:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #111a22;
  --panel-2: #15212b;
  --line: #263541;
  --line-soft: #1c2a35;
  --text: #edf4f5;
  --muted: #9baeb8;
  --quiet: #718590;
  --accent: #65d8c9;
  --accent-dim: rgba(101,216,201,.13);
  --accent-line: rgba(101,216,201,.35);
  --danger: #e2a17d;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); min-width: 320px; }
body { margin: 0; background: radial-gradient(ellipse at 20% -10%, rgba(47,83,91,.17), transparent 38%), var(--bg); color: var(--text); min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1600px; margin: 0 auto; padding: 0 28px 28px; }
.site-header { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 27px; height: 27px; border: 1px solid var(--accent-line); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 3px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .75; }
.eyebrow { font-size: 9px; font-weight: 750; letter-spacing: .16em; color: var(--muted); }
.brand-lockup .eyebrow { color: #d7e2e6; font-size: 10px; }
.brand-lockup .eyebrow span { color: var(--accent); margin: 0 5px; }
.brand-sub { color: var(--quiet); font-size: 8px; letter-spacing: .18em; margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.live-dot, .check-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(101,216,201,.6); }
.header-seed { padding-left: 14px; border-left: 1px solid var(--line); color: var(--quiet); }
.intro-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 25px 0 22px; }
.accent-text { color: var(--accent); }
h1 { font-size: clamp(24px, 2.8vw, 36px); line-height: 1.12; letter-spacing: -.045em; margin: 8px 0 8px; font-weight: 680; }
.intro-copy { color: var(--muted); margin: 0; max-width: 700px; font-size: 13px; line-height: 1.55; }
.model-stamp { flex: 0 0 126px; border-left: 1px solid var(--accent-line); padding-left: 15px; margin-bottom: 2px; }
.stamp-label, .stamp-foot { display: block; color: var(--quiet); font-size: 8px; letter-spacing: .17em; }
.model-stamp strong { display: block; font-size: 13px; letter-spacing: .04em; line-height: 1.25; margin: 5px 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stage-column { min-width: 0; }
.stage-card, .control-panel, .checks-card, .readout, .science-details { background: linear-gradient(145deg, rgba(21,32,42,.96), rgba(13,21,29,.98)); border: 1px solid var(--line); border-radius: var(--radius); }
.stage-card { overflow: hidden; }
.stage-topline, .stage-bottomline { min-height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.stage-topline { border-bottom: 1px solid var(--line-soft); }
.stage-bottomline { border-top: 1px solid var(--line-soft); color: #c3d0d4; font-size: 10px; letter-spacing: .015em; font-weight: 500; }
.tiny-square { display: inline-block; width: 6px; height: 6px; background: var(--accent); margin-right: 7px; border-radius: 1px; }
.stage-note { color: var(--quiet); font-size: 8px; }
.canvas-wrap { height: clamp(300px, 36vw, 510px); position: relative; background: #0d151d; }
canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-legend { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; letter-spacing: .13em; }
.stage-legend i { width: 13px; height: 6px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(101,216,201,.35); }
.readouts { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.readout { padding: 12px 12px 11px; min-width: 0; border-radius: 11px; }
.readout-label { color: var(--muted); font-size: 8px; letter-spacing: .11em; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-label span { color: var(--quiet); font-size: 7px; margin-left: 4px; }
.readout-value { font-size: clamp(19px, 2.2vw, 25px); font-weight: 650; letter-spacing: -.04em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-foot { color: var(--quiet); font-size: 8px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout.risk .readout-value { color: var(--danger); }
.checks-card { margin-top: 10px; padding: 14px 15px 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2, .panel-heading h2 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.02em; }
.check-status { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 8px; letter-spacing: .14em; font-weight: 750; }
.checks-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.check-item { background: rgba(6,13,19,.48); border: 1px solid var(--line-soft); border-radius: 8px; padding: 9px 9px 8px; min-width: 0; }
.check-item span { display: block; color: var(--muted); font-size: 8px; min-height: 22px; line-height: 1.25; }
.check-item strong { display: block; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; margin: 4px 0 3px; }
.check-item small { display: block; color: var(--quiet); font-size: 7px; line-height: 1.3; }
.checks-note { color: var(--quiet); font-size: 8px; line-height: 1.45; margin: 10px 0 0; }
.control-panel { padding: 16px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.panel-heading h2 { font-size: 17px; }
.input-tag { font-size: 7px; letter-spacing: .13em; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-dim); border-radius: 20px; padding: 5px 7px; }
.presets-block { padding-bottom: 13px; border-bottom: 1px solid var(--line-soft); }
.control-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.control-label-row label { color: var(--muted); font-size: 8px; letter-spacing: .13em; font-weight: 750; }
.control-label-row span { color: var(--quiet); font-size: 7px; letter-spacing: .09em; }
.preset-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.preset-button { text-align: left; min-height: 45px; padding: 8px 9px; background: #111c25; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .18s, background .18s; }
.preset-button strong { display: block; font-size: 10px; font-weight: 650; }
.preset-button span { display: block; color: var(--quiet); font-size: 7px; margin-top: 4px; }
.preset-button:hover, .preset-button.active { border-color: var(--accent-line); background: rgba(101,216,201,.08); }
.preset-button.active strong { color: var(--accent); }
.preset-description { color: var(--quiet); font-size: 8px; line-height: 1.4; margin: 8px 0 0; min-height: 22px; }
.sliders { padding: 13px 0 11px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 13px; }
.slider-control { min-width: 0; }
.slider-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.slider-heading label { color: #d7e2e5; font-size: 10px; font-weight: 550; }
.slider-heading label span { color: var(--quiet); font-size: 9px; cursor: help; }
.slider-heading output { color: var(--accent); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; margin: 0; accent-color: var(--accent); cursor: pointer; display: block; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: var(--quiet); font-size: 7px; font-variant-numeric: tabular-nums; }
.control-actions { padding: 13px 0 12px; border-bottom: 1px solid var(--line-soft); }
.transport-row { display: grid; grid-template-columns: 1.3fr .8fr .8fr; gap: 6px; }
.action-button { border: 1px solid var(--line); background: #17232d; border-radius: 7px; height: 34px; cursor: pointer; font-size: 9px; color: #cbd8dc; transition: .15s; }
.action-button:hover { border-color: var(--accent-line); }
.action-button.primary { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); font-weight: 700; }
.play-icon { margin-right: 5px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.quality-row > span { color: var(--quiet); font-size: 7px; letter-spacing: .14em; }
.segmented { display: inline-flex; padding: 2px; background: #0b131a; border: 1px solid var(--line); border-radius: 6px; }
.segmented button { border: 0; background: transparent; color: var(--quiet); border-radius: 4px; font-size: 8px; padding: 4px 10px; cursor: pointer; }
.segmented button.selected { color: var(--accent); background: rgba(101,216,201,.12); }
.experiment-card { margin-top: 13px; padding: 12px; border: 1px solid var(--accent-line); background: linear-gradient(140deg, rgba(101,216,201,.075), rgba(13,21,29,.7)); border-radius: 10px; }
.experiment-top { display: flex; justify-content: space-between; align-items: center; }
.experiment-top .eyebrow { color: var(--accent); }
.experiment-mark { color: rgba(101,216,201,.55); font-size: 15px; font-weight: 750; }
.experiment-card h3 { margin: 5px 0 5px; font-size: 12px; }
.experiment-card p { color: var(--muted); font-size: 8px; line-height: 1.45; margin: 0 0 9px; }
.experiment-button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--accent-line); border-radius: 6px; padding: 8px 10px; background: rgba(101,216,201,.11); color: var(--accent); font-size: 9px; font-weight: 700; cursor: pointer; }
.experiment-button:hover { background: rgba(101,216,201,.18); }
.experiment-result { color: var(--muted); font-size: 8px; line-height: 1.45; margin-top: 8px; min-height: 24px; }
.science-section { margin-top: 16px; }
.science-details { overflow: hidden; }
.science-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; }
.science-details summary::-webkit-details-marker { display: none; }
.science-details summary strong { display: block; font-size: 15px; margin-top: 4px; }
.summary-side { color: var(--quiet); font-size: 8px; letter-spacing: .12em; display: flex; align-items: center; gap: 14px; }
.summary-side i { color: var(--accent); font-size: 15px; font-style: normal; }
.science-details[open] .summary-side i { transform: rotate(45deg); }
.science-content { border-top: 1px solid var(--line-soft); padding: 17px 18px 13px; }
.science-lead p { margin: 0 0 17px; color: #c6d4d8; font-size: 12px; line-height: 1.65; max-width: 950px; }
.science-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 34px; }
.science-columns h3 { margin: 0 0 7px; font-size: 11px; color: var(--accent); }
.science-columns p { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 0 0 8px; }
.equation { padding: 10px 12px; border: 1px solid var(--line); background: #0c141b; border-radius: 7px; color: #d8e9e7 !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px !important; }
.science-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); margin-top: 9px; color: var(--quiet); font-size: 7px; letter-spacing: .12em; }
.page-footer { display: flex; justify-content: space-between; color: #52636d; font-size: 7px; letter-spacing: .14em; padding: 17px 2px 0; }

@media (max-width: 1080px) {
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: minmax(0,1fr) 310px; gap: 12px; }
  .control-panel { padding: 13px; }
  .readouts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .checks-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 12px 22px; }
  .site-header { height: 58px; }
  .header-right { font-size: 7px; gap: 6px; }
  .header-seed { display: none; }
  .intro-row { padding: 20px 0 16px; }
  .model-stamp { display: none; }
  h1 { font-size: clamp(23px, 6.5vw, 30px); max-width: 550px; }
  .intro-copy { font-size: 11px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; }
  .stage-column, .control-panel { width: 100%; }
  .canvas-wrap { height: clamp(285px, 78vw, 380px); }
  .control-panel { padding: 14px; }
  .checks-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .science-columns { grid-template-columns: 1fr; gap: 14px; }
  .science-details summary { padding: 13px; }
  .summary-side { font-size: 7px; gap: 6px; }
  .science-content { padding: 14px; }
}
@media (max-width: 420px) {
  .app-shell { padding-left: 9px; padding-right: 9px; }
  .brand-lockup .eyebrow { font-size: 8px; }
  .brand-sub { font-size: 7px; }
  .header-right { letter-spacing: .07em; }
  .canvas-wrap { height: 300px; }
  .stage-topline, .stage-bottomline { padding-left: 9px; padding-right: 9px; }
  .stage-note { font-size: 6px; }
  .stage-bottomline { font-size: 8px; }
  .stage-legend { font-size: 7px; }
  .readouts { gap: 6px; }
  .readout { padding: 10px 9px; }
  .readout-label { font-size: 7px; }
  .readout-label span { display: none; }
  .readout-value { font-size: 21px; }
  .readout-foot { font-size: 7px; }
  .checks-card { padding: 12px 10px; }
  .checks-grid { gap: 5px; }
  .check-item { padding: 8px 7px; }
  .science-foot { flex-direction: column; }
  .summary-side { letter-spacing: .06em; }
}

body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .site-header, body.embed-mode .intro-row, body.embed-mode .science-section, body.embed-mode .page-footer { display: none !important; }
body.embed-mode .app-shell { height: 100%; padding: 10px; overflow: hidden; }
body.embed-mode main { height: 100%; }
body.embed-mode .workspace { height: 100%; display: grid; grid-template-rows: minmax(0,1fr) 222px; grid-template-columns: minmax(0,1fr); gap: 9px; align-items: stretch; }
body.embed-mode .stage-column { min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) auto auto; gap: 8px; }
body.embed-mode .stage-card { min-height: 0; display: flex; flex-direction: column; }
body.embed-mode .canvas-wrap { flex: 1; min-height: 0; height: auto; }
body.embed-mode .stage-topline, body.embed-mode .stage-bottomline { flex: 0 0 27px; }
body.embed-mode .readouts { margin: 0; }
body.embed-mode .readout { padding: 7px 10px; }
body.embed-mode .readout-value { margin-top: 4px; font-size: 18px; }
body.embed-mode .readout-foot { margin-top: 2px; }
body.embed-mode .checks-card { display: none; }
body.embed-mode .control-panel { height: 222px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; }
body.embed-mode .panel-heading { margin-bottom: 8px; }
body.embed-mode .panel-heading h2 { font-size: 13px; }
body.embed-mode .presets-block { padding-bottom: 8px; }
body.embed-mode .preset-button { min-height: 34px; padding: 5px 7px; }
body.embed-mode .preset-description { display: none; }
body.embed-mode .sliders { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 12px; padding: 8px 0; }
body.embed-mode .slider-heading { display: block; margin-bottom: 4px; }
body.embed-mode .slider-heading label { display: block; font-size: 8px; }
body.embed-mode .slider-heading output { display: block; font-size: 8px; margin-top: 2px; }
body.embed-mode .range-ends { font-size: 6px; margin-top: 2px; }
body.embed-mode .control-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
body.embed-mode .quality-row { margin: 0; gap: 7px; }
body.embed-mode .experiment-card { display: none; }
@media (max-width: 600px) {
  body.embed-mode .app-shell { padding: 7px; }
  body.embed-mode .workspace { grid-template-rows: minmax(0,1fr) 275px; }
  body.embed-mode .control-panel { height: 275px; }
  body.embed-mode .canvas-wrap { min-height: 0; }
  body.embed-mode .stage-column { grid-template-rows: minmax(0,1fr) auto; }
  body.embed-mode .readouts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.embed-mode .readout:nth-child(5) { display: none; }
  body.embed-mode .sliders { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.embed-mode .control-actions { flex-wrap: wrap; }
  body.embed-mode .transport-row { flex: 1 1 190px; }
  body.embed-mode .quality-row { flex: 1 1 110px; }
}
