:root {
  color-scheme: dark;
  --void: #010407;
  --void-2: #03080d;
  --glass: rgba(4, 18, 25, .56);
  --glass-2: rgba(3, 12, 18, .78);
  --cyan: #8be7ff;
  --cyan-2: #32b7dc;
  --cyan-3: #0c6f8c;
  --ice: #d7f8ff;
  --amber: #f6b84f;
  --amber-soft: rgba(246,184,79,.22);
  --red: #ff6b63;
  --green: #63e2b7;
  --line: rgba(120, 222, 255, .23);
  --line-strong: rgba(151, 235, 255, .5);
  --muted: #72909c;
  --text: #d7eef5;
  --shadow: 0 0 34px rgba(47,177,220,.09);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--text);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(18,83,104,.15) 0%, rgba(2,7,11,.1) 28%, transparent 58%),
    linear-gradient(180deg, #02070b 0%, #010306 100%);
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.helmet-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.helmet-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center,
      transparent 0 36%,
      rgba(0,0,0,.06) 54%,
      rgba(0,0,0,.62) 100%);
}

.helmet-grid {
  position: absolute;
  inset: -20%;
  opacity: .13;
  background-image:
    linear-gradient(rgba(94,209,243,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,209,243,.13) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(700px) rotateX(59deg) translateY(22%);
  transform-origin: center bottom;
  mask-image: radial-gradient(ellipse at 50% 52%, #000 0 40%, transparent 78%);
}

.helmet-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -25%;
  height: 18%;
  background: linear-gradient(180deg, transparent, rgba(95,224,255,.05), transparent);
  animation: scan 7.5s linear infinite;
}

@keyframes scan {
  to { transform: translateY(750%); }
}

.visor-edge {
  position: absolute;
  top: 8%;
  bottom: 6%;
  width: 12vw;
  border-color: rgba(115,215,246,.22);
  filter: drop-shadow(0 0 8px rgba(66,191,231,.12));
}

.visor-left {
  left: -2vw;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  clip-path: polygon(0 0, 78% 0, 100% 19%, 91% 76%, 68% 100%, 0 100%);
}

.visor-right {
  right: -2vw;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 32% 100%, 9% 76%, 0 19%);
}

.hud-corner {
  position: absolute;
  width: 64px;
  height: 64px;
  opacity: .42;
}

.corner-tl { top: 16px; left: 16px; border-top: 1px solid var(--cyan-2); border-left: 1px solid var(--cyan-2); }
.corner-tr { top: 16px; right: 16px; border-top: 1px solid var(--cyan-2); border-right: 1px solid var(--cyan-2); }
.corner-bl { bottom: 16px; left: 16px; border-bottom: 1px solid var(--cyan-2); border-left: 1px solid var(--cyan-2); }
.corner-br { bottom: 16px; right: 16px; border-bottom: 1px solid var(--cyan-2); border-right: 1px solid var(--cyan-2); }

.datum {
  position: absolute;
  opacity: .07;
  background: var(--cyan);
}
.datum-x { left: 8%; right: 8%; top: 50%; height: 1px; }
.datum-y { top: 10%; bottom: 10%; left: 50%; width: 1px; }

.screen {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
}

/* ---------- LOGIN ---------- */

