:root {
  color-scheme: dark;
  --bg: #07111b;
  --panel: #0b1824;
  --panel-2: #0e1d2a;
  --line: rgba(169, 198, 216, .13);
  --line-strong: rgba(169, 198, 216, .22);
  --text: #e8f0f5;
  --muted: #8da3b3;
  --dim: #5e7484;
  --accent: #63d9e8;
  --accent-soft: rgba(99, 217, 232, .12);
  --warm: #ffbd78;
  --ice: #a9d9ed;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 720px; height: 100vh; display: grid; grid-template-rows: 68px minmax(0, 1fr) 190px; background: radial-gradient(ellipse at 40% 0%, rgba(25, 63, 83, .16), transparent 46%), var(--bg); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7, 17, 27, .92); min-width: 0; gap: 18px; }
.brand-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; position: relative; border: 1px solid rgba(99,217,232,.42); border-radius: 50%; transform: rotate(-28deg); flex: 0 0 auto; }
.brand-mark::before { content: ""; position: absolute; width: 34px; height: 12px; left: -3px; top: 8px; border: 1px solid var(--accent); border-radius: 50%; opacity: .8; }
.brand-mark span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.brand-mark span:nth-child(1) { left: 5px; top: 5px; }.brand-mark span:nth-child(2) { right: 5px; bottom: 5px; opacity: .6; }.brand-mark span:nth-child(3) { left: 12px; top: 12px; width: 5px; height: 5px; background: var(--warm); }
.eyebrow { color: var(--muted); font-size: 9px; line-height: 1.2; letter-spacing: .16em; font-weight: 750; }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.025em; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-status { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.model-tag, .live-indicator { font-size: 9px; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.model-tag { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: #b8cbd5; }
.live-indicator i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(99,217,232,.7); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; min-height: 0; overflow: hidden; }
.visual-pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 52%, rgba(16, 48, 65, .26), transparent 57%), linear-gradient(145deg, #081521, #07111b 70%); }
.visual-pane::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-right: 1px solid var(--line); box-shadow: inset 0 0 80px rgba(0,0,0,.15); }
#scene { display: block; width: 100%; height: 100%; outline: none; }
.scene-topline, .scene-bottomline { position: absolute; left: 20px; right: 20px; display: flex; align-items: center; pointer-events: none; z-index: 2; }
.scene-topline { top: 18px; justify-content: space-between; }
.scene-chip { display: flex; align-items: center; gap: 8px; color: #b7cad4; font-size: 9px; font-weight: 750; letter-spacing: .13em; padding: 7px 10px; background: rgba(8, 21, 32, .68); border: 1px solid var(--line); border-radius: 5px; backdrop-filter: blur(8px); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(99,217,232,.6); }
.scene-time { color: var(--muted); font-size: 9px; letter-spacing: .13em; font-weight: 700; padding: 7px 10px; background: rgba(8,21,32,.6); border: 1px solid var(--line); border-radius: 5px; }
.scene-time strong { color: var(--text); font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.scene-time small { color: var(--dim); font-size: 7px; margin-left: 4px; }
.scene-bottomline { bottom: 14px; justify-content: center; gap: 12px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .12em; text-shadow: 0 1px 4px #07111b; }
.scene-bottomline b { color: #dce8ef; font-size: 10px; letter-spacing: 0; margin-left: 5px; font-variant-numeric: tabular-nums; }
.bottom-divider { height: 12px; width: 1px; background: var(--line-strong); }
.inspector { background: linear-gradient(180deg, rgba(13, 28, 41, .98), rgba(9, 21, 32, .98)); border-left: 1px solid var(--line); padding: 17px 16px 14px; min-width: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #294150 transparent; }
.inspector-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.units-note { font-size: 8px; color: var(--dim); letter-spacing: .12em; font-weight: 750; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card { padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(18, 37, 52, .58); min-width: 0; }
.metric-primary { border-color: rgba(99,217,232,.32); background: linear-gradient(140deg, rgba(24,65,79,.42), rgba(18,37,52,.58)); }
.metric-label { font-size: 9px; color: var(--muted); font-weight: 600; line-height: 1.3; min-height: 23px; }
.metric-value { font-size: clamp(20px, 2.1vw, 25px); line-height: 1.15; font-weight: 620; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-primary .metric-value { color: var(--accent); }
.metric-value small { font-size: 10px; letter-spacing: 0; color: #9eb4c1; margin-left: 4px; font-weight: 550; }
.metric-foot { margin-top: 5px; color: var(--dim); font-size: 7px; letter-spacing: .09em; font-weight: 700; }
.caption-card { margin-top: 11px; padding: 11px 12px 10px; border-left: 2px solid var(--accent); background: rgba(99,217,232,.055); border-radius: 0 7px 7px 0; }
.caption-card p { margin: 6px 0 0; color: #c1d0d8; font-size: 10px; line-height: 1.48; }
.check-card { margin-top: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(5, 14, 23, .32); }
.check-head { display: flex; align-items: center; justify-content: space-between; }
.check-pill { color: var(--accent); border: 1px solid rgba(99,217,232,.22); border-radius: 4px; padding: 3px 5px; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.check-title { margin-top: 7px; color: #c8d6dd; font-size: 10px; font-weight: 650; }
.check-values { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.check-values div:not(.check-equals) { display: flex; flex-direction: column; gap: 2px; }
.check-values small { color: var(--dim); font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.check-values strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.check-equals { color: var(--dim); font-size: 9px; }
.check-diff { margin-top: 7px; color: var(--muted); font-size: 8px; }
.check-diff strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.science-toggle { margin-top: 10px; padding: 10px 11px; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: rgba(18,37,52,.55); display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: left; }
.science-toggle span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-toggle b { font-size: 10px; font-weight: 620; color: #d8e3e9; }
.toggle-glyph { color: var(--accent); font-size: 18px; font-weight: 300; transition: transform .2s ease; }
.science-toggle[aria-expanded="true"] .toggle-glyph { transform: rotate(45deg); }
.science-panel { padding: 11px 10px 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 7px 7px; background: rgba(5,14,23,.3); }
.equation-block { margin-bottom: 10px; }
.equation-label { color: var(--accent); font-size: 7px; letter-spacing: .12em; font-weight: 800; margin-bottom: 5px; }
.equation-block p { margin: 4px 0; color: #c3d2da; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.science-copy { color: #9db1bd; font-size: 8px; line-height: 1.5; margin-top: 8px; }
.science-copy b { color: #d2dfe6; }
.scale-note { padding-top: 8px; border-top: 1px solid var(--line); }
.disclaimer { color: var(--dim); font-size: 7px; line-height: 1.4; margin: 10px 0 2px; }
.control-deck { min-height: 0; padding: 10px 20px 8px; border-top: 1px solid var(--line); background: linear-gradient(180deg, #0a1722, #08131e); display: flex; flex-direction: column; gap: 9px; overflow: hidden; }
.control-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 31px; }
.preset-group, .transport-controls, .view-controls { display: flex; align-items: center; gap: 6px; }
.preset-button, .utility-button, .icon-button { border: 1px solid var(--line-strong); background: rgba(17,36,51,.78); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.preset-button:hover, .utility-button:hover, .icon-button:hover { border-color: rgba(99,217,232,.5); }
.preset-button:active, .utility-button:active, .icon-button:active { transform: translateY(1px); }
.preset-button { height: 30px; padding: 0 11px; border-radius: 5px; color: #9fb2be; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.preset-button.active { color: var(--accent); border-color: rgba(99,217,232,.42); background: rgba(99,217,232,.09); }
.icon-button { height: 30px; min-width: 32px; border-radius: 5px; color: #b9cbd4; font-size: 10px; font-weight: 750; }
.icon-button.primary-action { background: var(--accent); color: #06202a; border-color: var(--accent); font-size: 13px; }
.icon-button.primary-action:hover { background: #8ce8f1; }
.utility-button { height: 30px; padding: 0 9px; border-radius: 5px; color: #9fb2be; font-size: 8px; font-weight: 750; letter-spacing: .08em; white-space: nowrap; }
.utility-button.active { color: var(--accent); border-color: rgba(99,217,232,.38); }
.switch-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.screenshot-button { color: #c4d4dc; }
.control-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.control-card { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 7px 9px 5px; border: 1px solid var(--line); border-radius: 7px; background: rgba(17,35,49,.52); cursor: pointer; }
.control-title { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; color: #9eb1bd; font-size: 9px; font-weight: 600; white-space: nowrap; }
.control-title b { color: #dce7ec; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 15px; margin: 6px 0 1px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(99,217,232,.65), rgba(99,217,232,.17)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(99,217,232,.65), rgba(99,217,232,.17)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid #d7faff; margin-top: -4px; box-shadow: 0 0 0 3px rgba(99,217,232,.12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #d7faff; box-shadow: 0 0 0 3px rgba(99,217,232,.12); }
.control-range { display: flex; justify-content: space-between; color: var(--dim); font-size: 7px; }
.deck-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 20px; }
.time-control { display: flex; align-items: center; gap: 9px; min-width: 270px; color: var(--muted); font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.time-control input { flex: 1; margin: 0; }
.time-control b { min-width: 73px; text-align: right; color: var(--accent); font-size: 9px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.deck-note { color: var(--dim); font-size: 8px; letter-spacing: .02em; text-align: right; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; }
  .topbar { padding: 0 16px; }
  .control-deck { padding-left: 14px; padding-right: 14px; }
  .control-grid { gap: 6px; }
  .control-card { padding-left: 7px; padding-right: 7px; }
  .control-title { font-size: 8px; }
  .control-title b { font-size: 8px; }
  .utility-button { padding: 0 7px; }
}
@media (max-width: 760px) {
  .app-shell { min-height: 0; height: 100vh; height: 100dvh; grid-template-rows: 56px minmax(0, 1fr) 270px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-block { gap: 9px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-mark::before { width: 28px; left: -2px; top: 6px; }
  .brand-mark span:nth-child(3) { left: 9px; top: 9px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 11px; max-width: 235px; }
  .top-status { gap: 8px; }
  .model-tag { display: none; }
  .live-indicator { font-size: 7px; }
  .workspace { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(250px, 1fr) auto; min-height: 0; }
  .visual-pane { min-height: 0; }
  .visual-pane::after { border-right: 0; border-bottom: 1px solid var(--line); }
  .scene-topline { left: 10px; right: 10px; top: 9px; }
  .scene-chip { font-size: 7px; padding: 6px 7px; }
  .scene-time { font-size: 7px; padding: 6px 7px; }
  .scene-time strong { font-size: 10px; }
  .scene-bottomline { left: 8px; right: 8px; bottom: 8px; gap: 7px; font-size: 6px; }
  .scene-bottomline b { font-size: 8px; margin-left: 3px; }
  .bottom-divider { height: 9px; }
  .inspector { padding: 8px 10px 9px; border-left: 0; border-top: 1px solid var(--line); overflow: auto; }
  .inspector-heading { margin-bottom: 6px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .metric-card { padding: 6px 6px 5px; border-radius: 6px; }
  .metric-label { min-height: 22px; font-size: 7px; }
  .metric-value { font-size: clamp(15px, 4.5vw, 20px); }
  .metric-value small { font-size: 8px; margin-left: 2px; }
  .metric-foot { font-size: 5px; letter-spacing: .04em; margin-top: 3px; }
  .caption-card { margin-top: 6px; padding: 7px 9px; }
  .caption-card p { font-size: 8px; line-height: 1.35; margin-top: 3px; }
  .check-card { display: none; }
  .science-toggle { display: flex; }
  .control-deck { padding: 8px 10px 8px; gap: 7px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #294150 transparent; }
  .control-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 6px; min-height: auto; }
  .preset-group { grid-column: 1 / -1; }
  .preset-button { height: 27px; padding: 0 9px; font-size: 7px; flex: 1; }
  .transport-controls { grid-column: 1; grid-row: 2; }
  .view-controls { grid-column: 2; grid-row: 2; justify-content: flex-end; gap: 4px; }
  .icon-button { height: 27px; min-width: 29px; }
  .utility-button { height: 27px; padding: 0 6px; font-size: 6px; }
  .control-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px; }
  .control-card { padding: 5px 7px 4px; min-height: 52px; }
  .control-title { font-size: 8px; }
  .control-title b { font-size: 8px; }
  input[type="range"] { height: 12px; margin: 4px 0 0; }
  .control-range { font-size: 6px; }
  .deck-bottom { align-items: flex-start; flex-direction: column; gap: 3px; }
  .time-control { width: 100%; min-width: 0; gap: 7px; font-size: 7px; }
  .time-control b { min-width: 62px; font-size: 8px; }
  .deck-note { font-size: 6px; text-align: left; }
}
@media (max-width: 380px) {
  .top-status { display: none; }
  h1 { max-width: 270px; }
  .scene-chip { letter-spacing: .07em; }
  .utility-button { padding: 0 4px; letter-spacing: .04em; }
  .scene-bottomline { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
