:root {
  color-scheme: dark;
  --bg: #07111b;
  --panel: #0d1925;
  --panel-2: #101f2d;
  --line: rgba(157, 184, 204, .13);
  --line-strong: rgba(157, 184, 204, .22);
  --text: #edf4f7;
  --muted: #8295a5;
  --soft: #a9bac5;
  --cyan: #68d6d3;
  --amber: #d7a36b;
  --slate: #8b9eac;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; background-image: radial-gradient(ellipse at 14% 0%, rgba(32, 83, 98, .15), transparent 36%), linear-gradient(145deg, #08131e, #060d15 72%); }
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 { max-width: 1720px; margin: 0 auto; padding: 0 28px 16px; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(104,214,211,.55); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-7deg); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--cyan); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .5; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .72; }
.eyebrow, .kicker, .section-label, .scene-scale, .hud-label, .readout-label, .equation-label, .specimen-id span, .panel-foot, .global-footer, .transport-hint, .transport-button, .play-button, .speed-control > span, .seed-tag, .live-pill, .scene-caption b { font-size: 9px; letter-spacing: .15em; font-weight: 750; }
.eyebrow { color: #d8e3e8; }
.eyebrow span { color: #4d7d83; padding: 0 4px; }
.brand-sub { margin-top: 4px; font-size: 8px; color: #718796; letter-spacing: .22em; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.live-pill { display: flex; align-items: center; gap: 8px; color: #a6c7c7; letter-spacing: .12em; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(104,214,211,.7); }
.seed-tag { color: #718696; }
.seed-tag b { color: #c5d2d8; font-size: 10px; margin-left: 5px; letter-spacing: .08em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; padding-top: 24px; align-items: start; }
.visual-column { min-width: 0; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 2px 16px; }
.kicker { color: #7d9da6; letter-spacing: .19em; }
.kicker span { color: #45666f; padding: 0 4px; }
h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.05; margin: 8px 0 7px; font-weight: 620; letter-spacing: -.045em; }
.subtitle { margin: 0; color: #91a5b1; font-size: 12px; line-height: 1.5; }
.specimen-id { min-width: 124px; text-align: right; padding-bottom: 2px; }
.specimen-id span { display: block; color: #69818f; font-size: 8px; }
.specimen-id b { display: block; color: #c3d1d8; font-size: 16px; font-weight: 650; letter-spacing: .05em; margin: 3px 0; }
.specimen-id small { color: #607887; font-size: 7px; letter-spacing: .14em; }
.scene-card { border: 1px solid var(--line-strong); border-radius: var(--radius); background: #0a1621; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.scene-topline { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); background: rgba(15, 29, 42, .72); }
.scene-legend { display: flex; align-items: center; gap: 7px; color: #7d929f; font-size: 8px; letter-spacing: .09em; font-weight: 700; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 7px; }
.legend-dot:first-child { margin-left: 0; }
.legend-dot.cyan { background: var(--cyan); box-shadow: 0 0 7px rgba(104,214,211,.6); }
.legend-dot.amber { background: var(--amber); }
.legend-dot.slate { background: var(--slate); }
.scene-scale { color: #6e8290; font-size: 8px; }
.scene-scale b { color: #b8c8d1; margin-left: 6px; }
.scene-stage { position: relative; height: clamp(380px, 43vw, 570px); overflow: hidden; background: radial-gradient(ellipse at 52% 48%, #142633 0%, #0c1b28 48%, #08131e 100%); }
#scene { width: 100%; height: 100%; display: block; touch-action: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 44%, rgba(3,9,15,.24) 100%), linear-gradient(180deg, rgba(4,10,17,.12), transparent 24%, transparent 72%, rgba(4,10,17,.22)); }
.annotation-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.annotation { position: absolute; min-width: 118px; color: #cbd8dd; opacity: .9; transition: opacity .2s; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.annotation b { display: block; font-size: 8px; letter-spacing: .16em; font-weight: 800; }
.annotation small { display: block; margin-top: 3px; color: #8fa3ad; font-size: 9px; }
.ann-line { display: block; width: 28px; height: 1px; margin-bottom: 6px; background: var(--cyan); box-shadow: 0 0 6px rgba(104,214,211,.4); }
.ann-rind .ann-line { background: var(--amber); }
.ann-core .ann-line { background: #9baab3; }
.scene-hud { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid rgba(165,192,205,.12); background: rgba(5,14,22,.58); backdrop-filter: blur(7px); border-radius: 9px; pointer-events: none; }
.hud-top-left { top: 15px; left: 15px; }
.hud-bottom-left { bottom: 15px; left: 15px; }
.hud-bottom-right { bottom: 15px; right: 15px; text-align: right; }
.hud-label { color: #78919f; font-size: 7px; letter-spacing: .17em; }
.scene-hud b { font-size: 19px; line-height: 1.1; font-weight: 620; letter-spacing: -.03em; color: #e6eff2; font-variant-numeric: tabular-nums; }
.scene-hud small { color: #6f8592; font-size: 7px; letter-spacing: .13em; }
.context-note { position: absolute; z-index: 2; top: 17px; right: 16px; color: #6f8592; font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.context-note span { color: #3e6973; padding: 0 5px; }
.context-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); margin-right: 6px; }
.webgl-error { position: absolute; inset: 0; z-index: 5; background: rgba(4,11,17,.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; color: #dce7eb; }
.webgl-error[hidden] { display: none; }
.webgl-error span { color: #91a5b1; font-size: 12px; }
.scene-footer { min-height: 59px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 14px 10px; border-top: 1px solid var(--line); background: rgba(10,22,33,.9); }
.scene-caption { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.scene-caption b { color: #a7bbc4; font-size: 8px; }
.scene-caption span { color: #748a97; font-size: 10px; line-height: 1.35; }
.scene-actions { display: flex; gap: 7px; flex-shrink: 0; }
.icon-button { width: 34px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: #102130; color: #a7bac4; cursor: pointer; font-size: 17px; transition: .18s ease; }
.icon-button:hover { border-color: rgba(104,214,211,.45); color: var(--cyan); background: #132b38; }
#qualityLabel { font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.transport-bar { margin-top: 12px; min-height: 56px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,25,37,.92); }
.transport-main { display: flex; align-items: center; gap: 7px; }
.play-button { display: flex; align-items: center; gap: 9px; border: 1px solid rgba(104,214,211,.42); background: rgba(46,113,116,.2); color: #b8eeea; border-radius: 8px; padding: 0 13px; height: 36px; cursor: pointer; font-size: 9px; letter-spacing: .14em; }
.play-button:hover { background: rgba(46,113,116,.34); }
.play-icon { font-size: 14px; line-height: 1; }
.transport-button { height: 36px; padding: 0 11px; border: 1px solid var(--line); background: #101f2c; border-radius: 8px; color: #9cafb9; cursor: pointer; font-size: 8px; letter-spacing: .13em; }
.transport-button:hover { color: #e0eaee; border-color: var(--line-strong); }
.transport-button span { color: #6e8794; font-size: 7px; margin-left: 4px; }
.speed-control { display: flex; align-items: center; gap: 4px; }
.speed-control > span { color: #6d8592; margin-right: 5px; font-size: 8px; }
.speed-control button { height: 29px; min-width: 31px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #8095a1; font-size: 9px; cursor: pointer; }
.speed-control button:hover { color: #dbe6eb; }
.speed-control button.selected { color: var(--cyan); border-color: rgba(104,214,211,.25); background: rgba(104,214,211,.09); }
.transport-hint { color: #526a78; font-size: 7px; letter-spacing: .1em; white-space: nowrap; }
.transport-hint span { color: #8296a2; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.readout-card { padding: 12px 13px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,25,37,.82); min-width: 0; }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #718795; font-size: 7px; letter-spacing: .13em; white-space: nowrap; }
.mini-mark { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.mini-mark.amber { background: var(--amber); }
.mini-mark.slate { background: var(--slate); }
.mini-mark.cyan { background: var(--cyan); }
.readout-value { margin-top: 7px; color: #e2ecef; font-size: 23px; line-height: 1; letter-spacing: -.04em; font-weight: 590; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { font-size: 10px; color: #8ba0aa; font-weight: 500; letter-spacing: 0; }
.readout-value.compact { font-size: 17px; margin-top: 10px; }
.readout-foot { margin-top: 7px; color: #607683; font-size: 8px; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(11,23,34,.86); overflow: hidden; }
.science-panel summary { min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(104,214,211,.23); color: var(--cyan); border-radius: 8px; font-size: 17px; }
.science-panel summary b { display: block; font-size: 9px; letter-spacing: .15em; }
.science-panel summary small { display: block; margin-top: 4px; color: #718795; font-size: 9px; }
.summary-chevron { margin-left: auto; color: #7c929e; font-size: 17px; transition: transform .2s; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 14px 15px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.equation-block { padding: 13px; border: 1px solid rgba(157,184,204,.1); border-radius: 9px; background: rgba(16,31,45,.6); min-width: 0; }
.equation-label { color: #7c9ca4; font-size: 7px; margin-bottom: 10px; }
.equation { color: #d5e5e8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.equation sub, .equation sup { font-size: 8px; }
.equation-block p { color: #8397a3; font-size: 9px; line-height: 1.55; margin: 8px 0 0; }
.validation-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 11px; }
.validation-grid div { padding: 8px 7px; border: 1px solid rgba(157,184,204,.1); border-radius: 6px; background: rgba(5,14,22,.35); }
.validation-grid span { display: block; color: #6d8592; font-size: 6px; letter-spacing: .11em; }
.validation-grid b { display: block; margin-top: 5px; color: #d8e8e9; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.validation-note { display: flex; align-items: center; gap: 7px; color: #7e969e; font-size: 8px; margin-top: 8px; line-height: 1.4; }
.status-check { color: var(--cyan); font-size: 13px; }
.science-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.science-tags span { border: 1px solid var(--line); color: #8298a2; padding: 6px 8px; border-radius: 5px; font-size: 7px; letter-spacing: .07em; }
.limitations { grid-column: 1 / -1; border-left: 2px solid rgba(215,163,107,.65); padding: 3px 0 3px 10px; }
.limitations b { color: #c7a57e; font-size: 7px; letter-spacing: .13em; }
.limitations p { color: #7d919d; font-size: 9px; line-height: 1.55; margin: 5px 0 0; }
.disclaimer { color: #596f7c; font-size: 8px; padding: 10px 2px 0; }
.control-column { position: sticky; top: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: linear-gradient(160deg, rgba(16,31,45,.96), rgba(10,21,32,.97)); padding: 17px 16px 13px; box-shadow: 0 16px 42px rgba(0,0,0,.16); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 16px; font-weight: 590; letter-spacing: -.03em; margin: 5px 0 0; }
.panel-heading .kicker { font-size: 8px; }
.parameter-count { color: #d4e1e5; font-size: 18px; font-weight: 600; letter-spacing: -.04em; }
.parameter-count span { display: block; color: #647d89; font-size: 6px; letter-spacing: .13em; text-align: right; margin-top: 2px; }
.preset-section, .parameter-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; justify-content: space-between; color: #8096a2; font-size: 7px; letter-spacing: .15em; }
.section-label span { color: #526e7b; }
.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 10px; }
.preset-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7,17,27,.55); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-card:hover { border-color: rgba(104,214,211,.3); }
.preset-card.active { border-color: rgba(104,214,211,.42); background: rgba(45,110,113,.13); }
.preset-icon { color: var(--cyan); font-size: 14px; line-height: 1; }
.preset-card:nth-child(2) .preset-icon { color: var(--amber); }
.preset-card:nth-child(3) .preset-icon { color: #d3bb86; }
.preset-card b { font-size: 9px; font-weight: 650; color: #c7d5dc; }
.preset-card small { font-size: 7px; color: #718692; white-space: nowrap; }
.parameter-section { padding-bottom: 5px; }
.parameter-section > .section-label { margin-bottom: 15px; }
.parameter { margin-bottom: 14px; }
.param-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.param-head label { color: #b9c8cf; font-size: 10px; }
.param-head output { color: var(--cyan); font-size: 10px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 3px; margin: 0; appearance: none; -webkit-appearance: none; background: linear-gradient(90deg, rgba(104,214,211,.82), rgba(104,214,211,.22)); border-radius: 5px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #b3e9e4; border: 2px solid #193a43; box-shadow: 0 0 0 3px rgba(104,214,211,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #b3e9e4; border: 2px solid #193a43; box-shadow: 0 0 0 3px rgba(104,214,211,.12); }
.range-ends { display: flex; justify-content: space-between; color: #5e7481; font-size: 7px; margin-top: 6px; }
.driver-summary { padding: 14px 0 12px; }
.causal-flow { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 11px; }
.causal-flow > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 3px; }
.causal-flow i { color: #476a75; font-size: 11px; font-style: normal; margin-top: -12px; }
.cause-icon { color: #9cb3bd; font-size: 15px; line-height: 1; }
.cyan-text { color: var(--cyan); }
.amber-text { color: var(--amber); }
.causal-flow b { color: #b9c9d0; font-size: 8px; font-weight: 650; }
.causal-flow small { color: #657d89; font-size: 7px; white-space: nowrap; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); color: #5f7784; font-size: 6px; letter-spacing: .1em; }
.panel-foot b { color: #9bb0ba; font-size: 7px; margin-left: 4px; letter-spacing: .06em; }
.global-footer { display: flex; justify-content: space-between; gap: 10px; padding: 18px 2px 0; color: #4e6471; font-size: 7px; letter-spacing: .12em; }
.global-footer i { color: #2f5963; font-style: normal; padding: 0 5px; }
.embed-mode .topbar, .embed-mode .global-footer, .embed-mode .title-row { display: none; }
.embed-mode .workspace { padding-top: 0; }
.embed-mode .scene-stage { height: min(72vh, 650px); }
@media (max-width: 1120px) {
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: minmax(0,1fr) 300px; gap: 14px; }
  .control-column { padding: 14px 12px 12px; }
  .transport-hint { display: none; }
  .readout-grid { gap: 7px; }
  .readout-card { padding: 11px 10px; }
  .readout-label { font-size: 6px; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .control-column { position: static; }
  .scene-stage { height: min(65vw, 520px); min-height: 360px; }
  .control-column { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .panel-heading, .preset-section, .parameter-section, .driver-summary, .panel-foot { min-width: 0; }
  .panel-heading, .preset-section { grid-column: 1 / -1; }
  .parameter-section { border-bottom: 0; }
  .driver-summary { border-left: 1px solid var(--line); padding-left: 16px; }
  .panel-foot { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 11px 14px; }
  .topbar { height: 57px; }
  .topbar-right { gap: 10px; }
  .live-pill { font-size: 7px; }
  .seed-tag { font-size: 7px; }
  .brand-sub { font-size: 7px; }
  .workspace { padding-top: 16px; gap: 13px; }
  .title-row { margin-bottom: 12px; }
  h1 { font-size: 27px; }
  .subtitle { max-width: 270px; font-size: 10px; }
  .specimen-id { min-width: 86px; }
  .specimen-id b { font-size: 13px; }
  .specimen-id small { font-size: 6px; }
  .scene-topline { height: 34px; padding: 0 9px; }
  .scene-legend { gap: 4px; font-size: 6px; letter-spacing: .04em; }
  .legend-dot { width: 5px; height: 5px; margin-left: 4px; }
  .scene-scale { font-size: 6px; }
  .scene-stage { min-height: 350px; height: 105vw; max-height: 480px; }
  .scene-hud { padding: 7px 8px; }
  .hud-top-left { top: 9px; left: 9px; }
  .hud-bottom-left { bottom: 9px; left: 9px; }
  .hud-bottom-right { bottom: 9px; right: 9px; }
  .scene-hud b { font-size: 15px; }
  .context-note { top: 11px; right: 9px; font-size: 6px; }
  .annotation b { font-size: 6px; }
  .annotation small { font-size: 7px; }
  .annotation { min-width: 90px; }
  .scene-footer { padding: 8px 9px; min-height: 58px; }
  .scene-caption span { font-size: 8px; }
  .scene-caption b { font-size: 7px; }
  .scene-actions { gap: 4px; }
  .icon-button { width: 30px; height: 30px; }
  .transport-bar { flex-wrap: wrap; padding: 8px; gap: 7px; }
  .transport-main { gap: 5px; }
  .play-button { height: 33px; padding: 0 9px; font-size: 8px; }
  .transport-button { height: 33px; padding: 0 8px; font-size: 7px; }
  .speed-control { margin-left: auto; }
  .speed-control > span { display: none; }
  .speed-control button { min-width: 27px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 21px; }
  .science-content { grid-template-columns: 1fr; }
  .science-tags, .limitations { grid-column: auto; }
  .control-column { display: block; padding: 14px 12px 11px; }
  .parameter-section { border-bottom: 1px solid var(--line); }
  .driver-summary { border-left: 0; padding-left: 0; }
  .panel-foot { grid-column: auto; }
  .global-footer { font-size: 6px; letter-spacing: .07em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
