/* Shared across index.html (landing page) and dashboard.html (per-border detail). */

:root {
  color-scheme: light dark;
  --bg: #f4f8fd;
  --surface: #ffffff;
  --surface-hover: #eef4fc;
  --border: #d6e2f2;
  --text: #16233b;
  --text-muted: #64758e;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --shadow: rgba(29, 78, 216, 0.14);
  /* Header/footer "chrome": a light blue tint in the same family as --accent,
     rather than plain white/--surface or a stark dark navy -- follows the
     light/dark theme like everything else. */
  --chrome-bg: #e4edfb;
  --chrome-border: #c7d9f5;
}

/* Follow the OS preference unless the user has explicitly chosen a theme
   (data-theme, set by theme.js and persisted in localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220;
    --surface: #101b2f;
    --surface-hover: #15233c;
    --border: #223452;
    --text: #e7edf9;
    --text-muted: #8fa1c2;
    --accent: #60a5fa;
    --accent-strong: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.16);
    --shadow: rgba(0, 0, 0, 0.45);
    --chrome-bg: #17233c;
    --chrome-border: #2c3f61;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220;
  --surface: #101b2f;
  --surface-hover: #15233c;
  --border: #223452;
  --text: #e7edf9;
  --text-muted: #8fa1c2;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --shadow: rgba(0, 0, 0, 0.45);
  --chrome-bg: #17233c;
  --chrome-border: #2c3f61;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 24px;
  max-width: 1100px;
  margin-inline: auto;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s, color 0.2s;
}
a { color: var(--accent); }

.subtitle { color: var(--text-muted); margin-top: 0; margin-bottom: 24px; font-size: 0.9rem; }
.updated { color: var(--text-muted); font-size: 0.8rem; }
.note { color: var(--text-muted); font-size: 0.8rem; margin-top: 24px; }

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--surface);
  transition: background-color 0.2s, border-color 0.2s;
}
.card .value { font-size: 2rem; font-weight: 600; }
.card .label { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; }
.pill.entry { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.pill.exit { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
/* De-emphasized, not hidden -- a report past the "still current" threshold
   but not yet old enough to be dropped entirely (see community_reports.py). */
.pill.stale { opacity: 0.55; filter: grayscale(40%); }
.pill .pill-age { font-weight: 400; opacity: 0.8; }

.comparison-note { margin-top: 10px; font-weight: 600; font-size: 0.85rem; color: var(--text); }
.independence-note { margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }

.forecast-row { display: flex; gap: 10px; flex-wrap: wrap; }
.forecast-point {
  flex: 1 1 100px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  background: var(--surface-hover); text-align: center;
}
.forecast-point .forecast-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.forecast-point .forecast-range { font-size: 1.1rem; font-weight: 700; margin: 4px 0; }
.forecast-point .forecast-confidence { font-size: 0.72rem; color: var(--text-muted); }
.forecast-point.low-confidence .forecast-range { color: var(--text-muted); }

/* Fixed top-right theme toggle, shared by every page. */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 10;
  width: 42px; height: 42px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.15rem; cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.2s;
}
.theme-toggle:hover { transform: scale(1.06); background: var(--surface-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Nav bar: shared header on every page. Light blue-tinted "chrome",
   in the same tone family as the accent color, distinct from --surface. --- */
.navbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--chrome-bg); color: var(--text);
  border-bottom: 1px solid var(--chrome-border);
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 1px 6px var(--shadow);
}
.navbar .brand { font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; color: var(--accent-strong); text-decoration: none; }
.navbar .tabs { display: flex; gap: 22px; flex-wrap: wrap; }
.navbar .tab {
  border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted);
  padding: 6px 2px; font: inherit; font-size: 0.92rem; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.navbar .tab:hover { color: var(--accent); }
.navbar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.navbar .theme-toggle { position: static; width: 38px; height: 38px; font-size: 1rem; box-shadow: none; }

/* --- Footer: shared, full-bleed, on every page. Same light blue-tinted
   chrome as the navbar, so the page reads as a bookended frame. --- */
.site-footer {
  background: var(--chrome-bg); color: var(--text-muted); border-top: 1px solid var(--chrome-border);
  margin-top: 40px; padding: 32px 40px 20px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px;
  max-width: 1100px; margin: 0 auto;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-weight: 800; font-size: 1.05rem; color: var(--accent-strong); margin-bottom: 6px; }
.footer-col p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.footer-col h4 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.footer-col a { display: block; color: var(--text); text-decoration: none; font-size: 0.9rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1100px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--chrome-border);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 0.8rem;
}