.login-screen {
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.helmet-login {
  width: min(92vw, 520px);
  position: relative;
  padding: 40px 44px 30px;
  background:
    linear-gradient(135deg, rgba(6,23,31,.78), rgba(2,10,15,.78));
  border: 1px solid var(--line);
  clip-path: polygon(7% 0, 93% 0, 100% 8%, 100% 92%, 93% 100%, 7% 100%, 0 92%, 0 8%);
  box-shadow: 0 0 70px rgba(36,167,206,.1);
  backdrop-filter: blur(20px);
}

.helmet-login::before,
.helmet-login::after {
  content: "";
  position: absolute;
  height: 1px;
  width: 34%;
  background: linear-gradient(90deg, transparent, var(--cyan));
  top: 17px;
}
.helmet-login::before { left: 18px; }
.helmet-login::after { right: 18px; transform: scaleX(-1); }

.login-reticle {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
}
.reticle-ring {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  border: 1px solid;
  transform: translate(-50%, -50%);
}
.reticle-ring.r1 {
  width: 108px; height: 108px;
  border-color: rgba(108,224,255,.25);
  border-style: dashed;
  animation: spin 20s linear infinite;
}
.reticle-ring.r2 {
  width: 78px; height: 78px;
  border-color: rgba(108,224,255,.45);
  border-left-color: transparent;
  border-right-color: transparent;
  animation: spinReverse 14s linear infinite;
}
.reticle-ring.r3 {
  width: 52px; height: 52px;
  border-color: rgba(246,184,79,.55);
}
.reticle-core {
  position: absolute;
  width: 18px;
  height: 18px;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 22px rgba(139,231,255,.75);
}

.hud-kicker {
  font-family: "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
  color: var(--cyan-2);
  font-size: 9px;
  letter-spacing: .22em;
  font-weight: 700;
}

.brand-lockup {
  margin: 8px 0 0;
  text-align: center;
  color: var(--ice);
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 400;
  letter-spacing: .22em;
  text-shadow: 0 0 20px rgba(88,208,244,.24);
}
.brand-expansion {
  margin-top: 3px;
  text-align: center;
  color: #547682;
  font: 9px/1.4 "SFMono-Regular", Menlo, monospace;
  letter-spacing: .18em;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.field-shell {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  border-left: 1px solid rgba(139,231,255,.38);
  padding: 8px 0 9px 10px;
  background: linear-gradient(90deg, rgba(40,157,190,.06), transparent);
}

.field-index {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--cyan-3);
  font: 10px "SFMono-Regular", Menlo, monospace;
}

.field-shell label {
  color: var(--cyan-2);
  font: 9px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .16em;
}

.field-shell input {
  width: 100%;
  margin-top: 4px;
  padding: 4px 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(113,220,251,.18);
  outline: none;
  color: var(--ice);
  background: transparent;
  font: 15px "SFMono-Regular", Menlo, monospace;
}

.field-shell input:focus {
  border-bottom-color: var(--cyan-2);
}

.hud-action {
  position: relative;
  border: 1px solid rgba(122,224,251,.3);
  border-radius: 0;
  color: var(--cyan);
  background: rgba(18,90,111,.08);
  font: 10px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .15em;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.login-action {
  margin-top: 8px;
  height: 44px;
}
.login-action i {
  position: absolute;
  left: 8px; right: 8px; bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-2), transparent);
}

.auth-error {
  min-height: 18px;
  color: var(--red);
  font: 10px "SFMono-Regular", Menlo, monospace;
}

.login-footer {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #526d77;
  font: 8px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .12em;
}

.signal-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(99,226,183,.8);
}

/* ---------- TOP BAR ---------- */

.app-screen {
  padding: 82px 20px 78px;
}

.hud-topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 28px 8px;
  background: linear-gradient(180deg, rgba(1,5,8,.96), rgba(1,5,8,.68), transparent);
  border-bottom: 1px solid rgba(91,195,226,.12);
  backdrop-filter: blur(12px);
}

.top-brand { text-align: center; }
.brand-main {
  color: var(--ice);
  font-size: 17px;
  letter-spacing: .25em;
  font-weight: 500;
}
.brand-sub {
  margin-top: 3px;
  color: #436a77;
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .18em;
}

.top-cluster { min-width: 190px; }
.top-right { text-align: right; }

.hud-label {
  color: #456875;
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .16em;
}
.hud-value {
  margin-top: 2px;
  color: var(--cyan);
  font: 13px "SFMono-Regular", Menlo, monospace;
}
.hud-micro {
  margin-top: 2px;
  color: #3e5e69;
  font: 7px "SFMono-Regular", Menlo, monospace;
}

.connection-status {
  margin-top: 3px;
  color: #7ca2ad;
  font: 8px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .1em;
}
.connection-status .signal-dot { margin-right: 6px; }

.top-actions {
  position: absolute;
  right: 24px;
  top: 54px;
  display: flex;
  gap: 6px;
}

