/* ==========================================================================
   AEGIS HALL — premiere immersion (The Epistolary vision)
   Distinct from Orbital Command Deck (obsidian/crimson/gold).
   Palette: argent · sapphire · violet · cold white · deep slate.
   Law: maximal spectacle DEFAULT. prefers-reduced-motion = optional hatch.
   Chat well stays opaque/readable. Continuum payments untouched.
   ========================================================================== */

.aegis-hall,
.aegis-deck {
  --ah-void: #05060d;
  --ah-slate: #0b1020;
  --ah-panel: rgba(10, 16, 36, 0.92);
  --ah-well: rgba(6, 10, 22, 0.94);
  --ah-argent: #e8f1ff;
  --ah-sapphire: #3d7cff;
  --ah-sapphire-bright: #6aa8ff;
  --ah-violet: #7b5cff;
  --ah-cyan: #5ef2ff;
  --ah-ink: #f4f7ff;
  --ah-muted: #a8b4d4;
  --ah-glow: rgba(94, 242, 255, 0.55);
  --ah-rim: rgba(122, 168, 255, 0.45);
}

/* ---- Full-screen /room/aegis ------------------------------------------- */
body.aegis-deck.room-full {
  background: var(--ah-void) !important;
  color: var(--ah-ink);
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}

/* Layer stack: bg < mid < chrome/well < fg < fx canvas */
.ah-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}
.ah-layer-bg {
  z-index: 0;
  background-image: url('/img/aegis/aegis-bg-loop.webp'), url('/img/aegis/aegis-bg-loop.gif');
  animation: ah-bg-drift 28s ease-in-out infinite alternate,
             ah-bg-hue 18s linear infinite;
  filter: saturate(1.25) contrast(1.08) brightness(1.05);
  transform: scale(1.08);
}
.ah-layer-mid {
  z-index: 1;
  background-image: url('/img/aegis/aegis-mid-holo.webp'), url('/img/aegis/aegis-mid-holo.gif');
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: ah-mid-parallax 16s ease-in-out infinite alternate,
             ah-holo-flicker 3.2s steps(2, end) infinite;
}
.ah-layer-fg {
  z-index: 6;
  background-image: url('/img/aegis/aegis-fg-sparkle.webp'), url('/img/aegis/aegis-fg-sparkle.gif');
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: ah-fg-drift 11s ease-in-out infinite alternate;
}
.ah-fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.ah-scanlines {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(94, 242, 255, 0.03) 2px,
    rgba(94, 242, 255, 0.03) 3px
  );
  animation: ah-scan-crawl 6s linear infinite;
  mix-blend-mode: soft-light;
  opacity: 0.7;
}
.ah-vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, transparent 40%, rgba(5, 6, 13, 0.55) 100%),
    linear-gradient(180deg, rgba(61, 124, 255, 0.12), transparent 18%, transparent 82%, rgba(123, 92, 255, 0.18));
  animation: ah-vig-pulse 7s ease-in-out infinite;
}
.ah-energy-ribbon {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  height: 2px;
  width: 140%;
  left: -20%;
  background: linear-gradient(90deg, transparent, var(--ah-cyan), var(--ah-sapphire-bright), var(--ah-violet), transparent);
  box-shadow: 0 0 18px var(--ah-glow), 0 0 40px rgba(61, 124, 255, 0.45);
  opacity: 0.65;
  animation: ah-ribbon-sweep 9s linear infinite;
}
.ah-energy-ribbon.r2 { top: 28%; animation-duration: 11s; animation-delay: -3s; opacity: 0.45; }
.ah-energy-ribbon.r3 { top: 72%; animation-duration: 13s; animation-delay: -6s; opacity: 0.4; filter: hue-rotate(40deg); }
.ah-energy-ribbon.r1 { top: 48%; }

@keyframes ah-bg-drift {
  0% { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
  100% { transform: scale(1.14) translate3d(1.5%, 1.2%, 0); }
}
@keyframes ah-bg-hue {
  0% { filter: saturate(1.25) contrast(1.08) brightness(1.05) hue-rotate(0deg); }
  50% { filter: saturate(1.4) contrast(1.12) brightness(1.1) hue-rotate(12deg); }
  100% { filter: saturate(1.25) contrast(1.08) brightness(1.05) hue-rotate(0deg); }
}
@keyframes ah-mid-parallax {
  0% { transform: translate3d(-2%, 1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -1.5%, 0) scale(1.1); }
}
@keyframes ah-fg-drift {
  0% { transform: translate3d(0, 0, 0) scale(1.02); }
  100% { transform: translate3d(-1.5%, 2%, 0) scale(1.08); }
}
@keyframes ah-holo-flicker {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.72; }
  52% { opacity: 0.95; }
  54% { opacity: 0.7; }
  80% { opacity: 0.88; }
}
@keyframes ah-scan-crawl {
  0% { background-position: 0 0; }
  100% { background-position: 0 60px; }
}
@keyframes ah-vig-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
@keyframes ah-ribbon-sweep {
  0% { transform: translateX(-15%) rotate(-6deg); }
  100% { transform: translateX(15%) rotate(-6deg); }
}
@keyframes ah-glow-pulse {
  0%, 100% { opacity: 0.55; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.35); }
}
@keyframes ah-emblem-spin-soft {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}
@keyframes ah-title-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes ah-panel-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--ah-rim), 0 0 24px rgba(61, 124, 255, 0.25), inset 0 0 40px rgba(94, 242, 255, 0.04); }
  50% { box-shadow: 0 0 0 1px var(--ah-cyan), 0 0 40px rgba(94, 242, 255, 0.35), inset 0 0 50px rgba(123, 92, 255, 0.08); }
}

