:root {
  color-scheme: dark;
  --bg: #07121a;
  --surface: #0d1b25;
  --surface-2: #11232e;
  --surface-3: #162b37;
  --line: #243946;
  --line-soft: rgba(135, 165, 180, .16);
  --text: #e8f0f2;
  --muted: #9aadb7;
  --faint: #718793;
  --accent: #5de2d0;
  --accent-soft: rgba(93, 226, 208, .12);
  --water: #2994a5;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; 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; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% -12%, rgba(40, 101, 112, .16), transparent 42%), var(--bg); }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line-soft); background: rgba(7, 18, 26, .94); }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(93,226,208,.42); border-radius: 10px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; background: var(--accent-soft); flex: 0 0 auto; }
.brand-mark span { width: 4px; 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: .75; }
.brand-copy { min-width: 0; }
.eyebrow { color: var(--accent); font-size: 9px; letter-spacing: .16em; font-weight: 750; line-height: 1.4; }
.eyebrow span { color: var(--faint); padding: 0 4px; }
h1, h2, p { margin: 0; }
.brand-copy h1 { margin-top: 3px; font-size: clamp(15px, 1.6vw, 20px); line-height: 1.2; letter-spacing: -.025em; font-weight: 650; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .13em; white-space: nowrap; }
.live-dot, .caption-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(93,226,208,.65); }
.workspace { width: 100%; height: 0; max-width: 1800px; margin: 0 auto; padding: 20px 24px 16px; display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(340px, .72fr); gap: 20px; flex: 1; min-height: 0; }
.observatory { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-heading h2, .panel-heading h2 { font-size: 17px; letter-spacing: -.025em; font-weight: 620; margin-top: 3px; }
.scale-note, .small-tag { color: var(--faint); font-size: 8px; letter-spacing: .13em; font-weight: 700; white-space: nowrap; }
.canvas-stage { position: relative; width: 100%; height: clamp(330px, 51vh, 500px); min-height: 280px; overflow: hidden; border: 1px solid #263d49; border-radius: 16px; background: #0a1821; box-shadow: 0 18px 50px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.025); }
#scene { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#scene:active { cursor: grabbing; }
.caption-row { display: flex; align-items: flex-start; gap: 10px; padding: 2px 2px 4px; min-height: 38px; }
.caption-mark { margin-top: 6px; flex: 0 0 auto; }
.caption-row p { color: #c1d0d5; font-size: 12px; line-height: 1.55; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 12px 12px 10px; border: 1px solid var(--line-soft); border-radius: 11px; background: linear-gradient(145deg, rgba(17,35,46,.9), rgba(10,25,34,.9)); }
.readout-label { color: var(--muted); font-size: 8px; letter-spacing: .11em; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-value { margin-top: 7px; font-size: clamp(16px, 2vw, 22px); line-height: 1; font-weight: 640; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-foot { margin-top: 7px; color: var(--faint); font-size: 9px; line-height: 1.25; }
.lab-panel { min-width: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 0 2px 8px 0; scrollbar-width: thin; scrollbar-color: #344c58 transparent; }
.panel-card, .checks-card, .science-panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15,31,41,.96), rgba(10,23,31,.96)); }
.panel-card { padding: 14px; }
.panel-heading { align-items: center; margin-bottom: 12px; }
.panel-heading h2 { font-size: 15px; }
.small-tag { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(17,35,46,.62); text-align: left; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.preset-button:hover { border-color: rgba(93,226,208,.48); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(93,226,208,.7); background: var(--accent-soft); }
.preset-symbol { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--accent); background: rgba(93,226,208,.09); font-size: 17px; }
.preset-button strong, .preset-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-button strong { font-size: 10px; font-weight: 650; }
.preset-button small { margin-top: 3px; color: var(--faint); font-size: 8px; }
.control-list { display: grid; gap: 11px; }
.control-row { display: block; cursor: help; }
.control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-name { font-size: 11px; color: #d5e0e3; font-weight: 560; }
.control-name em { color: var(--accent); font-style: italic; }
.control-top output { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 5px 0 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: ew-resize; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(93,226,208,.62), #314853); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(93,226,208,.62), #314853); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; border: 2px solid #07121a; background: var(--accent); box-shadow: 0 0 0 1px rgba(93,226,208,.55); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #07121a; background: var(--accent); box-shadow: 0 0 0 1px rgba(93,226,208,.55); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #667d88; font-size: 8px; }
.transport-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line-soft); }
.transport-buttons { display: flex; gap: 6px; }
.action-button, .quality-button, .experiment-button { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #142833; color: #dce7e9; font-size: 10px; font-weight: 620; cursor: pointer; transition: background .15s, border-color .15s; }
.action-button { padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; }
.action-button:hover, .quality-button:hover { border-color: rgba(93,226,208,.5); }
.action-button.primary { color: #061b1c; background: var(--accent); border-color: var(--accent); }
.action-button.primary:hover { background: #82f0df; }
#play-icon { font-size: 9px; }
.quality-button { display: flex; align-items: center; gap: 7px; padding: 0 9px; color: var(--muted); white-space: nowrap; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.quality-button[aria-pressed="false"] .quality-dot { background: #82949c; }
.panel-copy { color: var(--muted); font-size: 10px; line-height: 1.55; margin: -2px 0 10px; }
.experiment-button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 11px; color: var(--accent); border-color: rgba(93,226,208,.34); background: var(--accent-soft); }
.experiment-button:hover { background: rgba(93,226,208,.19); }
.experiment-button span { font-size: 16px; }
.experiment-result { margin-top: 9px; padding: 9px 10px; border-radius: 8px; background: rgba(3,13,19,.48); color: var(--muted); font-size: 9px; line-height: 1.55; min-height: 40px; }
.experiment-result strong { color: var(--text); font-weight: 650; }
.checks-card { padding: 12px 14px 10px; }
.checks-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.check-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(135,165,180,.09); color: #b5c4ca; font-size: 9px; line-height: 1.35; }
.check-row strong { flex: 0 0 auto; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 9px; }
.check-note { color: #6e838d; font-size: 8px; margin-top: 4px; }
.science-panel { overflow: hidden; }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 620; }
.summary-plus { color: var(--accent); font-size: 17px; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 14px 14px; color: #b7c6cb; font-size: 10px; line-height: 1.65; }
.science-content h3 { margin: 13px 0 5px; color: #e2ecee; font-size: 11px; font-weight: 650; }
.science-content p { margin: 5px 0 8px; }
.science-content ul { margin: 5px 0 8px; padding-left: 17px; }
.science-content li { margin: 4px 0; }
.equation { margin: 8px 0; padding: 9px 10px; overflow-wrap: anywhere; border-left: 2px solid var(--accent); border-radius: 0 7px 7px 0; background: rgba(93,226,208,.07); color: #d8f2ef; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.science-foot { color: #7f939d; font-size: 9px; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 24px 10px; color: #5e737d; font-size: 8px; letter-spacing: .12em; border-top: 1px solid rgba(135,165,180,.1); }
button:focus-visible, summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .topbar, body.embed-mode .footer { display: none; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .workspace { height: 100%; min-height: 0; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1.1fr) minmax(310px, .9fr); padding-left: 16px; padding-right: 16px; gap: 14px; }
  .canvas-stage { height: clamp(300px, 48vh, 430px); }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout-card { padding: 10px; }
}
@media (max-width: 700px) {
  .topbar { min-height: 64px; padding: 10px 14px; gap: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .top-meta { font-size: 8px; }
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: 0; overflow: visible; padding: 14px 12px 20px; gap: 16px; }
  .observatory { gap: 10px; }
  .section-heading h2 { font-size: 15px; }
  .scale-note { font-size: 7px; text-align: right; }
  .canvas-stage { height: 290px; min-height: 250px; border-radius: 12px; }
  .caption-row p { font-size: 11px; }
  .readouts { gap: 7px; }
  .readout-card { padding: 10px; }
  .readout-value { font-size: 19px; }
  .lab-panel { overflow: visible; padding: 0; }
  .panel-card { padding: 13px; }
  .footer { padding: 8px 12px; font-size: 7px; }
  body.embed-mode .app-shell { height: 100%; min-height: 0; overflow: hidden; }
  body.embed-mode .workspace { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.embed-mode .canvas-stage { height: 270px; min-height: 240px; }
}
@media (max-width: 380px) {
  .top-meta { display: none; }
  .preset-button { padding: 8px 6px; gap: 6px; }
  .preset-button strong { font-size: 9px; }
  .transport-buttons { gap: 4px; }
  .action-button { padding: 0 8px; }
  .quality-button { padding: 0 7px; font-size: 9px; }
  .readout-value { font-size: 17px; }
}
