:root {
  color-scheme: dark;
  --bg: #0b1017;
  --panel: #101720;
  --panel-2: #131d28;
  --line: rgba(181, 197, 211, .12);
  --line-strong: rgba(181, 197, 211, .2);
  --text: #e8edf1;
  --muted: #8b9aa8;
  --faint: #596a79;
  --accent: #d6b77a;
  --accent-bright: #edce91;
  --accent-dim: rgba(214,183,122,.13);
  --cyan: #79b7b7;
  --danger: #d18b78;
  --gap: 8px;
  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%; 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-bright); outline-offset: 3px; }
.app-shell { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 35% 20%, rgba(34,49,62,.28), transparent 52%), var(--bg); }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(11,16,23,.96); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(214,183,122,.34); border-radius: 10px; color: var(--accent); background: linear-gradient(145deg, rgba(214,183,122,.1), rgba(214,183,122,.015)); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { min-width: 0; }
.eyebrow, .section-kicker, .caption-kicker { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.2; }
.eyebrow span { color: var(--accent); padding: 0 3px; }
h1 { font-size: 18px; line-height: 1.2; font-weight: 640; letter-spacing: -.035em; margin: 3px 0 0; }
h1 span { color: var(--accent); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.live-indicator { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .14em; font-weight: 750; color: #a6c0b1; padding: 8px 10px; border: 1px solid rgba(121,183,153,.18); border-radius: 6px; background: rgba(121,183,153,.055); }
.live-dot, .telemetry-dot { width: 6px; height: 6px; border-radius: 50%; background: #83c39b; box-shadow: 0 0 9px rgba(131,195,155,.55); }
.quality-switch { display: flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #0d141c; }
.quality-btn { border: 0; border-radius: 4px; background: transparent; color: var(--muted); padding: 6px 10px; font-size: 10px; cursor: pointer; }
.quality-btn.active { color: var(--text); background: #25313c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.icon-action { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: #151f29; color: #d8e0e5; font-size: 11px; cursor: pointer; transition: border-color .18s, background .18s; }
.icon-action:hover { border-color: rgba(214,183,122,.5); background: #1b2732; }
.icon-action svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 364px; gap: 0; }
.stage-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: 54px minmax(0,1fr) 74px; border-right: 1px solid var(--line); }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(15,22,31,.6); }
.view-tabs { display: flex; gap: 5px; height: 100%; align-items: center; }
.view-tab { height: 32px; padding: 0 13px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #8795a2; font-size: 11px; cursor: pointer; transition: color .18s, background .18s, border-color .18s; }
.view-tab:hover { color: var(--text); background: rgba(255,255,255,.035); }
.view-tab.active { color: var(--accent-bright); background: rgba(214,183,122,.09); border-color: rgba(214,183,122,.23); }
.transport-controls { display: flex; align-items: center; gap: 6px; }
.transport-btn { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: #141e28; color: #aab8c3; cursor: pointer; transition: all .18s; }
.transport-btn:hover { border-color: rgba(214,183,122,.45); color: var(--accent-bright); }
.transport-btn.primary { background: var(--accent-dim); color: var(--accent-bright); border-color: rgba(214,183,122,.35); }
.transport-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.canvas-frame { min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 48%, #1a2631 0%, #111a24 49%, #0d141d 100%); }
#machine-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-corner { position: absolute; pointer-events: none; color: rgba(157,174,188,.56); font-size: 8px; font-weight: 750; letter-spacing: .16em; }
.canvas-corner.top-left { top: 16px; left: 18px; display: flex; align-items: center; gap: 8px; }
.canvas-corner.bottom-right { right: 18px; bottom: 14px; font-size: 7px; letter-spacing: .13em; }
.corner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(214,183,122,.5); }
.corner-divider { color: rgba(214,183,122,.55); }
.stage-stamp { position: absolute; right: 18px; top: 14px; width: 31px; height: 40px; border: 1px solid rgba(214,183,122,.17); border-radius: 4px; color: rgba(214,183,122,.42); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 10px/9px Georgia,serif; pointer-events: none; }
.stage-stamp small { font-size: 7px; line-height: 8px; }
.caption-bar { min-height: 74px; display: flex; align-items: center; gap: 13px; padding: 11px 20px; border-top: 1px solid var(--line); background: #0e151e; }
.caption-symbol { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border: 1px solid rgba(214,183,122,.22); border-radius: 7px; color: var(--accent); background: rgba(214,183,122,.06); }
.caption-symbol svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.3; fill: none; stroke-linecap: round; }
.caption-copy { min-width: 0; flex: 1; }
.caption-kicker { font-size: 8px; margin-bottom: 4px; color: #9c8c6f; }
.caption-copy p { margin: 0; color: #c2cbd2; font-size: 11px; line-height: 1.45; max-width: 720px; }
.caption-state { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; color: #93a1ad; font-size: 8px; font-weight: 750; letter-spacing: .13em; }
.control-panel { min-height: 0; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #111a24, #0f1720); scrollbar-width: thin; scrollbar-color: #344452 transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #344452; border-radius: 6px; }
.panel-section { padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading h2 { margin: 4px 0 0; font-size: 15px; line-height: 1.15; font-weight: 620; letter-spacing: -.025em; }
.section-kicker { font-size: 8px; }
.section-index { color: #5f6e7b; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.section-index i { color: var(--accent); font-style: normal; padding: 0 2px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 16px; }
.preset-btn { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 9px 9px; border: 1px solid var(--line); border-radius: 5px; background: #0e161f; color: #98a6b1; font-size: 9px; text-align: left; cursor: pointer; transition: all .18s; }
.preset-btn:hover { border-color: rgba(214,183,122,.32); color: var(--text); }
.preset-btn.active { border-color: rgba(214,183,122,.38); background: rgba(214,183,122,.08); color: #e5d1a7; }
.preset-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #d4b677; box-shadow: 0 0 7px rgba(212,182,119,.4); }
.preset-dot.worn { background: #c18b7b; box-shadow: 0 0 7px rgba(193,139,123,.4); }
.control-list { display: grid; gap: 14px; }
.control-item { min-width: 0; }
.control-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 8px; row-gap: 3px; }
.control-heading label { color: #d5dde3; font-size: 10px; font-weight: 600; }
.value-tag { color: #657786; font-size: 7px; font-weight: 750; letter-spacing: .11em; }
.control-heading output { grid-column: 1 / -1; color: var(--accent-bright); font: 600 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 7px 0 2px; 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, #9d865d var(--fill, 50%), #33424f var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #33424f; }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 4px; background: #9d865d; }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; -webkit-appearance: none; border: 2px solid #111923; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 1px rgba(214,183,122,.5), 0 0 9px rgba(214,183,122,.18); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #111923; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 1px rgba(214,183,122,.5); }
.range-ends { display: flex; justify-content: space-between; color: #596a78; font-size: 7px; font-weight: 700; letter-spacing: .09em; }
.reference-strip { margin-top: 17px; padding: 11px 10px 10px; border: 1px solid rgba(214,183,122,.17); border-radius: 6px; background: linear-gradient(115deg, rgba(214,183,122,.07), rgba(214,183,122,.015)); }
.reference-title { display: flex; align-items: center; justify-content: space-between; color: #a99a7a; font-size: 8px; font-weight: 750; letter-spacing: .13em; }
.reference-title span { color: #c6b080; font-size: 7px; }
.reference-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-top: 9px; }
.reference-values > div { display: flex; flex-direction: column; gap: 3px; }
.reference-values strong { color: #e5d2a7; font: 600 14px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.reference-values strong small { font-size: 9px; color: #ad9b76; }
.reference-values span { color: #74818a; font-size: 6.5px; letter-spacing: .09em; font-weight: 700; }
.telemetry-section { padding-top: 16px; }
.telemetry-section .section-kicker { display: flex; align-items: center; gap: 7px; }
.telemetry-dot { width: 5px; height: 5px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(145deg, rgba(28,41,53,.72), rgba(17,26,36,.8)); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #8999a6; font-size: 7px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.readout-label span { color: #596d7b; font-size: 6px; letter-spacing: .06em; }
.readout-value { margin-top: 7px; color: #e8d4a9; font: 600 20px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.06em; white-space: nowrap; }
.readout-value small { color: #9babb7; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.readout-note { margin-top: 4px; color: #71818d; font-size: 8px; }
.micro-track { height: 2px; margin-top: 8px; background: #2b3945; border-radius: 4px; overflow: hidden; }
.micro-track i { display: block; width: 30%; height: 100%; background: linear-gradient(90deg, #8d7853, #d6b77a); border-radius: 4px; transition: width .18s; }
.check-card { margin-top: 9px; padding: 11px 11px 10px; border: 1px solid rgba(121,183,183,.2); border-radius: 5px; background: linear-gradient(135deg, rgba(121,183,183,.075), rgba(121,183,183,.015)); }
.check-top { display: flex; align-items: center; justify-content: space-between; }
.check-top h3 { margin: 3px 0 0; font-size: 11px; font-weight: 620; }
.check-badge { padding: 4px 6px; border: 1px solid rgba(121,183,183,.25); border-radius: 3px; color: #9ac4c1; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.check-badge.warn { color: #d4a18c; border-color: rgba(209,139,120,.3); background: rgba(209,139,120,.07); }
.check-equation { margin: 10px 0; padding: 7px 8px; border-radius: 4px; background: rgba(0,0,0,.18); color: #c6d9d7; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
.check-equation sub { font-size: 8px; }
.check-values { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.check-values > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.check-values span { color: #738b8c; font-size: 6.5px; font-weight: 750; letter-spacing: .08em; }
.check-values strong { color: #cbd8d5; font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.check-values .check-delta strong { color: #a9d0c3; }
.check-foot { margin-top: 8px; color: #71858a; font-size: 8px; line-height: 1.4; }
.science-section { padding-top: 16px; }
.science-details { border: 1px solid var(--line); border-radius: 5px; background: rgba(7,12,18,.22); }
.science-details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; color: #c6d0d8; font-size: 10px; cursor: pointer; }
.science-details summary::-webkit-details-marker { display: none; }
.chevron { width: 7px; height: 7px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.science-details[open] .chevron { transform: rotate(225deg) translate(-2px,-1px); }
.science-content { padding: 0 11px 12px; color: #a1afb9; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 9px 0 0; }
.science-content b { color: #d2dce2; font-weight: 650; }
.science-intro { color: #c1cbd2; }
.equation-block { display: grid; gap: 7px; margin-top: 11px; padding: 10px; border-left: 2px solid rgba(214,183,122,.5); background: rgba(214,183,122,.045); }
.equation-block > .equation-heading { display: block; color: #9c8d6e; font-size: 7px; font-weight: 750; letter-spacing: .1em; padding-bottom: 2px; }
.equation-block > div { display: grid; grid-template-columns: 98px minmax(0,1fr); gap: 7px; align-items: baseline; }
.equation-name { color: #9c8d6e; font-size: 8px; }
.equation-block code { color: #d8c9a8; font-size: 8px; white-space: normal; overflow-wrap: anywhere; }
.disclaimer { padding-top: 8px; border-top: 1px solid var(--line); color: #c3ad80; font-style: italic; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; padding: 12px 18px 14px; color: #596b78; font-size: 7px; font-weight: 750; letter-spacing: .11em; }
.panel-footer i { color: var(--accent); font-style: normal; }
@media (max-width: 1050px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; }
  .panel-section { padding-left: 14px; padding-right: 14px; }
  .readout-value { font-size: 18px; }
}
@media (max-width: 700px) {
  body { overflow: auto; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { height: 100%; min-height: 0; }
  .topbar { height: 54px; flex-basis: 54px; padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 15px; }
  .top-actions { gap: 6px; }
  .live-indicator { padding: 6px 7px; font-size: 7px; gap: 5px; }
  .quality-switch { padding: 2px; }
  .quality-btn { padding: 5px 7px; font-size: 9px; }
  .icon-action { width: 31px; height: 31px; justify-content: center; padding: 0; }
  .icon-action span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 0; min-height: 0; overflow: hidden; }
  .stage-column { flex: 0 0 49%; min-height: 280px; grid-template-rows: 42px minmax(0,1fr) 58px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-toolbar { padding: 0 10px; }
  .view-tab { height: 29px; padding: 0 9px; font-size: 9px; }
  .transport-controls { gap: 4px; }
  .transport-btn { width: 28px; height: 28px; }
  .canvas-corner.top-left { top: 10px; left: 11px; font-size: 6px; gap: 5px; }
  .canvas-corner.bottom-right { right: 10px; bottom: 8px; font-size: 6px; }
  .stage-stamp { right: 9px; top: 9px; transform: scale(.8); transform-origin: top right; }
  .caption-bar { min-height: 58px; padding: 7px 10px; gap: 8px; }
  .caption-symbol { width: 25px; height: 25px; flex-basis: 25px; }
  .caption-copy p { font-size: 9px; line-height: 1.35; }
  .caption-kicker { font-size: 7px; margin-bottom: 3px; }
  .caption-state { padding: 5px 6px; font-size: 6px; }
  .control-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .panel-section { padding: 13px 13px 12px; }
  .section-heading h2 { font-size: 13px; }
  .preset-btn { padding: 8px; font-size: 8px; }
  .control-list { gap: 11px; }
  .reference-strip { margin-top: 12px; }
  .telemetry-section { padding-top: 12px; }
  .readout-value { font-size: 18px; }
  .readout-card { padding: 9px; }
  .science-section { padding-top: 12px; }
  .panel-footer { padding: 10px 13px 12px; }
  body.embed-mode .stage-column { flex-basis: 47%; min-height: 280px; }
}
@media (max-width: 380px) {
  .brand-lockup { gap: 8px; }
  .live-indicator { display: none; }
  .view-tab { padding: 0 7px; }
  .readout-label { font-size: 6.5px; }
  .readout-label span { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