/* Room chrome above mid, below fg */
body.aegis-deck .room-bar {
  position: relative;
  z-index: 8;
  background: linear-gradient(180deg, rgba(8, 12, 28, 0.92), rgba(8, 12, 28, 0.72)) !important;
  border-bottom: 1px solid var(--ah-rim) !important;
  box-shadow: 0 0 30px rgba(61, 124, 255, 0.25);
  backdrop-filter: blur(8px);
}
body.aegis-deck .room-name {
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--ah-argent), var(--ah-cyan), var(--ah-sapphire-bright), var(--ah-argent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ah-title-shimmer 4s linear infinite;
  font-weight: 700;
}
body.aegis-deck .ah-banner {
  position: relative;
  z-index: 8;
  margin: 0;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-argent);
  background: linear-gradient(90deg, transparent, rgba(61, 124, 255, 0.22), rgba(123, 92, 255, 0.28), rgba(61, 124, 255, 0.22), transparent);
  border-bottom: 1px solid rgba(94, 242, 255, 0.25);
  animation: ah-glow-pulse 4.5s ease-in-out infinite;
}
body.aegis-deck .ah-telem {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}
body.aegis-deck .ah-telem-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(94, 242, 255, 0.28);
  border-radius: 999px;
  background: rgba(10, 16, 36, 0.65);
  color: var(--ah-muted);
}
body.aegis-deck .ah-telem-item .val { color: var(--ah-cyan); font-weight: 700; }
body.aegis-deck .ah-telem-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ah-cyan);
  box-shadow: 0 0 8px var(--ah-glow);
  animation: ah-glow-pulse 1.8s ease-in-out infinite;
}
body.aegis-deck .ah-emblem {
  width: 36px; height: 40px;
  background: url('/img/aegis/aegis-emblem-loop.webp') center / contain no-repeat;
  animation: ah-emblem-spin-soft 6s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--ah-glow));
}

/* OPAQUE chat well — readability is law */
body.aegis-deck .ah-well,
body.aegis-deck .chat-messages.ah-well,
.aegis-hall .chat-messages.ah-well {
  position: relative;
  z-index: 8;
  background: var(--ah-well) !important;
  border: 1px solid var(--ah-rim) !important;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(94, 242, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 60px rgba(61, 124, 255, 0.06);
  color: var(--ah-ink) !important;
  animation: ah-panel-breathe 5.5s ease-in-out infinite;
}
body.aegis-deck .ah-well .chat-msg,
.aegis-hall .ah-well .chat-msg,
body.aegis-deck .ah-well .msg,
.aegis-hall .chat-messages .msg {
  color: var(--ah-ink);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}
body.aegis-deck .room-form,
body.aegis-deck .chat-form.room-form {
  position: relative;
  z-index: 8;
  background: rgba(8, 12, 28, 0.94) !important;
  border-top: 1px solid var(--ah-rim);
  backdrop-filter: blur(10px);
}
body.aegis-deck .room-roster {
  position: relative;
  z-index: 9;
  background: var(--ah-panel) !important;
  border: 1px solid var(--ah-rim);
  box-shadow: 0 0 30px rgba(61, 124, 255, 0.3);
}

/* ---- /chat/aegis panel immersion --------------------------------------- */
.aegis-hall.chat-panel,
section.aegis-hall {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 16, 36, 0.88), rgba(6, 10, 22, 0.94)),
    url('/img/aegis/aegis-cathedral-plate.webp') center / cover no-repeat !important;
  border: 1px solid var(--ah-rim) !important;
  box-shadow: 0 0 0 1px rgba(94, 242, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 80px rgba(61, 124, 255, 0.08);
  animation: ah-panel-breathe 6s ease-in-out infinite;
}
.aegis-hall .ah-panel-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}
.aegis-hall .ah-panel-layers .ah-layer-bg,
.aegis-hall .ah-panel-layers .ah-layer-mid,
.aegis-hall .ah-panel-layers .ah-layer-fg {
  position: absolute;
  inset: -4%;
}
.aegis-hall .ah-panel-layers .ah-layer-bg { z-index: 0; opacity: 0.55; }
.aegis-hall .ah-panel-layers .ah-layer-mid { z-index: 1; opacity: 0.7; }
.aegis-hall .ah-panel-layers .ah-layer-fg { z-index: 3; opacity: 0.75; }
.aegis-hall .ah-lobby-head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.35rem;
}
.aegis-hall .ah-lobby-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--ah-argent), var(--ah-cyan), var(--ah-violet), var(--ah-argent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ah-title-shimmer 5s linear infinite;
  font-weight: 800;
}
.aegis-hall .ah-banner {
  position: relative;
  z-index: 2;
  margin: 0 1rem 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ah-argent);
  border: 1px solid rgba(94, 242, 255, 0.25);
  border-radius: 6px;
  background: rgba(61, 124, 255, 0.12);
  animation: ah-glow-pulse 4s ease-in-out infinite;
}
.aegis-hall .chat-main {
  position: relative;
  z-index: 2;
}
.aegis-hall .chat-topic {
  color: var(--ah-muted) !important;
  border-color: rgba(94, 242, 255, 0.2) !important;
}
.aegis-hall .chat-form,
.aegis-hall .chat-form textarea {
  background: rgba(8, 12, 28, 0.9) !important;
  color: var(--ah-ink) !important;
  border-color: var(--ah-rim) !important;
}
.aegis-hall .chat-form textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(94, 242, 255, 0.35), 0 0 20px rgba(61, 124, 255, 0.25);
}

