:root {
  color-scheme: dark;
  --bg: #081218;
  --panel: #101f27;
  --panel-2: #13252e;
  --panel-3: #172b34;
  --line: rgba(190, 220, 222, .12);
  --line-strong: rgba(190, 220, 222, .2);
  --text: #e8f0ec;
  --muted: #8da3a5;
  --muted-2: #62797e;
  --teal: #71e0d1;
  --teal-dim: #3d9e98;
  --amber: #f2bd78;
  --coral: #ee806d;
  --radius: 18px;
  --shadow: 0 18px 48px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 16% 0%, rgba(47, 93, 92, .16), transparent 38%), var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; letter-spacing: .005em; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 22px 28px 18px; }
body.embed-mode .app-shell { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 2px 22px; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(113,224,209,.32); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 3px; background: rgba(113,224,209,.06); transform: rotate(-8deg); }
.brand-mark span { display: block; width: 4px; border-radius: 6px; background: var(--teal); transform: skewY(-22deg); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .72; }
.eyebrow, .section-label, .science-kicker { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.eyebrow span { color: var(--teal-dim); padding: 0 4px; }
h1 { margin: 4px 0 0; font-size: clamp(21px, 2vw, 28px); font-weight: 550; letter-spacing: -.045em; line-height: 1.1; }
h1 em { color: var(--teal); font-style: normal; font-weight: 350; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.model-tag { display: flex; align-items: center; gap: 8px; color: #a3b6b4; font-size: 9px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.pulse-dot, .view-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(113,224,209,.1); }
.icon-button, .control-button, .play-button, .quality-button, .preset-button { border: 1px solid var(--line); cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.035); color: #c7d5d2; font-size: 11px; }
.icon-button:hover, .control-button:hover { background: rgba(113,224,209,.08); border-color: rgba(113,224,209,.34); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(315px, .85fr); gap: 18px; align-items: start; }
.visual-column { min-width: 0; }
.stage-card, .control-panel, .readout-card, .caption-card, .science-panel { background: linear-gradient(145deg, rgba(19,37,46,.96), rgba(13,27,35,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage-card { overflow: hidden; }
.stage-meta { height: 40px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.012); }
.view-label, .stage-right-meta { display: flex; align-items: center; gap: 9px; color: #a7b9b6; font-size: 9px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.stage-right-meta { color: #70878a; font-size: 8px; }
.stage-divider { width: 1px; height: 11px; background: var(--line-strong); }
.canvas-wrap { position: relative; height: clamp(340px, 42vw, 520px); min-height: 300px; overflow: hidden; background: #0b1a20; }
#simCanvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; bottom: 13px; display: flex; align-items: center; gap: 7px; color: rgba(184,207,201,.58); font-size: 8px; font-weight: 750; letter-spacing: .13em; pointer-events: none; text-shadow: 0 1px 6px #071217; }
.corner-left { left: 16px; }
.corner-right { right: 16px; gap: 6px; }
.corner-line { width: 18px; height: 1px; background: var(--teal-dim); }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; margin-left: 5px; }
.legend-dot.anchored { background: var(--amber); }
.legend-dot.lifted { background: var(--teal); }
.legend-dot.slipping { background: var(--coral); }
.stage-footer { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.playback-controls, .quality-control { display: flex; align-items: center; gap: 7px; }
.play-button { display: inline-flex; align-items: center; gap: 8px; min-width: 94px; justify-content: center; padding: 8px 13px; border-radius: 9px; background: var(--teal); color: #09201f; border-color: var(--teal); font-size: 11px; font-weight: 750; }
.play-button:hover { background: #8df0e1; transform: translateY(-1px); }
.play-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.control-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,.025); color: #b7c7c3; font-size: 10px; }
.step-glyph { font-size: 17px; line-height: 9px; }
.reset-glyph { font-size: 15px; line-height: 10px; }
.quality-control { gap: 4px; }
.quality-control > span { color: var(--muted-2); font-size: 8px; letter-spacing: .13em; font-weight: 750; margin-right: 5px; }
.quality-button { padding: 6px 8px; border-radius: 7px; background: transparent; border-color: transparent; color: #789092; font-size: 9px; }
.quality-button.active { color: var(--teal); background: rgba(113,224,209,.09); border-color: rgba(113,224,209,.16); }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 10px; }
.readout-card { min-width: 0; padding: 11px 12px 10px; border-radius: 13px; box-shadow: none; }
.readout-label { display: flex; justify-content: space-between; gap: 5px; color: #81989a; font-size: 8px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.readout-symbol { color: var(--teal-dim); font-size: 13px; line-height: 8px; }
.readout-value { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; font-size: clamp(20px, 2.2vw, 27px); line-height: 1.1; letter-spacing: -.045em; font-weight: 520; font-variant-numeric: tabular-nums; }
.readout-value small { color: #91a9a6; font-size: 10px; letter-spacing: 0; font-weight: 500; }
.readout-note { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #789092; font-size: 8px; white-space: nowrap; }
.kind { color: #607d7c; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.reserve-track { height: 5px; background: rgba(255,255,255,.07); border-radius: 5px; margin: 14px 0 8px; overflow: hidden; }
.reserve-track span { display: block; height: 100%; width: 88%; background: linear-gradient(90deg, #b68a59, var(--teal)); border-radius: inherit; transition: width .2s ease; }
.caption-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 10px; border-radius: 13px; box-shadow: none; background: rgba(113,224,209,.045); border-color: rgba(113,224,209,.12); }
.caption-icon { flex: 0 0 27px; width: 27px; height: 27px; border: 1px solid rgba(113,224,209,.3); border-radius: 9px; display: grid; place-items: center; }
.caption-icon span { width: 12px; height: 5px; border-top: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: skewX(-30deg); }
.caption-kicker { color: var(--teal-dim); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.caption-card p { margin: 4px 0 0; color: #b2c4bf; font-size: 11px; line-height: 1.45; }
.control-panel { padding: 17px 17px 13px; min-width: 0; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 19px; font-weight: 530; letter-spacing: -.04em; }
.panel-index { color: #607a7e; font-size: 9px; letter-spacing: .12em; padding-bottom: 3px; }
.preset-block { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 8px; text-align: left; border-radius: 10px; background: rgba(255,255,255,.018); border-color: var(--line); }
.preset-button:hover { border-color: rgba(113,224,209,.35); background: rgba(113,224,209,.045); }
.preset-button.selected { background: rgba(113,224,209,.075); border-color: rgba(113,224,209,.35); }
.preset-button strong { display: block; font-size: 10px; font-weight: 650; color: #d9e5df; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #789092; font-size: 8px; white-space: nowrap; }
.preset-icon { position: relative; display: flex; align-items: end; justify-content: center; gap: 2px; flex: 0 0 22px; height: 22px; padding: 3px; border-radius: 6px; background: rgba(113,224,209,.08); }
.preset-icon i { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--teal); }
.firm-icon i:nth-child(1) { height: 7px; }.firm-icon i:nth-child(2) { height: 12px; }.firm-icon i:nth-child(3) { height: 9px; }
.loose-icon { background: rgba(238,128,109,.08); }.loose-icon i { background: var(--coral); }.loose-icon i:nth-child(1) { height: 5px; }.loose-icon i:nth-child(2) { height: 8px; }.loose-icon i:nth-child(3) { height: 4px; }
.preset-check { display: none; margin-left: auto; color: var(--teal); font-size: 11px; }
.preset-button.selected .preset-check { display: block; }
.control-list { padding: 4px 0 0; }
.control-item { padding: 11px 0 10px; border-bottom: 1px solid rgba(190,220,222,.075); }
.control-item.last-control { border-bottom: 0; padding-bottom: 8px; }
.control-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.control-top label { color: #d1dfd9; font-size: 10px; font-weight: 600; }
.control-top output { color: var(--teal); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 16px; margin: 7px 0 1px; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(113,224,209,.72), rgba(113,224,209,.18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(113,224,209,.72), rgba(113,224,209,.18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #d7fff6; border-radius: 50%; background: var(--teal-dim); box-shadow: 0 0 0 3px rgba(113,224,209,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d7fff6; border-radius: 50%; background: var(--teal-dim); box-shadow: 0 0 0 3px rgba(113,224,209,.12); }
.range-ends { display: flex; justify-content: space-between; gap: 6px; color: #60797d; font-size: 8px; font-variant-numeric: tabular-nums; }
.range-ends .kind { margin-left: auto; }
.panel-tip { display: flex; gap: 9px; padding: 11px 10px; margin-top: 6px; border: 1px solid rgba(242,189,120,.15); border-radius: 10px; background: rgba(242,189,120,.045); }
.tip-mark { flex: 0 0 17px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; color: #1c1a14; background: var(--amber); font-size: 10px; font-weight: 900; }
.panel-tip strong { display: block; color: #e7c69e; font-size: 9px; font-weight: 700; }
.panel-tip p { margin: 3px 0 0; color: #9a9b8d; font-size: 8px; line-height: 1.45; }
.panel-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 11px; color: #657e81; font-size: 7px; letter-spacing: .1em; }
.panel-foot b { color: #9bb0ab; font-size: 8px; font-weight: 650; letter-spacing: 0; }
.panel-foot i { font-style: normal; }
.science-panel { margin-top: 16px; overflow: hidden; box-shadow: none; }
.science-panel summary { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 10px 17px; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(113,224,209,.09); color: var(--teal); font-size: 16px; }
.science-panel summary strong { display: block; color: #dce8e2; font-size: 11px; font-weight: 650; }
.science-panel summary small { display: block; margin-top: 3px; color: #7d9595; font-size: 9px; }
.summary-tag { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #728b8c; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.summary-tag span { color: var(--teal); font-size: 14px; }
.science-panel[open] .summary-tag span { transform: rotate(45deg); }
.science-content { padding: 4px 17px 16px; border-top: 1px solid var(--line); }
.science-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 28px; padding: 16px 0; }
.science-kicker { color: var(--teal-dim); font-size: 8px; }
.science-grid h3 { margin: 6px 0 8px; color: #dce8e2; font-size: 13px; font-weight: 620; letter-spacing: -.015em; }
.equation { margin: 6px 0; padding: 8px 10px; border-left: 2px solid rgba(113,224,209,.4); background: rgba(255,255,255,.025); color: #d4e6df; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.science-grid p { margin: 7px 0 0; color: #8da5a2; font-size: 9px; line-height: 1.55; }
.check-values { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 9px; }
.check-values div { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.02); }
.check-values small { display: block; color: #728b8d; font-size: 7px; letter-spacing: .09em; }
.check-values strong { display: block; margin-top: 5px; color: var(--teal); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-note { color: #6f8989 !important; font-size: 8px !important; }
.simplification-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid rgba(242,189,120,.12); border-radius: 9px; background: rgba(242,189,120,.035); }
.note-dot { flex: 0 0 6px; width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--amber); }
.simplification-note p { margin: 0; color: #9ca99e; font-size: 8px; line-height: 1.55; }
.simplification-note b { color: #d5c09f; }
.institution-note { margin-top: 11px; color: #6d8585; font-size: 8px; font-style: italic; }
.footer { display: flex; justify-content: space-between; gap: 15px; padding: 15px 3px 0; color: #536c70; font-size: 8px; letter-spacing: .1em; }
.footer i { color: var(--teal-dim); font-style: normal; padding: 0 4px; }
.footer span:last-child { text-align: right; letter-spacing: .015em; }
.footer b { color: #829b97; font-weight: 600; }
@media (min-width: 1450px) { .app-shell { padding-left: 36px; padding-right: 36px; } .canvas-wrap { height: 530px; } }
@media (max-width: 1100px) { .app-shell { padding: 18px 18px 14px; } .layout { grid-template-columns: minmax(0,1.45fr) minmax(300px,.9fr); gap: 12px; } .control-panel { padding: 14px 13px 12px; } .preset-button { padding: 8px 6px; gap: 6px; } .preset-button strong { font-size: 9px; } .preset-button small { font-size: 7px; } .readout-card { padding: 10px 9px; } .readout-label { font-size: 7px; } }
@media (max-width: 820px) { .app-shell { padding: 14px 14px 12px; } .layout { grid-template-columns: minmax(0,1fr); gap: 12px; } .canvas-wrap { height: clamp(290px, 48vw, 430px); } .control-panel { padding: 15px; } .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; } .control-item:nth-child(odd) { padding-right: 8px; } .control-item:nth-child(even) { padding-left: 8px; } .control-item.last-control { border-bottom: 1px solid rgba(190,220,222,.075); } .panel-tip { margin-top: 12px; } }
@media (max-width: 540px) {
  .app-shell { padding: 10px 10px 12px; }
  .topbar { padding: 0 1px 12px; gap: 8px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 20px; }
  .top-actions { gap: 7px; }
  .model-tag { font-size: 7px; gap: 6px; }
  .icon-button { padding: 8px; }
  .icon-button span { display: none; }
  .layout { gap: 10px; }
  .stage-card { border-radius: 14px; }
  .stage-meta { height: 34px; padding: 0 10px; }
  .view-label { font-size: 8px; }
  .stage-right-meta { font-size: 7px; gap: 6px; }
  .canvas-wrap { height: clamp(255px, 38dvh, 340px); min-height: 245px; }
  .canvas-corner { bottom: 9px; font-size: 6px; gap: 5px; }
  .corner-left { left: 10px; }
  .corner-right { right: 9px; }
  .legend-dot { width: 4px; height: 4px; margin-left: 3px; }
  .stage-footer { padding: 8px 9px; }
  .playback-controls { gap: 5px; }
  .play-button { min-width: 78px; padding: 7px 9px; font-size: 10px; }
  .control-button { padding: 7px 8px; font-size: 9px; }
  .quality-control > span { display: none; }
  .quality-button { padding: 6px; font-size: 8px; }
  .readouts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 7px; }
  .readout-card { padding: 8px 9px; border-radius: 10px; }
  .readout-label { font-size: 7px; }
  .readout-value { margin-top: 3px; font-size: 22px; }
  .readout-note { font-size: 7px; margin-top: 2px; }
  .reserve-track { margin: 9px 0 6px; }
  .caption-card { margin-top: 7px; padding: 9px 10px; gap: 8px; }
  .caption-icon { flex-basis: 24px; width: 24px; height: 24px; }
  .caption-card p { font-size: 9px; line-height: 1.4; }
  .caption-kicker { font-size: 7px; }
  .control-panel { padding: 13px 11px 10px; border-radius: 14px; }
  .panel-heading { padding-bottom: 11px; }
  .panel-heading h2 { font-size: 17px; }
  .preset-block { padding: 11px 0; }
  .preset-buttons { gap: 5px; }
  .preset-button { padding: 8px 6px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .control-list { column-gap: 10px; }
  .control-item { padding: 9px 0 8px; }
  .control-top label, .control-top output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .panel-tip { padding: 9px; }
  .panel-foot { font-size: 6px; }
  .science-panel { margin-top: 10px; }
  .science-panel summary { min-height: 52px; padding: 8px 11px; }
  .science-content { padding: 3px 11px 12px; }
  .science-grid { grid-template-columns: 1fr; gap: 15px; }
  .footer { padding-top: 10px; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
