
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Rajdhani:wght@400;500;600&display=swap");
:root {
  --void: #02060C;
  --navy: #041526;
  --cyan: #4DE8FF;
  --cyan-hot: #E8FCFF;
  --electric: #1AA8FF;
  --deep: #0A4A7A;
  --bloom: rgba(40, 200, 255, 0.55);
  --glass: rgba(8, 40, 70, 0.35);
  --level: 0;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; cursor: pointer;
  background: var(--void); color: var(--cyan-hot);
  font-family: Rajdhani, sans-serif;
}
body {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(50,220,255,0.42) 0%, rgba(20,120,200,0.22) 32%, #02060C 70%),
    var(--void);
}
.field { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0.9; }
.mast {
  position: fixed; top: 10px; left: 0; right: 0; text-align: center; z-index: 3;
  font: 500 9px Orbitron, sans-serif; letter-spacing: 0.46em; color: var(--cyan);
}
.shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 22vw minmax(0, 1fr) 26vw;
  grid-template-rows: 1fr 1fr minmax(18vh, 140px);
  grid-template-areas:
    "env core intel"
    "sys core intel"
    "cmd cmd cmd";
  height: 100dvh; padding: 18px; gap: 12px;
}
.zone { position: relative; min-height: 0; }
.zone-env, .zone-sys, .zone-intel {
  background: rgba(8, 40, 70, 0.45);
  box-shadow: inset 0 0 0 1px rgba(77, 232, 255, 0.28);
}
.zone-env { grid-area: env; display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.zone-sys { grid-area: sys; padding: 6px 4px; }
.zone-core { grid-area: core; display: flex; flex-direction: column; align-items: center; justify-content: center; background: none; border: 0; box-shadow: none; gap: 8px; }
.zone-intel { grid-area: intel; display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 8px 10px; }
.zone-cmd {
  grid-area: cmd; display: grid;
  grid-template-columns: 160px 1fr 72px;
  grid-template-rows: 1fr auto auto;
  align-items: center; gap: 8px 16px;
  min-height: 18vh;
  background: linear-gradient(180deg, rgba(8,40,70,0.0), rgba(8,40,70,0.45));
  box-shadow: inset 0 1px 0 rgba(77,232,255,0.35);
  padding: 8px 12px 6px;
}
.core-clip {
  width: min(42vw, 52vh);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  -webkit-clip-path: circle(50% at 50% 50%);
  background: transparent;
  box-shadow: none;
}
#core { width: 100%; height: 100%; display: block; background: transparent; border: 0; }
.env-read .time { font: 600 28px Orbitron, sans-serif; letter-spacing: 0.12em; color: var(--cyan-hot); }
.env-read .date, .env-read .loc, .env-read .wx {
  font: 500 15px Rajdhani, sans-serif; color: var(--cyan); letter-spacing: 0.14em;
}
.zone-intel .k {
  display: block; font: 500 8px Orbitron, sans-serif; letter-spacing: 0.32em; color: var(--electric);
}
.zone-intel .col { position: relative; padding: 4px 0 4px 10px; }
.zone-intel .col::before {
  content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px;
  border-left: 1px solid var(--cyan); border-top: 1px solid var(--cyan);
}
.zone-intel p { margin: 2px 0 0; font: 500 15px/1.25 Rajdhani, sans-serif; color: #D8F6FF; }
#tools i { font-style: normal; margin-right: 10px; opacity: 0.28; letter-spacing: 0.16em; font: 500 10px Orbitron, sans-serif; }
#tools i.on { opacity: 1; color: var(--cyan-hot); }
.zone-intel .data { flex: 1; min-height: 0; overflow: auto; }
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) 18% 16% 10%;
  font: 500 13px/1.25 Rajdhani, sans-serif; color: #D8F6FF;
  padding: 3px 0 3px 4px;
}
.row .tick { width: 1px; height: 11px; margin: 2px auto 0; background: transparent; }
.row.overdue .tick { background: var(--cyan-hot); }
.row.overdue b { color: var(--cyan-hot); }
.row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .pri { font: 500 8px Orbitron, sans-serif; text-align: right; color: var(--cyan); }
#reply {
  margin: 0; font: 500 18px/1.25 Rajdhani, sans-serif; letter-spacing: 0.04em;
  color: var(--cyan-hot); max-height: 2.5em; overflow: hidden;
}
#reply.hint { color: rgba(77, 232, 255, 0.55); font-weight: 400; }
#form { grid-column: 1 / -1; }
#form input {
  width: 100%; border: 0; border-bottom: 1px solid rgba(77,232,255,0.45);
  background: transparent; color: var(--cyan-hot); outline: 0;
  font: 500 14px Rajdhani, sans-serif; text-align: center; padding: 4px 0;
}
button.send, .mic { display: none; }
.mic-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--cyan); display: grid; place-items: center;
  box-shadow: 0 0 16px var(--bloom);
}
.mic-ring b { font: 500 8px Orbitron, sans-serif; letter-spacing: 0.2em; }
body.blocked .mic-ring { border-color: rgba(77,232,255,0.35); box-shadow: none; }

