:root {
  color-scheme: dark;
  --bg: #07121b;
  --panel: #0b1923;
  --panel-2: #0e202b;
  --panel-3: #122632;
  --line: rgba(155, 188, 199, 0.13);
  --line-strong: rgba(155, 188, 199, 0.22);
  --text: #e4eef0;
  --muted: #8ba0a9;
  --subtle: #607780;
  --cyan: #6dc4ca;
  --cyan-bright: #9be2df;
  --amber: #edaa70;
  --green: #85c8a8;
  --radius: 10px;
  --space: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
#app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 50% -20%, rgba(29, 67, 81, .22), transparent 44%), var(--bg); }
.topbar { height: 62px; flex: 0 0 62px; display: grid; grid-template-columns: 230px minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(6, 17, 25, .94); z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); width: max-content; }
.brand-mark { width: 26px; height: 26px; display: flex; align-items: end; gap: 3px; padding: 4px; border: 1px solid rgba(109,196,202,.36); border-radius: 7px; transform: skewY(-7deg); }
.brand-mark span { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--cyan); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 14px; opacity: .8; }
.brand-mark span:nth-child(3) { height: 18px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; gap: 4px; }
.brand-copy strong { font-size: 11px; letter-spacing: .17em; font-weight: 800; }
.brand-copy strong span { color: var(--cyan); }
.brand-copy small { color: var(--subtle); font-size: 8px; letter-spacing: .2em; font-weight: 700; }
.topbar-center { display: flex; flex-direction: column; gap: 3px; min-width: 0; border-left: 1px solid var(--line); padding-left: 22px; }
.eyebrow { font-size: 9px; letter-spacing: .16em; color: var(--cyan); font-weight: 750; }
.topbar-title { font-size: 13px; color: #d5e1e4; letter-spacing: .01em; font-weight: 600; }
.topbar-status { display: flex; align-items: center; gap: 9px; font-size: 9px; letter-spacing: .12em; color: #a2b5bb; font-weight: 700; white-space: nowrap; }
.status-dot, .event-pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(133,200,168,.55); }
.version-tag { padding: 5px 7px; border: 1px solid rgba(109,196,202,.28); border-radius: 4px; color: var(--cyan); font-size: 8px; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 376px; gap: 0; }
.viewport-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; background: #07131e; border-right: 1px solid var(--line); }
.scene-container { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, #12303c 0%, #091a26 48%, #06111b 100%); }
.webgl-canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.scene-hud { position: absolute; z-index: 2; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-hud-top { top: 18px; }
.scene-hud-bottom { bottom: 18px; align-items: end; }
.hud-location { display: flex; flex-direction: column; gap: 5px; }
.hud-kicker, .timeline-readout span { color: #78939e; font-size: 8px; letter-spacing: .17em; font-weight: 750; }
.hud-location strong { font-size: 10px; letter-spacing: .11em; color: rgba(225,239,241,.86); font-weight: 700; }
.hud-event { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(150,188,196,.17); border-radius: 5px; background: rgba(6,18,27,.56); backdrop-filter: blur(12px); color: #9bb2ba; font-size: 8px; letter-spacing: .11em; font-weight: 750; }
.event-pulse { width: 5px; height: 5px; background: var(--amber); box-shadow: 0 0 12px rgba(237,170,112,.7); }
.timeline-readout { display: flex; flex-direction: column; gap: 4px; padding: 8px 11px; border: 1px solid rgba(150,188,196,.17); border-radius: 5px; background: rgba(6,18,27,.62); backdrop-filter: blur(12px); }
.timeline-readout strong { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 650; letter-spacing: .03em; }
.wave-legend { display: flex; align-items: center; gap: 14px; padding: 8px 10px; background: rgba(6,18,27,.55); border: 1px solid rgba(150,188,196,.13); border-radius: 5px; color: #9bb2ba; font-size: 8px; letter-spacing: .09em; }
.wave-legend span { display: flex; align-items: center; gap: 6px; }
.legend-wave, .legend-land { width: 12px; height: 3px; border-radius: 2px; display: inline-block; background: #64c2c5; box-shadow: 0 0 7px rgba(100,194,197,.6); }
.legend-land { background: #88877b; box-shadow: none; }
.scene-callout { position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; color: rgba(214,230,232,.74); font-size: 8px; letter-spacing: .12em; font-weight: 700; pointer-events: none; text-shadow: 0 1px 8px #07131e; }
.callout-slide { left: 25%; top: 41%; }
.callout-coast { right: 15%; top: 59%; }
.callout-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.callout-dot.amber { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.callout-dot.cyan { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.viewport-controls { position: absolute; right: 18px; bottom: 72px; z-index: 3; display: flex; gap: 6px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(164,198,206,.2); border-radius: 7px; background: rgba(7,21,30,.68); color: #b8cbd0; cursor: pointer; backdrop-filter: blur(12px); transition: border-color .18s, background .18s, color .18s; }
.icon-button:hover { border-color: rgba(109,196,202,.6); background: rgba(20,49,61,.9); color: var(--cyan-bright); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.context-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(4,12,18,.82); backdrop-filter: blur(8px); }
.context-overlay[hidden] { display: none; }
.context-card { max-width: 280px; padding: 24px; border: 1px solid var(--line-strong); border-radius: 12px; background: #0d202b; text-align: center; box-shadow: 0 20px 70px rgba(0,0,0,.35); }
.context-icon { display: block; font-size: 28px; color: var(--amber); margin-bottom: 12px; }
.context-card strong { font-size: 14px; }
.context-card p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 8px 0 18px; }
.readout-strip { min-height: 88px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line); background: #091822; }
.readout-item { min-width: 0; padding: 14px 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.readout-item:last-child { border-right: 0; }
.readout-label { color: #8199a1; font-size: 8px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.readout-label em { font-style: normal; color: #4f7883; font-size: 7px; margin-left: 3px; }
.readout-item strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-item strong small { font-size: 10px; color: #91a8af; font-weight: 600; }
.readout-note { font-size: 9px; color: #607984; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 16px; background: linear-gradient(180deg, #0d1c27, #0a1822 42%, #091720); scrollbar-width: thin; scrollbar-color: #29404b transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #29404b; border-radius: 6px; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h1 { margin: 5px 0 4px; font-size: 21px; line-height: 1.1; font-weight: 650; letter-spacing: -.035em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.panel-index { padding-top: 4px; color: #59737d; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.control-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.section-heading h2 { margin: 0; color: #a9bbc0; font-size: 9px; letter-spacing: .14em; font-weight: 800; }
.section-hint { color: #5e7a84; font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.preset-button { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 9px 8px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(18,39,50,.55); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(109,196,202,.42); background: rgba(24,53,65,.7); }
.preset-button.active { border-color: rgba(109,196,202,.58); background: rgba(24,59,70,.58); box-shadow: inset 0 0 0 1px rgba(109,196,202,.08); }
.preset-button strong { font-size: 9px; font-weight: 700; white-space: nowrap; }
.preset-button small { color: #6f8992; font-size: 7px; letter-spacing: .07em; white-space: nowrap; }
.preset-mark { width: 18px; height: 3px; border-radius: 4px; display: block; background: #7bb9b9; }
.compact-mark { width: 8px; opacity: .75; }
.flank-mark { width: 13px; }
.catastrophic-mark { width: 18px; background: var(--amber); }
.parameter-section { padding-bottom: 13px; }
.slider-control { margin: 0 0 12px; }
.slider-control:last-child { margin-bottom: 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.slider-head label { color: #c1d0d4; font-size: 10px; font-weight: 550; }
.slider-head output { color: var(--cyan-bright); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; margin: 0; border-radius: 5px; background: linear-gradient(90deg, #579ba4, #23424d); cursor: pointer; outline: none; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c8f0e9; background: #4c9da5; box-shadow: 0 0 0 3px rgba(76,157,165,.15); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #c8f0e9; background: #4c9da5; box-shadow: 0 0 0 3px rgba(76,157,165,.15); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(109,196,202,.25); }
.slider-scale { display: flex; justify-content: space-between; margin-top: 5px; color: #617a83; font-size: 7px; letter-spacing: .06em; }
.compact-slider { margin-top: 2px; }
.playback-section { padding-bottom: 14px; }
.playback-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; }
.button { min-height: 33px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border-radius: 6px; font-size: 8px; letter-spacing: .09em; font-weight: 800; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.button:active { transform: translateY(1px); }
.button-primary { border: 1px solid #3d9198; background: linear-gradient(180deg,#23616a,#17444e); color: #d7f1ee; }
.button-primary:hover { background: linear-gradient(180deg,#2b7480,#1d5661); }
.button-secondary { border: 1px solid var(--line-strong); background: rgba(17,39,50,.65); color: #a9bdc3; }
.button-secondary:hover { border-color: rgba(109,196,202,.48); color: #d9eeee; background: #16323e; }
.play-symbol { font-size: 11px; line-height: 1; }
.step-symbol, .reset-symbol { font-size: 14px; line-height: .7; }
.speed-control { margin-top: 14px; }
.quality-row { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; color: #8198a0; font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.quality-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: #10242f; color: #b5c7cb; border-radius: 20px; padding: 5px 9px; font-size: 8px; letter-spacing: .1em; cursor: pointer; }
.quality-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(133,200,168,.45); }
.quality-toggle[aria-pressed="false"] .quality-indicator { background: var(--amber); box-shadow: none; }
.validation-card { margin-top: 15px; padding: 13px 13px 12px; border: 1px solid rgba(109,196,202,.22); border-radius: 8px; background: linear-gradient(135deg,rgba(20,53,62,.66),rgba(12,31,42,.78)); }
.validation-top { display: flex; justify-content: space-between; align-items: center; }
.validation-pass { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 7px; letter-spacing: .09em; font-weight: 800; }
.validation-pass i { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: var(--green); }
.validation-card h3 { margin: 7px 0 11px; font-size: 13px; font-weight: 650; }
.validation-values { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.validation-values div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.validation-values span { color: #6f8c95; font-size: 7px; letter-spacing: .11em; font-weight: 750; }
.validation-values strong { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.validation-values small { color: #88a5ac; font-size: 8px; }
.validation-card p { margin: 10px 0 0; color: #829ba3; font-size: 9px; line-height: 1.5; }
.validation-card p i { color: #c2d7d9; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 7px; background: rgba(13,31,42,.56); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; list-style: none; cursor: pointer; color: #b5c9ce; font-size: 9px; letter-spacing: .12em; font-weight: 800; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 5px; background: rgba(109,196,202,.13); color: var(--cyan); font-style: normal; font-size: 12px; }
.details-chevron { color: #79929a; font-size: 15px; transition: transform .2s; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.science-content h4 { margin: 12px 0 5px; color: #c3d3d6; font-size: 9px; letter-spacing: .04em; }
.science-content p, .science-content li { color: #829ba3; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 5px 0; }
.science-content code { display: inline-block; max-width: 100%; padding: 3px 5px; border-radius: 4px; background: rgba(3,13,19,.55); color: #a9d7d5; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; overflow-wrap: anywhere; }
.science-content ul { margin: 6px 0 0; padding-left: 16px; }
.science-content li { margin-bottom: 4px; }
.science-content b { color: #c1d4d8; }
.model-label { color: var(--amber) !important; font-size: 7px !important; letter-spacing: .12em; font-weight: 800; }
.panel-footnote { margin-top: 12px; color: #59727b; font-size: 8px; line-height: 1.45; }
.footerbar { height: 25px; flex: 0 0 25px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid var(--line); color: #58717a; background: #07131c; font-size: 7px; letter-spacing: .13em; font-weight: 700; }
.footerbar span span { color: #8db6ba; }
:focus-visible { outline: 2px solid rgba(109,196,202,.85); outline-offset: 3px; }
body.embed .topbar, body.embed .footerbar { display: none; }
body.embed .workspace { height: 100vh; }
body.embed .control-panel { padding-top: 14px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0,1fr) 350px; }
  .control-panel { padding-left: 16px; padding-right: 16px; }
  .readout-item { padding-left: 12px; padding-right: 10px; }
  .readout-item strong { font-size: 18px; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  #app-shell { min-height: 100vh; }
  .topbar { height: 56px; flex-basis: 56px; grid-template-columns: 1fr auto; padding: 0 14px; }
  .topbar-center { display: none; }
  .topbar-status { font-size: 8px; gap: 7px; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .viewport-panel { flex: 0 0 auto; grid-template-rows: minmax(360px, 53vh) auto; border-right: 0; }
  .scene-container { min-height: 360px; }
  .readout-strip { min-height: 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout-item { min-height: 72px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
  .readout-item:nth-child(2) { border-right: 0; }
  .readout-item:nth-child(3), .readout-item:nth-child(4) { border-bottom: 0; }
  .readout-item strong { font-size: 19px; }
  .control-panel { overflow: visible; padding: 18px 16px 22px; }
  .panel-heading h1 { font-size: 20px; }
  .control-section { padding: 14px 0; }
  .footerbar { height: auto; min-height: 28px; flex-basis: auto; padding: 8px 12px; gap: 8px; font-size: 6px; }
  .footerbar span:nth-child(2) { display: none; }
  .scene-hud { left: 13px; right: 13px; }
  .scene-hud-top { top: 13px; }
  .scene-hud-bottom { bottom: 13px; }
  .viewport-controls { right: 12px; bottom: 62px; }
  .callout-slide { left: 16%; top: 42%; }
  .callout-coast { right: 10%; top: 59%; }
}
@media (max-width: 420px) {
  .brand-mark { width: 24px; height: 24px; }
  .brand-copy strong { font-size: 10px; }
  .brand-copy small { font-size: 7px; }
  .version-tag { display: none; }
  .viewport-panel { grid-template-rows: minmax(340px, 48vh) auto; }
  .scene-container { min-height: 340px; }
  .hud-location strong { font-size: 8px; }
  .hud-kicker { font-size: 7px; }
  .hud-event { padding: 6px 7px; font-size: 7px; }
  .wave-legend { gap: 7px; padding: 6px 7px; font-size: 6px; }
  .timeline-readout { padding: 6px 8px; }
  .timeline-readout strong { font-size: 14px; }
  .scene-callout { font-size: 7px; }
  .readout-label { font-size: 7px; }
  .readout-label em { display: none; }
  .readout-note { font-size: 8px; }
  .preset-button { padding: 8px 6px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 6px; letter-spacing: .03em; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
