
:root {
  color-scheme: dark;
  --back: #080f19;
  --panel: #111b29;
  --edge: #26384c;
  --ink: #edf4fd;
  --muted: #a5b8ce;
  --cyan: #78e0f6;
  --gold: #ffd27b;
  --lavender: #d2bdff;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; background: radial-gradient(ellipse at 46% 0, #18283d, transparent 56rem), var(--back); color: var(--ink) }
main { width: min(1500px, 100%); margin: auto; padding: 28px clamp(14px, 3.5vw, 52px) 32px }
h1, h2, p, dl, dd { margin: 0 }
h1 { font-size: clamp(1.65rem, 3.2vw, 2.12rem); letter-spacing: -.045em; line-height: 1.1 }
h2 { font-size: 1rem; letter-spacing: -.015em }
button, input { font: inherit }
button { cursor: pointer }
button:focus-visible, input:focus-visible, canvas:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px }
.masthead, .identity, .scene-header, .placement, .select-point, .legend, .readout { display: flex; align-items: center }
.masthead { justify-content: space-between; gap: 12px; margin-bottom: 20px }
.identity { gap: 13px }
.mark { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; background: #14273b; border: 1px solid #34516a; border-radius: 12px; color: var(--cyan) }
.mark canvas { width: 28px; height: 28px }
.subtitle { color: var(--muted); margin-top: 4px; font-size: .875rem }
.button, .select-point button { min-height: 37px; padding: 6px 12px; color: var(--ink); background: #172436; border: 1px solid #35475e; border-radius: 8px; font-size: .875rem; font-weight: 650 }
.button:hover, .select-point button:hover { background: #22364c; border-color: #617d97 }
.reset { background: transparent; white-space: nowrap }
.placement, .scene, .results, .coordinates { border: 1px solid var(--edge); background: var(--panel); border-radius: 14px }
.placement { justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 10px 13px 10px 16px; margin-bottom: 14px }
.select-point { gap: 5px; flex-wrap: wrap }
.select-point > strong { font-size: .875rem; margin-right: 6px }
.select-point button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 10px; background: #0e1826; color: var(--muted); border-color: transparent }
.select-point button[aria-pressed="true"] { color: var(--ink); background: #21384b; border-color: #42617a }
.point-chip { display: inline-grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px; border-radius: 50%; color: #0b1520; font: 750 .75rem var(--mono); background: var(--cyan) }
.point-chip.b { background: var(--lavender) }
.hint { color: var(--muted); font-size: .875rem }
.views { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px }
.scene { min-width: 0; overflow: hidden }
.scene-header { min-height: 58px; justify-content: space-between; gap: 8px; padding: 10px 15px }
.projection { color: var(--muted); font: .76rem var(--mono) }
.scene-header h2 + .projection { margin-top: 2px }
.stage {
  position: relative;
  height: clamp(334px, 35vw, 505px);
  border-top: 1px solid var(--edge);
  background-color: #0a1422;
  background-image: radial-gradient(ellipse at center, #132a40bb, transparent 72%),
    linear-gradient(90deg, #6686a612 1px, transparent 1px),
    linear-gradient(#6686a612 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  background-position: center;
}
.stage canvas { display: block; width: 100%; height: 100%; cursor: crosshair }
#globe { touch-action: none; cursor: grab }
#globe:active { cursor: grabbing }
canvas:focus-visible { outline-offset: -4px }
.legend { gap: 9px 22px; flex-wrap: wrap; padding: 12px 3px; color: var(--muted); font-size: .875rem }
.key { display: inline-flex; align-items: center; gap: 8px }
.swatch { width: 28px; border-top: 3px solid var(--gold); border-radius: 2px }
.swatch.long { border-top: 2px dashed var(--cyan); border-radius: 0 }
.legend .credit { margin-left: auto; color: var(--muted); font-size: .78rem }
.credit a { color: var(--muted); text-underline-offset: 2px }
.inspector { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) }
.metric { padding: 14px 13px; min-width: 0 }
.metric + .metric { border-left: 1px solid var(--edge) }
.metric dt { color: var(--muted); font-size: .82rem }
.metric dd { margin-top: 6px; font: 700 clamp(.91rem, 1.45vw, 1.32rem) var(--mono); white-space: nowrap }
.metric:first-child dd { color: var(--gold) }
.metric small { color: var(--muted); font-size: .68em; font-weight: 500 }
.coordinates { display: grid; grid-template-columns: 1fr 1fr }
fieldset { min-width: 0; margin: 0; border: 0; padding: 10px 13px 13px }
fieldset + fieldset { border-left: 1px solid var(--edge) }
legend { float: left; width: 100%; padding: 0; margin-bottom: 7px }
.readout { gap: 7px; font-size: .85rem; font-weight: 650 }
.fields { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.fields label { min-width: 0; color: var(--muted); font-size: .8rem }
.fields input { display: block; width: 100%; margin-top: 4px; min-height: 34px; padding: 4px 7px; color: var(--ink); border: 1px solid #35495f; border-radius: 6px; background: #0d1724; font: .84rem var(--mono) }
.note { color: var(--muted); font-size: .84rem; margin: 11px 2px 0 }
.note:empty { display: none }
@media (max-width: 950px) {
  .inspector { grid-template-columns: 1fr }
  .stage { height: clamp(265px, 40vw, 410px) }
}
@media (max-width: 680px) {
  main { padding-top: 18px }
  .views { grid-template-columns: 1fr }
  .stage { height: clamp(270px, 67vw, 385px) }
  #map-stage { height: clamp(205px, 57vw, 345px) }
  .legend .credit { margin-left: 0 }
  .projection { font-size: .72rem }
  .scene-header { min-height: 54px }
}
@media (max-width: 380px) {
  .mark { display: none }
  .placement { padding-inline: 11px }
  .legend { gap: 7px 14px }
  .metric { padding-inline: 8px }
  fieldset { padding-inline: 9px }
}