.zone-intel .col { display: grid; grid-template-columns: 1fr auto; align-items: start; }
.zone-intel .k { grid-column: 1 / -1; }
.zone-intel .bar { height: 3px; width: 56px; background: rgba(77,232,255,0.18); margin-top: 8px; }
.zone-intel .bar i { display: block; height: 100%; background: #4DE8FF; width: 30%; }
body.thinking .zone-intel .bar i { animation: crawl 1.1s linear infinite; }
@keyframes crawl { 0% { width: 12%; } 100% { width: 100%; } }
.lamps { display: flex; gap: 5px; margin-top: 6px; grid-column: 1 / -1; }
.lamps b { width: 4px; height: 4px; border-radius: 50%; background: rgba(77,232,255,0.25); display: block; }
body.live .lamps b[data-s="armed"], body:not(.command):not(.thinking):not(.speaking) .lamps b[data-s="armed"] { background: #E8FCFF; box-shadow: 0 0 8px var(--bloom); }
body.command .lamps b[data-s="command"] { background: #E8FCFF; box-shadow: 0 0 8px var(--bloom); }
body.thinking .lamps b[data-s="thinking"] { background: #E8FCFF; box-shadow: 0 0 8px var(--bloom); }
body.speaking .lamps b[data-s="speaking"] { background: #E8FCFF; box-shadow: 0 0 8px var(--bloom); }
.zone-cmd { box-shadow: inset 0 1px 0 rgba(77,232,255,0.7); background: rgba(8,40,70,0.08); }
#wave { width: 200px; height: 48px; }
.dust { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.state-chip {
  display: flex; align-items: center; gap: 8px;
  font: 500 10px Orbitron, sans-serif; letter-spacing: 0.22em;
  color: var(--cyan-hot); pointer-events: none; z-index: 2;
}
.state-chip i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--bloom);
}
.state-chip span {
  font: 500 11px Rajdhani, sans-serif; letter-spacing: 0.12em;
  color: var(--cyan); text-transform: none;
}
#route .pill, .pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px 2px 10px;
  border: 1px solid rgba(77, 232, 255, 0.55);
  background: rgba(8, 40, 70, 0.45);
  border-radius: 999px;
  font: 600 11px Orbitron, sans-serif;
  letter-spacing: 0.14em;
  color: var(--cyan-hot);
}

.zone-core { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
#reply.hint { color: rgba(216,246,255,0.42); }
.zone-env, .zone-sys {
  background: linear-gradient(180deg, rgba(10,50,90,0.22), rgba(4,18,36,0.08));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(77,232,255,0.14);
  box-shadow: inset 0 1px 0 rgba(232,252,255,0.08);
}
.zone-intel .col {
  background: linear-gradient(180deg, rgba(10,50,90,0.20), rgba(4,18,36,0.06));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(77,232,255,0.12);
  padding: 6px 8px 6px 12px;
}

.wake-line {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  text-align: center;
  font: 500 9px Orbitron, sans-serif;
  letter-spacing: 0.28em;
  color: rgba(77,232,255,0.58);
}

.match-line {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font: 500 9px Orbitron, sans-serif;
  letter-spacing: 0.22em;
  color: var(--cyan);
}

.sheet {
  display: block;
  position: fixed; left: 10px; right: auto; top: 72px; bottom: 120px;
  width: 240px; max-width: 240px; min-height: 420px;
  z-index: 6; overflow: auto;
  background: rgba(8, 40, 70, 0.18);
  color: #D8F6FF;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid #5FE3E0;
  box-shadow: 0 0 28px rgba(40, 200, 255, 0.18);
  padding: 14px 16px;
}
.sheet header { font: 500 12px Orbitron, sans-serif; letter-spacing: 0.28em; color: var(--cyan-hot); margin-bottom: 10px; }
.sheet-head { display: none; }
.sheet-row {
  display: block; padding: 8px 0;
  border-top: 1px solid rgba(77,232,255,0.14);
  font: 500 13px/1.3 Rajdhani, sans-serif; color: #D8F6FF;
}
.sheet-row b { display: block; font-weight: 600; white-space: normal; overflow: visible; word-break: break-word; color: var(--cyan-hot); }
.sheet-row span { display: block; white-space: normal; overflow: visible; word-break: break-word; opacity: 0.82; }

.corners { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.corners .c {
  position: absolute; font: 500 10px Orbitron, sans-serif;
  letter-spacing: 0.22em; color: rgba(77,232,255,0.78);
  display: flex; flex-direction: column; gap: 3px;
}
.corners .c b { color: var(--cyan-hot); font-weight: 600; }
.corners .tl { top: 28px; left: 22px; }
.corners .tr { top: 28px; right: 22px; align-items: flex-end; }
.corners .bl { bottom: 22px; left: 22px; }
.corners .br { bottom: 22px; right: 22px; align-items: flex-end; text-align: right; }
#c-led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--bloom);
  display: inline-block; margin-bottom: 4px;
}
body.speaking #c-led, body.thinking #c-led, body.command #c-led {
  animation: led 0.7s ease-in-out infinite;
}
@keyframes led { 50% { opacity: 0.25; } }
body.thinking { --bloom: rgba(40, 200, 255, 0.67); }
body.thinking {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(50,220,255,0.54) 0%, rgba(20,120,200,0.28) 32%, #02060C 70%),
    var(--void);
}

body.has-sheet .zone-intel .col.data {
  background: rgba(8, 40, 70, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #5FE3E0;
  box-shadow: 0 0 22px rgba(40, 200, 255, 0.16);
  padding: 8px 10px;
}
.row.sheet {
  grid-template-columns: 1.3fr 0.9fr 1.2fr 0.6fr;
  align-items: start;
}
.row.sheet .staff { white-space: normal; overflow: visible; line-height: 1.25; }

.field .traces { opacity: 0.72; }
.field .traces path { stroke-dasharray: 14 22; animation: run 2.4s linear infinite; }
@keyframes run { to { stroke-dashoffset: -260; } }
body.thinking .field .traces { opacity: 0.58; }
body.thinking .field .traces path { animation-duration: 2.1s; }
body.speaking .field .traces { opacity: 0.4; }

#g-time { display: none; }
.wake-line { display: none; }

body.has-sheet .zone-intel .col.data .rows { display: none; }
body.has-sheet .zone-intel .col.data { border-color: transparent; background: transparent; box-shadow: none; }

body.has-sheet .zone-intel .col.data { display: none; }
body.has-sheet .zone-sys { visibility: hidden; }

.sheet[hidden] { display: none !important; }
.sheet.open {
  display: block !important;
  width: 240px !important;
  min-height: 420px !important;
}
body.has-sheet .zone-intel .col.data { display: none !important; }

.sheet-row .line { display: flex; align-items: baseline; gap: 8px; }
.sheet-row .line b { display: inline; flex: 0 1 auto; }
.sheet-row .brand { opacity: 0.45; flex: 1; }
.sheet-row .when { margin-left: auto; opacity: 0.55; white-space: nowrap; }
.sheet-row .staff { opacity: 0.5; margin-top: 2px; }

.mem-line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
  padding: 0 0 0 10px;
  background: none;
  border: 0;
  box-shadow: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.mem-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 8px;
  transform: translateY(-50%);
  background: #5FE3E0;
}
.mem-line .mem-k {
  font: 500 10px Orbitron, sans-serif;
  letter-spacing: 0.18em;
  color: #4DE8FF;
}
.mem-line .mem-town {
  font: 600 12px Rajdhani, sans-serif;
  letter-spacing: 0;
  color: #E8FCFF;
}
.mem-line.fade { opacity: 0.4; }
.mem-line.under-sheet {
  position: fixed;
  left: 10px;
  bottom: 96px;
  width: 240px;
  z-index: 7;
}

.visit-listen { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.visit-listen[hidden] { display: none !important; }
#visit-wave { width: 160px; height: 36px; display: block; }
.sheet-sub { font: 500 11px Orbitron, sans-serif; letter-spacing: 0.16em; color: #4DE8FF; margin: 0 0 8px; }
body.success #state-lab, body.success #c-state { color: #4DE8FF; }

.zone-core, .core-clip {
  transition: width 420ms ease, height 420ms ease, right 420ms ease, left 420ms ease, top 420ms ease, bottom 420ms ease, transform 420ms ease;
}
body.live .zone-core,
body.has-sheet .zone-core {
  position: fixed;
  top: 0;
  right: 24px;
  bottom: max(18vh, 148px);
  left: auto;
  width: 22vh;
  z-index: 4;
  align-items: center;
  justify-content: center;
}
body.live .core-clip,
body.has-sheet .core-clip {
  width: 22vh;
  height: 22vh;
}
body.has-sheet .sheet.open {
  left: 24px;
  right: calc(24px + 22vh + 16px);
  width: auto !important;
  max-width: none !important;
}
.mem-line.under-sheet {
  left: 24px;
  width: auto;
  right: calc(24px + 22vh + 16px);
}
