:root {
  color-scheme: dark;
  --bg: #090d15;
  --panel: #101722;
  --panel-2: #131e2b;
  --line: #263443;
  --line-soft: rgba(128, 157, 179, .14);
  --text: #e8f0f5;
  --muted: #91a3b2;
  --quiet: #647889;
  --accent: #5fe3d0;
  --accent-dim: rgba(95, 227, 208, .12);
  --accent-line: rgba(95, 227, 208, .36);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0; background: radial-gradient(ellipse at 18% -20%, rgba(39, 76, 91, .19), transparent 45%), var(--bg); }
.topbar { height: 68px; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); background: rgba(9, 13, 21, .96); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(95, 227, 208, .28); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 2px; background: rgba(95, 227, 208, .07); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--accent); transform: skew(-18deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .8; }
.brand-copy { min-width: 0; }
.eyebrow { font-size: 9px; line-height: 1.2; letter-spacing: .18em; font-weight: 750; color: #8da5b3; }
.eyebrow-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin: 0 5px 1px; }
h1 { margin: 4px 0 0; font-size: 17px; line-height: 1.15; letter-spacing: -.025em; font-weight: 660; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.icon-button, .quality-button, .export-button { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #111a26; color: #b9c9d3; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.icon-button { width: 34px; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.quality-button { min-width: 48px; padding: 0 9px; color: var(--accent); font-size: 9px; letter-spacing: .1em; font-weight: 800; }
.export-button { padding: 0 11px; font-size: 10px; font-weight: 750; letter-spacing: .08em; color: var(--text); }
.export-button span { color: var(--accent); font-size: 15px; margin-right: 4px; }
.icon-button:hover, .quality-button:hover, .export-button:hover { border-color: var(--accent-line); background: #172632; color: var(--accent); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 350px; flex: 1; min-height: 0; }
.stage-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 16px 12px 18px; gap: 10px; }
.stage-frame { position: relative; flex: 1; min-height: 0; overflow: hidden; border: 1px solid rgba(104, 135, 155, .18); border-radius: 13px; background: linear-gradient(145deg, #0c1420, #0a1019 70%); box-shadow: 0 18px 55px rgba(0, 0, 0, .22), inset 0 1px rgba(255,255,255,.025); }
#labCanvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; top: 13px; right: 15px; display: flex; align-items: center; gap: 7px; color: #6f8796; font-size: 8px; font-weight: 800; letter-spacing: .15em; pointer-events: none; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(95,227,208,.55); display: inline-block; flex-shrink: 0; }
.caption-bar { min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(16, 23, 34, .72); }
.caption-icon { width: 27px; height: 27px; display: grid; place-items: center; flex-shrink: 0; border-radius: 8px; color: var(--accent); background: var(--accent-dim); font-size: 16px; }
.caption-kicker { color: #79909e; font-size: 8px; letter-spacing: .16em; font-weight: 800; margin-bottom: 3px; }
.caption-bar p { margin: 0; color: #bdcbd4; font-size: 11px; line-height: 1.4; }
.science-panel { flex: 0 0 auto; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(16, 23, 34, .66); overflow: hidden; }
.science-panel summary { list-style: none; cursor: pointer; padding: 10px 13px; color: #c5d2da; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 16px; font-weight: 400; }
.science-panel[open] summary::after { content: "−"; }
.science-symbol { color: var(--accent); font-size: 15px; }
.summary-hint { color: #718696; font-size: 9px; font-weight: 500; margin-left: 2px; }
.science-content { padding: 0 13px 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.equation-card { min-width: 0; padding: 10px; border: 1px solid rgba(128,157,179,.12); border-radius: 8px; background: rgba(7, 13, 21, .45); }
.equation-label { color: #7d95a4; font-size: 8px; letter-spacing: .12em; font-weight: 800; margin-bottom: 8px; }
.equation { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: normal; }
.equation-card p, .model-note, .affiliation-note { color: #95a8b5; font-size: 9px; line-height: 1.55; margin: 7px 0 0; }
.model-note, .affiliation-note { grid-column: 1 / -1; margin: 1px 2px 0; }
.affiliation-note { color: #6f8796; margin-top: -4px; }
.control-panel { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 17px 16px; border-left: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(17,25,37,.98), rgba(12,19,29,.98)); scrollbar-width: thin; scrollbar-color: #344554 transparent; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.status-pill { display: flex; align-items: center; gap: 6px; color: #89a39f; font-size: 8px; letter-spacing: .1em; font-weight: 800; border: 1px solid rgba(95,227,208,.18); background: rgba(95,227,208,.06); padding: 6px 8px; border-radius: 99px; }
.status-pill .live-dot { width: 5px; height: 5px; }
.section-label { display: flex; align-items: center; justify-content: space-between; color: #8095a4; font-size: 8px; letter-spacing: .15em; font-weight: 850; margin-bottom: 9px; }
.preset-block { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: 9px 8px; min-height: 55px; border: 1px solid var(--line); border-radius: 9px; background: #111b28; cursor: pointer; transition: .16s ease; }
.preset-button:hover { border-color: #49606d; background: #15232e; }
.preset-button.active { border-color: rgba(95,227,208,.48); background: linear-gradient(120deg, rgba(95,227,208,.12), rgba(17,27,40,.9)); box-shadow: inset 0 0 0 1px rgba(95,227,208,.06); }
.preset-glyph { width: 25px; height: 25px; display: grid; place-items: center; flex-shrink: 0; border-radius: 7px; color: var(--accent); background: rgba(95,227,208,.09); font-size: 16px; }
.preset-button b { display: block; font-size: 9px; line-height: 1.25; font-weight: 700; color: #dce7ec; }
.preset-button small { display: block; margin-top: 4px; color: #8295a2; font-size: 8px; line-height: 1.2; }
.control-group { padding: 0 1px 13px; margin-bottom: 12px; border-bottom: 1px solid rgba(128,157,179,.1); }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.control-head label, .control-label { color: #c8d5dc; font-size: 10px; font-weight: 650; }
.unit { color: #7d96a5; font-size: 9px; margin-left: 3px; font-weight: 500; }
.control-head output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 16px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0%, rgba(95,227,208,.38) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(95,227,208,.38); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #dffcf7; border: 3px solid #42bfae; margin-top: -5px; box-shadow: 0 0 0 3px rgba(95,227,208,.1), 0 0 9px rgba(95,227,208,.2); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #dffcf7; border: 3px solid #42bfae; box-shadow: 0 0 0 3px rgba(95,227,208,.1); }
.range-ends { display: flex; justify-content: space-between; margin-top: 3px; color: #637988; font-size: 8px; font-variant-numeric: tabular-nums; }
.taper-group { padding-bottom: 14px; margin-bottom: 14px; }
.micro-note { color: #6d8391; font-size: 8px; letter-spacing: .12em; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 8px; background: #0b121c; border: 1px solid var(--line-soft); }
.segment { border: 1px solid transparent; border-radius: 6px; padding: 7px 4px; color: #8da0ad; background: transparent; font-size: 9px; cursor: pointer; }
.segment.active { color: var(--accent); border-color: rgba(95,227,208,.22); background: rgba(95,227,208,.1); font-weight: 700; }
.control-hint { margin: 7px 0 0; color: #718695; font-size: 8px; line-height: 1.4; }
.readout-section { margin-top: 2px; }
.textbook-tag { font-size: 7px; letter-spacing: .12em; color: #5e7d83; border: 1px solid rgba(95,227,208,.16); padding: 3px 5px; border-radius: 4px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 9px 9px 8px; border: 1px solid rgba(128,157,179,.13); border-radius: 8px; background: rgba(8,14,22,.52); }
.readout-card > span { display: block; color: #8296a3; font-size: 8px; margin-bottom: 5px; }
.readout-card strong { display: block; color: #e6f1f4; font-size: 17px; font-weight: 680; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card strong i { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 600; letter-spacing: 0; }
.readout-card small { display: block; margin-top: 5px; color: #617887; font-size: 7px; line-height: 1.2; }
.check-card { margin-top: 9px; padding: 10px; border: 1px solid rgba(95,227,208,.2); border-radius: 9px; background: linear-gradient(120deg, rgba(95,227,208,.07), rgba(8,14,22,.6)); }
.check-head { display: flex; align-items: center; gap: 6px; color: #8da9a8; font-size: 8px; letter-spacing: .12em; font-weight: 850; }
.check-mark { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; color: #091711; background: var(--accent); font-size: 9px; font-weight: 900; }
.check-method { margin-left: auto; color: #6d858d; font-size: 7px; letter-spacing: .02em; font-weight: 550; }
.check-values { display: grid; grid-template-columns: 1fr 20px 1fr; align-items: center; margin-top: 10px; }
.check-values small { display: block; color: #748b98; font-size: 7px; margin-bottom: 4px; }
.check-values strong { color: #e0efee; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.check-vs { color: #627984; font-size: 8px; text-align: center; }
.check-footer { display: flex; justify-content: space-between; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(95,227,208,.12); color: #7d929d; font-size: 8px; }
.check-footer strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.footer-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 12px; color: #687e8c; font-size: 8px; line-height: 1.5; }
.info-dot { width: 12px; height: 12px; display: inline-grid; place-items: center; flex-shrink: 0; border: 1px solid #506573; border-radius: 50%; font-size: 8px; font-weight: 800; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .stage-column { padding-left: 12px; padding-right: 12px; }
  .control-panel { padding-left: 13px; padding-right: 13px; }
}
@media (max-width: 720px) {
  html, body { overflow: hidden; }
  .topbar { height: 56px; min-height: 56px; padding: 0 10px; gap: 8px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 8px; }
  .brand-copy .eyebrow { display: none; }
  h1 { font-size: 12px; margin-top: 0; }
  .top-actions { gap: 4px; }
  .icon-button { width: 29px; height: 29px; border-radius: 7px; font-size: 16px; }
  .quality-button { height: 29px; min-width: 39px; padding: 0 6px; font-size: 8px; }
  .export-button { height: 29px; padding: 0 7px; font-size: 8px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(265px, 47%) minmax(0,1fr); }
  .stage-column { padding: 8px 8px 6px; gap: 6px; }
  .stage-frame { border-radius: 10px; }
  .caption-bar { min-height: 43px; padding: 5px 9px; gap: 8px; }
  .caption-icon { width: 23px; height: 23px; }
  .caption-kicker { font-size: 7px; }
  .caption-bar p { font-size: 9px; line-height: 1.3; }
  .science-panel summary { padding: 8px 10px; font-size: 10px; }
  .summary-hint { font-size: 8px; }
  .science-content { grid-template-columns: 1fr; gap: 6px; padding: 0 9px 10px; }
  .equation-card { padding: 8px; }
  .equation { font-size: 10px; }
  .equation-card p, .model-note, .affiliation-note { font-size: 8px; }
  .control-panel { border-left: 0; border-top: 1px solid var(--line-soft); padding: 13px 13px 18px; }
  .panel-heading { margin-bottom: 12px; }
  .panel-heading h2 { font-size: 15px; }
  .preset-block { padding-bottom: 11px; margin-bottom: 12px; }
  .preset-button { min-height: 49px; padding: 7px; }
  .control-group { padding-bottom: 10px; margin-bottom: 10px; }
  .readout-card { padding: 8px; }
  .readout-card strong { font-size: 16px; }
}
@media (max-width: 380px) {
  .brand-lockup { gap: 7px; }
  .brand-mark { display: none; }
  h1 { font-size: 12px; }
  .topbar { padding: 0 8px; }
  .icon-button { width: 27px; }
  .export-button { padding: 0 5px; }
  .preset-button b { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
