:root {
  color-scheme: dark;
  --bg: #101816;
  --panel: #151f1c;
  --panel-2: #192521;
  --line: #2a3932;
  --line-soft: rgba(169, 197, 174, .12);
  --text: #e8eee5;
  --muted: #91a097;
  --dim: #64756b;
  --accent: #c7ee70;
  --accent-soft: rgba(199, 238, 112, .14);
  --accent-line: rgba(199, 238, 112, .42);
  --radius: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 18% 0%, rgba(63, 92, 67, .15), transparent 38%), var(--bg); }
.topbar { min-height: 76px; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(300px, 1.2fr) minmax(180px, 1fr); align-items: center; gap: 20px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: rgba(16, 24, 22, .96); }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid var(--accent-line); border-radius: 50%; position: relative; display: grid; place-items: center; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; border: 1px solid rgba(199, 238, 112, .72); border-radius: 50%; transform: rotate(-25deg); }
.brand-mark::before { width: 19px; height: 10px; }
.brand-mark::after { width: 10px; height: 19px; }
.brand-mark span:nth-child(1) { width: 4px; height: 4px; background: var(--accent); border: 0; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { display: none; }
.brand-copy { display: grid; gap: 3px; }
.eyebrow, .kicker, .corner-label, .corner-sub, .top-status, .readout-top, .check-label, .class-tag, .range-ends, .quality-control > span, .playback-foot, .panel-foot, .footer, .stage-scale-note { font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.eyebrow { color: var(--dim); }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #d9e2d7; }
.heading-block { justify-self: center; text-align: center; }
.heading-block h1 { font-size: 17px; line-height: 1.2; letter-spacing: -.025em; margin: 0; font-weight: 650; }
.heading-block p { margin: 4px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .015em; }
.top-status { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.status-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(199, 238, 112, .55); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(345px, .92fr); gap: 14px; padding: 14px 18px 10px; max-width: 1640px; width: 100%; margin: 0 auto; }
.visual-column, .control-column { min-width: 0; min-height: 0; }
.visual-column { display: flex; flex-direction: column; gap: 10px; }
.control-column { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a4b40 transparent; padding-right: 2px; }
.section-heading { min-height: 38px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-heading h2 { margin: 3px 0 0; font-size: 16px; font-weight: 620; letter-spacing: -.02em; }
.kicker { color: var(--accent); font-size: 8px; }
.legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-item i { display: inline-block; width: 15px; height: 3px; border-radius: 5px; }
.legend-source { background: #91c5aa; box-shadow: 0 0 8px rgba(145,197,170,.5); }
.legend-band { background: var(--accent); box-shadow: 0 0 8px rgba(199,238,112,.65); }
.stage { position: relative; flex: 1 1 auto; min-height: 300px; overflow: hidden; border: 1px solid #304139; border-radius: var(--radius); background: #14201d; box-shadow: inset 0 0 55px rgba(0,0,0,.18), 0 10px 35px rgba(0,0,0,.13); isolation: isolate; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
#simCanvas { display: block; width: 100%; height: 100%; }
.stage-corner { position: absolute; z-index: 2; top: 13px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.stage-corner-left { left: 15px; }
.stage-corner-right { right: 15px; flex-direction: row; align-items: center; color: #a9b8aa; }
.corner-label { color: #b5c4b7; font-size: 8px; }
.corner-sub { color: #718178; font-size: 7px; letter-spacing: .1em; }
.stage-corner-right { font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.stage-scale-note { position: absolute; right: 14px; bottom: 12px; z-index: 2; color: rgba(190, 207, 190, .5); font-size: 7px; pointer-events: none; }
.caption-strip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px; min-height: 48px; background: rgba(25, 37, 32, .78); border: 1px solid var(--line-soft); border-radius: 10px; }
.caption-mark { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(199,238,112,.35); }
.caption-strip p { margin: 0; color: #b9c5b9; font-size: 11px; line-height: 1.5; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout { min-width: 0; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(27,40,34,.9), rgba(20,30,26,.85)); }
.readout-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #8fa096; font-size: 7px; letter-spacing: .09em; white-space: nowrap; }
.class-tag { color: #738478; font-size: 6px; letter-spacing: .08em; white-space: nowrap; }
.readout-value { margin-top: 8px; color: #edf3e8; font-size: clamp(17px, 1.9vw, 23px); font-weight: 580; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: #9cab9d; font-size: 10px; letter-spacing: 0; font-weight: 500; }
.readout-foot { margin-top: 6px; color: #718177; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-strip { display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 5px 10px; border-top: 1px solid var(--line-soft); color: #a8b6aa; font-size: 9px; font-variant-numeric: tabular-nums; }
.check-label { color: var(--accent); font-size: 7px; white-space: nowrap; }
.check-pass { margin-left: auto; color: var(--accent); font-size: 7px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.control-section { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(24,36,31,.95), rgba(19,29,25,.96)); padding: 13px 14px; }
.section-heading.compact { min-height: 31px; }
.section-heading.compact h2 { font-size: 14px; }
.section-glyph { color: var(--accent); font-size: 22px; opacity: .8; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.preset-button { display: flex; align-items: center; gap: 9px; min-width: 0; text-align: left; padding: 9px 9px; border: 1px solid #35463b; border-radius: 9px; background: rgba(16,25,21,.55); cursor: pointer; transition: border-color .22s ease, background .22s ease, transform .22s ease; }
.preset-button:hover { border-color: #6e8551; background: rgba(39,56,39,.55); }
.preset-button:active { transform: translateY(1px); }
.preset-button.active { border-color: var(--accent-line); background: var(--accent-soft); }
.preset-symbol { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 7px; color: var(--accent); background: rgba(199,238,112,.1); font-size: 15px; }
.quiet-symbol { color: #9ca99d; background: rgba(156,169,157,.08); }
.preset-button b { display: block; font-size: 10px; font-weight: 650; color: #dbe5d8; }
.preset-button small { display: block; margin-top: 3px; color: #84948a; font-size: 8px; }
.control-list { display: grid; gap: 11px; margin-top: 13px; }
.control-item { min-width: 0; }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.control-label-row label { color: #d3ddd2; font-size: 10px; font-weight: 580; }
.control-label-row output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; padding: 0; appearance: none; -webkit-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(199,238,112,.75), #405247); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, rgba(199,238,112,.75), #405247); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #19241e; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(199,238,112,.5), 0 0 10px rgba(199,238,112,.28); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #19241e; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(199,238,112,.5); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; align-items: center; margin-top: 1px; color: #697a70; font-size: 7px; letter-spacing: .04em; font-weight: 550; }
.range-ends .class-tag { margin-left: auto; }
.transport-note { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: #84948a; font-size: 9px; line-height: 1.45; }
.transport-icon { color: var(--accent); font-size: 15px; }
.playback-section { padding: 12px 14px 10px; }
.playback-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.time-display { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; color: #edf4e7; font-size: 20px; font-weight: 620; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.time-display small { color: #7d8c81; font-size: 7px; font-weight: 700; letter-spacing: .11em; }
.quality-control { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #344239; border-radius: 7px; }
.quality-control > span { margin: 0 4px 0 3px; color: #77877c; font-size: 7px; }
.quality-control button { border: 0; border-radius: 4px; padding: 5px 6px; color: #8b9a8e; background: transparent; font-size: 7px; letter-spacing: .08em; font-weight: 800; cursor: pointer; }
.quality-control button[aria-pressed="true"] { color: #e4f0d2; background: rgba(199,238,112,.15); }
.transport-controls { display: grid; grid-template-columns: 1.15fr 1fr .8fr 38px; gap: 6px; margin-top: 11px; }
.transport-controls button { min-height: 34px; border-radius: 8px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.transport-controls button:active { transform: translateY(1px); }
.primary-control { display: flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #1b2718; font-size: 10px; font-weight: 800; }
.primary-control:hover { background: #d7f68f; }
.primary-control span:first-child { font-size: 9px; }
.secondary-control, .icon-control { border: 1px solid #3a4a40; background: rgba(14,22,18,.55); color: #c0cdc0; font-size: 9px; font-weight: 650; }
.secondary-control:hover, .icon-control:hover { border-color: #70845a; background: rgba(49,67,47,.55); }
.secondary-control small { display: block; margin-top: 1px; color: #809087; font-size: 7px; font-weight: 500; }
.icon-control { font-size: 16px; }
.progress-track { height: 3px; margin-top: 11px; overflow: hidden; border-radius: 5px; background: #2c3b32; }
.progress-track div { height: 100%; width: 0; border-radius: inherit; background: var(--accent); box-shadow: 0 0 8px rgba(199,238,112,.5); transition: width .12s linear; }
.playback-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #728178; font-size: 6px; letter-spacing: .09em; white-space: nowrap; }
.playback-foot .class-tag { margin-left: 3px; }
.science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(21,32,27,.92); overflow: hidden; }
.science-panel summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--accent-line); border-radius: 8px; color: var(--accent); font-size: 15px; }
.science-panel summary b { display: block; color: #dbe5d8; font-size: 10px; font-weight: 650; }
.science-panel summary small { display: block; margin-top: 3px; color: #819087; font-size: 8px; }
.summary-chevron { margin-left: auto; color: var(--muted); font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 14px 13px; border-top: 1px solid var(--line-soft); }
.science-content h3 { margin: 13px 0 6px; color: #c9d7c7; font-size: 10px; font-weight: 700; }
.science-content p { margin: 6px 0; color: #91a095; font-size: 9px; line-height: 1.55; }
.science-content .equation { padding: 7px 8px; border-left: 2px solid var(--accent-line); border-radius: 0 5px 5px 0; background: rgba(199,238,112,.055); color: #d5e3cf; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.constants-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.constants-grid > div { padding: 7px; border: 1px solid var(--line-soft); border-radius: 6px; }
.constants-grid b { display: block; color: #c9d6c8; font-size: 8px; font-weight: 650; }
.constants-grid small { display: block; margin-top: 4px; color: #718278; font-size: 6px; letter-spacing: .08em; }
.science-content .disclaimer { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line-soft); color: #bdcaaf; font-style: italic; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; padding: 1px 3px 3px; color: #5e6f64; font-size: 6px; letter-spacing: .1em; }
.footer { display: flex; justify-content: space-between; padding: 7px 22px 9px; color: #5c6c62; border-top: 1px solid rgba(169,197,174,.08); font-size: 7px; letter-spacing: .11em; }
.footer b { color: var(--accent); font-weight: 500; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 1500px) { .workspace { gap: 18px; padding: 18px 24px 12px; } .stage { min-height: 390px; } .control-section { padding: 15px 17px; } }
@media (max-width: 900px) { .topbar { grid-template-columns: 1fr 1.2fr; } .top-status { display: none; } .workspace { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .95fr); padding-inline: 12px; } .legend { gap: 9px; font-size: 8px; } .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .readout-value { font-size: 19px; } }
@media (max-width: 680px) {
  .app-shell { min-height: 100vh; }
  .topbar { min-height: 62px; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 12px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-name { font-size: 9px; }
  .eyebrow { font-size: 7px; }
  .heading-block { justify-self: end; text-align: right; }
  .heading-block h1 { font-size: 14px; }
  .heading-block p { font-size: 9px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; overflow: visible; }
  .visual-column { flex: none; gap: 8px; }
  .control-column { flex: none; overflow: visible; padding: 0; }
  .section-heading { min-height: 30px; }
  .section-heading h2 { font-size: 14px; }
  .legend { gap: 8px; font-size: 7px; }
  .legend-item { gap: 4px; }
  .legend-item i { width: 11px; }
  .stage { flex: none; height: clamp(220px, 31vh, 270px); min-height: 220px; }
  .stage-corner { top: 9px; }
  .stage-corner-left { left: 10px; }
  .stage-corner-right { right: 10px; }
  .corner-label { font-size: 7px; }
  .corner-sub { font-size: 6px; }
  .stage-corner-right { font-size: 7px; }
  .stage-scale-note { display: none; }
  .caption-strip { min-height: 42px; padding: 8px 10px; }
  .caption-strip p { font-size: 10px; }
  .readout-grid { gap: 6px; }
  .readout { padding: 8px 9px; }
  .readout-top { font-size: 6px; }
  .readout-value { margin-top: 6px; font-size: 18px; }
  .readout-foot { margin-top: 4px; font-size: 7px; }
  .check-strip { flex-wrap: wrap; gap: 5px 9px; padding: 6px 3px; font-size: 8px; }
  .check-label { width: 100%; }
  .check-pass { margin-left: auto; }
  .control-section { padding: 12px; }
  .control-list { gap: 12px; }
  .control-label-row label, .control-label-row output { font-size: 10px; }
  .transport-note { font-size: 8px; }
  .playback-foot { font-size: 6px; }
  .panel-foot { padding-bottom: 4px; }
  .footer { display: none; }
}
@media (max-width: 370px) {
  .legend { display: none; }
  .preset-button { padding: 8px 6px; gap: 6px; }
  .preset-button b { font-size: 9px; }
  .playback-foot { letter-spacing: .04em; }
  .quality-control > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .workspace { min-height: 0; overflow: hidden; }
@media (max-width: 680px) {
  body.embed-mode .workspace { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  body.embed-mode .control-column { padding-bottom: 4px; }
}
.control-column > * { flex: 0 0 auto; }
.range-ends .class-tag { margin-left: 0; }
