:root {
  color-scheme: dark;
  --bg: #080d12;
  --panel: #101820;
  --panel-2: #131e27;
  --line: #26343e;
  --line-soft: rgba(151, 179, 190, .13);
  --text: #e7eff0;
  --muted: #8a9ba3;
  --subtle: #5e7079;
  --accent: #72e4c0;
  --accent-dim: rgba(114, 228, 192, .13);
  --accent-glow: rgba(114, 228, 192, .24);
  --radius: 15px;
  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 { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: 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 { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 25% -15%, rgba(53, 111, 105, .12), transparent 38%), var(--bg); }
.topbar { height: 68px; flex: 0 0 68px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: rgba(8, 13, 18, .88); }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(114, 228, 192, .42); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 4px; height: 17px; border-radius: 4px; background: var(--accent); transform: rotate(26deg); }
.brand-mark span:nth-child(2) { height: 12px; opacity: .68; transform: rotate(-18deg); }
.brand-mark span:nth-child(3) { height: 8px; opacity: .42; transform: rotate(36deg); }
.brand-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eyebrow, .top-meta, .stage-kicker, .panel-kicker, .metric-head, .quality-control > span, .footnote { color: var(--muted); font-size: 9px; letter-spacing: .15em; font-weight: 700; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 3px; height: 3px; background: var(--accent); border-radius: 50%; }
.brand-copy h1 { font-size: 15px; line-height: 1.1; margin: 0; font-weight: 600; letter-spacing: -.02em; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 8px; }
.live-dot, .state-pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.meta-divider { height: 12px; width: 1px; background: var(--line); }
.main-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; padding: 14px 18px 16px; overflow: hidden; }
.visual-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.stage-card, .control-card, .science-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19, 30, 39, .96), rgba(13, 21, 28, .98)); box-shadow: 0 12px 35px rgba(0, 0, 0, .16); }
.stage-card { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.stage-topline { flex: 0 0 auto; min-height: 66px; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px 11px; }
.stage-kicker { color: var(--accent); font-size: 8px; margin-bottom: 5px; }
.stage-topline h2 { margin: 0; font-size: 16px; font-weight: 570; letter-spacing: -.025em; }
.stage-state { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(114, 228, 192, .2); background: rgba(114, 228, 192, .055); color: #b9d8cf; padding: 7px 10px; border-radius: 30px; font-size: 8px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; }
.state-pip { width: 5px; height: 5px; }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 170px; overflow: hidden; background: #091218; border-top: 1px solid rgba(151, 179, 190, .08); border-bottom: 1px solid rgba(151, 179, 190, .08); }
#field { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.canvas-overlay { position: absolute; left: 15px; right: 15px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.canvas-overlay-top { top: 13px; }
.canvas-overlay-bottom { bottom: 13px; }
.overlay-chip { padding: 5px 8px; border: 1px solid rgba(153, 190, 191, .15); border-radius: 5px; color: #8da3a9; background: rgba(8, 16, 21, .66); font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.overlay-time { color: #c5d4d5; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; text-shadow: 0 1px 8px #071016; }
.overlay-time small { color: #71868d; font-size: 8px; font-weight: 500; }
.legend { display: flex; align-items: center; gap: 6px; color: #80949b; font-size: 8px; }
.legend-cell { width: 12px; height: 5px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 8px rgba(114, 228, 192, .3); }
.legend-dim { background: #6b8990; opacity: .55; box-shadow: none; }
.scale-label { color: #a4b8ba; font-size: 9px; font-weight: 600; }
.scale-label small { color: #6f8389; font-size: 8px; font-weight: 400; }
.caption-strip { min-height: 62px; flex: 0 0 auto; display: flex; align-items: center; gap: 11px; padding: 10px 17px; }
.caption-icon { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border: 1px solid rgba(114, 228, 192, .24); border-radius: 9px; color: var(--accent); background: rgba(114, 228, 192, .06); font-size: 18px; }
.caption-title { font-size: 11px; font-weight: 650; margin-bottom: 3px; }
.caption-strip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.metrics-grid { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.metric-card { min-width: 0; min-height: 100px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #111b23, #0d151c); padding: 11px 12px 9px; }
.metric-head { min-height: 21px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; font-size: 7px; letter-spacing: .12em; line-height: 1.35; }
.metric-mark { color: #52656d; font-size: 8px; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; color: var(--accent); font-size: clamp(21px, 2vw, 27px); line-height: 1; letter-spacing: -.04em; font-weight: 570; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { color: #8ba1a4; font-size: 9px; letter-spacing: 0; font-weight: 500; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; color: #647780; font-size: 8px; white-space: nowrap; }
.metric-bar { display: block; width: 52px; height: 3px; border-radius: 5px; overflow: hidden; background: #26343b; }
.metric-bar i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.control-column { min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #31434a transparent; }
.control-card { padding: 15px 15px 12px; flex: 0 0 auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.panel-kicker { color: var(--accent); font-size: 8px; margin-bottom: 4px; }
.panel-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.025em; font-weight: 600; }
.adjust-icon { color: var(--accent); font-size: 23px; transform: rotate(90deg); opacity: .75; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 15px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid #293943; border-radius: 9px; background: #0c151b; padding: 9px 8px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: #49635f; transform: translateY(-1px); }
.preset-button.active { border-color: rgba(114, 228, 192, .58); background: rgba(114, 228, 192, .075); }
.preset-symbol { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 7px; background: #1a2931; color: #91a4a9; font-size: 14px; letter-spacing: -2px; }
.preset-wave { color: var(--accent); background: rgba(114, 228, 192, .11); font-size: 20px; }
.preset-button b { display: block; font-size: 9px; font-weight: 650; line-height: 1.3; }
.preset-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.control-list { display: flex; flex-direction: column; gap: 13px; }
.control-block { min-width: 0; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-label label { color: #c9d5d7; font-size: 10px; font-weight: 560; }
.control-label output { color: var(--accent); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-label output small { color: #7e9298; font-size: 8px; font-weight: 500; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, rgba(114, 228, 192, .56), #304148); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, rgba(114, 228, 192, .56), #304148); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0e171c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(114, 228, 192, .24); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0e171c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(114, 228, 192, .24); }
.range-ends { display: flex; justify-content: space-between; color: #61747b; font-size: 8px; margin-top: 2px; }
.range-ends i { color: #829399; font-style: normal; font-size: 7px; }
.transport-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.transport-controls { display: flex; align-items: center; gap: 6px; }
.transport-button { height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #2b3c44; border-radius: 7px; background: #15222a; color: #c0d0d2; padding: 0 10px; font-size: 9px; font-weight: 650; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.transport-button:hover { background: #1b2b33; border-color: #49635f; }
.transport-button.primary { min-width: 84px; border-color: rgba(114, 228, 192, .34); background: rgba(114, 228, 192, .1); color: var(--accent); }
.transport-button.primary span:first-child { font-size: 12px; }
.transport-button.icon-button { width: 32px; padding: 0; font-size: 17px; }
.transport-button:active, .preset-button:active, .text-action:active { transform: translateY(1px); }
.quality-control { display: flex; align-items: center; gap: 7px; }
.quality-control > span { font-size: 7px; }
.quality-control button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #a5b8ba; font-size: 8px; font-weight: 750; letter-spacing: .1em; cursor: pointer; padding: 5px 0 5px 4px; }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.quick-check { margin-top: 10px; padding: 8px 9px; border: 1px solid rgba(114, 228, 192, .22); border-radius: 8px; background: rgba(114, 228, 192, .04); }
.quick-check-head { display: flex; align-items: center; justify-content: space-between; color: var(--accent); font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.quick-check-head span:last-child { color: #819a95; }
.quick-check-row { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.quick-check-row > div { min-width: 0; }
.quick-check-row small { display: block; color: #71878a; font-size: 6px; letter-spacing: .1em; white-space: nowrap; }
.quick-check-row b { display: block; margin-top: 2px; color: #d9e9e4; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-versus { color: #60777a; font-size: 8px; }
.quick-check-diff { margin-left: auto; text-align: right; }

.bottom-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; }
.text-action { border: 0; background: transparent; color: var(--accent); padding: 3px 0; font-size: 9px; font-weight: 600; cursor: pointer; }
.text-action span { margin-right: 5px; }
.keyboard-hint { color: #5f727a; font-size: 7px; white-space: nowrap; }
.science-card { flex: 0 0 auto; overflow: hidden; }
.science-card summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer; }
.science-card summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(114, 228, 192, .08); color: var(--accent); font-size: 16px; }
.science-card summary b { display: block; font-size: 10px; font-weight: 650; }
.science-card summary small { display: block; color: var(--muted); margin-top: 3px; font-size: 8px; }
.chevron { margin-left: auto; color: #80949a; transition: transform .2s ease; }
.science-card[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 14px 14px; border-top: 1px solid var(--line-soft); color: #9dafb3; font-size: 9px; line-height: 1.55; }
.science-content h3 { color: #d8e3e3; font-size: 10px; margin: 12px 0 6px; }
.science-content p { margin: 5px 0 8px; }
.equation { padding: 8px 9px; border: 1px solid rgba(114, 228, 192, .12); border-radius: 7px; background: rgba(114, 228, 192, .035); color: #c3e2d9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.check-card { margin: 11px 0; border: 1px solid rgba(114, 228, 192, .24); border-radius: 9px; background: rgba(114, 228, 192, .045); padding: 9px; }
.check-title { display: flex; justify-content: space-between; color: var(--accent); font-size: 7px; font-weight: 750; letter-spacing: .11em; }
.check-title span { color: #819a95; font-weight: 500; letter-spacing: 0; }
.check-equation { color: #aabebc; font-size: 8px; margin-top: 6px; }
.check-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 8px; }
.check-values small { display: block; color: #6f8588; font-size: 6px; letter-spacing: .12em; }
.check-values b { display: block; margin-top: 3px; color: #d9e9e4; font-size: 10px; font-variant-numeric: tabular-nums; }
.science-content ul { margin: 5px 0 9px; padding-left: 16px; }
.science-content li { padding-left: 2px; margin: 4px 0; }
.method-note { color: #71858a; font-size: 8px; }
.method-note span { color: var(--accent); }
.disclaimer { padding-top: 8px; border-top: 1px solid var(--line-soft); color: #83969a; font-size: 8px; }
.footnote { color: #596d75; font-size: 7px; line-height: 1.5; padding: 0 3px 3px; letter-spacing: .1em; }
.footnote b { color: #82979a; font-weight: 750; }
@media (max-width: 1050px) and (min-width: 761px) {
  .main-layout { grid-template-columns: minmax(0, 1fr) 325px; padding: 12px; gap: 10px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-card { min-height: 86px; }
  .topbar { padding: 0 17px; }
}
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { height: 54px; flex-basis: 54px; padding: 0 12px; gap: 9px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .brand-mark span { height: 14px; }
  .brand-copy { gap: 2px; }
  .eyebrow { font-size: 7px; gap: 5px; }
  .brand-copy h1 { font-size: 12px; }
  .top-meta { font-size: 7px; gap: 6px; }
  .top-meta .meta-divider, .top-meta span:last-child { display: none; }
  .main-layout { display: flex; flex-direction: column; gap: 9px; padding: 9px 9px 10px; overflow: hidden; }
  .visual-column { flex: 0 0 42%; min-height: 0; gap: 8px; }
  .stage-card { min-height: 0; flex: 1 1 auto; }
  .stage-topline { min-height: 48px; padding: 8px 11px; }
  .stage-kicker { font-size: 7px; margin-bottom: 3px; }
  .stage-topline h2 { font-size: 13px; }
  .stage-state { padding: 5px 7px; font-size: 7px; gap: 6px; }
  .canvas-wrap { min-height: 100px; }
  .canvas-overlay { left: 9px; right: 9px; }
  .canvas-overlay-top { top: 8px; }
  .canvas-overlay-bottom { bottom: 8px; }
  .overlay-chip { padding: 4px 6px; font-size: 7px; }
  .overlay-time { font-size: 10px; }
  .legend { font-size: 7px; gap: 4px; }
  .legend-cell { width: 9px; }
  .scale-label { font-size: 8px; }
  .caption-strip { min-height: 48px; padding: 6px 10px; gap: 8px; }
  .caption-icon { width: 24px; height: 24px; flex-basis: 24px; font-size: 15px; }
  .caption-title { font-size: 9px; margin-bottom: 2px; }
  .caption-strip p { font-size: 8px; line-height: 1.3; }
  .metrics-grid { flex: 0 0 auto; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .metric-card { min-height: 58px; padding: 6px 6px 5px; border-radius: 8px; }
  .metric-head { min-height: 15px; font-size: 5px; letter-spacing: .08em; }
  .metric-mark { font-size: 6px; }
  .metric-value { margin-top: 2px; font-size: clamp(13px, 4.4vw, 18px); gap: 2px; }
  .metric-value small { font-size: 6px; }
  .metric-foot { margin-top: 5px; font-size: 5px; }
  .metric-bar { width: 30px; height: 2px; }
  .control-column { flex: 1 1 auto; min-height: 0; gap: 8px; overscroll-behavior: contain; }
  .control-card { padding: 11px 11px 9px; }
  .panel-heading { margin-bottom: 9px; }
  .panel-kicker { font-size: 7px; }
  .panel-heading h2 { font-size: 13px; }
  .adjust-icon { font-size: 19px; }
  .presets { margin-bottom: 10px; gap: 6px; }
  .preset-button { padding: 6px 7px; gap: 6px; }
  .preset-symbol { width: 22px; height: 22px; flex-basis: 22px; font-size: 12px; }
  .preset-wave { font-size: 17px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; margin-top: 2px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 8px; }
  .control-label { margin-bottom: 3px; gap: 3px; align-items: flex-start; flex-direction: column; }
  .control-label label { font-size: 8px; }
  .control-label output { font-size: 8px; }
  .control-label output small { font-size: 7px; }
  input[type="range"] { height: 12px; }
  .range-ends { font-size: 6px; margin-top: 0; }
  .range-ends i { font-size: 6px; }
  .transport-row { margin-top: 9px; padding-top: 8px; }
  .transport-button { height: 27px; font-size: 8px; padding: 0 8px; }
  .transport-button.primary { min-width: 72px; }
  .transport-button.icon-button { width: 28px; }
  .quality-control > span { font-size: 6px; }
  .quality-control button { font-size: 7px; }
  .quick-check { margin-top: 8px; padding: 7px 8px; }
  .quick-check-row { gap: 7px; margin-top: 5px; }
  .quick-check-row b { font-size: 9px; }
  .quick-check-row small { font-size: 5px; }
  .bottom-actions { margin-top: 6px; }
  .text-action { font-size: 8px; }
  .keyboard-hint { font-size: 6px; }
  .science-card summary { padding: 8px 10px; }
  .science-summary-icon { width: 23px; height: 23px; font-size: 14px; }
  .science-card summary b { font-size: 9px; }
  .science-card summary small { font-size: 7px; }
  .science-content { padding: 0 10px 10px; font-size: 8px; }
  .science-content h3 { font-size: 9px; }
  .equation { font-size: 8px; }
  .footnote { font-size: 6px; }
}
@media (max-width: 390px) {
  .visual-column { flex-basis: 40%; }
  .metric-head { font-size: 4.7px; }
  .metric-foot { font-size: 4.6px; }
  .caption-strip p { font-size: 7.5px; }
  .control-list { column-gap: 9px; }
  .range-ends { letter-spacing: -.02em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
