:root {
  color-scheme: dark;
  --bg: #101619;
  --panel: #172126;
  --panel-2: #1c292f;
  --line: #2a3a40;
  --muted: #8b9ba1;
  --text: #edf2ef;
  --soft: #c1ccca;
  --accent: #e7ad72;
  --accent-dim: rgba(231,173,114,.13);
  --green: var(--accent);
  --danger: var(--accent);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { background: var(--bg); min-width: 320px; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 14% 0%, #1b292d 0%, var(--bg) 48%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1480px, 100%); margin: 0 auto; padding: 0 24px 16px; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(155,178,180,.13); }
.brand-lockup { display: flex; align-items: center; gap: 8px; color: #dce5e1; font-size: 10px; letter-spacing: .15em; font-weight: 800; }
.brand-lockup i { color: var(--muted); font-style: normal; font-weight: 500; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--accent); color: var(--accent); border-radius: 7px; font-size: 14px; letter-spacing: 0; }
.top-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.live-dot, .tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(231,173,114,.35); display: inline-block; }
.seed-label { padding: 5px 8px; border: 1px solid var(--line); border-radius: 20px; margin-left: 8px; color: #a8b5b3; }
.layout { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(330px, .83fr); gap: 24px; padding-top: 24px; align-items: start; }
.visual-column { min-width: 0; }
.intro-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 0 0 16px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.eyebrow span { color: #607177; padding: 0 4px; }
h1 { margin: 5px 0 3px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.045em; line-height: 1.08; font-weight: 650; }
.subtitle { color: #9caaa9; margin: 0; font-size: 12px; }
.model-tag { border: 1px solid var(--line); border-radius: 30px; padding: 7px 10px; color: #9eaeac; font-size: 8px; letter-spacing: .13em; white-space: nowrap; margin-bottom: 3px; }
.tag-dot { width: 5px; height: 5px; margin-right: 6px; vertical-align: 1px; }
.stage-wrap { animation: stageIn .85s cubic-bezier(.2,.7,.2,1) both; position: relative; overflow: hidden; border: 1px solid #2a3b40; border-radius: var(--radius); background: #121c20; box-shadow: 0 18px 46px rgba(0,0,0,.22); }
#scene { width: 100%; height: clamp(350px, 48vh, 490px); display: block; touch-action: pan-y; }
.stage-footer { min-height: 34px; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(18,28,32,.94); border-top: 1px solid rgba(140,164,165,.12); color: #b5c0bd; font-size: 10px; }
.stage-scale { color: #718188; font-size: 8px; letter-spacing: .12em; white-space: nowrap; }
.transport-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.transport-controls { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.primary-btn, .icon-btn, .experiment-btn, .quality-btn { border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.primary-btn:hover, .icon-btn:hover, .experiment-btn:hover, .quality-btn:hover { border-color: rgba(231,173,114,.65); }
.primary-btn { background: var(--accent); color: #1b211f; font-weight: 800; padding: 9px 13px; border-color: var(--accent); font-size: 11px; }
.primary-btn:hover { background: #f0bc85; transform: translateY(-1px); }
.play-icon { font-size: 9px; margin-right: 5px; }
.icon-btn { background: #1a272c; color: #bdc9c6; padding: 8px 11px; font-size: 10px; }
.cooling-track { min-width: 130px; flex: 1; max-width: 300px; }
.track-labels { display: flex; justify-content: space-between; color: #77878b; font-size: 8px; letter-spacing: .1em; margin-bottom: 6px; }
#temp-label { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 0; }
.track { height: 4px; border-radius: 10px; background: #29383e; overflow: hidden; }
#track-fill { width: 100%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .12s linear; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.readout { background: #172126; border: 1px solid #28373d; border-radius: 11px; padding: 16px 12px 8px; min-width: 0; }
.readout-label { color: #8d9da0; font-size: 8px; letter-spacing: .11em; font-weight: 750; white-space: nowrap; }
.readout-label span { color: #c0ccc8; margin-left: 3px; font-size: 9px; letter-spacing: 0; }
.readout-value { font-size: clamp(17px, 2.1vw, 23px); font-weight: 650; letter-spacing: -.04em; margin-top: 8px; color: #edf1ed; white-space: nowrap; }
.readout-note { font-size: 9px; color: #819195; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checks-panel { margin-top: 16px; border: 1px solid #28383e; border-radius: 12px; background: rgba(23,33,38,.82); padding: 16px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.section-heading h2, .panel-top h2 { font-size: 16px; margin: 1px 0 0; letter-spacing: -.025em; font-weight: 650; }
.check-stamp { color: var(--green); border: 1px solid rgba(231,173,114,.23); border-radius: 20px; padding: 5px 8px; font-size: 8px; letter-spacing: .12em; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid rgba(140,164,165,.1); }
.check-icon { color: var(--green); font-size: 12px; }
.check-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.check-copy strong { font-size: 10px; font-weight: 650; color: #dbe3df; }
.check-copy small { color: #839397; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-result { color: var(--green); font-variant-numeric: tabular-nums; font-size: 10px; font-weight: 700; white-space: nowrap; }
.check-footnote { color: #728287; font-size: 9px; margin: 6px 0 0; line-height: 1.5; }
.control-panel { min-width: 0; border: 1px solid #2a3a40; border-radius: 14px; background: linear-gradient(160deg, rgba(27,40,45,.98), rgba(20,30,34,.98)); padding: 16px; box-shadow: 0 18px 44px rgba(0,0,0,.16); }
.panel-top { display: flex; align-items: center; justify-content: space-between; }
.panel-status { color: #93a4a3; font-size: 8px; letter-spacing: .11em; white-space: nowrap; }
.panel-status .live-dot { width: 5px; height: 5px; margin-right: 5px; }
.panel-intro { color: #98a8a7; font-size: 11px; line-height: 1.55; margin: 8px 0 16px; max-width: 320px; }
.control-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #aebbb8; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.mini-hint { color: #718287; font-size: 7px; font-weight: 600; letter-spacing: .09em; }
.preset-block { padding-bottom: 16px; border-bottom: 1px solid rgba(140,164,165,.12); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-btn { display: flex; align-items: center; text-align: left; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid #304147; background: #172328; border-radius: 9px; cursor: pointer; }
.preset-btn:hover { border-color: #6c6254; }
.preset-btn.active { border-color: rgba(231,173,114,.75); background: rgba(231,173,114,.08); }
.preset-btn b { display: block; color: #dce4df; font-size: 10px; font-weight: 650; }
.preset-btn small { display: block; color: #829296; font-size: 8px; margin-top: 2px; }
.preset-swatch { width: 9px; height: 26px; border-radius: 4px; flex: 0 0 auto; background: #879694; }
.swatch-craze { background: linear-gradient(180deg,#e7ad72,#b77d50); }
.swatch-compress { background: linear-gradient(180deg,#8d9a99,#58696b); }
.swatch-fail { background: linear-gradient(180deg,#e7ad72,#80573a); }
.controls-block { padding: 16px 0; }
.control-list { display: flex; flex-direction: column; gap: 16px; }
.control-item { min-width: 0; }
.control-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.control-line label { color: #d1dad6; font-size: 10px; font-weight: 550; }
.control-value { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-help { display: block; color: #75868a; font-size: 8px; margin-top: 3px; line-height: 1.3; }
input[type="range"] { width: 100%; height: 13px; margin: 0; appearance: none; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #405157; }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #405157; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; background: var(--accent); border: 2px solid #f6d6b2; box-shadow: 0 0 0 3px rgba(231,173,114,.13); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #f6d6b2; box-shadow: 0 0 0 3px rgba(231,173,114,.13); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.experiment-card { border: 1px solid rgba(231,173,114,.27); background: linear-gradient(145deg, rgba(231,173,114,.09), rgba(231,173,114,.025)); border-radius: 11px; padding: 16px; }
.experiment-top { display: flex; gap: 9px; align-items: center; }
.experiment-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-size: 18px; }
.experiment-top h3 { margin: 1px 0 0; font-size: 12px; font-weight: 650; }
.experiment-card p { color: #9aa9a6; font-size: 9px; line-height: 1.5; margin: 8px 0 9px; }
.experiment-btn { width: 100%; background: #e7ad72; border-color: #e7ad72; color: #1b211f; font-size: 10px; font-weight: 800; padding: 9px 10px; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.experiment-btn:hover { background: #f0bc85; }
.experiment-result { color: #b8c4bf; font-size: 9px; line-height: 1.5; padding-top: 8px; min-height: 28px; }
.panel-bottom { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.quality-btn { background: #1b292e; padding: 6px 8px; color: #87989a; font-size: 8px; letter-spacing: .1em; }
.quality-btn b { color: var(--accent); margin-left: 3px; }
#quality-note { color: #738489; font-size: 8px; flex: 1; }
.model-label { color: #75858a; font-size: 7px; letter-spacing: .09em; }
.science-section { margin-top: 24px; border: 1px solid #293a40; border-radius: 12px; background: #151f23; overflow: hidden; }
.science-section details > summary { display: flex; justify-content: space-between; align-items: center; padding: 16px; cursor: pointer; list-style: none; color: #dce4df; font-size: 12px; font-weight: 700; }
.science-section details > summary::-webkit-details-marker { display: none; }
.science-symbol { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 7px; border-radius: 7px; color: var(--accent); background: var(--accent-dim); font-size: 16px; vertical-align: middle; }
.summary-hint { color: #74858a; font-size: 8px; letter-spacing: .13em; font-weight: 600; }
.summary-hint b { color: var(--accent); font-size: 13px; margin-left: 8px; }
.science-content { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; padding: 0 16px 16px; }
.science-card { padding: 13px; border-radius: 9px; background: #1a272c; border: 1px solid #2b3b40; min-width: 0; }
.science-card h3 { font-size: 12px; margin: 5px 0 7px; }
.science-card p, .science-card li { color: #9aa9a7; font-size: 9px; line-height: 1.55; }
.science-card p { margin: 6px 0; }
.science-card ul { padding-left: 15px; margin: 7px 0; }
.science-card li { margin-bottom: 4px; }
.equation { color: #f0c18f; background: rgba(231,173,114,.07); border: 1px solid rgba(231,173,114,.13); border-radius: 6px; padding: 7px; margin: 8px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.5; }
.not-affiliated { color: #75858a !important; border-top: 1px solid #2b3b40; padding-top: 7px; }
.footer { display: flex; justify-content: space-between; padding: 13px 2px 0; color: #5f7076; font-size: 7px; letter-spacing: .13em; }
@keyframes stageIn { from { opacity: 0; transform: translateY(9px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; overflow: auto; overscroll-behavior: contain; padding-bottom: 12px; }
body.embed-mode .topbar { display: none; }
body.embed-mode .layout { padding-top: 12px; }
@media (max-width: 980px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .layout { grid-template-columns: minmax(0,1fr) minmax(300px,.78fr); gap: 16px; }
  .control-panel { padding: 14px; }
  .readout { padding: 9px; }
  .readout-label { font-size: 7px; }
  .science-content { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .topbar { height: 48px; }
  .top-meta { font-size: 7px; }
  .seed-label { display: none; }
  .layout { grid-template-columns: minmax(0,1fr); gap: 16px; padding-top: 16px; }
  .intro-row { align-items: start; }
  h1 { font-size: 27px; }
  .subtitle { font-size: 11px; }
  .model-tag { display: none; }
  #scene { height: clamp(285px, 40vh, 350px); }
  .stage-footer { font-size: 9px; padding: 7px 10px; }
  .stage-scale { font-size: 7px; }
  .transport-row { padding: 10px 0 12px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout { padding: 10px 11px; }
  .readout-label { font-size: 8px; }
  .readout-value { font-size: 20px; }
  .control-panel { padding: 15px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 15px; row-gap: 14px; }
  .science-content { grid-template-columns: 1fr 1fr; }
  .footer { padding-bottom: 4px; }
}
@media (max-width: 420px) {
  .top-meta { display: none; }
  .intro-row { margin-bottom: 11px; }
  h1 { font-size: 25px; }
  #scene { height: 300px; }
  .stage-footer { min-height: 32px; }
  .stage-scale { font-size: 6px; }
  .transport-row { gap: 8px; }
  .transport-controls { gap: 5px; }
  .primary-btn { padding: 9px 10px; font-size: 10px; }
  .icon-btn { padding: 8px 9px; font-size: 9px; }
  .cooling-track { min-width: 92px; }
  .track-labels { font-size: 7px; }
  .check-copy small { font-size: 8px; }
  .check-footnote { font-size: 8px; }
  .science-section details > summary { padding: 16px; }
  .summary-hint { font-size: 6px; letter-spacing: .08em; }
  .science-content { grid-template-columns: 1fr; padding: 0 8px 8px; }
}
