:root {
  color-scheme: dark;
  --bg: #090f16;
  --panel: #101a24;
  --panel-2: #121f2a;
  --line: rgba(167, 190, 208, .12);
  --line-strong: rgba(167, 190, 208, .2);
  --text: #edf4f7;
  --muted: #91a3b1;
  --dim: #627483;
  --accent: #5ce0c0;
  --accent-soft: rgba(92, 224, 192, .12);
  --accent-glow: rgba(92, 224, 192, .26);
  --warm: #e5ad76;
  --radius: 16px;
  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%; min-width: 0; height: 100%; background: var(--bg); color: var(--text); }
body { 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 18% 0%, rgba(39, 78, 84, .16), transparent 42%), var(--bg); }
.topbar { flex: 0 0 66px; height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(9, 15, 22, .94); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(92,224,192,.35); border-radius: 11px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 8px; background: var(--accent-soft); box-shadow: 0 0 24px rgba(92,224,192,.06); }
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .8; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.25; }
h1 { margin: 3px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.model-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); border: 1px solid rgba(92,224,192,.2); background: rgba(92,224,192,.07); padding: 7px 10px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.pulse-dot, .round-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.topbar-note { color: var(--dim); font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(340px, .88fr); gap: 14px; padding: 14px; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 40px minmax(0, 1fr) 58px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, rgba(20,34,44,.9), rgba(11,19,28,.96)); overflow: hidden; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid rgba(167,190,208,.08); }
.stage-heading > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.stage-heading-detail { color: var(--dim); font-size: 10px; }
.round-counter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; letter-spacing: .12em; font-weight: 800; }
.round-counter .number-note { letter-spacing: 0; font-size: 8px; font-weight: 500; color: var(--dim); }
.stage-wrap { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 49%, rgba(30, 71, 75, .2), transparent 57%), #0b141d; }
#worldCanvas, #chartCanvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; top: 16px; display: flex; align-items: center; gap: 8px; color: #748795; font-size: 8px; font-weight: 800; letter-spacing: .16em; pointer-events: none; }
.canvas-corner-left { left: 18px; }
.canvas-corner-left b { color: #d9e8ec; font-size: 10px; letter-spacing: .06em; }
.canvas-corner-right { right: 18px; }
.regime-pill { border: 1px solid rgba(92,224,192,.2); background: rgba(92,224,192,.08); color: var(--accent); border-radius: 999px; padding: 6px 9px; letter-spacing: .12em; font-size: 8px; }
.canvas-bottom-left { position: absolute; bottom: 14px; left: 18px; display: flex; align-items: center; gap: 7px; color: #7e909d; font-size: 8px; font-weight: 800; letter-spacing: .11em; pointer-events: none; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.winner-dot { background: var(--accent); box-shadow: 0 0 9px var(--accent-glow); }
.crowd-dot { background: #526270; }
.legend-separator { width: 9px; }
.stage-caption { min-height: 0; display: flex; align-items: center; gap: 12px; padding: 8px 18px; border-top: 1px solid rgba(167,190,208,.09); background: rgba(10,17,25,.62); }
.caption-icon { width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid rgba(92,224,192,.18); border-radius: 9px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 14px; }
.stage-caption p { margin: 0; color: #b1c0c8; font-size: 11px; line-height: 1.45; }
.inspector { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #2a3b48 transparent; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.readout-card, .chart-card, .control-card, .science-card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(18,30,41,.96), rgba(13,23,32,.96)); }
.readout-card { padding: 11px 13px 10px; min-width: 0; }
.readout-primary { background: linear-gradient(145deg, rgba(22,52,53,.82), rgba(13,28,35,.98)); border-color: rgba(92,224,192,.2); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.readout-label span { color: #6e8791; font-size: 10px; letter-spacing: 0; }
.readout-value { margin-top: 6px; font-size: clamp(21px, 2.2vw, 27px); line-height: 1; font-weight: 620; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.readout-primary .readout-value { color: var(--accent); }
.readout-foot { margin-top: 5px; color: var(--dim); font-size: 8px; }
.readout-foot span { color: #718592; }
.chart-card { padding: 13px 14px 10px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-subtitle { display: block; margin-top: 4px; color: #d6e1e5; font-size: 11px; font-weight: 600; letter-spacing: -.01em; }
.live-key { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.live-key i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.chart-wrap { height: 150px; margin-top: 7px; position: relative; }
.chart-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; color: #8598a5; font-size: 8px; }
.chart-footer em { color: #657b88; font-style: normal; }
.curve-key { display: inline-flex; align-items: center; gap: 6px; }
.curve-key i { width: 14px; height: 2px; border-radius: 2px; background: var(--accent); display: inline-block; }
.critical-key { color: var(--warm); }
.control-card { padding: 14px; }
.control-heading { margin-bottom: 11px; }
.tiny-tag { border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 7px; color: #7e929f; font-size: 7px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.preset-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.018); color: #a7b7c1; text-align: left; font-size: 9px; font-weight: 700; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button span { float: right; color: #78909b; }
.preset-button:hover, .preset-button.active { border-color: rgba(92,224,192,.38); background: rgba(92,224,192,.08); color: var(--accent); }
.slider-block { margin: 10px 0 12px; }
.slider-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.slider-label-row label { color: #c6d3d9; font-size: 10px; font-weight: 650; }
.slider-label-row label span { color: var(--accent); font-size: 11px; margin-left: 3px; }
.slider-label-row output { color: var(--text); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 4px 0 0; background: transparent; accent-color: var(--accent); cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #2b3d49; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #09131a; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(92,224,192,.13); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #2b3d49; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #09131a; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(92,224,192,.13); }
input[type="range"]:focus-visible { outline: 2px solid rgba(92,224,192,.55); outline-offset: 3px; border-radius: 4px; }
.range-hint { display: flex; justify-content: space-between; align-items: center; color: #657987; font-size: 8px; font-variant-numeric: tabular-nums; }
.range-unit { color: #6e8491; }
.quality-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; color: #8fa2ad; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.quality-toggle { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: #0b141c; border: 1px solid var(--line); }
.quality-toggle button { padding: 5px 8px; border: 0; border-radius: 5px; color: #718490; background: transparent; font-size: 8px; font-weight: 800; cursor: pointer; }
.quality-toggle button[aria-pressed="true"] { color: var(--accent); background: rgba(92,224,192,.12); }
.transport-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr .72fr; gap: 6px; margin-top: 10px; }
.transport-button, .shot-button { min-width: 0; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.025); color: #b8c7cf; font-size: 8px; font-weight: 800; letter-spacing: .08em; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.transport-button span { color: #7e929f; margin-left: 3px; }
.transport-button:hover, .shot-button:hover { border-color: rgba(92,224,192,.38); background: rgba(92,224,192,.07); }
.transport-button:active, .shot-button:active, .preset-button:active { transform: translateY(1px); }
.transport-button.primary { background: var(--accent); border-color: var(--accent); color: #09201e; }
.transport-button.primary span { color: #17443d; }
.shot-button { color: var(--accent); border-color: rgba(92,224,192,.24); }
.input-note { margin: 9px 0 0; color: #667b87; font-size: 8px; line-height: 1.4; }
.science-card { padding: 0; overflow: hidden; }
.science-card summary { min-height: 54px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.science-card summary::-webkit-details-marker { display: none; }
.science-card summary .card-subtitle { color: #aebec6; font-weight: 500; }
.chevron { color: var(--accent); font-size: 18px; transition: transform .2s ease; }
.science-card[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 14px 14px; color: #9eb0ba; font-size: 10px; line-height: 1.55; }
.science-content p { margin: 8px 0; }
.science-content b { color: #e4edf0; font-weight: 650; }
.equation-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 7px 0; padding: 8px 9px; border: 1px solid rgba(167,190,208,.1); border-radius: 8px; background: rgba(5,12,18,.4); }
.equation-block span { color: #718895; font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.equation-block code { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-align: right; }
.check-panel { margin-top: 10px; padding: 10px; border: 1px solid rgba(92,224,192,.17); border-radius: 9px; background: rgba(92,224,192,.045); }
.check-title { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.check-values { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 7px; color: #8499a5; font-size: 8px; }
.check-values b { display: block; margin-top: 2px; color: #e7f1f2; font-size: 13px; font-variant-numeric: tabular-nums; }
.check-panel p { margin: 7px 0 0; color: #8296a1; font-size: 9px; }
.disclaimer { color: #71848f; font-size: 9px; }
.footer-note { padding: 3px 4px 8px; text-align: center; color: #536874; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.footer-note span { color: var(--accent); padding: 0 5px; }
button:focus-visible, summary:focus-visible { outline: 2px solid rgba(92,224,192,.65); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
@media (max-width: 920px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .95fr); padding: 10px; gap: 10px; }
  .topbar { padding: 0 16px; }
  .readout-card { padding: 10px; }
  .chart-wrap { height: 130px; }
  .stage-heading-detail { display: none; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { flex-basis: 56px; height: 56px; padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  h1 { font-size: 16px; }
  .eyebrow { font-size: 8px; }
  .topbar-right { gap: 0; }
  .topbar-note { display: none; }
  .model-tag { font-size: 8px; padding: 6px 8px; }
  .workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(260px, 43%) minmax(0, 57%); gap: 8px; padding: 8px; }
  .stage-panel { grid-row: 1; grid-template-rows: 32px minmax(0,1fr) 46px; border-radius: 13px; }
  .stage-heading { padding: 0 11px; }
  .stage-heading > div:first-child { gap: 0; }
  .stage-heading-detail { display: none; }
  .section-kicker { font-size: 8px; }
  .round-counter { font-size: 8px; }
  .canvas-corner { top: 10px; font-size: 7px; }
  .canvas-corner-left { left: 11px; }
  .canvas-corner-right { right: 10px; }
  .regime-pill { padding: 5px 7px; font-size: 7px; }
  .canvas-bottom-left { left: 11px; bottom: 9px; font-size: 7px; }
  .stage-caption { padding: 6px 10px; gap: 8px; }
  .caption-icon { width: 22px; height: 22px; flex-basis: 22px; border-radius: 7px; }
  .stage-caption p { font-size: 9px; line-height: 1.35; }
  .inspector { grid-row: 2; overflow-y: auto; padding: 0 1px 12px 0; gap: 8px; overscroll-behavior: contain; }
  .readout-grid { gap: 6px; }
  .readout-card { padding: 9px 10px 8px; border-radius: 11px; }
  .readout-label { font-size: 7px; }
  .readout-value { margin-top: 5px; font-size: 22px; }
  .readout-foot { margin-top: 4px; font-size: 7px; }
  .chart-card, .control-card { border-radius: 11px; padding: 11px; }
  .chart-wrap { height: 128px; }
  .chart-footer { font-size: 7px; }
  .card-subtitle { font-size: 10px; }
  .control-heading { margin-bottom: 8px; }
  .preset-row { margin-bottom: 9px; }
  .slider-block { margin: 8px 0 9px; }
  .slider-label-row label { font-size: 9px; }
  .range-hint { font-size: 7px; }
  .transport-row { margin-top: 8px; }
  .transport-button, .shot-button { min-height: 32px; font-size: 7px; }
  .science-card summary { min-height: 48px; padding: 9px 11px; }
  .science-content { padding: 0 11px 12px; font-size: 9px; }
  .footer-note { padding-bottom: 4px; }
}
@media (max-width: 380px) {
  .workspace { grid-template-rows: minmax(250px, 41%) minmax(0,59%); }
  .transport-row { grid-template-columns: 1fr 1fr 1fr .68fr; }
  .transport-button { letter-spacing: .04em; }
  .chart-wrap { height: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
