/* OSR10 ocean globe. Palette follows the Algorithmic BrAIn site (navy, gold, cream; Cormorant Garamond + DM Sans). */
:root {
  --bg: #070d18;
  --navy: #0b1220;
  --navy-2: #111b2e;
  --navy-3: #1a2744;
  --panel: rgba(11, 18, 32, 0.9);
  --card: rgba(13, 21, 38, 0.88);
  --line: rgba(247, 245, 240, 0.1);
  --line-2: rgba(247, 245, 240, 0.18);
  --ink: #f7f5f0;
  --ink-2: rgba(247, 245, 240, 0.86);
  --muted: rgba(247, 245, 240, 0.62);
  --faint: rgba(247, 245, 240, 0.42);
  --gold: #c9a227;
  --gold-2: #e0c35a;
  --gold-tint: rgba(201, 162, 39, 0.12);
  --gold-line: rgba(201, 162, 39, 0.32);
  --sea: #5fb3c9;
  --sea-tint: rgba(95, 179, 201, 0.14);
  --warm: #e8775a;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --panel-w: 420px;
  --r: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--gold-2); text-decoration-color: rgba(224, 195, 90, 0.4); text-underline-offset: 2px; }
a:hover { color: #ecd27f; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
svg { display: block; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--navy); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

#globe { position: absolute; inset: 0; }
.cesium-viewer-bottom, .cesium-widget-credits { display: none !important; }
.cesium-widget canvas { outline: none; }

/* ------------------------------------------------------------------ loader */
.loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #13213a 0%, var(--bg) 70%); transition: opacity 0.8s ease; }
.loader.is-done { opacity: 0; pointer-events: none; }
.loader-card { text-align: center; }
.loader-wave { width: 140px; height: 46px; margin: 0 auto 18px; }
.loader-wave path { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 160; animation: wave 2.4s ease-in-out infinite; }
.loader-wave path:first-child { stroke: var(--gold-2); }
.loader-wave path:last-child { stroke: var(--sea); animation-delay: 0.3s; }
@keyframes wave { 0% { stroke-dashoffset: 160; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -160; } }
.loader-title { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: 0.01em; }
.loader-text { margin-top: 6px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ panel */
.panel { position: absolute; z-index: 10; top: 16px; left: 16px; bottom: 16px; width: var(--panel-w); display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s; }
.panel.is-collapsed { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.sheet-grip { display: none; }
.panel-head { padding: 16px 18px 0; border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 38px; height: 38px; flex: none; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }
.brand-title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; margin-top: 2px; }
.tabs { display: flex; gap: 2px; margin-top: 12px; }
.tabs button { flex: 1; background: none; border: 0; padding: 10px 4px 11px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; letter-spacing: 0.01em; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.tab-body { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(247, 245, 240, 0.18) transparent; }
.tab-body:focus { outline: none; }

/* ------------------------------------------------------------------ story */
.story { padding: 0 6px; scroll-padding-top: 12px; }
.chapter { padding: 26px 18px 30px; margin: 10px 0; border-radius: 14px; opacity: 0.4; transition: opacity 0.5s, background 0.5s; min-height: 62%; }
.chapter.is-active { opacity: 1; background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)); }
.chapter:first-child { margin-top: 6px; }
.story-end { height: 38vh; }
.kicker { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.kicker .ch-no { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.chapter h1, .chapter h2 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 8px 0 14px; letter-spacing: 0.005em; }
.chapter h1 { font-size: 40px; }
.chapter h2 { font-size: 31px; }
.chapter-body { font-size: 15px; line-height: 1.62; color: var(--ink-2); }
.chapter-body p { margin: 0 0 12px; }
.chapter-body strong { color: var(--ink); font-weight: 600; }
.chapter-body .lede { font-size: 16.5px; color: var(--ink); }
a.place { color: var(--ink); text-decoration: none; border-bottom: 1px dotted rgba(224, 195, 90, 0.7); cursor: pointer; white-space: nowrap; }
a.place::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); margin: 0 4px 2px 1px; box-shadow: 0 0 0 2px rgba(224, 195, 90, 0.2); }
a.place:hover { color: var(--gold-2); }

