:root {
  color-scheme: dark;
  --bg: #07151e;
  --panel: #0c202b;
  --panel-2: #102936;
  --panel-3: #142f3b;
  --line: rgba(159, 198, 204, .13);
  --line-strong: rgba(159, 198, 204, .24);
  --text: #e7f2f1;
  --muted: #91a9ad;
  --dim: #607b82;
  --accent: #6be4d2;
  --accent-soft: rgba(107, 228, 210, .12);
  --accent-faint: rgba(107, 228, 210, .06);
  --shadow: 0 18px 55px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); background: radial-gradient(ellipse at 18% -12%, rgba(43, 105, 116, .18), transparent 48%), var(--bg); }
.topbar { min-height: 76px; padding: 16px 24px 14px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 31px; height: 31px; border: 1px solid rgba(107, 228, 210, .5); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-22deg); flex: 0 0 auto; }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; }
.eyebrow { color: var(--muted); font-size: 9px; line-height: 1.4; letter-spacing: .18em; font-weight: 750; }
.eyebrow-dot { display: inline-block; width: 3px; height: 3px; margin: 0 5px 2px; border-radius: 50%; background: var(--accent); }
h1 { margin: 2px 0 0; font-size: clamp(19px, 2vw, 25px); line-height: 1.05; letter-spacing: -.045em; font-weight: 660; }
h1 em { color: var(--accent); font-style: normal; font-weight: 450; }
.top-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; color: #a9bdc0; font-size: 8px; letter-spacing: .09em; font-weight: 700; white-space: nowrap; }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.pill-dot.illustrative { opacity: .65; }
.pill-dot.scaled { opacity: .35; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 16px; padding: 16px 20px 20px; }
.scene-card, .control-card { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(150deg, rgba(16, 41, 54, .93), rgba(9, 27, 37, .98)); box-shadow: var(--shadow); overflow: hidden; }
.scene-card { display: flex; flex-direction: column; }
.scene-topline { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.scene-context, .scene-tools { display: flex; align-items: center; gap: 8px; }
.scene-context { color: #b9cfce; font-size: 9px; letter-spacing: .14em; font-weight: 760; }
.live-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(107, 228, 210, .8); }
.live-indicator.quiet { background: #61777d; box-shadow: none; }
.view-label { color: var(--dim); font-size: 8px; letter-spacing: .12em; font-weight: 700; }
.view-label span { color: var(--accent); padding: 0 3px; }
.icon-button { border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.025); padding: 5px 8px; color: var(--accent); font-size: 8px; letter-spacing: .12em; font-weight: 800; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-button:hover { background: var(--accent-soft); border-color: rgba(107,228,210,.45); }
.canvas-wrap { flex: 1; min-height: 260px; position: relative; overflow: hidden; background: #092330; }
#oceanCanvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-label { position: absolute; pointer-events: none; color: rgba(204, 228, 225, .68); font-size: 8px; font-weight: 750; letter-spacing: .14em; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.label-wind { top: 6.2%; left: 5.2%; display: flex; align-items: center; gap: 8px; }
.label-wind b { color: var(--accent); font-size: 14px; font-weight: 500; }
.label-rule { width: 20px; height: 1px; background: var(--accent); opacity: .7; }
.label-surface { top: 23.5%; right: 5.1%; color: rgba(180, 232, 222, .86); }
.label-surface span { color: var(--accent); padding: 0 3px; }
.label-depth { top: 47%; left: 2.2%; writing-mode: vertical-rl; transform: rotate(180deg); opacity: .65; }
.canvas-legend { position: absolute; right: 16px; bottom: 39px; display: flex; flex-direction: column; gap: 7px; padding: 9px 10px; border: 1px solid rgba(168, 209, 208, .12); border-radius: 7px; background: rgba(5, 21, 29, .42); color: rgba(198, 221, 220, .75); font-size: 8px; letter-spacing: .05em; backdrop-filter: blur(8px); }
.canvas-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); }
.legend-dot.gather { width: 13px; height: 2px; border-radius: 0; box-shadow: 0 0 8px var(--accent); }
.canvas-footer { position: absolute; bottom: 13px; left: 16px; right: 16px; display: flex; justify-content: space-between; color: rgba(169, 199, 200, .43); font-size: 7px; letter-spacing: .16em; font-weight: 750; pointer-events: none; }
.caption-strip { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px 17px; border-top: 1px solid var(--line); background: rgba(5, 20, 28, .42); }
.caption-icon { width: 26px; height: 26px; border: 1px solid rgba(107,228,210,.32); border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; }
.caption-icon span { width: 8px; height: 8px; border: 1px solid var(--accent); border-radius: 50%; box-shadow: 0 0 9px rgba(107,228,210,.45); }
.caption-kicker { color: var(--accent); font-size: 8px; letter-spacing: .16em; font-weight: 800; margin-bottom: 4px; }
.caption-strip p { margin: 0; max-width: 780px; color: #b4c9ca; font-size: 11px; line-height: 1.5; }
.control-card { padding: 12px 15px 9px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(107,228,210,.25) transparent; display: flex; flex-direction: column; gap: 8px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-heading h2 { margin: 2px 0 0; font-size: 17px; font-weight: 630; letter-spacing: -.035em; }
.text-button { background: none; border: 0; padding: 7px 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .13em; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-button { min-height: 36px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); color: #91a9ad; padding: 7px 9px; text-align: left; font-size: 8px; letter-spacing: .12em; font-weight: 800; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.preset-button span { margin-left: 4px; letter-spacing: .02em; font-size: 10px; font-weight: 650; }
.preset-button:hover, .preset-button.active { border-color: rgba(107,228,210,.42); background: var(--accent-soft); color: var(--accent); }
.sliders { display: grid; gap: 7px; }
.slider-block { min-width: 0; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.slider-heading label { color: #c6d7d6; font-size: 10px; font-weight: 600; }
.slider-heading output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 11px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(107,228,210,.72), rgba(107,228,210,.14)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(107,228,210,.72), rgba(107,228,210,.14)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #0b202a; background: var(--accent); box-shadow: 0 0 0 2px rgba(107,228,210,.28), 0 0 10px rgba(107,228,210,.4); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #0b202a; background: var(--accent); box-shadow: 0 0 0 2px rgba(107,228,210,.28), 0 0 10px rgba(107,228,210,.4); }
.slider-scale { display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.scale-tag { color: #637e84; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.measurements { padding: 8px 9px 7px; border: 1px solid var(--line); border-radius: 9px; background: rgba(2, 17, 25, .24); }
.measure-head { display: flex; justify-content: space-between; color: #80999d; font-size: 7px; letter-spacing: .15em; font-weight: 800; margin-bottom: 9px; }
.measure-head span:last-child { color: #5f7c83; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.measure { min-width: 0; padding: 6px 7px; border-radius: 6px; background: rgba(255,255,255,.025); }
.measure > span { display: block; color: #9eb4b6; font-size: 8px; line-height: 1.25; }
.measure strong { display: block; margin-top: 4px; color: #e4f2ef; font-size: 16px; line-height: 1.1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.measure strong small { font-size: 9px; font-weight: 550; color: #a8c1c1; letter-spacing: 0; }
.measure i { display: block; margin-top: 4px; color: #607d83; font-size: 6px; letter-spacing: .12em; font-style: normal; font-weight: 800; }
.measure-highlight { background: var(--accent-faint); border: 1px solid rgba(107,228,210,.18); }
.measure-highlight strong { color: var(--accent); }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; color: #80999d; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.check-row b { display: block; color: #b4c9c8; margin-top: 3px; font-size: 8px; letter-spacing: .01em; font-weight: 600; }
.check-row b i { color: #a8c5c2; font-style: normal; font-variant-numeric: tabular-nums; }
.check-row strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.science-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-details summary { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #c5d8d6; font-size: 8px; letter-spacing: .15em; font-weight: 800; cursor: pointer; list-style: none; }
.science-details summary::-webkit-details-marker { display: none; }
.science-details summary::after { content: "+"; color: var(--accent); font-size: 15px; font-weight: 400; margin-left: auto; }
.science-details[open] summary::after { content: "−"; }
.summary-hint { color: #6d878c; font-size: 8px; letter-spacing: .02em; font-weight: 500; }
.science-content { padding: 2px 0 10px; color: #9eb4b5; font-size: 9px; line-height: 1.5; }
.science-intro { margin: 0 0 8px; }
.equation { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(159,198,204,.08); }
.equation span { color: #7f9b9f; font-size: 8px; }
.equation code { color: #d4e6e3; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; white-space: nowrap; }
.assumption-note, .constants-note { margin: 8px 0 0; color: #8ca6a9; }
.disclaimer { margin: 8px 0 0; color: #68868c; font-size: 8px; }
.transport-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.transport-controls { display: flex; align-items: center; gap: 7px; }
.transport-button, .screenshot-button { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.025); color: #b4c9c9; padding: 0 10px; font-size: 8px; letter-spacing: .12em; font-weight: 800; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.transport-button:hover, .screenshot-button:hover { border-color: rgba(107,228,210,.48); background: var(--accent-soft); color: var(--accent); }
.transport-button:active, .screenshot-button:active { transform: translateY(1px); }
.transport-button.primary { border-color: rgba(107,228,210,.45); background: var(--accent); color: #062129; min-width: 92px; }
.transport-button.primary:hover { background: #8af0df; }
.pause-glyph { font-size: 12px; margin-right: 6px; }
.screenshot-button { color: var(--accent); border-color: rgba(107,228,210,.3); }
.screenshot-button:first-letter { font-size: 13px; }
.keyboard-hint { color: #617c82; font-size: 7px; letter-spacing: .06em; text-align: center; }
.keyboard-hint span { color: var(--accent); padding: 0 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; min-height: 0; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .workspace { min-height: 0; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; padding-left: 14px; padding-right: 14px; gap: 12px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .top-meta { gap: 5px; }
  .meta-pill { padding: 5px 7px; font-size: 7px; }
}
@media (max-width: 720px) {
  .topbar { min-height: 65px; padding: 10px 13px; gap: 10px; }
  .brand-mark { width: 27px; height: 27px; }
  .top-meta { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(270px, 1fr) auto; gap: 10px; padding: 10px 10px 12px; }
  .scene-card { min-height: 270px; }
  .scene-topline { min-height: 37px; padding: 0 11px; }
  .view-label { font-size: 7px; }
  .canvas-wrap { min-height: 190px; }
  .caption-strip { min-height: 63px; padding: 9px 12px; gap: 9px; }
  .caption-strip p { font-size: 10px; line-height: 1.35; }
  .caption-icon { width: 22px; height: 22px; }
  .control-card { padding: 12px; gap: 10px; }
  body.embed-mode .workspace { grid-template-rows: minmax(245px, 1fr) minmax(220px, 39dvh); }
  body.embed-mode .control-card { max-height: 39dvh; }
}
@media (max-width: 420px) {
  h1 { font-size: 19px; }
  .eyebrow { font-size: 8px; }
  .workspace { padding-left: 8px; padding-right: 8px; }
  .canvas-label { font-size: 7px; }
  .label-surface { right: 3.5%; }
  .canvas-legend { right: 9px; bottom: 35px; padding: 7px 8px; }
  .caption-strip p { font-size: 9px; }
  .control-card { padding: 10px; }
  .sliders { gap: 8px; }
  .slider-heading label { font-size: 9px; }
  .slider-heading output { font-size: 9px; }
  .measure strong { font-size: 14px; }
  .measure { padding: 6px; }
  .preset-button span { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
