.stage { position: fixed; inset: 0; z-index: 0; }
.scene { position: absolute; inset: 0; overflow: hidden; }
.constellation-canvas, .constellation-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.constellation-canvas { cursor: grab; touch-action: none; }
.constellation-canvas:active { cursor: grabbing; }
.scene-empty { position: absolute; left: calc(var(--pad) + var(--left)); right: calc(var(--pad) + var(--right)); top: var(--top); bottom: 140px;
  display: grid; place-content: center; justify-items: center; gap: 6px; pointer-events: none; text-align: center; }
.scene-empty strong { font-size: 22px; font-weight: 300; letter-spacing: -.01em; }
.scene-empty small { font-size: 13px; color: var(--muted); }
.empty-reticle { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 12px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%); animation: breathe 2.4s ease-in-out infinite; }

.topbar { position: relative; z-index: 3; height: var(--top); padding: 0 var(--pad); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.brand-mark { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(from 200deg, #8a7cf0, #3d9be9, #2fb383, #dfa53a, #ef7d5c, #dc6dac, #8a7cf0); -webkit-mask: radial-gradient(circle, transparent 3px, #000 3.5px); mask: radial-gradient(circle, transparent 3px, #000 3.5px); }
.readouts { display: flex; gap: 6px; margin: 0; padding: 5px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.readouts div { display: flex; align-items: baseline; gap: 8px; padding: 4px 14px; }
.readouts div + div { border-left: 1px solid var(--line); }
.readouts dt { font-size: 12px; color: var(--muted); }
.readouts dd { margin: 0; font-size: 13px; font-weight: 600; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.model-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.clear-button { color: var(--muted); }

@media (min-width: 1024px) and (min-height: 560px) {
  html, body { height: 100%; overflow: hidden; }
  .hud > * { position: fixed; z-index: 2; }
  .intro { left: var(--pad); top: calc(var(--top) + clamp(16px, 3.5vh, 44px)); width: var(--left); }
  .manuscript { left: var(--pad); width: var(--left); top: var(--intro-bottom, 330px); bottom: var(--pad); }
  .inspector { right: var(--pad); width: var(--right); top: calc(var(--top) + clamp(16px, 3.5vh, 44px)); max-height: calc(100dvh - var(--top) - clamp(16px, 3.5vh, 44px) - var(--pad)); }
  .legend { left: calc(var(--pad) + var(--left) + 32px); right: calc(var(--pad) + var(--right) + 32px); top: calc(var(--top) + 14px); }
  .map-caption { left: calc(var(--pad) + var(--left) + 40px); bottom: calc(var(--pad) + 112px); }
  .map-tools { right: calc(var(--pad) + var(--right) + 40px); bottom: calc(var(--pad) + 102px); }
  .composer { left: calc(var(--pad) + var(--left) + 40px); right: calc(var(--pad) + var(--right) + 40px); bottom: var(--pad); margin: 0 auto; max-width: 760px; }
}
@media (min-width: 1024px) and (min-height: 560px) and (max-height: 760px) {
  :root { --top: 56px; }
  .lede { display: none; }
  .intro h1 { font-size: clamp(40px, 7.6vh, 58px) !important; }
  .map-caption { display: none; }
  .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 1379px) and (min-width: 1024px) { .readouts div:nth-child(2), .brand small { display: none; } .top-actions { gap: 14px; } }

@media not ((min-width: 1024px) and (min-height: 560px)) {
  body { display: flex; flex-direction: column; }
  .hud { display: contents; }
  .stage { position: relative; order: 2; height: min(66vh, 540px); margin-top: 8px; }
  .scene-empty { inset: 0; }
  .topbar { order: 0; grid-template-columns: 1fr auto; }
  .readouts { display: none; }
  .top-actions { gap: 14px; }
  .top-actions .text-button:not([data-action="about"]) { display: none; }
  .intro { order: 1; padding: 22px var(--pad) 6px; }
  .legend { order: 3; padding: 12px var(--pad) 0; }
  .map-caption { order: 4; padding: 8px var(--pad) 0; flex-wrap: wrap; justify-content: center; white-space: normal; text-align: center; }
  .map-tools { order: 5; padding: 6px var(--pad) 0; justify-content: center; }
  .composer { order: 6; margin: 14px var(--pad) 0; }
  .manuscript { order: 7; margin: 18px var(--pad) 0; max-height: 380px; }
  .inspector { order: 8; margin: 18px var(--pad) 28px; }
}
@media (max-width: 640px) { .top-actions .text-button, .brand small { display: none; } }
@media (max-width: 1799px) and (min-width: 1024px) { .map-caption span:last-child { display: none; } }