.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 14px; }
.num { padding: 12px 13px 11px; border-radius: 12px; background: var(--gold-tint); border: 1px solid var(--gold-line); }
.num.is-wide { grid-column: 1 / -1; }
.num-v { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.num-u { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--gold-2); margin-left: 3px; }
.num-l { font-size: 12.5px; line-height: 1.38; color: var(--ink-2); margin-top: 6px; }
.num-s { font-size: 10.5px; color: var(--faint); margin-top: 5px; letter-spacing: 0.02em; }

.fig { margin: 16px 0 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; display: block; width: 100%; padding: 0; text-align: left; }
.fig img { width: 100%; display: block; max-height: 240px; object-fit: contain; background: #fff; }
.fig-cap { background: var(--navy-2); padding: 9px 12px 10px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.fig-cap b { color: var(--ink-2); font-weight: 600; }
.fig:hover { border-color: var(--gold-line); }

.src { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.src a { color: var(--muted); }
.layer-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--sea-tint); border: 1px solid rgba(95, 179, 201, 0.26); font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.layer-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; stroke: var(--sea); fill: none; stroke-width: 2; }
.caveat { font-size: 12px; line-height: 1.5; color: var(--muted); border-left: 2px solid var(--gold-line); padding: 2px 0 2px 10px; margin: 12px 0; }
.cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 16px; border-radius: 999px; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 13.5px; border: 0; cursor: pointer; }
.cta:hover { background: var(--gold-2); }
.cta.ghost { background: none; color: var(--ink); border: 1px solid var(--line-2); font-weight: 600; }
.cta.ghost:hover { border-color: var(--gold-line); color: var(--gold-2); }

.views { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 2px; align-items: center; }
.views::before { content: "Map"; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-right: 2px; }
.chart { margin: 14px 0 4px; }
.chart-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .ax { stroke: rgba(247, 245, 240, 0.16); stroke-width: 1; }
.chart .tick { fill: var(--faint); font-size: 10px; font-family: var(--sans); }
.chart .series { fill: none; stroke-width: 1.6; }
.chart .band { opacity: 0.18; }
.chart .hl { fill: var(--gold-2); }
.chart-note { font-size: 10.5px; color: var(--faint); margin-top: 4px; line-height: 1.4; }

.story-nav { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); background: rgba(11, 18, 32, 0.6); }
.nav-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.nav-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: none; cursor: pointer; display: grid; place-items: center; flex: none; }
.nav-btn svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:hover:not(:disabled) { border-color: var(--gold); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 4px; border: 0; padding: 0; background: rgba(247, 245, 240, 0.22); cursor: pointer; transition: width 0.3s, background 0.3s; }
.dot:hover { background: rgba(247, 245, 240, 0.5); }
.dot.is-active { width: 20px; background: var(--gold-2); }
.nav-count { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
body:not(.mode-story) .story-nav { display: none; }

/* ------------------------------------------------------------------ explore / report / about */
.explore, .report, .about { padding: 18px 18px 26px; }
.sec-h { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 4px 0 6px; }
.sec-p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0 0 14px; }
.sub-h { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; margin: 20px 0 9px; }
.var-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.var-btn { text-align: left; padding: 10px 11px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.var-btn:hover { border-color: var(--line-2); }
.var-btn.is-active { border-color: var(--gold); background: var(--gold-tint); }
.var-btn b { font-size: 13px; font-weight: 600; }
.var-btn em { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.35; }
.var-btn .ramp { height: 5px; border-radius: 3px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 12.5px; color: var(--muted); }
.field-row { display: flex; gap: 8px; align-items: center; }
.field input[type="date"], .field select { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: var(--ink); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; color-scheme: dark; }
.field input[type="range"] { width: 100%; accent-color: var(--gold); }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: none; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--gold-line); }
.chip.is-active { border-color: var(--gold); color: var(--ink); background: var(--gold-tint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hint { font-size: 12px; line-height: 1.5; color: var(--faint); margin-top: 10px; }
.share { display: flex; gap: 6px; margin-top: 8px; }
.share input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted); border-radius: 9px; padding: 7px 9px; font-size: 11.5px; }