.hud-icon {
  width: 31px; height: 27px;
  border: 1px solid rgba(126,223,249,.18);
  color: var(--cyan-2);
  background: rgba(6,28,36,.7);
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.hud-icon.danger { color: #a86967; }

/* ---------- MAIN LAYOUT ---------- */

.helmet-layout {
  max-width: 1720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: start;
}

.hud-rail {
  display: grid;
  gap: 12px;
  padding-top: 26px;
}

.hud-panel {
  position: relative;
  background:
    linear-gradient(135deg, rgba(10,36,46,.34), rgba(1,9,13,.55));
  border: 1px solid rgba(93,196,226,.16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.hud-panel > header {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px 6px 11px;
  border-bottom: 1px solid rgba(102,209,239,.12);
  color: var(--cyan-2);
  font: 8px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .12em;
}

.hud-panel > header small {
  color: #395a65;
  font-size: 7px;
}

.telemetry-stack { padding: 8px 10px 10px; }
.telemetry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 9px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(108,207,236,.07);
}
.telemetry-row:last-child { border-bottom: 0; }
.telemetry-row span {
  color: #577986;
  font: 7px "SFMono-Regular", Menlo, monospace;
}
.telemetry-row strong {
  color: #a8dce9;
  font: 8px "SFMono-Regular", Menlo, monospace;
  font-weight: 500;
}
.meter {
  grid-column: 1 / 3;
  display: block;
  height: 2px;
  margin-top: 3px;
  background: rgba(100,191,216,.08);
}
.meter b {
  display: block;
  width: calc(var(--meter) * 100%);
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-3), var(--cyan));
  box-shadow: 0 0 7px rgba(101,216,246,.45);
}
.meter.amber b {
  background: linear-gradient(90deg, #805a20, var(--amber));
  box-shadow: 0 0 7px rgba(246,184,79,.34);
}

.context-readout { padding: 8px 10px; }
.context-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #577986;
  font: 7px "SFMono-Regular", Menlo, monospace;
}
.context-line strong {
  color: var(--cyan);
  font-weight: 500;
}

.quick-panel { padding-bottom: 7px; }
.quick-command {
  width: calc(100% - 14px);
  margin: 7px 7px 0;
  padding: 8px 9px;
  text-align: left;
  border: 0;
  border-left: 1px solid rgba(117,217,246,.3);
  color: #698c98;
  background: rgba(19,71,86,.06);
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .08em;
  cursor: pointer;
}
.quick-command:hover {
  color: var(--cyan);
  background: rgba(49,157,188,.09);
}

.hud-main { min-width: 0; }
.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* ---------- COMMAND / REACTOR ---------- */

.command-stage {
  min-height: 385px;
  display: grid;
  place-items: center;
  align-content: center;
  padding-top: 18px;
}

.reactor-field {
  position: relative;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
}

.reactor-halo {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(104,220,251,.14);
}
.halo-a {
  width: 244px; height: 244px;
  border-left-color: rgba(139,231,255,.55);
  border-right-color: rgba(139,231,255,.55);
  animation: spin 32s linear infinite;
}
.halo-b {
  width: 204px; height: 204px;
  border-style: dashed;
  border-color: rgba(104,220,251,.28);
  animation: spinReverse 21s linear infinite;
}
.halo-c {
  width: 166px; height: 166px;
  border-color: rgba(246,184,79,.25);
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation: spin 15s linear infinite;
}

.reactor-button {
  position: relative;
  width: 128px;
  height: 128px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 0 18px rgba(79,196,230,.2));
}
.reactor-outer,
.reactor-segments,
.reactor-inner,
.reactor-point {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%,-50%);
}
.reactor-outer {
  width: 126px; height: 126px;
  border: 1px solid rgba(129,225,251,.4);
  box-shadow: inset 0 0 20px rgba(44,161,194,.12), 0 0 22px rgba(44,161,194,.12);
}
.reactor-segments {
  width: 103px; height: 103px;
  border: 9px dashed rgba(92,205,237,.36);
  animation: spin 18s linear infinite;
}
.reactor-inner {
  width: 72px; height: 72px;
  border: 1px solid rgba(171,238,255,.55);
  background:
    radial-gradient(circle,
      rgba(219,250,255,.98) 0 7%,
      rgba(127,225,250,.72) 8% 17%,
      rgba(34,137,166,.45) 18% 42%,
      rgba(4,26,34,.85) 43% 68%,
      transparent 69%);
  box-shadow: 0 0 26px rgba(105,219,248,.28);
}
.reactor-point {
  width: 10px; height: 10px;
  background: var(--ice);
  box-shadow: 0 0 18px rgba(210,248,255,.95);
}

