:root {
  color-scheme: dark;
  --bg: #0a1116;
  --panel: #111c22;
  --panel-2: #152229;
  --line: #26353d;
  --line-soft: rgba(150, 176, 181, .13);
  --text: #e7eee9;
  --muted: #91a29f;
  --dim: #647571;
  --accent: #c2f36b;
  --accent-soft: rgba(194, 243, 107, .12);
  --warm: #d9b98b;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 25% 0%, #14232a 0%, var(--bg) 52%); color: var(--text); font-family: var(--font); font-size: 13px; }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(1500px, 100%); margin: 0 auto; padding: 22px 26px 14px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 2px 18px; border-bottom: 1px solid var(--line-soft); }
.brand-lockup { display: flex; align-items: center; gap: 15px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; position: relative; border: 1px solid rgba(194,243,107,.32); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-25deg); }
.brand-mark span { display: block; width: 2px; border-radius: 2px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 12px; transform: translateY(3px) rotate(-24deg); }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 15px; transform: translateY(-3px) rotate(24deg); }
.eyebrow, .section-kicker, .overlay-label, .caption-label, .readout-label, .readout-note, .meter-top, .footer-line, .stage-stamp, .canvas-legend, .top-meta, .range-ends, .audit-card span { font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.eyebrow { color: #9eafaa; display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
h1 { margin: 4px 0 0; font-size: clamp(18px, 2.1vw, 25px); letter-spacing: -.045em; font-weight: 600; }
h1 em { color: var(--accent); font-style: normal; }
.top-meta { color: #81918d; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 11px rgba(194,243,107,.55); }
.meta-divider { width: 1px; height: 13px; background: var(--line); margin: 0 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(330px, .9fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.stage-panel, .control-panel { min-width: 0; background: linear-gradient(145deg, rgba(20,32,38,.94), rgba(13,23,28,.98)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stage-panel { padding: 17px 17px 0; display: flex; flex-direction: column; }
.stage-heading, .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-kicker { color: #81938e; margin-bottom: 5px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.035em; }
.stage-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { border: 1px solid rgba(194,243,107,.26); color: var(--accent); background: rgba(194,243,107,.07); padding: 6px 8px; border-radius: 4px; font-size: 8px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.pill-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 0 5px 1px 0; }
.muted-pill { color: #9caeaa; border-color: var(--line); background: rgba(255,255,255,.025); }
.canvas-wrap { position: relative; height: clamp(330px, 38vw, 430px); min-height: 290px; margin-top: 14px; border: 1px solid rgba(160,184,178,.14); border-radius: 8px; overflow: hidden; background: #101a1f; }
canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-overlay { position: absolute; top: 13px; padding: 9px 11px; min-width: 112px; border: 1px solid rgba(153,176,171,.18); border-radius: 6px; background: rgba(9,16,20,.76); backdrop-filter: blur(8px); pointer-events: none; }
.overlay-top-left { left: 13px; }
.overlay-top-right { right: 13px; text-align: right; }
.overlay-label { display: block; color: #81938e; font-size: 8px; }
.canvas-overlay strong { display: block; margin-top: 3px; font-size: 20px; line-height: 1.1; font-weight: 600; letter-spacing: -.04em; color: var(--text); }
.canvas-overlay strong span { font-size: 11px; color: var(--muted); margin-left: 2px; }
.overlay-sub { margin-top: 4px; color: #93a39f; font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.canvas-legend { position: absolute; bottom: 12px; left: 13px; display: flex; flex-wrap: wrap; gap: 12px; color: #a1b0ac; font-size: 8px; pointer-events: none; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-line { width: 14px; height: 2px; display: inline-block; border-radius: 3px; }
.awn-line { background: #d8c19a; }
.hair-line { background: var(--accent); }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.seed-dot { background: #d7ae78; }
.stage-stamp { position: absolute; bottom: 13px; right: 13px; color: #647773; font-size: 8px; pointer-events: none; }
.stage-stamp span { color: var(--accent); padding: 0 4px; }
.stage-caption { display: flex; gap: 11px; align-items: flex-start; padding: 13px 2px 15px; min-height: 68px; }
.caption-icon { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 17px; }
.caption-label { color: #82948f; font-size: 8px; margin: 1px 0 4px; }
.stage-caption p { margin: 0; color: #c0cbc5; font-size: 11px; line-height: 1.5; max-width: 720px; }
.control-panel { padding: 17px 16px 14px; }
.panel-head { margin-bottom: 13px; }
.icon-button { border: 1px solid var(--line); border-radius: 5px; background: #17242a; padding: 7px 9px; font-size: 9px; letter-spacing: .12em; font-weight: 700; color: #a7b5af; cursor: pointer; white-space: nowrap; }
.quality-indicator { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin-left: 5px; vertical-align: 1px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 13px; }
.preset { display: flex; align-items: center; gap: 9px; min-width: 0; text-align: left; padding: 9px 10px; border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 6px; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.preset:hover { border-color: #52645e; transform: translateY(-1px); }
.preset.active { border-color: rgba(194,243,107,.45); background: rgba(194,243,107,.07); }
.preset-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; color: var(--accent); border-radius: 5px; background: rgba(194,243,107,.1); font-size: 17px; }
.quiet-icon { color: #a8b5af; background: rgba(255,255,255,.06); }
.preset b { display: block; font-size: 10px; font-weight: 600; }
.preset small { display: block; color: #83948f; font-size: 8px; margin-top: 3px; white-space: nowrap; }
.controls-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 17px; row-gap: 10px; }
.control-group { min-width: 0; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.control-top label { color: #c6d0ca; font-size: 10px; font-weight: 550; white-space: nowrap; }
.control-top output { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-top output i { color: #76877f; font-style: normal; font-size: 7px; letter-spacing: .07em; margin-left: 2px; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #34434a; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--accent); border: 2px solid #18242a; box-shadow: 0 0 0 1px rgba(194,243,107,.5); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #34434a; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #18242a; }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.range-ends { display: flex; justify-content: space-between; gap: 4px; color: #637570; font-size: 7px; letter-spacing: .02em; font-weight: 500; }
.last-control { grid-column: 1 / -1; }
.last-control .range-ends { max-width: 50%; }
.transport-controls { display: grid; grid-template-columns: 1.1fr .8fr .8fr 1.1fr; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.transport-controls button { height: 34px; border-radius: 5px; cursor: pointer; font-size: 9px; font-weight: 750; letter-spacing: .1em; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.transport-controls button:active { transform: translateY(1px); }
.primary-button { background: var(--accent); color: #18221b; border: 1px solid var(--accent); display: flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button:hover { background: #d1ff80; }
.play-symbol { font-size: 12px; }
.secondary-button, .screenshot-button { background: #18252b; color: #aebbb5; border: 1px solid #34434a; }
.secondary-button:hover, .screenshot-button:hover, .icon-button:hover { border-color: #758a7c; color: var(--text); }
.secondary-button span, .screenshot-button span { color: var(--accent); margin-left: 3px; }
.screenshot-button { font-size: 8px !important; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(155px, 1.05fr); gap: 0; margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(16,27,33,.92); overflow: hidden; }
.readout-item, .threshold-meter { min-width: 0; padding: 13px 14px 11px; border-right: 1px solid var(--line-soft); }
.threshold-meter { border-right: 0; }
.readout-label { display: block; color: #81938e; font-size: 8px; letter-spacing: .12em; white-space: nowrap; }
.readout-item strong { display: block; margin: 5px 0 3px; font-size: 21px; line-height: 1; font-weight: 600; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.readout-item strong small { color: #9aaba4; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-note { display: block; color: #687b75; font-size: 7px; letter-spacing: .09em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-readout strong { color: var(--accent); }
.meter-top { display: flex; justify-content: space-between; gap: 6px; color: #81938e; font-size: 8px; }
.meter-top strong { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.meter-track { height: 5px; background: #2a3a40; border-radius: 4px; overflow: hidden; margin: 13px 0 10px; }
.meter-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; transition: width .12s linear; box-shadow: 0 0 12px rgba(194,243,107,.25); }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(15,25,30,.88); }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 27px; height: 27px; display: grid; place-items: center; color: var(--accent); border-radius: 6px; background: var(--accent-soft); font-size: 16px; }
.science-panel summary b { display: block; font-size: 11px; font-weight: 600; }
.science-panel summary small { display: block; margin-top: 2px; color: #81938e; font-size: 9px; }
.summary-chevron { margin-left: auto; color: #81938e; font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 22px; padding: 2px 16px 16px; border-top: 1px solid var(--line-soft); }
.science-column { padding-top: 13px; min-width: 0; }
.science-column h3 { margin: 0 0 8px; color: #d6e0d9; font-size: 11px; font-weight: 650; }
.science-column p, .science-column li { color: #9baaa4; font-size: 10px; line-height: 1.55; }
.science-column p { margin: 0 0 9px; }
.equation { margin: 7px 0; padding: 7px 8px; border-left: 2px solid rgba(194,243,107,.45); background: rgba(255,255,255,.025); color: #d6e2d9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; overflow-wrap: anywhere; }
.equation-note { color: #758781 !important; font-size: 9px !important; }
.check-heading { margin-top: 13px !important; }
.audit-card { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 8px 0; }
.audit-card div { padding: 8px; border: 1px solid var(--line-soft); border-radius: 5px; background: rgba(255,255,255,.02); min-width: 0; }
.audit-card span { display: block; color: #72847e; font-size: 7px; }
.audit-card strong { display: block; margin-top: 4px; color: var(--accent); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.science-caveat ul { padding-left: 14px; margin: 0 0 10px; }
.science-caveat li { margin: 0 0 5px; }
.disclaimer { border-top: 1px solid var(--line-soft); padding-top: 9px; color: #7f9089 !important; font-style: italic; }
.footer-line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 3px 0; color: #5e706a; font-size: 7px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .shell { height: 100%; display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 8px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
body.embed-mode .workspace { flex: 0 0 auto; min-height: 0; }
body.embed-mode .stage-panel, body.embed-mode .control-panel { min-height: 0; }
body.embed-mode .canvas-wrap { height: auto; flex: 1 1 auto; min-height: 250px; }
body.embed-mode .readout-strip { flex: 0 0 auto; }
body.embed-mode .science-panel { flex: 0 0 auto; }
body.embed-mode .footer-line { flex: 0 0 auto; }
@media (max-width: 980px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .workspace { grid-template-columns: minmax(0,1.2fr) minmax(310px,.9fr); gap: 11px; }
  .stage-panel { padding: 14px 13px 0; }
  .control-panel { padding: 14px 12px 12px; }
  .controls-list { column-gap: 11px; }
  .control-top label { font-size: 9px; }
  .control-top output { font-size: 9px; }
  .readout-item, .threshold-meter { padding-left: 10px; padding-right: 10px; }
  .readout-item strong { font-size: 18px; }
}
@media (max-width: 760px) {
  .shell { padding: 12px 11px 10px; }
  .topbar { padding-bottom: 12px; }
  .brand-lockup { gap: 10px; }
  .brand-mark { width: 29px; height: 29px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 18px; }
  .top-meta { font-size: 7px; gap: 6px; }
  .top-meta .meta-divider, .top-meta span:last-child { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .stage-panel { padding: 13px 12px 0; }
  .control-panel { padding: 13px 12px 12px; }
  .canvas-wrap { height: clamp(275px, 40dvh, 370px); min-height: 265px; margin-top: 11px; }
  .stage-caption { min-height: 62px; padding: 10px 1px 12px; }
  .stage-heading h2, .panel-head h2 { font-size: 15px; }
  .canvas-overlay { top: 9px; padding: 7px 8px; min-width: 92px; }
  .overlay-top-left { left: 9px; }
  .overlay-top-right { right: 9px; }
  .canvas-overlay strong { font-size: 17px; }
  .canvas-legend { bottom: 9px; left: 9px; gap: 8px; font-size: 7px; }
  .stage-stamp { bottom: 10px; right: 9px; font-size: 7px; }
  .readout-strip { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 10px; }
  .readout-item { padding: 10px 12px; }
  .readout-item:nth-child(2n) { border-right: 0; }
  .readout-item:nth-child(3), .readout-item:nth-child(4), .threshold-meter { border-top: 1px solid var(--line-soft); }
  .threshold-meter { grid-column: 1 / -1; padding: 11px 12px; }
  .meter-track { margin: 8px 0; }
  .science-content { grid-template-columns: 1fr; gap: 2px; padding-left: 13px; padding-right: 13px; }
  .science-column { padding-top: 12px; }
  .footer-line { font-size: 6px; }
  body.embed-mode .shell { padding: 9px 9px 7px; }
  body.embed-mode .workspace { display: block; overflow: visible; }
  body.embed-mode .stage-panel { margin-bottom: 9px; }
  body.embed-mode .canvas-wrap { height: 34dvh; min-height: 265px; max-height: 350px; }
  body.embed-mode .control-panel { margin-bottom: 8px; }
  body.embed-mode .readout-strip { margin-top: 0; }
  body.embed-mode .science-panel { margin-top: 8px; }
  .stage-stamp { display: none; }
}
@media (max-width: 420px) {
  .top-meta { display: none; }
  .stage-badges { gap: 4px; }
  .pill { padding: 5px 6px; font-size: 7px; }
  .controls-list { column-gap: 10px; row-gap: 9px; }
  .control-top { display: block; margin-bottom: 3px; }
  .control-top output { display: block; margin-top: 2px; }
  .range-ends { font-size: 6px; }
  .transport-controls { grid-template-columns: 1fr 1fr 1fr; }
  .screenshot-button { grid-column: 1 / -1; }
  .last-control .range-ends { max-width: 100%; }
  .readout-label { font-size: 7px; }
  .readout-item strong { font-size: 20px; }
  .footer-line { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
