:root {
  color-scheme: dark;
  --bg: #080d14;
  --panel: #0e1621;
  --panel-2: #111c29;
  --panel-3: #0b121c;
  --line: rgba(165, 190, 214, .13);
  --line-strong: rgba(165, 190, 214, .22);
  --text: #e8f0f7;
  --muted: #91a3b5;
  --dim: #5c7084;
  --accent: #63d7ed;
  --accent-soft: rgba(99, 215, 237, .13);
  --accent-glow: rgba(99, 215, 237, .24);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 16% -10%, rgba(38, 87, 110, .16), transparent 38%), var(--bg); }
.topbar { height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 20, .92); }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(99, 215, 237, .38); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: rgba(99, 215, 237, .06); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .72; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { color: var(--dim); font-size: 9px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.035em; font-weight: 670; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 9px; color: #8ea2b5; font-size: 9px; letter-spacing: .12em; font-weight: 750; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.meta-divider { height: 14px; width: 1px; background: var(--line-strong); margin: 0 3px; }
.tag { border: 1px solid rgba(99, 215, 237, .22); color: var(--accent); border-radius: 20px; padding: 5px 8px; font-size: 8px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(360px, .92fr); gap: 16px; padding: 16px 18px 18px; min-height: calc(100vh - 76px); }
.visual-panel, .control-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18, 29, 42, .96), rgba(10, 17, 26, .98)); box-shadow: 0 14px 44px rgba(0, 0, 0, .18); }
.visual-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.visual-head { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.visual-title { font-size: 14px; font-weight: 650; letter-spacing: -.015em; margin-top: 4px; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent-glow); margin-left: 3px; }
.legend-line { width: 17px; height: 2px; background: var(--accent); opacity: .7; margin-left: 6px; }
.canvas-stage { position: relative; min-height: 0; flex: 1 1 auto; overflow: hidden; background: radial-gradient(ellipse at 30% 52%, rgba(24, 65, 82, .16), transparent 52%), #0a121c; }
#scene { display: block; width: 100%; height: 100%; outline: none; }
.canvas-corner { position: absolute; top: 13px; color: #61768b; font-size: 8px; font-weight: 800; letter-spacing: .14em; pointer-events: none; }
.canvas-corner.tl { left: 16px; }
.canvas-corner.tl span { color: var(--accent); padding: 0 4px; }
.canvas-corner.tr { right: 16px; color: var(--accent); }
.caption-strip { min-height: 72px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: rgba(9, 15, 23, .8); }
.caption-symbol { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(99, 215, 237, .24); color: var(--accent); border-radius: 9px; font-size: 17px; background: var(--accent-soft); }
.caption-copy p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; color: #b8c7d4; }
.control-panel { min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #314355 transparent; }
.control-panel > * { flex: 0 0 auto; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout-card { min-width: 0; padding: 11px 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 11, 18, .38); }
.primary-readout { background: linear-gradient(135deg, rgba(29, 72, 88, .22), rgba(7, 14, 22, .55)); border-color: rgba(99, 215, 237, .22); }
.readout-label { color: #8196a9; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.readout-label span { color: var(--accent); font-size: 10px; margin-left: 3px; }
.readout-value { font-variant-numeric: tabular-nums; font-size: 22px; line-height: 1.2; letter-spacing: -.045em; margin-top: 7px; font-weight: 650; color: #edf7fc; }
.primary-readout .readout-value { color: var(--accent); }
.lock-value { font-size: 15px; letter-spacing: -.02em; padding-top: 4px; }
.readout-unit { color: #71869a; font-size: 8px; margin-top: 4px; white-space: nowrap; }
.readout-unit b { color: #53697d; font-size: 7px; font-weight: 800; letter-spacing: .04em; }
.controls-section { border: 1px solid var(--line); border-radius: 13px; background: rgba(6, 12, 19, .35); padding: 13px 13px 12px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2 { margin: 3px 0 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.unit-note { font-size: 7px; letter-spacing: .1em; color: #61778a; font-weight: 800; }
.control-row { margin-bottom: 12px; }
.control-label-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.control-label-line label { color: #cbd7e2; font-size: 10px; font-weight: 600; }
.control-label-line label i { color: var(--accent); font-family: Georgia, serif; font-size: 13px; margin-left: 2px; }
.unit-inline { color: #667c90; font-size: 7px; font-weight: 500; letter-spacing: 0; margin-left: 3px; white-space: nowrap; }
.control-label-line output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(99, 215, 237, .65), rgba(99, 215, 237, .18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(99, 215, 237, .65), rgba(99, 215, 237, .18)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; background: #d8faff; border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(99, 215, 237, .1), 0 0 12px rgba(99, 215, 237, .3); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d8faff; border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(99, 215, 237, .1), 0 0 12px rgba(99, 215, 237, .3); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.range-ends { display: flex; justify-content: space-between; color: #5f7487; font-size: 7px; margin-top: 2px; }
.compact-control { margin-bottom: 14px; }
.preset-block { padding-top: 10px; border-top: 1px solid var(--line); }
.preset-heading { color: #8297aa; font-size: 8px; font-weight: 800; letter-spacing: .12em; margin-bottom: 8px; }
.preset-heading span { color: #53697c; font-size: 7px; }
.preset-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 7px; text-align: left; min-width: 0; padding: 8px 7px; border: 1px solid var(--line); border-radius: 9px; background: #0c1520; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: rgba(99, 215, 237, .35); transform: translateY(-1px); }
.preset-button.selected { border-color: rgba(99, 215, 237, .44); background: rgba(43, 104, 122, .17); }
.preset-glyph { flex: 0 0 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; font-size: 13px; color: var(--accent); background: rgba(99, 215, 237, .1); }
.drift-glyph { font-size: 17px; }
.preset-button b, .preset-button small { display: block; white-space: nowrap; }
.preset-button b { font-size: 8px; font-weight: 700; color: #d7e4ed; }
.preset-button small { font-size: 7px; color: #70869a; margin-top: 2px; }
.action-row { display: grid; grid-template-columns: 1.1fr .85fr .85fr 1.2fr; gap: 6px; margin-top: 12px; }
.action-button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 33px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(19, 31, 44, .82); color: #c5d3df; cursor: pointer; font-size: 12px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.action-button span { font-size: 8px; font-weight: 650; }
.action-button:hover { border-color: rgba(99, 215, 237, .42); background: rgba(33, 57, 73, .8); }
.action-button:active { transform: translateY(1px); }
.primary-action { border-color: rgba(99, 215, 237, .42); background: rgba(54, 130, 149, .19); color: var(--accent); }
.screenshot-button { font-size: 11px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-row { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #71869a; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #080f17; gap: 2px; }
.segmented button { border: 0; background: transparent; border-radius: 5px; padding: 4px 8px; color: #7c90a3; font-size: 8px; cursor: pointer; }
.segmented button.active { background: rgba(99, 215, 237, .15); color: var(--accent); }
.keyboard-hint { margin-left: auto; color: #53697c; font-size: 7px; letter-spacing: .01em; font-weight: 600; white-space: nowrap; }
.keyboard-hint b { color: var(--accent); padding: 0 2px; }
.check-card { border: 1px solid rgba(99, 215, 237, .2); border-radius: 12px; padding: 11px 12px 10px; background: linear-gradient(130deg, rgba(27, 74, 88, .17), rgba(6, 13, 21, .6)); }
.check-head { display: flex; align-items: center; gap: 8px; }
.check-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: rgba(99, 215, 237, .13); font-size: 13px; }
.check-head h3 { margin: 3px 0 0; font-size: 10px; font-weight: 650; }
.check-badge { margin-left: auto; border: 1px solid rgba(99, 215, 237, .2); border-radius: 20px; padding: 4px 7px; color: var(--accent); font-size: 8px; }
.check-equation { color: #a7b8c6; font-size: 9px; margin: 10px 0 9px; }
.check-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.check-values div { border: 1px solid var(--line); background: rgba(4, 9, 15, .3); border-radius: 7px; padding: 7px 8px; min-width: 0; }
.check-values small, .check-values b { display: block; }
.check-values small { color: #657c90; font-size: 7px; letter-spacing: .08em; font-weight: 800; }
.check-values b { margin-top: 4px; font-size: 10px; color: #dbeaf2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-values div:last-child b { color: var(--accent); }
.check-foot { margin-top: 8px; color: #667d91; font-size: 8px; line-height: 1.4; }
.science-panel { border: 1px solid var(--line); border-radius: 12px; background: rgba(6, 12, 19, .35); overflow: hidden; }
.science-panel summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 11px 12px; color: #d5e0e8; font-size: 10px; font-weight: 650; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 13px; }
.summary-note { margin-left: auto; color: #5e7488; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.science-content { padding: 0 13px 13px; border-top: 1px solid var(--line); }
.science-content h4 { margin: 12px 0 7px; color: #a9bdcc; font-size: 9px; letter-spacing: .04em; }
.science-content p, .science-content li { color: #8095a8; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 7px 0; }
.science-content ul { padding-left: 16px; margin: 6px 0 9px; }
.science-content li { margin: 3px 0; }
.equation { padding: 10px 9px; border-radius: 8px; background: rgba(3, 9, 15, .58); border: 1px solid var(--line); color: #d7edf4; font-family: Georgia, "Times New Roman", serif; text-align: center; font-size: 15px; }
.secondary-equation { font-size: 13px; }
.frac { display: inline-flex; vertical-align: middle; flex-direction: column; text-align: center; font-size: .85em; line-height: 1.05; }
.frac span:first-child { border-bottom: 1px solid currentColor; padding: 0 3px 2px; }
.frac span:last-child { padding-top: 2px; }
.disclaimer { border-top: 1px solid var(--line); padding-top: 9px; color: #61788b !important; font-style: italic; }
@media (min-width: 1500px) {
  .workspace { max-width: 1780px; margin: 0 auto; }
  .control-panel { padding: 18px; gap: 14px; }
  .readout-value { font-size: 25px; }
}
@media (max-width: 980px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .95fr); padding: 12px; gap: 12px; }
  .control-panel { padding: 10px; }
  .visual-head { padding: 0 14px; }
  .legend { font-size: 8px; }
  .keyboard-hint { display: none; }
}
@media (max-width: 700px) {
  html, body { min-height: 100%; }
  .app-shell { min-height: 100dvh; }
  .topbar { height: 58px; padding: 0 12px; gap: 9px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  h1 { font-size: 17px; }
  .eyebrow { font-size: 8px; }
  .top-meta { gap: 6px; font-size: 7px; }
  .top-meta .meta-divider, .top-meta .tag { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 9px; padding: 9px; min-height: calc(100dvh - 58px); }
  .visual-panel { min-height: 390px; height: 49dvh; flex: 0 0 49dvh; border-radius: 13px; }
  .visual-head { height: 43px; flex-basis: 43px; padding: 0 12px; }
  .visual-title { font-size: 12px; }
  .legend { font-size: 7px; gap: 5px; }
  .legend-line { width: 12px; margin-left: 2px; }
  .canvas-corner { top: 8px; font-size: 7px; }
  .canvas-corner.tl { left: 10px; }
  .canvas-corner.tr { right: 10px; }
  .caption-strip { min-height: 57px; padding: 8px 11px; gap: 9px; }
  .caption-symbol { width: 24px; height: 24px; flex-basis: 24px; font-size: 14px; }
  .caption-copy p { font-size: 9px; line-height: 1.35; margin-top: 3px; }
  .control-panel { flex: 1 1 auto; min-height: 0; padding: 10px; border-radius: 13px; gap: 9px; overflow-y: auto; overscroll-behavior: contain; }
  .readout-grid { gap: 6px; }
  .readout-card { padding: 8px 9px 7px; border-radius: 9px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 19px; margin-top: 4px; }
  .lock-value { font-size: 13px; }
  .readout-unit { font-size: 7px; margin-top: 2px; }
  .readout-unit b { font-size: 6px; }
  .controls-section { padding: 10px; }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { font-size: 13px; }
  .control-row { margin-bottom: 10px; }
  .control-label-line label { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .preset-button { padding: 7px 5px; gap: 5px; }
  .preset-glyph { flex-basis: 20px; height: 20px; }
  .preset-button b { font-size: 7px; }
  .preset-button small { font-size: 6px; }
  .action-row { margin-top: 10px; }
  .action-button { min-height: 31px; }
  .action-button span { font-size: 7px; }
  .quality-row { flex-wrap: wrap; }
  .keyboard-hint { display: none; }
  .check-card { padding: 9px; }
  .science-panel summary { padding: 9px; }
}
@media (max-width: 380px) {
  .visual-panel { height: 47dvh; flex-basis: 47dvh; }
  .legend { display: none; }
  .preset-button { gap: 4px; }
  .preset-button b { font-size: 6.5px; }
  .preset-button small { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .workspace { height: calc(100dvh - 76px); min-height: 0; }
@media (max-width: 700px) {
  body.embed-mode .workspace { height: calc(100dvh - 58px); min-height: 0; }
  body.embed-mode .visual-panel { min-height: 0; }
}