/* Floating emblem ornament on panel */
.aegis-hall .ah-float-emblem {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 56px;
  height: 64px;
  z-index: 3;
  pointer-events: none;
  background: url('/img/aegis/aegis-emblem-loop.webp') center / contain no-repeat;
  animation: ah-emblem-spin-soft 5s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--ah-glow));
  opacity: 0.9;
}

/* Rulers Quarter link card (optional boost) */
.ah-rulers-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(94, 242, 255, 0.35);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(61, 124, 255, 0.15), rgba(123, 92, 255, 0.18));
  text-decoration: none;
  color: var(--ah-argent);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.ah-rulers-link:hover {
  box-shadow: 0 0 24px rgba(94, 242, 255, 0.35);
  transform: translateY(-1px);
}
.ah-rulers-link .ah-emblem { width: 28px; height: 32px; }

/* Mobile readable — spectacle stays ON */
@media (max-width: 640px) {
  .ah-layer-bg { opacity: 0.95; }
  .ah-layer-mid { opacity: 0.75; }
  .ah-layer-fg { opacity: 0.8; }
  body.aegis-deck .ah-well,
  .aegis-hall .chat-messages.ah-well {
    background: rgba(6, 10, 22, 0.96) !important;
  }
  .aegis-hall .ah-lobby-title { font-size: 0.8rem; letter-spacing: 0.08em; }
}

/* Optional escape hatch — quieter, NOT the default */
@media (prefers-reduced-motion: reduce) {
  .ah-layer-bg,
  .ah-layer-mid,
  .ah-layer-fg,
  .ah-scanlines,
  .ah-energy-ribbon,
  .ah-vignette,
  body.aegis-deck .room-name,
  .aegis-hall .ah-lobby-title,
  .aegis-hall .ah-banner,
  body.aegis-deck .ah-banner,
  body.aegis-deck .ah-emblem,
  .aegis-hall .ah-float-emblem,
  body.aegis-deck .ah-well,
  section.aegis-hall {
    animation: none !important;
  }
  .ah-fx-canvas { display: none; }
  .ah-layer-mid, .ah-layer-fg { opacity: 0.45; }
  .ah-scanlines { opacity: 0.25; }
}

/* ==========================================================================
   AEGIS HALL — ARCHITECTURE ENHANCEMENT + PREMIUM CHROME (SIGNED INTO LAW)
   Vaults · colonnades · holo arches · corridors · buttress light · parallax
   Premium typography · glass/metal UI · micro-interactions · ambient opt-in
   Scope: .aegis-hall / body.aegis-deck only. Orbital untouched.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;800&family=Rajdhani:wght@500;600;700&display=swap');

.aegis-hall,
.aegis-deck {
  --ah-font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --ah-font-ui: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --ah-px: 0;
  --ah-py: 0;
}

/* ---- Architecture plates (behind + mid stack) -------------------------- */
.ah-layer-vault {
  z-index: 0;
  background-image: url('/img/aegis/aegis-arch-vault.svg');
  background-size: cover;
  background-position: center top;
  mix-blend-mode: screen;
  opacity: 0.82;
  animation: ah-vault-breathe 14s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * -10px), calc(var(--ah-py) * -8px), 0) scale(1.06);
}
.ah-layer-corridor {
  z-index: 1;
  background-image: url('/img/aegis/aegis-arch-corridor.svg');
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.52;
  animation: ah-corridor-depth 20s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * -6px), calc(var(--ah-py) * -4px), 0) scale(1.05);
}
.ah-layer-holoarch {
  z-index: 2;
  background-image: url('/img/aegis/aegis-arch-holo.svg');
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.68;
  animation: ah-holoarch-pulse 9s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * 7px), calc(var(--ah-py) * 5px), 0) scale(1.04);
}
.ah-layer-colonnade {
  z-index: 2;
  background-image: url('/img/aegis/aegis-arch-colonnade.svg');
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: ah-colonnade-sway 18s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * 14px), calc(var(--ah-py) * 3px), 0) scale(1.03);
}
.ah-layer-buttress {
  z-index: 3;
  background-image: url('/img/aegis/aegis-arch-buttress.svg');
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: ah-buttress-sweep 11s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * 4px), calc(var(--ah-py) * 10px), 0);
}

/* bg/mid/fg keep their transform animations; architecture plates carry mouse parallax */

