:root {
  color-scheme: dark;
  --bg: #06111b;
  --panel: #0a1824;
  --panel-2: #0e1e2c;
  --line: rgba(152, 190, 211, .13);
  --line-strong: rgba(152, 190, 211, .22);
  --text: #e8f1f5;
  --muted: #8297a5;
  --soft: #a9bbc5;
  --cyan: #73d6d6;
  --cyan-bright: #a5eeee;
  --gold: #ffbd70;
  --gold-bright: #ffe0a5;
  --green: #73d9b4;
  --red: #e98c7d;
  --radius: 12px;
  --space: 8px;
  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: hidden; font-size: 13px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 45% -20%, rgba(30, 78, 93, .24), transparent 52%), var(--bg); }
.topbar { height: 76px; flex: 0 0 76px; display: grid; grid-template-columns: 230px minmax(260px, 1fr) auto; align-items: center; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(5, 15, 24, .88); position: relative; z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(115,214,214,.42); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: rgba(55, 128, 139, .12); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--cyan); }
.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: .72; }
.brand-copy { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 9px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; color: #88a7b7; }
.brand-sub { color: #5e7b8b; font-size: 8px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; }
.title-lockup { min-width: 0; }
.title-lockup h1 { font-size: 17px; line-height: 1.1; font-weight: 650; margin: 0 0 4px; letter-spacing: -.025em; }
.title-lockup p { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.solver-status { display: flex; align-items: center; gap: 7px; color: #80b5a6; font-size: 9px; font-weight: 800; letter-spacing: .12em; margin-right: 10px; white-space: nowrap; }
.solver-status i, .chip-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(115,217,180,.6); }
.icon-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(19, 39, 52, .62); color: #b5c7d0; padding: 0 10px; font-size: 9px; font-weight: 800; letter-spacing: .09em; cursor: pointer; transition: border-color .18s, background .18s, color .18s; }
.icon-button:hover { border-color: rgba(115,214,214,.55); background: rgba(33, 71, 83, .55); color: white; }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quality-glyph { border: 1px solid rgba(255,189,112,.45); border-radius: 3px; padding: 2px 3px; color: var(--gold); font-size: 8px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 374px; flex: 1 1 auto; min-height: 0; padding: 14px 14px 10px; gap: 12px; }
.scene-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 9px; }
.scene-wrap { position: relative; flex: 1 1 auto; min-height: 420px; overflow: hidden; border-radius: 14px; border: 1px solid rgba(105, 163, 184, .2); background: radial-gradient(ellipse at 48% 50%, #173342, #081622 68%, #050e17); box-shadow: 0 18px 50px rgba(0,0,0,.28), inset 0 0 70px rgba(54, 124, 143, .08); }
#scene-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-topline { position: absolute; z-index: 2; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; pointer-events: none; }
.scene-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(138, 189, 203, .18); border-radius: 6px; background: rgba(5, 17, 27, .62); backdrop-filter: blur(10px); color: #a7c3cd; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.scene-chip-right { color: #8098a5; }
.scene-compass { position: absolute; z-index: 2; right: 18px; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 5px; transform: translateY(-50%); color: rgba(184, 210, 219, .62); font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.scene-compass i { width: 1px; height: 54px; background: linear-gradient(to bottom, transparent, rgba(115,214,214,.65), transparent); position: relative; }
.scene-compass i::before { content: ''; position: absolute; left: -3px; top: 3px; width: 7px; height: 7px; border-top: 1px solid var(--cyan); border-right: 1px solid var(--cyan); transform: rotate(-45deg); }
.scene-annotations { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.world-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 4px; background: rgba(4, 16, 25, .72); border: 1px solid rgba(115,214,214,.25); color: #8dd8d9; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; opacity: 0; transition: opacity .2s; backdrop-filter: blur(6px); }
.world-label.visible { opacity: 1; }
.world-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.world-label-gold { border-color: rgba(255,189,112,.3); color: #f6c27f; }
.world-label-gold i, .world-label-sun i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.world-label-sun { border-color: rgba(255,189,112,.4); color: var(--gold-bright); }
.scene-bottomline { position: absolute; z-index: 2; bottom: 14px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scale-note { display: flex; align-items: center; gap: 8px; color: rgba(168, 195, 206, .68); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.scale-line { width: 26px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px rgba(115,214,214,.7); }
.scene-coordinates { color: rgba(168,195,206,.58); font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.context-loss { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(3, 11, 18, .94); }
.context-loss[hidden] { display: none; }
.context-icon { color: var(--gold); font-size: 28px; margin-bottom: 10px; }
.context-loss h2 { margin: 0 0 7px; font-size: 17px; }
.context-loss p { max-width: 320px; color: var(--muted); line-height: 1.55; font-size: 12px; }
.scene-loader { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #8dbbc5; background: rgba(5, 16, 25, .96); font-size: 9px; font-weight: 800; letter-spacing: .18em; transition: opacity .35s; }
.scene-loader.done { opacity: 0; pointer-events: none; }
.loader-ring { width: 25px; height: 25px; border: 2px solid rgba(115,214,214,.18); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scene-caption-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 7px 2px; min-height: 76px; }
.caption-block { min-width: 0; }
.caption-block p { max-width: 650px; margin: 6px 0 0; color: #9bb0bb; font-size: 11px; line-height: 1.5; }
.caption-metrics { display: flex; gap: 18px; flex: 0 0 auto; }
.caption-metrics div { display: flex; flex-direction: column; gap: 5px; }
.caption-metrics span { color: #6f8795; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.caption-metrics strong { color: var(--gold-bright); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.caption-metrics div:first-child strong { color: var(--cyan-bright); }
.control-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(160deg, rgba(14, 30, 44, .98), rgba(8, 22, 34, .98)); box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.panel-heading { flex: 0 0 auto; padding: 17px 17px 13px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.02em; font-weight: 650; }
.model-tag { padding: 5px 7px; border-radius: 4px; border: 1px solid rgba(115,214,214,.2); color: #7bc7c9; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.panel-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 0 16px 14px; scrollbar-width: thin; scrollbar-color: rgba(111, 150, 169, .3) transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(111,150,169,.3); border-radius: 10px; }
.control-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h3 { margin: 0; color: #d5e2e8; font-size: 11px; font-weight: 700; }
.section-heading > span { color: #627e8c; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 51px; padding: 7px 6px; text-align: left; border: 1px solid var(--line); border-radius: 7px; background: rgba(7, 20, 31, .66); cursor: pointer; transition: .18s; }
.preset-button:hover { border-color: rgba(115,214,214,.42); background: rgba(19, 46, 57, .6); }
.preset-button.active { border-color: rgba(115,214,214,.55); background: linear-gradient(140deg, rgba(47, 103, 111, .3), rgba(14, 37, 48, .7)); box-shadow: inset 0 0 0 1px rgba(115,214,214,.06); }
.preset-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--cyan); background: rgba(115,214,214,.1); font-size: 17px; }
.preset-icon-extreme { color: var(--gold); background: rgba(255,189,112,.1); }
.preset-button b { display: block; color: #c7d8df; font-size: 9px; font-weight: 750; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #718b99; font-size: 8px; white-space: nowrap; }
.slider-control { margin: 0 0 12px; }
.slider-control:last-child { margin-bottom: 0; }
.slider-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.slider-label label { color: #aebfc8; font-size: 10px; font-weight: 600; }
.slider-label em { color: #6f8d9c; font-style: normal; font-weight: 500; margin-left: 3px; }
.slider-label output { color: var(--cyan-bright); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 99px; background: linear-gradient(90deg, rgba(115,214,214,.9), rgba(115,214,214,.16)); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border: 2px solid #c5f4f0; border-radius: 50%; background: #2b7e83; box-shadow: 0 0 0 3px rgba(115,214,214,.13), 0 0 12px rgba(115,214,214,.35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #c5f4f0; border-radius: 50%; background: #2b7e83; box-shadow: 0 0 0 3px rgba(115,214,214,.13); }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #536e7d; font-size: 8px; font-variant-numeric: tabular-nums; }
.readout-section { padding-bottom: 12px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.readout-card { min-width: 0; padding: 9px 9px 8px; border: 1px solid rgba(143,180,196,.12); border-radius: 7px; background: rgba(4, 17, 27, .55); }
.readout-card > span { display: block; color: #6f8997; font-size: 7px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-card strong { display: block; margin: 6px 0 3px; color: var(--cyan-bright); font-size: 16px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readout-card:nth-child(2) strong { color: var(--gold-bright); }
.readout-card small { color: #597382; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.solution-banner { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 9px 10px; border-radius: 7px; border: 1px solid rgba(115,217,180,.2); background: rgba(39, 102, 83, .13); }
.solution-banner.no-solution { border-color: rgba(233,140,125,.22); background: rgba(113, 51, 47, .12); }
.solution-pulse { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(115,217,180,.6); }
.no-solution .solution-pulse { background: var(--red); box-shadow: 0 0 10px rgba(233,140,125,.5); }
.solution-banner div { flex: 1; min-width: 0; }
.solution-banner b { display: block; color: #a9e4d0; font-size: 9px; }
.solution-banner small { display: block; margin-top: 3px; color: #739a91; font-size: 8px; line-height: 1.3; }
.no-solution .solution-banner b, .no-solution b { color: #f1b2a7; }
.no-solution .solution-banner small { color: #b18179; }
.solution-arrow { color: var(--green); font-size: 15px; }
.no-solution .solution-arrow { color: var(--red); }
.validation-card { padding: 10px; border: 1px solid rgba(143,180,196,.13); border-radius: 8px; background: rgba(4, 17, 27, .55); }
.validation-title { display: flex; align-items: center; gap: 9px; }
.validation-symbol { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: rgba(255,189,112,.12); color: var(--gold); font-size: 17px; }
.validation-title b { display: block; font-size: 9px; color: #c9d8df; }
.validation-title small { display: block; margin-top: 3px; color: #76909d; font-size: 8px; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0 8px; }
.validation-values div { min-width: 0; }
.validation-values span, .validation-footer span { display: block; color: #657f8d; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.validation-values strong { display: block; margin-top: 4px; color: #b8d1d9; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.validation-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
.validation-footer strong { margin-left: auto; margin-right: 10px; color: var(--green); font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-pass { padding: 3px 6px; border-radius: 4px; color: #8ce1bd !important; background: rgba(115,217,180,.1); }
.validation-pass.validation-fail { color: #f1aa9f !important; background: rgba(233,140,125,.12); }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 18, 28, .48); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 10px; list-style: none; cursor: pointer; color: #c6d7de; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 7px; border-radius: 6px; color: var(--cyan); background: rgba(115,214,214,.1); font-size: 13px; }
.summary-state { color: #65818e; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.science-panel[open] .summary-state { color: var(--cyan); }
.science-content { padding: 0 11px 12px; color: #8fa6b2; font-size: 9px; line-height: 1.55; }
.science-content h4 { margin: 12px 0 6px; color: #c5d5dc; font-size: 9px; }
.science-content p { margin: 6px 0; }
.science-content ul { margin: 6px 0 8px; padding-left: 16px; }
.science-content li { margin: 4px 0; }
.equation { padding: 8px 9px; border-left: 2px solid rgba(115,214,214,.55); border-radius: 0 5px 5px 0; background: rgba(16, 43, 53, .48); color: #a5e1df; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.65; }
.science-note { color: #d2aa75; font-size: 8px; }
.transport-bar { flex: 0 0 auto; padding: 11px 13px; border-top: 1px solid var(--line); background: rgba(4, 15, 24, .65); }
.transport-buttons { display: flex; gap: 6px; }
.transport-main, .transport-secondary { min-height: 32px; border-radius: 6px; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .1em; transition: .18s; }
.transport-main { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(115,214,214,.38); background: rgba(42, 109, 116, .34); color: #c8f4ef; }
.transport-main:hover { background: rgba(51, 133, 138, .45); }
.transport-main span:first-child { font-size: 13px; }
.transport-secondary { padding: 0 10px; border: 1px solid var(--line-strong); background: rgba(18, 38, 51, .62); color: #9db3bd; }
.transport-secondary:hover { border-color: rgba(115,214,214,.38); color: #e5f3f5; }
.speed-control { display: flex; align-items: center; gap: 4px; margin-top: 9px; }
.speed-control > span { margin-right: auto; color: #617d8a; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.speed-control button { min-width: 32px; height: 22px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #76909d; font-size: 8px; font-weight: 750; cursor: pointer; }
.speed-control button:hover { color: white; }
.speed-control button.active { border-color: rgba(115,214,214,.24); background: rgba(115,214,214,.1); color: var(--cyan-bright); }
.footer-bar { flex: 0 0 24px; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; color: #506a78; font-size: 7px; font-weight: 750; letter-spacing: .12em; border-top: 1px solid rgba(140,177,194,.08); }
.embed .topbar, .embed .footer-bar, .embed .scene-caption-row { display: none; }
.embed .workspace { padding: 0; gap: 0; grid-template-columns: minmax(0,1fr) 340px; }
.embed .scene-wrap { border-radius: 0; border: 0; }
.embed .control-panel { border-radius: 0; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 190px minmax(200px,1fr) auto; gap: 12px; padding: 0 16px; }
  .workspace { grid-template-columns: minmax(0,1fr) 340px; padding: 10px; gap: 9px; }
  .solver-status { display: none; }
}
@media (max-width: 820px) {
  body { overflow: hidden; }
  .app-shell { height: 100svh; min-height: 0; overflow: hidden; }
  .topbar { height: 66px; flex-basis: 66px; grid-template-columns: 1fr auto; padding: 0 12px; }
  .brand-lockup { display: none; }
  .title-lockup h1 { font-size: 15px; }
  .title-lockup p { font-size: 10px; }
  .top-actions { gap: 5px; }
  .icon-button { min-height: 31px; padding: 0 7px; font-size: 8px; }
  .workspace { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: calc(100svh - 92px); overflow: hidden; padding: 8px; gap: 8px; }
  .scene-column { flex: 0 0 auto; min-height: 0; }
  .scene-wrap { flex: none; height: min(38svh, 340px); min-height: 255px; }
  .scene-caption-row { min-height: 60px; padding: 4px 4px 7px; }
  .caption-block p { font-size: 10px; }
  .caption-metrics { gap: 10px; }
  .caption-metrics strong { font-size: 13px; }
  .control-panel { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; }
  .panel-scroll { overflow-y: auto; }
  .transport-bar { position: sticky; bottom: 0; }
  .footer-bar { min-height: 26px; padding: 6px 10px; font-size: 6px; gap: 8px; }
  .footer-bar span:last-child { text-align: right; }
  .embed .workspace { display: flex; height: 100svh; padding: 8px; }
  .embed .scene-wrap { height: 44svh; min-height: 230px; }
  .embed .control-panel { flex: 1 1 auto; min-height: 0; max-height: none; }
}
@media (max-width: 480px) {
  .topbar { height: 60px; flex-basis: 60px; }
  .title-lockup h1 { font-size: 14px; }
  .title-lockup p { font-size: 9px; }
  .icon-button span:not(.quality-glyph) { display: none; }
  .icon-button { width: 32px; padding: 0; }
  .quality-glyph { font-size: 8px; }
  .scene-wrap { height: min(38svh, 315px); min-height: 250px; }
  .scene-chip { padding: 6px 7px; font-size: 7px; }
  .scene-chip-right { display: none; }
  .scene-bottomline { left: 10px; right: 10px; bottom: 10px; }
  .scale-note { font-size: 6px; }
  .scene-coordinates { font-size: 6px; }
  .scene-caption-row { align-items: flex-start; gap: 8px; }
  .caption-block p { max-width: 210px; font-size: 9px; }
  .caption-metrics { flex-direction: column; gap: 7px; }
  .caption-metrics div { gap: 2px; }
  .caption-metrics span { font-size: 6px; }
  .caption-metrics strong { font-size: 11px; }
  .panel-heading { padding: 13px 13px 11px; }
  .panel-scroll { padding: 0 13px 12px; }
  .preset-grid { gap: 5px; }
  .preset-button { gap: 4px; padding: 6px 4px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .preset-icon { flex-basis: 18px; width: 18px; height: 18px; font-size: 14px; }
  .footer-bar { align-items: flex-start; line-height: 1.3; }
  .footer-bar span:first-child { max-width: 62%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