.rep-sec { margin-top: 18px; }
.rep-item { display: block; width: 100%; text-align: left; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); margin-bottom: 7px; cursor: pointer; }
.rep-item:hover { border-color: var(--gold-line); }
.rep-no { font-size: 11px; color: var(--gold-2); font-weight: 700; letter-spacing: 0.06em; }
.rep-t { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 3px 0; color: var(--ink); }
.rep-a { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.rep-links { display: flex; gap: 12px; margin-top: 6px; font-size: 11.5px; }
.rep-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.rep-thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; cursor: zoom-in; aspect-ratio: 4 / 3; }
.rep-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about p, .about li { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.about ul { padding-left: 18px; margin: 6px 0 12px; }
.about li { margin-bottom: 5px; }
.about code { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: 1px; }
.status-dot.ok { background: #6fcf97; }
.status-dot.bad { background: var(--warm); }

/* ------------------------------------------------------------------ map chrome */
.panel-toggle { position: absolute; z-index: 11; top: 26px; left: calc(16px + var(--panel-w) + 10px); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); backdrop-filter: blur(10px); cursor: pointer; display: grid; place-items: center; transition: left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.panel-toggle svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; transition: transform 0.3s; }
body.panel-collapsed .panel-toggle { left: 16px; }
body.panel-collapsed .panel-toggle svg { transform: rotate(180deg); }

.toolbar { position: absolute; z-index: 12; top: 16px; right: 16px; display: flex; gap: 8px; align-items: center; }
.tool-btn { height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); backdrop-filter: blur(10px); cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.tool-btn svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn:hover { border-color: var(--gold); }
.basemap-menu { position: absolute; top: 48px; right: 0; width: 280px; padding: 6px; }
.basemap-option { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; border: 0; background: none; border-radius: 9px; cursor: pointer; }
.basemap-option:hover { background: rgba(255, 255, 255, 0.05); }
.basemap-option.is-active { background: var(--gold-tint); }
.basemap-option .sw { width: 34px; height: 34px; border-radius: 8px; flex: none; border: 1px solid var(--line-2); }
.basemap-option b { display: block; font-size: 13px; }
.basemap-option em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-toggle { display: flex; gap: 10px; align-items: center; padding: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.menu-toggle input { accent-color: var(--gold); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }

.legend { position: absolute; z-index: 9; right: 16px; bottom: 30px; width: 300px; padding: 13px 15px 12px; }
.lg-title { font-size: 13.5px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lg-title span { font-weight: 500; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.lg-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.lg-bar { height: 11px; border-radius: 3px; margin-top: 10px; }
.lg-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.lg-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.lg-src { font-size: 10.5px; color: var(--faint); margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); line-height: 1.45; }
.lg-src a { color: var(--muted); }
.lg-status { font-size: 11px; color: var(--warm); margin-top: 6px; }
.lg-hint { font-size: 10.5px; color: var(--faint); margin-top: 6px; }

.timebar { position: absolute; z-index: 9; bottom: 30px; left: calc(16px + var(--panel-w) + 16px); right: calc(16px + 300px + 16px); max-width: 640px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 10px 16px 9px 10px; }
body.panel-collapsed .timebar { left: 16px; }
.tb-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--gold); cursor: pointer; display: grid; place-items: center; flex: none; }
.tb-play svg { width: 18px; height: 18px; fill: var(--navy); }
.tb-play .i-pause, .tb-play.is-playing .i-play { display: none; }
.tb-play.is-playing .i-pause { display: block; }
.tb-main { flex: 1; min-width: 0; }
.tb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tb-date { font-family: var(--serif); font-size: 21px; font-weight: 600; font-variant-numeric: lining-nums; white-space: nowrap; }
.tb-note { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-range { width: 100%; margin: 4px 0 0; accent-color: var(--gold); height: 18px; }
.tb-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }

.probe { position: absolute; z-index: 13; min-width: 170px; max-width: 260px; padding: 9px 12px 10px; font-size: 12px; pointer-events: auto; transform: translate(-50%, calc(-100% - 14px)); }
.probe::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.pr-v { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.1; }
.pr-v small { font-family: var(--sans); font-size: 12px; color: var(--gold-2); font-weight: 600; margin-left: 3px; }
.pr-l { color: var(--muted); margin-top: 2px; }
.pr-c { color: var(--faint); font-size: 10.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.probe-close { position: absolute; top: 4px; right: 4px; border: 0; background: none; cursor: pointer; padding: 4px; }
.probe-close svg { width: 12px; height: 12px; stroke: var(--muted); stroke-width: 2; }

.tooltip { position: absolute; z-index: 14; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: rgba(7, 13, 24, 0.94); border: 1px solid var(--line-2); font-size: 12px; max-width: 240px; transform: translate(12px, 12px); }
.credits { position: absolute; z-index: 8; left: calc(16px + var(--panel-w) + 16px); bottom: 6px; right: 330px; font-size: 10px; color: rgba(247, 245, 240, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; }
.credits a { color: rgba(247, 245, 240, 0.62); }
.credits .cesium-credit-lightbox-overlay, .credits .cesium-credit-expand-link { display: none; }
.credits img { height: 12px; vertical-align: -2px; opacity: 0.6; }
body.panel-collapsed .credits { left: 16px; }

.place-label { position: absolute; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 16, 0.86); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 3vh 3vw; }
.lb-inner { position: relative; max-width: min(1200px, 94vw); max-height: 94vh; display: flex; flex-direction: column; background: var(--navy-2); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.lb-inner figure { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.lb-img { background: #fff; display: grid; place-items: center; min-height: 0; overflow: auto; }
.lb-img img { max-width: 100%; max-height: 68vh; display: block; }
.lightbox figcaption { padding: 14px 18px 16px; overflow-y: auto; max-height: 24vh; }
.lb-title { font-weight: 700; font-size: 14px; }
.lb-caption { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); margin-top: 5px; }
.lb-source { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.lb-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); background: rgba(255, 255, 255, 0.92); cursor: pointer; display: grid; place-items: center; }
.lb-close svg { width: 16px; height: 16px; stroke: #111b2e; stroke-width: 2.2; stroke-linecap: round; }

/* embedded in an iframe on another page */
.embed-hint { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; border-radius: 12px; background: rgba(7, 13, 24, 0.9); border: 1px solid var(--line-2); font-size: 14px; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.embed-hint.is-on { opacity: 1; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  :root { --panel-w: 380px; }
  .legend { width: 260px; }
  .timebar { right: calc(16px + 260px + 16px); }
  .credits { right: 290px; }
}
@media (max-width: 899px) {
  html, body { font-size: 14px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 52%; border-radius: 18px 18px 0 0; border-bottom: 0; transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.4s; }
  .panel.is-expanded { height: 86%; }
  .panel.is-collapsed { transform: translateY(calc(100% - 40px)); opacity: 1; pointer-events: auto; }
  .sheet-grip { display: grid; place-items: center; height: 22px; border: 0; background: none; cursor: grab; flex: none; }
  .sheet-grip span { width: 42px; height: 4px; border-radius: 2px; background: rgba(247, 245, 240, 0.3); }
  .panel-head { padding: 0 14px; }
  .brand { display: none; }
  .tabs { margin-top: 0; }
  .tabs button { padding: 9px 2px 10px; font-size: 12.5px; }
  .panel-toggle { display: none; }
  .chapter { padding: 18px 12px 22px; min-height: 0; }
  .chapter h1 { font-size: 32px; }
  .chapter h2 { font-size: 26px; }
  .num-v { font-size: 27px; }
  .toolbar { top: 10px; right: 10px; gap: 6px; }
  .tool-btn { height: 36px; min-width: 36px; border-radius: 10px; }
  .legend { top: 10px; left: 10px; right: auto; bottom: auto; width: min(230px, calc(100vw - 180px)); padding: 9px 11px; }
  .lg-sub, .lg-src, .lg-hint { display: none; }
  .lg-title { font-size: 12px; }
  .timebar { left: 10px; right: 10px; bottom: calc(52% + 10px); max-width: none; padding: 7px 12px 6px 7px; }
  body.sheet-expanded .timebar { display: none !important; }
  body.panel-collapsed .timebar { bottom: 50px; left: 10px; }
  .tb-play { width: 36px; height: 36px; }
  .tb-date { font-size: 17px; }
  .tb-ends { display: none; }
  .credits { left: 10px; right: 10px; bottom: calc(52% + 2px); font-size: 9px; }
  body.panel-collapsed .credits { bottom: 42px; left: 10px; }
  body.has-timebar .credits { display: none; }
  .lightbox { padding: 0; }
  .lb-inner { max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
