:root {
  color-scheme: dark;
  --bg: #090d14;
  --panel: #101722;
  --panel-2: #141e2b;
  --line: #273343;
  --line-soft: rgba(151, 171, 193, .15);
  --text: #edf3f8;
  --muted: #9aaabc;
  --subtle: #6e8094;
  --accent: #58e0cf;
  --accent-dim: rgba(88, 224, 207, .14);
  --good: #58e0cf;
  --warning: #aebbc8;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.brand-header { height: 31px; padding: 0 24px; display: flex; align-items: center; gap: 12px; background: #070a10; border-bottom: 1px solid rgba(151,171,193,.12); color: #8fa1b4; font-size: 9px; letter-spacing: .16em; font-weight: 750; }
.brand-mark { color: var(--accent); }
.brand-divider { height: 13px; width: 1px; background: #394758; }
.brand-sub, .brand-issue { color: #75869a; }
.brand-spacer { flex: 1; }
.app-shell { height: calc(100vh - 31px); height: calc(100dvh - 31px); min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 57px; flex: 0 0 57px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: #0c121b; }
.topbar-title { display: flex; align-items: baseline; gap: 14px; }
.topbar-kicker { color: var(--accent); font-size: 9px; letter-spacing: .17em; font-weight: 800; }
.topbar-name { color: #c5d0dc; font-size: 11px; letter-spacing: .12em; font-weight: 700; }
.topbar-status { display: flex; align-items: center; gap: 8px; color: #a5b5c5; font-size: 9px; letter-spacing: .13em; font-weight: 800; }
.live-dot, .stamp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(88,224,207,.55); }
.workspace { width: 100%; max-width: 1680px; margin: 0 auto; padding: 13px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 14px; flex: 1; min-height: 0; overflow: hidden; }
.lab-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #344457 transparent; }
.intro-row { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 1px 2px 0; }
.intro-copy { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 9px; letter-spacing: .16em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.12; letter-spacing: -.035em; font-weight: 720; }
.lead { margin: 6px 0 0; color: #aab9c8; font-size: 11px; line-height: 1.45; max-width: 760px; }
.model-stamp { flex: 0 0 132px; border: 1px solid var(--line); background: rgba(20,30,43,.65); border-radius: 10px; padding: 9px 10px; color: #d8e3ed; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.model-stamp .stamp-dot { display: inline-block; margin: 0 7px 0 1px; width: 6px; height: 6px; }
.model-stamp small { display: block; padding: 5px 0 0 14px; color: var(--subtle); font-size: 8px; letter-spacing: .12em; }
.scene-card { min-height: 250px; flex: 1 1 250px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(ellipse at 48% 35%, rgba(31,57,69,.42), transparent 58%), linear-gradient(145deg, #101a27, #0d141e 72%); box-shadow: 0 14px 35px rgba(0,0,0,.18); }
.scene-head { min-height: 35px; padding: 9px 13px 6px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid rgba(151,171,193,.1); color: #dbe5ee; font-size: 9px; letter-spacing: .1em; }
.scene-head b { font-size: 9px; letter-spacing: .13em; }
.scene-sub { margin-left: 9px; color: #8497aa; font-size: 9px; letter-spacing: .02em; font-weight: 500; }
.scene-note { color: #6f8397; font-size: 8px; letter-spacing: .12em; white-space: nowrap; }
.canvas-wrap { position: relative; flex: 1; min-height: 160px; overflow: hidden; }
#scene { display: block; width: 100%; height: 100%; min-height: 160px; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
.canvas-hint { position: absolute; right: 12px; top: 10px; color: #72879a; font-size: 8px; letter-spacing: .11em; pointer-events: none; }
.drag-icon { color: var(--accent); font-size: 14px; vertical-align: -1px; margin-right: 3px; }
.view-fit { position: absolute; left: 12px; top: 10px; padding: 4px 6px; color: var(--warning); background: rgba(60,45,24,.72); border: 1px solid rgba(240,194,122,.3); border-radius: 5px; font-size: 8px; letter-spacing: .12em; }
.scene-foot { min-height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 13px; border-top: 1px solid rgba(151,171,193,.1); color: #8496a9; font-size: 8px; letter-spacing: .08em; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-nucleus { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #dbe6ee; box-shadow: 0 0 6px rgba(255,255,255,.45); }
.legend-cloud { width: 12px; height: 7px; display: inline-block; border-radius: 50%; background: rgba(88,224,207,.5); border: 1px solid rgba(88,224,207,.8); }
.scene-foot-right { margin-left: auto; color: #64778b; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; min-height: 75px; padding: 9px 11px 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,23,34,.9); }
.readout-label { display: flex; align-items: center; gap: 5px; color: #8fa1b4; font-size: 8px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.kind-tag { display: inline-block; padding: 2px 4px; border-radius: 3px; font-size: 7px; letter-spacing: .07em; font-weight: 850; }
.kind-tag.scaled { color: var(--accent); background: var(--accent-dim); }
.kind-tag.simulated { color: #d0d9e3; background: rgba(160,178,197,.12); }
.readout-value { margin-top: 5px; font-size: 24px; line-height: 1; letter-spacing: -.04em; font-weight: 690; font-variant-numeric: tabular-nums; }
.readout-value small { margin-left: 4px; color: #9cabb9; font-size: 11px; letter-spacing: 0; font-weight: 550; }
.readout-foot { margin-top: 5px; color: #718398; font-size: 9px; }
.diagnostics-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 8px; }
.diagnostic-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,23,34,.9); padding: 9px 11px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #d5e0e9; font-size: 8px; font-weight: 850; letter-spacing: .13em; margin-bottom: 6px; }
.heading-note { color: #71859a; font-size: 7px; letter-spacing: .1em; white-space: nowrap; }
.check-line { min-height: 20px; display: grid; grid-template-columns: minmax(0,1fr) 54px 39px; align-items: center; gap: 5px; border-top: 1px solid rgba(151,171,193,.08); }
.check-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a4b2c0; font-size: 9px; }
.check-line strong { color: #e2edf4; text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
.check-status { justify-self: end; color: var(--accent); font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.check-status.warn { color: var(--warning); }
.check-foot { margin: 5px 0 0; color: #687c90; font-size: 8px; line-height: 1.3; }
.period-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 3px 0 7px; }
.period-grid small { display: block; color: #788ca0; font-size: 7px; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.period-grid strong { display: block; margin-top: 5px; color: #e2edf4; font-size: 17px; font-weight: 680; font-variant-numeric: tabular-nums; }
.period-diff { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(151,171,193,.1); color: #8da0b2; font-size: 8px; }
.period-diff strong { color: var(--accent); font-size: 9px; }
.experiment-note { margin: 5px 0 0; color: #687c90; font-size: 8px; line-height: 1.3; }
.control-panel { min-width: 0; align-self: stretch; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, #111a27, #0d141e); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #344457 transparent; }
.control-section { min-width: 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; color: #dbe5ee; font-size: 9px; font-weight: 850; letter-spacing: .13em; margin-bottom: 8px; }
.section-index { color: #5e7185; font-size: 8px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-button { min-height: 48px; text-align: left; padding: 7px 8px; border: 1px solid #2a394a; border-radius: 8px; background: rgba(23,34,48,.8); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.preset-button span { display: block; color: #c8d4df; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.preset-button small { display: block; margin-top: 4px; color: #7f91a4; font-size: 8px; line-height: 1.2; }
.preset-button:hover { border-color: #6b8499; }
.preset-button.active { border-color: rgba(88,224,207,.7); background: rgba(88,224,207,.09); }
.preset-button.active span { color: var(--accent); }
.preset-button.fail-preset.active { border-color: rgba(88,224,207,.7); background: rgba(88,224,207,.09); }
.preset-button.fail-preset.active span { color: var(--accent); }
.parameter-section { border-top: 1px solid rgba(151,171,193,.12); padding-top: 10px; }
.control-block { margin-bottom: 10px; }
.control-block.last-control { margin-bottom: 0; }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-label-row label { color: #c9d5df; font-size: 10px; font-weight: 650; }
.control-label-row output { color: var(--accent); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.primary-control .control-label-row label { color: #eef7fa; }
.primary-control .control-label-row output { font-size: 12px; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; padding: 0; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 5px; background: #344354; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid #0b1119; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 5px; background: #344354; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0b1119; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; gap: 5px; margin-top: 2px; color: #718398; font-size: 8px; font-variant-numeric: tabular-nums; }
.range-ends .unit-hint { color: #687c90; }
.control-tip { margin: 5px 0 0; color: #7c8ea1; font-size: 8px; line-height: 1.35; }
.transport-section { padding: 10px 0 8px; border-top: 1px solid rgba(151,171,193,.12); border-bottom: 1px solid rgba(151,171,193,.12); }
.transport-buttons { display: grid; grid-template-columns: 1.1fr 1fr .8fr; gap: 6px; }
.transport-buttons button { min-height: 34px; border-radius: 7px; cursor: pointer; font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.transport-main { display: flex; align-items: center; justify-content: center; gap: 7px; color: #061512; background: var(--accent); border: 1px solid var(--accent); }
.transport-main span:first-child { font-size: 12px; }
.transport-secondary { color: #bdcad6; background: #182333; border: 1px solid #344457; }
.transport-buttons button:hover { filter: brightness(1.12); }
.transport-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #718398; font-size: 7px; letter-spacing: .09em; font-variant-numeric: tabular-nums; }
.display-section { padding-top: 1px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #b9c7d4; font-size: 9px; }
.quality-toggle { display: flex; padding: 2px; gap: 2px; border: 1px solid #2d3c4d; border-radius: 7px; background: #0b121b; }
.quality-option { min-width: 40px; padding: 4px 7px; border: 0; border-radius: 5px; color: #8294a7; background: transparent; cursor: pointer; font-size: 8px; font-weight: 850; }
.quality-option.selected { color: #061512; background: var(--accent); }
.science-panel { border: 1px solid #2b3949; border-radius: 9px; background: rgba(8,13,21,.46); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; color: #d5e1ea; cursor: pointer; list-style: none; font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 15px; font-weight: 400; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 11px 11px; color: #9babb9; font-size: 9px; line-height: 1.5; }
.science-content h2 { margin: 12px 0 5px; color: #dbe5ed; font-size: 10px; letter-spacing: .03em; }
.science-content p { margin: 5px 0 8px; }
.science-content ul { padding-left: 15px; margin: 6px 0 9px; }
.science-content li { margin: 4px 0; }
.equation { margin: 7px 0; padding: 8px; overflow-x: auto; border-left: 2px solid var(--accent); background: rgba(88,224,207,.06); color: #e1f3f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; white-space: nowrap; }
.affiliation-note { padding-top: 7px; border-top: 1px solid rgba(151,171,193,.1); color: #77899b; font-style: italic; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 3px; color: #586b7e; font-size: 7px; letter-spacing: .1em; }
body.embed-mode .brand-header { display: none; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .workspace { min-height: 0; }
@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0,1fr) 380px; padding-left: 22px; padding-right: 22px; }
  .control-panel { padding: 15px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1fr) 320px; gap: 10px; padding: 10px; }
  .control-panel { padding: 10px; }
  .model-stamp { display: none; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 21px; }
  .scene-foot { gap: 9px; }
}
@media (max-width: 700px) {
  body { overflow-x: hidden; }
  .brand-header { height: 26px; padding: 0 13px; font-size: 8px; }
  .brand-issue { display: none; }
  .app-shell { height: auto; min-height: calc(100vh - 26px); }
  .topbar { height: 48px; flex-basis: 48px; padding: 0 14px; }
  .topbar-title { display: block; }
  .topbar-kicker { display: block; font-size: 8px; }
  .topbar-name { display: block; margin-top: 3px; font-size: 9px; }
  .topbar-status { font-size: 8px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding: 10px; height: auto; min-height: 0; overflow: visible; }
  body.embed-mode .app-shell { height: 100%; min-height: 0; }
  body.embed-mode .workspace { height: auto; overflow-y: auto; overscroll-behavior: contain; }
  .lab-panel { flex: 0 0 auto; gap: 9px; overflow: visible; }
  .intro-row { min-height: 0; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 20px; line-height: 1.12; }
  .lead { margin-top: 5px; font-size: 10px; }
  .scene-card { flex: none; height: 284px; min-height: 284px; }
  .scene-head { min-height: 32px; padding: 8px 10px 5px; }
  .scene-sub { display: block; margin: 3px 0 0; font-size: 8px; }
  .scene-note { font-size: 7px; }
  .canvas-wrap { min-height: 0; }
  #scene { min-height: 0; }
  .scene-foot { min-height: 26px; padding: 0 9px; gap: 9px; font-size: 7px; }
  .scene-foot-right { display: none; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .readout-card { min-height: 72px; padding: 8px 9px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 22px; }
  .diagnostics-row { grid-template-columns: 1fr; gap: 7px; }
  .diagnostic-card { padding: 9px 10px; }
  .check-line { min-height: 22px; }
  .check-name { font-size: 8px; }
  .period-grid strong { font-size: 16px; }
  .control-panel { flex: none; overflow: visible; padding: 11px; gap: 11px; }
  .preset-button { min-height: 47px; }
  .control-block { margin-bottom: 11px; }
  .control-label-row label { font-size: 10px; }
  .control-tip { font-size: 8px; }
  .panel-footer { padding: 4px 0 1px; }
}
@media (max-width: 360px) {
  .workspace { padding: 8px; }
  h1 { font-size: 18px; }
  .scene-card { height: 264px; min-height: 264px; }
  .scene-note { display: none; }
  .readout-value { font-size: 20px; }
  .scene-foot { gap: 6px; font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
