:root {
  color-scheme: dark;
  font: 15px/1.45 "Segoe UI",system-ui,sans-serif;
  --ink: #ebf3ff;
  --muted: #aabed6;
  --accent: #92caff;
  --navy: #091426;
  --panel: #0e1c30;
  --surface: #152943;
  --surface-active: #213d5e;
  --line: #344e6d;
  color: var(--ink);
  background: var(--navy);
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
button,input,select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: wait; }
button:focus-visible,input:focus-visible,select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.top { min-height: 70px; padding: 8px 25px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--navy); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 13px; align-items: center; }
.brand > div { display: grid; gap: 0; }
.brand strong { font-size: 17px; line-height: 1.1; }
.brand div span { font-size: 12px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.nust-logo { display: block; width: 66px; height: auto; flex: none; }
.export,.views button { display: flex; gap: 13px; align-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; }
main { display: grid; grid-template-columns: 286px minmax(0,1fr); min-height: 0; }
aside { min-height: 0; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 26px 21px; }
aside section + section { border-top: 1px solid var(--line); margin-top: 23px; padding-top: 21px; }
h1,h2,p { margin: 0; }
h1 { font-size: 21px; letter-spacing: -.025em; }
aside h2 { font-size: 15px; }
form { margin-top: 17px; display: grid; gap: 7px; }
label { color: var(--muted); font-size: 12px; font-weight: 600; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.input-unit { display: flex; align-items: baseline; margin-top: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; }
.input-unit input { width: 100%; min-width: 0; font-size: 19px; color: var(--ink); border: 0; background: transparent; }
.input-unit span { white-space: nowrap; font-size: 12px; }
select { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 4px; padding: 8px; }
.primary { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 10px 12px; color: #091426; background: var(--accent); border: 0; border-radius: 4px; font-weight: 650; }
.primary:hover { background: #b3dbff; }
.coverage { color: var(--muted); margin-top: 10px; font-size: 12px; min-height: 2.9em; }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 13px; color: var(--ink); font-weight: 400; }
input[type=checkbox],input[type=range] { accent-color: var(--accent); }
.range { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; gap: 4px; }
output { color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 6px 0 0; }
.vector-controls { margin: 8px 0 13px 18px; padding-left: 10px; border-left: 2px solid var(--line); }
.vector-controls .range { margin-top: 9px; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.display-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
.secondary { margin-top: 5px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 4px; padding: 4px 8px; font-size: 12px; }
.secondary:hover,.export:hover:not(:disabled),.views button:hover { background: var(--surface-active); }
.probe p { margin: 8px 0; font-size: 12px; color: var(--muted); min-height: 2em; }
.probe dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 0; }
.probe dl div { background: var(--surface); border-radius: 4px; padding: 5px 7px; }
.probe dt { color: var(--muted); font-size: 11px; }
.probe dd { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.viewport { overflow: hidden; position: relative; min-height: 0; background: radial-gradient(ellipse at 52% 40%, #193353, #0a172b 75%); }
.render-target,.render-target canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.view-header,.view-footer { position: absolute; z-index: 1; pointer-events: none; display: flex; justify-content: space-between; left: 22px; right: 22px; gap: 12px; }
.view-header { top: 21px; align-items: start; }
.view-header h2 { font-size: clamp(17px,2vw,24px); letter-spacing: -.024em; }
.view-header p { color: var(--muted); font-size: 13px; }
.views { display: flex; gap: 4px; pointer-events: auto; }
.views button { font-size: 12px; }
.views button[aria-pressed=true] { border-color: #7298c3; background: var(--surface-active); }
.compass { position: absolute; right: 23px; top: 75px; color: var(--ink); font-size: 11px; text-align: center; pointer-events: none; }
.dial { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: #101f35ed; }
.dial i { display: block; height: 27px; width: 4px; background: var(--accent); clip-path: polygon(50% 0, 100% 32%, 73% 32%, 73% 100%, 27% 100%, 27% 32%, 0 32%); }
.view-footer { align-items: end; bottom: 18px; }
.controls-hint,.legend,.notice { font-size: 12px; padding: 8px 10px; border: 1px solid var(--line); background: #101f35f2; border-radius: 4px; color: var(--ink); }
.orbit-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }
.legend { width: min(215px, 45%); flex-shrink: 0; }
.legend div:not(.ramp) { display: flex; justify-content: space-between; gap: 7px; }
.legend strong { font-size: 11px; }
.ramp { height: 7px; margin: 5px 0 2px; background: linear-gradient(90deg,#8276d4,#5999f4,#29bbec,#21e2a5,#93f347,#e9cf3b,#fa7d20,#f65426,#b72819); }
.notice { max-width: min(410px,90%); text-align: center; position: absolute; z-index: 2; top: 48%; left: 50%; transform: translate(-50%,-50%); }
.notice[hidden] { display: none; }
dialog { max-width: min(640px,90vw); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
dialog::backdrop { background: #070f1eb8; }
dialog p { margin: 10px 0; color: var(--muted); }
dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); padding: 13px; color: var(--accent); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; border-top: 1px solid var(--line); background: var(--navy); padding: 9px 25px; color: var(--muted); font-size: 12px; }
.site-footer strong { color: var(--ink); font-weight: 600; }
.site-footer span { display: inline-block; }
.site-footer a { color: var(--muted); text-underline-offset: 2px; }
.site-footer a:hover { color: var(--accent); }
@media(max-width:820px) {
  main { grid-template-columns: 224px minmax(0,1fr); }
  aside { padding: 19px 13px; }
  .view-header,.view-footer { left: 11px; right: 11px; }
}
@media(max-width:610px) {
  body { height: auto; min-height: 100dvh; display: block; }
  main { display: flex; flex-direction: column-reverse; }
  .top,.site-footer { padding-inline: 12px; }
  .header-actions { gap: 10px; }
  .nust-logo { width: 48px; }
  .header-actions .export { padding: 6px; font-size: 11px; gap: 4px; }
  .header-actions .export span { display: none; }
  .viewport { min-height: 475px; }
  aside { border: 0; }
  .orbit-hint { display: none; }
  .view-footer { justify-content: end; }
  .view-header h2 { font-size: 15px; }
  .view-header p { font-size: 11px; }
  .views button { padding: 5px; }
}
