/* FloatChat — a scrolling product page with the working explorer in its hero.
   Warm paper, navy ink, one copper accent; Inter with Instrument Serif italics.
   Chart colours live in theme.py. */
:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --paper-2: #efebe3;
  --ink: #0f1e2e;
  --ink-2: #3c4a59;
  --muted: #6b7785;
  --line: rgba(15, 30, 46, 0.10);
  --line-strong: rgba(15, 30, 46, 0.18);
  --copper: #b5651d;
  --copper-ink: #8a4e14;
  --copper-grad: linear-gradient(135deg, #d38a3d 0%, #b5651d 55%, #9c5518 100%);
  --green: #0f8a5f;
  --red: #b8402a;
  --raspberry: #c2416b;
  --ocean: #dde9ef;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

/* ── Icons (CSS masks, 1.5 px strokes) ───────────────── */
.icon {
  display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E"); }
.icon-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.1' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.1' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.1' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.icon-sparkle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3.5l1.8 4.9 4.9 1.8-4.9 1.8L11 16.9l-1.8-4.9-4.9-1.8 4.9-1.8z'/%3E%3Cpath d='M18.5 15.5v5M16 18h5'/%3E%3C/svg%3E"); }
.icon-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15.5' r='4'/%3E%3Cpath d='M11 12.5l8.5-8.5M16.5 7l2.5 2.5M14 9.5l2 2'/%3E%3C/svg%3E"); }
.icon-send { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5.5 11.5L12 5l6.5 6.5'/%3E%3C/svg%3E"); }
.icon-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E"); }
.icon-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5v5.2M12 16.3h.01'/%3E%3C/svg%3E"); }
.icon-chevron { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6l6 6-6 6'/%3E%3C/svg%3E"); }
.icon-doc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3.5H7a1.5 1.5 0 0 0-1.5 1.5v14A1.5 1.5 0 0 0 7 20.5h10a1.5 1.5 0 0 0 1.5-1.5V8z'/%3E%3Cpath d='M14 3.5V8h4.5M9 12.5h6M9 16h6'/%3E%3C/svg%3E"); }

/* ── Page ─────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input { font: inherit; color: inherit; }
a { color: var(--copper-ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.arrow { display: inline-block; margin-left: 8px; transition: transform 0.3s var(--ease); }
a:hover > .arrow, button:hover > .arrow { transform: translateX(3px); }

._dash-loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 0; background: var(--paper); }
._dash-loading::after { content: ""; width: 120px; height: 2px; border-radius: 2px; background: var(--line);
  box-shadow: inset 40px 0 0 var(--copper); animation: load-sweep 1.2s var(--ease) infinite; }

/* ── Navigation ───────────────────────────────────────── */
.topnav {
  position: sticky; top: 14px; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  width: min(1080px, calc(100% - 32px)); margin: 14px auto 0; padding: 8px 8px 8px 22px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--line); box-shadow: 0 10px 30px -18px rgba(15, 30, 46, 0.35);
}
.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.nav-links { display: flex; gap: 26px; margin: 0 auto; }
.nav-link { position: relative; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; padding: 6px 0; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--copper); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn-copper, .btn-primary {
  color: #fff; background: var(--copper-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 18px -10px rgba(138, 78, 20, 0.7);
}
.btn-copper:hover:not(:disabled), .btn-primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 24px -10px rgba(138, 78, 20, 0.8); }
.btn-white { color: var(--ink); background: #fff; border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(15, 30, 46, 0.06); }
.btn-white:hover:not(:disabled) { border-color: rgba(15, 30, 46, 0.32); }
.btn-soft { color: var(--ink); background: rgba(15, 30, 46, 0.06); }
.btn-soft:hover:not(:disabled) { background: rgba(15, 30, 46, 0.1); }
.btn-ghost { color: var(--ink-2); background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: rgba(15, 30, 46, 0.32); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-icon { width: 38px; height: 38px; padding: 0; }

/* ── Hero ─────────────────────────────────────────────── */
.hero { max-width: 900px; margin: 0 auto; padding: 72px 24px 56px; text-align: center; }
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; margin-bottom: 28px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(15, 30, 46, 0.05);
}
.tag { padding: 3px 10px; border-radius: 999px; background: var(--copper-grad); color: #fff; font-size: 12px; font-weight: 600; }
.hero-title { margin: 0; font-size: clamp(40px, 6.2vw, 72px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 700; color: var(--ink); }
.hero-title em, .section-title em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--copper-ink);
}
.hero-sub { margin: 22px 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 28px); color: var(--copper-ink); }
.hero-body { max-width: 62ch; margin: 18px auto 0; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font-size: 13px; color: var(--muted); }
.hero-meta span + span::before { content: "·"; margin-right: 18px; color: var(--line-strong); }

/* ── Explorer frame ───────────────────────────────────── */
.explore { position: relative; width: min(1280px, calc(100% - 48px)); margin: 8px auto 0; }
.bezel {
  padding: 18px; border-radius: 30px;
  background: linear-gradient(160deg, #1a3049 0%, #0f1e2e 55%, #0b1622 100%);
  box-shadow: 0 40px 80px -40px rgba(15, 30, 46, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.window { overflow: hidden; border-radius: 16px; background: #fff; }
.window-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  height: 48px; padding: 0 12px 0 16px; background: #f6f4ef; border-bottom: 1px solid var(--line);
}
.window-dots { display: flex; gap: 7px; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-dots span:nth-child(2) { background: #febc2e; }
.window-dots span:nth-child(3) { background: #28c840; }
.window-title { font-size: 13px; font-weight: 500; color: var(--muted); }
.period { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.period label { font-size: 12.5px; color: var(--muted); }
.period .dash-dropdown { width: 190px; }
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; height: 740px; }
.ws-left { display: flex; flex-direction: column; min-height: 0; background: #fbfaf7; border-right: 1px solid var(--line); }
.ws-map { position: relative; min-width: 0; background: var(--ocean); }
.ws-right { display: flex; flex-direction: column; min-height: 0; background: #fff; border-left: 1px solid var(--line); }
.map-graph { position: absolute; inset: 0; }
.map-graph .js-plotly-plot { position: absolute; inset: 0; }
.ws-map .maplibregl-ctrl-attrib { background: rgba(255, 255, 255, 0.85) !important; color: var(--muted) !important; font-size: 11px; }
.ws-map .maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }

/* Floating cards that overlap the frame, as in the hero of a product page */
.float-card {
  position: absolute; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 30, 46, 0.05), 0 22px 44px -22px rgba(15, 30, 46, 0.4);
}
.explore { padding-bottom: 44px; }
/* The totals strip overlaps only the frame's dark bottom edge, never the explorer's content. */
.kpi-card {
  left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: baseline; gap: 26px;
  padding: 12px 26px; border-radius: 999px; white-space: nowrap;
}
.kpi { display: flex; align-items: baseline; gap: 7px; }
.kpi + .kpi { padding-left: 26px; border-left: 1px solid var(--line); }
.kpi:first-child .kpi-value { font-size: 26px; }
.kpi-value { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi.skeleton { width: 150px; height: 22px; border-radius: 6px; }
.legend-card { right: 12px; bottom: 30px; z-index: 3; padding: 12px 14px; width: 188px; font-size: 12px; color: var(--ink-2);
  border-radius: 14px; box-shadow: 0 12px 28px -18px rgba(15, 30, 46, 0.45); }
.legend-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.legend-ramp { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #123a63 0%, #2f7f8f 35%, #e0a43a 70%, #b8402a 100%); }
.legend-ticks { display: flex; justify-content: space-between; margin: 4px 0 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.key { flex: none; display: inline-block; }
.key-track { width: 18px; height: 0; border-top: 1px solid rgba(15, 30, 46, 0.4); }
.key-selected { width: 18px; height: 0; border-top: 3px solid var(--ink); }
.key-highlight { width: 9px; height: 9px; border-radius: 50%; background: var(--raspberry); }
.key-none { width: 9px; height: 9px; border-radius: 50%; background: #9aa5b1; }

/* Status and analysis over the map */
.statusbar {
  position: absolute; left: 14px; top: 14px; z-index: 3; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: calc(100% - 28px); padding: 7px 14px; border-radius: 999px; font-size: 12.5px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); box-shadow: 0 8px 20px -14px rgba(15, 30, 46, 0.5);
}
.status { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.hint { color: var(--muted); }
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.is-live, .is-on .status-dot { background: var(--green); }
.status-dot.is-live::after, .is-on .status-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: breathe 2.4s var(--ease) infinite;
}
.status-dot.is-error { background: var(--red); }
.highlight-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.highlight-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--raspberry); flex: none; }
.analysis {
  position: absolute; left: 14px; top: 58px; z-index: 4; width: min(560px, calc(100% - 28px)); max-height: calc(100% - 110px); overflow: auto;
  padding: 14px 16px 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 22px 44px -22px rgba(15, 30, 46, 0.45); animation: rise 0.5s var(--ease) both;
}
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analysis-message { margin: 8px 0 4px; color: var(--ink-2); line-height: 1.5; }
.analysis-message:empty { display: none; }

/* ── Explorer: left panel ─────────────────────────────── */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 12px 12px 0; padding: 3px; border-radius: 12px; background: rgba(15, 30, 46, 0.06); }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tab .icon { width: 14px; height: 14px; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 30, 46, 0.1), 0 0 0 1px var(--line); }
.tab.is-active .icon { color: var(--copper); }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px; gap: 10px; }
.pane.is-hidden { display: none; }
#pane-regions { overflow-y: auto; }

.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.key-row .input-wrap { flex: 1; }
.input-wrap > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.text-input {
  width: 100%; min-width: 0; padding: 9px 12px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line-strong); color: var(--ink); outline: none; font-size: 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.text-input.with-icon { padding-left: 36px; }
.text-input::placeholder { color: var(--muted); }
.text-input:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(181, 101, 29, 0.14); }
.list-caption { font-size: 12px; color: var(--muted); padding: 0 2px; }
.float-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px 6px; }
.float-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "wmo span" "meta meta"; gap: 1px 8px;
  width: 100%; padding: 9px 12px; text-align: left; cursor: pointer; background: transparent; border: 0; border-radius: 10px;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.float-item:hover { background: rgba(15, 30, 46, 0.04); }
.float-item.is-selected { background: #fff; box-shadow: 0 1px 2px rgba(15, 30, 46, 0.08), 0 0 0 1px var(--line), inset 3px 0 0 var(--copper); }
.float-wmo { grid-area: wmo; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.float-span { grid-area: span; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.float-meta { grid-area: meta; font-size: 12.5px; color: var(--ink-2); }

.skeleton { position: relative; overflow: hidden; background: rgba(15, 30, 46, 0.06); border-radius: 6px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent); animation: shimmer 1.5s var(--ease) infinite;
}
.skeleton-row { display: grid; gap: 7px; padding: 12px; }
.line-lg { height: 12px; width: 46%; }
.line-sm { height: 10px; width: 70%; }

.notice { display: grid; justify-items: start; gap: 6px; padding: 16px; border-radius: 14px; background: #faf8f4; border: 1px solid var(--line); }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(181, 101, 29, 0.1); color: var(--copper-ink); margin-bottom: 2px; }
.notice-icon .icon { width: 18px; height: 18px; }
.notice-title { font-weight: 600; color: var(--ink); }
.notice-body { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; max-width: 42ch; }
.notice.is-error .notice-icon { background: rgba(184, 64, 42, 0.1); color: var(--red); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field-help { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.field-help:empty { display: none; }
.region-actions { display: flex; gap: 8px; }
.region-actions .btn { flex: 1; }

.ai-settings { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-settings summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); list-style: none; }
.ai-settings summary::-webkit-details-marker { display: none; }
.ai-settings .chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.3s var(--ease); }
.ai-settings[open] .chevron { transform: rotate(90deg); }
.ai-status { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--muted); }
.ai-status.is-on { color: var(--green); }
.settings-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 12px 12px; }
.key-row { display: flex; gap: 6px; }
.key-row .btn { border-radius: 10px; }

.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; word-break: break-word; animation: rise 0.4s var(--ease) both; }
.msg-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg-ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink); }
.msg-ai p { margin: 0 0 8px; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { margin: 4px 0 8px; padding-left: 20px; }
.msg-ai code { font-size: 12px; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); font-size: 12px; cursor: pointer; transition: border-color 0.2s var(--ease), color 0.2s var(--ease); }
.chip:hover { border-color: var(--copper); color: var(--ink); }
.typing { display: inline-flex; gap: 5px; padding: 11px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bob 1.1s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
.composer { display: flex; gap: 8px; padding: 5px; border-radius: 14px; background: #fff; border: 1px solid var(--line-strong); }
.composer .text-input { border: 0; box-shadow: none; }
.composer:focus-within { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(181, 101, 29, 0.14); }

/* Dropdowns (react-select) */
.dd .Select-control { background: #fff !important; border: 1px solid var(--line-strong) !important; border-radius: 10px !important; height: 36px; box-shadow: none !important; cursor: pointer; }
.dd .Select-control:hover { border-color: rgba(15, 30, 46, 0.32) !important; }
.dd .Select-value, .dd .Select-placeholder { line-height: 34px !important; }
.dd .Select-value-label { color: var(--ink) !important; font-size: 14px; }
.dd .Select-placeholder { color: var(--muted) !important; font-size: 14px; }
.dd .Select-menu-outer { background: #fff !important; border: 1px solid var(--line-strong) !important; border-radius: 10px !important; margin-top: 4px; overflow: hidden; z-index: 30; box-shadow: 0 18px 36px -18px rgba(15, 30, 46, 0.4) !important; }
.dd .VirtualizedSelectOption { color: var(--ink-2); padding: 0 12px; font-size: 14px; }
.dd .VirtualizedSelectFocusedOption { background: var(--paper); color: var(--ink); }
.dd .VirtualizedSelectSelectedOption { color: var(--copper-ink); font-weight: 600; }
.dd .Select--multi .Select-value { background: var(--paper-2) !important; border-color: var(--line) !important; color: var(--ink) !important; line-height: 1.4 !important; margin-top: 5px; }

/* ── Explorer: inspector ──────────────────────────────── */
.panel-head { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.badge { padding: 2px 9px; border-radius: 999px; background: rgba(181, 101, 29, 0.1); color: var(--copper-ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-error { display: inline-flex; align-items: center; gap: 6px; color: var(--red); }
.inspector-loading { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.inspector-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.inspector-detail { display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats:empty { display: none; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.chart-block { border-top: 1px solid var(--line); padding-top: 14px; }
.chart-block:first-child { border-top: 0; padding-top: 0; }
.chart-title { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.progress-line { position: absolute; top: 0; left: 18px; right: 18px; height: 2px; overflow: hidden; border-radius: 2px; background: var(--line); }
.progress-line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--copper); animation: sweep 1.1s var(--ease) infinite; }

/* ── Sections ─────────────────────────────────────────── */
.section { padding: 104px 24px; }
.section > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section-tint { background: var(--paper-2); }
.section-head { margin-bottom: 44px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); }
.section-title { margin: 14px 0 0; max-width: 18ch; font-size: clamp(32px, 4.2vw, 50px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; color: var(--ink); }
.lede { margin: 18px 0 0; max-width: 58ch; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.fine-print { margin-top: 14px; font-size: 13px; color: var(--muted); }

.numbers-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 48px -32px rgba(15, 30, 46, 0.3); }
.num-cell { padding: 26px 28px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.num-cell:nth-child(3n) { border-right: 0; }
.num-cell:nth-last-child(-n+3) { border-bottom: 0; }
.skeleton-cell { grid-column: 1 / -1; height: 280px; }
.num { display: flex; align-items: baseline; gap: 4px; }
.num-value { font-size: clamp(32px, 3.4vw, 44px); font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.num-unit { font-size: 17px; font-weight: 500; color: var(--muted); }
.num-label { margin-top: 6px; font-size: 14px; color: var(--ink-2); max-width: 28ch; }
.num-ink .num-value { color: var(--ink); }
.num-blue .num-value { color: #2a6fbd; }
.num-copper .num-value { color: var(--copper); }
.num-green .num-value { color: var(--green); }
.num-red .num-value { color: var(--red); }

.step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; padding: 36px 0; }
.step-flip .step-text { order: 2; }
.step-label { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.step-num { color: var(--copper); font-variant-numeric: tabular-nums; }
.step-title { margin: 12px 0 0; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; color: var(--ink); }
.step-body { margin: 14px 0 22px; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); max-width: 52ch; }
.figure-card { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 48px -32px rgba(15, 30, 46, 0.35); }
.figure-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-soft { padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.questions { display: grid; gap: 8px; }
.question {
  text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper);
  font-size: 15px; color: var(--ink); cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.question::before { content: "“"; margin-right: 4px; font-family: var(--serif); font-size: 20px; color: var(--copper); }
.question:hover { border-color: var(--copper); transform: translateX(3px); }

.report-grid { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 18px; }
.report-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 48px -32px rgba(15, 30, 46, 0.3); }
.card-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.card-body { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.report-contents { background: transparent; box-shadow: none; }
.contents-list { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; color: var(--ink-2); }
.contents-list li::marker { color: var(--copper); font-weight: 600; }
.report-loading { margin-top: 16px; }
.report-progress { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.report-progress .progress-line { top: auto; bottom: 0; left: 0; right: 0; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.method-card { padding: 22px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.method-num { font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1; color: var(--copper-ink); margin-bottom: 14px; }
.limits-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 760px; }
.limits-list li { position: relative; padding-left: 26px; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.limits-list li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 12px; height: 2px; background: var(--copper); }

.footer { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 56px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.footer-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 90ch; }

/* Scroll reveal (page.js adds .js-reveal to <html> so nothing stays hidden without JS) */
.js-reveal .reveal-me { opacity: 0; transform: translateY(14px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js-reveal .reveal-me.is-in { opacity: 1; transform: none; }

/* ── Motion ───────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes breathe { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes load-sweep { 0% { box-shadow: inset 0 0 0 var(--copper); } 100% { box-shadow: inset 120px 0 0 var(--copper); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .ws-map { order: 1; height: 440px; }
  .ws-left { order: 2; height: 520px; border-right: 0; border-top: 1px solid var(--line); }
  .ws-right { order: 3; border-left: 0; border-top: 1px solid var(--line); }
  .inspector-body { overflow: visible; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .report-contents { grid-column: 1 / -1; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 1fr; gap: 24px; }
  .step-flip .step-text { order: 0; }
}
@media (max-width: 760px) {
  .topnav { padding-left: 16px; gap: 12px; }
  .nav-links { display: none; }
  .topnav .btn { margin-left: auto; }
  .hero { padding: 48px 18px 36px; }
  .hero-body { font-size: 16.5px; }
  .explore { width: calc(100% - 20px); }
  .bezel { padding: 8px; border-radius: 20px; }
  .window { border-radius: 12px; }
  .window-bar { grid-template-columns: auto 1fr; height: auto; padding: 8px 10px; }
  .window-title { display: none; }
  .period .dash-dropdown { width: 170px; }
  .ws-map { height: 380px; }
  .section { padding: 72px 18px; }
  .numbers-grid { grid-template-columns: 1fr 1fr; }
  .num-cell { padding: 18px; border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; }
  .num-cell:nth-child(2n) { border-right: 0 !important; }
  .report-grid, .method-grid { grid-template-columns: 1fr; }
  .hint { display: none; }
  .legend-card .legend-row { display: none; }
  .legend-card { width: 150px; }
  .kpi-card { gap: 14px; padding: 10px 16px; }
  .kpi + .kpi { padding-left: 14px; }
  .kpi:first-child .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 12px; }
}
