:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --panel: #10151d;
  --panel-2: #131a23;
  --line: #26313d;
  --line-soft: #1c2631;
  --text: #e9f0f6;
  --muted: #8c9aa8;
  --dim: #647282;
  --accent: #65d6c6;
  --accent-strong: #8ae8dc;
  --accent-wash: rgba(101,214,198,.12);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
.app-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 12% -12%, rgba(53,91,101,.18), transparent 42%), var(--bg); }
.topbar { height: 78px; flex: 0 0 78px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: rgba(10,13,18,.94); }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; border: 1px solid #33434d; border-radius: 10px; transform: rotate(-8deg); }
.brand-mark span { display: block; border-radius: 2px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .32; }
.heading-group { min-width: 0; }
.eyebrow, .section-heading, .stage-topline, .caption-label, .metric-label, .chart-heading, .equation-label { font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.heading-group h1 { margin: 3px 0 1px; font-size: 17px; line-height: 1.2; font-weight: 690; letter-spacing: -.025em; }
.heading-group h1 span { color: var(--accent); padding: 0 2px; }
.heading-group p { margin: 0; color: var(--muted); font-size: 11px; }
.top-status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .12em; color: var(--accent); font-weight: 800; white-space: nowrap; }
.status-dot, .live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(101,214,198,.65); }
.status-dot.paused { background: #738191; box-shadow: none; }
.seed-tag { margin-left: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--dim); font-size: 8px; }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 354px; gap: 0; flex: 1; min-height: 0; }
.visual-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 18px 14px 22px; border-right: 1px solid var(--line-soft); }
.stage-topline { height: 26px; flex: 0 0 26px; display: flex; align-items: flex-start; justify-content: space-between; }
.stage-right { display: flex; align-items: center; gap: 10px; }
.stage-key { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 8px; font-weight: 600; letter-spacing: .02em; }
.quality-button { height: 22px; padding: 0 8px; border: 1px solid #3c4c58; border-radius: 5px; background: #121c24; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.quality-button:hover { border-color: var(--accent); }
.key-dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; display: inline-block; margin-left: 8px; }
.key-ring { width: 8px; height: 8px; border: 1px solid var(--accent); border-radius: 50%; display: inline-block; margin-left: 7px; }
.key-line { width: 12px; border-top: 1px dashed #7d8b99; display: inline-block; margin-left: 7px; }
.canvas-wrap { position: relative; flex: 1; min-height: 150px; overflow: hidden; border: 1px solid #202b36; border-radius: 10px; background: #0b1118; box-shadow: inset 0 0 80px rgba(0,0,0,.18); }
#landscape { display: block; width: 100%; height: 100%; }
.canvas-hud { position: absolute; top: 14px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.hud-left { left: 16px; }
.hud-right { right: 16px; align-items: flex-end; }
.hud-label { font-size: 8px; font-weight: 800; letter-spacing: .15em; color: #72808e; }
.canvas-hud strong { color: #dfe9ef; font-size: 13px; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.hud-right strong { color: var(--accent); font-size: 9px; }
.canvas-footnote { position: absolute; left: 14px; bottom: 10px; color: #657482; font-size: 8px; letter-spacing: .035em; pointer-events: none; }
.caption-strip { display: flex; gap: 11px; align-items: flex-start; min-height: 64px; padding: 13px 4px 0; }
.caption-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid rgba(101,214,198,.28); border-radius: 8px; background: var(--accent-wash); color: var(--accent); font-size: 15px; }
.caption-label { font-size: 8px; }
.caption-strip p { margin: 4px 0 0; color: #b5c2cd; font-size: 11px; line-height: 1.45; max-width: 850px; }
.control-panel { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 16px 12px; background: linear-gradient(180deg, rgba(17,23,31,.96), rgba(12,17,23,.98)); scrollbar-width: thin; scrollbar-color: #34424e transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #34424e; border-radius: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.live-pill { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 8px; letter-spacing: .1em; }
.live-pill i { width: 5px; height: 5px; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-card { min-width: 0; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(20,28,37,.78); }
.metric-wide { grid-column: 1 / -1; }
.metric-label { font-size: 8px; letter-spacing: .1em; }
.metric-label span { color: var(--dim); font-weight: 600; }
.metric-value { margin-top: 5px; color: #edf4f7; font-size: 19px; line-height: 1.05; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-wide .metric-value { font-size: 23px; color: var(--accent-strong); }
.metric-sub { margin-top: 4px; color: var(--dim); font-size: 9px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.check-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px; margin-top: 7px; padding: 8px 9px; border: 1px solid rgba(101,214,198,.22); border-radius: 6px; background: rgba(101,214,198,.045); }
.check-line span { color: #84939f; font-size: 7px; font-weight: 800; letter-spacing: .11em; }
.check-line strong { color: #c7d8db; font-size: 9px; font-variant-numeric: tabular-nums; }
.check-line small { grid-column: 1 / -1; color: var(--accent); font-size: 8px; font-variant-numeric: tabular-nums; }
.preset-section, .parameters-section, .run-section { margin-top: 17px; }
.tiny-note { color: var(--dim); font-size: 8px; font-weight: 600; letter-spacing: .04em; text-transform: none; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 7px; background: #121923; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { border-color: #53616d; }
.preset-button.active { border-color: rgba(101,214,198,.65); background: rgba(101,214,198,.08); }
.preset-button b { display: block; font-size: 9px; font-weight: 700; }
.preset-button small { display: block; margin-top: 3px; color: var(--dim); font-size: 8px; }
.preset-glyph { width: 26px; height: 26px; flex: 0 0 26px; position: relative; border: 1px solid #4b5b67; border-radius: 50%; }
.round-glyph::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--accent); border-radius: 50%; }
.canyon-glyph { transform: rotate(-35deg) scaleY(.38); border-color: var(--accent); border-width: 2px; border-radius: 50%; }
.control-row { margin: 12px 0 13px; }
.control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.control-head label { color: #d4dee6; font-size: 10px; font-weight: 620; }
.control-head output { color: var(--accent-strong); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; appearance: none; background: transparent; cursor: ew-resize; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0%, #2d4249 0%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #2d4249; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0e171c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0e171c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-hints { display: flex; justify-content: space-between; margin-top: 4px; color: #647381; font-size: 8px; }
.restart-note { margin: 7px 0 0; color: #778694; font-size: 8px; line-height: 1.4; }
.run-buttons { display: grid; grid-template-columns: 1.12fr .8fr .7fr 1.15fr; gap: 6px; }
.primary-button, .secondary-button { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border-radius: 6px; font-size: 9px; font-weight: 700; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #09201f; }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { border: 1px solid #34414d; background: #151d27; color: #d2dce4; }
.secondary-button:hover { border-color: #647582; background: #1a2630; }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.play-icon { font-size: 12px; }
kbd { padding: 2px 4px; border: 1px solid #43515e; border-radius: 3px; color: #82909d; font-size: 8px; font-weight: 600; }
.screenshot-button { white-space: nowrap; }
.screenshot-button span { color: var(--accent); font-size: 12px; }
.chart-card { margin-top: 11px; padding: 10px 10px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(18,25,34,.8); }
.chart-heading { display: flex; justify-content: space-between; color: #a5b2bd; font-size: 8px; }
.chart-heading span:last-child { color: var(--dim); font-weight: 600; text-transform: none; letter-spacing: .03em; }
#historyChart { display: block; width: 100%; height: 112px; margin-top: 4px; }
.chart-legend { display: flex; gap: 14px; color: var(--dim); font-size: 8px; }
.legend-line, .legend-optimum { display: inline-block; width: 11px; margin-right: 4px; vertical-align: middle; border-top: 2px solid var(--accent); }
.legend-optimum { border-top: 1px dashed #7d8994; }
.science-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(17,24,33,.75); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 10px; color: #b8c5cf; font-size: 9px; font-weight: 800; letter-spacing: .14em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-mark { color: var(--accent); font-size: 15px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-mark { transform: rotate(45deg); }
.science-content { padding: 0 10px 12px; color: #9aa9b6; font-size: 9px; line-height: 1.5; }
.science-intro { margin: 0 0 10px; color: #c0cbd4; }
.equation-block { margin: 7px 0; padding: 8px; border-left: 2px solid rgba(101,214,198,.6); background: #0c131a; }
.equation-label { display: block; margin-bottom: 4px; color: #71818e; font-size: 7px; }
.equation-block code { color: #d6e7e8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.equation-block small { display: block; margin-top: 4px; color: var(--dim); font-size: 8px; }
.science-content h3 { margin: 12px 0 5px; color: #c6d1da; font-size: 9px; }
.science-content ul { margin: 5px 0 10px; padding-left: 16px; }
.science-content li { margin: 4px 0; }
.disclaimer { margin: 10px 0 0; color: #84929f; font-style: italic; }
.panel-footer { padding: 12px 0 2px; color: #52606d; font-size: 8px; letter-spacing: .04em; text-align: center; }
@media (max-width: 900px) {
  .topbar { height: 66px; flex-basis: 66px; padding: 0 16px; }
  .workspace { grid-template-columns: minmax(0,1fr) 320px; }
  .visual-stage { padding-left: 14px; padding-right: 12px; }
  .control-panel { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { height: 100dvh; }
  .topbar { height: 58px; flex-basis: 58px; gap: 10px; padding: 0 12px; }
  .brand-mark { width: 28px; height: 28px; padding: 4px; gap: 2px; border-radius: 8px; }
  .eyebrow { font-size: 7px; }
  .heading-group h1 { font-size: 13px; }
  .heading-group p { display: none; }
  .top-status { gap: 5px; font-size: 7px; }
  .seed-tag { margin-left: 4px; padding: 4px 5px; font-size: 7px; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(245px, 42%) minmax(0,1fr); gap: 0; }
  .visual-stage { padding: 9px 9px 7px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .stage-topline { height: 20px; flex-basis: 20px; font-size: 8px; }
  .stage-right { gap: 5px; }
  .stage-key { gap: 4px; font-size: 7px; }
  .quality-button { height: 19px; padding: 0 6px; font-size: 7px; }
  .key-dot { margin-left: 2px; }
  .key-ring, .key-line { margin-left: 2px; }
  .canvas-wrap { min-height: 0; border-radius: 7px; }
  .canvas-hud { top: 9px; }
  .hud-left { left: 10px; }
  .hud-right { right: 10px; }
  .hud-label { font-size: 7px; }
  .canvas-hud strong { font-size: 11px; }
  .hud-right strong { font-size: 7px; }
  .canvas-footnote { left: 9px; bottom: 7px; font-size: 7px; }
  .caption-strip { min-height: 48px; padding: 7px 1px 0; gap: 7px; }
  .caption-icon { width: 22px; height: 22px; flex-basis: 22px; font-size: 12px; border-radius: 6px; }
  .caption-label { font-size: 7px; }
  .caption-strip p { margin-top: 2px; font-size: 9px; line-height: 1.3; }
  .control-panel { padding: 10px 10px 14px; overflow: auto; }
  .section-heading { margin-bottom: 7px; font-size: 8px; }
  .metrics-grid { gap: 5px; }
  .metric-card { padding: 7px 8px 6px; }
  .metric-label { font-size: 7px; }
  .metric-value { margin-top: 3px; font-size: 16px; }
  .metric-wide .metric-value { font-size: 19px; }
  .metric-sub { margin-top: 3px; font-size: 8px; }
  .preset-section, .parameters-section, .run-section { margin-top: 13px; }
  .preset-button { padding: 7px 6px; gap: 6px; }
  .preset-glyph { width: 22px; height: 22px; flex-basis: 22px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .control-row { margin: 9px 0 10px; }
  .control-head label, .control-head output { font-size: 9px; }
  .range-hints { font-size: 7px; }
  .restart-note { font-size: 7px; }
  .run-buttons { grid-template-columns: 1.1fr .75fr .65fr 1.1fr; gap: 5px; }
  .primary-button, .secondary-button { height: 32px; padding: 0 5px; font-size: 8px; }
  .chart-card { margin-top: 8px; padding: 8px; }
  #historyChart { height: 98px; }
  .science-panel { margin-top: 10px; }
}
@media (max-width: 380px) {
  .top-status { font-size: 6px; }
  .seed-tag { display: none; }
  .stage-key { font-size: 6px; }
  .metric-label { letter-spacing: .06em; }
  .run-buttons { grid-template-columns: 1fr 1fr .8fr; }
  .screenshot-button { grid-column: 1 / -1; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
