:root {
  color-scheme: dark;
  --bg: #080d14;
  --panel: #0d1520;
  --panel-2: #101b28;
  --line: rgba(164, 190, 207, .13);
  --line-strong: rgba(164, 190, 207, .22);
  --text: #edf4f6;
  --muted: #91a3ae;
  --dim: #60717e;
  --accent: #82e6d2;
  --accent-soft: rgba(130, 230, 210, .12);
  --accent-strong: #a4f5e5;
  --radius: 12px;
  font-family: 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); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: 62px minmax(0, 1fr); background: radial-gradient(ellipse at 23% 0%, rgba(30, 66, 75, .13), transparent 42%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 20, .94); min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; position: relative; border: 1px solid rgba(130,230,210,.48); border-radius: 50%; display: grid; place-items: center; transform: rotate(-25deg); }
.brand-mark:before, .brand-mark:after { content: ""; position: absolute; width: 39px; height: 12px; border: 1px solid rgba(130,230,210,.48); border-radius: 50%; }
.brand-mark:after { transform: rotate(58deg); width: 34px; height: 10px; opacity: .5; }
.brand-mark span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(130,230,210,.8); }
.brand-mark i { position: absolute; width: 3px; height: 3px; background: #e5fffa; border-radius: 50%; top: 3px; right: 2px; }
.brand-copy { min-width: 0; }
.brand-kicker { font-size: 9px; letter-spacing: .18em; color: #718792; font-weight: 700; line-height: 1.4; }
.brand-kicker span { color: var(--accent); padding: 0 4px; }
.brand-title { font-size: 14px; letter-spacing: -.02em; font-weight: 650; line-height: 1.35; }
.top-meta { display: flex; align-items: center; gap: 9px; font-size: 9px; letter-spacing: .14em; color: #8ea1aa; font-weight: 700; white-space: nowrap; }
.live-dot, .clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(130,230,210,.7); }
.live-label { color: #b8d4d3; }
.meta-divider { height: 14px; width: 1px; background: var(--line-strong); margin: 0 5px; }
.seed-label { color: #687c88; }
.seed-label span { color: var(--accent); padding: 0 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 12px; padding: 12px; min-height: 0; overflow: hidden; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(190px, 1fr) auto auto auto; gap: 9px; padding: 18px 18px 12px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(155deg, rgba(17,29,41,.95), rgba(10,17,26,.97) 58%); box-shadow: 0 18px 48px rgba(0,0,0,.18); overflow: hidden; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.heading-copy { min-width: 0; }
.eyebrow, .panel-eyebrow { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .17em; display: flex; align-items: center; gap: 7px; }
.eyebrow-line { display: inline-block; width: 17px; height: 1px; background: var(--accent); opacity: .8; }
h1 { margin: 5px 0 3px; font-size: clamp(17px, 1.7vw, 22px); line-height: 1.15; letter-spacing: -.045em; font-weight: 650; }
.stage-subtitle { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.stage-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.utility-button, .icon-button { border: 1px solid var(--line-strong); background: rgba(7,13,20,.48); color: #aabac2; height: 31px; border-radius: 8px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 10px; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.utility-button:hover, .icon-button:hover { border-color: rgba(130,230,210,.48); color: var(--text); background: rgba(130,230,210,.08); }
.utility-button.active { color: var(--accent-strong); border-color: rgba(130,230,210,.36); background: var(--accent-soft); }
.icon-button { width: 32px; padding: 0; }
.button-glyph { width: 12px; height: 12px; display: inline-block; position: relative; }
.trace-glyph:before { content: ""; position: absolute; left: 0; right: 0; top: 5px; border-top: 1px dashed currentColor; }
.trace-glyph:after { content: ""; position: absolute; width: 4px; height: 4px; border: 1px solid currentColor; border-radius: 50%; top: 3px; left: 4px; background: var(--panel); }
.quality-glyph { width: 11px; height: 11px; border: 1px solid currentColor; border-radius: 3px; display: inline-block; position: relative; }
.quality-glyph:after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: currentColor; top: 3px; left: 3px; box-shadow: 0 0 4px currentColor; }
.camera-glyph { width: 14px; height: 10px; border: 1px solid currentColor; border-radius: 2px; display: block; position: relative; }
.camera-glyph:before { content: ""; position: absolute; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; top: 1px; left: 3px; }
.camera-glyph:after { content: ""; position: absolute; width: 4px; height: 2px; background: currentColor; top: -3px; left: 3px; border-radius: 2px 2px 0 0; }
.canvas-frame { min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(141,174,187,.14); border-radius: 11px; background: #080f18; }
#simCanvas { display: block; width: 100%; height: 100%; outline: none; }
.canvas-corner { position: absolute; top: 10px; z-index: 1; color: #708893; font-size: 8px; letter-spacing: .14em; font-weight: 750; pointer-events: none; }
.canvas-corner-left { left: 12px; display: flex; align-items: center; gap: 6px; }
.canvas-corner-right { right: 12px; color: #5e727e; }
.corner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .75; }
.canvas-hint { position: absolute; bottom: 9px; right: 11px; color: rgba(145,170,181,.6); font-size: 8px; letter-spacing: .13em; pointer-events: none; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.readout-card { padding: 8px 10px 7px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,12,19,.42); min-width: 0; }
.readout-label { display: flex; align-items: center; gap: 5px; color: #81939e; font-size: 8px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.value-tag { color: #637e82; font-size: 7px; letter-spacing: .08em; border: 1px solid rgba(130,230,210,.14); border-radius: 3px; padding: 1px 3px; }
.readout-value { font-size: clamp(17px, 1.9vw, 23px); font-weight: 650; letter-spacing: -.045em; line-height: 1.3; margin-top: 3px; font-variant-numeric: tabular-nums; }
.readout-value small { font-size: 10px; color: #9aadb5; font-weight: 550; letter-spacing: 0; }
.readout-formula { font-size: 8px; color: #657985; margin-top: 1px; white-space: nowrap; }
.caption-row { display: flex; gap: 9px; align-items: flex-start; padding: 7px 10px; border: 1px solid rgba(130,230,210,.14); background: rgba(130,230,210,.035); border-radius: 8px; min-height: 42px; }
.caption-mark { width: 15px; height: 15px; border: 1px solid rgba(130,230,210,.48); border-radius: 50%; color: var(--accent); display: grid; place-items: center; font-size: 10px; font-family: Georgia,serif; flex: 0 0 auto; margin-top: 1px; }
.caption-title { color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .13em; margin-bottom: 2px; }
.caption-row p { margin: 0; color: #a8b8be; font-size: 10px; line-height: 1.35; }
.transport-bar { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport-controls { display: flex; align-items: center; gap: 5px; }
.play-button, .step-button { height: 29px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; padding: 0 10px; border: 1px solid var(--line-strong); background: rgba(8,15,22,.65); color: #b7c5ca; cursor: pointer; font-size: 10px; transition: all .2s ease; }
.play-button { color: #081512; background: var(--accent); border-color: var(--accent); font-weight: 750; min-width: 82px; }
.play-button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.step-button:hover { color: var(--text); border-color: rgba(130,230,210,.4); }
.pause-icon { width: 9px; height: 10px; display: inline-block; border-left: 2px solid #0a1916; border-right: 2px solid #0a1916; }
.play-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid #0a1916; }
.step-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; position: relative; }
.step-icon:after { content: ""; position: absolute; height: 10px; width: 1px; background: currentColor; right: -3px; top: -5px; }
.reset-icon { width: 10px; height: 10px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; position: relative; }
.reset-icon:after { content: ""; position: absolute; right: -2px; top: -2px; border-left: 4px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transform: rotate(-35deg); }
.playback-control { display: flex; align-items: center; gap: 8px; min-width: 130px; flex: 0 1 190px; }
.playback-control label { color: #72858f; font-size: 8px; letter-spacing: .1em; white-space: nowrap; font-weight: 750; }
.playback-control label span { color: var(--accent); font-variant-numeric: tabular-nums; }
.playback-control input { min-width: 45px; flex: 1; }
.event-clock { display: flex; align-items: center; gap: 6px; color: #81939c; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-clock .clock-dot { width: 5px; height: 5px; }
.control-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(180deg, rgba(15,25,36,.98), rgba(10,17,26,.98)); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 14px; scrollbar-width: thin; scrollbar-color: #334651 transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #334651; border-radius: 5px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-eyebrow { color: #78949a; font-size: 8px; }
.panel-header h2 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.035em; font-weight: 650; }
.sliders-icon { display: flex; gap: 3px; align-items: center; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; }
.sliders-icon span { width: 2px; height: 12px; background: #6d8a8d; position: relative; }
.sliders-icon span:nth-child(2) { height: 17px; }
.sliders-icon span:after { content: ""; width: 6px; height: 4px; position: absolute; left: -2px; top: 3px; background: var(--accent); border-radius: 2px; }
.sliders-icon span:nth-child(2):after { top: 9px; }
.section-label { display: flex; justify-content: space-between; color: #8da0a9; font-size: 8px; letter-spacing: .12em; font-weight: 750; margin-bottom: 8px; }
.section-label span { color: #627c7f; font-size: 7px; }
.preset-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 7px; min-width: 0; text-align: left; padding: 8px 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(5,12,18,.36); cursor: pointer; transition: all .2s ease; }
.preset-button:hover { border-color: rgba(130,230,210,.38); }
.preset-button.selected { background: rgba(130,230,210,.075); border-color: rgba(130,230,210,.4); }
.preset-button b { display: block; font-size: 9px; font-weight: 650; color: #d8e3e5; white-space: nowrap; }
.preset-button small { display: block; color: #788b95; font-size: 7px; margin-top: 3px; white-space: nowrap; }
.preset-symbol { width: 25px; height: 25px; border: 1px solid rgba(130,230,210,.22); border-radius: 6px; flex: 0 0 auto; position: relative; overflow: hidden; }
.crisp-symbol:before { content: ""; position: absolute; width: 3px; height: 21px; left: 10px; top: 1px; background: var(--accent); box-shadow: -5px 0 0 rgba(130,230,210,.3), 5px 0 0 rgba(130,230,210,.3); }
.crisp-symbol:after { content: ""; position: absolute; width: 22px; height: 1px; left: 1px; top: 12px; background: rgba(130,230,210,.45); }
.soft-symbol:before { content: ""; position: absolute; inset: 5px 2px; background: linear-gradient(90deg, transparent, rgba(130,230,210,.8), transparent); filter: blur(3px); }
.soft-symbol:after { content: ""; position: absolute; width: 16px; height: 7px; left: 4px; top: 8px; border-radius: 50%; border: 1px solid rgba(130,230,210,.55); filter: blur(1px); }
.control-list { padding-top: 3px; }
.control-row { padding: 8px 0 7px; border-bottom: 1px solid rgba(164,190,207,.075); }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.control-top label { color: #c3d0d4; font-size: 10px; font-weight: 550; }
.control-top output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 4px; margin: 0; border-radius: 8px; background: linear-gradient(90deg, rgba(130,230,210,.68), rgba(130,230,210,.16)); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #a3f4e4; border: 2px solid #173b39; box-shadow: 0 0 0 2px rgba(130,230,210,.16); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #a3f4e4; border: 2px solid #173b39; box-shadow: 0 0 0 2px rgba(130,230,210,.16); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.range-ends { display: flex; justify-content: space-between; color: #5e707b; font-size: 7px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.control-footer { padding: 10px 0 11px; }
.footer-note { display: flex; gap: 7px; align-items: center; color: #738791; font-size: 8px; line-height: 1.35; }
.footer-note-icon { width: 14px; height: 14px; border: 1px solid rgba(130,230,210,.3); border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-size: 9px; flex: 0 0 auto; }
.science-panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(5,12,18,.32); overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px; cursor: pointer; color: #d2dddf; font-size: 10px; font-weight: 650; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.science-icon { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid rgba(130,230,210,.3); border-radius: 5px; color: var(--accent); font-size: 11px; }
.summary-plus { margin-left: auto; color: var(--accent); font-size: 16px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 10px 12px; color: #9aabb3; font-size: 9px; line-height: 1.5; }
.science-content h3 { margin: 10px 0 4px; color: #d1dfe0; font-size: 10px; font-weight: 650; }
.science-content p { margin: 5px 0 8px; }
.equation { margin: 6px 0; padding: 7px 8px; background: rgba(130,230,210,.045); border: 1px solid rgba(130,230,210,.12); border-radius: 5px; color: #c5e6df; font-family: Georgia,serif; font-size: 10px; overflow-wrap: anywhere; }
.frac { font-size: 9px; }
.science-content ul { padding-left: 15px; margin: 5px 0 9px; }
.science-content li { margin: 3px 0; }
.science-tag { display: inline-block; font-family: inherit; font-size: 7px; color: #7b9e99; letter-spacing: .08em; border: 1px solid rgba(130,230,210,.16); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.check-card { margin: 9px 0; padding: 8px; border: 1px solid rgba(130,230,210,.22); border-radius: 6px; background: rgba(130,230,210,.04); }
.check-heading { color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .08em; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.check-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin-top: 6px; }
.check-values span { display: block; color: #81949c; font-size: 7px; }
.check-values b { display: block; color: #e0efec; font-size: 10px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.scale-note { padding: 8px; border-left: 2px solid rgba(130,230,210,.5); background: rgba(130,230,210,.035); }
.scale-note b { color: #d0e1df; font-size: 9px; }
.scale-note p { margin: 3px 0 0; }
.disclaimer { color: #71858d; font-style: italic; font-size: 8px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1fr) 310px; gap: 8px; padding: 8px; }
  .stage-panel { padding: 14px 13px 10px; }
  .panel-scroll { padding: 14px 12px 12px; }
  .stage-actions .utility-button { padding: 0 7px; }
  .readout-label { font-size: 7px; }
  .value-tag { display: none; }
}
@media (max-width: 680px) {
  .app-shell { grid-template-rows: 54px minmax(0,1fr); }
  .topbar { padding: 0 13px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-mark:before { width: 33px; height: 10px; }
  .brand-mark:after { width: 28px; height: 8px; }
  .brand-title { font-size: 12px; }
  .brand-kicker { font-size: 7px; }
  .top-meta { gap: 6px; font-size: 7px; }
  .seed-label { display: none; }
  .meta-divider { display: none; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 258px; gap: 7px; padding: 7px; }
  .stage-panel { grid-template-rows: auto minmax(120px,1fr) auto auto auto; gap: 6px; padding: 10px 9px 8px; border-radius: 11px; }
  .stage-heading { align-items: flex-start; }
  h1 { font-size: 15px; margin: 4px 0 2px; }
  .stage-subtitle { font-size: 9px; }
  .eyebrow { font-size: 7px; }
  .stage-actions { gap: 4px; }
  .utility-button { height: 27px; padding: 0 6px; gap: 4px; font-size: 8px; }
  .icon-button { width: 27px; height: 27px; }
  .stage-actions .button-glyph, .stage-actions .quality-glyph { transform: scale(.85); }
  .canvas-frame { border-radius: 8px; }
  .canvas-corner { top: 7px; font-size: 6px; }
  .canvas-corner-left { left: 8px; }
  .canvas-corner-right { right: 8px; }
  .canvas-hint { bottom: 6px; right: 8px; font-size: 6px; }
  .readout-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .readout-card { padding: 5px 5px 4px; border-radius: 6px; }
  .readout-label { font-size: 6px; letter-spacing: .04em; white-space: normal; line-height: 1.15; min-height: 14px; }
  .readout-value { font-size: 15px; margin-top: 2px; }
  .readout-value small { font-size: 8px; }
  .readout-formula { font-size: 6px; overflow: hidden; text-overflow: ellipsis; }
  .caption-row { min-height: 32px; padding: 5px 7px; gap: 6px; }
  .caption-mark { width: 12px; height: 12px; font-size: 8px; }
  .caption-title { font-size: 6px; margin-bottom: 1px; }
  .caption-row p { font-size: 8px; line-height: 1.25; }
  .transport-bar { min-height: 28px; gap: 5px; }
  .play-button, .step-button { height: 25px; padding: 0 7px; font-size: 8px; gap: 5px; }
  .play-button { min-width: 68px; }
  .playback-control { flex: 1 1 90px; min-width: 80px; gap: 5px; }
  .playback-control label { font-size: 6px; }
  .event-clock { font-size: 7px; gap: 4px; }
  .control-panel { border-radius: 10px; }
  .panel-scroll { padding: 10px 11px; }
  .panel-header { padding-bottom: 8px; }
  .panel-header h2 { font-size: 13px; }
  .panel-eyebrow { font-size: 7px; }
  .preset-block { padding: 8px 0 7px; }
  .section-label { font-size: 7px; margin-bottom: 5px; }
  .preset-button { padding: 5px 6px; gap: 6px; }
  .preset-symbol { width: 21px; height: 21px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; margin-top: 2px; }
  .control-row { padding: 5px 0 4px; }
  .control-top { margin-bottom: 4px; }
  .control-top label, .control-top output { font-size: 9px; }
  .range-ends { font-size: 6px; margin-top: 2px; }
  .control-footer { padding: 7px 0; }
  .footer-note { font-size: 7px; }
  .science-panel summary { padding: 8px; font-size: 9px; }
}
@media (max-width: 370px) {
  .stage-actions .utility-button span:not(.button-glyph):not(.quality-glyph) { display: none; }
  .stage-actions .utility-button { width: 28px; padding: 0; }
  .readout-value { font-size: 13px; }
  .event-clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
