/* ==========================================================================
   BROADWAY.GARTER.APP // 261 BROADWAY, GLEBE (KINGS COURT / KINGS CONFIDENTIAL)
   Pitch Black Luxury Design System — Hedi Slimane / Saint Laurent / PBI Register
   ========================================================================== */

:root {
  --bg-obsidian: #050505;
  --bg-deep: #08080b;
  --bg-panel: #0d0d10;
  --bg-panel-glass: rgba(13, 13, 16, 0.88);
  --bg-panel-heavy: rgba(10, 10, 14, 0.95);
  --bg-elevated: #141419;
  --bg-hover: #1b1b22;

  --gold: #c9a44c;
  --gold-bright: #e5c46c;
  --gold-dim: rgba(201, 164, 76, 0.16);
  --gold-border: rgba(201, 164, 76, 0.28);
  --gold-border-strong: rgba(201, 164, 76, 0.62);
  --gold-glow: 0 0 22px rgba(201, 164, 76, 0.24);

  --cyan: #38bdf8;
  --cyan-bright: #7dd3fc;
  --cyan-dim: rgba(56, 189, 248, 0.14);
  --cyan-border: rgba(56, 189, 248, 0.36);
  --cyan-glow: 0 0 20px rgba(56, 189, 248, 0.28);

  --crimson: #ef4444;
  --crimson-dim: rgba(239, 68, 68, 0.15);
  --crimson-border: rgba(239, 68, 68, 0.42);
  --crimson-glow: 0 0 18px rgba(239, 68, 68, 0.28);

  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.15);

  --text-primary: #f5f2eb;
  --text-secondary: #b4b2ac;
  --text-muted: #767570;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}
::-webkit-scrollbar-thumb {
  background: rgba(201, 164, 76, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Subtle CAD Blueprint Grid Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(201, 164, 76, 0.07), transparent 48%),
    radial-gradient(circle at 80% 75%, rgba(56, 189, 248, 0.05), transparent 52%);
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
}

/* ==========================================================================
   1. PASSWORD GATE OVERLAY (`zendaya`)
   ========================================================================== */
.vault-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 50% 35%, rgba(201, 164, 76, 0.12), rgba(5, 5, 5, 0.98) 65%),
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    #050505;
  background-size: 100% 100%, 40px 40px, 40px 40px, 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s ease;
}

.vault-overlay.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vault-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg-panel-heavy);
  border: 1px solid var(--gold-border-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.92), var(--gold-glow);
  border-radius: var(--radius-md);
  padding: 36px 38px 32px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(24px);
}

.vault-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--cyan), var(--gold), transparent);
}

.vault-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vault-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 10px var(--crimson);
  animation: pulseDot 1.8s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

.vault-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1.12;
  margin-bottom: 8px;
}

.vault-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.vault-kpi-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px;
  background: rgba(5, 5, 5, 0.72);
  border: 1px solid rgba(201, 164, 76, 0.2);
  border-radius: var(--radius-sm);
}

.vault-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vault-kpi-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.vault-kpi-val {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
}

.vault-kpi-val.cyan {
  color: var(--cyan);
}

.vault-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vault-input-row {
  display: flex;
  gap: 10px;
}

.vault-input {
  flex: 1;
  background: #050505;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.vault-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201, 164, 76, 0.25);
}