.reactor-button.listening .reactor-outer,
.reactor-button.thinking .reactor-outer {
  box-shadow: 0 0 40px rgba(87,213,247,.38);
}
.reactor-button.listening .reactor-segments {
  border-color: rgba(246,184,79,.72);
  animation-duration: 7s;
}
.reactor-button.thinking .reactor-segments {
  animation-duration: 3.5s;
}
.reactor-button.responding .reactor-inner {
  box-shadow: 0 0 45px rgba(105,219,248,.52);
}

.reactor-axis {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(92,208,238,.25), transparent);
}
.axis-h { width: 330px; height: 1px; }
.axis-v {
  width: 1px;
  height: 330px;
  background: linear-gradient(180deg, transparent, rgba(92,208,238,.25), transparent);
}

.reactor-state {
  position: absolute;
  bottom: 3px;
  color: var(--cyan-2);
  font: 8px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .23em;
}

.greeting-block {
  margin-top: 3px;
  text-align: center;
}
.greeting-block h2 {
  margin: 7px 0 2px;
  color: var(--ice);
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 300;
  letter-spacing: -.02em;
}
.greeting-block p {
  margin: 0;
  color: #5f7e89;
  font: 9px "SFMono-Regular", Menlo, monospace;
}

.conversation-shell {
  max-width: 920px;
  margin: 0 auto;
  border-top: 1px solid rgba(111,218,247,.15);
  background: linear-gradient(180deg, rgba(3,16,22,.25), rgba(1,7,10,.12));
}
.conversation-header {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #47707c;
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .15em;
}
.conversation-header small { color: #395861; }

.chat-log {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(92,208,238,.22) transparent;
  padding: 4px 2px 12px;
}

.message {
  position: relative;
  max-width: 88%;
  margin: 7px 0;
  padding: 9px 13px 9px 15px;
  border-left: 1px solid;
  color: #a9c3cc;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  background: linear-gradient(90deg, rgba(17,71,86,.08), transparent);
}
.message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 1px;
  background: currentColor;
  opacity: .45;
}
.message.user {
  margin-left: auto;
  border-left-color: var(--amber);
  color: #d7c093;
  background: linear-gradient(90deg, rgba(112,77,25,.11), transparent);
}
.message.jarvis {
  border-left-color: var(--cyan-2);
}
.message-meta {
  display: block;
  margin-top: 5px;
  color: #365965;
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .05em;
}

.command-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 8px;
  padding: 8px 0 7px;
  border-top: 1px solid rgba(105,212,241,.12);
}
.composer-prefix {
  align-self: center;
  color: var(--amber);
  font: 10px "SFMono-Regular", Menlo, monospace;
}
.command-composer textarea {
  min-height: 35px;
  max-height: 110px;
  resize: none;
  padding: 7px 5px;
  border: 0;
  border-bottom: 1px solid rgba(106,211,239,.15);
  outline: none;
  color: var(--ice);
  background: transparent;
  font: 12px "SFMono-Regular", Menlo, monospace;
}
.command-composer textarea:focus {
  border-bottom-color: rgba(139,231,255,.48);
}
.composer-send {
  height: 34px;
  min-width: 74px;
  border: 1px solid rgba(117,218,245,.22);
  color: var(--cyan);
  background: rgba(18,79,96,.09);
  font: 8px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .12em;
  cursor: pointer;
}
.composer-send i {
  margin-left: 8px;
  color: var(--amber);
  font-style: normal;
}

/* ---------- MEMORY GRAPH ---------- */

.mode-heading {
  min-height: 76px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 15px 4px 11px;
  border-bottom: 1px solid rgba(102,209,239,.12);
}
.mode-heading h2 {
  margin: 5px 0 0;
  color: var(--ice);
  font-size: 25px;
  font-weight: 300;
  letter-spacing: .08em;
}
.mode-actions { display: flex; gap: 7px; }
.hud-action.small {
  padding: 7px 10px;
  font-size: 7px;
}

.memory-matrix {
  height: calc(100dvh - 190px);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 12px;
  padding-top: 12px;
}

.graph-shell {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(15,74,90,.11), transparent 52%),
    linear-gradient(rgba(93,201,231,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93,201,231,.035) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  border: 1px solid rgba(93,201,231,.14);
}
.graph-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.graph-shell canvas:active { cursor: grabbing; }

