:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #111a22;
  --panel-2: #151f28;
  --line: rgba(173, 195, 210, .13);
  --muted: #8395a3;
  --text: #e8eef2;
  --soft: #b8c6cf;
  --accent: #e4a64b;
  --accent-dim: rgba(228, 166, 75, .14);
  --hot: #f28a4c;
  --cold: #61a9d1;
  --green: #82c6a6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { 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%; min-width: 0; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; display: grid; grid-template-rows: 64px minmax(0, 1fr) 34px; background: radial-gradient(ellipse at 35% 44%, rgba(28, 46, 58, .28), transparent 58%), var(--bg); overflow: hidden; }
.topbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 22, .92); z-index: 3; }
.brand-lockup, .topbar-right, .brand-copy, .footer-left, .footer-right { display: flex; align-items: center; }
.brand-lockup { gap: 13px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(228,166,75,.6); border-radius: 8px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 6px 5px; background: linear-gradient(145deg, rgba(228,166,75,.13), rgba(228,166,75,.02)); }
.brand-mark span { width: 4px; border-radius: 3px 3px 1px 1px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .72; }
.brand-copy { display: block; min-width: 0; }
.eyebrow { font-size: 9px; letter-spacing: .16em; color: #8a9aa6; font-weight: 700; line-height: 1.2; }
.eyebrow span { color: #53616b; padding: 0 4px; }
.brand-title { margin-top: 4px; font-size: 15px; letter-spacing: -.02em; font-weight: 650; white-space: nowrap; }
.topbar-right { gap: 15px; }
.date-chip { font-size: 9px; color: #9eacb6; letter-spacing: .12em; font-weight: 700; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.018); }
.date-chip b { color: #5c6a75; padding: 0 4px; }
.live-dot, .stage-kicker-dot, .phase-pip { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(130,198,166,.55); margin-right: 7px; vertical-align: 1px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: #a9b7c0; }
.icon-button:hover { border-color: rgba(228,166,75,.55); color: var(--accent); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-height: 0; min-width: 0; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 0; }
.stage-panel { min-width: 0; min-height: 0; width: 100%; position: relative; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(ellipse at 48% 48%, rgba(33, 55, 66, .33), transparent 55%), linear-gradient(180deg, rgba(17,27,36,.62), rgba(8,14,19,.5)); }
.stage-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(155,184,201,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(155,184,201,.025) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent); }
.stage-topline { position: absolute; z-index: 2; top: 16px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.stage-kicker { color: #9aaab5; font-size: 9px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.stage-kicker-dot { background: var(--accent); box-shadow: 0 0 9px rgba(228,166,75,.55); }
.view-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid rgba(165,188,204,.16); background: rgba(10,17,23,.82); border-radius: 7px; pointer-events: auto; backdrop-filter: blur(8px); }
.view-button { border: 0; border-radius: 4px; background: transparent; color: #8799a5; padding: 7px 10px; font-size: 10px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.view-button:hover { color: #dbe4e9; }
.view-button.active { background: rgba(228,166,75,.16); color: #f0bf73; box-shadow: inset 0 0 0 1px rgba(228,166,75,.24); }
#machineCanvas { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
.stage-bottomline { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 18px; pointer-events: none; }
.stage-caption { color: #aab9c3; font-size: 11px; line-height: 1.45; max-width: 490px; padding-left: 11px; border-left: 2px solid rgba(228,166,75,.7); text-shadow: 0 1px 8px #081016; }
.stage-coordinates { display: flex; align-items: center; gap: 7px; color: #60717d; font-size: 8px; letter-spacing: .14em; white-space: nowrap; }
.stage-coordinates i { display: block; width: 20px; height: 1px; background: #52616b; }
.stage-watermark { position: absolute; right: 22px; top: 47%; transform: translateY(-50%); color: rgba(161,184,198,.08); font-size: 13px; font-weight: 900; line-height: 1.5; letter-spacing: .28em; text-align: right; pointer-events: none; }
.control-panel { min-height: 0; min-width: 0; width: 100%; background: linear-gradient(180deg, #121b23, #0f171e); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 19px 18px 15px; scrollbar-width: thin; scrollbar-color: #31414d transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #344550; border-radius: 8px; }
.panel-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-heading-row h1 { font-size: 19px; letter-spacing: -.04em; line-height: 1; margin: 6px 0 0; font-weight: 650; }
.phase-pill { padding: 7px 9px; border-radius: 4px; background: rgba(242,138,76,.12); border: 1px solid rgba(242,138,76,.25); color: #f2a16d; font-size: 9px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.phase-pill .phase-pip { background: var(--hot); box-shadow: 0 0 8px rgba(242,138,76,.5); width: 5px; height: 5px; }
.phase-pill.phase-blast { color: #82c1e3; background: rgba(97,169,209,.12); border-color: rgba(97,169,209,.25); }
.phase-pill.phase-blast .phase-pip { background: var(--cold); box-shadow: 0 0 8px rgba(97,169,209,.5); }
.panel-intro { margin: 10px 0 14px; min-height: 34px; color: #9aaab5; font-size: 10.5px; line-height: 1.5; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout { min-width: 0; padding: 10px 10px 9px; background: linear-gradient(145deg, rgba(31,45,56,.7), rgba(20,31,40,.7)); border: 1px solid rgba(163,185,200,.11); border-radius: 6px; }
.readout-primary { border-color: rgba(228,166,75,.26); background: linear-gradient(145deg, rgba(70,54,34,.27), rgba(24,34,42,.8)); }
.readout-label { color: #81939f; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.readout-value { margin-top: 6px; font-size: 24px; line-height: 1; font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; color: #e7edf1; }
.readout-primary .readout-value { color: #f0b36b; }
.readout-value small { margin-left: 4px; color: #91a1ab; font-size: 10px; letter-spacing: 0; font-weight: 600; }
.readout-foot { margin-top: 5px; color: #687b87; font-size: 8px; }
.zone-strip { margin: 12px 1px 16px; display: grid; gap: 5px; }
.zone-line { display: flex; align-items: center; justify-content: space-between; color: #80919d; font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.zone-line b { color: #c9d3d9; font-size: 9px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.zone-track { height: 4px; border-radius: 4px; background: #25343e; overflow: hidden; }
.zone-track span { display: block; width: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #a85c38, #f1a05e); transition: width .25s; }
.zone-track.cold-track span { background: linear-gradient(90deg, #477f9d, #7bbad9); }
.divider-label { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 10px; color: #a8b6bf; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.unit-note { color: #657580; font-size: 7px; letter-spacing: .08em; }
.controls-list { display: grid; gap: 12px; }
.control-row label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #a6b5bf; font-size: 9px; font-weight: 600; }
.control-row label b { color: #e1e8ec; font-size: 9px; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.control-row label em { display: inline-grid; place-items: center; width: 12px; height: 12px; margin-left: 3px; border: 1px solid #546672; border-radius: 50%; color: #8395a0; font-size: 8px; font-style: normal; cursor: help; }
input[type="range"] { width: 100%; height: 13px; margin: 5px 0 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, rgba(228,166,75,.72), rgba(100,120,133,.4)); border-radius: 4px; }
input[type="range"]::-moz-range-track { height: 3px; background: linear-gradient(90deg, rgba(228,166,75,.72), rgba(100,120,133,.4)); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #e8b46e; border: 2px solid #3b3023; box-shadow: 0 0 0 2px rgba(228,166,75,.18); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #e8b46e; border: 2px solid #3b3023; box-shadow: 0 0 0 2px rgba(228,166,75,.18); }
.range-ends { display: flex; justify-content: space-between; color: #627480; font-size: 7px; margin-top: 1px; }
.preset-row { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.preset-label { display: block; color: #80919d; font-size: 8px; letter-spacing: .13em; font-weight: 800; margin-bottom: 7px; }
.preset-buttons { display: flex; gap: 6px; }
.preset-button { flex: 1; border: 1px solid rgba(158,181,196,.15); background: rgba(255,255,255,.02); color: #8798a4; border-radius: 4px; padding: 8px 6px; font-size: 9px; cursor: pointer; transition: .2s; }
.preset-button:hover { border-color: rgba(228,166,75,.45); color: #e2e9ed; }
.preset-button.active { border-color: rgba(228,166,75,.36); color: #eab76d; background: rgba(228,166,75,.09); }
.transport-row { display: grid; grid-template-columns: 1.1fr 1fr .8fr; gap: 6px; margin-top: 12px; }
.transport-button { min-height: 33px; border: 1px solid rgba(160,183,198,.17); background: rgba(255,255,255,.025); border-radius: 4px; color: #9eacb5; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: background .18s, border-color .18s, color .18s; }
.transport-button:hover { color: #e8eef2; border-color: rgba(228,166,75,.45); }
.transport-button.primary { background: rgba(228,166,75,.15); border-color: rgba(228,166,75,.35); color: #f0bd76; }
.play-icon { font-size: 11px; margin-right: 5px; }
.utility-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.utility-button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #738692; padding: 5px 1px; font-size: 7px; letter-spacing: .12em; font-weight: 800; cursor: pointer; }
.utility-button:hover { color: #d4dfe5; }
.utility-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.utility-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 6px rgba(130,198,166,.5); }
.utility-button[aria-pressed="false"] .utility-dot { background: #667984; box-shadow: none; }
.science-panel { margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; cursor: pointer; color: #c2cdd4; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 17px; font-weight: 400; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 13px; color: #9baab4; font-size: 9px; line-height: 1.55; }
.science-content h2 { margin: 1px 0 7px; color: #e0e8ed; font-size: 13px; letter-spacing: -.02em; }
.science-content p { margin: 7px 0; }
.equation-card, .check-card { margin: 9px 0; padding: 9px; background: rgba(25,38,47,.8); border: 1px solid rgba(153,178,194,.12); border-radius: 5px; }
.equation-title { color: #8799a5; font-size: 8px; letter-spacing: .06em; margin-bottom: 6px; }
.equation { color: #e5b878; font-family: Georgia, "Times New Roman", serif; font-size: 13px; padding: 2px 0; overflow-wrap: anywhere; }
.science-note { color: #81929d; }
.check-head { display: flex; align-items: center; justify-content: space-between; color: #c1ccd3; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.check-tag { color: #8cc4a8; font-size: 7px; }
.check-result { color: #e4b879; font-size: 9px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.reference-list { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.reference-title { color: #8799a5; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.reference-list p { color: #748692; font-size: 8px; margin: 6px 0; }
.disclaimer { padding-top: 7px; color: #a0b0ba; font-size: 8px; border-top: 1px solid var(--line); }
.panel-footnote { color: #5f717d; font-size: 7px; letter-spacing: .1em; margin-top: 12px; }
.footerbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid var(--line); background: #0a1016; color: #647681; font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.footer-left { gap: 8px; }
.footer-icon { color: var(--accent); font-size: 12px; }
.footer-sep { color: #3f505b; padding: 0 4px; }
.footer-right { gap: 7px; }
.footer-right b { color: #9cabb5; font-size: 7px; letter-spacing: .08em; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 326px; }
  .panel-scroll { padding-left: 15px; padding-right: 15px; }
}
@media (max-width: 700px) {
  .app-shell { grid-template-rows: 54px minmax(0, 1fr) 27px; }
  .topbar { padding: 0 12px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 6px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  .brand-title { font-size: 13px; margin-top: 3px; }
  .date-chip { display: none; }
  .topbar-right { gap: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(245px, 1fr) minmax(0, 43dvh); }
  .stage-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-topline { top: 9px; left: 10px; right: 10px; gap: 5px; align-items: flex-start; }
  .stage-kicker { font-size: 7px; padding-top: 8px; letter-spacing: .1em; }
  .view-switch { gap: 1px; padding: 2px; }
  .view-button { padding: 6px 7px; font-size: 8px; }
  .stage-bottomline { left: 11px; right: 11px; bottom: 10px; gap: 8px; }
  .stage-caption { font-size: 9px; max-width: 70%; line-height: 1.35; }
  .stage-coordinates { font-size: 6px; gap: 4px; }
  .stage-coordinates i { width: 10px; }
  .stage-watermark { right: 10px; font-size: 9px; }
  .control-panel { min-height: 0; min-width: 0; width: 100%; }
  .panel-scroll { padding: 12px 13px 12px; }
  .panel-heading-row h1 { font-size: 16px; }
  .panel-intro { margin: 7px 0 9px; min-height: 0; font-size: 9px; }
  .readout-grid { gap: 5px; }
  .readout { padding: 7px 8px 6px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 20px; margin-top: 4px; }
  .readout-foot { font-size: 7px; margin-top: 3px; }
  .zone-strip { margin: 8px 1px 10px; gap: 4px; }
  .divider-label { padding-top: 9px; margin-bottom: 8px; }
  .controls-list { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 9px; }
  .control-row label { font-size: 8px; }
  .control-row label b { font-size: 8px; }
  input[type="range"] { margin-top: 3px; }
  .range-ends { font-size: 6px; }
  .preset-row { margin-top: 11px; padding-top: 9px; }
  .transport-row { margin-top: 9px; }
  .transport-button { min-height: 30px; font-size: 7px; }
  .utility-row { margin-top: 5px; }
  .science-panel { margin-top: 7px; }
  .science-panel summary { padding: 9px 0; }
  .panel-footnote { margin-top: 8px; }
  .footerbar { padding: 0 10px; font-size: 6px; }
  .footer-left { gap: 5px; }
  .footer-right { gap: 4px; }
  .footer-right b { font-size: 6px; }
}
@media (max-width: 390px) {
  .stage-coordinates { display: none; }
  .controls-list { column-gap: 9px; }
  .control-row label { font-size: 7.5px; }
  .readout-value { font-size: 18px; }
  .footer-left { max-width: 50%; white-space: nowrap; overflow: hidden; }
  .footer-right { white-space: nowrap; }
}
@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; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; }