.vault-submit-btn {
  background: linear-gradient(135deg, #d7b45c 0%, #a98229 100%);
  color: #050505;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

.vault-submit-btn:hover {
  filter: brightness(1.1);
  box-shadow: var(--gold-glow);
}

.vault-submit-btn:active {
  transform: translateY(1px);
}

.vault-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.vault-error {
  color: var(--crimson);
  font-family: var(--font-mono);
  font-size: 11px;
  min-height: 16px;
}

@keyframes vaultShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.vault-card.shake {
  animation: vaultShake 0.36s ease;
}

/* ==========================================================================
   2. APP SHELL LAYOUT (TOP RIBBON + MAIN WORKSPACE SPLIT + BOTTOM STUDIO BAR)
   ========================================================================== */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

/* Top Command Ribbon */
.top-command-ribbon {
  flex-shrink: 0;
  background: var(--bg-panel-heavy);
  border-bottom: 1px solid var(--gold-border);
  padding: 6px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
}

.ribbon-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-cluster {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--crimson-dim);
  border: 1px solid var(--crimson-border);
  color: #fca5a5;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ribbon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cmd-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cmd-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-bright);
}

.cmd-btn.active,
.cmd-btn.gold-solid {
  background: linear-gradient(135deg, rgba(201, 164, 76, 0.28), rgba(201, 164, 76, 0.12));
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: var(--gold-glow);
}

.cmd-btn.cyan-accent {
  border-color: var(--cyan-border);
  color: var(--cyan);
}
.cmd-btn.cyan-accent:hover,
.cmd-btn.cyan-accent.active {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  box-shadow: var(--cyan-glow);
}

.cmd-btn.crimson-accent {
  border-color: var(--crimson-border);
  color: #fca5a5;
}
.cmd-btn.crimson-accent:hover {
  background: var(--crimson-dim);
  border-color: var(--crimson);
}

/* 5-Card Headline KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.kpi-card {
  background: rgba(5, 5, 5, 0.72);
  border: 1px solid rgba(201, 164, 76, 0.2);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.kpi-card:hover {
  background: rgba(201, 164, 76, 0.08);
  border-color: var(--gold);
}

.kpi-card.kpi-half-price {
  border-left-color: var(--emerald);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(5, 5, 5, 0.78));
}

.kpi-card.kpi-cyan {
  border-left-color: var(--cyan);
}

.kpi-card.kpi-crimson {
  border-left-color: var(--crimson);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.kpi-main {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.kpi-card.kpi-half-price .kpi-main {
  color: #34d399;
}

.kpi-card.kpi-cyan .kpi-main {
  color: var(--cyan-bright);
}

.kpi-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Primary View Mode Switcher Tabs */
.view-mode-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-top: 2px;
}

.view-tab-btn {
  background: rgba(20, 20, 25, 0.75);
  border: 1px solid rgba(201, 164, 76, 0.18);
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.view-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(201, 164, 76, 0.1);
  border-color: rgba(201, 164, 76, 0.35);
}

.view-tab-btn.active {
  background: linear-gradient(180deg, rgba(201, 164, 76, 0.22), rgba(13, 13, 16, 0.96));
  color: var(--gold-bright);
  border-color: var(--gold-border-strong);
  border-bottom: 2px solid var(--gold);
  font-weight: 600;
}

/* ==========================================================================
   3. INTERACTIVE SPLIT / FULLSCREEN WORKSPACE (62% LEFT / 38% RIGHT)
   ========================================================================== */