@keyframes ah-vault-breathe {
  0% { opacity: 0.7; }
  100% { opacity: 0.92; }
}
@keyframes ah-corridor-depth {
  0% { opacity: 0.4; filter: brightness(0.95); }
  100% { opacity: 0.62; filter: brightness(1.1); }
}
@keyframes ah-holoarch-pulse {
  0% { opacity: 0.5; filter: hue-rotate(0deg); }
  100% { opacity: 0.82; filter: hue-rotate(16deg); }
}
@keyframes ah-colonnade-sway {
  0% { opacity: 0.6; }
  100% { opacity: 0.85; }
}
@keyframes ah-buttress-sweep {
  0% { opacity: 0.35; }
  100% { opacity: 0.65; }
}
@keyframes ah-send-flare {
  0% { filter: drop-shadow(0 0 0 rgba(94,242,255,0)); transform: scale(1); }
  40% { filter: drop-shadow(0 0 16px rgba(94,242,255,0.9)); transform: scale(1.12); }
  100% { filter: drop-shadow(0 0 0 rgba(94,242,255,0)); transform: scale(1); }
}
@keyframes ah-msg-arrive {
  from { opacity: 0; transform: translateY(8px); filter: blur(1.5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes ah-presence-ping {
  0% { box-shadow: 0 0 0 0 rgba(94, 242, 255, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(94, 242, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 242, 255, 0); }
}
@keyframes ah-chrome-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Premium typography on Aegis surfaces */
body.aegis-deck,
.aegis-hall {
  font-family: var(--ah-font-ui);
}
body.aegis-deck .room-name,
.aegis-hall .ah-lobby-title {
  font-family: var(--ah-font-display) !important;
  font-weight: 800;
  letter-spacing: 0.16em !important;
}
body.aegis-deck .ah-banner,
.aegis-hall .ah-banner {
  font-family: var(--ah-font-ui);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-shadow: 0 0 14px rgba(94, 242, 255, 0.35);
}
body.aegis-deck .ah-telem,
.aegis-hall .ah-telem {
  font-family: var(--ah-font-display);
  letter-spacing: 0.08em;
}

/* Glass / metal chrome upgrades for chat well + form */
body.aegis-deck .ah-well,
body.aegis-deck .chat-messages.ah-well,
.aegis-hall .chat-messages.ah-well {
  background:
    linear-gradient(165deg, rgba(14, 22, 48, 0.97), rgba(6, 10, 22, 0.98)) !important;
  border-radius: 14px !important;
  border: 1px solid rgba(122, 168, 255, 0.5) !important;
  box-shadow:
    0 0 0 1px rgba(94, 242, 255, 0.1),
    0 16px 48px rgba(0, 0, 0, 0.58),
    inset 0 0 70px rgba(61, 124, 255, 0.08),
    inset 0 1px 0 rgba(232, 241, 255, 0.14) !important;
  backdrop-filter: blur(10px) saturate(1.15);
  scroll-behavior: smooth;
  font-size: 1.02rem;
  line-height: 1.48;
  letter-spacing: 0.01em;
}
body.aegis-deck .ah-well .chat-msg,
.aegis-hall .ah-well .chat-msg,
body.aegis-deck .ah-well .msg,
.aegis-hall .chat-messages .msg {
  animation: ah-msg-arrive 0.36s ease-out;
}
body.aegis-deck .room-bar {
  backdrop-filter: blur(14px) saturate(1.2) !important;
  border-image: linear-gradient(90deg, transparent, #5ef2ff, #7b5cff, transparent) 1;
}
body.aegis-deck .room-form,
body.aegis-deck .chat-form.room-form,
.aegis-hall .chat-form {
  background: linear-gradient(180deg, rgba(10, 16, 36, 0.94), rgba(8, 12, 28, 0.97)) !important;
  backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(232, 241, 255, 0.08);
}
body.aegis-deck .room-form textarea,
body.aegis-deck .chat-form.room-form textarea,
.aegis-hall .chat-form textarea {
  font-family: var(--ah-font-ui) !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.02em;
  border-radius: 10px !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
body.aegis-deck .room-form textarea:focus,
.aegis-hall .chat-form textarea:focus {
  border-color: var(--ah-cyan) !important;
  box-shadow: 0 0 0 2px rgba(94, 242, 255, 0.3), 0 0 22px rgba(61, 124, 255, 0.28);
}
body.aegis-deck .send-img,
.aegis-hall .send-img {
  transition: transform 0.2s ease, filter 0.2s ease;
}
body.aegis-deck .send-img:hover,
.aegis-hall .send-img:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 12px var(--ah-glow));
}
body.aegis-deck .send-img.ah-sent,
.aegis-hall .send-img.ah-sent {
  animation: ah-send-flare 0.55s ease-out;
}
body.aegis-deck .ah-telem-dot,
.aegis-hall .ah-telem-dot {
  animation: ah-glow-pulse 1.8s ease-in-out infinite, ah-presence-ping 2.4s ease-out infinite !important;
}
body.aegis-deck .pulse-dot {
  animation: ah-presence-ping 2s ease-out infinite, ah-glow-pulse 1.6s ease-in-out infinite;
}
body.aegis-deck .online-list li::before, .online-list li::before,
.aegis-hall .online-list-inline li::before, .online-list-inline li::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--ah-cyan);
  box-shadow: 0 0 8px var(--ah-glow);
  animation: ah-presence-ping 2.2s ease-out infinite;
  vertical-align: middle;
}

/* Ambient audio toggle — OFF by default */
.ah-ambient-toggle {
  position: relative;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.45rem;
  padding: 0.18rem 0.5rem;
  font-family: var(--ah-font-display);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-muted);
  background: rgba(10, 16, 36, 0.65);
  border: 1px solid rgba(94, 242, 255, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ah-ambient-toggle[aria-pressed="true"] {
  color: var(--ah-cyan);
  border-color: var(--ah-cyan);
  box-shadow: 0 0 14px rgba(94, 242, 255, 0.35);
}
.ah-ambient-toggle:hover { color: var(--ah-argent); }

/* Panel architecture layers for /chat/aegis */
.aegis-hall .ah-panel-layers .ah-layer-vault,
.aegis-hall .ah-panel-layers .ah-layer-corridor,
.aegis-hall .ah-panel-layers .ah-layer-holoarch,
.aegis-hall .ah-panel-layers .ah-layer-colonnade,
.aegis-hall .ah-panel-layers .ah-layer-buttress {
  position: absolute;
  inset: -5%;
}
.aegis-hall .ah-panel-layers .ah-layer-vault { z-index: 0; opacity: 0.65; }
.aegis-hall .ah-panel-layers .ah-layer-corridor { z-index: 1; opacity: 0.4; }
.aegis-hall .ah-panel-layers .ah-layer-holoarch { z-index: 2; opacity: 0.5; }
.aegis-hall .ah-panel-layers .ah-layer-colonnade { z-index: 2; opacity: 0.55; }
.aegis-hall .ah-panel-layers .ah-layer-buttress { z-index: 2; opacity: 0.35; }

.aegis-hall .chat-online-top .cot-label,
.aegis-hall .cot-label {
  font-family: var(--ah-font-display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--ah-cyan) !important;
}

/* Metal rim accent on panel */
.aegis-hall.chat-panel,
section.aegis-hall {
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(94, 242, 255, 0.12),
    0 24px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 90px rgba(61, 124, 255, 0.1),
    inset 0 1px 0 rgba(232, 241, 255, 0.12) !important;
}

@media (max-width: 640px) {
  .ah-layer-vault { opacity: 0.65; }
  .ah-layer-corridor { opacity: 0.35; }
  .ah-layer-holoarch { opacity: 0.45; }
  .ah-layer-colonnade { opacity: 0.5; }
  .ah-layer-buttress { opacity: 0.3; }
  .ah-ambient-toggle { display: none; }
  body.aegis-deck .ah-well,
  .aegis-hall .chat-messages.ah-well {
    background: rgba(6, 10, 22, 0.97) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-layer-vault,
  .ah-layer-corridor,
  .ah-layer-holoarch,
  .ah-layer-colonnade,
  .ah-layer-buttress {
    animation: none !important;
  }
  body.aegis-deck .ah-layer-bg,
  body.aegis-deck .ah-layer-mid,
  body.aegis-deck .ah-layer-fg,
  body.aegis-deck .ah-layer-vault,
  body.aegis-deck .ah-layer-corridor,
  body.aegis-deck .ah-layer-holoarch,
  body.aegis-deck .ah-layer-colonnade,
  body.aegis-deck .ah-layer-buttress {
    transform: none !important;
  }
  body.aegis-deck .ah-well .chat-msg,
  .aegis-hall .ah-well .chat-msg,
  body.aegis-deck .send-img.ah-sent {
    animation: none !important;
  }
}

/* ==========================================================================
   AEGIS HALL — WHOLE-ROOM ENHANCEMENT PASS (indulgent)
   Richer composition · apex/floor plates · chrome polish · send/receive feel
   Scope: .aegis-hall / body.aegis-deck only. Orbital untouched. Text readable.
   ========================================================================== */

.ah-layer-apex {
  z-index: 1;
  background-image: url('/img/aegis/aegis-arch-apex.svg');
  background-size: cover;
  background-position: center top;
  mix-blend-mode: screen;
  opacity: 0.78;
  animation: ah-apex-breathe 12s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * -4px), calc(var(--ah-py) * -12px), 0) scale(1.05);
}
.ah-layer-floor {
  z-index: 2;
  background-image: url('/img/aegis/aegis-arch-floor.svg');
  background-size: cover;
  background-position: center bottom;
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: ah-floor-shimmer 16s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * 8px), calc(var(--ah-py) * 14px), 0) scale(1.04);
}
.ah-layer-fog {
  z-index: 3;
  background:
    radial-gradient(ellipse 70% 40% at 50% 78%, rgba(61, 124, 255, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 30% at 20% 40%, rgba(123, 92, 255, 0.12), transparent 65%),
    radial-gradient(ellipse 45% 28% at 80% 35%, rgba(94, 242, 255, 0.1), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: ah-fog-drift 22s ease-in-out infinite alternate;
  transform: translate3d(calc(var(--ah-px) * 10px), calc(var(--ah-py) * 6px), 0);
}
.ah-energy-ribbon.r4 {
  top: 12%;
  animation-duration: 15s;
  animation-delay: -2s;
  opacity: 0.35;
  filter: hue-rotate(-25deg);
  height: 1.5px;
}
.ah-energy-ribbon.r5 {
  top: 88%;
  animation-duration: 17s;
  animation-delay: -8s;
  opacity: 0.3;
  filter: hue-rotate(55deg);
  height: 1.5px;
}

@keyframes ah-apex-breathe {
  0% { opacity: 0.6; filter: brightness(0.95); }
  100% { opacity: 0.9; filter: brightness(1.15); }
}
@keyframes ah-floor-shimmer {
  0% { opacity: 0.4; filter: brightness(0.9) hue-rotate(0deg); }
  100% { opacity: 0.68; filter: brightness(1.12) hue-rotate(10deg); }
}
@keyframes ah-fog-drift {
  0% { opacity: 0.7; }
  100% { opacity: 0.95; }
}
@keyframes ah-law-seal-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ah-banner-sheen {
  0% { background-position: -120% 0; }
  100% { background-position: 220% 0; }
}
@keyframes ah-receive-glow {
  0% { box-shadow: inset 0 0 0 0 rgba(94, 242, 255, 0); }
  35% { box-shadow: inset 0 0 40px 2px rgba(94, 242, 255, 0.22); }
  100% { box-shadow: inset 0 0 0 0 rgba(94, 242, 255, 0); }
}
@keyframes ah-composer-breathe {
  0%, 100% { box-shadow: 0 -6px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(232,241,255,0.1), 0 0 0 0 rgba(94,242,255,0); }
  50% { box-shadow: 0 -8px 28px rgba(0,0,0,0.4), inset 0 1px 0 rgba(232,241,255,0.14), 0 0 18px rgba(61,124,255,0.18); }
}
@keyframes ah-bracket-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}
@keyframes ah-scroll-hint {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

/* ---- Header / room-bar composition ------------------------------------- */
body.aegis-deck .room-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  padding: 0.55rem 0.9rem !important;
  background:
    linear-gradient(180deg, rgba(14, 22, 48, 0.96), rgba(8, 12, 28, 0.88)),
    linear-gradient(90deg, rgba(61,124,255,0.15), transparent 30%, transparent 70%, rgba(123,92,255,0.15)) !important;
  border-bottom: 1px solid transparent !important;
  border-image: linear-gradient(90deg, transparent, #5ef2ff, #7b5cff, #5ef2ff, transparent) 1 !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(232, 241, 255, 0.12),
    0 0 40px rgba(61, 124, 255, 0.2) !important;
}
body.aegis-deck .room-back {
  color: var(--ah-cyan) !important;
  border: 1px solid rgba(94, 242, 255, 0.28);
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s;
}
body.aegis-deck .room-back:hover,
body.aegis-deck .room-back:focus-visible {
  color: var(--ah-argent) !important;
  background: rgba(61, 124, 255, 0.2);
  box-shadow: 0 0 16px rgba(94, 242, 255, 0.35);
  transform: translateX(-2px);
  outline: none;
}
body.aegis-deck .room-count,
body.aegis-deck #room-bar-handle {
  font-family: var(--ah-font-display);
  letter-spacing: 0.06em;
  border: 1px solid rgba(94, 242, 255, 0.3) !important;
  border-radius: 999px;
  background: rgba(10, 16, 36, 0.7) !important;
  color: var(--ah-muted) !important;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
body.aegis-deck .room-count:hover,
body.aegis-deck .room-count:focus-visible,
body.aegis-deck #room-bar-handle:hover,
body.aegis-deck #room-bar-handle:focus-visible {
  color: var(--ah-cyan) !important;
  border-color: var(--ah-cyan) !important;
  box-shadow: 0 0 18px rgba(94, 242, 255, 0.4);
  transform: translateY(-1px);
  outline: none;
}

/* Telemetry chips — richer hover/focus */
body.aegis-deck .ah-telem-item,
.aegis-hall .ah-telem-item {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
  cursor: default;
}
body.aegis-deck .ah-telem-item:hover,
.aegis-hall .ah-telem-item:hover {
  border-color: var(--ah-cyan);
  background: rgba(61, 124, 255, 0.22);
  box-shadow: 0 0 14px rgba(94, 242, 255, 0.3);
  transform: translateY(-1px);
}
body.aegis-deck .ah-telem-item .lab,
.aegis-hall .ah-telem-item .lab {
  color: var(--ah-sapphire-bright);
  opacity: 0.9;
  font-size: 0.58rem;
}

/* Banner with sheen + law seal */
body.aegis-deck .ah-banner,
.aegis-hall .ah-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
body.aegis-deck .ah-banner::before,
.aegis-hall .ah-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(232,241,255,0.18) 48%, transparent 62%);
  background-size: 220% 100%;
  animation: ah-banner-sheen 5.5s linear infinite;
  pointer-events: none;
}
.ah-law-seal {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ah-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--ah-glow), inset 0 0 6px rgba(94,242,255,0.35);
  position: relative;
  flex-shrink: 0;
  animation: ah-law-seal-spin 18s linear infinite;
}
.ah-law-seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--ah-cyan);
  box-shadow: 0 0 6px var(--ah-glow);
}

