:root {
  color-scheme: dark;
  --bg: #08131b;
  --panel: #0d1c26;
  --panel-2: #10222d;
  --panel-3: #132a35;
  --line: rgba(169, 206, 213, .12);
  --line-strong: rgba(169, 206, 213, .2);
  --text: #e6f0ed;
  --muted: #8da5a7;
  --dim: #61787d;
  --accent: #7de1d0;
  --accent-soft: rgba(125, 225, 208, .12);
  --warm: #f2a06e;
  --cool: #65a9d1;
  --danger: #ef927e;
  --radius: 14px;
  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; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 28% 0%, rgba(35, 76, 82, .16), transparent 46%), var(--bg); }
.topbar { flex: 0 0 68px; min-height: 68px; display: flex; align-items: center; padding: 0 26px; border-bottom: 1px solid var(--line); gap: 28px; background: rgba(8, 19, 27, .88); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.brand-symbol { width: 28px; height: 28px; border: 1px solid rgba(125,225,208,.52); border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-24deg); }
.brand-symbol span { display: block; width: 3px; height: 15px; border-radius: 4px; background: var(--accent); opacity: .9; }
.brand-symbol span:nth-child(2) { height: 20px; opacity: .65; }
.brand-symbol span:nth-child(3) { height: 11px; opacity: .4; }
.eyebrow, .section-kicker, .micro-label, .subsection-label, .readout-label, .readout-foot, .canvas-topline, .canvas-legend, .canvas-footer, .caption-heading, .check-heading, .panel-foot, .clock-state, .equation-label { letter-spacing: .13em; font-size: 9px; font-weight: 700; color: var(--muted); }
.eyebrow { font-size: 8px; color: #829b9e; }
.eyebrow span { color: var(--accent); padding: 0 3px; }
.brand-name { font-size: 14px; letter-spacing: -.02em; font-weight: 650; margin-top: 2px; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: #9cb2b3; font-size: 9px; letter-spacing: .16em; font-weight: 700; }
.status-dot, .caption-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(125,225,208,.65); }
.topbar-divider { color: #476168; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.quiet-button, .icon-button { border: 1px solid var(--line-strong); background: rgba(18, 39, 49, .75); border-radius: 8px; height: 34px; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.quiet-button { padding: 0 12px; font-size: 8px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
.icon-button { width: 36px; display: grid; place-items: center; color: #bfd0cd; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.quiet-button:hover, .icon-button:hover { border-color: rgba(125,225,208,.55); background: rgba(125,225,208,.08); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 388px; }
.visual-panel { min-width: 0; min-height: 0; padding: 24px 26px 20px; display: grid; grid-template-rows: auto minmax(250px, 1fr) auto; gap: 16px; border-right: 1px solid var(--line); }
.visual-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 70px; }
.section-kicker { display: flex; align-items: center; gap: 10px; font-size: 8px; color: var(--accent); }
.kicker-rule { display: inline-block; width: 30px; height: 1px; background: rgba(125,225,208,.45); }
h1 { font-size: clamp(23px, 2.4vw, 34px); letter-spacing: -.055em; line-height: 1.05; font-weight: 570; margin: 9px 0 5px; }
h1 em { color: var(--accent); font-style: normal; }
.visual-subtitle { color: var(--muted); font-size: 11px; margin: 0; letter-spacing: .01em; }
.clock-block { flex: 0 0 auto; text-align: right; padding: 0 0 2px 16px; border-left: 1px solid var(--line); }
.micro-label { font-size: 7px; white-space: nowrap; }
.scaled-tag { color: var(--accent); font-size: 7px; margin-left: 5px; }
.clock-block strong { display: block; font-variant-numeric: tabular-nums; font-size: 22px; line-height: 1.1; font-weight: 550; letter-spacing: -.04em; margin: 4px 0 3px; }
.clock-state { color: var(--accent); font-size: 7px; }
.canvas-frame { min-height: 0; height: 100%; position: relative; overflow: hidden; border: 1px solid rgba(130, 175, 181, .15); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 45%, rgba(26, 69, 77, .32), transparent 64%), linear-gradient(145deg, #0d202b, #0a1821 72%); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 12px 36px rgba(0,0,0,.16); }
.canvas-frame::after { content: ""; pointer-events: none; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 20%, transparent 82%, rgba(0,0,0,.1)); }
#simCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.canvas-topline { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; font-size: 7px; z-index: 1; pointer-events: none; }
.model-chip { border: 1px solid rgba(125,225,208,.2); color: var(--accent); background: rgba(7,20,27,.42); border-radius: 4px; padding: 4px 6px; letter-spacing: .1em; }
.canvas-legend { position: absolute; left: 16px; bottom: 34px; display: flex; gap: 15px; font-size: 7px; z-index: 1; pointer-events: none; }
.canvas-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.warm-dot { background: var(--warm); box-shadow: 0 0 7px rgba(242,160,110,.5); }
.cool-dot { background: var(--cool); box-shadow: 0 0 7px rgba(101,169,209,.5); }
.heat-dot { background: var(--accent); box-shadow: 0 0 7px rgba(125,225,208,.5); }
.canvas-footer { position: absolute; left: 16px; right: 16px; bottom: 13px; display: flex; justify-content: space-between; font-size: 7px; color: #6f8b91; z-index: 1; pointer-events: none; }
.canvas-footer b { color: #b7cbca; font-size: 7px; margin-left: 5px; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.readout-card { min-width: 0; padding: 11px 13px 10px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(140deg, rgba(17,39,49,.86), rgba(12,28,37,.84)); }
.readout-label { display: flex; justify-content: space-between; align-items: center; font-size: 7px; color: #90a9ab; white-space: nowrap; }
.readout-index { color: #506b72; font-variant-numeric: tabular-nums; }
.readout-value { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.1; font-weight: 560; letter-spacing: -.055em; font-variant-numeric: tabular-nums; margin: 8px 0 6px; white-space: nowrap; }
.readout-value span { font-size: 11px; font-weight: 500; color: #a6bcbb; letter-spacing: 0; margin-left: 3px; }
.readout-foot { font-size: 6px; color: #6f888d; white-space: nowrap; }
.readout-foot span { color: #8aa7a6; }
.margin-track { height: 3px; border-radius: 4px; overflow: hidden; background: rgba(239,146,126,.16); margin: 2px 0 8px; }
.margin-track span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease, background .25s ease; }
.margin-card .readout-value { margin-bottom: 4px; }
.control-panel { min-width: 0; min-height: 0; padding: 20px 19px 14px; background: linear-gradient(180deg, rgba(14,30,40,.94), rgba(10,23,31,.97)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #29434b transparent; }
.panel-intro { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title-row .section-kicker { font-size: 7px; }
.illustrative-tag { color: #9cb3b1; font-size: 6px; letter-spacing: .1em; border: 1px solid rgba(156,179,177,.22); border-radius: 4px; padding: 4px 5px; white-space: nowrap; }
.panel-intro p { font-size: 11px; color: #c2d1ce; line-height: 1.45; margin: 8px 0 0; max-width: 290px; }
.subsection-label { font-size: 7px; color: #829b9e; display: flex; align-items: center; justify-content: space-between; }
.preset-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.preset-button { border: 1px solid var(--line-strong); background: rgba(18,39,49,.5); border-radius: 8px; min-height: 49px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; text-align: left; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.preset-button:hover { border-color: rgba(125,225,208,.42); }
.preset-button.active { border-color: rgba(125,225,208,.5); background: rgba(125,225,208,.075); }
.preset-mark { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #526a71; box-shadow: 0 0 0 3px rgba(82,106,113,.12); }
.preset-button.active .preset-mark { background: var(--accent); box-shadow: 0 0 0 3px rgba(125,225,208,.13), 0 0 10px rgba(125,225,208,.3); }
.preset-button b { display: block; font-size: 9px; font-weight: 650; color: #d8e4e0; }
.preset-button small { display: block; font-size: 7px; color: #7f999b; margin-top: 3px; }
.controls-section { padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.controls-heading { margin-bottom: 10px; }
.controls-heading span { color: #5d777d; font-size: 6px; }
.control-item { margin: 0 0 10px; }
.control-item:last-child { margin-bottom: 0; }
.control-item label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 9px; color: #c4d2cf; margin-bottom: 5px; }
.control-item output { font-size: 9px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 12px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(125,225,208,.5), rgba(125,225,208,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(125,225,208,.5), rgba(125,225,208,.16)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; margin-top: -4px; background: var(--accent); border: 2px solid #0c2028; box-shadow: 0 0 0 1px rgba(125,225,208,.62), 0 0 8px rgba(125,225,208,.2); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #0c2028; box-shadow: 0 0 0 1px rgba(125,225,208,.62); }
.range-labels { display: flex; justify-content: space-between; color: #607a80; font-size: 6px; margin-top: 1px; }
.transport-section { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.transport-top { display: flex; align-items: center; justify-content: space-between; }
.speed-control { display: flex; padding: 2px; gap: 2px; border-radius: 6px; border: 1px solid var(--line); background: rgba(6,18,25,.45); }
.speed-control button { border: 0; background: transparent; color: #7e989a; border-radius: 4px; font-size: 8px; padding: 4px 8px; cursor: pointer; }
.speed-control button.selected { color: #0b1c22; background: var(--accent); font-weight: 750; }
.transport-buttons { display: grid; grid-template-columns: 1.2fr 1fr .72fr; gap: 6px; margin-top: 9px; }
.transport-buttons button { min-height: 34px; border-radius: 7px; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .09em; transition: background .2s ease, border-color .2s ease; }
.run-button { display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--accent); color: #082027; border: 1px solid var(--accent); }
.run-button:hover { background: #a0f0e3; }
.pause-icon { display: flex; gap: 2px; }
.pause-icon i { display: block; width: 2px; height: 9px; border-radius: 2px; background: #0b252b; }
.play-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #0b252b; }
.step-button, .reset-button { background: rgba(19,42,53,.65); color: #b8cbc7; border: 1px solid var(--line-strong); }
.step-button:hover, .reset-button:hover { border-color: rgba(125,225,208,.4); background: rgba(125,225,208,.07); }
.step-button span { color: #7f9b9c; font-weight: 500; letter-spacing: 0; }
.caption-card { margin-top: 12px; border: 1px solid rgba(125,225,208,.18); border-radius: 9px; padding: 10px 11px 11px; background: linear-gradient(120deg, rgba(125,225,208,.07), rgba(16,38,47,.55)); }
.caption-heading { display: flex; align-items: center; gap: 7px; font-size: 7px; color: var(--accent); }
.caption-pulse { width: 5px; height: 5px; }
.caption-card p { font-size: 9px; line-height: 1.5; color: #c2d2ce; margin: 7px 0 0; }
.check-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px 9px; background: rgba(7,19,26,.42); }
.check-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 7px; }
.check-heading span:first-child { color: var(--accent); }
.check-heading span:last-child { color: #607a80; font-size: 6px; }
.check-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid rgba(169,206,213,.07); font-size: 8px; color: #8da5a7; }
.check-row strong { font-size: 9px; color: #d8e5e1; font-variant-numeric: tabular-nums; font-weight: 600; }
.check-error-row strong { color: var(--accent); }
.check-foot { font-size: 6px; color: #627d82; margin-top: 6px; line-height: 1.4; }
.science-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12,28,37,.62); }
.science-panel summary { min-height: 38px; padding: 0 11px; display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; color: #c4d4d0; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-action { color: #718c90; font-size: 6px; letter-spacing: .1em; }
.summary-action i { color: var(--accent); font-style: normal; font-size: 13px; margin-left: 5px; vertical-align: -1px; }
.science-panel[open] .summary-action i { display: inline-block; transform: rotate(45deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line); }
.science-lead, .simplification-note, .constants-note, .disclaimer { font-size: 8px; line-height: 1.55; color: #a9bfbb; }
.science-lead { margin: 10px 0; }
.equation-block { padding: 8px 9px; margin: 7px 0; border: 1px solid rgba(169,206,213,.1); border-radius: 6px; background: rgba(3,13,19,.3); }
.equation-label { display: flex; justify-content: space-between; gap: 8px; font-size: 6px; color: #7f999b; }
.equation-label b { color: var(--accent); font-size: 6px; }
.equation { color: #d8e8e2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; line-height: 1.55; margin-top: 5px; overflow-wrap: anywhere; }
.constants-note { margin: 9px 0; color: #91aaa9; }
.constants-note b, .simplification-note b { color: #c8d8d3; }
.simplification-note { border-left: 2px solid rgba(125,225,208,.4); padding-left: 8px; margin: 9px 0; }
.disclaimer { color: #6f888d; font-style: italic; margin: 9px 0 0; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 1px 1px; font-size: 6px; color: #5f787e; }
.panel-foot b { color: #93aaa9; font-weight: 700; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 420px; } .visual-panel { padding: 30px 34px 24px; gap: 18px; } .control-panel { padding: 24px 22px 16px; } }
@media (max-width: 1050px) and (min-width: 701px) { .workspace { grid-template-columns: minmax(0, 1fr) 340px; } .visual-panel { padding: 20px 18px 16px; } .control-panel { padding: 16px 14px 12px; } .readout-card { padding: 10px 9px; } .readout-label { font-size: 6px; } .readout-foot { font-size: 5px; } }
@media (max-width: 700px) {
  body { overflow: hidden; }
  .topbar { flex-basis: 56px; min-height: 56px; padding: 0 13px; gap: 10px; }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-symbol { width: 24px; height: 24px; }
  .brand-symbol span { height: 12px; }
  .brand-symbol span:nth-child(2) { height: 16px; }
  .brand-symbol span:nth-child(3) { height: 9px; }
  .brand-name { font-size: 12px; }
  .eyebrow { font-size: 7px; }
  .topbar-center { display: none; }
  .topbar-actions { gap: 6px; }
  .quiet-button { height: 30px; padding: 0 8px; font-size: 7px; }
  .icon-button { width: 32px; height: 30px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .visual-panel { flex: 0 0 43dvh; min-height: 300px; max-height: 390px; padding: 12px 12px 9px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); grid-template-rows: auto minmax(130px, 1fr) auto; }
  .visual-heading { min-height: 48px; align-items: center; }
  .section-kicker { font-size: 6px; gap: 6px; }
  .kicker-rule { width: 16px; }
  h1 { font-size: clamp(19px, 5.2vw, 24px); margin: 5px 0 3px; }
  .visual-subtitle { font-size: 8px; }
  .clock-block { padding-left: 9px; }
  .micro-label { font-size: 5px; }
  .clock-block strong { font-size: 17px; }
  .clock-state { font-size: 6px; }
  .canvas-frame { border-radius: 10px; }
  .canvas-topline { top: 8px; left: 9px; right: 9px; font-size: 6px; }
  .canvas-legend { left: 9px; bottom: 25px; gap: 8px; font-size: 5px; }
  .canvas-legend span { gap: 3px; }
  .legend-dot { width: 5px; height: 5px; }
  .canvas-footer { left: 9px; right: 9px; bottom: 9px; font-size: 5px; }
  .canvas-footer b { font-size: 5px; margin-left: 2px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 7px 7px 6px; border-radius: 7px; }
  .readout-label { font-size: 5px; letter-spacing: .08em; }
  .readout-index { display: none; }
  .readout-value { font-size: clamp(16px, 5vw, 21px); margin: 5px 0 4px; }
  .readout-value span { font-size: 9px; }
  .readout-foot { font-size: 4.5px; letter-spacing: .07em; }
  .margin-track { margin: 1px 0 6px; height: 2px; }
  .margin-card .readout-value { margin-bottom: 3px; }
  .control-panel { flex: 1 1 auto; min-height: 0; padding: 13px 13px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .panel-intro { padding-bottom: 10px; }
  .panel-title-row .section-kicker { font-size: 6px; }
  .illustrative-tag { font-size: 5px; padding: 3px 4px; }
  .panel-intro p { font-size: 9px; margin-top: 5px; }
  .preset-section { padding: 10px 0; }
  .subsection-label { font-size: 6px; }
  .preset-button { min-height: 42px; padding: 6px 8px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .controls-section { padding: 10px 0; }
  .controls-heading { margin-bottom: 7px; }
  .control-item { margin-bottom: 7px; }
  .control-item label { font-size: 8px; margin-bottom: 3px; }
  .control-item output { font-size: 8px; }
  input[type="range"] { height: 10px; }
  .range-labels { font-size: 5px; }
  .transport-section { padding: 10px 0; }
  .transport-buttons { margin-top: 7px; }
  .transport-buttons button { min-height: 31px; font-size: 7px; }
  .caption-card { margin-top: 9px; padding: 8px 9px; }
  .caption-card p { font-size: 8px; margin-top: 5px; }
  .check-card { margin-top: 8px; padding: 8px 9px; }
  .science-panel { margin-top: 8px; }
  .panel-foot { padding-top: 9px; }
}
@media (max-width: 380px) {
  .visual-panel { flex-basis: 41dvh; min-height: 285px; padding-left: 9px; padding-right: 9px; }
  .canvas-legend { gap: 5px; font-size: 4.5px; }
  .readout-card { padding-left: 5px; padding-right: 5px; }
  .readout-foot { font-size: 4px; }
  .control-panel { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