.workspace-split {
  flex: 1;
  min-height: 0;
  display: flex;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.stage-left {
  width: 62%;
  height: 100%;
  position: relative;
  background: var(--bg-obsidian);
  border-right: 1px solid var(--gold-border);
  transition: width var(--transition-smooth);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.workspace-split.stage-fullscreen .stage-left {
  width: 100%;
  border-right: none;
}

.drawer-right {
  width: 38%;
  height: 100%;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: width var(--transition-smooth), opacity var(--transition-smooth);
  overflow: hidden;
}

.workspace-split.stage-fullscreen .drawer-right {
  width: 0%;
  opacity: 0;
  pointer-events: none;
}

/* Stage Panes */
.stage-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.stage-pane.active {
  display: flex;
}

.webgl-mount,
.graph-stage-mount {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: auto;
}

#building-webgl-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  outline: none;
}

/* ==========================================================================
   4. 3D BUILDING FLOATING HUD OVERLAYS (MORPH, EXPLODE, ENVELOPES, CHARACTER)
   ========================================================================== */
.hud-panel {
  position: absolute;
  z-index: 20;
  background: var(--bg-panel-glass);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  pointer-events: auto;
}

.hud-top-left {
  top: 12px;
  left: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.hud-top-right {
  top: 12px;
  right: 12px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-bottom-left {
  bottom: 12px;
  left: 12px;
  width: 350px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-bottom-right {
  bottom: 12px;
  right: 12px;
  max-width: 310px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-section-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-section-title .cyan-tag {
  color: var(--cyan);
}

.hud-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-slider-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.hud-slider-val {
  color: var(--cyan-bright);
  font-weight: 600;
}

input[type="range"].luxury-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--cyan-dim), var(--gold-dim));
  border: 1px solid rgba(201, 164, 76, 0.35);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"].luxury-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid #050505;
  box-shadow: 0 0 10px var(--gold);
  cursor: pointer;
}

.hud-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hud-pill {
  flex: 1;
  min-width: 42px;
  background: rgba(5, 5, 5, 0.8);
  border: 1px solid rgba(201, 164, 76, 0.24);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 7px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.hud-pill:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.hud-pill.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}

.hud-pill.cyan.active {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan-bright);
}

.envelope-btn-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.envelope-btn {
  background: rgba(5, 5, 5, 0.82);
  border: 1px solid rgba(201, 164, 76, 0.24);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 6px 9px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.envelope-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
  background: rgba(201, 164, 76, 0.08);
}

.envelope-btn.active {
  background: linear-gradient(90deg, rgba(201, 164, 76, 0.24), rgba(56, 189, 248, 0.12));
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
  box-shadow: var(--gold-glow);
}

.envelope-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
}

/* Character & On-Screen WASD + Elevator Controls */
.char-controls-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.char-select {
  width: 100%;
  background: #050505;
  border: 1px solid var(--gold-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  outline: none;
}

.wasd-elevator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wasd-pad {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(2, 26px);
  gap: 3px;
}

.wasd-key {
  background: #050505;
  border: 1px solid var(--cyan-border);
  color: var(--cyan-bright);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 80ms ease;
}

.wasd-key:hover,
.wasd-key.pressed {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  box-shadow: var(--cyan-glow);
  transform: scale(0.96);
}

.elevator-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.elevator-btns {
  display: flex;
  gap: 4px;
}

/* ==========================================================================
   5. RIGHT INTELLIGENCE & DOSSIER DRAWER (4 TABS)
   ========================================================================== */
.drawer-tabs-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #08080b;
  border-bottom: 1px solid var(--gold-border);
  flex-shrink: 0;
}

.drawer-tab-btn {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(201, 164, 76, 0.14);
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 9px 6px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition-fast);
}

.drawer-tab-btn:last-child {
  border-right: none;
}

.drawer-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(201, 164, 76, 0.07);
}

.drawer-tab-btn.active {
  color: var(--gold-bright);
  background: rgba(201, 164, 76, 0.14);
  border-bottom-color: var(--gold);
}

.drawer-content-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.drawer-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.drawer-pane.active {
  display: flex;
}

/* Cards inside Drawer */
.dossier-card {
  background: rgba(5, 5, 5, 0.68);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dossier-card.cyan-card {
  border-color: var(--cyan-border);
}

.dossier-card.crimson-card {
  border-color: var(--crimson-border);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(5, 5, 5, 0.78));
}

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-body {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  user-select: text;
}

.nyx-quote-box {
  background: rgba(201, 164, 76, 0.08);
  border-left: 3px solid var(--gold);
  padding: 9px 11px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-style: italic;
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.5;
  user-select: text;
}

.narrate-action-btn {
  background: linear-gradient(135deg, #c9a44c 0%, #9b7826 100%);
  color: #050505;
  border: none;
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all var(--transition-fast);
}

.narrate-action-btn:hover {
  filter: brightness(1.12);
  box-shadow: var(--gold-glow);
}

/* Spec Key-Value Grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.spec-cell {
  background: rgba(13, 13, 16, 0.9);
  border: 1px solid rgba(201, 164, 76, 0.16);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
}

.spec-k {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spec-v {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 2px;
}

/* Floor & Room Selector Accordion / Pills */
.floor-block {
  border: 1px solid rgba(201, 164, 76, 0.2);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: rgba(8, 8, 11, 0.8);
}

.floor-block-header {
  padding: 7px 10px;
  background: rgba(201, 164, 76, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gold-bright);
  cursor: pointer;
}

.room-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
}

