:root {
  color-scheme: dark;
  --bg: #090f18;
  --surface: #101a27;
  --surface-2: #132131;
  --surface-3: #0c1521;
  --line: rgba(160, 184, 204, 0.13);
  --line-strong: rgba(160, 184, 204, 0.22);
  --text: #edf3f8;
  --muted: #91a3b5;
  --muted-2: #667b8e;
  --accent: #7ce3c5;
  --accent-dim: rgba(124, 227, 197, 0.13);
  --accent-line: rgba(124, 227, 197, 0.4);
  --radius: 16px;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 48% -18%, rgba(47, 83, 102, 0.24), transparent 52%), var(--bg); color: var(--text); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 0 28px 20px; }
body.embed-mode .app-shell { height: 100%; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #304354 transparent; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.identity { display: flex; align-items: center; gap: 12px; }
.mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 11px; color: var(--accent); background: var(--accent-dim); font-family: Georgia, serif; font-size: 27px; line-height: 1; }
.identity-copy { display: grid; gap: 3px; }
.overline, .eyebrow, .readout-label, .panel-heading h2, .controls-header h2, .response-heading h2, .page-footer, .preset-label, .plot-corner-label, .plot-scale-label, .science-toggle-right { font-size: 9px; letter-spacing: 0.15em; font-weight: 750; }
.overline { color: var(--muted-2); }
.identity-name { font-size: 13px; font-weight: 650; color: #d9e5ee; }
.series-index { color: var(--muted-2); font-size: 10px; margin-left: 5px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #c4d3df; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(124,227,197,.6); }
.top-chip, .micro-tag, .unit-pill { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; font-size: 8px; letter-spacing: .1em; font-weight: 700; white-space: nowrap; }
main { padding-top: 22px; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); }
.eyebrow span { color: var(--muted-2); padding: 0 4px; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.045em; font-weight: 670; }
.dek { margin: 8px 0 0; color: #a5b5c4; font-size: 14px; letter-spacing: -.01em; }
.intro-note { width: min(340px, 33%); display: flex; gap: 12px; align-items: flex-start; padding: 0 4px 4px 0; }
.note-rule { width: 2px; height: 34px; flex: 0 0 2px; background: var(--accent); border-radius: 2px; opacity: .8; }
.intro-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.panel, .plot-card { background: linear-gradient(145deg, rgba(19, 33, 48, .94), rgba(13, 23, 35, .98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.plot-card { min-width: 0; overflow: hidden; }
.panel-heading { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.heading-stack { display: grid; gap: 5px; }
.panel-heading h2, .controls-header h2, .response-heading h2 { margin: 0; color: #dbe6ee; }
.panel-subtitle { font-size: 10px; color: var(--muted); letter-spacing: .015em; }
.panel-subtitle .micro-tag { margin-left: 7px; vertical-align: 1px; padding: 3px 6px; font-size: 7px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.quiet-button, .preset-button, .transport-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.018); color: #c3d1dc; border-radius: 8px; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease; }
.quiet-button { padding: 8px 10px; font-size: 8px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.quiet-button:hover, .preset-button:hover, .transport-button:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-dim); }
.button-icon { color: var(--accent); font-size: 12px; margin-right: 5px; }
.plot-wrap { position: relative; height: 410px; padding: 0; background: radial-gradient(ellipse at 48% 55%, rgba(27, 55, 70, .25), transparent 66%), #0d1723; }
#plotCanvas, #responseCanvas { display: block; width: 100%; height: 100%; }
.plot-corner-label, .plot-scale-label { position: absolute; pointer-events: none; color: #91a7b8; font-size: 8px; letter-spacing: .11em; }
.plot-corner-label { top: 16px; right: 18px; }
.plot-corner-label span { color: var(--accent); padding: 0 4px; }
.plot-scale-label { left: 18px; bottom: 12px; color: #6e8496; }
.plot-scale-label .micro-tag { padding: 2px 5px; font-size: 7px; margin-left: 4px; }
.plot-footer { height: 38px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--accent); font-size: 9px; letter-spacing: .02em; }
.plot-footer .muted { color: var(--muted-2); }
.legend-line, .legend-dash { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--accent); border-radius: 2px; }
.legend-dash { height: 0; border-top: 1px dashed #d0e4e1; background: transparent; }
.inspector { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout-card { min-height: 85px; padding: 12px 13px 10px; border-radius: 12px; background: linear-gradient(145deg, rgba(22, 38, 54, .95), rgba(15, 27, 40, .95)); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; }
.readout-primary { border-color: rgba(124, 227, 197, .26); background: linear-gradient(145deg, rgba(25, 56, 59, .42), rgba(15, 27, 40, .95)); }
.readout-label { color: var(--muted-2); font-size: 8px; letter-spacing: .12em; }
.readout-card strong { color: #eff8f6; font-size: clamp(17px, 1.6vw, 22px); line-height: 1; font-weight: 620; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-primary strong { color: var(--accent); }
.readout-note { color: #b4c4d0; font-size: 9px; }
.readout-note span { color: var(--muted-2); }
.check-card { min-height: 80px; display: block; padding: 9px 13px 8px; background: rgba(124, 227, 197, .055); border: 1px solid rgba(124, 227, 197, .17); border-radius: 12px; }
.check-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check-values { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; margin-top: 6px; border-top: 1px solid rgba(124, 227, 197, .11); color: var(--muted-2); font-size: 8px; }
.check-values b { margin-left: 4px; color: #c9e7df; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.check-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-dim); font-size: 13px; }
.check-heading div { display: grid; gap: 4px; }
.check-heading strong { font-size: 9px; letter-spacing: .08em; color: #c9e7df; white-space: nowrap; }
.check-result { display: grid; gap: 3px; text-align: right; }
.check-result strong { color: var(--accent); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-result span { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.check-result .micro-tag { margin-left: 3px; font-size: 6px; padding: 2px 4px; }
.response-card { padding: 12px 13px 11px; flex: 1; min-height: 0; }
.response-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.response-heading h2 { font-size: 9px; letter-spacing: .14em; margin-bottom: 5px; }
.response-heading .panel-subtitle { font-size: 9px; }
.unit-pill { font-size: 7px; padding: 4px 6px; }
.response-chart-wrap { height: 118px; margin-top: 4px; }
.state-caption { margin: 3px 0 0; color: #9eb0bf; font-size: 9px; line-height: 1.45; min-height: 27px; }
.controls-card { margin-top: 14px; padding: 15px 18px 12px; }
.controls-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.controls-header h2 { font-size: 9px; letter-spacing: .15em; }
.preset-group { display: flex; align-items: center; gap: 7px; }
.preset-label { color: var(--muted-2); margin-right: 3px; font-size: 8px; }
.preset-button { padding: 6px 9px; font-size: 8px; letter-spacing: .08em; font-weight: 750; }
.control-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 15px 0 12px; }
.control-block { min-width: 0; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.control-label-row label { color: #cbd8e2; font-size: 10px; font-weight: 620; white-space: nowrap; }
.math-label { color: var(--accent); font-family: Georgia, serif; font-style: italic; font-size: 12px; }
.control-label-row output { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 16px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(124,227,197,.62), rgba(124,227,197,.2)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(124,227,197,.62), rgba(124,227,197,.2)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; border: 2px solid #0d1723; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(124,227,197,.7), 0 0 12px rgba(124,227,197,.22); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0d1723; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(124,227,197,.7); }
.range-ends { display: flex; justify-content: space-between; margin-top: 2px; color: var(--muted-2); font-size: 8px; font-variant-numeric: tabular-nums; }
.range-ends i { color: #63798b; font-style: normal; }
.transport-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.transport-buttons { display: flex; gap: 7px; align-items: center; }
.primary-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(124,227,197,.55); border-radius: 8px; color: #071712; background: var(--accent); font-size: 8px; letter-spacing: .1em; font-weight: 850; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.transport-button { padding: 8px 11px; font-size: 8px; letter-spacing: .08em; font-weight: 750; }
.transport-button span { color: var(--accent); margin-left: 4px; font-size: 11px; }
.transport-hint { color: var(--muted-2); font-size: 9px; text-align: right; }
.science-panel { margin-top: 12px; overflow: hidden; }
.science-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border: 0; background: transparent; cursor: pointer; color: #d7e3ec; text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.science-toggle > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.science-symbol { color: var(--accent); font-family: Georgia, serif; font-size: 17px; }
.science-toggle-right { color: var(--muted-2); display: inline-flex; gap: 12px; align-items: center; font-size: 8px; }
.science-toggle-right b { color: var(--accent); font-size: 15px; font-weight: 500; }
.science-content { border-top: 1px solid var(--line); padding: 17px; }
.science-columns { display: grid; grid-template-columns: 1.15fr 1.15fr .9fr; gap: 22px; }
.science-columns h3 { margin: 0 0 8px; color: #d8e4ed; font-size: 10px; }
.science-columns p { margin: 0 0 8px; color: #91a4b5; font-size: 10px; line-height: 1.6; }
.equation { color: #d7eee7; font-family: Georgia, serif; font-style: italic; }
.equation-block { color: var(--accent); font-family: Georgia, serif; font-size: 15px; line-height: 1.6; padding: 8px 10px; margin: 7px 0 10px; background: rgba(124,227,197,.055); border-left: 2px solid var(--accent-line); }
.science-caveat { padding-left: 17px; border-left: 1px solid var(--line-strong); }
.science-columns .disclaimer { margin-top: 10px; color: #b8c9d4; font-style: italic; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 14px 2px 0; color: #536779; font-size: 7px; letter-spacing: .15em; }

@media (min-width: 1450px) {
  .plot-wrap { height: 450px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 360px; }
  .response-chart-wrap { height: 140px; }
}
@media (max-width: 1050px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; }
  .plot-wrap { height: 390px; }
  .control-grid { gap: 14px; }
  .readout-card { padding: 10px; }
}
@media (max-width: 780px) {
  .app-shell { padding: 0 14px 18px; }
  .topbar { height: 62px; }
  .topbar-right { gap: 0; }
  .top-chip { display: none; }
  main { padding-top: 18px; }
  .intro-row { align-items: flex-start; margin-bottom: 16px; }
  h1 { font-size: clamp(25px, 7vw, 34px); }
  .dek { font-size: 12px; }
  .intro-note { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .plot-wrap { height: clamp(315px, 43vh, 410px); }
  .inspector { display: grid; grid-template-columns: minmax(0, 1fr); }
  .readout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .readout-card { min-height: 83px; padding: 10px 8px; }
  .readout-label { font-size: 7px; letter-spacing: .08em; }
  .readout-card strong { font-size: clamp(13px, 3.3vw, 18px); }
  .readout-note { font-size: 8px; }
  .check-card { min-height: 58px; }
  .response-card { min-height: 205px; }
  .response-chart-wrap { height: 126px; }
  .controls-card { padding: 13px 13px 11px; }
  .controls-header { align-items: flex-start; flex-direction: column; gap: 11px; }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 17px; column-gap: 18px; }
  .transport-row { align-items: flex-start; flex-direction: column; }
  .transport-hint { text-align: left; }
  .science-columns { grid-template-columns: 1fr; gap: 14px; }
  .science-caveat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
@media (max-width: 420px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .topbar { height: 56px; }
  .mark { width: 32px; height: 32px; }
  .identity-name { font-size: 12px; }
  .live-indicator { font-size: 8px; }
  .intro-row { margin-bottom: 12px; }
  .eyebrow { font-size: 8px; }
  .plot-wrap { height: 340px; }
  .panel-heading { height: 56px; padding: 0 11px; }
  .panel-actions { gap: 5px; }
  .quiet-button { padding: 7px 8px; font-size: 7px; }
  .plot-corner-label { top: 11px; right: 10px; font-size: 7px; }
  .plot-scale-label { left: 10px; top: 11px; bottom: auto; max-width: 46%; font-size: 7px; line-height: 1.35; }
  .plot-scale-label .micro-tag { display: none; }
  .plot-footer { height: auto; min-height: 48px; flex-wrap: wrap; justify-content: flex-start; gap: 5px 12px; padding: 8px 10px; }
  .plot-footer { padding: 0 10px; font-size: 8px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout-card { min-height: 78px; padding: 10px 11px; }
  .readout-label { font-size: 8px; }
  .readout-card strong { font-size: 19px; }
  .readout-note { font-size: 8px; }
  .check-heading strong { font-size: 8px; }
  .preset-group { flex-wrap: wrap; }
  .preset-button { padding: 6px 8px; }
  .control-grid { column-gap: 13px; }
  .control-label-row label { font-size: 9px; }
  .control-label-row output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .page-footer { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
