:root {
  color-scheme: dark;
  --bg: #081111;
  --panel: #0d1918;
  --panel-2: #10201e;
  --line: rgba(183, 221, 213, .12);
  --line-strong: rgba(183, 221, 213, .2);
  --text: #e6f0ed;
  --muted: #8fa7a0;
  --quiet: #627973;
  --accent: #78ddc9;
  --accent-dim: rgba(120, 221, 201, .14);
  --accent-line: rgba(120, 221, 201, .38);
  --danger: #e6b58c;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
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; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 32% 45%, rgba(22, 54, 48, .2), transparent 52%), var(--bg); }
.topbar { height: 78px; flex: 0 0 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(8, 17, 17, .9); }
.identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.mark { width: 34px; height: 34px; position: relative; border: 1px solid var(--accent-line); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-5deg); }
.mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.mark span:nth-child(1) { height: 10px; opacity: .55; }
.mark span:nth-child(2) { height: 18px; }
.mark span:nth-child(3) { height: 13px; opacity: .75; }
.eyebrow { font-size: 9px; line-height: 1.3; font-weight: 750; letter-spacing: .17em; color: var(--accent); }
.eyebrow i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--quiet); margin: 0 5px 2px; }
h1 { margin: 4px 0 0; font-size: 18px; line-height: 1.15; letter-spacing: -.035em; font-weight: 630; }
.top-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: .14em; font-weight: 700; white-space: nowrap; }
.live-dot, .stage-dot, .insight-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(120,221,201,.55); }
.live-dot { opacity: .55; }
.meta-divider { height: 15px; width: 1px; background: var(--line-strong); margin: 0 6px; }
.meta-small { color: var(--quiet); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 0; }
.visual-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 106px 27px; padding: 0 24px 18px 28px; border-right: 1px solid var(--line); }
.stage-bar { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 12px; }
.stage-label, .stage-state { font-size: 9px; font-weight: 760; letter-spacing: .15em; color: var(--muted); white-space: nowrap; }
.stage-dot { display: inline-block; margin: 0 7px 1px; width: 4px; height: 4px; box-shadow: none; }
.stage-state { color: var(--accent); overflow: hidden; text-overflow: ellipsis; }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(17,37,34,.76), rgba(8,18,18,.96)); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 60px rgba(0,0,0,.14); }
canvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; bottom: 13px; z-index: 2; font-size: 8px; letter-spacing: .13em; font-weight: 700; color: rgba(177, 203, 196, .52); pointer-events: none; }
.canvas-corner-left { left: 15px; }
.canvas-corner-left span { color: var(--accent); padding: 0 4px; }
.canvas-corner-right { right: 15px; font-variant-numeric: tabular-nums; }
.readout-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-top: 12px; }
.audit-line-visible { min-width: 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); overflow: hidden; }
.audit-line-visible span:first-child { flex: 0 0 auto; color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.audit-line-visible span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #91a8a1; font-size: 8px; font-variant-numeric: tabular-nums; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px 9px; background: rgba(13, 27, 25, .78); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 8px; color: var(--muted); letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.readout-label span { color: var(--quiet); font-family: Georgia, serif; font-size: 10px; letter-spacing: 0; }
.readout-value { margin-top: 7px; font-size: clamp(18px, 2.2vw, 24px); line-height: 1; font-weight: 560; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { font-size: 10px; letter-spacing: 0; color: var(--muted); font-weight: 600; margin-left: 2px; }
.readout-foot { margin-top: 7px; color: var(--quiet); font-size: 8px; letter-spacing: .04em; }
.mini-track { height: 3px; border-radius: 4px; margin-top: 10px; background: rgba(255,255,255,.07); overflow: hidden; }
.mini-track span { display: block; width: 100%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .18s ease-out; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 18px; background: linear-gradient(180deg, rgba(13,25,24,.96), rgba(10,20,19,.98)); scrollbar-width: thin; scrollbar-color: rgba(120,221,201,.25) transparent; }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: rgba(120,221,201,.22); border-radius: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.panel-head h2 { margin: 5px 0 0; font-size: 17px; font-weight: 620; letter-spacing: -.035em; }
.panel-icon { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 9px; color: var(--accent); font-size: 16px; }
.section-kicker { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .15em; font-weight: 750; color: var(--muted); margin-bottom: 8px; }
.section-kicker span { color: var(--quiet); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; transition: background .18s, border-color .18s, color .18s; }
.preset-button:hover { border-color: var(--accent-line); color: var(--text); }
.preset-button.selected { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.control-list { display: grid; gap: 15px; margin: 19px 0 17px; }
.control-item { min-width: 0; }
.control-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.control-heading label { font-size: 10px; color: #cbd9d5; font-weight: 590; }
.control-heading output { color: var(--accent); font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; appearance: none; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, var(--accent) 0%, rgba(120,221,201,.35) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: rgba(120,221,201,.35); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid var(--accent); border-radius: 50%; background: #0b1917; box-shadow: 0 0 0 3px rgba(120,221,201,.1); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid var(--accent); border-radius: 50%; background: #0b1917; box-shadow: 0 0 0 3px rgba(120,221,201,.1); }
.range-ends { display: flex; justify-content: space-between; color: var(--quiet); font-size: 8px; margin-top: 3px; letter-spacing: .015em; }
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 42px; gap: 7px; }
.run-button, .icon-button { min-height: 38px; border-radius: 8px; cursor: pointer; transition: transform .16s, background .16s, border-color .16s; }
.run-button { display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--accent); background: var(--accent); color: #06201b; font-size: 11px; font-weight: 780; }
.run-button:hover { background: #92ead8; transform: translateY(-1px); }
.play-glyph { font-size: 9px; }
.icon-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: var(--text); font-size: 11px; font-weight: 700; }
.icon-button:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }
.secondary-row { display: flex; justify-content: space-between; margin-top: 10px; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: var(--quiet); font-size: 8px; letter-spacing: .11em; font-weight: 750; cursor: pointer; }
.text-button strong { color: var(--accent); margin-left: 3px; }
.text-button:hover { color: var(--text); }
.insight-card { margin-top: 14px; padding: 12px 13px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(120,221,201,.045); }
.insight-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.insight-pulse { width: 5px; height: 5px; flex: 0 0 5px; box-shadow: none; }
.insight-head > span:nth-child(2) { font-size: 8px; font-weight: 800; letter-spacing: .12em; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insight-tag { margin-left: auto; color: var(--quiet); font-size: 7px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.insight-card p { margin: 8px 0 0; font-size: 10px; line-height: 1.55; color: #a7bbb5; }
.science-panel { margin-top: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { min-height: 39px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-mark { font-size: 16px; color: var(--accent); font-weight: 400; transition: transform .18s; }
.science-panel[open] .summary-mark { transform: rotate(45deg); }
.science-content { padding: 0 0 13px; color: #9db1ab; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 7px 0 10px; }
.science-content strong { color: #d8e7e2; font-weight: 650; }
.equation { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; padding: 7px 9px; border-left: 2px solid var(--accent-line); background: rgba(255,255,255,.025); }
.equation span { color: var(--quiet); font-size: 7px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.equation code { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; white-space: normal; }
.check-line { color: var(--accent); font-variant-numeric: tabular-nums; }
.disclaimer { color: var(--quiet); font-style: italic; }
.panel-foot { display: flex; flex-direction: column; gap: 5px; margin-top: 13px; color: var(--quiet); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.panel-foot span { font-size: 8px; font-weight: 500; letter-spacing: .015em; color: #8ca49c; }
@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .visual-panel { padding-left: 18px; padding-right: 16px; }
  .control-panel { padding-left: 17px; padding-right: 17px; }
  .topbar { padding: 0 18px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .topbar { height: 66px; flex-basis: 66px; padding: 0 14px; }
  .mark { width: 29px; height: 29px; border-radius: 8px; }
  .identity { gap: 10px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 15px; }
  .top-meta { gap: 6px; font-size: 8px; }
  .meta-small, .meta-divider { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 41dvh) minmax(0, 1fr); overflow: hidden; }
  .visual-panel { grid-template-rows: 31px minmax(0, 1fr) 79px 26px; padding: 0 10px 8px; border-right: 0; min-height: 0; }
  .stage-bar { padding: 0 3px; }
  .stage-label, .stage-state { font-size: 7px; letter-spacing: .1em; }
  .stage-state { max-width: 45%; text-align: right; }
  .canvas-wrap { border-radius: 10px; }
  .canvas-corner { bottom: 8px; font-size: 6px; }
  .canvas-corner-left { left: 9px; }
  .canvas-corner-right { right: 9px; }
  .readout-strip { gap: 6px; padding-top: 7px; }
  .audit-line-visible { gap: 6px; }
  .audit-line-visible span:first-child { font-size: 6px; letter-spacing: .07em; }
  .audit-line-visible span:last-child { font-size: 6px; }
  .readout-card { padding: 8px 8px 6px; border-radius: 8px; }
  .readout-label { font-size: 6px; letter-spacing: .07em; }
  .readout-label span { font-size: 8px; }
  .readout-value { margin-top: 6px; font-size: 18px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { font-size: 6px; margin-top: 5px; }
  .mini-track { margin-top: 8px; }
  .control-panel { padding: 14px 15px 22px; min-height: 0; }
  .panel-head { margin-bottom: 13px; }
  .panel-head h2 { font-size: 15px; }
  .panel-icon { width: 25px; height: 25px; }
  .control-list { gap: 13px; margin: 15px 0; }
  .control-heading label { font-size: 10px; }
  .control-heading output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .insight-card { margin-top: 12px; }
}
@media (max-width: 380px) {
  .top-meta { font-size: 7px; }
  .stage-label, .stage-state { font-size: 6px; }
  .readout-card { padding-left: 6px; padding-right: 6px; }
  .readout-value { font-size: 16px; }
  .control-panel { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