/* ---- Roster polish ----------------------------------------------------- */
body.aegis-deck .room-roster {
  border-radius: 12px !important;
  backdrop-filter: blur(16px) saturate(1.2);
  background:
    linear-gradient(165deg, rgba(14, 22, 48, 0.96), rgba(8, 12, 28, 0.98)) !important;
  border: 1px solid rgba(122, 168, 255, 0.55) !important;
  box-shadow:
    0 0 0 1px rgba(94, 242, 255, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(232, 241, 255, 0.12) !important;
  animation: ah-panel-breathe 6s ease-in-out infinite;
}
body.aegis-deck .room-roster-head,
body.aegis-deck .room-roster .catbar {
  font-family: var(--ah-font-display) !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ah-cyan) !important;
  border-bottom: 1px solid rgba(94, 242, 255, 0.25);
  background: linear-gradient(90deg, rgba(61,124,255,0.2), transparent) !important;
}
body.aegis-deck .online-list li {
  transition: background 0.2s, padding-left 0.2s;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
}
body.aegis-deck .online-list li:hover {
  background: rgba(61, 124, 255, 0.15);
  padding-left: 0.55rem;
}
.aegis-hall .chat-online-top {
  position: relative;
  z-index: 2;
  padding: 0.35rem 0.75rem;
  margin: 0 0.75rem 0.4rem;
  border: 1px solid rgba(94, 242, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 16, 36, 0.55);
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.aegis-hall .chat-online-top:hover {
  border-color: rgba(94, 242, 255, 0.45);
  box-shadow: 0 0 16px rgba(61, 124, 255, 0.2);
}

/* ---- Chat well: brackets, scrollbar, scroll fades, receive ------------ */
body.aegis-deck .ah-well,
body.aegis-deck .chat-messages.ah-well,
.aegis-hall .chat-messages.ah-well {
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 242, 255, 0.45) rgba(8, 12, 28, 0.6);
  transition: box-shadow 0.35s ease;
}
body.aegis-deck .ah-well.ah-receiving,
.aegis-hall .chat-messages.ah-well.ah-receiving {
  animation: ah-receive-glow 0.7s ease-out;
}
body.aegis-deck .ah-well::-webkit-scrollbar,
.aegis-hall .chat-messages.ah-well::-webkit-scrollbar {
  width: 8px;
}
body.aegis-deck .ah-well::-webkit-scrollbar-track,
.aegis-hall .chat-messages.ah-well::-webkit-scrollbar-track {
  background: rgba(8, 12, 28, 0.7);
  border-radius: 8px;
}
body.aegis-deck .ah-well::-webkit-scrollbar-thumb,
.aegis-hall .chat-messages.ah-well::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--ah-cyan), var(--ah-violet));
  border-radius: 8px;
  border: 1px solid rgba(10, 16, 36, 0.5);
}
/* Corner brackets on well */
body.aegis-deck .ah-well::before,
body.aegis-deck .ah-well::after,
.aegis-hall .chat-messages.ah-well::before,
.aegis-hall .chat-messages.ah-well::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 3;
  border-color: var(--ah-cyan);
  border-style: solid;
  opacity: 0.55;
  animation: ah-bracket-pulse 3.5s ease-in-out infinite;
}
body.aegis-deck .ah-well::before,
.aegis-hall .chat-messages.ah-well::before {
  top: 6px; left: 6px;
  border-width: 2px 0 0 2px;
  border-radius: 3px 0 0 0;
}
body.aegis-deck .ah-well::after,
.aegis-hall .chat-messages.ah-well::after {
  bottom: 6px; right: 6px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 3px 0;
  animation-delay: 1.2s;
}

