:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111b25;
  --panel-2: #14212d;
  --line: rgba(177, 204, 220, .12);
  --line-strong: rgba(177, 204, 220, .22);
  --text: #e7f0f5;
  --muted: #8da0ad;
  --faint: #5e7180;
  --accent: #4ad7c3;
  --accent-soft: rgba(74, 215, 195, .12);
  --warm: #e8b66b;
  --danger: #e48c76;
  --grid: 8px;
  font-family: 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); }
body { min-height: 100vh; overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; padding: 0 18px 16px; max-width: 1920px; margin: 0 auto; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(74,215,195,.35); border-radius: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 7px; background: linear-gradient(145deg, rgba(74,215,195,.12), rgba(74,215,195,.02)); flex: 0 0 auto; }
.brand-mark span { width: 4px; border-radius: 4px 4px 1px 1px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(1) { height: 10px; }.brand-mark span:nth-child(2) { height: 17px; }.brand-mark span:nth-child(3) { height: 13px; }
.eyebrow { color: #8da6b4; font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
.eyebrow-dot { display: inline-block; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; vertical-align: 2px; margin: 0 6px; }
h1 { margin: 3px 0 0; font-size: clamp(17px, 2vw, 23px); letter-spacing: -.045em; font-weight: 650; line-height: 1.12; }
h1 em { color: var(--accent); font-style: normal; font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.model-tag, .time-tag { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 100px; padding: 7px 10px; color: #a9bdc9; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(74,215,195,.65); }
.time-tag { color: var(--warm); border-color: rgba(232,182,107,.25); }.time-tag small { color: #83939d; font-size: 8px; letter-spacing: 0; font-weight: 600; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; flex: 1 1 auto; min-height: 0; padding-top: 16px; }
.visual-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 124px; gap: 0; background: #0d151e; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.scene-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(19,31,42,.78); }
.view-tabs { display: flex; align-items: center; gap: 4px; min-width: 0; }
.view-tab { appearance: none; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #8095a2; font-size: 10px; font-weight: 700; padding: 7px 10px; cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease; white-space: nowrap; }
.view-tab:hover { color: var(--text); background: rgba(255,255,255,.035); }
.view-tab.active { color: var(--accent); background: rgba(74,215,195,.08); border-color: rgba(74,215,195,.2); }
.scene-tools { display: flex; align-items: center; gap: 7px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 8px; background: rgba(255,255,255,.025); color: #a7bac5; font-size: 8px; font-weight: 800; letter-spacing: .08em; cursor: pointer; transition: .18s ease; }
.icon-button:hover { border-color: rgba(74,215,195,.5); color: var(--accent); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; background: #0b141d; }
#scene { display: block; width: 100%; height: 100%; outline: none; }
.canvas-corner { position: absolute; z-index: 2; color: rgba(155,178,191,.58); font-size: 8px; font-weight: 800; letter-spacing: .14em; pointer-events: none; display: flex; align-items: center; gap: 7px; }
.canvas-corner small { color: rgba(155,178,191,.38); font-size: 7px; font-weight: 600; letter-spacing: .08em; }
.canvas-corner-tl { top: 13px; left: 16px; }.canvas-corner-br { bottom: 13px; right: 16px; }
.corner-line { display: inline-block; width: 18px; height: 1px; background: rgba(74,215,195,.55); }
.canvas-hint { position: absolute; bottom: 13px; left: 16px; font-size: 7px; color: rgba(155,178,191,.4); letter-spacing: .13em; font-weight: 700; pointer-events: none; }
.visual-footer { display: grid; grid-template-rows: 76px minmax(0,1fr); background: #101a24; border-top: 1px solid var(--line); min-height: 0; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 11px 14px 8px; gap: 10px; }
.metric-card { min-width: 0; padding: 0 10px; border-left: 1px solid var(--line); }
.metric-card:first-child { border-left: 0; padding-left: 0; }
.metric-label { color: #8298a6; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.metric-value { color: #e4eef2; font-size: clamp(17px, 2vw, 23px); line-height: 1.28; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { font-size: 10px; color: #91a7b3; font-weight: 500; letter-spacing: 0; }
.metric-note { color: #607582; font-size: 7px; white-space: nowrap; }
.metric-accent .metric-value { color: var(--accent); }
.caption-row { border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 7px 14px; min-height: 0; }
.caption-mark { width: 5px; height: 22px; background: var(--accent); border-radius: 3px; flex: 0 0 auto; opacity: .8; }
.caption-row p { margin: 0; color: #9aadb8; font-size: 10px; line-height: 1.4; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px; scrollbar-width: thin; scrollbar-color: #334958 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.panel-heading h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.04em; font-weight: 650; }
.status-chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 100px; padding: 5px 8px; color: #91a4b0; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.status-chip span { width: 5px; height: 5px; border-radius: 50%; background: var(--warm); }.status-chip.running span { background: var(--accent); box-shadow: 0 0 7px rgba(74,215,195,.5); }.status-chip.stalled span { background: var(--danger); }
.transport-controls { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; margin-bottom: 15px; }
.primary-control, .secondary-control { min-height: 35px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 9px; font-weight: 850; letter-spacing: .1em; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.primary-control { border: 1px solid rgba(74,215,195,.38); color: #081b1b; background: var(--accent); box-shadow: 0 4px 16px rgba(74,215,195,.1); }.primary-control:hover { background: #67e6d4; transform: translateY(-1px); }
.secondary-control { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #a5b7c1; }.secondary-control:hover { border-color: rgba(74,215,195,.42); color: var(--accent); }
.play-symbol { font-size: 12px; line-height: 1; }
.preset-block { margin-bottom: 15px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8298a6; font-size: 8px; font-weight: 850; letter-spacing: .13em; margin-bottom: 8px; }
.section-label span { color: #657a87; font-size: 7px; letter-spacing: .1em; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 8px; text-align: left; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: rgba(255,255,255,.018); cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.preset-button.selected { border-color: rgba(74,215,195,.4); background: rgba(74,215,195,.065); }
.preset-icon { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: rgba(74,215,195,.1); color: var(--accent); font-size: 17px; flex: 0 0 auto; }
.heavy-icon { background: rgba(232,182,107,.11); color: var(--warm); }
.preset-button b { display: block; color: #dbe6eb; font-size: 9px; font-weight: 750; line-height: 1.25; white-space: nowrap; }
.preset-button small { display: block; color: #728794; font-size: 7px; line-height: 1.35; margin-top: 3px; }
.controls-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 11px; }
.control-row { margin: 0 0 12px; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.control-top label { color: #d0dce2; font-size: 10px; font-weight: 650; }
.control-top output { color: var(--accent); font-size: 8px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(74,215,195,.75), rgba(74,215,195,.18)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #e5fffb; margin-top: -4.5px; box-shadow: 0 0 0 3px rgba(74,215,195,.12); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(74,215,195,.75), rgba(74,215,195,.18)); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #e5fffb; box-shadow: 0 0 0 3px rgba(74,215,195,.12); }
.range-ends { display: flex; justify-content: space-between; color: #617682; font-size: 7px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.science-panel { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 11px; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.science-panel summary b { display: block; font-size: 10px; color: #dbe6eb; }.science-panel summary small { display: block; font-size: 7px; color: #718692; margin-top: 2px; }
.chevron { margin-left: auto; color: #8195a1; font-size: 15px; transition: transform .18s ease; }.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 10px 0 0; }
.science-intro, .simplification, .required-line { color: #8fa3ae; font-size: 8px; line-height: 1.55; margin: 0 0 9px; }
.equation { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid rgba(177,204,220,.09); border-radius: 6px; margin: 5px 0; background: rgba(255,255,255,.018); }
.equation span { color: #78909d; font-size: 7px; font-weight: 700; }.equation code { color: #c5e9e4; font-size: 8px; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.constants-note { color: #8398a4; font-size: 8px; line-height: 1.55; padding: 8px; border-left: 2px solid rgba(74,215,195,.45); background: rgba(74,215,195,.035); margin: 8px 0; }.constants-note b { color: #c4d3da; }
.audit-box { border: 1px solid rgba(74,215,195,.18); border-radius: 8px; padding: 9px; margin: 9px 0; background: rgba(74,215,195,.035); }
.audit-heading { display: flex; justify-content: space-between; gap: 6px; color: #b6c9d1; font-size: 7px; font-weight: 850; letter-spacing: .1em; }.audit-heading span { color: var(--accent); font-size: 6px; }
.audit-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 8px 0 5px; }.audit-values small { display: block; color: #708792; font-size: 6px; }.audit-values b { display: block; color: #d7e7ec; font-size: 10px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.audit-box p { color: #778d98; font-size: 7px; line-height: 1.45; margin: 0; }
.simplification { margin-top: 8px; }.simplification b { color: #c1d0d7; }.required-line { color: #617985; font-style: italic; margin-bottom: 0; }
.panel-foot { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 10px; color: #718590; font-size: 7px; }
.foot-key { color: #9bafb9; font-weight: 850; letter-spacing: .1em; margin-right: 3px; }.panel-foot kbd { font: 700 7px ui-monospace, monospace; color: #a8bac3; background: rgba(255,255,255,.05); border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 4px; }.foot-scale { margin-left: auto; color: #607783; font-size: 6px; letter-spacing: .08em; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) 315px; gap: 12px; }
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .control-panel { padding: 12px; }
  .metrics-grid { gap: 5px; padding-left: 10px; padding-right: 10px; }
  .metric-card { padding: 0 7px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 8px 8px; }
  .topbar { min-height: 64px; gap: 8px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 8px; padding: 6px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  h1 { font-size: 17px; }
  .topbar-meta { gap: 5px; }
  .model-tag { padding: 6px 7px; font-size: 6px; letter-spacing: .08em; }
  .time-tag { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) minmax(220px, 31dvh); gap: 8px; padding-top: 8px; }
  .visual-panel { grid-template-rows: 38px minmax(0,1fr) 112px; border-radius: 10px; }
  .scene-toolbar { padding: 0 8px; gap: 5px; }
  .view-tab { padding: 6px 7px; font-size: 8px; }
  .icon-button { min-height: 25px; padding: 4px 6px; font-size: 7px; }
  .screenshot-button span { display: none; }
  .canvas-corner { font-size: 6px; }.canvas-corner-tl { top: 8px; left: 9px; }.canvas-corner-br { bottom: 8px; right: 9px; }.canvas-hint { bottom: 8px; left: 9px; font-size: 6px; }
  .visual-footer { grid-template-rows: 70px minmax(0,1fr); }
  .metrics-grid { padding: 8px 7px 6px; gap: 0; }
  .metric-card { padding: 0 5px; }
  .metric-label { font-size: 6px; letter-spacing: .07em; }
  .metric-value { font-size: 16px; }
  .metric-value small { font-size: 8px; }
  .metric-note { font-size: 6px; white-space: normal; line-height: 1.1; }
  .caption-row { padding: 6px 8px; gap: 7px; }
  .caption-mark { height: 18px; }.caption-row p { font-size: 8px; line-height: 1.3; }
  .control-panel { border-radius: 10px; padding: 11px 12px; }
  .panel-heading { margin-bottom: 9px; }.panel-heading h2 { font-size: 15px; }
  .transport-controls { margin-bottom: 10px; gap: 5px; }.primary-control,.secondary-control { min-height: 31px; font-size: 8px; }
  .preset-block { margin-bottom: 10px; }.preset-button { padding: 6px; gap: 6px; }.preset-icon { width: 22px; height: 22px; }.preset-button b { font-size: 8px; }.preset-button small { font-size: 6px; }
  .controls-section { padding-top: 9px; margin-top: 8px; }.control-row { margin-bottom: 9px; }.control-top label { font-size: 9px; }.control-top output { font-size: 7px; }
  .science-panel { margin-top: 9px; padding-top: 9px; }
  .panel-foot { margin-top: 10px; }
}
@media (max-width: 390px) {
  .model-tag { display: none; }
  .view-tab { padding: 6px 6px; font-size: 7px; }
  .metric-value { font-size: 14px; }
  .metric-label { font-size: 5.5px; }
  .metric-note { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
