/* =========================================================
   Glacier dashboard: theme, base styles, buttons, legal pages.
   The 3D page's own layout is in assets3d/style3d.css
   Theme is set as data-theme="dark|light" on <html>.
   ========================================================= */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --fg: #e6e6e6;
  --muted: #8f8f8f;
  --line: #262626;
  --hover: rgba(255, 255, 255, 0.07);
  --accent: #38bdf8;

  /* Dash 4 component tokens */
  --Dash-Fill-Inverse-Strong: #0a0a0a;
  --Dash-Fill-Interactive-Strong: var(--accent);
  --Dash-Fill-Interactive-Weak: rgba(255, 255, 255, 0.04);
  --Dash-Fill-Primary-Hover: rgba(255, 255, 255, 0.06);
  --Dash-Fill-Primary-Active: rgba(255, 255, 255, 0.1);
  --Dash-Fill-Disabled: rgba(255, 255, 255, 0.08);
  --Dash-Stroke-Strong: #3a3a3a;
  --Dash-Stroke-Weak: #262626;
  --Dash-Text-Strong: #fff;
  --Dash-Text-Primary: #e6e6e6;
  --Dash-Text-Weak: #a3a3a3;
  --Dash-Text-Disabled: #6b6b6b;
  --Dash-Tooltip-Background-Color: #1a1a1a;
  --Dash-Tooltip-Border-Color: #3a3a3a;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --hover: rgba(0, 0, 0, 0.05);
  --accent: #0369a1;

  --Dash-Fill-Inverse-Strong: #fff;
  --Dash-Fill-Interactive-Strong: var(--accent);
  --Dash-Fill-Interactive-Weak: rgba(0, 0, 0, 0.03);
  --Dash-Fill-Primary-Hover: rgba(0, 0, 0, 0.04);
  --Dash-Fill-Primary-Active: rgba(0, 0, 0, 0.08);
  --Dash-Fill-Disabled: rgba(0, 0, 0, 0.06);
  --Dash-Stroke-Strong: #c8c8c8;
  --Dash-Stroke-Weak: #e5e5e5;
  --Dash-Text-Strong: #000;
  --Dash-Text-Primary: #1a1a1a;
  --Dash-Text-Weak: #6b6b6b;
  --Dash-Text-Disabled: #a3a3a3;
  --Dash-Tooltip-Background-Color: #fff;
  --Dash-Tooltip-Border-Color: #c8c8c8;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

h1, h2, p { margin: 0; }

/* ---------- Buttons, slider ---------- */
.btn {
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--Dash-Stroke-Strong);
  border-radius: 6px;
  height: 32px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }

.year .dash-slider-container, .year > div { margin: 0; }

/* phones and short windows */
@media (max-height: 600px), (orientation: portrait) and (max-width: 719px) {
  .btn { height: 28px; padding: 0 8px; font-size: 12px; }
}

/* ---------- Legal links and pages (legal.py) ---------- */
.legal-links { display: flex; flex-wrap: wrap; gap: 2px 12px; width: 100%; font-size: 11px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--fg); text-decoration: underline; }

body.legal-page { overflow: auto; }
.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.55; }
.legal h1 { font-size: 22px; margin: 16px 0 8px; }
.legal h2 { font-size: 15px; margin: 24px 0 6px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal a { color: var(--accent); }
.legal-top { display: flex; justify-content: space-between; gap: 12px; }
.legal-note { color: var(--muted); font-size: 13px; }
.legal .legal-links { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
