:root {
  color-scheme: dark;
  --bg: #080d16;
  --panel: #101927;
  --panel-2: #0c1421;
  --line: #243247;
  --line-soft: rgba(128, 153, 184, .15);
  --text: #edf4fb;
  --muted: #8c9cb1;
  --muted-2: #61738b;
  --accent: #59dfd0;
  --accent-soft: rgba(89, 223, 208, .12);
  --accent-glow: rgba(89, 223, 208, .22);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 24px; background: radial-gradient(ellipse at 22% -10%, rgba(37, 88, 107, .18), transparent 40%), var(--bg); }
.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { flex: 0 0 auto; min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.eyebrow, .section-heading, .caption-label, .canvas-topline, .bottom-meta, .footer, .readout-name, .readout-kind, .quality-label { letter-spacing: .12em; font-size: 9px; font-weight: 750; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent); margin-bottom: 5px; }
.eyebrow-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
h1 { font-size: clamp(19px, 2vw, 25px); line-height: 1.15; margin: 0; font-weight: 680; letter-spacing: -.035em; }
.subtitle { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.transport { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-button { min-height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #111c2b; color: #cbd7e5; font-size: 11px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.icon-button:hover { border-color: #456075; background: #172638; transform: translateY(-1px); }
.icon-button.primary { background: var(--accent-soft); border-color: rgba(89,223,208,.38); color: var(--accent); }
.button-icon { display: inline-block; width: 13px; margin-right: 4px; font-size: 12px; }
.icon-button.screenshot { border-color: transparent; background: transparent; color: var(--muted); }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; padding: 18px 0 12px; }
.visual-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.canvas-frame { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: linear-gradient(145deg, rgba(20, 34, 50, .72), rgba(9, 17, 29, .96)); box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.canvas-topline { height: 34px; flex: 0 0 auto; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; color: #a8b9ca; border-bottom: 1px solid var(--line-soft); }
.canvas-topline > span:first-child { display: flex; align-items: center; gap: 8px; }
.canvas-note { color: var(--muted-2); font-size: 8px; }
#labCanvas { display: block; width: 100%; height: 100%; min-height: 0; flex: 1 1 auto; }
.canvas-legend { flex: 0 0 auto; min-height: 38px; padding: 0 15px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: #aab9c9; font-size: 9px; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-mark { width: 13px; height: 3px; display: inline-block; border-radius: 3px; }
.legend-mark.rs { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.legend-mark.periodic { background: #a0afc2; }
.legend-mark.random { background: #697b93; }
.legend-hint { margin-left: auto; color: var(--muted-2); }
.caption-bar { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(16, 25, 39, .75); }
.caption-symbol { flex: 0 0 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 23px; }
.caption-label { color: var(--accent); font-size: 8px; margin-bottom: 4px; }
.caption-bar p { margin: 0; color: #c4d0de; font-size: 11px; line-height: 1.45; }
.bottom-meta, .footer { color: #53647b; font-size: 8px; display: flex; justify-content: space-between; gap: 12px; padding: 0 2px; }
.control-column { min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #31445b transparent; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(165deg, rgba(17, 27, 42, .96), rgba(11, 19, 31, .98)); padding: 15px; display: flex; flex-direction: column; gap: 17px; }
.section-heading { color: #aab9ca; display: flex; align-items: center; justify-content: space-between; font-size: 9px; }
.live-tag { color: var(--accent); font-size: 8px; letter-spacing: .08em; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.readout-card { min-width: 0; border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 9px 8px; background: rgba(6, 13, 23, .34); }
.readout-name { color: #7e91a8; font-size: 7px; letter-spacing: .1em; line-height: 1.4; min-height: 20px; }
.readout-value { color: var(--text); font-size: 19px; font-weight: 670; letter-spacing: -.04em; line-height: 1.3; white-space: nowrap; }
.readout-value small { font-size: 9px; color: #9badc0; font-weight: 500; letter-spacing: 0; }
.readout-kind { color: #61748c; font-size: 7px; letter-spacing: .04em; margin-top: 3px; }
.preset-section, .parameter-section, .check-section { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.preset-button { border: 1px solid var(--line); border-radius: 8px; background: #0b1421; padding: 9px 8px; color: #aebdd0; font-size: 9px; line-height: 1.3; cursor: pointer; text-align: left; transition: .18s ease; }
.preset-button span { float: right; color: var(--muted-2); }
.preset-button:hover { border-color: #4a6177; }
.preset-button.selected { border-color: rgba(89,223,208,.5); color: var(--accent); background: var(--accent-soft); }
.muted-small { color: #657991; font-size: 7px; letter-spacing: .08em; }
.control-block { margin-top: 13px; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.control-label-row label { font-size: 10px; color: #d2deea; font-weight: 620; }
.unit { font-size: 8px; color: #778ba3; font-weight: 450; margin-left: 4px; }
.control-label-row output { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; }
input[type="range"] { width: 100%; height: 15px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #2a3a50; border-radius: 3px; }
input[type="range"]::-moz-range-track { height: 3px; background: #2a3a50; border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; border: 2px solid #07121b; background: var(--accent); box-shadow: 0 0 0 3px rgba(89,223,208,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #07121b; background: var(--accent); box-shadow: 0 0 0 3px rgba(89,223,208,.12); }
.range-ends { display: flex; justify-content: space-between; color: #5e7188; font-size: 7px; margin-top: 2px; }
select { width: 100%; min-height: 34px; color: #cbd7e5; background: #0b1421; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 10px; }
.check-pill { border: 1px solid rgba(89,223,208,.25); border-radius: 4px; padding: 3px 5px; color: var(--accent); font-size: 7px; letter-spacing: .08em; }
.check-row, .check-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: #8da0b6; font-size: 9px; }
.check-row strong, .check-footer strong { color: #dbe6f0; font-size: 10px; font-variant-numeric: tabular-nums; }
.check-footer { border-top: 1px solid var(--line-soft); padding-top: 8px; margin-top: 8px; }
.check-footer strong { color: var(--accent); }
.check-explain { margin: 8px 0 0; color: #657991; font-size: 8px; line-height: 1.45; }
.quality-row { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.quality-label { color: #8da0b6; font-size: 8px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #0a1320; gap: 2px; }
.segmented button { border: 0; border-radius: 5px; background: transparent; color: #7f91a7; font-size: 8px; padding: 5px 10px; cursor: pointer; }
.segmented button.active { color: var(--accent); background: var(--accent-soft); }
.science-panel { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; color: #b8c7d8; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 15px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { color: #8ea0b5; font-size: 9px; line-height: 1.6; padding: 5px 0 2px; }
.science-content h3 { color: #d2deea; font-size: 10px; margin: 12px 0 4px; }
.science-content p { margin: 5px 0; }
.equation { padding: 7px 9px; margin: 7px 0; border-left: 2px solid var(--accent); background: rgba(89,223,208,.06); color: #d5e9e8; font-family: Georgia, "Times New Roman", serif; font-size: 13px; letter-spacing: .01em; overflow-wrap: anywhere; }
.disclaimer { margin-top: 12px !important; color: #71849a; font-style: italic; }
.footer { flex: 0 0 auto; min-height: 24px; align-items: center; border-top: 1px solid var(--line-soft); }
@media (min-width: 1500px) { .app-shell { padding-left: 34px; padding-right: 34px; } .workspace { grid-template-columns: minmax(0, 1fr) 365px; } }
@media (max-width: 900px) { .app-shell { padding: 0 16px; } .workspace { grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; } .control-column { padding: 12px; } .transport { gap: 5px; } .icon-button { padding: 0 9px; } }
@media (max-width: 680px) {
  .app-shell { padding: 0 10px; }
  .topbar { min-height: 74px; gap: 8px; align-items: center; }
  .eyebrow { font-size: 7px; margin-bottom: 4px; }
  h1 { font-size: 17px; }
  .subtitle { display: none; }
  .transport { gap: 4px; }
  .icon-button { min-height: 31px; padding: 0 7px; border-radius: 7px; font-size: 9px; }
  .icon-button.screenshot { padding: 0 5px; }
  .icon-button.screenshot span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 9px; padding: 9px 0 7px; overflow: hidden; }
  .visual-column { flex: 0 0 47%; min-height: 260px; gap: 7px; }
  .canvas-frame { border-radius: 10px; }
  .canvas-topline { height: 26px; padding: 0 9px; font-size: 7px; }
  .canvas-note { font-size: 6px; }
  .canvas-legend { min-height: 27px; padding: 4px 8px; gap: 8px; font-size: 7px; }
  .legend-mark { width: 9px; }
  .legend-hint { display: none !important; }
  .caption-bar { min-height: 48px; padding: 6px 8px; gap: 8px; }
  .caption-symbol { flex-basis: 26px; height: 26px; font-size: 17px; }
  .caption-label { font-size: 6px; margin-bottom: 2px; }
  .caption-bar p { font-size: 8px; line-height: 1.35; }
  .bottom-meta { display: none; }
  .control-column { flex: 1 1 0; min-height: 0; overflow-y: auto; border-radius: 10px; padding: 11px; gap: 12px; }
  .section-heading { font-size: 8px; }
  .readout-grid { gap: 6px; margin-top: 8px; }
  .readout-card { padding: 7px 8px 6px; }
  .readout-name { font-size: 6px; min-height: 15px; }
  .readout-value { font-size: 16px; }
  .readout-value small { font-size: 8px; }
  .readout-kind { font-size: 6px; }
  .preset-section, .parameter-section, .check-section { padding-top: 10px; }
  .preset-button { font-size: 8px; padding: 8px 7px; }
  .control-block { margin-top: 10px; }
  .control-label-row label { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .check-row, .check-footer { font-size: 8px; }
  .check-explain { font-size: 7px; }
  .footer { min-height: 20px; font-size: 6px; }
  .footer span:last-child { display: none; }
}
@media (max-width: 390px) {
  .app-shell { padding: 0 8px; }
  .topbar { min-height: 69px; }
  h1 { font-size: 15px; }
  .eyebrow { font-size: 6px; }
  .icon-button { font-size: 8px; padding: 0 6px; min-height: 29px; }
  .workspace { padding-top: 7px; }
  .visual-column { flex-basis: 45%; min-height: 245px; }
  .canvas-legend { gap: 6px; }
  .canvas-legend span { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