/* Message polish — system / oracle emphasis without drowning text */
body.aegis-deck .ah-well .chat-msg,
.aegis-hall .ah-well .chat-msg,
body.aegis-deck .ah-well .msg,
.aegis-hall .chat-messages .msg {
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  transition: background 0.25s ease;
}
body.aegis-deck .ah-well .chat-msg:hover,
.aegis-hall .ah-well .chat-msg:hover,
body.aegis-deck .ah-well .msg:hover,
.aegis-hall .chat-messages .msg:hover {
  background: rgba(61, 124, 255, 0.08);
}
body.aegis-deck .ah-well .chat-msg.ah-fresh,
.aegis-hall .ah-well .chat-msg.ah-fresh,
body.aegis-deck .ah-well .msg.ah-fresh,
.aegis-hall .chat-messages .msg.ah-fresh {
  animation: ah-msg-arrive 0.42s ease-out;
  background: rgba(94, 242, 255, 0.06);
}

/* ---- Composer / send feel ---------------------------------------------- */
body.aegis-deck .room-form,
body.aegis-deck .chat-form.room-form,
.aegis-hall .chat-form {
  animation: ah-composer-breathe 5s ease-in-out infinite;
  border-top: 1px solid transparent !important;
  border-image: linear-gradient(90deg, transparent, rgba(94,242,255,0.5), rgba(123,92,255,0.5), transparent) 1 !important;
  padding: 0.65rem 0.85rem !important;
}
body.aegis-deck .room-form textarea,
body.aegis-deck .chat-form.room-form textarea,
.aegis-hall .chat-form textarea {
  background: rgba(6, 10, 22, 0.92) !important;
  border: 1px solid rgba(122, 168, 255, 0.4) !important;
  box-shadow: inset 0 0 24px rgba(61, 124, 255, 0.06);
}
body.aegis-deck .room-form textarea::placeholder,
.aegis-hall .chat-form textarea::placeholder {
  color: rgba(168, 180, 212, 0.65);
  letter-spacing: 0.04em;
}
body.aegis-deck .send-img,
.aegis-hall .send-img {
  border-radius: 50%;
  position: relative;
}
body.aegis-deck .send-img:focus-visible,
.aegis-hall .send-img:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(94, 242, 255, 0.45), 0 0 20px rgba(61, 124, 255, 0.4);
}
body.aegis-deck .send-img.ah-sent::after,
.aegis-hall .send-img.ah-sent::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(94, 242, 255, 0.7);
  animation: ah-presence-ping 0.55s ease-out;
  pointer-events: none;
}

