/* FireSync UI: editorial / scientific style. Developed with SI (Claude, Anthropic) assistance. See AI_USAGE.md. License: Apache-2.0 */
:root {
  --bg: #0e0d0b;
  --surface: #151411;
  --surface-2: #1c1a16;
  --rule: #2a2823;
  --rule-2: #3b3832;
  --text: #ece8df;
  --muted: #a49f94;
  --faint: #716c62;
  --ember: #e8590c;
  --ember-2: #f3965a;
  --sky: #82a9d4;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ember-2); text-underline-offset: 2px; }
::selection { background: var(--ember); color: #fff; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------------------------------------------------------------- intro */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .6s ease, visibility .6s ease; }
.intro.done { opacity: 0; visibility: hidden; }
.intro-inner { width: min(420px, 80vw); }
.intro-logo { font-family: var(--serif); font-size: 44px; font-weight: 600; letter-spacing: -0.01em; }
.intro-logo span { color: var(--ember); }
.intro-tag { color: var(--muted); margin-top: 4px; font-size: 15px; }
.intro-bar { height: 1px; margin: 26px 0 10px; background: var(--rule-2); overflow: hidden; }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--text); transition: width .35s ease; }
.intro-status { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- masthead */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h, 58px) + 14px); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; height: 58px; padding: 0 22px; background: var(--bg); border-bottom: 1px solid var(--rule); }
/* Reading progress: the rule under the bar fills with the fire ramp as the page scrolls. */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, #932667, #dd513a 45%, #fca50a); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: none; color: var(--text); text-decoration: none; }
/* Twelve cells, one per month: the calendar in miniature. They light up once on load and again on hover. */
.mark { display: grid; grid-template-columns: repeat(4, 5px); gap: 1.5px; flex: none; }
.mark i { width: 5px; height: 5px; background: var(--c); animation: mark-in .8s both; animation-delay: calc(var(--i) * 55ms + .35s); }
.mark i:nth-child(1) { --i: 0; --c: #1f0c48; } .mark i:nth-child(2) { --i: 1; --c: #420a68; } .mark i:nth-child(3) { --i: 2; --c: #6a176e; } .mark i:nth-child(4) { --i: 3; --c: #932667; }
.mark i:nth-child(5) { --i: 4; --c: #bc3754; } .mark i:nth-child(6) { --i: 5; --c: #dd513a; } .mark i:nth-child(7) { --i: 6; --c: #f37819; } .mark i:nth-child(8) { --i: 7; --c: #fca50a; }
.mark i:nth-child(9) { --i: 8; --c: #f6d746; } .mark i:nth-child(10) { --i: 9; --c: #f37819; } .mark i:nth-child(11) { --i: 10; --c: #932667; } .mark i:nth-child(12) { --i: 11; --c: #420a68; }
@keyframes mark-in { 0% { opacity: 0; transform: scale(.2); background: #fcffa4; } 55% { opacity: 1; transform: scale(1.2); } 100% { opacity: 1; transform: none; background: var(--c); } }
@keyframes mark-wave { 0%, 100% { background: var(--c); transform: none; } 45% { background: #fcffa4; transform: scale(1.3); } }
.brand:hover .mark i, .brand:focus-visible .mark i { animation: mark-wave .7s both; animation-delay: calc(var(--i) * 38ms); }
.brand-txt { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand h1 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.brand h1 span { color: var(--ember); }
.brand p { margin: 0; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s ease, transform .3s ease; }
.topbar.scrolled .brand p { opacity: 0; transform: translateY(3px); }
.nav { position: relative; display: flex; align-self: stretch; margin-right: auto; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 0 11px; font-size: 13px; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav a i { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--faint); transition: color .2s; }
.nav a:hover, .nav a.on { color: var(--text); }
.nav a:hover i, .nav a.on i { color: var(--ember-2); }
/* One line that slides under the section being read, and follows the pointer while it is over the menu. */
.nav-ink { position: absolute; left: 0; bottom: -1px; z-index: 1; height: 2px; width: 0; background: var(--text); opacity: 0; pointer-events: none; transition: transform .38s cubic-bezier(.3, 1, .3, 1), width .38s cubic-bezier(.3, 1, .3, 1), opacity .2s; }
.ready .nav a { animation: nav-in .5s both; }
.ready .nav a:nth-child(2) { animation-delay: 50ms; } .ready .nav a:nth-child(3) { animation-delay: 100ms; } .ready .nav a:nth-child(4) { animation-delay: 150ms; } .ready .nav a:nth-child(5) { animation-delay: 200ms; }
@keyframes nav-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fresh { display: inline-flex; align-items: center; gap: 7px; margin-right: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.fresh i { width: 6px; height: 6px; border-radius: 50%; background: #f37819; animation: live 2.4s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(243, 120, 25, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(243, 120, 25, 0); } }
@media (max-width: 1560px) { .brand p { display: none; } }
@media (max-width: 1330px) { .fresh { display: none; } }
@media (max-width: 1180px) { .nav { display: none; } }
@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 9px 14px 10px; }
  .top-actions { flex: 1 1 100%; margin-left: 0; }
  .top-actions .search { flex: 1 1 auto; min-width: 0; }
  .top-actions .search input, .top-actions .search input:focus { width: 100%; }
  .search kbd { display: none; }
}

.search { position: relative; }
.search input { width: 206px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 3px; padding: 7px 10px 7px 30px; font-size: 13px; outline: none; transition: width .32s cubic-bezier(.3, 1, .3, 1), border-color .15s; }
.search input:focus { width: 290px; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0 5px; font-family: var(--mono); font-size: 10px; line-height: 16px; color: var(--faint); border: 1px solid var(--rule-2); border-radius: 3px; pointer-events: none; transition: opacity .15s; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { opacity: 0; }
.search input:focus { border-color: var(--text); }
.search svg { position: absolute; left: 9px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--faint); }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow-y: auto; z-index: 40; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 3px; display: none; }
.search-results.open { display: block; }
.search-results button { display: flex; width: 100%; justify-content: space-between; gap: 8px; padding: 7px 10px; background: none; border: 0; text-align: left; cursor: pointer; font-size: 13px; }
.search-results button:hover, .search-results button.active { background: var(--surface-2); }
.search-results small { color: var(--faint); font-family: var(--mono); font-size: 11px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 3px; font-size: 13px; cursor: pointer; background: transparent; border: 1px solid var(--rule-2); color: var(--text); transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--muted); background: var(--surface); }
.btn svg { width: 14px; height: 14px; color: var(--muted); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary svg { color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: none; border-color: var(--rule-2); }
select.btn { padding-right: 8px; background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 5px 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button:not(.on):hover { color: var(--text); }

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; max-width: 1760px; margin: 0 auto; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

.globe-pane { position: sticky; top: var(--topbar-h, 58px); height: calc(100vh - var(--topbar-h, 58px)); min-height: 560px; overflow: hidden; background: #050505; border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
@media (max-width: 1100px) { .globe-pane { position: relative; top: 0; height: 74vh; min-height: 520px; border-right: 0; border-bottom: 1px solid var(--rule); } }
.globe-stage { position: relative; flex: 1 1 auto; min-height: 0; }
#globe { position: absolute; inset: 0; cursor: grab; }
#globe:active { cursor: grabbing; }
.globe-hud { position: absolute; z-index: 5; pointer-events: none; }
.globe-hud > * { pointer-events: auto; }
.hud-tl { top: 16px; left: 18px; }
.hud-tr { top: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.hud-row { display: flex; gap: 6px; align-items: center; }
.hud-seg { background: rgba(14, 13, 11, 0.86); }
.hud-seg button { padding: 6px 10px; font-size: 12px; }
.glass { background: rgba(14, 13, 11, 0.86); border: 1px solid var(--rule-2); border-radius: 3px; }
.month-display { background: none; border: 0; padding: 0; text-shadow: 0 1px 12px rgba(0,0,0,.9); }
.month-display .lbl { font-size: 12px; color: var(--muted); }
.month-display .big { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.month-display .sub { font-family: var(--mono); font-size: 12px; color: var(--ember-2); margin-top: 2px; }
.hud-btn { width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.hud-btn:hover { color: var(--text); border-color: var(--muted); }
.hud-btn.on { color: var(--text); border-color: var(--text); }
.hud-btn svg { width: 15px; height: 15px; }
.globe-dock { flex: none; position: relative; z-index: 6; background: var(--bg); border-top: 1px solid var(--rule-2); }
.timeline { padding: 10px 16px 6px; display: flex; align-items: center; gap: 12px; }
.timeline .play { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--text); background: none; display: grid; place-items: center; cursor: pointer; }
.timeline .play:hover { background: var(--text); }
.timeline .play:hover svg { fill: var(--bg); }
.timeline .play svg { width: 13px; height: 13px; fill: var(--text); }
.timeline input[type=range] { flex: 1; accent-color: var(--ember); }
.timeline .t-label { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 70px; text-align: right; }
.dock-row { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 0 16px 10px 60px; flex-wrap: wrap; }
.dock-eras { flex: 1 1 220px; min-width: 0; }
.era-strip { position: relative; height: 3px; margin: 0; display: flex; }
.era-strip i { display: block; height: 100%; }
.era-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 6px 0 0; font-size: 11px; color: var(--faint); }
.era-legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--c); }
.globe-hint { position: absolute; left: 18px; bottom: 14px; right: 18px; z-index: 4; font-size: 12px; color: var(--muted); background: none; border: 0; text-shadow: 0 1px 8px #000; transition: opacity .6s; pointer-events: none; }
/* Column legend lives in the dock, outside the globe canvas, so it never overlaps the Earth. */
.legend-points { flex: 0 1 330px; min-width: 220px; font-size: 11px; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--rule); }
.legend-points .pl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.legend-points .pl-title { color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.legend-points .pl-ramp { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; }
.legend-points .ramp { display: block; width: 92px; height: 5px; background: linear-gradient(90deg, #8a1c12, #d9480f, #f97316, #fbbf24, #fff7c2); }
.legend-points .pl-body { margin-top: 3px; line-height: 1.4; }
.legend-points .pl-fill { margin-top: 3px; line-height: 1.4; color: var(--faint); }
.legend-points .pl-fill[hidden] { display: none; }
@media (max-width: 760px) { .dock-row { padding-left: 16px; } .legend-points { flex-basis: 100%; padding-left: 0; border-left: 0; } }

/* ---------------------------------------------------------------- reading column */
.panel { display: flex; flex-direction: column; min-width: 0; padding: 0 34px 20px; }
@media (max-width: 700px) { .panel { padding: 0 16px 20px; } }
.card { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.card h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.card .desc { color: var(--muted); font-size: 14px; margin: 6px 0 0; line-height: 1.55; max-width: 68ch; }
.card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.section-no { font-family: var(--mono); font-size: 11px; color: var(--ember-2); display: block; margin-bottom: 6px; }
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

.aoi-head { display: block; }
.aoi-head .kicker { font-size: 12px; color: var(--ember-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.aoi-head h2 { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); font-weight: 600; margin: 4px 0 0; line-height: 1.05; letter-spacing: -0.015em; }
.aoi-head .meta { color: var(--faint); font-size: 12px; margin-top: 8px; font-family: var(--mono); }
.chips { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--faint); }
.chip { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; font-size: 13px; }
.chip:hover { color: var(--text); text-decoration-color: var(--text); }
.chip.label { text-decoration: none; cursor: default; color: var(--faint); }

.insight { margin: 18px 0 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; color: #d9d4ca; max-width: 62ch; }
.insight b { color: var(--text); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 22px; }
@media (max-width: 1400px) and (min-width: 1101px), (max-width: 760px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi:nth-child(4) { border-left: 0; padding-left: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--rule); } }
@media (max-width: 480px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(4) { border-left: 1px solid var(--rule); padding-left: 14px; } .kpi:nth-child(3), .kpi:nth-child(5) { border-left: 0; padding-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); } }
.kpi { padding: 14px 14px 14px 0; }
.kpi + .kpi { padding-left: 14px; border-left: 1px solid var(--rule); }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-family: var(--serif); font-size: clamp(26px, 2.4vw, 34px); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums lining-nums; }
.kpi .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.v.hot { color: var(--ember-2); } .v.cool { color: var(--sky); }

/* ---------------------------------------------------------------- calendar */
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.yr-range { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.yr-range select { padding: 5px 6px; }
.legend { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.legend .ramp { width: 160px; height: 8px; }
.legend .ramp-wrap { display: flex; align-items: center; gap: 8px; }
.legend .keys { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .keys span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; display: inline-block; }
.legend .sw.hatch { background: repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 1px, transparent 1px 4px), #4a2a5a; }

.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.cal { display: grid; grid-template-columns: 44px repeat(12, minmax(34px, 1fr)) 58px; gap: 2px; min-width: 620px; font-family: var(--mono); font-size: 10.5px; }
.cal .hd { color: var(--faint); text-align: center; padding: 4px 0 6px; font-family: var(--sans); font-size: 11px; }
.cal .yr { color: var(--muted); display: flex; align-items: center; cursor: pointer; }
.cal .yr:hover { color: var(--text); }
.cal .yr.sel { color: var(--text); font-weight: 600; }
.cal .tot { color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 3px; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, rgba(243, 120, 25, .3) var(--w, 0%), transparent var(--w, 0%)); }
.cal .cell { position: relative; height: 23px; border-radius: 1px; display: grid; place-items: center; cursor: pointer; font-variant-numeric: tabular-nums; background: var(--surface-2); color: rgba(255,255,255,.88); outline: 0 solid transparent; transition: background-color .45s ease, color .35s ease; }
.cal .cell:hover { outline: 1px solid var(--text); outline-offset: 0; z-index: 3; }
.cal .cell.recon::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.2) 0 1px, transparent 1px 4px); pointer-events: none; }
.cal .cell.nodata { background: transparent; cursor: default; }
.cal .cell.nodata:hover { outline: 0; }
.cal .cell.sel { outline: 2px solid var(--text); outline-offset: 1px; z-index: 4; }
.cal .cell.playing { outline: 2px solid var(--ember); outline-offset: 1px; z-index: 4; }
.cal .era-sep { grid-column: 1 / -1; color: var(--faint); font-family: var(--sans); font-size: 11px; padding: 8px 0 3px; border-bottom: 1px solid var(--rule); margin-bottom: 2px; }
.cal .foot { color: var(--muted); text-align: center; padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--rule-2); font-variant-numeric: tabular-nums; }
.cal .foot.lbl { text-align: left; font-family: var(--sans); font-size: 11px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.charts-row > .card { border-bottom: 0; }
.charts-wrap { border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; gap: 0; } }
.chart { width: 100%; height: 250px; margin-top: 10px; }
.chart.tall { height: 300px; }

/* ---------------------------------------------------------------- validation & method */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
@media (max-width: 700px) { .metrics { grid-template-columns: 1fr; } }
.metric { padding: 14px 16px 14px 0; }
.metric + .metric { padding-left: 16px; border-left: 1px solid var(--rule); }
.metric .k { font-size: 12px; color: var(--muted); }
.metric .row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.metric .row b { font-family: var(--serif); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .row.naive b { font-size: 17px; color: var(--faint); font-weight: 400; }
.metric .row span { font-size: 12px; color: var(--muted); }
.method { font-size: 15px; line-height: 1.7; color: #d2cdc3; }
.method p, .method ol { max-width: 72ch; }
.method ol { padding-left: 20px; }
.method li { margin: 6px 0; }
.method code { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--surface-2); padding: 1px 5px; }
.sources { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 80ch; }
footer { color: var(--faint); font-size: 12px; padding: 26px 0 50px; line-height: 1.6; max-width: 80ch; }

/* ---------------------------------------------------------------- tooltip, toast, popover */
.tooltip { position: fixed; z-index: 80; pointer-events: none; padding: 10px 12px; background: #f3efe6; color: #1a1814; border-radius: 2px; box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 12px; min-width: 200px; opacity: 0; transition: opacity .12s; }
.tooltip.show { opacity: 1; }
.tooltip .t { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.tooltip .r { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #5a554c; padding: 1px 0; }
.tooltip .r b { color: #1a1814; font-weight: 600; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; padding: 8px 14px; font-size: 13px; color: var(--bg); background: var(--text); border-radius: 2px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 45; width: 260px; padding: 14px; display: none; background: var(--surface); }
.pop.open { display: block; }
.pop label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.pop input[type=number] { width: 100%; background: var(--bg); border: 1px solid var(--rule-2); border-radius: 3px; padding: 6px 8px; font-size: 14px; font-family: var(--mono); }
.pop .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rel { position: relative; }
.radius-ctl { width: 226px; padding: 10px 12px; font-size: 12px; color: var(--muted); display: none; }
.radius-ctl.on { display: block; }
.radius-ctl b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.radius-ctl input { width: 100%; height: 22px; accent-color: #fbbf24; display: block; margin: 6px 0 6px; cursor: pointer; }
.banner { font-size: 13px; color: var(--muted); border-left: 2px solid var(--ember); padding: 4px 0 4px 12px; margin-top: 14px; }
.partial-note { font-size: 12px; color: var(--faint); margin-top: 8px; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------------------------------------------------------------- regionalization: breadcrumb, filters, ranking, globe tooltip */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--faint); margin-bottom: 10px; min-height: 18px; }
.crumbs button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; font-size: 12px; }
.crumbs button:hover { color: var(--text); text-decoration-color: var(--text); }
.crumbs span { color: var(--text); }
.crumbs i { font-style: normal; color: var(--faint); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 16px; }
.filters .f { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); flex: 1 1 180px; min-width: 0; max-width: 300px; }
.filters .f[hidden] { display: none; }
.filters select { width: 100%; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 3px; padding: 6px 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.filters select:hover { border-color: var(--muted); }
.filters select:disabled { color: var(--faint); cursor: default; }
.ranking { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 14px; }
.ranking[hidden] { display: none; }
.rank-head h3 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.rank-head p { margin: 3px 0 10px; font-size: 12px; color: var(--faint); }
.rank-list { display: flex; flex-direction: column; }
.rk { display: grid; grid-template-columns: 26px minmax(0, 1.25fr) minmax(60px, 1fr) 64px 64px; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; background: none; border: 0; border-bottom: 1px solid var(--rule); text-align: left; cursor: pointer; font-size: 13px; color: var(--text); }
.rk:hover { background: var(--surface); }
.rk.sel { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ember); }
.rk-n { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }
.rk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name small { margin-left: 6px; font-size: 11px; color: var(--faint); }
.rk-bar { height: 6px; background: var(--surface-2); }
.rk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #932667, #dd513a, #fca50a); }
.rk-v { font-family: var(--mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.rk-a { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-a.hot { color: var(--ember-2); }
.rk-a.cool { color: var(--sky); }
.rank-more { margin-top: 8px; }
.rank-more[hidden] { display: none; }
@media (max-width: 520px) { .rk { grid-template-columns: 22px minmax(0, 1fr) 56px 58px; } .rk-bar { display: none; } }
.gtip { background: rgba(14, 13, 11, 0.94); border: 1px solid var(--rule-2); border-radius: 3px; padding: 8px 10px; min-width: 170px; font-family: var(--sans); color: var(--text); box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.gtip .gt-k { font-size: 10.5px; color: var(--ember-2); text-transform: uppercase; letter-spacing: .07em; }
.gtip .gt-t { font-family: var(--serif); font-size: 15px; font-weight: 600; margin: 1px 0 4px; }
.gtip .gt-r { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; color: var(--muted); }
.gtip .gt-r b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.gtip .gt-h { margin-top: 5px; font-size: 11px; color: var(--faint); }
.float-tooltip-kap { background: none !important; padding: 0 !important; border-radius: 0 !important; }

/* ---------------------------------------------------------------- map stage: 3D / 2D, selection, hover readout */
#globe[hidden], #map2d[hidden] { display: none; }
#map2d { position: absolute; inset: 0; background: #050505; }
.map2d-canvas { display: block; cursor: grab; touch-action: none; }
.map2d-canvas:active { cursor: grabbing; }
.mode-circle #globe, .mode-circle .map2d-canvas { cursor: crosshair !important; }
.view-2d .only3d { display: none; }
.hud-tr { gap: 8px; }
.view-seg button, .mode-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12.5px; }
.mode-seg button svg { width: 14px; height: 14px; }
.rc-head { display: flex; align-items: baseline; justify-content: space-between; }
.rc-head b { font-size: 15px; }
.rc-presets { display: flex; gap: 4px; }
.rc-presets button { flex: 1; padding: 4px 0; font-family: var(--mono); font-size: 11px; color: var(--muted); background: none; border: 1px solid var(--rule-2); border-radius: 3px; cursor: pointer; }
.rc-presets button:hover { color: var(--text); border-color: var(--muted); }
.rc-hint { margin-top: 7px; font-size: 11px; color: var(--faint); }
.sel-actions { display: flex; gap: 6px; margin-top: 10px; }
.sel-actions[hidden] { display: none; }
.sel-btn { display: inline-flex; align-items: center; gap: 5px; max-width: 190px; padding: 5px 9px 5px 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.sel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn svg { width: 13px; height: 13px; flex: none; }
.sel-btn:hover { color: var(--text); border-color: var(--muted); }
/* Region under the cursor. Fixed in the corner: it never sits on the territory being pointed at. */
.globe-hud .hover-box { max-width: 250px; margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--ember); opacity: 0; transform: translateX(-4px); transition: opacity .14s, transform .14s; pointer-events: none; text-shadow: 0 1px 10px rgba(0, 0, 0, .95), 0 0 3px rgba(0, 0, 0, .9); }
.globe-hud .hover-box.on { opacity: 1; transform: none; }
.hb-k { font-size: 10.5px; color: var(--ember-2); text-transform: uppercase; letter-spacing: .07em; }
.hb-t { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.15; }
.hb-v { margin-top: 2px; font-family: var(--mono); font-size: 12px; }
.hb-h { margin-top: 2px; font-size: 11px; color: var(--muted); }
@media (max-width: 760px) {
  .view-seg button, .mode-seg button { padding: 7px 9px; }
  .radius-ctl { width: 200px; }
  .month-display .big { font-size: 28px; }
}

/* ---------------------------------------------------------------- calendar facts, ranking section */
.cal-facts { display: flex; flex-wrap: wrap; margin: 0 0 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.fact { flex: 1 1 150px; min-width: 0; padding: 11px 14px 11px 0; background: none; border: 0; color: inherit; text-align: left; }
.fact + .fact { padding-left: 14px; border-left: 1px solid var(--rule); }
button.fact { cursor: pointer; }
.fact .fk { font-size: 11.5px; color: var(--muted); }
.fact .fv { margin-top: 2px; font-family: var(--serif); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.fact .fs { margin-top: 1px; font-family: var(--mono); font-size: 11px; color: var(--ember-2); }
button.fact:hover .fv { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 560px) { .fact { flex-basis: 45%; } .fact:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); } .fact:nth-child(4) { border-top: 1px solid var(--rule); } }
.cal .foot.heat { border-top: 0; margin-top: 4px; padding: 4px 0; border-radius: 1px; }
.card > .ranking { margin-top: 0; padding-top: 0; border-top: 0; }
.rank-head h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 0; }
.rank-head .desc { margin: 6px 0 12px; }
.card[hidden] { display: none; }
.hand { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.hand h3 { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.hand .metrics { margin: 14px 0 0; }
.limits { margin-top: 18px; padding: 14px 16px; background: var(--surface); border-left: 2px solid var(--sky); }
.limits h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); }
.limits ul { margin: 0; padding-left: 18px; max-width: 74ch; }
.limits li { margin: 5px 0; font-size: 14px; line-height: 1.55; }

/* The readout in the corner gets a backing whenever the map fills the stage behind it. */
.has-sel .hud-tl, .view-2d .hud-tl { padding: 10px 14px 12px 12px; margin: -10px 0 0 -12px; background: rgba(14, 13, 11, 0.84); border: 1px solid var(--rule-2); border-radius: 3px; }
.has-sel .month-display, .view-2d .month-display { text-shadow: none; }
.kpi .v { font-size: clamp(23px, 1.95vw, 32px); letter-spacing: -0.01em; white-space: nowrap; }

/* Hover readout hangs below the corner block, so the block never changes height. */
.hud-tl { max-width: 262px; }
.globe-hud .hover-box { position: absolute; top: 100%; left: 0; width: max-content; margin-top: 10px; }
.has-sel .hover-box, .view-2d .hover-box { padding: 8px 12px 9px 10px; background: rgba(14, 13, 11, 0.84); border: 1px solid var(--rule-2); border-left: 2px solid var(--ember); border-radius: 0 3px 3px 0; text-shadow: none; }
.has-sel .hud-tl, .view-2d .hud-tl { position: absolute; }

/* Radius panel: its own corner of the stage (bottom strip on phones, so it never sits on the circle). */
.globe-stage > .radius-ctl { position: absolute; z-index: 5; top: 232px; right: 16px; }
.btn, .seg button { white-space: nowrap; }
@media (max-width: 760px) {
  .globe-stage > .radius-ctl { top: auto; right: 10px; bottom: 10px; left: 10px; width: auto; padding: 8px 12px; }
  .radius-ctl .rc-hint { display: none; }
  .radius-ctl.on ~ .globe-hint { display: none; }
  .top-actions { display: contents; }
  .brand { order: 1; flex: 1 1 auto; }
  .top-actions > .seg { order: 2; }
  .top-actions > .search { order: 3; flex: 1 1 180px; min-width: 0; }
  .top-actions > #btnWorld { order: 4; }
  .top-actions > .rel { order: 5; }
  .hud-tl { max-width: 190px; }
}

/* Search takes the centre of the header, between the section menu and the actions. */
.nav { margin-right: 0; }
.top-actions { flex: 1 1 auto; min-width: 0; }
.top-actions .search { flex: 1 1 auto; max-width: 560px; min-width: 160px; margin: 0 auto; }
.search input, .search input:focus { width: 100%; padding-top: 8px; padding-bottom: 8px; font-size: 13.5px; }
.search input:focus { border-color: var(--ember-2); box-shadow: 0 0 0 3px rgba(232, 89, 12, .14); }
.dock-fresh { margin-top: 5px; font-size: 10.5px; color: var(--faint); }
@media (max-width: 760px) { .top-actions .search { margin: 0; max-width: none; } }
@media (min-width: 761px) { .top-actions .search { margin: 0 12px 0 0; max-width: none; } }

/* Search: the icon and an ember line answer the focus, and the result list drops in. */
.search svg { transition: color .2s, transform .35s cubic-bezier(.3, 1.6, .4, 1); }
.search:focus-within svg { color: var(--ember-2); transform: translateY(-50%) scale(1.15) rotate(-12deg); }
.search::after { content: ""; position: absolute; left: 1px; right: 1px; bottom: 1px; height: 2px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #932667, #dd513a 45%, #fca50a); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.3, 1, .3, 1); pointer-events: none; }
.search:focus-within::after { transform: scaleX(1); }
.search input::placeholder { color: var(--faint); transition: color .2s; }
.search input:hover::placeholder { color: var(--muted); }
.search-results.open { animation: drop-in .2s cubic-bezier(.3, 1, .3, 1); transform-origin: 50% 0; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }
.search-results button { transition: background .12s, padding-left .15s; }
.search-results button:hover, .search-results button.active { padding-left: 14px; }
.brand { cursor: pointer; }
.aoi-head .meta { min-height: 1.4em; }
@media (max-width: 760px) { .aoi-head .meta { min-height: 2.9em; } }

/* Calendar first: the overview is only a heading and one sentence, the month figures follow the calendar. */
#overview { padding-bottom: 18px; }
#monthSec { padding-top: 6px; }
#monthSec .kpis { margin-top: 0; border-top: 0; }
#calendarSec { padding-top: 20px; }
#calendarSec .card-head { margin-bottom: 12px; }
