/* MAGMA — interface. Basalt, ash and sulphur. */
:root {
  --bg: #0b0e12;
  --panel: rgba(15, 19, 25, 0.72);
  --panel-strong: rgba(15, 19, 25, 0.9);
  --line: rgba(226, 214, 194, 0.1);
  --line-2: rgba(226, 214, 194, 0.2);
  --text: #e8e2d6;
  --muted: #9a9387;
  --faint: #6c675f;
  --sulphur: #e4d64e;
  --sulphur-dim: rgba(228, 214, 78, 0.14);
  --heat: #ff6b2c;
  --cyan: #7cc3d6;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gut: 20px;
  --top: 84px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--sulphur); outline-offset: 2px; border-radius: 6px; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }

.ui-fade { transition: opacity .6s ease, transform .6s ease; }
body.intro-on .ui-fade { opacity: 0; pointer-events: none; }
body.ctx-on #phaseCard, body.ctx-on #monitor, body.ctx-on #viewCtl { opacity: 0; pointer-events: none; }
body.ctx-on #hotspots, body.intro-on #hotspots, body.intro-on #labels { opacity: 0; pointer-events: none; }

/* ------------------------------------------------ intro */
.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 55%, rgba(11, 14, 18, 0.25), rgba(11, 14, 18, 0.88) 70%); transition: opacity 1s ease; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-inner { max-width: 520px; padding: 0 24px; text-align: center; }
.intro-title { font-family: var(--serif); font-weight: 400; font-size: clamp(64px, 11vw, 120px); line-height: .9; margin: 0; letter-spacing: -0.02em; }
.intro-sub { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--muted); margin: 10px 0 26px; }
.intro-text { font-family: var(--serif); font-size: 18px; line-height: 1.55; color: #cfc8bb; margin: 0 auto 30px; max-width: 30em; }
.intro-sound { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; color: var(--muted); font-size: 13px; cursor: pointer; }
.intro-sound input { accent-color: var(--sulphur); }

.btn-primary { background: var(--sulphur); color: #17150b; font-weight: 600; padding: 12px 22px; border-radius: 999px; font-size: 14.5px; transition: transform .15s ease, opacity .2s; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-secondary { border: 1px solid var(--line-2); padding: 9px 16px; border-radius: 999px; font-size: 13px; color: var(--text); margin-top: 6px; }
.btn-secondary:hover { border-color: var(--sulphur); }
.btn-ghost { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.link-btn { color: var(--sulphur); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------ top bar */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 18px var(--gut); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; line-height: 1.05; min-width: 150px; }
.brand-name { font-family: var(--serif); font-size: 28px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.types { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.type-btn { padding: 8px 14px; border-radius: 9px; text-align: left; color: var(--muted); transition: color .2s, background .2s; }
.type-btn:hover { color: var(--text); }
.type-btn[aria-pressed="true"] { background: rgba(226, 214, 194, 0.08); color: var(--text); box-shadow: inset 0 -2px 0 var(--sulphur); }
.type-btn b { display: block; font-weight: 500; font-size: 13.5px; }
.type-btn small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.type-btn[aria-pressed="true"] small { color: var(--muted); }
.tools { margin-left: auto; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tool { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; transition: color .2s, background .2s; }
.tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tool[aria-pressed="true"] { color: #17150b; background: var(--sulphur); }
.tool[data-tool="sound"][aria-pressed="false"] .snd-on { opacity: 0.25; }

/* ------------------------------------------------ phase card */
.phase-card { position: fixed; left: var(--gut); top: calc(var(--top) + 6px); width: 330px; z-index: 10; padding: 20px 22px 18px; background: linear-gradient(180deg, rgba(15, 19, 25, 0.78), rgba(15, 19, 25, 0.62)); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.phase-step { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; padding-right: 30px; line-height: 1.35; }
.pc-toggle { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.pc-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.pc-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.phase-card.collapsed .pc-toggle svg { transform: rotate(180deg); }
.phase-card.collapsed .phase-text, .phase-card.collapsed .phase-watch, .phase-card.collapsed .custom-badge { display: none; }
.phase-card.collapsed .phase-dur { margin-bottom: 0; }
.phase-step .dots { display: inline-flex; gap: 3px; }
.phase-step .dots i { width: 14px; height: 3px; border-radius: 2px; background: var(--line-2); }
.phase-step .dots i.on { background: var(--sulphur); }
.phase-name { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1; margin: 10px 0 6px; letter-spacing: -0.015em; }
.phase-dur { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.phase-dur b { color: var(--text); font-weight: 500; }
.phase-text { font-family: var(--serif); font-size: 16.5px; line-height: 1.5; color: #d9d2c5; margin: 0 0 14px; }
.phase-watch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.phase-watch .lf { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--sulphur); background: var(--sulphur-dim); }
.chip[disabled] { opacity: 0.4; cursor: default; }
.custom-badge { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.custom-badge span { color: var(--sulphur); }
.ctx-card .btn-secondary { margin-top: 2px; }

/* ------------------------------------------------ monitor */
.monitor { position: fixed; right: var(--gut); top: calc(var(--top) + 6px); width: 296px; z-index: 10; padding: 14px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.alert { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.alert-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--al, #62cf8d); box-shadow: 0 0 0 4px color-mix(in srgb, var(--al, #62cf8d) 22%, transparent), 0 0 14px var(--al, #62cf8d); transition: background .4s, box-shadow .4s; }
.alert-level { font-weight: 600; font-size: 15px; }
.alert-desc { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.alert-av { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--al, #62cf8d); color: var(--al, #62cf8d); white-space: nowrap; }
.inst { margin: 8px 0 10px; }
.inst-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.inst-val { color: var(--text); font-variant-numeric: tabular-nums; }
.inst-canvas { width: 100%; display: block; border-radius: 6px; background: rgba(0, 0, 0, 0.22); }
.readouts { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.readouts div { display: flex; justify-content: space-between; font-size: 12.5px; }
.readouts dt { color: var(--muted); }
.readouts dd { margin: 0; font-variant-numeric: tabular-nums; }
.monitor-toggle { display: none; }

/* ------------------------------------------------ hotspots & labels */
#hotspots, #labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hs { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: auto; border-radius: 50%; display: grid; place-items: center; transition: opacity .35s; will-change: transform; }
.hs::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--sulphur); box-shadow: 0 0 0 2px rgba(11, 14, 18, 0.65); }
.hs::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(228, 214, 78, 0.75); }
.hs.watch::after { animation: ping 2.2s ease-out infinite; }
.hs:not(.watch):not(.active) { opacity: 0.62; transform-origin: center; }
.hs:not(.watch):not(.active)::before { width: 7px; height: 7px; }
.hs:not(.watch):not(.active)::after { inset: 3px; border-color: rgba(228, 214, 78, 0.45); }
.hs:hover { opacity: 1 !important; }
.hs.dim { opacity: 0 !important; pointer-events: none; }
.hs.active::before { background: #fff; }
.hs-label { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12.5px; padding: 4px 9px; border-radius: 7px; background: var(--panel-strong); border: 1px solid var(--line-2); color: var(--text); opacity: 0; transition: opacity .2s; pointer-events: none; }
.hs:hover .hs-label, .hs:focus-visible .hs-label, .hs.watch .hs-label { opacity: 1; }
.hs.watch .hs-label { background: rgba(15, 19, 25, 0.66); border-color: var(--line); }
.hs.nolab .hs-label { opacity: 0; }
.hs.nolab:hover .hs-label { opacity: 1; }
.hs.left .hs-label { left: auto; right: 18px; }
@keyframes ping { 0% { transform: scale(0.8); opacity: 1; } 80%, 100% { transform: scale(2.1); opacity: 0; } }

.lbl { position: absolute; left: 0; top: 0; font-size: 11px; color: var(--muted); white-space: nowrap; transform-origin: 0 50%; will-change: transform; font-variant-numeric: tabular-nums; }
.lbl-depth { transform-origin: 100% 50%; text-align: right; }
.lbl-depth::after { content: ''; display: inline-block; width: 8px; height: 1px; background: var(--faint); vertical-align: middle; margin-left: 5px; }
.lbl-soft { color: var(--faint); font-style: italic; }
.lbl-plane { color: var(--text); }
.lbl-ctx { font-size: 12.5px; color: var(--text); background: rgba(11, 14, 18, 0.55); padding: 3px 8px; border-radius: 6px; }
.lbl-hot { color: #ffc28a; }
.lbl-depthctx { font-size: 11px; color: var(--muted); transform-origin: 100% 50%; }

/* ------------------------------------------------ info card, index, lab */
.card, .lab { position: fixed; z-index: 15; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 16px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow: auto; overscroll-behavior: contain; }
.card { right: var(--gut); top: calc(var(--top) + 6px); width: 360px; max-height: calc(100vh - var(--top) - 200px); padding: 20px 22px 16px; animation: cardIn .3s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.card-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 8px; font-size: 22px; line-height: 1; color: var(--muted); }
.card-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.card-kind { font-size: 12px; color: var(--sulphur); }
.card-title { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.08; margin: 6px 30px 10px 0; letter-spacing: -0.01em; }
.card-text { font-family: var(--serif); font-size: 16.5px; line-height: 1.55; color: #ddd6c9; margin: 0 0 14px; }
.card-facts { margin: 0 0 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card-facts dt { color: var(--muted); font-size: 12.5px; }
.card-facts dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.card-why { border-left: 2px solid var(--sulphur); padding: 2px 0 2px 12px; margin-bottom: 14px; }
.card-why-h { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.card-why p { margin: 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: #e9e3d7; }
.card-nav { display: flex; align-items: center; justify-content: space-between; }
.card-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.index-hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.index-list button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.index-list button:hover { background: rgba(255, 255, 255, 0.05); }
.index-list button small { color: var(--faint); font-size: 12px; }
.index-list button.off { color: var(--faint); }

.lab { left: var(--gut); top: calc(var(--top) + 6px); width: 384px; max-height: calc(100vh - var(--top) - 160px); padding: 20px 22px 18px; animation: labIn .3s ease; }
@keyframes labIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.lab-intro { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: #d6cfc2; margin: 0 0 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.slider { margin-bottom: 12px; }
.slider-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.slider-head output { color: var(--text); font-variant-numeric: tabular-nums; }
.slider-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--sulphur); margin-top: -6.5px; box-shadow: 0 0 0 4px rgba(11, 14, 18, 0.8); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--sulphur); }
.lab-visc { margin: 6px 0 14px; }
.visc-bar { position: relative; height: 30px; border-radius: 6px; background: linear-gradient(90deg, #6fb2c9 0%, #d8b85a 30%, #e07a35 60%, #7d3324 100%); opacity: .92; }
.visc-bar .ref { position: absolute; bottom: -16px; transform: translateX(-50%); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.visc-bar .ref::before { content: ''; position: absolute; left: 50%; top: -6px; width: 1px; height: 5px; background: var(--faint); }
.visc-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(11, 14, 18, 0.7); transition: left .25s ease; }
.lab-result { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }
.lab-rock { font-size: 12.5px; color: var(--muted); }
.lab-style { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin: 4px 0 6px; }
.lab-desc { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: #d9d2c5; margin: 0 0 12px; }
.vei { display: flex; gap: 3px; align-items: flex-end; height: 34px; margin-bottom: 6px; }
.vei i { flex: 1; border-radius: 3px 3px 0 0; background: var(--line-2); position: relative; }
.vei i.on { background: var(--heat); }
.vei i span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--faint); font-style: normal; }
.lab-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 20px; }
.lab-meta b { color: var(--text); font-weight: 500; }
.lab-analogue { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 10px 0 14px; }
.lab-analogue b { color: var(--text); font-weight: 500; }
.lab-actions { display: flex; gap: 10px; align-items: center; }
.lab-note { font-size: 11.5px; color: var(--faint); margin: 12px 0 0; }

/* ------------------------------------------------ view controls */
.viewctl { position: fixed; left: var(--gut); bottom: 98px; z-index: 10; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.seg button { padding: 6px 11px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: rgba(226, 214, 194, 0.1); color: var(--text); }
.slice { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px 12px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.slice input { width: 130px; }
.key-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.legend, .hz-legend { position: absolute; bottom: calc(100% + 10px); left: 0; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(2, auto); gap: 6px 18px; font-size: 12.5px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hz-legend { grid-template-columns: auto; left: auto; position: absolute; }
.legend div, .hz-legend div { display: flex; align-items: center; gap: 8px; color: #d8d1c4; }
.legend i, .hz-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.hz-title { color: var(--muted) !important; font-size: 12px; }
.legend + .hz-legend, .hz-legend { left: 0; }
.legend:not([hidden]) ~ .hz-legend { bottom: calc(100% + 150px); }

/* ------------------------------------------------ timeline */
.timeline { position: fixed; left: var(--gut); right: var(--gut); bottom: 18px; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.play { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--sulphur); color: #17150b; display: grid; place-items: center; }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .i-play { display: none; }
.play.paused .i-play { display: block; }
.play.paused .i-pause { display: none; }
.tl-main { flex: 1; min-width: 0; }
.tl-bar { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.tl-segs { position: absolute; inset: 0; display: flex; gap: 3px; }
.tl-seg { position: relative; height: 100%; border-radius: 7px; overflow: hidden; background: rgba(226, 214, 194, 0.06); }
.tl-seg .fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: rgba(226, 214, 194, 0.16); }
.tl-seg.hot .fill { background: linear-gradient(90deg, rgba(255, 107, 44, 0.32), rgba(255, 150, 60, 0.42)); }
.tl-seg span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.tl-seg.cur span { color: var(--text); font-weight: 500; }
.tl-seg:hover { background: rgba(226, 214, 194, 0.1); }
.tl-head { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--sulphur); border-radius: 2px; box-shadow: 0 0 10px rgba(228, 214, 78, 0.6); pointer-events: none; }
.tl-head::before { content: ''; position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sulphur); }
.tl-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tl-meta b { color: var(--text); font-weight: 500; }
.speed { display: flex; gap: 2px; flex: none; }
.speed button { padding: 6px 9px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.speed button[aria-pressed="true"] { color: var(--text); background: rgba(226, 214, 194, 0.1); }

.toast { position: fixed; left: 50%; top: 92px; transform: translate(-50%, -8px); z-index: 30; background: var(--panel-strong); border: 1px solid var(--line-2); padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100vw - 40px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ responsive */
@media (max-width: 1360px) {
  .tool span { display: none; }
}
@media (max-width: 1180px) {
  .tool { padding: 8px; }
  .type-btn small { display: none; }
}
@media (max-width: 860px) {
  :root { --gut: 12px; --top: 170px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px var(--gut); }
  .brand { min-width: 0; }
  .brand-name { font-size: 22px; }
  .brand-sub { display: none; }
  .types { margin-left: auto; }
  .type-btn { padding: 7px 9px; }
  .tools { margin-left: 0; width: 100%; overflow-x: auto; justify-content: space-between; }
  .phase-card { top: auto; bottom: 150px; width: auto; right: var(--gut); padding: 12px 14px; max-height: 32vh; overflow: auto; }
  .phase-name { font-size: 28px; margin: 6px 0 4px; }
  .phase-text { font-size: 14.5px; margin-bottom: 8px; }
  .monitor { width: 210px; padding: 10px 12px; }
  .monitor.collapsed .inst, .monitor.collapsed .readouts { display: none; }
  .monitor.collapsed .alert { border: 0; padding: 0; margin: 0; }
  .alert-desc { display: none; }
  .monitor-toggle { display: block; width: 100%; margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }
  .monitor.collapsed .monitor-toggle { margin-top: 6px; }
  .card, .lab, .index { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 86px; max-height: 62vh; }
  .viewctl { bottom: 88px; gap: 6px; }
  .viewctl .slice { display: none; }
  .phase-card.collapsed { bottom: 150px; }
  .timeline { bottom: 10px; gap: 10px; padding: 8px 10px; }
  .tl-seg span { font-size: 11px; left: 6px; }
  .tl-seg:not(.cur) span { display: none; }
  .speed { display: none; }
  .hs-label { display: none; }
  .hs:not(.watch):not(.active) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hs.watch::after { animation: none; }
  .card, .lab { animation: none; }
}

/* ------------------------------------------------ settings, record, probe */
.settings, .rec-panel { right: var(--gut); top: calc(var(--top) + 6px); width: 380px; }
.rec-panel { max-height: calc(100vh - var(--top) - 100px); }
.set-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.set-label { font-size: 12.5px; color: var(--muted); width: 78px; flex: none; }
.set-help { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: #d6cfc2; margin: 0 0 8px; }
.set-dim { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.set-check { display: flex; gap: 9px; align-items: center; font-size: 13px; color: #d8d1c4; margin: 9px 0; cursor: pointer; }
.set-check input { accent-color: var(--sulphur); width: 15px; height: 15px; }
.set-stat { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-stat b { color: var(--text); font-weight: 600; }
.select { background: rgba(255, 255, 255, 0.05); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; }
.select option { background: #14181e; }
.rec-go { width: 100%; margin-top: 10px; }
.tool-icon { padding: 7px 8px; }
.tool[data-tool="record"][aria-pressed="false"] svg { color: #ff8a6a; }

/* viewfinder while recording */
body.rec-on .ui-fade, body.rec-on #hotspots, body.rec-on #labels, body.rec-on .card, body.rec-on .lab, body.rec-on #fpsChip, body.rec-on #probeTip, body.rec-on #probeMark, body.rec-on #toast { opacity: 0 !important; pointer-events: none !important; }
body.rec-on { background: #050608; }
#scene.rec-frame { left: 50%; top: calc(50% + 22px); transform: translate(-50%, -50%); opacity: 0; }
.rec-comp { position: fixed; left: -20000px; top: 0; pointer-events: none; }
body.rec-on .rec-comp { left: 50%; top: calc(50% + 22px); transform: translate(-50%, -50%); z-index: 2; box-shadow: 0 0 0 1px rgba(226, 214, 194, 0.22), 0 30px 80px rgba(0, 0, 0, 0.6); border-radius: 4px; }
.rec-bar { position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 999px; background: rgba(15, 19, 25, 0.9); border: 1px solid var(--line-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4b3a; box-shadow: 0 0 10px #ff4b3a; animation: recblink 1.2s steps(2, start) infinite; }
.rec-len { color: var(--muted); }
.rec-stop { background: #ff4b3a; color: #fff; font-weight: 600; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
@keyframes recblink { to { opacity: 0.25; } }
.rec-count { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; font-family: var(--serif); font-size: 160px; line-height: 1; color: rgba(242, 236, 224, 0.92); text-shadow: 0 8px 40px rgba(0, 0, 0, 0.6); pointer-events: none; }

/* probe */
body.probe-on #scene { cursor: crosshair; }
.probe-tip { position: fixed; left: 0; top: 0; z-index: 25; width: 290px; padding: 12px 14px 10px; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 12px; pointer-events: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pt-name { font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.pt-text { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin: 5px 0 8px; }
.pt-rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.pt-rows dt { font-size: 12px; color: var(--muted); }
.pt-rows dd { margin: 0; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-flag { margin-top: 7px; font-size: 12px; color: var(--cyan); }
.probe-mark { position: fixed; left: 0; top: 0; z-index: 24; width: 0; height: 0; pointer-events: none; }
.probe-mark::before { content: ''; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--sulphur); box-shadow: 0 0 0 2px rgba(11, 14, 18, 0.6); }

/* frame-rate chip */
.fps-chip { position: fixed; right: var(--gut); bottom: 98px; z-index: 11; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.fps-chip.low { color: #ffb070; border-color: rgba(255, 154, 69, 0.4); }
@media (max-width: 860px) {
  .settings, .rec-panel { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 86px; max-height: 62vh; }
  .probe-tip { width: 230px; }
  .fps-chip { bottom: 140px; }
}
.bench { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 80; background: rgba(10, 12, 16, 0.94); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 20px; font-size: 13px; line-height: 1.7; max-width: min(720px, calc(100vw - 32px)); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ real eruptions: navigation */
.mode { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); flex: none; }
.mode button { padding: 9px 13px; border-radius: 9px; font-size: 13px; color: var(--muted); white-space: nowrap; transition: color .2s, background .2s; }
.mode button:hover { color: var(--text); }
.mode button[aria-pressed="true"] { color: #17150b; background: var(--sulphur); font-weight: 500; }
.mode .ms { display: none; }
.topbar { gap: 16px; }
.brand { min-width: 0; flex: none; }

.echip { display: flex; align-items: stretch; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0; }
.echip button { border-radius: 9px; color: var(--muted); display: grid; place-items: center; transition: color .2s, background .2s; }
.echip button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.echip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ec-arrow { width: 30px; }
.ec-globe { width: 36px; color: var(--sulphur) !important; }
.ec-name { padding: 5px 14px 5px 10px; text-align: left; display: block !important; min-width: 0; box-shadow: inset 0 -2px 0 var(--sulphur); background: rgba(226, 214, 194, 0.06); }
.ec-name b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-name small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.layers-wrap { position: relative; display: flex; }
.lay-count { font-style: normal; font-size: 11px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--sulphur); color: #17150b; display: inline-grid; place-items: center; padding: 0 4px; font-weight: 600; }
#layersBtn.has { color: var(--text); }
.layers-menu { position: fixed; top: 80px; right: var(--gut); width: 310px; z-index: 30; padding: 6px; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 14px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); animation: cardIn .2s ease; }
.lay { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 9px; color: var(--muted); }
.lay:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.lay svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lay b { display: block; font-weight: 500; font-size: 13.5px; color: var(--text); }
.lay small { display: block; font-size: 12px; color: var(--faint); margin-top: 1px; }
.lay kbd { font-family: var(--sans); font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.lay[aria-pressed="true"] { background: var(--sulphur-dim); color: var(--sulphur); }
.lay[aria-pressed="true"] kbd { color: var(--sulphur); border-color: rgba(228, 214, 78, 0.4); }

/* timeline: key moments */
.tl-marks { position: absolute; inset: 0; pointer-events: none; }
.tl-mark { position: absolute; top: -6px; bottom: -6px; width: 14px; margin-left: -7px; pointer-events: auto; }
.tl-mark::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: rgba(242, 236, 224, 0.5); border-radius: 1px; }
.tl-mark::after { content: ''; position: absolute; left: 3px; top: 1px; width: 8px; height: 8px; border-radius: 50%; background: #f2ece0; box-shadow: 0 0 0 2px rgba(11, 14, 18, 0.7); transition: transform .15s; }
.tl-mark:hover::after { transform: scale(1.35); background: var(--sulphur); }
.tm-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; padding: 7px 10px; border-radius: 9px; background: var(--panel-strong); border: 1px solid var(--line-2); font-size: 12.5px; line-height: 1.35; color: var(--text); text-align: left; opacity: 0; pointer-events: none; transition: opacity .15s; }
.tm-tip em { display: block; font-style: normal; color: var(--sulphur); font-size: 11.5px; margin-bottom: 2px; }
.tl-mark:hover .tm-tip, .tl-mark:focus-visible .tm-tip { opacity: 1; }
body.real-on .tl-seg span { font-size: 12px; }

/* phase card additions */
.phase-moment { margin: -4px 0 12px; padding: 8px 10px; border-radius: 10px; background: rgba(228, 214, 78, 0.08); border: 1px solid rgba(228, 214, 78, 0.22); font-size: 13.5px; line-height: 1.4; color: #efe8d8; }
.phase-moment em { display: block; font-style: normal; font-size: 11.5px; color: var(--sulphur); margin-bottom: 1px; font-variant-numeric: tabular-nums; }
.phase-moment.pop { animation: momentIn .5s ease; }
@keyframes momentIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pc-story { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 13px; color: var(--sulphur); }
.pc-story svg { width: 13px; height: 13px; fill: currentColor; }
.pc-story:hover { text-decoration: underline; text-underline-offset: 3px; }
.phase-card.collapsed .phase-moment, .phase-card.collapsed .pc-story { display: none; }

/* monitor additions */
.mon-note { font-size: 12px; line-height: 1.4; color: var(--muted); font-style: italic; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.mon-rec { margin: 2px 0 8px; padding: 8px 10px; border-radius: 9px; background: rgba(124, 195, 214, 0.07); border: 1px solid rgba(124, 195, 214, 0.18); font-size: 12px; line-height: 1.4; color: #d6dfe0; }
.mon-rec span { display: block; font-size: 11px; color: var(--cyan); margin-bottom: 2px; }

/* far-away places */
.hs.far::before { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--cyan); }
.hs.far::after { border-color: rgba(124, 195, 214, 0.6); border-radius: 30%; transform: rotate(45deg); }
.hs.far .hs-label { color: #d7eef3; }
.lbl-compass { font-weight: 600; font-size: 13px; color: var(--sulphur); transform-origin: 50% 50%; margin-left: -4px; }

/* info card media */
.card-media { margin: -2px 0 14px; }
.ea-head { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.ea-head span { color: var(--faint); }
.ea-map { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.ea-map path#eaAsh { transition: d .9s ease; }
.ea-lbl { font: 500 9px var(--sans); fill: #e8e2d6; }
.ea-days { margin-top: 8px; width: max-content; }

/* story card */
.story { width: 400px; max-height: calc(100vh - var(--top) - 120px); }
.story-title { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.04; margin: 6px 30px 6px 0; letter-spacing: -0.015em; text-wrap: balance; }
.story-date { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.story-lead { font-family: var(--serif); font-size: 19px; line-height: 1.42; color: #f1ebde; margin: 0 0 10px; text-wrap: pretty; }
.story-body { font-family: var(--serif); font-size: 15.5px; line-height: 1.55; color: #d6cfc2; margin: 0 0 16px; }
.story-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.story-actions .btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 13.5px; }
.story-actions .btn-primary svg { width: 12px; height: 12px; fill: currentColor; }
.story-actions .btn-secondary { margin-top: 0; }
.story-h { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 16px 0 8px; }
.story .card-facts { margin-bottom: 6px; }
.story-legacy { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: #e1dacd; margin: 0 0 12px; }
.story-quote { margin: 0; border-left: 2px solid var(--sulphur); padding: 2px 0 2px 12px; font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.5; color: #cfc8bb; }
.story-src { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.story-src a { font-size: 12.5px; color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(124, 195, 214, 0.35); text-underline-offset: 3px; line-height: 1.35; }
.story-src a:hover { text-decoration-color: var(--cyan); }

/* the 30-second story captions */
.story-cap { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 22; width: min(680px, calc(100vw - 2 * var(--gut))); display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: end; padding: 14px 16px 12px 20px; background: linear-gradient(180deg, rgba(15, 19, 25, 0.86), rgba(15, 19, 25, 0.94)); border: 1px solid var(--line-2); border-radius: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.story-cap.pop .sc-main { animation: momentIn .45s ease; }
.sc-time { font-size: 12px; color: var(--sulphur); font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.sc-text { font-family: var(--serif); font-size: 22px; line-height: 1.3; color: #f6f1e6; text-wrap: balance; }
.sc-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--sulphur); transform-origin: 0 50%; transform: scaleX(0); }
.sc-stop { font-size: 12.5px; color: var(--muted); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); align-self: start; }
.sc-stop:hover { color: var(--text); border-color: var(--text); }
body.rec-on .story-cap { opacity: 0; }

/* ------------------------------------------------ library: globe, to scale, features */
.library { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.library > * { pointer-events: auto; }
.library > * { transition: opacity .6s ease; }
.library.leaving > * { opacity: 0 !important; pointer-events: none !important; }
body.lib-on .ui-fade, body.lib-on #hotspots, body.lib-on #labels, body.lib-on .card, body.lib-on .lab, body.lib-on #probeTip, body.lib-on #probeMark, body.lib-on .story-cap, body.lib-on #ctxCard { opacity: 0 !important; pointer-events: none !important; }
.lib-head { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 20px; padding: 18px var(--gut) 40px; background: linear-gradient(180deg, rgba(7, 9, 12, 0.92), rgba(7, 9, 12, 0)); pointer-events: none; }
.lib-head > * { pointer-events: auto; }
.lib-title { flex: 1; min-width: 0; }
.lib-kicker { font-size: 12px; color: var(--sulphur); letter-spacing: 0.04em; }
.lib-title h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 3vw, 36px); line-height: 1.05; margin: 4px 0 0; letter-spacing: -0.015em; text-wrap: balance; }
.lib-tabs button { padding: 7px 13px; font-size: 13px; }
.lib-close { position: static; width: 38px; height: 38px; font-size: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.library.tab-features { background: rgba(7, 9, 12, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.library.tab-features .lib-head { background: none; }
.lib-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lib-pin { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; font-size: 11.5px; line-height: 1; letter-spacing: 0.01em; color: #e9e3d7; padding: 3px 6px 4px; border-radius: 3px; background: rgba(7, 9, 12, 0.46); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); will-change: transform, opacity; transition: color .25s, background .25s; }
.lib-pin b { font-weight: 500; }
.lib-pin span { font-size: 10.5px; letter-spacing: 0.04em; }
.lib-pin span { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.lib-pin.hov { background: rgba(7, 9, 12, 0.7); }
.lib-pin.hov b { color: var(--sulphur); }
.lib-speed { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; font-size: 9.5px; line-height: 1.25; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(236, 230, 218, 0.5); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95); will-change: transform, opacity; }
.lib-speed span { display: block; }
.lib-speed b { display: block; font-weight: 500; font-size: 10.5px; letter-spacing: 0.02em; text-transform: none; color: rgba(239, 232, 218, 0.82); font-variant-numeric: tabular-nums; }
.lib-reachlab { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; font-family: var(--serif); font-size: 13px; color: #d9e6ea; font-style: italic; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95); }
.lib-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lib-leaders line { stroke: rgba(236, 230, 218, 0.3); stroke-width: 0.75; }
.lib-tip { position: absolute; left: 0; top: 0; width: 280px; padding: 12px 14px; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 12px; pointer-events: none; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 3; }
.lib-tip b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.1; margin: 2px 0; }
.lt-year { font-size: 11.5px; color: var(--sulphur); }
.lt-place { display: block; font-size: 12px; color: var(--muted); }
.lib-tip p { margin: 8px 0 6px; font-size: 13px; line-height: 1.45; color: #d9d2c5; }
.lt-go { font-size: 12px; color: var(--cyan); }
.lib-legend { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: 212px; display: grid; gap: 5px; font-size: 12px; color: #d8d1c4; padding: 12px 14px 12px; background: rgba(11, 14, 18, 0.62); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 1; }
.lib-legend > div:not(.lg-toggles):not(.lib-credit):not(.lg-h) { display: flex; align-items: center; gap: 8px; }
.lib-legend i { width: 16px; height: 1.5px; border-radius: 1px; display: inline-block; flex: none; }
.lib-legend i.lg-col { position: relative; width: 1.5px; height: 13px; margin: 3px 7px 0; border-radius: 0; }
.lib-legend i.lg-col::after { content: ''; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); background: inherit; box-shadow: 0 0 0 1.5px #090b0e; }
.lg-col.ex { background: #eddbb3; }
.lg-col.lv { background: #db7552; }
.lg-h { font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.lg-h:first-child { margin-top: 0; }
.lg-note { margin: 1px 0 2px; font-size: 11px; line-height: 1.38; color: var(--faint); }
.lg-toggles { display: flex; flex-wrap: wrap; gap: 5px; }
.lg-toggles button { font-size: 11.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); transition: color .2s, background .2s, border-color .2s; }
.lg-toggles button[aria-pressed="true"] { color: #17150b; background: var(--sulphur); border-color: var(--sulphur); }
.lib-credit { font-size: 10px; color: var(--faint); margin-top: 4px; display: block !important; line-height: 1.35; }
.lib-keybtn { display: none; font-size: 12.5px; padding: 7px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.lib-keybtn[aria-expanded="true"] { color: var(--text); border-color: var(--line-2); }
.lib-reach { position: absolute; left: 50%; bottom: 200px; transform: translateX(-50%); width: min(560px, calc(100vw - 2 * var(--gut))); padding: 10px 16px 11px; border-radius: 12px; background: rgba(11, 14, 18, 0.72); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: var(--serif); font-size: 16px; line-height: 1.4; color: #efe8da; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lib-reach em { display: block; font-family: var(--sans); font-style: normal; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sulphur); margin-bottom: 3px; }
.lr-count { font-family: var(--sans); font-size: 12px; color: #9fd4e4; white-space: nowrap; margin-left: 4px; font-variant-numeric: tabular-nums; }
.lt-small { font-size: 12px !important; color: var(--muted) !important; }
.lib-snap { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 45; pointer-events: none; transform-origin: 50% 50%; will-change: transform, opacity, filter; }
body.rec-on .library { opacity: 0 !important; pointer-events: none !important; }
body.rec-on #libSnap { display: none; }
body.diving #hotspots, body.diving #labels, body.diving .phase-card, body.diving .monitor, body.diving .viewctl, body.diving .timeline { opacity: 0 !important; pointer-events: none; }
body.landed #hotspots, body.landed #labels, body.landed .phase-card, body.landed .monitor, body.landed .viewctl, body.landed .timeline { animation: landIn .9s ease both; }
@keyframes landIn { from { opacity: 0; } to { opacity: 1; } }
.lib-strip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 50px var(--gut) 18px; overflow-x: auto; scroll-snap-type: x proximity; background: linear-gradient(0deg, rgba(7, 9, 12, 0.95), rgba(7, 9, 12, 0)); scrollbar-width: thin; }
.lib-card { flex: 1 1 160px; min-width: 160px; max-width: 220px; scroll-snap-align: start; text-align: left; padding: 12px 14px 13px; border-radius: 14px; background: rgba(15, 19, 25, 0.78); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: border-color .2s, transform .2s, background .2s; }
.lib-card:hover, .lib-card.hov, .lib-card:focus-visible { border-color: rgba(228, 214, 78, 0.6); background: rgba(22, 26, 32, 0.92); transform: translateY(-3px); }
.lib-card.cur { box-shadow: inset 0 -2px 0 var(--sulphur); }
.lc-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lc-year { color: var(--sulphur); }
.lc-vei { color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.lib-card b { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.1; margin-top: 4px; color: var(--text); }
.lc-place { font-size: 12px; color: var(--muted); }
.lc-line { font-size: 12.5px; line-height: 1.38; color: #cfc8bb; margin-top: 6px; }
.lib-fade { position: fixed; inset: 0; background: #07090c; opacity: 0; pointer-events: none; transition: opacity .42s ease; z-index: 5; }
.lib-fade.on { opacity: 1; }
.lib-scale { position: absolute; inset: 0; pointer-events: none; }
.ls-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ls-lab { position: absolute; left: 0; top: 0; translate: -50% 0; text-align: center; white-space: nowrap; font-size: 12px; color: var(--muted); line-height: 1.3; }
.ls-lab b { display: block; font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--text); }
.ls-lab em { display: block; font-style: normal; color: var(--sulphur); font-variant-numeric: tabular-nums; }
.ls-lab.ref b { font-family: var(--sans); font-size: 12px; color: var(--sulphur); }
.ls-lab.extra b { color: #cfc8bb; }
.ls-lab.dropped::before { content: ''; position: absolute; left: 50%; top: calc(4px - var(--drop)); height: calc(var(--drop) - 6px); border-left: 1px solid var(--line-2); }
.ls-panel { position: absolute; left: var(--gut); bottom: 22px; width: min(400px, calc(100vw - 2 * var(--gut))); padding: 14px 16px 10px; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 14px; pointer-events: auto; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ls-note { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: #ddd6c9; margin: 0 0 6px; }
.ls-small { font-size: 11.5px; color: var(--faint); margin: 6px 0 2px; line-height: 1.4; }
.lib-features { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(520px, calc(100vw - 2 * var(--gut))); max-height: calc(100vh - 130px); overflow: auto; padding: 20px 22px 16px; background: var(--panel-strong); border: 1px solid var(--line-2); border-radius: 16px; }

@media (max-width: 1360px) {
  .mode .ml { display: none; } .mode .ms { display: inline; }
}
@media (max-width: 1180px) {
  .ec-name small { display: none; }
}
@media (max-width: 860px) {
  .mode { order: 2; }
  .echip { order: 3; margin-left: auto; }
  .types { order: 3; }
  .tools { order: 4; }
  .ec-name b { font-size: 16px; max-width: 34vw; }
  .ec-arrow { width: 26px; }
  .layers-menu { left: var(--gut); right: var(--gut); width: auto; }
  .story { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 86px; max-height: 66vh; }
  .story-cap { bottom: 84px; padding: 10px 12px 10px 14px; }
  .sc-text { font-size: 17px; }
  .lib-head { flex-wrap: wrap; padding-top: 12px; gap: 10px; }
  .lib-title { flex-basis: calc(100% - 60px); }
  .lib-tabs { order: 3; }
  .lib-legend { display: none; }
  .lib-legend.open { display: grid; top: calc(var(--top) - 34px); transform: none; z-index: 3; }
  .lib-keybtn { display: inline-block; order: 4; margin-left: auto; }
  .lib-reach { bottom: 150px; font-size: 14.5px; }
  .lib-card { flex-basis: 168px; }
  .lc-line { display: none; }
  .ls-panel { bottom: 12px; }
  body.real-on #tlCycle { display: none; }
  .lib-head { z-index: 2; }
  .lib-title h2 { font-size: 23px; }
  .monitor.collapsed .mon-note, .monitor.collapsed .mon-rec { display: none; }
  .ls-lab { font-size: 11px; }
  .ls-lab b { font-size: 14px; }
}