/* Topic line on tab view */
.aegis-hall .chat-topic {
  position: relative;
  z-index: 2;
  font-family: var(--ah-font-ui);
  letter-spacing: 0.04em;
  padding: 0.4rem 0.85rem !important;
  margin: 0 0.75rem 0.35rem;
  border-radius: 8px;
  background: rgba(10, 16, 36, 0.45);
  border: 1px solid rgba(94, 242, 255, 0.18) !important;
}

/* Lobby head richer layout */
.aegis-hall .ah-lobby-head {
  padding: 0.85rem 1rem 0.45rem;
  background: linear-gradient(180deg, rgba(14, 22, 48, 0.55), transparent);
  border-bottom: 1px solid rgba(94, 242, 255, 0.12);
  margin-bottom: 0.25rem;
}

/* Panel architecture: apex + floor + fog */
.aegis-hall .ah-panel-layers .ah-layer-apex,
.aegis-hall .ah-panel-layers .ah-layer-floor,
.aegis-hall .ah-panel-layers .ah-layer-fog {
  position: absolute;
  inset: -5%;
}
.aegis-hall .ah-panel-layers .ah-layer-apex { z-index: 1; opacity: 0.55; }
.aegis-hall .ah-panel-layers .ah-layer-floor { z-index: 2; opacity: 0.4; }
.aegis-hall .ah-panel-layers .ah-layer-fog { z-index: 2; opacity: 0.5; }

/* Full-screen layout breathing room */
body.aegis-deck.room-full {
  display: flex;
  flex-direction: column;
}
body.aegis-deck.room-full > .ah-well,
body.aegis-deck.room-full > #chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0.55rem 0.75rem;
}
body.aegis-deck.room-full > .room-form,
body.aegis-deck.room-full > .chat-form.room-form {
  flex: 0 0 auto;
  margin: 0 0.5rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(122, 168, 255, 0.4) !important;
  border-image: none !important;
}

/* Scroll top/bottom fade hints via mask */
body.aegis-deck .ah-well,
.aegis-hall .chat-messages.ah-well {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 14px), transparent 100%);
}

