:root {
  color-scheme: dark;
  --bg: #07121a;
  --panel: #0d1b25;
  --panel-2: #10222d;
  --line: rgba(150, 184, 197, .14);
  --line-strong: rgba(150, 184, 197, .24);
  --text: #e7f0f2;
  --muted: #8ca4ae;
  --dim: #617984;
  --accent: #63d6c2;
  --accent-2: #9ae8d7;
  --warm: #f3ad69;
  --cool: #69c8ed;
  --danger: #f28d7d;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; 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; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 22% 0%, rgba(29, 83, 83, .13), transparent 42%), var(--bg); }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { height: 72px; flex: 0 0 72px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(7, 18, 26, .94); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(99, 214, 194, .28); border-radius: 12px; color: var(--accent); background: rgba(99, 214, 194, .07); }
.brand-mark svg { width: 34px; height: 34px; }
.brand-copy { min-width: 0; }
.eyebrow, .stage-kicker, .section-heading, .caption-label, .readout-name, .readout-foot, .range-ends, .equation-label, .audit-title, .panel-footnote { letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 750; margin-bottom: 4px; }
h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--muted); font-size: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(99, 214, 194, .7); }
.live-label { color: var(--accent-2); font-weight: 750; letter-spacing: .1em; }
.top-divider { height: 17px; width: 1px; background: var(--line-strong); margin: 0 4px; }
.species-label { font-size: 11px; color: #9bb0b8; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; padding: 14px; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-head { flex: 0 0 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px 0 4px; }
.stage-kicker { color: var(--accent); font-size: 9px; font-weight: 750; margin-bottom: 4px; }
.stage-title { font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.clock-chip { min-width: 114px; padding: 7px 10px; display: grid; grid-template-columns: 16px auto; grid-template-rows: 18px 11px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(15, 34, 44, .78); }
.clock-icon { grid-row: 1 / span 2; color: var(--accent); font-size: 17px; }
#clockReadout { font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.clock-sub { font-size: 7px; letter-spacing: .13em; color: var(--dim); }
.canvas-frame { position: relative; flex: 1 1 auto; min-height: 250px; overflow: hidden; border: 1px solid rgba(138, 181, 187, .17); border-radius: 16px; background: radial-gradient(ellipse at 50% 38%, rgba(24, 65, 69, .27), transparent 57%), linear-gradient(180deg, #0b1a23 0%, #091720 70%, #0a1a21 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 16px 44px rgba(0,0,0,.15); }
#moundCanvas { display: block; width: 100%; height: 100%; }
.canvas-legend { position: absolute; left: 16px; bottom: 13px; display: flex; flex-wrap: wrap; gap: 13px; color: #8099a2; font-size: 8px; letter-spacing: .1em; pointer-events: none; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-swatch.warm { background: var(--warm); box-shadow: 0 0 8px rgba(243,173,105,.65); }
.legend-swatch.cool { background: var(--cool); box-shadow: 0 0 8px rgba(105,200,237,.6); }
.legend-swatch.wall { background: #b28b64; }
.canvas-stamp { position: absolute; right: 14px; top: 13px; padding: 6px 9px; border: 1px solid rgba(99,214,194,.22); border-radius: 7px; color: #9ce0d3; background: rgba(7, 22, 29, .74); font-size: 8px; font-weight: 750; letter-spacing: .13em; pointer-events: none; }
.caption-row { min-height: 70px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 27, 37, .82); }
.caption-icon { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(99,214,194,.24); border-radius: 10px; color: var(--accent); background: rgba(99,214,194,.07); font-size: 17px; }
.caption-label { color: var(--accent); font-size: 8px; font-weight: 750; margin-bottom: 4px; }
.caption-copy p { margin: 0; color: #c0d0d4; font-size: 11px; line-height: 1.45; }
.control-column { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(180deg, rgba(14, 30, 40, .97), rgba(10, 23, 32, .98)); }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #29434d transparent; padding: 15px 14px 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: #a7bac0; font-size: 8px; font-weight: 800; }
.section-note { color: #5f7b84; font-size: 7px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; min-height: 80px; padding: 9px 10px 8px; border: 1px solid rgba(145, 178, 188, .12); border-radius: 10px; background: rgba(18, 39, 49, .78); }
.primary-readout { grid-column: span 2; min-height: 94px; background: linear-gradient(105deg, rgba(25, 66, 66, .55), rgba(17, 40, 49, .82)); border-color: rgba(99, 214, 194, .23); }
.readout-topline { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.readout-name { color: #7f9aa3; font-size: 7px; font-weight: 750; }
.readout-unit { color: #5e7881; font-size: 8px; }
.readout-value { margin-top: 5px; color: #e5f1f0; font-size: 23px; font-weight: 650; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.primary-readout .readout-value { color: var(--accent-2); font-size: 29px; }
.readout-foot { margin-top: 6px; color: #6e8992; font-size: 7px; font-weight: 700; }
.primary-readout .readout-foot { color: #9bc8c1; }
.readout-bar { height: 3px; margin-top: 8px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.readout-bar span { display: block; width: 64%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.controls-section, .time-section, .preset-section { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.control-group { margin: 0 0 13px; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-label-row label { color: #c8d6d9; font-size: 10px; font-weight: 550; }
.control-label-row output { color: var(--accent-2); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 8px; background: linear-gradient(90deg, rgba(99,214,194,.56), rgba(99,214,194,.14)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 8px; background: linear-gradient(90deg, rgba(99,214,194,.56), rgba(99,214,194,.14)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid #0a1c23; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(99,214,194,.18), 0 0 10px rgba(99,214,194,.28); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0a1c23; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(99,214,194,.18); }
.range-ends { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; color: #5c737c; font-size: 6px; font-weight: 650; }
.last-control { margin-bottom: 1px; }
.time-section { margin-top: 13px; }
.time-value { color: var(--accent-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.day-ticks { display: flex; justify-content: space-between; margin-top: 1px; color: #617984; font-size: 7px; font-variant-numeric: tabular-nums; }
.cycle-track { position: relative; height: 5px; margin-top: 7px; border-radius: 6px; overflow: hidden; background: #1b2e39; }
.night-band { position: absolute; inset: 0 auto 0 0; width: 25%; background: #263e5a; }
.day-band { position: absolute; top: 0; bottom: 0; left: 25%; width: 50%; background: linear-gradient(90deg, #b87e4d, #e7b36b, #b87e4d); opacity: .85; }
.sun-marker { position: absolute; top: -2px; left: 58.3%; width: 3px; height: 9px; border-radius: 4px; background: #fff0b2; box-shadow: 0 0 7px #ffd78a; transform: translateX(-50%); }
.preset-section { margin-top: 13px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid rgba(145,178,188,.15); border-radius: 9px; text-align: left; background: rgba(17, 37, 47, .76); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.preset-button:hover { border-color: rgba(99,214,194,.38); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(99,214,194,.5); background: rgba(29, 70, 69, .42); }
.preset-symbol { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font-size: 17px; }
.sun-symbol { color: #f4bb73; background: rgba(244,187,115,.1); }
.moon-symbol { color: #9bc9ed; background: rgba(155,201,237,.1); }
.preset-button strong { display: block; color: #d8e5e6; font-size: 8px; font-weight: 700; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #76909a; font-size: 7px; white-space: nowrap; }
.transport-section { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.transport-button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid rgba(145,178,188,.18); border-radius: 8px; color: #a8bdc2; background: rgba(19, 40, 50, .8); font-size: 9px; font-weight: 650; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.transport-button:hover { border-color: rgba(99,214,194,.42); color: #e5f1ef; }
.play-button { min-width: 85px; color: #061a1d; background: var(--accent); border-color: var(--accent); }
.play-button:hover { color: #061a1d; background: #8ce4d3; }
.play-button span:first-child { font-size: 10px; }
.quality-button { margin-left: auto; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.quality-button.low .quality-dot { background: var(--warm); }
.screenshot-button { flex: 1 1 100%; }
.science-panel { margin-top: 12px; border: 1px solid rgba(145,178,188,.14); border-radius: 10px; background: rgba(15, 32, 42, .7); }
.science-panel summary { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #c6d5d8; list-style: none; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-mark { color: var(--accent); font-size: 15px; }
.chevron { margin-left: auto; color: #78939b; font-size: 14px; transition: transform .16s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 10px 11px; }
.science-intro, .simplification-note, .disclaimer { color: #8fa7af; font-size: 9px; line-height: 1.5; }
.science-intro { margin: 0 0 10px; }
.equation-block { padding: 8px; margin: 7px 0; border: 1px solid rgba(145,178,188,.1); border-radius: 7px; background: rgba(4, 15, 22, .48); }
.equation-label { display: block; margin-bottom: 6px; color: #73bfb1; font-size: 7px; font-weight: 800; }
.equation-block code { display: block; margin: 3px 0; color: #d2e4e1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; line-height: 1.5; white-space: normal; }
.audit-box { margin: 8px 0; padding: 8px; border: 1px solid rgba(99,214,194,.2); border-radius: 8px; background: rgba(25, 66, 66, .18); }
.audit-title { margin-bottom: 6px; color: var(--accent); font-size: 7px; font-weight: 800; }
.audit-line { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: #8fa7af; font-size: 8px; }
.audit-line strong { color: #dcebe7; font-variant-numeric: tabular-nums; }
.audit-difference { border-top: 1px solid rgba(99,214,194,.12); margin-top: 3px; padding-top: 6px; }
.audit-difference strong { color: var(--accent-2); }
.simplification-note { margin: 9px 0 7px; }
.simplification-note strong { color: #c3d4d7; }
.disclaimer { margin: 0; color: #6f8992; font-style: italic; }
.panel-footnote { padding: 11px 2px 0; color: #5f7780; font-size: 6px; line-height: 1.6; }
.panel-footnote span { color: #45616a; }
@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; padding: 10px; }
  .panel-scroll { padding: 12px 11px; }
  .topbar { padding: 0 15px; }
}
@media (max-width: 700px) {
  html, body { min-height: 100%; }
  body { overflow-x: hidden; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { min-height: 100vh; }
  body.embed-mode .app-shell { height: 100%; min-height: 0; }
  .topbar { height: 58px; flex: 0 0 58px; gap: 9px; padding: 0 12px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 29px; height: 29px; }
  .eyebrow { font-size: 7px; margin-bottom: 3px; }
  h1 { font-size: 13px; }
  .topbar-right { gap: 6px; font-size: 8px; }
  .live-dot { width: 6px; height: 6px; }
  .top-divider, .species-label { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow: hidden; }
  .stage-column { flex: 0 0 42dvh; min-height: 255px; gap: 6px; }
  .stage-head { flex: 0 0 36px; padding: 0 2px; }
  .stage-kicker { font-size: 7px; margin-bottom: 2px; }
  .stage-title { font-size: 13px; }
  .clock-chip { min-width: 86px; padding: 4px 7px; grid-template-columns: 14px auto; grid-template-rows: 15px 9px; border-radius: 8px; }
  .clock-icon { font-size: 14px; }
  #clockReadout { font-size: 11px; }
  .clock-sub { font-size: 6px; }
  .canvas-frame { min-height: 0; border-radius: 12px; }
  .canvas-legend { left: 9px; bottom: 8px; gap: 8px; font-size: 6px; }
  .legend-swatch { width: 6px; height: 6px; }
  .canvas-stamp { top: 8px; right: 8px; padding: 5px 6px; font-size: 6px; }
  .caption-row { min-height: 54px; padding: 7px 9px; gap: 8px; border-radius: 9px; }
  .caption-icon { flex-basis: 25px; height: 25px; border-radius: 7px; font-size: 13px; }
  .caption-label { font-size: 6px; margin-bottom: 2px; }
  .caption-copy p { font-size: 8px; line-height: 1.35; }
  .control-column { flex: 1 1 auto; min-height: 0; border-radius: 12px; }
  .panel-scroll { padding: 10px 10px 9px; }
  .section-heading { margin-bottom: 7px; font-size: 7px; }
  .section-note { font-size: 6px; }
  .readout-grid { gap: 5px; }
  .readout-card { min-height: 62px; padding: 7px 8px 6px; border-radius: 8px; }
  .primary-readout { min-height: 70px; }
  .readout-name { font-size: 6px; }
  .readout-unit { font-size: 7px; }
  .readout-value { margin-top: 4px; font-size: 18px; }
  .primary-readout .readout-value { font-size: 23px; }
  .readout-foot { margin-top: 4px; font-size: 6px; }
  .readout-bar { margin-top: 6px; height: 2px; }
  .controls-section, .time-section, .preset-section { margin-top: 10px; padding-top: 9px; }
  .control-group { margin-bottom: 8px; }
  .control-label-row { margin-bottom: 2px; }
  .control-label-row label, .control-label-row output { font-size: 8px; }
  input[type="range"] { height: 12px; }
  input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; }
  input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; }
  .range-ends { font-size: 5px; }
  .day-ticks { font-size: 6px; }
  .cycle-track { margin-top: 5px; height: 4px; }
  .preset-buttons { gap: 5px; }
  .preset-button { min-height: 40px; gap: 6px; padding: 5px 6px; border-radius: 7px; }
  .preset-symbol { flex-basis: 20px; width: 20px; height: 20px; font-size: 14px; }
  .preset-button strong { font-size: 7px; }
  .preset-button small { font-size: 6px; }
  .transport-section { gap: 5px; margin-top: 10px; padding-top: 9px; }
  .transport-button { min-height: 29px; padding: 0 8px; font-size: 8px; }
  .play-button { min-width: 74px; }
  .science-panel { margin-top: 9px; }
  .science-panel summary { min-height: 33px; font-size: 7px; }
  .science-intro, .simplification-note, .disclaimer { font-size: 8px; }
  .equation-block code { font-size: 8px; }
  .panel-footnote { padding-top: 8px; font-size: 5px; }
}
@media (max-width: 380px) {
  .stage-column { flex-basis: 40dvh; }
  .topbar-right .live-label { display: none; }
  .preset-button strong { font-size: 6px; }
  .transport-button { padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