.room-chip {
  background: #0d0d10;
  border: 1px solid rgba(201, 164, 76, 0.18);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--transition-fast);
}

.room-chip:hover {
  border-color: var(--gold);
  background: rgba(201, 164, 76, 0.09);
}

.room-chip.active {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: var(--cyan-glow);
}

.room-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--gold);
}

.room-chip-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 5 Lenses Interactive List */
.lens-item {
  background: rgba(13, 13, 16, 0.88);
  border: 1px solid rgba(201, 164, 76, 0.22);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lens-item:hover,
.lens-item.active {
  background: rgba(201, 164, 76, 0.11);
  border-color: var(--gold);
}

.lens-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.lens-name {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.lens-point {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}

.lens-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
}

.lens-verdict {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   6. 37-DOCUMENT VAULT BROWSER (DRAWER + FULL STAGE VIEW)
   ========================================================================== */
.vault-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  z-index: 5;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(201, 164, 76, 0.16);
}

.doc-search-input {
  width: 100%;
  background: #050505;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xs);
  padding: 8px 11px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
}

.doc-search-input:focus {
  border-color: var(--gold);
}

.doc-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.doc-cat-pill {
  background: #050505;
  border: 1px solid rgba(201, 164, 76, 0.24);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-cat-pill.active,
.doc-cat-pill:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.doc-list-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.doc-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
}

.doc-row-card {
  background: rgba(5, 5, 5, 0.78);
  border: 1px solid rgba(201, 164, 76, 0.22);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.doc-row-card:hover {
  border-color: var(--gold);
  background: rgba(201, 164, 76, 0.06);
}

.doc-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.doc-filename {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.doc-ext-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
  flex-shrink: 0;
}

.doc-ext-badge.pdf {
  background: var(--crimson-dim);
  color: #fca5a5;
  border-color: var(--crimson-border);
}

.doc-ext-badge.html {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border-color: var(--gold-border);
}

.doc-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
}

.doc-row-actions {
  display: flex;
  gap: 6px;
}

.doc-btn {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(201, 164, 76, 0.28);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition-fast);
}

.doc-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-bright);
}

.doc-btn.primary {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--cyan-border);
  color: var(--cyan-bright);
}

.doc-btn.primary:hover {
  background: rgba(56, 189, 248, 0.26);
  border-color: var(--cyan);
}

/* ==========================================================================
   7. BOTTOM HYPERFRAMES STUDIO BAR
   ========================================================================== */
.bottom-studio-bar {
  flex-shrink: 0;
  min-height: 76px;
  background: var(--bg-panel-heavy);
  border-top: 1px solid var(--gold-border);
  z-index: 45;
  position: relative;
}

/* ==========================================================================
   8. IN-APP DOCUMENT PREVIEW MODAL (`<iframe>`)
   ========================================================================== */
.doc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.doc-modal-backdrop.open {
  display: flex;
}

.doc-modal-window {
  width: 100%;
  max-width: 1280px;
  height: 88vh;
  background: var(--bg-panel);
  border: 1px solid var(--gold-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.95), var(--gold-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-modal-header {
  padding: 12px 18px;
  background: #08080b;
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.doc-modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-modal-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.doc-modal-body {
  flex: 1;
  background: #101014;
  position: relative;
}

.doc-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* Data Tables in Dossier */
.luxury-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.luxury-table th {
  text-align: left;
  padding: 7px 8px;
  background: rgba(201, 164, 76, 0.12);
  color: var(--gold-bright);
  border-bottom: 1px solid var(--gold-border);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.luxury-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(201, 164, 76, 0.12);
  color: var(--text-secondary);
}

.luxury-table tr:hover td {
  background: rgba(201, 164, 76, 0.06);
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stage-left {
    width: 56%;
  }
  .drawer-right {
    width: 44%;
  }
}