@media (max-width: 640px) {
  .ah-layer-apex { opacity: 0.55; }
  .ah-layer-floor { opacity: 0.35; }
  .ah-layer-fog { opacity: 0.45; }
  .ah-energy-ribbon.r4, .ah-energy-ribbon.r5 { display: none; }
  body.aegis-deck .ah-telem { gap: 0.35rem; }
  body.aegis-deck .ah-telem-item .lab { display: none; }
  body.aegis-deck.room-full > .ah-well,
  body.aegis-deck.room-full > #chat-messages {
    margin: 0.35rem 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ah-layer-apex,
  .ah-layer-floor,
  .ah-layer-fog,
  .ah-law-seal,
  body.aegis-deck .ah-banner::before,
  .aegis-hall .ah-banner::before,
  body.aegis-deck .room-form,
  .aegis-hall .chat-form,
  body.aegis-deck .ah-well::before,
  body.aegis-deck .ah-well::after {
    animation: none !important;
  }
  body.aegis-deck .ah-layer-apex,
  body.aegis-deck .ah-layer-floor,
  body.aegis-deck .ah-layer-fog {
    transform: none !important;
  }
}

/* AEGIS HALL NAV — room↔chat parity */
body.aegis-deck .ah-hall-nav,
body.orbital-deck .ocd-hall-nav {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  margin: 0;
  background: linear-gradient(180deg, rgba(8,12,28,0.88), rgba(8,12,28,0.55));
  border-bottom: 1px solid rgba(94, 242, 255, 0.22);
  font-family: var(--ah-font-ui, 'Rajdhani', system-ui, sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body.orbital-deck .ocd-hall-nav {
  background: linear-gradient(180deg, rgba(6,10,18,0.9), rgba(6,10,18,0.55));
  border-bottom-color: rgba(212, 175, 55, 0.35);
  font-family: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
}
body.aegis-deck .ah-hall-nav a,
body.orbital-deck .ocd-hall-nav a {
  color: rgba(200, 220, 255, 0.82);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .15s, border-color .15s, box-shadow .15s, background .15s;
}
body.orbital-deck .ocd-hall-nav a { color: rgba(240, 220, 160, 0.88); }
body.aegis-deck .ah-hall-nav a:hover,
body.aegis-deck .ah-hall-nav a:focus-visible,
body.orbital-deck .ocd-hall-nav a:hover,
body.orbital-deck .ocd-hall-nav a:focus-visible {
  color: #5ef2ff;
  border-color: rgba(94, 242, 255, 0.45);
  box-shadow: 0 0 14px rgba(94, 242, 255, 0.25);
  background: rgba(61, 124, 255, 0.12);
}
body.orbital-deck .ocd-hall-nav a:hover,
body.orbital-deck .ocd-hall-nav a:focus-visible {
  color: #f0d070;
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
  background: rgba(212, 175, 55, 0.1);
}
body.aegis-deck .ah-hall-nav a.active,
body.orbital-deck .ocd-hall-nav a.active,
body.orbital-deck .ocd-hall-nav a.active-fs {
  color: #e8f1ff;
  border-color: rgba(94, 242, 255, 0.55);
  background: rgba(61, 124, 255, 0.2);
}
body.orbital-deck .ocd-hall-nav a.active,
body.orbital-deck .ocd-hall-nav a.active-fs {
  color: #fff6d0;
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(212, 175, 55, 0.18);
}
body.aegis-deck .ah-chat-tabs,
body.orbital-deck .ocd-chat-tabs {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.35rem 0.65rem 0.45rem;
  margin: 0;
  background: rgba(4, 8, 18, 0.55);
  border-bottom: 1px solid rgba(122, 168, 255, 0.18);
}
body.orbital-deck .ocd-chat-tabs {
  background: rgba(8, 6, 2, 0.55);
  border-bottom-color: rgba(212, 175, 55, 0.22);
}
body.aegis-deck .ah-chat-tabs .chat-tab,
body.orbital-deck .ocd-chat-tabs .chat-tab {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(180, 200, 240, 0.85);
  border: 1px solid rgba(94, 242, 255, 0.18);
  background: rgba(10, 16, 36, 0.55);
}
body.orbital-deck .ocd-chat-tabs .chat-tab {
  color: rgba(240, 220, 160, 0.88);
  border-color: rgba(212, 175, 55, 0.25);
  background: rgba(20, 14, 4, 0.55);
}
body.aegis-deck .ah-chat-tabs .chat-tab.active,
body.orbital-deck .ocd-chat-tabs .chat-tab.active,
body.aegis-deck .ah-chat-tabs .chat-tab.ah-fs-pill,
body.orbital-deck .ocd-chat-tabs .chat-tab.ah-fs-pill {
  color: #fff;
  border-color: rgba(94, 242, 255, 0.55);
  background: rgba(61, 124, 255, 0.28);
  box-shadow: 0 0 12px rgba(94, 242, 255, 0.2);
}
body.orbital-deck .ocd-chat-tabs .chat-tab.active,
body.orbital-deck .ocd-chat-tabs .chat-tab.ah-fs-pill {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.22);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}
body.aegis-deck .ah-float-emblem {
  position: fixed;
  right: 1.1rem;
  top: 4.8rem;
  width: 64px;
  height: 64px;
  z-index: 6;
  pointer-events: none;
  opacity: 0.85;
  background: url('/img/aegis/aegis-emblem-loop.webp') center / contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(94, 242, 255, 0.45));
}
@media (max-width: 720px) {
  body.aegis-deck .ah-float-emblem { width: 44px; height: 44px; top: 4.2rem; right: 0.55rem; opacity: 0.7; }
  body.aegis-deck .ah-hall-nav a.ah-nav-tabmode,
  body.orbital-deck .ocd-hall-nav a.ah-nav-tabmode { display: none; }
}

