:root {
  --bg: #ffffff;
  --panel: #f4f4f4;
  --text: #1d1f37;
  --muted: #6e7387;
  /* --accent: #7c9cff; */
  /* --accent-2: #b58bff; */
  /* --ring: rgba(124, 156, 255, 0.35); */
  --radius: 16px;
  --shadow: 0 10px 25px rgba(177, 177, 177, 0.35);
  --gap: 1.25rem;
  --maxw: 1100px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto,
    'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  letter-spacing: 0.2px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

header {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0;
}

.subtitle {
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--gap);
  margin: 1.25rem 0 1.75rem;
}

.team {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.9rem;
  color: var(--text);
}

.subtitle {
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--gap);
  margin: 1.25rem 0 1.75rem;
}

.team {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
  margin-top: 1.25rem;
  margin-bottom: 3rem;
}

.panel {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 320px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.3rem;
  font-weight: 600;
  color: var(----text);
}

.panel-subtitle {
  padding: 0 1rem 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  border-bottom: 1px solid rgb(244, 244, 244);
}

.panel-body {
  padding: 0.5rem 0.75rem 1rem;
}

.chart {
  width: 100%;
  height: 340px;
}

writeup {
  margin-top: 5rem;
  color: var(--text);
  text-align: left;
}

footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.8;
}

footer a:link {
  color: var(--muted);
}

footer a:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .panels {
    grid-template-columns: 1fr;
  }

  input[type='range'] {
    width: 100%;
  }

  .meta {
    grid-template-columns: 1fr;
  }
}

/* tooltip styling */
#tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 13px;
  color: #1d1f37;
  transition: opacity 0.08s ease-out;
}

#tooltip .tt-month {
  font-weight: 600;
  margin-bottom: 2px;
}

#tooltip .tt-value {
  font-size: 12px;
  opacity: 0.9;
}

/* stats styling */
#statsLeft .stats-wrap,
#statsRight .stats-wrap {
  display: grid;
  gap: 0.5rem;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  justify-content: space-around;
}

.stats-title {
  margin-bottom: 0.25rem;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0.35rem 1rem;
}

.stats-grid .k {
  display: inline-block;
  opacity: 0.8;
  margin-right: 0.4rem;
}

.stats-grid .v {
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 18px;
  padding: 0 0 6px 6px;
  font-size: 12px;
  align-items: center;
  color: #555;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}


/* annotations styling */
/* .annotation { pointer-events: none; }          don’t block bar hover */
/* .annotation rect { */
  /* fill: rgba(255,255,255,0.55);                translucent; bands still show */
  /* stroke: rgba(0,0,0,0.12); */
  /* rx: 10; */
  /* filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12)); */
/* } */
/* .annotation text { */
  /* font-size: 13px; */
  /* fill: #1d1f37; */
/* } */

.annotation text,
.annotation .annotation-text { font-size: 13px; fill: #1d1f37; }
.annotation rect, .annotation text { pointer-events: none; }
