:root {
  color-scheme: dark;
  --bg: #0b121a;
  --panel: #111b25;
  --panel-2: #15212c;
  --line: #263541;
  --line-soft: rgba(139, 163, 181, .14);
  --text: #e8edf1;
  --muted: #93a3af;
  --dim: #687b89;
  --accent: #e5a06f;
  --teal: #7cd5d2;
  --amber: #ff9b55;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 48% 24%, rgba(31, 48, 61, .28), transparent 56%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(11, 18, 26, .92); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid #415361; border-radius: 8px; transform: skewY(-7deg); background: linear-gradient(145deg, #273a46, #101a22); }
.brand-mark span { display: block; width: 4px; background: linear-gradient(#e8b083, #9b6445); border-radius: 2px; transform: skewY(7deg); }
.brand-mark span:nth-child(1) { height: 10px; }.brand-mark span:nth-child(2) { height: 17px; }.brand-mark span:nth-child(3) { height: 13px; }
.brand-name { font-size: 11px; letter-spacing: .17em; font-weight: 800; color: #dfe8ed; }
.brand-name span { color: #718493; font-weight: 600; margin-left: 8px; letter-spacing: .12em; }
.brand-subtitle { margin-top: 4px; color: #778a98; font-size: 8px; letter-spacing: .18em; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topic-tag, .version-tag { font-size: 9px; letter-spacing: .14em; color: #a9b8c3; font-weight: 700; }
.topic-tag { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #344752; border-radius: 20px; }
.topic-tag i { width: 6px; height: 6px; border-radius: 50%; background: #dca276; box-shadow: 0 0 9px rgba(220, 162, 118, .7); }
.version-tag { color: #657887; }
.workspace { width: 100%; max-width: 1920px; flex: 1; min-height: 0; margin: 0 auto; padding: 14px; display: grid; grid-template-columns: 268px minmax(420px, 1fr) 284px; gap: 12px; }
.panel { background: linear-gradient(180deg, rgba(20, 31, 42, .98), rgba(15, 25, 35, .98)); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.controls-panel, .data-panel { padding: 16px 15px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #344753 transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 15px; }
.eyebrow, .section-label { font-size: 8px; letter-spacing: .17em; font-weight: 800; color: #8094a3; }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.025em; font-weight: 650; }
.panel-index { color: #536877; font-size: 10px; font-weight: 700; letter-spacing: .1em; padding-top: 2px; }
.preset-block { margin-bottom: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.preset-block > .section-label { display: block; margin-bottom: 8px; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 9px; text-align: left; border: 1px solid #2b3b47; border-radius: 8px; background: #121e28; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: #647988; background: #182632; }
.preset-button.active { border-color: #a97856; background: linear-gradient(90deg, rgba(169, 120, 86, .16), rgba(21, 33, 44, .9)); }
.preset-button:active { transform: translateY(1px); }
.preset-button b { display: block; font-size: 10px; font-weight: 700; }
.preset-button small { display: block; margin-top: 2px; color: #7f929f; font-size: 8px; }
.preset-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 6px; background: #26343e; color: #e5a06f; font-size: 17px; }
.quench-icon { color: #7cd5d2; }.thick-icon { color: #c5a58d; }
.control-group { margin: 0 0 13px; }
.control-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-heading label { font-size: 10px; font-weight: 600; color: #d0dbe1; }
.control-heading output { font-size: 9px; color: #e8b58f; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 4px; border-radius: 8px; background: linear-gradient(90deg, #9b7358, #334b59); outline: none; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #e4ad83; border: 2px solid #202e39; box-shadow: 0 0 0 1px #d69c72; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #e4ad83; border: 2px solid #202e39; box-shadow: 0 0 0 1px #d69c72; }
input[type="range"]:focus-visible { outline: 2px solid var(--teal); outline-offset: 5px; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #647886; font-size: 8px; }
.last-control { margin-bottom: 10px; }
.control-footnote { display: flex; align-items: center; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line-soft); color: #778a98; font-size: 8px; line-height: 1.45; }
.tiny-dot { width: 5px; height: 5px; background: #d89c70; border-radius: 50%; flex: 0 0 5px; }
.stage-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.stage-topline { display: flex; align-items: flex-start; justify-content: space-between; padding: 5px 4px 2px; }
.stage-title-group h1 { margin: 4px 0 1px; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.08; letter-spacing: -.045em; font-weight: 690; }
.stage-title-group p { margin: 0; color: #8b9ca8; font-size: 11px; }
.run-state { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; padding: 6px 9px; border: 1px solid #28534e; border-radius: 20px; color: #86c8b8; background: rgba(25, 66, 59, .22); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.run-state span { width: 6px; height: 6px; border-radius: 50%; background: #65c8a5; box-shadow: 0 0 9px rgba(101, 200, 165, .8); }
.run-state b { font-size: inherit; font-weight: inherit; }
.run-state.is-paused { color: #d6ae82; border-color: #68513d; background: rgba(82, 57, 37, .22); }
.run-state.is-paused span { background: #d6ae82; box-shadow: none; }
.stage-wrap { flex: 1; min-height: 470px; display: flex; flex-direction: column; border: 1px solid #2b3b47; border-radius: 12px; overflow: hidden; background: #0a1118; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.scene-host { position: relative; flex: 1; min-height: 390px; overflow: hidden; background: radial-gradient(ellipse at 52% 44%, #1a2a36 0%, #0a121a 68%); }
.scene-host canvas { width: 100%; height: 100%; display: block; outline: none; }
.scene-label { position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; color: rgba(207, 220, 228, .78); font-size: 8px; font-weight: 800; letter-spacing: .13em; pointer-events: none; text-shadow: 0 1px 5px #081018; }
.label-surface { top: 15%; left: 7%; }.label-front { top: 61%; left: 9%; color: #e6ae81; }.label-core { bottom: 12%; right: 7%; color: #c78b65; }
.label-line { width: 19px; height: 1px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.scene-hint { position: absolute; bottom: 12px; left: 14px; z-index: 2; color: #718492; font-size: 8px; letter-spacing: .1em; pointer-events: none; }
.scene-hint span { margin: 0 5px; color: #435561; }
.mouse-icon { font-size: 13px; vertical-align: -1px; }
.context-notice, .webgl-fallback { position: absolute; z-index: 5; inset: auto 18px 50px; padding: 12px 14px; border: 1px solid #8a684d; border-radius: 8px; background: rgba(24, 28, 32, .95); color: #f0c29c; text-align: center; font-size: 11px; }
.webgl-fallback { inset: 20% 10%; display: grid; place-items: center; color: #f2d0b0; }
.stage-bottom-bar { min-height: 62px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #293944; background: #111c26; }
.time-cluster { min-width: 88px; }
.time-cluster .eyebrow { display: block; font-size: 7px; }
.time-cluster strong { display: block; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; color: #e5b18b; }
.transport-controls, .view-controls { display: flex; align-items: center; gap: 6px; }
.transport-main, .icon-button, .quality-button { min-height: 32px; border: 1px solid #354855; border-radius: 7px; background: #182631; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.transport-main { display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; font-size: 10px; font-weight: 700; color: #e9d1be; }
.transport-main:hover, .icon-button:hover, .quality-button:hover { background: #233441; border-color: #607684; }
#play-icon { color: #e8a879; font-size: 11px; }
.icon-button { min-width: 32px; padding: 0 8px; color: #b4c2ca; font-size: 11px; }
#step-button { font-size: 9px; }
.transport-divider { width: 1px; height: 24px; margin: 0 3px; background: #31414c; }
.speed-control { display: flex; align-items: center; gap: 7px; color: #8295a2; font-size: 8px; letter-spacing: .12em; }
.speed-control input { width: 74px; }
.speed-control output { min-width: 34px; color: #e4b18d; font-size: 9px; font-weight: 700; letter-spacing: 0; }
.quality-button { padding: 0 9px; font-size: 8px; color: #aebec7; }
.screenshot-button { color: #e4b18d; font-size: 15px; }
.stage-legend { min-height: 22px; padding: 0 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: #738694; font-size: 7px; letter-spacing: .1em; font-weight: 700; }
.legend-swatch { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.legend-swatch.basalt { background: #56636c; }.legend-swatch.crack { background: #ff9b55; box-shadow: 0 0 5px #ff9b55; }.legend-swatch.hot { background: #783c29; }
.live-note { margin-left: auto; color: #8d9da8; font-size: 8px; letter-spacing: .03em; font-weight: 500; text-transform: none; }
.data-heading { margin-bottom: 13px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 72px; padding: 10px 9px 8px; border: 1px solid #2b3b47; border-radius: 8px; background: linear-gradient(145deg, rgba(29, 43, 54, .92), rgba(17, 28, 38, .95)); }
.readout-label { display: block; color: #8295a2; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.readout-card strong { display: block; margin: 7px 0 3px; font-size: 19px; font-weight: 650; letter-spacing: -.04em; color: #e7b38f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card small { color: #607482; font-size: 7px; letter-spacing: .09em; }
.secondary-readouts { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 11px; border-bottom: 1px solid var(--line-soft); }
.secondary-readouts div { display: flex; flex-direction: column; gap: 4px; }
.secondary-readouts span { color: #7c8e9b; font-size: 8px; }
.secondary-readouts strong { color: #d8e0e5; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stress-meter { margin-top: 10px; padding: 9px 10px 8px; border: 1px solid #2b3b47; border-radius: 8px; background: rgba(17, 28, 38, .75); }
.stress-meter-heading { display: flex; align-items: center; justify-content: space-between; color: #8295a2; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.stress-meter-heading strong { color: #e6b18a; font-size: 9px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stress-track { height: 5px; margin-top: 8px; border-radius: 8px; background: #263541; overflow: hidden; }
.stress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7abbb4, #e5a06f, #ff8c4e); transition: width .2s ease; }
.stress-track i.over-threshold { box-shadow: 0 0 8px rgba(255, 140, 78, .55); }
.stress-meter-foot { margin-top: 6px; color: #657987; font-size: 7px; }
.profile-card { margin-top: 12px; padding: 10px 10px 8px; border: 1px solid #2b3b47; border-radius: 8px; background: rgba(17, 28, 38, .8); }
.card-title-row, .validation-title { display: flex; justify-content: space-between; align-items: center; }
.unit-label { color: #617583; font-size: 7px; letter-spacing: .1em; }
#thermal-profile { display: block; width: 100%; height: 104px; margin-top: 6px; overflow: visible; }
.profile-legend { display: flex; gap: 15px; color: #778b99; font-size: 8px; }
.profile-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.temp-dot { background: #f0a16a; }.front-dot { background: #7cd5d2; }
.validation-card { margin-top: 10px; padding: 11px 10px 9px; border: 1px solid #3c4a52; border-radius: 8px; background: linear-gradient(145deg, rgba(35, 44, 49, .72), rgba(17, 28, 38, .95)); }
.textbook-tag { padding: 4px 6px; border-radius: 4px; background: rgba(113, 164, 157, .14); color: #8dc8bd; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.validation-card > p { margin: 8px 0 10px; color: #8b9ca7; font-size: 8px; line-height: 1.4; }
.validation-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(130, 151, 163, .1); color: #8799a5; font-size: 8px; }
.validation-row strong { color: #dce5e9; font-size: 9px; font-variant-numeric: tabular-nums; }
.difference-row strong { color: #8dd0c2; }
.validation-depth { margin-top: 6px; color: #617683; font-size: 7px; }
.science-panel { margin-top: 10px; border: 1px solid #2c3c48; border-radius: 8px; background: rgba(16, 26, 36, .88); }
.science-panel summary { min-height: 40px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; color: #d8e1e6; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; align-items: center; gap: 8px; }
.science-icon { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 5px; background: #273944; color: #e2aa7d; font-size: 12px; }
.chevron { color: #8295a2; font-size: 14px; transition: transform .16s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line-soft); }
.science-content h3 { margin: 12px 0 6px; color: #d8e2e8; font-size: 9px; }
.science-content p { margin: 6px 0 8px; color: #8799a5; font-size: 8px; line-height: 1.55; }
.equation { padding: 8px 7px; border: 1px solid #2c3c47; border-radius: 5px; background: #0d1720; color: #e9b58e; font-family: Georgia, "Times New Roman", serif; font-size: 12px; text-align: center; letter-spacing: .01em; }
.assumption-list { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.assumption-list > span { color: #a6b6c0; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.assumption-list ul { padding-left: 15px; margin: 7px 0 0; color: #8294a0; font-size: 8px; line-height: 1.55; }
.assumption-list li { margin: 3px 0; }
.model-label { margin-top: 10px; color: #718692; font-size: 7px; font-weight: 800; letter-spacing: .1em; line-height: 1.45; }
.footerbar { min-height: 30px; flex: 0 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-top: 1px solid rgba(44, 61, 73, .7); color: #5f7380; font-size: 8px; }
.footerbar b { color: #8c9da7; margin: 0 4px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.embed-mode .topbar, .embed-mode .footerbar, .embed-mode .data-panel { display: none; }
.embed-mode .workspace { display: block; padding: 0; height: 100vh; }
.embed-mode .controls-panel { position: absolute; z-index: 4; left: 12px; top: 12px; width: 245px; max-height: calc(100vh - 24px); opacity: .97; }
.embed-mode .stage-panel { height: 100%; gap: 0; }
.embed-mode .stage-topline, .embed-mode .stage-legend { display: none; }
.embed-mode .stage-wrap { height: 100%; border: 0; border-radius: 0; }
.embed-mode .scene-host { min-height: 0; }
.embed-mode .stage-bottom-bar { position: absolute; z-index: 3; bottom: 10px; left: 270px; right: 10px; border: 1px solid #354753; border-radius: 9px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 240px minmax(360px, 1fr) 250px; padding: 10px; gap: 9px; }
  .controls-panel, .data-panel { padding: 13px 11px; }
  .stage-bottom-bar { gap: 6px; padding: 8px; }
  .speed-control input { width: 58px; }
  .quality-button { display: none; }
}
@media (max-width: 900px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .workspace { display: flex; flex-direction: column; padding: 10px; gap: 10px; }
  .stage-panel { order: 0; }
  .controls-panel { order: 1; }
  .data-panel { order: 2; }
  .stage-wrap { min-height: 0; }
  .scene-host { min-height: 430px; height: 52vh; }
  .controls-panel, .data-panel { overflow: visible; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-button { padding: 7px 5px; gap: 5px; }
  .preset-icon { width: 20px; height: 20px; flex-basis: 20px; }
  .preset-button b { font-size: 9px; }.preset-button small { font-size: 7px; }
  .controls-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .controls-panel .panel-heading, .controls-panel .preset-block, .controls-panel .control-footnote { grid-column: 1 / -1; }
  .footerbar { padding: 7px 12px; min-height: 34px; flex-basis: auto; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .topbar-right { gap: 6px; }.version-tag { display: none; }
  .brand-name { font-size: 10px; }.brand-name span { display: none; }
  .workspace { padding: 8px; gap: 8px; }
  .stage-title-group h1 { font-size: 21px; }
  .stage-title-group p { font-size: 10px; }
  .scene-host { height: 48vh; min-height: 330px; }
  .stage-bottom-bar { flex-wrap: wrap; justify-content: space-between; min-height: 94px; }
  .time-cluster { min-width: 70px; }
  .transport-controls { order: 3; width: 100%; justify-content: space-between; }
  .view-controls { margin-left: auto; }
  .speed-control { margin-left: auto; }
  .speed-control input { width: 78px; }
  .stage-legend { gap: 9px; font-size: 6px; }
  .live-note { width: 100%; margin-left: 0; }
  .controls-panel { display: block; padding: 14px 12px; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-button { flex-direction: column; align-items: flex-start; min-height: 62px; padding: 7px; }
  .preset-button small { display: none; }
  .control-group { margin-bottom: 15px; }
  .readout-card { min-height: 70px; }
  .footerbar { font-size: 7px; }
  .label-surface { top: 9%; left: 5%; }.label-front { top: 60%; left: 5%; }.label-core { bottom: 10%; right: 4%; }
  .scene-label { font-size: 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; }
}
