:root {
  color-scheme: dark;
  --bg: #090f14;
  --panel: #101920;
  --panel-2: #131f28;
  --panel-3: #17242d;
  --line: #263640;
  --line-soft: rgba(145, 165, 176, .13);
  --text: #e8edf0;
  --muted: #8798a2;
  --dim: #5e707b;
  --accent: #d6ad69;
  --accent-soft: rgba(214, 173, 105, .12);
  --accent-line: rgba(214, 173, 105, .42);
  --good: #b8c8bc;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; 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 { width: 100%; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 30% 12%, rgba(37, 57, 67, .2), transparent 48%), var(--bg); }
.topbar { flex: 0 0 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: rgba(9, 15, 20, .96); }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(214,173,105,.42); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); }
.brand-mark span { width: 2px; border-radius: 2px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 11px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .7; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .science-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; line-height: 1.35; }
h1 { margin: 3px 0 0; font-size: 18px; line-height: 1.2; letter-spacing: -.025em; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.era-tag, .illustrative-tag { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.illustrative-tag { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(350px, .92fr); gap: 14px; padding: 14px 18px 10px; }
.visual-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.stage-toolbar { flex: 0 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-switch, .speed-switch, .quality-switch { display: inline-flex; gap: 3px; padding: 3px; background: #0e171e; border: 1px solid var(--line); border-radius: 8px; }
.view-btn, .speed-switch button, .quality-switch button { border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 650; padding: 7px 11px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.view-btn:hover, .speed-switch button:hover, .quality-switch button:hover { color: var(--text); }
.view-btn.active, .speed-switch button.active, .quality-switch button.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(214,173,105,.19); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #101920; color: #b7c3c9; cursor: pointer; font-size: 10px; font-weight: 650; transition: border-color .18s ease, color .18s ease; }
.icon-button:hover { color: var(--accent); border-color: var(--accent-line); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.canvas-wrap { position: relative; min-height: 0; flex: 1; overflow: hidden; border: 1px solid #25343d; border-radius: 13px; background: radial-gradient(ellipse at 50% 45%, rgba(31,47,55,.42), rgba(11,18,24,.88) 67%); box-shadow: 0 18px 55px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.025); }
#instrumentCanvas { display: block; width: 100%; height: 100%; }
.canvas-topline { position: absolute; top: 14px; left: 16px; display: flex; align-items: center; gap: 8px; color: #8d9ba3; font-size: 9px; font-weight: 700; letter-spacing: .13em; pointer-events: none; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(214,173,105,.55); }
.live-dot.paused { background: #74848c; box-shadow: none; }
.canvas-legend { position: absolute; right: 15px; bottom: 13px; display: flex; flex-direction: column; gap: 7px; color: #8c9aa2; font-size: 9px; pointer-events: none; }
.canvas-legend span { display: flex; align-items: center; gap: 7px; }
.legend-line { width: 16px; height: 2px; display: inline-block; }
.legend-line.gold { background: var(--accent); }
.legend-line.white { background: #c8d2d7; }
.stage-foot { flex: 0 0 17px; display: flex; justify-content: space-between; gap: 12px; color: #647680; font-size: 8px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.stage-foot span { overflow: hidden; text-overflow: ellipsis; }
.console { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 12px 0; scrollbar-width: thin; scrollbar-color: #344650 transparent; }
.console::-webkit-scrollbar { width: 5px; }
.console::-webkit-scrollbar-thumb { background: #344650; border-radius: 5px; }
.console-section { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19,31,40,.96), rgba(14,23,30,.96)); padding: 14px; margin-bottom: 10px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
h2 { margin: 4px 0 0; font-size: 15px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.status-chip, .parameter-tag { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 5px 7px; font-size: 8px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; border: 1px solid rgba(129,151,162,.14); background: rgba(8,15,20,.34); border-radius: 8px; padding: 10px 10px 9px; }
.primary-readout { grid-column: span 2; padding: 11px 12px; background: linear-gradient(105deg, rgba(214,173,105,.075), rgba(8,15,20,.35)); border-color: rgba(214,173,105,.22); }
.readout-label { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: #91a0a8; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.readout-label span { color: #697b85; font-size: 7px; letter-spacing: .08em; }
.readout-value { margin-top: 5px; color: #e6ecef; font-size: 22px; font-weight: 570; letter-spacing: -.045em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.primary-readout .readout-value { color: var(--accent); font-size: 25px; }
.readout-value small { color: #98a8b0; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.readout-note { margin-top: 4px; color: #687b85; font-size: 9px; }
.audit-strip { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; margin-top: 8px; border-radius: 8px; background: rgba(184,200,188,.055); border: 1px solid rgba(184,200,188,.15); }
.audit-icon { flex: 0 0 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; color: #c4d0c6; background: rgba(184,200,188,.12); font-size: 10px; font-weight: 800; }
.audit-copy { min-width: 0; }
.audit-title { color: #aab8b1; font-size: 8px; font-weight: 750; letter-spacing: .11em; }
.audit-values { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px; color: #83938c; font-size: 9px; font-variant-numeric: tabular-nums; }
.audit-values b { color: #d4ded7; font-weight: 650; }
.audit-delta { color: #c7d2ca; font-weight: 700; }
.caption-box { margin-top: 8px; padding: 9px 11px; border-left: 2px solid var(--accent); background: rgba(214,173,105,.055); color: #aebbc1; font-size: 10px; line-height: 1.5; min-height: 52px; }
.caption-mark { display: block; margin-bottom: 3px; color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.compact-heading { align-items: center; margin-bottom: 10px; }
.parameter-tag { color: #82939c; background: rgba(125,145,155,.08); border-color: rgba(125,145,155,.2); font-size: 7px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 13px; }
.preset-btn { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8,15,20,.32); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-btn:hover { border-color: #63717a; }
.preset-btn.selected { border-color: var(--accent-line); background: var(--accent-soft); }
.preset-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid rgba(214,173,105,.24); border-radius: 6px; color: var(--accent); font-size: 14px; }
.preset-btn b { display: block; font-size: 9px; font-weight: 700; color: #dce3e6; }
.preset-btn small { display: block; margin-top: 3px; color: #7c8c95; font-size: 8px; line-height: 1.2; }
.control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 15px; row-gap: 11px; }
.control-row { min-width: 0; }
.control-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.control-head label { color: #b6c2c8; font-size: 9px; font-weight: 600; line-height: 1.25; }
.control-head output { color: var(--accent); font-size: 9px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; display: block; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(214,173,105,.78), rgba(214,173,105,.18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(214,173,105,.78), rgba(214,173,105,.18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #0d151b; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #0d151b; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.range-ends { display: flex; justify-content: space-between; color: #60727c; font-size: 7px; margin-top: 1px; }
.motion-controls { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr .72fr; gap: 6px; }
.transport-btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; height: 31px; border: 1px solid var(--line); border-radius: 7px; background: #0e171e; color: #b4c0c6; cursor: pointer; font-size: 9px; font-weight: 650; transition: all .18s ease; }
.transport-btn:hover { border-color: #677780; color: var(--text); }
.primary-transport { color: #141a1d; background: var(--accent); border-color: var(--accent); }
.primary-transport:hover { color: #141a1d; background: #e3bd7c; border-color: #e3bd7c; }
.primary-transport svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.reset-btn { color: #8b9aa2; }
.speed-row, .quality-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.speed-row > span, .quality-row > span:first-child { color: #74858e; font-size: 7px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; }
.speed-switch { padding: 2px; }
.speed-switch button { padding: 5px 8px; font-size: 8px; }
.quality-row { padding-top: 9px; border-top: 1px solid var(--line-soft); }
.quality-switch { padding: 2px; }
.quality-switch button { padding: 4px 8px; font-size: 8px; }
.sim-clock { color: #71818a; font-size: 8px; font-variant-numeric: tabular-nums; letter-spacing: .07em; white-space: nowrap; }
.science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #101920; margin-bottom: 8px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer; color: #c4cfd4; font-size: 9px; font-weight: 750; letter-spacing: .14em; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-chevron { color: var(--accent); font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .science-chevron { transform: rotate(180deg); }
.science-content { padding: 0 14px 14px; color: #aab7bd; font-size: 10px; line-height: 1.55; }
.science-content p { margin: 8px 0; }
.science-content .science-small { color: #8798a1; font-size: 9px; }
.equation { padding: 8px 10px; margin: 6px 0; border: 1px solid rgba(214,173,105,.16); border-radius: 6px; background: rgba(214,173,105,.045); color: #e0c18f; font-family: "Times New Roman", serif; font-size: 14px; text-align: center; }
.science-disclaimer { padding-top: 8px; margin-top: 11px !important; border-top: 1px solid var(--line-soft); color: #c3cdd1; font-size: 9px; }
.footer-bar { flex: 0 0 22px; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; color: #52636c; font-size: 7px; font-weight: 750; letter-spacing: .14em; }
.footer-bar i { color: var(--accent); font-style: normal; padding: 0 4px; }
@media (max-width: 1040px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0, 1.35fr) minmax(330px, .95fr); padding-left: 12px; padding-right: 12px; gap: 10px; }
  .topbar { padding: 0 16px; }
  .console-section { padding: 11px; }
  .control-list { column-gap: 10px; }
  .view-btn { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { flex: 0 0 58px; padding: 0 12px; gap: 8px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; }
  .eyebrow { font-size: 7px; letter-spacing: .11em; }
  h1 { font-size: 15px; }
  .topbar-right { gap: 5px; }
  .era-tag { display: none; }
  .illustrative-tag { padding: 6px 7px; font-size: 7px; }
  .workspace { display: flex; flex-direction: column; gap: 8px; padding: 8px 9px 5px; min-height: 0; }
  .visual-column { flex: 0 0 42%; min-height: 245px; gap: 6px; }
  .stage-toolbar { flex: 0 0 32px; gap: 5px; }
  .view-switch { gap: 1px; padding: 2px; }
  .view-btn { padding: 6px 7px; font-size: 8px; }
  .icon-button { height: 28px; padding: 0 7px; font-size: 8px; }
  .icon-button svg { width: 12px; height: 12px; }
  .canvas-wrap { flex: 1; min-height: 0; border-radius: 9px; }
  .canvas-topline { top: 9px; left: 10px; font-size: 7px; }
  .canvas-legend { right: 9px; bottom: 8px; font-size: 7px; gap: 4px; }
  .legend-line { width: 11px; }
  .stage-foot { flex: 0 0 12px; font-size: 6px; letter-spacing: .07em; }
  .console { flex: 1 1 auto; min-height: 0; padding-right: 0; }
  .console-section { padding: 10px; margin-bottom: 7px; border-radius: 9px; }
  .section-heading { margin-bottom: 9px; }
  .section-kicker { font-size: 7px; }
  h2 { font-size: 13px; }
  .status-chip { padding: 4px 6px; font-size: 7px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 8px; }
  .primary-readout { padding: 8px 10px; }
  .readout-label { font-size: 7px; }
  .readout-label span { font-size: 6px; }
  .readout-value { font-size: 18px; margin-top: 4px; }
  .primary-readout .readout-value { font-size: 21px; }
  .readout-value small { font-size: 9px; }
  .readout-note { font-size: 8px; margin-top: 2px; }
  .audit-strip { padding: 7px 8px; margin-top: 6px; gap: 7px; }
  .audit-title { font-size: 7px; }
  .audit-values { font-size: 8px; gap: 5px 9px; margin-top: 3px; }
  .caption-box { padding: 7px 9px; margin-top: 6px; min-height: 0; font-size: 9px; }
  .caption-mark { font-size: 6px; }
  .compact-heading { margin-bottom: 8px; }
  .parameter-tag { font-size: 6px; padding: 4px 5px; }
  .preset-row { gap: 5px; margin-bottom: 10px; }
  .preset-btn { padding: 6px; gap: 6px; }
  .preset-icon { width: 21px; height: 21px; flex-basis: 21px; font-size: 12px; }
  .preset-btn b { font-size: 8px; }
  .preset-btn small { font-size: 7px; }
  .control-list { column-gap: 10px; row-gap: 8px; }
  .control-head { margin-bottom: 4px; }
  .control-head label, .control-head output { font-size: 8px; }
  .range-ends { font-size: 6px; }
  .motion-controls { margin-top: 9px; padding-top: 8px; }
  .transport-row { gap: 5px; }
  .transport-btn { height: 28px; font-size: 8px; }
  .speed-row, .quality-row { margin-top: 7px; }
  .speed-switch button, .quality-switch button { padding: 4px 7px; font-size: 7px; }
  .science-panel summary { padding: 10px 12px; font-size: 8px; }
  .science-content { padding: 0 12px 12px; font-size: 9px; }
  .footer-bar { flex: 0 0 17px; padding: 0 10px; font-size: 6px; }
}
@media (max-width: 390px) {
  .visual-column { flex-basis: 40%; min-height: 235px; }
  .view-btn { padding-left: 6px; padding-right: 6px; font-size: 7px; }
  .screenshot-button span { display: none; }
  .control-list { column-gap: 8px; }
  .control-head label, .control-head output { font-size: 7px; }
  .range-ends { font-size: 5px; }
  .readout-value { font-size: 17px; }
  .primary-readout .readout-value { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
