html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #f5f5f7;
  font-family: 'Inter', Arial, sans-serif;
}
body {
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

#centered-app {
  width: 98vw;
  max-width: 1800px;
  min-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#main-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 15fr 50fr 25fr;
  grid-template-rows: 10vh 70vh 1vh 8vh;
  align-items: start;
  min-height: 100vh;
  margin: 0 auto;
  column-gap: 1vw;
}

/* -------- FILTER BOX -------- */
#filter-box {
  grid-column: 1 / 2;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  height: 90vh;
  margin-top: 10vh;
  width: 100%;
}
.filter-section {
  background: #fafcff;
  border: 1px solid #ccd8e2;
  border-radius: 13px;
  box-shadow: 0 2px 7px #dde2ee28;
  width: 100%;
  height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1.2em 1.1em;
  gap: 1.5em;
  overflow: hidden;
  box-sizing: border-box;
}
.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-bottom: 0.5em;
}
.filter-dropdown {
  width: 100%;
  padding: 0.18em 0.23em;
  border-radius: 6px;
  border: 1px solid #c5ced8;
  font-size: 0.96em;
  background: #f8fafd;
}
.btn-clear {
  margin-top: 0.4em;
  background: #e3f0fb;
  border: 1px solid #6ca0dc;
  color: #225f9a;
  border-radius: 7px;
  padding: 0.22em 0.9em;
  font-size: 0.97em;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-clear:hover { background: #cbe2f6; }
.tag-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.14em 0.7em;
  margin-bottom: 0.5em;
}
.tag-checkbox {
  font-size: 0.8em;
  cursor: pointer;
  align-items: center;
  display: flex;
  height: 2.1em;
}

/* -------- CARD BOX -------- */
#card-box {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 70vh;
  margin-top: 10vh;
}
#cards-scroll {
  width: 100%;
  height: 70vh;
  border-radius: 11px;
  box-shadow: 0 2px 7px #dde2ee20;
  padding: 1em 1.1em 1.2em 1.1em;
  overflow-y: scroll;
  box-sizing: border-box;
}
#cards {
  width: 100%;
}
.cc-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px #0002;
  margin-bottom: 1.05em;
  padding: 0.95em 1em;
  border-left: 4px solid transparent;
  transition: border-color 0.3s;
  font-size: 0.98em;
}
.cc-card.is-highlighted {
  border-left: 4px solid #225f9a;
  background: #e3f1fa;
}
.cc-card__header {
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.cc-card__summary {
  margin-bottom: 0.5rem;
  opacity: 1;
  transition: opacity 0.12s;
  white-space: pre-line;
  text-align: justify;
}
.cc-card__summary.is-swapping {
  opacity: 0;
}
.cc-card__moreinfo {
  transition: max-height 0.3s ease;
  overflow: hidden;
  background: #f8f8f8;
  padding: 0.5em 1em;
  border-top: 1px solid #eee;
}
.cc-card__visit-title {
  font-weight: bold;
  margin-bottom: 0.3em;
  color: #294D6E;
}

/* -------- TIMELINE BOX -------- */
#timeline-box {
  grid-column: 3 / 4;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 90vh;
  margin-top: 10vh;
  width: 100%;
}
.timeline-section {
  width: 100%;
  min-height: 70vh;
  max-height: 80vh;
  background: #fcfcfc;
  border: 1px solid #ccd8e2;
  border-radius: 13px;
  box-shadow: 0 2px 7px #dde2ee24;
  padding: 1.3em 1.2em;
  overflow-y: scroll;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  height: 80vh;
}
#timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.cc-timeline-node {
  display: flex; align-items: center; gap: 0.5em;
  cursor: pointer;
  border-radius: 7px;
  padding: 0.22em 0.3em;
  transition: background 0.15s;
  position: relative;
  font-size: 0.97em;
}
.cc-timeline-node:hover, .cc-timeline-node.is-active { background: #e3f0fb; }
.cc-timeline-date { font-weight: 600; font-size: 0.96em; min-width: 70px; color: #174272; }
.cc-timeline-title { font-size: 0.96em; color: #294D6E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95%; }
.cc-timeline-dot {
  width: 11px; height: 11px; background: #6ca0dc;
  border-radius: 50%; margin-right: 7px; flex-shrink: 0; border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e3f0fb;
}

/* -------- DETAIL SELECTOR -------- */
#detail-selector-bar {
  box-sizing: border-box; /* <-- Add this */
  grid-column: 2 / 3;    /* Exactly same as card-box */
  grid-row: 4 / 5;       /* This is now the 4th row */
  width: 100%;
  height: 9vh;
  background: #f6fafd;
  border-radius: 13px;
  border: 1px solid #ccd8e2;
  box-shadow: 0 2px 7px #dde2ee28;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2em;
  padding: 1em 2em;
  min-width: 320px;
  max-width: 100%;
  margin: 0 auto;
  /* Remove position: absolute, left/right, and bottom */
}
.detail-slider-label {
  font-weight: 600;
  margin-right: 1.1em;
  min-width: 110px;
}
.slider-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  margin: 0 1.2em;
}
#detail-slider {
  accent-color: #225f9a;
  width: 210px;
  margin-bottom: 0.2em;
}
.slider-labels {
  width: 210px;
  display: flex;
  justify-content: space-between;
  font-size: 0.95em;
  color: #444;
  user-select: none;
}
#detail-label {
  font-weight: bold;
  margin-left: 1em;
  min-width: 170px;
  display: inline-block;
}

/* Force scrollbars on all main columns for visual symmetry */
#cards-scroll, .timeline-section {
  scrollbar-width: thin;
  overflow-y: scroll;
}

.cc-moreinfo-link {
  color: #294D6E;
  text-decoration: underline;
  cursor: pointer;
}

.cc-moreinfo-link:hover,
.cc-moreinfo-link:focus {
  color: #4177b4;
  text-decoration: underline;
}

@media (max-width: 900px) {
  #centered-app { width: 99vw; min-width: unset; }
  #main-grid { grid-template-columns: 1fr; }
  #filter-box, #timeline-box { display: none; }
  #card-box { width: 100vw; }
  #detail-selector-bar { left: 2vw; width: 96vw; }
}