.graph-crosshair {
  position: absolute;
  pointer-events: none;
  opacity: .12;
  background: var(--cyan);
}
.graph-crosshair-x { left: 0; right: 0; top: 50%; height: 1px; }
.graph-crosshair-y { top: 0; bottom: 0; left: 50%; width: 1px; }

.graph-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #4f707a;
  font: 6px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .08em;
}
.legend-dot {
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--cyan-2);
}
.legend-dot.profile { background: #d4f8ff; }
.legend-dot.fact { background: #65d4ef; }
.legend-dot.project { background: var(--amber); }
.legend-dot.preference { background: #7797ff; }
.legend-dot.goal { background: #ffd279; }

.memory-inspector {
  padding: 18px 16px;
  background: linear-gradient(145deg, rgba(6,27,35,.62), rgba(1,9,13,.8));
  border: 1px solid rgba(92,201,230,.16);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.inspector-id {
  color: var(--amber);
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .12em;
}
.memory-inspector h3 {
  margin: 8px 0 8px;
  color: var(--ice);
  font-weight: 400;
  font-size: 17px;
}
.memory-inspector p {
  color: #75919a;
  font-size: 12px;
  line-height: 1.5;
}
.inspector-meta {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}
.inspector-meta div,
.inspector-links div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(96,203,232,.09);
  padding: 7px 0;
  color: #4f707a;
  font: 7px "SFMono-Regular", Menlo, monospace;
}
.inspector-meta strong,
.inspector-links button {
  color: #8bbbc8;
  font-weight: 500;
}
.inspector-links {
  margin-top: 18px;
}
.inspector-links h4 {
  margin: 0 0 6px;
  color: var(--cyan-2);
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .12em;
}
.inspector-links button {
  border: 0;
  background: none;
  cursor: pointer;
  text-align: right;
  padding: 0;
  font: inherit;
}

.mini-map-panel { min-height: 240px; }
.mini-graph-shell {
  height: 205px;
  border: 0;
}
.graph-expand {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 6px 8px;
  border: 1px solid rgba(111,214,243,.18);
  color: #6593a0;
  background: rgba(2,12,17,.72);
  font: 6px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .1em;
  cursor: pointer;
}

.node-preview {
  min-height: 105px;
  padding: 11px;
  color: #607e88;
  font-size: 11px;
  line-height: 1.45;
}
.preview-reticle {
  width: 28px; height: 28px;
  float: left;
  margin: 0 10px 5px 0;
  border: 1px dashed rgba(112,217,246,.28);
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(76,191,223,.08);
}

.signal-list { padding: 7px 10px; }
.signal-list div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #4d707a;
  font: 7px "SFMono-Regular", Menlo, monospace;
}
.signal-list strong { color: var(--green); font-weight: 500; }

/* ---------- TASKS / SYSTEM ---------- */

.task-grid,
.system-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  padding-top: 14px;
}

.task-ghost,
.system-module {
  min-height: 175px;
  padding: 16px;
  border: 1px solid rgba(98,203,232,.13);
  background: rgba(4,18,24,.38);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.ghost-index,
.module-id {
  color: var(--amber);
  font: 7px "SFMono-Regular", Menlo, monospace;
}
.task-ghost strong,
.system-module h3 {
  display: block;
  margin-top: 17px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
}
.task-ghost p {
  margin-top: 12px;
  color: #5d7983;
  font-size: 11px;
  line-height: 1.55;
}
.system-module h3 { font-size: 14px; margin: 7px 0 16px; }
.system-module dl { margin: 0; }
.system-module dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid rgba(94,197,226,.08);
}
.system-module dt,
.system-module dd {
  margin: 0;
  font: 8px "SFMono-Regular", Menlo, monospace;
}
.system-module dt { color: #506e78; }
.system-module dd { color: #89aeb9; text-align: right; }

/* ---------- NAV ---------- */

.hud-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(11px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  height: 48px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  background: rgba(2,10,14,.88);
  border: 1px solid rgba(97,202,231,.17);
  backdrop-filter: blur(16px);
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 13px 100%, 0 50%);
}
.hud-nav button {
  position: relative;
  border: 0;
  border-right: 1px solid rgba(95,198,226,.08);
  color: #456873;
  background: transparent;
  cursor: pointer;
}
.hud-nav button:last-child { border-right: 0; }
.hud-nav button.active {
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(44,153,184,.11), transparent);
}
.hud-nav button.active::before {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  top: 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(139,231,255,.6);
}
.nav-code {
  display: block;
  margin-bottom: 2px;
  color: #355561;
  font: 6px "SFMono-Regular", Menlo, monospace;
}
.hud-nav strong {
  font: 7px "SFMono-Regular", Menlo, monospace;
  letter-spacing: .13em;
}

/* ---------- ANIMATIONS ---------- */

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes spinReverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}
.reactor-field .halo-a,
.reactor-field .halo-b,
.reactor-field .halo-c {
  transform-origin: center;
}
.reactor-field .halo-a { animation-name: haloSpin; }
.reactor-field .halo-b { animation-name: haloSpinReverse; }
.reactor-field .halo-c { animation-name: haloSpin; }
@keyframes haloSpin { to { transform: rotate(360deg); } }
@keyframes haloSpinReverse { to { transform: rotate(-360deg); } }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1180px) {
  .helmet-layout {
    grid-template-columns: 210px minmax(0,1fr);
  }
  .rail-right { display: none; }
}

