:root { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #f1f3f5; background: #0b1015; font-synthesis: none; --muted: #929ca6; --red: #ff4b55; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #f1f3f5; outline-offset: 3px; }
[hidden] { display: none !important; }
.demo { max-width: 1160px; margin: 0 auto; padding: 18px 24px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 16px; }
h1 { margin: 0; font-size: clamp(22px, 2.6vw, 26px); font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 18px; align-items: start; }
.scene-panel { overflow: hidden; border: 1px solid #2b333c; border-radius: 14px; background: #0f151b; }
.hud { padding: 18px 22px 0; --risk-color: #f1f3f5; }
.hud[data-critical="true"] { --risk-color: #f2b454; }
.hud[data-detected="true"] { --risk-color: var(--red); }
.risk-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.risk-heading h2 { text-transform: uppercase; font-size: 14px; letter-spacing: .025em; color: #dce0e5; }
#risk-value { color: var(--risk-color); font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.percent-sign { margin-left: 1px; font-size: 17px; }
.risk-meter { display: grid; grid-template-columns: repeat(var(--segments, 16), minmax(0, 1fr)); gap: 5px; height: 18px; }
.segment { position: relative; background: #252c33; border: 1px solid #3a424b; }
.segment-light { position: absolute; inset: 1px; background: var(--risk-color); opacity: 0; }
.demo-status { min-height: 24px; line-height: 24px; margin-top: 9px; color: #bdc5cd; font-size: 14px; }
.demo-status[data-urgent="true"] { color: var(--red); }
.scene-viewport { position: relative; }
.restart-overlay { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: rgb(6 10 14 / .52); }
.restart-button { min-height: 44px; padding: 11px 28px; border: 1px solid #d0d7df; border-radius: 8px; background: #eef1f4; color: #11171e; font-weight: 600; }
.restart-button:hover { background: #fff; }
#scene { display: block; width: 100%; height: min(58vh, 440px); min-height: 300px; user-select: none; }
.cone { fill: #d1d5da; fill-opacity: .085; stroke: #c1c9d2; stroke-opacity: .65; stroke-width: 1.5; }
.zone-surface { fill: #cbd3db; fill-opacity: .035; }
.zone-ring { fill: #d2dae2; fill-opacity: .045; stroke: #929ca7; stroke-width: 1.6; }
.safe-ring { fill: none; stroke: #d8e0e8; stroke-width: 1.8; }
.loss-ring { fill: none; stroke: #a4afb9; stroke-width: 1.8; stroke-dasharray: 5 7; }
.loss-ring[data-lost="true"] { stroke: #ff4b55; stroke-opacity: .75; }
.map-labels text, .map-label, .zone-label { font-family: inherit; font-size: 16px; fill: #d0d7df; paint-order: stroke; stroke: #0f151b; stroke-width: 3px; stroke-linejoin: round; }
.map-labels .cone-label { fill: #bac4ce; font-size: 13px; letter-spacing: .06em; }
.zone-label { fill: #e3e8ed; font-size: 16px; }
.distance-line { stroke: #c6ced6; stroke-opacity: .3; stroke-width: 1; stroke-dasharray: 3 5; }
.target circle { fill: #1c242d; stroke: #bbc4ce; stroke-width: 1.5; }
.target > path { fill: #bbc4ce; }
.target .target-chevron { stroke: #bbc4ce; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#player { cursor: grab; touch-action: none; outline: none; }
#player.dragging { cursor: grabbing; }
#player[aria-disabled="true"] { pointer-events: none; }
.player-halo { fill: #f1f3f5; fill-opacity: .03; stroke: #f1f3f5; stroke-opacity: .18; }
.player-core { fill: #f1f3f5; stroke: #f1f3f5; stroke-width: 1; }
.player-center { fill: #1b232c; }
.player-label { fill: #e1e5e9; }
#player:focus-visible .player-halo { stroke-opacity: .9; stroke-width: 2; }
.drag-hint { margin: 0 0 0 auto; font-size: 14px; color: #aeb7c1; }
.scene-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding: 0 12px 16px; font-size: 12px; color: var(--muted); }
.scene-legend span { display: flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 12px; border-top: 1px solid; }
.near-line { border-color: #929ca7; }
.safe-line { border-color: #d8e0e8; }
.lost-line { border-color: #a4afb9; border-top-style: dashed; }
.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-panel { border: 1px solid #2b333c; border-radius: 12px; background: #11171e; padding: 16px; }
.settings-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 8px; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: #a3acb6; font-size: 12px; }
.text-button:hover { color: #f1f3f5; text-decoration: underline; }
#settings { display: flex; flex-direction: column; gap: 13px; }
#settings > label { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 28px; color: #d0d6dc; }
.input-wrap { display: flex; align-items: center; gap: 3px; width: 86px; flex: 0 0 86px; margin-left: auto; background: #0b1015; border: 1px solid #35404c; border-radius: 5px; padding: 0 6px; }
.input-wrap > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
input { width: 100%; min-width: 0; border: none; background: transparent; color: #e9edf1; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; padding: 4px 0; appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button { appearance: none; }
.input-wrap:focus-within { border-color: #dce2e8; }
.input-wrap:has(input[aria-invalid="true"]) { border-color: #ff4b55; }
input:focus-visible { outline: none; }
.derived { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #2b333c; font-size: 14px; color: var(--muted); }
.derived output { color: #d0d6dc; font-variant-numeric: tabular-nums; }
.settings-error { font-size: 12px; color: #ff8a91; line-height: 1.4; margin: 10px 0 0; }
.readouts { display: grid; grid-template-columns: 1fr .8fr 1.3fr; gap: 8px; padding: 0 4px; }
.readouts div { display: flex; flex-direction: column; gap: 5px; }
.readouts span { color: var(--muted); font-size: 12px; }
.readouts output { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; white-space: nowrap; }
@media (max-width: 920px) { .demo { padding: 16px; } .workspace { grid-template-columns: minmax(0, 1fr) 294px; gap: 12px; } .settings-panel { padding: 14px; } .hud { padding: 16px 16px 0; } .scene-legend { gap: 8px 12px; } }
@media (max-width: 700px) { .demo { padding: 14px; } .page-header { margin-bottom: 14px; } h1 { font-size: 23px; } .workspace { grid-template-columns: minmax(0, 1fr); } #scene { height: auto; min-height: 0; aspect-ratio: 1; max-height: 420px; } .hud { padding: 14px 14px 0; } .risk-meter { gap: 3px; height: 16px; } .risk-heading { margin-bottom: 10px; } .sidebar { gap: 12px; } .readouts { padding: 0 14px 6px; } }
