:root {
  color-scheme: dark;
  --bg: #0a1017;
  --panel: #111a24;
  --panel-2: #151f2a;
  --line: #263544;
  --line-soft: rgba(120, 150, 174, .15);
  --text: #e8eef2;
  --muted: #8fa2b1;
  --dim: #617585;
  --accent: #e6a65a;
  --accent-2: #f2c17b;
  --hot: #f08c56;
  --cold: #62b8d1;
  --green: #9dc9a9;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { width: 100%; 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-2); outline-offset: 3px; }
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 88px auto;
  gap: 0;
  background: radial-gradient(ellipse at 45% -25%, rgba(56, 79, 98, .2), transparent 55%), var(--bg);
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 15, 22, .9);
  min-width: 0;
}
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(230,166,90,.45); border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 5px; background: linear-gradient(145deg, rgba(230,166,90,.14), rgba(230,166,90,.02)); }
.brand-mark span { display: block; width: 4px; border-radius: 2px 2px 0 0; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .6; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .8; }
.eyebrow { font-size: 9px; line-height: 1.2; letter-spacing: .16em; font-weight: 750; color: var(--muted); }
h1 { margin: 3px 0 0; font-size: 16px; line-height: 1; letter-spacing: -.02em; font-weight: 650; white-space: nowrap; }
h1 span { color: #9eb0bc; font-weight: 450; }
.top-meta { display: flex; align-items: center; gap: 16px; }
.era-tag, .model-tag { font-size: 9px; letter-spacing: .11em; color: #8194a3; font-weight: 700; white-space: nowrap; }
.model-tag { display: flex; align-items: center; gap: 7px; color: #a9c2b2; }
.model-tag i { width: 6px; height: 6px; border-radius: 50%; background: #9ac5a6; box-shadow: 0 0 10px rgba(154,197,166,.65); }
.workspace { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; padding: 14px 16px 12px; }
.stage-panel, .control-panel { min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(20,31,43,.98), rgba(13,21,30,.98)); overflow: hidden; }
.stage-panel { display: grid; grid-template-rows: 48px minmax(0,1fr) 62px; position: relative; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line-soft); gap: 12px; min-width: 0; }
.stage-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-index { color: var(--accent); font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .9; }
.stage-title { font-size: 13px; font-weight: 600; margin-top: 3px; color: #dbe4e9; }
.view-tabs { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(117,143,163,.18); border-radius: 8px; background: rgba(6,12,18,.55); }
.view-tab { border: 0; background: transparent; color: #8395a3; border-radius: 5px; padding: 7px 9px; font-size: 10px; font-weight: 650; cursor: pointer; transition: color .2s ease, background .2s ease; }
.view-tab:hover { color: var(--text); }
.view-tab.active { color: #f4d3a8; background: rgba(230,166,90,.14); box-shadow: inset 0 0 0 1px rgba(230,166,90,.18); }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 47% 45%, rgba(48,69,83,.18), transparent 58%), linear-gradient(180deg, rgba(7,13,19,.22), rgba(7,13,19,.02)); }
#scene { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-corner { position: absolute; top: 10px; z-index: 2; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; color: rgba(156,176,190,.65); pointer-events: none; }
.canvas-corner-left { left: 13px; display: flex; align-items: center; gap: 7px; color: #d8c09e; }
.canvas-corner-right { right: 13px; }
.corner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cold); box-shadow: 0 0 8px rgba(98,184,209,.55); }
.caption-row { display: flex; align-items: center; gap: 11px; padding: 9px 15px; border-top: 1px solid var(--line-soft); background: rgba(9,15,22,.48); min-width: 0; }
.caption-icon { width: 26px; height: 26px; border: 1px solid rgba(230,166,90,.28); border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.caption-icon span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(230,166,90,.5); }
.caption-copy { min-width: 0; flex: 1; }
.caption-copy p { margin: 4px 0 0; color: #b3c0c8; font-size: 11px; line-height: 1.35; }
.cycle-readout { flex: 0 0 auto; padding-left: 12px; border-left: 1px solid var(--line); text-align: right; }
.cycle-readout strong { display: block; margin-top: 4px; color: #e7d0ad; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.control-panel { display: flex; flex-direction: column; padding: 14px 14px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a4b59 transparent; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head h2 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.02em; font-weight: 620; }
.illustrative-chip { padding: 4px 6px; border: 1px solid rgba(230,166,90,.23); border-radius: 5px; color: #d8b783; background: rgba(230,166,90,.07); font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; white-space: nowrap; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 14px; }
.preset-button { 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(6,12,18,.28); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.preset-button:hover { border-color: #526879; }
.preset-button.active { border-color: rgba(230,166,90,.55); background: rgba(230,166,90,.075); }
.preset-button b { display: block; font-size: 9px; line-height: 1.2; color: #d7e0e5; font-weight: 700; }
.preset-button small { display: block; margin-top: 4px; color: #8294a2; font-size: 8px; line-height: 1.2; white-space: nowrap; }
.preset-glyph { width: 20px; height: 20px; flex: 0 0 auto; position: relative; border: 1px solid rgba(230,166,90,.28); border-radius: 6px; }
.balanced-glyph::before, .balanced-glyph::after { content: ""; position: absolute; left: 4px; right: 4px; height: 3px; border-radius: 2px; background: var(--accent); }
.balanced-glyph::before { top: 5px; opacity: .55; }.balanced-glyph::after { bottom: 5px; }
.rapid-glyph::before { content: ""; position: absolute; width: 7px; height: 7px; border-top: 2px solid var(--cold); border-right: 2px solid var(--cold); transform: rotate(45deg); top: 5px; left: 5px; }
.rapid-glyph::after { content: ""; position: absolute; height: 2px; width: 9px; background: var(--cold); left: 4px; top: 9px; }
.control-list { display: flex; flex-direction: column; gap: 12px; }
.control-item { min-width: 0; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-label-row label { color: #c9d4da; font-size: 10px; font-weight: 620; }
.control-label-row output { color: #e9c18b; font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
input[type="range"] { width: 100%; height: 12px; margin: 0; display: block; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(230,166,90,.8), rgba(90,121,143,.45)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(230,166,90,.8), rgba(90,121,143,.45)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border: 2px solid #f3d1a0; border-radius: 50%; margin-top: -4px; background: #182330; box-shadow: 0 0 0 3px rgba(230,166,90,.12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #f3d1a0; border-radius: 50%; background: #182330; box-shadow: 0 0 0 3px rgba(230,166,90,.12); }
.range-ends { display: flex; justify-content: space-between; margin-top: 3px; color: #607482; font: 8px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.run-controls { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; }
.primary-action, .icon-action, .quality-action { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: rgba(5,11,17,.35); cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.primary-action { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border-color: rgba(230,166,90,.48); color: #f2d5ae; background: rgba(230,166,90,.12); font-size: 10px; font-weight: 700; flex: 1; }
.primary-action:hover { background: rgba(230,166,90,.2); border-color: var(--accent); }
.icon-action { width: 34px; flex: 0 0 34px; display: grid; place-items: center; color: #9aabb7; }
.icon-action:hover, .quality-action:hover { border-color: #587082; background: rgba(89,119,140,.12); color: var(--text); }
.quality-action { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: #9db3a6; font-size: 9px; font-weight: 650; white-space: nowrap; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; background: #a6c6a9; box-shadow: 0 0 7px rgba(166,198,169,.45); }
.quality-action[aria-pressed="false"] .quality-dot { background: #7c8d9a; box-shadow: none; }
.play-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; }
.primary-action.is-playing .play-icon { width: 8px; height: 10px; border: 0; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.step-icon { width: 10px; height: 10px; position: relative; }
.step-icon::before { content: ""; position: absolute; top: 1px; left: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid currentColor; }
.step-icon::after { content: ""; position: absolute; top: 1px; right: 0; width: 2px; height: 8px; background: currentColor; }
.reset-icon { width: 11px; height: 11px; border: 1.6px solid currentColor; border-right-color: transparent; border-radius: 50%; position: relative; transform: rotate(35deg); }
.reset-icon::after { content: ""; position: absolute; right: -2px; top: -2px; border-top: 4px solid currentColor; border-left: 4px solid transparent; }
.camera-icon { width: 13px; height: 9px; border: 1.4px solid currentColor; border-radius: 2px; position: relative; }
.camera-icon::before { content: ""; position: absolute; width: 5px; height: 5px; border: 1.3px solid currentColor; border-radius: 50%; left: 3px; top: 1px; }
.camera-icon::after { content: ""; position: absolute; width: 5px; height: 2px; background: currentColor; left: 2px; top: -3px; border-radius: 2px 2px 0 0; }
.keyboard-hint { margin-top: 8px; color: #647785; font-size: 8px; letter-spacing: .02em; text-align: center; }
.keyboard-hint span { display: inline-block; padding: 2px 4px; border: 1px solid rgba(115,140,158,.22); border-radius: 3px; margin: 0 3px 0 6px; color: #a5b5bf; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.metrics-strip { min-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; padding: 0 16px 12px; min-width: 0; }
.metric-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, rgba(19,30,41,.95), rgba(12,20,28,.95)); padding: 10px 13px 8px; }
.metric-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.metric-symbol { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.heat-symbol { color: var(--hot); background: rgba(240,140,86,.12); }.ratio-symbol { color: var(--accent); background: rgba(230,166,90,.12); }.store-symbol { color: #c1a9dc; background: rgba(193,169,220,.12); }.pressure-symbol { color: var(--cold); background: rgba(98,184,209,.12); }
.metric-top .eyebrow { font-size: 8px; white-space: nowrap; }
.metric-class { margin-left: auto; color: #657a88; font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.metric-value { margin-top: 6px; color: #e7edf0; font: 600 21px/.95 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.06em; white-space: nowrap; }
.metric-value small { color: #91a3af; font-size: 10px; letter-spacing: 0; }
.metric-note { margin-top: 5px; color: #6f8391; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.science-footer { position: relative; z-index: 6; min-height: 38px; border-top: 1px solid var(--line-soft); background: rgba(8,14,20,.85); }
.science-footer details { width: 100%; }
.science-footer summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 20px; color: #b8c5cc; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.science-footer summary::-webkit-details-marker { display: none; }
.science-mark { color: var(--accent); font: 600 15px/1 Georgia, serif; }
.science-summary-note { color: #647987; font-size: 8px; font-weight: 500; letter-spacing: .04em; }
.chevron { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid #8295a1; border-bottom: 1.5px solid #8295a1; transform: rotate(45deg); transition: transform .2s ease; }
details[open] .chevron { transform: rotate(225deg); }
.science-content { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.25fr; gap: 18px; padding: 5px 20px 17px; max-height: 220px; overflow: auto; border-top: 1px solid var(--line-soft); scrollbar-width: thin; scrollbar-color: #3a4b59 transparent; }
.science-footer details[open] .science-content { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 7; background: rgba(9,15,22,.985); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -12px 30px rgba(0,0,0,.32); }
.science-column { min-width: 0; }
.science-column h3 { margin: 10px 0 7px; color: #d9e1e5; font-size: 10px; font-weight: 700; }
.science-column p { margin: 5px 0; color: #8294a0; font-size: 9px; line-height: 1.45; }
.science-column code { color: #e4c28f; font: 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: normal; }
.audit-values { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); color: #8395a0; font-size: 8px; }
.audit-values b { color: #e6c28f; font: 600 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.science-column .disclaimer { color: #b5c5b7; font-weight: 600; }
@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1fr) 300px; gap: 10px; padding: 10px; }
  .topbar { padding: 0 15px; }
  .control-panel { padding: 11px; }
  .preset-button { padding: 6px; }
  .science-content { gap: 10px; padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 700px) {
  .app-shell { grid-template-rows: 50px minmax(0,1fr) 130px 35px; }
  .topbar { padding: 0 12px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 13px; }
  .top-meta { gap: 0; }
  .era-tag { display: none; }
  .model-tag { font-size: 8px; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(205px,1fr) 300px; gap: 8px; padding: 8px 8px 7px; }
  .stage-panel { grid-template-rows: 40px minmax(0,1fr) 52px; }
  .stage-toolbar { padding: 0 9px; gap: 5px; }
  .stage-title { font-size: 11px; }
  .section-index { font-size: 10px; }
  .view-tabs { gap: 1px; padding: 2px; }
  .view-tab { padding: 6px 6px; font-size: 8px; }
  .canvas-corner { top: 7px; font-size: 7px; }
  .canvas-corner-left { left: 8px; }
  .canvas-corner-right { right: 8px; }
  .caption-row { padding: 6px 9px; gap: 7px; }
  .caption-icon { width: 22px; height: 22px; }
  .caption-copy p { font-size: 9px; line-height: 1.3; }
  .cycle-readout { padding-left: 8px; }
  .cycle-readout strong { font-size: 10px; }
  .control-panel { padding: 9px 10px 8px; }
  .panel-head { margin-bottom: 7px; align-items: center; }
  .panel-head h2 { font-size: 13px; margin-top: 2px; }
  .illustrative-chip { font-size: 7px; padding: 3px 5px; }
  .preset-row { gap: 6px; margin-bottom: 8px; }
  .preset-button { padding: 5px 6px; gap: 6px; }
  .preset-glyph { width: 17px; height: 17px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; margin-top: 3px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 8px; }
  .control-label-row { margin-bottom: 4px; gap: 4px; }
  .control-label-row label, .control-label-row output { font-size: 8px; }
  input[type="range"] { height: 10px; }
  .range-ends { font-size: 7px; margin-top: 1px; }
  .run-controls { padding-top: 8px; gap: 5px; }
  .primary-action, .icon-action, .quality-action { height: 30px; }
  .primary-action { font-size: 9px; padding: 0 8px; }
  .icon-action { width: 30px; flex-basis: 30px; }
  .quality-action { padding: 0 6px; font-size: 8px; }
  .keyboard-hint { margin-top: 5px; font-size: 7px; }
  .keyboard-hint span { font-size: 7px; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; padding: 0 8px 7px; }
  .metric-card { padding: 6px 8px 5px; border-radius: 7px; }
  .metric-top { gap: 5px; }
  .metric-symbol { width: 13px; height: 13px; font-size: 10px; }
  .metric-top .eyebrow { font-size: 7px; letter-spacing: .1em; }
  .metric-class { font-size: 6px; }
  .metric-value { font-size: 17px; margin-top: 4px; }
  .metric-value small { font-size: 8px; }
  .metric-note { font-size: 7px; margin-top: 3px; }
  .science-footer { min-height: 35px; }
  .science-footer summary { min-height: 35px; padding: 0 12px; gap: 7px; font-size: 8px; }
  .science-summary-note { font-size: 7px; }
  .science-content { grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 4px 12px 12px; max-height: 175px; }
  .science-column h3 { font-size: 9px; margin-top: 7px; }
  .science-column p, .science-column code { font-size: 8px; }
}
@media (max-width: 390px) {
  .workspace { grid-template-rows: minmax(195px,1fr) 300px; }
  .view-tab { padding-left: 5px; padding-right: 5px; }
  .stage-toolbar { padding: 0 7px; }
  .stage-title { font-size: 10px; }
  .caption-copy p { font-size: 8px; }
  .keyboard-hint { letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
