:root {
  --wr-bg: #04070f;
  --wr-panel: #0c1324;
  --wr-grid: #1f314e;
  --wr-neon: #7ef0ff;
  --wr-accent: #9a7bff;
  --wr-text: #dbe8ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--wr-text);
  background:
    linear-gradient(0deg, rgba(126, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 240, 255, 0.08) 1px, transparent 1px),
    var(--wr-bg);
  background-size: 24px 24px, 24px 24px, auto;
}
body.wraith-frozen { overflow: hidden; }
.wraith-header {
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid rgba(126, 240, 255, 0.35);
  background: rgba(4, 7, 15, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 55;
}
.wraith-id {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--wr-text);
  text-decoration: none;
}
.wraith-id img { width: 46px; height: 38px; }
.wraith-id span {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  letter-spacing: 0.08em;
}
.wraith-ham {
  justify-self: end;
  border: 1px solid var(--wr-neon);
  background: transparent;
  color: var(--wr-neon);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 1.2rem;
  cursor: pointer;
}
.wraith-nav {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
}
.wraith-nav.live { display: flex; }
.wraith-nav a {
  color: var(--wr-text);
  text-decoration: none;
  border: 1px solid rgba(154, 123, 255, 0.4);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}
.wraith-nav a:hover,
.wraith-nav a:focus-visible { border-color: var(--wr-neon); }
.wraith-main {
  width: min(1380px, 100% - 1.5rem);
  margin: 1rem auto 2rem;
  display: grid;
  gap: 0.9rem;
}
.wraith-prime,
.wraith-alerts,
.wraith-terminal,
.wraith-sidecar article,
.wraith-doc {
  border: 1px solid rgba(126, 240, 255, 0.2);
  background: linear-gradient(155deg, rgba(12, 19, 36, 0.95), rgba(8, 13, 28, 0.95));
  border-radius: 14px;
  padding: 1rem;
}
.wraith-prime h1,
.wraith-doc h1 {
  margin-top: 0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(1.8rem, 5.4vw, 3rem);
}
.wraith-alerts h2,
.wraith-terminal h2,
.wraith-sidecar h2 {
  margin-top: 0;
  font-family: 'Chakra Petch', sans-serif;
}
.wraith-alerts ul { margin: 0.5rem 0 0; padding-left: 1rem; line-height: 1.7; }
.wraith-capsule {
  border: 1px solid rgba(126, 240, 255, 0.42);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  min-height: 460px;
}
.wraith-capsule.full { min-height: 72vh; }
.wraith-capsule iframe {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
}
.wraith-sidecar {
  display: grid;
  gap: 0.85rem;
}
.wraith-doc {
  width: min(1140px, 100% - 1.5rem);
  margin: 1rem auto 2rem;
  line-height: 1.75;
  color: #c4d5f6;
}
.wraith-footer {
  margin: 0 0.8rem 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(126, 240, 255, 0.3);
  border-radius: 14px;
  color: #b5c8ec;
}
.wraith-footer div {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.wraith-footer a { color: var(--wr-neon); text-decoration: none; }
.wraith-age {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 90;
}
.wraith-age[hidden] { display: none; }
.wraith-age-pane {
  width: min(460px, 100%);
  background: var(--wr-panel);
  border: 1px solid rgba(126, 240, 255, 0.5);
  border-radius: 14px;
  padding: 1rem;
}
.wraith-age-pane h2 {
  margin-top: 0;
  font-family: 'Chakra Petch', sans-serif;
}
.wraith-age-pane div {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.wraith-age-pane button {
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
#wraith-ok { background: var(--wr-neon); color: #011824; }
#wraith-out { background: #26385f; color: #e6f0ff; }
@media (min-width: 940px) {
  .wraith-header {
    grid-template-columns: auto 1fr;
    padding-inline: 1.3rem;
  }
  .wraith-ham { display: none; }
  .wraith-nav {
    display: flex;
    flex-direction: row;
    justify-self: end;
    gap: 0.45rem;
  }
  .wraith-main {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-areas:
      'prime alerts'
      'terminal terminal'
      'side side';
  }
  .wraith-prime { grid-area: prime; }
  .wraith-alerts { grid-area: alerts; }
  .wraith-terminal { grid-area: terminal; }
  .wraith-sidecar {
    grid-area: side;
    grid-template-columns: 1fr 1fr;
  }
}