@media (max-width: 820px) {
  .app-screen {
    padding: calc(76px + env(safe-area-inset-top)) 12px calc(78px + env(safe-area-inset-bottom));
  }

  .hud-topbar {
    height: calc(64px + env(safe-area-inset-top));
    padding-left: 15px;
    padding-right: 15px;
  }

  .top-cluster.top-left { display: none; }
  .hud-topbar {
    grid-template-columns: 1fr auto;
  }
  .top-brand { text-align: left; }
  .top-cluster.top-right { min-width: 120px; }
  .top-right .hud-label,
  .top-right .connection-status { display: none; }
  .top-actions { position: static; justify-content: flex-end; }

  .helmet-layout {
    display: block;
  }
  .hud-rail { display: none; }

  .command-stage {
    min-height: 350px;
  }
  .reactor-field {
    width: 225px; height: 225px;
  }
  .axis-h { width: 280px; }
  .axis-v { height: 280px; }

  .conversation-shell {
    padding-bottom: 4px;
  }
  .chat-log {
    max-height: 34vh;
  }

  .memory-matrix {
    height: calc(100dvh - 205px);
    grid-template-columns: 1fr;
  }
  .memory-inspector {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 82px;
    z-index: 5;
    max-height: 34vh;
    overflow-y: auto;
    background: rgba(2,12,17,.94);
    transform: translateY(calc(100% + 120px));
    transition: transform .22s ease;
    pointer-events: none;
  }
  .memory-inspector.open {
    transform: translateY(0);
    pointer-events: auto;
  }

  .task-grid,
  .system-matrix {
    grid-template-columns: 1fr;
  }

  .mode-heading {
    min-height: 64px;
  }
  .mode-heading h2 { font-size: 20px; }

  .helmet-vignette {
    background:
      radial-gradient(ellipse at center,
        transparent 0 50%,
        rgba(0,0,0,.13) 73%,
        rgba(0,0,0,.62) 100%);
  }
}

@media (max-width: 520px) {
  .brand-main { font-size: 14px; }
  .brand-sub { font-size: 5px; }
  .helmet-login { padding: 34px 25px 26px; }

  .command-stage { min-height: 315px; }
  .reactor-field { transform: scale(.88); margin-top: -8px; margin-bottom: -10px; }
  .greeting-block h2 { font-size: 24px; }

  .chat-log { max-height: 31vh; }
  .message { max-width: 95%; font-size: 12px; }

  .command-composer {
    grid-template-columns: auto 1fr 48px;
  }
  .composer-send {
    min-width: 48px;
  }
  .composer-send span { display: none; }

  .hud-nav {
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* Local voice channel states */
.reactor-button.synthesizing .reactor-segments,
.reactor-button.transcribing .reactor-segments {
  animation-duration: 4.5s;
}

.reactor-button.synthesizing .reactor-inner {
  box-shadow: 0 0 42px rgba(246,184,79,.30);
}

.reactor-button.transcribing .reactor-outer {
  box-shadow: 0 0 38px rgba(139,231,255,.30);
}

#voiceStatus {
  transition: color .18s ease;
}
