:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111b25;
  --panel-2: #15212d;
  --line: #263746;
  --line-soft: rgba(131, 161, 181, .15);
  --text: #e8f0f5;
  --muted: #93a7b6;
  --subtle: #62798b;
  --accent: #62d6c5;
  --accent-2: #2b9e98;
  --amber: #eabf75;
  --blue: #68bce9;
  --danger: #e28a78;
  --radius: 15px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: 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); font-family: var(--sans); }
body { min-height: 100vh; overflow-x: hidden; background-image: radial-gradient(ellipse at 18% 0%, rgba(41, 85, 94, .18), transparent 42%), linear-gradient(180deg, #0c141d 0%, #0a1118 100%); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar { height: 72px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(122, 151, 172, .14); background: rgba(10, 17, 24, .92); }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(98, 214, 197, .55); border-radius: 10px; display: grid; place-items: center; position: relative; transform: rotate(45deg); }
.brand-mark span { position: absolute; width: 17px; height: 2px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(2) { transform: rotate(60deg); }
.brand-mark span:nth-child(3) { transform: rotate(120deg); }
.brand-copy h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.1; font-weight: 650; letter-spacing: -.035em; }
.eyebrow { font-size: 9px; line-height: 1.3; letter-spacing: .16em; color: #8ca4b5; font-weight: 750; }
.eyebrow-dot { display: inline-block; width: 3px; height: 3px; margin: 0 6px 2px; border-radius: 50%; background: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.era-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(98, 214, 197, .19); border-radius: 8px; color: #b4c8d3; background: rgba(26, 52, 60, .24); font-size: 9px; letter-spacing: .1em; font-weight: 700; white-space: nowrap; }
.era-chip small { font: 700 8px var(--mono); color: var(--accent); opacity: .85; }
.era-dot, .live-indicator, .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(98,214,197,.55); }
.icon-button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #111c26; display: grid; place-items: center; cursor: pointer; transition: border-color .18s, background .18s; }
.icon-button:hover { border-color: var(--accent-2); background: #172833; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: #a8bfcb; stroke-width: 1.5; stroke-linecap: round; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; padding: 16px 18px 18px; height: calc(100vh - 72px); height: calc(100dvh - 72px); min-height: 0; }
.stage-card, .control-rail { min-width: 0; min-height: 0; border: 1px solid rgba(117, 148, 168, .17); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19, 31, 42, .97), rgba(13, 23, 32, .97)); box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.stage-card { display: grid; grid-template-rows: 54px minmax(0, 1fr) 58px; overflow: hidden; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.stage-kicker { display: flex; align-items: center; gap: 9px; font-size: 9px; font-weight: 800; letter-spacing: .15em; color: #b1c3ce; white-space: nowrap; }
.live-indicator { width: 5px; height: 5px; }
.view-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(130, 157, 176, .16); border-radius: 9px; background: rgba(5, 12, 18, .36); }
.view-button { border: 0; border-radius: 6px; padding: 7px 10px; color: #8095a4; background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; transition: color .18s, background .18s, box-shadow .18s; }
.view-button:hover { color: var(--text); }
.view-button.active { color: #d9f4ef; background: rgba(54, 126, 119, .25); box-shadow: inset 0 0 0 1px rgba(98, 214, 197, .17); }
.canvas-wrap { min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, rgba(31, 69, 78, .22), transparent 56%), linear-gradient(135deg, rgba(13, 26, 36, .92), rgba(9, 17, 25, .98)); }
#machineCanvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-top-left { position: absolute; top: 16px; left: 17px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.micro-label { color: #c5d7df; font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.micro-sub { color: #728b9c; font-size: 8px; letter-spacing: .1em; font-weight: 650; }
.canvas-top-right { position: absolute; top: 15px; right: 16px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(126, 156, 174, .2); border-radius: 20px; background: rgba(7, 15, 22, .68); padding: 6px 9px; color: #a9bdc8; font: 700 8px var(--mono); letter-spacing: .08em; pointer-events: none; }
.canvas-top-right .badge-dot { width: 5px; height: 5px; }
.canvas-top-right.stalled .badge-dot { background: var(--danger); box-shadow: 0 0 8px rgba(226,138,120,.45); }
.canvas-caption { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 10px; align-items: flex-start; max-width: min(510px, calc(100% - 142px)); padding: 10px 13px 10px 11px; border: 1px solid rgba(124, 154, 173, .17); border-radius: 10px; background: rgba(7, 16, 23, .82); box-shadow: 0 8px 28px rgba(0,0,0,.15); pointer-events: none; backdrop-filter: blur(8px); }
.caption-mark { width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; display: grid; place-items: center; color: #a8e8de; border: 1px solid rgba(98, 214, 197, .5); font: italic 700 11px Georgia, serif; }
.canvas-caption p { margin: 0; color: #b5c6d0; font-size: 10px; line-height: 1.45; }
.screenshot-button { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 7px; padding: 9px 11px; border: 1px solid rgba(98, 214, 197, .24); border-radius: 9px; color: #c9e5e1; background: rgba(14, 39, 43, .85); font-size: 10px; font-weight: 700; cursor: pointer; transition: transform .18s, background .18s, border-color .18s; }
.screenshot-button:hover { transform: translateY(-1px); background: rgba(25, 65, 66, .92); border-color: rgba(98,214,197,.55); }
.screenshot-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; border-top: 1px solid var(--line-soft); background: rgba(10, 18, 26, .58); }
.motion-controls { display: flex; align-items: center; gap: 7px; }
.control-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 33px; padding: 0 11px; border: 1px solid rgba(127, 155, 174, .2); border-radius: 8px; color: #a7bac6; background: #14212c; font-size: 10px; font-weight: 700; cursor: pointer; transition: background .16s, border-color .16s, color .16s; }
.control-button:hover { color: var(--text); border-color: rgba(98,214,197,.4); }
.control-button.primary { color: #d7f6f0; border-color: rgba(98, 214, 197, .35); background: rgba(41, 104, 98, .26); }
.control-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quality-switch { display: flex; align-items: center; gap: 4px; color: #708797; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.quality-switch span { margin-right: 5px; }
.quality-switch button { border: 0; border-radius: 5px; padding: 6px 8px; background: transparent; color: #7f95a3; font-size: 9px; font-weight: 700; cursor: pointer; }
.quality-switch button.active { color: #d6eee9; background: rgba(67, 137, 127, .22); }
.control-rail { display: flex; flex-direction: column; overflow: auto; scrollbar-width: thin; scrollbar-color: #38505f transparent; }
.rail-section { padding: 15px 15px 14px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-heading h2 { margin: 3px 0 0; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.computed-chip, .illustrative-chip { border: 1px solid rgba(98, 214, 197, .18); border-radius: 5px; padding: 4px 6px; color: #8dd9cd; background: rgba(40, 103, 95, .12); font: 700 7px var(--mono); letter-spacing: .12em; white-space: nowrap; }
.illustrative-chip { color: #d8b77f; border-color: rgba(234,191,117,.2); background: rgba(117,83,39,.13); }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.readout { min-width: 0; padding: 9px 10px 8px; border: 1px solid rgba(123, 151, 170, .15); border-radius: 9px; background: linear-gradient(140deg, rgba(26, 42, 55, .72), rgba(17, 29, 39, .82)); }
.readout.primary-readout { border-color: rgba(98,214,197,.28); background: linear-gradient(140deg, rgba(26, 71, 70, .32), rgba(17, 34, 42, .86)); }
.readout-label { display: block; margin-bottom: 4px; color: #92a8b7; font-size: 9px; font-weight: 600; }
.readout strong { display: block; color: #e8f5f3; font: 650 20px/1.1 var(--mono); letter-spacing: -.07em; white-space: nowrap; }
.readout strong small { color: #9ab2bf; font: 600 10px var(--sans); letter-spacing: 0; }
.readout-tag { display: block; margin-top: 5px; color: #6f8998; font: 700 6px var(--mono); letter-spacing: .1em; }
.status-strip { display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 9px 10px; border: 1px solid rgba(98, 214, 197, .15); border-radius: 8px; background: rgba(31, 78, 75, .12); }
.status-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 19px; border-radius: 6px; color: #a1e4d9; background: rgba(98,214,197,.12); font-size: 13px; }
.status-strip.stalled { border-color: rgba(226,138,120,.24); background: rgba(103, 48, 42, .14); }
.status-strip.stalled .status-icon { color: #f0a392; background: rgba(226,138,120,.12); }
.status-strip strong { display: block; margin-bottom: 2px; color: #c9e5e0; font-size: 9px; }
.status-strip span:not(.status-icon) { display: block; color: #829aa8; font-size: 8px; line-height: 1.35; }
.design-section { padding-bottom: 12px; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 0 14px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; text-align: left; border: 1px solid rgba(124, 153, 171, .17); border-radius: 8px; background: rgba(20, 33, 44, .65); cursor: pointer; transition: border-color .16s, background .16s; }
.preset-button:hover { border-color: rgba(98,214,197,.35); }
.preset-button.active { border-color: rgba(98,214,197,.38); background: rgba(34, 80, 77, .22); }
.preset-glyph { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: rgba(98,214,197,.1); font-size: 13px; }
.preset-button:nth-child(2) .preset-glyph { color: var(--amber); background: rgba(234,191,117,.1); }
.preset-button b { display: block; color: #c5d4dd; font-size: 8px; font-weight: 700; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #748b9b; font-size: 7px; white-space: nowrap; }
.slider-control { margin-top: 12px; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.slider-heading label { color: #b4c5cf; font-size: 9px; font-weight: 650; }
.slider-heading output { color: #d3e7e5; font: 600 9px var(--mono); white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 4px; display: block; margin: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent-2) var(--range-fill, 35%), #304555 var(--range-fill, 35%), #304555 100%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #d6fff8; border-radius: 50%; background: #3eaaa0; box-shadow: 0 0 0 3px rgba(98,214,197,.13), 0 2px 6px rgba(0,0,0,.35); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #d6fff8; border-radius: 50%; background: #3eaaa0; box-shadow: 0 0 0 3px rgba(98,214,197,.13); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #647e8e; font: 8px var(--mono); }
.audit-section { padding-top: 13px; padding-bottom: 13px; }
.audit-heading { margin-bottom: 8px; }
.audit-heading h2 { font-size: 13px; }
.check-mark { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid rgba(98,214,197,.22); border-radius: 50%; color: var(--accent); background: rgba(42,106,98,.15); font-size: 11px; }
.audit-intro { margin: 0 0 8px; color: #8197a6; font-size: 8px; line-height: 1.45; }
.audit-row, .audit-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; }
.audit-row span, .audit-bottom span { color: #8ba1af; font-size: 8px; }
.audit-row strong { color: #d1e3e7; font: 600 9px var(--mono); }
.audit-bottom { margin-top: 3px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.audit-bottom span { color: #6f8796; font: 8px var(--mono); }
.audit-bottom strong { color: var(--accent); font: 700 9px var(--mono); }
.science-panel { margin: 12px 13px 0; border: 1px solid rgba(127, 156, 175, .17); border-radius: 10px; background: rgba(16, 28, 38, .74); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; }
.summary-plus { color: var(--accent); font-size: 18px; font-weight: 300; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 12px; }
.science-lead { margin: 2px 0 11px; color: #a9bdc7; font-size: 9px; line-height: 1.5; }
.equation { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(123,151,170,.1); }
.equation span { color: #7f97a6; font-size: 8px; }
.equation code { color: #d2e8e3; font: 9px var(--mono); white-space: nowrap; }
.science-copy { margin: 10px 0 0; color: #8da3b1; font-size: 8px; line-height: 1.55; }
.constants { display: grid; gap: 6px; margin-top: 10px; padding: 8px; border-radius: 7px; background: rgba(5, 13, 20, .45); color: #91a7b4; font: 8px/1.45 var(--mono); }
.constants b { color: var(--accent); font-size: 7px; letter-spacing: .08em; }
.constants span:last-child b { color: var(--amber); }
.disclaimer { margin: 10px 0 0; color: #b6c6cd; font-size: 8px; line-height: 1.45; }
.history-source { margin: 8px 0 0; color: #647d8d; font-size: 7px; line-height: 1.5; }
.rail-footnote { padding: 11px 15px 14px; color: #607989; font-size: 7px; line-height: 1.5; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .workspace { height: calc(100vh - 72px); height: calc(100dvh - 72px); }
body.embed-mode .control-rail { overscroll-behavior: contain; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0,1fr) 340px; gap: 11px; padding: 11px; }
  .readout strong { font-size: 18px; }
}
@media (max-width: 760px) {
  .canvas-wrap.cutaway-mode .canvas-top-left, .canvas-wrap.cutaway-mode .canvas-top-right { display: none; }
  .topbar { height: 62px; padding: 0 13px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-copy h1 { font-size: 17px; }
  .eyebrow { font-size: 8px; }
  .era-chip { padding: 7px 8px; font-size: 7px; gap: 6px; }
  .era-chip small { font-size: 7px; }
  .icon-button { width: 31px; height: 31px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(290px, 43%) minmax(0,1fr); gap: 9px; height: calc(100vh - 62px); height: calc(100dvh - 62px); padding: 8px; }
  .stage-card { grid-template-rows: 46px minmax(0,1fr) 50px; border-radius: 12px; }
  .stage-head { padding: 0 10px; }
  .stage-kicker { font-size: 8px; }
  .view-button { padding: 6px 8px; font-size: 9px; }
  .canvas-top-left { top: 11px; left: 11px; }
  .canvas-top-right { top: 10px; right: 10px; }
  .canvas-caption { left: 10px; bottom: 10px; max-width: calc(100% - 120px); padding: 8px 9px; }
  .canvas-caption p { font-size: 9px; }
  .screenshot-button { right: 10px; bottom: 10px; padding: 8px 9px; }
  .screenshot-button span { display: none; }
  .stage-footer { padding: 0 10px; }
  .control-button { min-height: 30px; padding: 0 9px; font-size: 9px; }
  .control-rail { border-radius: 12px; }
  .rail-section { padding: 12px 12px 11px; }
  .readout-grid { gap: 6px; }
  .readout { padding: 7px 8px; }
  .readout strong { font-size: 18px; }
  .readout-label { font-size: 8px; }
  .readout-tag { margin-top: 3px; }
  .status-strip { margin-top: 6px; padding: 7px 8px; }
  .design-section .section-heading { margin-bottom: 9px; }
  .presets { margin-bottom: 10px; }
  .slider-control { margin-top: 10px; }
  .science-panel { margin: 10px 11px 0; }
  .rail-footnote { padding: 9px 12px 11px; }
  body.embed-mode .workspace { height: calc(100vh - 62px); height: calc(100dvh - 62px); }
}
@media (max-width: 390px) {
  .era-chip { max-width: 165px; overflow: hidden; text-overflow: ellipsis; }
  .stage-kicker { letter-spacing: .1em; }
  .view-button { padding: 6px 6px; font-size: 8px; }
  .motion-controls { gap: 5px; }
  .control-button { gap: 5px; padding: 0 7px; }
  .quality-switch span { display: none; }
  .readout strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
