:root {
  color-scheme: dark;
  --bg: #07131d;
  --panel: #0b1b27;
  --panel-2: #0e2230;
  --line: rgba(154, 194, 207, .13);
  --line-strong: rgba(154, 194, 207, .22);
  --text: #e8f2f4;
  --muted: #91a8b2;
  --dim: #617984;
  --accent: #4ce0ce;
  --accent-2: #91f1e4;
  --amber: #f0c27c;
  --radius: 12px;
  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; width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
body { color: var(--text); }
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 { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 62px minmax(0, 1fr); overflow: hidden; background: var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #091722; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border: 1px solid rgba(76,224,206,.34); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, rgba(76,224,206,.14), rgba(76,224,206,.02)); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); transform: skewY(-25deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .72; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .stage-kicker, .summary-note { color: #7f9aa5; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.4; }
.brand-title { color: #e8f3f5; font-size: 15px; font-weight: 650; letter-spacing: -.025em; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.model-status { display: flex; align-items: center; gap: 8px; color: #8ea7b0; font-size: 9px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.status-dot, .live-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(76,224,206,.8); }
.icon-button { border: 1px solid var(--line-strong); background: rgba(17,39,51,.78); padding: 8px 11px; border-radius: 8px; display: flex; align-items: center; gap: 7px; color: #c5d6dc; font-size: 11px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button:hover { background: #153241; border-color: rgba(76,224,206,.4); transform: translateY(-1px); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 368px; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #071c29; border-right: 1px solid var(--line); }
#oceanCanvas { display: block; width: 100%; height: 100%; }
.stage-heading { position: absolute; top: 27px; left: 30px; z-index: 1; pointer-events: none; max-width: min(540px, 65%); }
.stage-kicker { display: flex; align-items: center; gap: 8px; color: #9bb4bc; }
.kicker-line { width: 22px; height: 1px; background: var(--accent); box-shadow: 0 0 9px rgba(76,224,206,.65); }
.stage-heading h1 { margin: 10px 0 5px; font-size: clamp(20px, 2.3vw, 30px); font-weight: 560; line-height: 1.12; letter-spacing: -.045em; color: #edf8f8; }
.stage-heading p { margin: 0; max-width: 410px; color: #9bb5bf; font-size: 12px; line-height: 1.5; }
.stage-legend { position: absolute; left: auto; right: 30px; top: 30px; bottom: auto; display: flex; flex-wrap: wrap; gap: 15px; color: #9ab0b8; font-size: 10px; pointer-events: none; }
.stage-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.legend-dot.tracer { background: #d8f4ed; box-shadow: 0 0 8px #71e4d4; }
.legend-line { display: inline-block; width: 15px; height: 2px; border-radius: 2px; }
.legend-line.roll { background: #51cbbf; }
.legend-line.streak { background: #e1f9e9; box-shadow: 0 0 7px #9fffe8; }
.stage-footer { position: absolute; bottom: 0; left: 0; right: 0; min-height: 43px; padding: 9px 30px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid rgba(150,199,210,.12); background: rgba(5,18,27,.72); backdrop-filter: blur(10px); color: #a5bac1; font-size: 10px; line-height: 1.4; }
#captionText { max-width: 78%; }
.scale-tag { color: #68848e; font-size: 8px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #0a1924; scrollbar-width: thin; scrollbar-color: #29434f transparent; }
.panel-section { padding: 19px 20px 17px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.section-heading h2 { margin: 3px 0 0; color: #e3eef0; font-size: 15px; font-weight: 620; letter-spacing: -.025em; }
.section-kicker { font-size: 8px; color: #6f8c97; }
.live-pill { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid rgba(76,224,206,.2); border-radius: 20px; color: #9ce9dd; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.live-pill span { width: 5px; height: 5px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; background: linear-gradient(145deg, rgba(21,45,58,.82), rgba(13,32,44,.9)); border: 1px solid rgba(145,183,194,.1); border-radius: 9px; }
.readout-card.accent-card { border-color: rgba(76,224,206,.28); background: linear-gradient(145deg, rgba(18,62,67,.52), rgba(13,34,45,.92)); }
.wide-card { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.readout-label { color: #92aab2; font-size: 9px; line-height: 1.3; display: flex; align-items: center; gap: 5px; }
.info { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; border: 1px solid #55727d; border-radius: 50%; color: #84a2ac; font-size: 8px; font-style: normal; cursor: help; }
.readout-value { margin-top: 5px; color: #eff9f8; font-size: 22px; font-weight: 560; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1; }
.readout-value small { color: #9ab1b9; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-foot { margin-top: 6px; color: #637f89; font-size: 7px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.wide-card .readout-value { margin: 0 0 0 auto; }
.wide-card .readout-foot { flex-basis: 100%; margin-top: -1px; }
.check-strip { display: flex; gap: 9px; align-items: center; padding: 9px 10px; margin-top: 8px; border: 1px solid rgba(76,224,206,.15); border-radius: 8px; background: rgba(17,53,57,.34); }
.check-icon { flex: 0 0 19px; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #7cf0d9; background: rgba(76,224,206,.13); font-size: 11px; }
.check-copy { min-width: 0; }
.check-title { color: #c7e3df; font-size: 9px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.check-status { color: #79e5cf; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.check-detail { margin-top: 3px; color: #77959b; font-size: 8px; font-variant-numeric: tabular-nums; }
.compact-heading { align-items: center; margin-bottom: 12px; }
.text-button { padding: 4px 0; border: 0; background: none; color: #7f9ca6; font-size: 10px; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.control-list { display: grid; gap: 12px; }
.control-row { display: block; cursor: pointer; }
.control-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.control-name { color: #c0d1d6; font-size: 10px; font-weight: 550; }
.control-value { color: #e2f4f0; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-value em { margin-left: 3px; color: #64858d; font-size: 6px; font-style: normal; font-weight: 800; letter-spacing: .08em; }
input[type="range"] { appearance: none; display: block; width: 100%; height: 4px; margin: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent) 0%, rgba(76,224,206,.32) 100%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #b5fff2; border-radius: 50%; background: #1c8f8a; box-shadow: 0 0 0 3px rgba(76,224,206,.11), 0 1px 6px rgba(0,0,0,.35); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #b5fff2; border-radius: 50%; background: #1c8f8a; box-shadow: 0 0 0 3px rgba(76,224,206,.11); }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #627d87; font-size: 8px; }
.presets-section { padding-top: 16px; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { min-height: 45px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; text-align: left; border: 1px solid rgba(145,183,194,.11); border-radius: 8px; background: rgba(15,35,47,.76); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { border-color: rgba(76,224,206,.32); background: rgba(20,49,59,.9); }
.preset-button.active { border-color: rgba(76,224,206,.43); background: rgba(22,66,67,.4); }
.preset-button strong { display: block; color: #d4e3e5; font-size: 10px; font-weight: 650; }
.preset-button small { display: block; margin-top: 2px; color: #78939c; font-size: 8px; }
.preset-glyph { width: 30px; height: 26px; flex: 0 0 30px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 5px; background: rgba(76,224,206,.06); overflow: hidden; }
.preset-glyph i { display: block; width: 2px; height: 16px; border-radius: 3px; background: #55dccc; opacity: .8; }
.aligned-glyph i:nth-child(2) { height: 21px; }
.crossed-glyph { transform: rotate(0deg); }
.crossed-glyph i { transform: rotate(32deg); opacity: .6; }
.calm-glyph i { height: 2px; width: 17px; background: #7f98a0; }
.playback-section { padding-top: 14px; padding-bottom: 14px; }
.playback-row, .playback-controls, .quality-control, .view-row { display: flex; align-items: center; }
.playback-row { justify-content: space-between; gap: 8px; }
.playback-controls { gap: 6px; }
.play-button, .step-button { min-height: 31px; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 650; transition: background .15s ease, border-color .15s ease; }
.play-button { display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid rgba(76,224,206,.34); color: #c9f5ed; background: rgba(32,102,96,.28); }
.play-button:hover { background: rgba(32,125,115,.4); }
.play-icon { font-size: 12px; line-height: 1; }
.step-button { padding: 0 9px; border: 1px solid var(--line-strong); color: #a8bec5; background: rgba(16,37,49,.75); }
.step-button:hover { border-color: rgba(76,224,206,.3); color: #dff7f2; }
.step-button span { color: var(--accent); font-size: 14px; margin-left: 3px; }
.quality-control { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(5,18,27,.38); }
.quality-control > span, .view-row > span { margin: 0 4px; color: #67828c; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.quality-control button, .view-row button { padding: 5px 7px; border: 0; border-radius: 5px; color: #77919a; background: transparent; font-size: 8px; cursor: pointer; }
.quality-control button[aria-pressed="true"], .view-row button[aria-pressed="true"] { color: #d6f6ef; background: rgba(76,224,206,.14); }
.view-row { gap: 4px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.view-row > span { margin-right: auto; }
.view-row button { padding: 6px 9px; font-size: 9px; }
.science-panel { border-top: 1px solid var(--line); }
.science-panel summary { min-height: 48px; padding: 0 20px; display: flex; align-items: center; gap: 9px; color: #d0e1e4; font-size: 11px; font-weight: 650; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 17px; font-weight: 350; }
.science-panel[open] summary::after { content: "−"; }
.science-mark { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid rgba(76,224,206,.22); border-radius: 6px; color: var(--accent); background: rgba(76,224,206,.07); font-size: 12px; }
.summary-note { margin-left: auto; font-size: 7px; font-weight: 650; letter-spacing: .09em; }
.science-panel summary::after { margin-left: 0; }
.science-content { padding: 0 20px 20px; color: #9db2ba; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d3e5e7; font-size: 10px; font-weight: 650; }
.science-content p { margin: 5px 0 9px; }
.equation-list { display: grid; gap: 6px; margin: 10px 0; }
.equation-list > div { padding: 7px 8px; border: 1px solid rgba(145,183,194,.09); border-radius: 6px; background: rgba(16,37,49,.52); }
.equation-name { display: block; margin-bottom: 3px; color: #80a1aa; font-size: 8px; }
.equation-list code { color: #d7f2ed; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; white-space: normal; }
.science-content ul { padding-left: 15px; margin: 6px 0 12px; }
.science-content li { margin: 4px 0; }
.number-key { display: grid; gap: 4px; padding: 8px; border-radius: 6px; background: rgba(15,35,47,.72); color: #91aab2; font-size: 8px; }
.number-key b { color: var(--accent); font-size: 7px; letter-spacing: .07em; }
.disclaimer { margin-top: 12px !important; color: #708b94; font-style: italic; }
@media (max-width: 900px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .panel-section { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 18px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-rows: 56px minmax(245px, 44dvh) minmax(0, 1fr); }
  .topbar { padding: 0 13px; gap: 8px; }
  .brand-mark { width: 29px; height: 29px; }
  .eyebrow { font-size: 7px; }
  .brand-title { font-size: 13px; }
  .topbar-actions { gap: 8px; }
  .model-status { font-size: 7px; gap: 5px; }
  .icon-button { padding: 7px; }
  .icon-button span { display: none; }
  .workspace { display: contents; }
  .stage { grid-row: 2; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-heading { top: 15px; left: 15px; max-width: 80%; }
  .stage-heading h1 { margin-top: 7px; font-size: 19px; }
  .stage-heading p { max-width: 300px; font-size: 9px; }
  .stage-kicker { font-size: 7px; }
  .stage-legend { display: none; }
  .stage-footer { min-height: 34px; padding: 6px 15px; font-size: 8px; }
  #captionText { max-width: 100%; }
  .scale-tag { display: none; }
  .sidebar { grid-row: 3; min-height: 0; border-top: 0; }
  .panel-section { padding: 12px 14px; }
  .measurements-section { padding-top: 13px; }
  .section-heading { margin-bottom: 9px; }
  .section-heading h2 { font-size: 13px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 7px 8px 6px; }
  .readout-label { font-size: 8px; }
  .readout-value { margin-top: 4px; font-size: 18px; }
  .readout-value small { font-size: 9px; }
  .readout-foot { margin-top: 4px; font-size: 6px; }
  .wide-card .readout-foot { margin-top: -2px; }
  .check-strip { padding: 6px 8px; margin-top: 6px; }
  .check-detail { font-size: 7px; }
  .conditions-section { padding-top: 12px; }
  .control-list { grid-template-columns: 1fr 1fr; gap: 10px 13px; }
  .control-name { font-size: 9px; }
  .control-value { font-size: 9px; }
  .control-value em { display: none; }
  .range-ends { font-size: 7px; }
  .presets-section { padding-top: 12px; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .preset-button { min-height: 43px; gap: 6px; padding: 6px; }
  .preset-glyph { width: 24px; flex-basis: 24px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .quiet-preset { grid-column: 1 / -1; }
  .playback-section { padding-top: 10px; padding-bottom: 10px; }
  .science-panel summary { min-height: 42px; padding: 0 14px; }
  .science-content { padding: 0 14px 16px; }
}
@media (max-width: 390px) {
  .model-status { display: none; }
  .stage-heading h1 { font-size: 17px; }
  .stage-heading p { max-width: 260px; }
  .stage-legend { gap: 7px; font-size: 7px; }
  .control-list { gap: 9px 10px; }
  .preset-button small { font-size: 6px; }
  .quality-control > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
