/* ═══════════════════════════════════════════════════════════════════
   VINTINUUM SHELL — Phase 2 three-column layout
   Left sidebar 280 | Stage 1fr | Right sidebar 340
   Footer 52px across bottom
   All rails keep max opacity <=0.20 so the body stage shows through.
   ═══════════════════════════════════════════════════════════════════ */

.vtn-shell {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  grid-template-rows: 1fr 52px;
  grid-template-areas:
    "left stage right"
    "footer footer footer";
  min-height: 100vh; /* fallback for browsers without svh */
  min-height: 100svh; /* svh accounts for dynamic browser chrome — fixes the F11-only bug */
  background: var(--bg-void, #05070c);
}

.vtn-sidebar-left {
  grid-area: left;
  background: rgba(8, 12, 20, 0.20);
  border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.vtn-sidebar-right {
  grid-area: right;
  background: rgba(8, 12, 20, 0.20);
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.vtn-stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
}

.vtn-footer {
  grid-area: footer;
  background: rgba(10, 14, 22, 0.25);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  position: relative;
  z-index: 10;
}

/* ── Sidebar left (Phase 2 b2) ─────────────────────────────────────── */
.vtn-side-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* No-overflow: top padding clears the fixed topbar (56px + safe area).
     Bottom padding clears the floating "leave a memory" pill (z-index 80,
     bottom calc(safe-area + 72px)) so the LAYER DISTRIBUTION + CONSCIOUSNESS
     LAYERS legend never disappears beneath it. */
  padding: calc(env(safe-area-inset-top, 0px) + 68px) 16px calc(env(safe-area-inset-bottom, 0px) + 110px);
  color: rgba(230, 238, 255, 0.82);
  font: 11px/1.4 var(--font-ui, system-ui, sans-serif);
}

.vtn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cfe2ff;
}
.vtn-mark { width: 26px; height: 26px; flex: 0 0 auto; }
.vtn-wordmark {
  font: 600 13px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.22em;
}

.vtn-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.vtn-tab {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: rgba(200, 215, 235, 0.72);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  padding: 0;
}
.vtn-tab svg { width: 18px; height: 18px; }
.vtn-tab:hover { color: #fff; border-color: rgba(255,255,255,0.10); }
.vtn-tab.is-active {
  background: rgba(124, 196, 255, 0.12);
  color: #cfe2ff;
  border-color: rgba(124, 196, 255, 0.28);
}

.vtn-sec-label {
  font: 600 9px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.28em;
  color: rgba(200, 215, 235, 0.55);
  margin-bottom: 8px;
}

.vtn-identity {
  padding: 10px 12px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.vtn-identity-label {
  font: 600 9px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.28em;
  color: rgba(200, 215, 235, 0.55);
  margin-bottom: 6px;
}
.vtn-identity-name {
  font: 600 15px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.14em;
  color: #e8f0ff;
}

/* Chem bars */
.vtn-chem-list { display: flex; flex-direction: column; gap: 8px; }
.vtn-chem-row {
  display: grid;
  grid-template-columns: 84px 1fr 28px;
  align-items: center;
  gap: 8px;
}
.vtn-chem-label {
  font: 500 10px/1 var(--font-ui, system-ui, sans-serif);
  color: rgba(210, 222, 240, 0.72);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.vtn-chem-track {
  height: 6px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.vtn-chem-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7cc4ff, #b47cff);
  transition: width .18s ease-out;
}
.vtn-chem-value {
  font: 500 10px/1 var(--font-ui, system-ui, sans-serif);
  color: rgba(210, 222, 240, 0.72);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Layer tiles — 7 tiles in a grid, height-filled from %, accented by --hue */
.vtn-layer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.vtn-layer-tile {
  position: relative;
  min-height: 54px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  padding: 6px 8px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: var(--hue, #cfe2ff);
}
.vtn-layer-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 0%;
  background: var(--hue, #7cc4ff);
  opacity: 0.18;
  transition: height .22s ease-out;
  pointer-events: none;
}
.vtn-layer-name {
  position: relative;
  font: 600 9px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hue, #cfe2ff);
  opacity: 0.92;
}
.vtn-layer-pct {
  position: relative;
  font: 500 11px/1 var(--font-ui, system-ui, sans-serif);
  color: rgba(230, 238, 255, 0.9);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

/* Legend */
.vtn-legend-list {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.vtn-legend-item {
  display: flex; align-items: center; gap: 6px;
  font: 500 10px/1 var(--font-ui, system-ui, sans-serif);
  color: rgba(210, 222, 240, 0.72);
  text-transform: capitalize;
}
.vtn-legend-swatch {
  width: 10px; height: 10px; border-radius: 2px;
  box-shadow: 0 0 6px currentColor;
}

/* ── Sidebar right (Phase 2 b3) ────────────────────────────────────── */
.vtn-side-right-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* No-overflow rule: top padding clears the fixed topbar (56px + safe area)
     so MEMORY / INNER LIFE / GENOME / SOUL QUEUE tab strip never sits under
     LORE/☰. Bottom padding clears the dock so feed cards never bleed under
     the footer strip. */
  padding: calc(env(safe-area-inset-top, 0px) + 68px) 12px 76px;
  max-height: 100vh;
  max-height: 100svh;
  color: rgba(230, 238, 255, 0.82);
  font: 11px/1.4 var(--font-ui, system-ui, sans-serif);
}

.vtn-right-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}
.vtn-right-tab {
  min-height: 44px;
  padding: 0 6px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(200, 215, 235, 0.62);
  font: 600 9px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background .15s, color .15s;
  /* Prevent SOUL QUEUE (or any two-word label) from wrapping behind the
     tab-strip border and appearing to overlap adjacent tabs. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vtn-right-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.vtn-right-tab.is-active {
  background: rgba(124, 196, 255, 0.14);
  color: #cfe2ff;
}

.vtn-card-list {
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.vtn-card-list::-webkit-scrollbar { width: 6px; }
.vtn-card-list::-webkit-scrollbar-track { background: transparent; }
.vtn-card-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.vtn-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(16, 22, 34, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}
.vtn-card-icon {
  color: rgba(200, 215, 235, 0.62);
  display: flex; align-items: center; justify-content: center;
}
.vtn-card-icon svg { width: 18px; height: 18px; }
.vtn-card-body { min-width: 0; }
.vtn-card-title {
  font: 600 11px/1.25 var(--font-ui, system-ui, sans-serif);
  color: #e8f0ff;
  letter-spacing: 0.04em;
  word-break: break-word;
}
.vtn-card-sub {
  margin-top: 3px;
  font: 400 10px/1.35 var(--font-ui, system-ui, sans-serif);
  color: rgba(210, 222, 240, 0.72);
  word-break: break-word;
}
.vtn-card-sub-dim { color: rgba(200, 215, 235, 0.5); }

.vtn-card-offline { opacity: 0.85; }
.vtn-card-loading .vtn-card-title { color: rgba(200, 215, 235, 0.55); font-weight: 400; }

/* ══════════════════════════════════════════════════════════════════════
   INNER LIFE HEATMAP — color, glyph, intensity, cascade, streak
   Heat without chaos. One color per layer, opacity = intensity.
   ══════════════════════════════════════════════════════════════════════ */
.vtn-card-heat {
  position: relative;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--layer-color, #888) calc(8% * var(--intensity, 0.5)), rgba(10, 12, 18, 0.55)) 0%,
    rgba(10, 12, 18, 0.55) 70%
  );
  border: 1px solid color-mix(in oklab, var(--layer-color, #888) 22%, rgba(255,255,255,0.04));
  transition: transform 180ms ease, border-color 240ms ease, box-shadow 240ms ease;
  overflow: hidden;
}
.vtn-card-heat::before {
  /* Left edge intensity bar — the thermometer */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--layer-color, #888);
  opacity: calc(0.35 + 0.65 * var(--intensity, 0.5));
  box-shadow: 0 0 8px color-mix(in oklab, var(--layer-color, #888) calc(60% * var(--intensity, 0.5)), transparent);
}
.vtn-card-heat .vtn-card-title {
  color: color-mix(in oklab, var(--layer-color, #fff) 85%, #fff);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.vtn-card-heat .vtn-card-sub { color: rgba(232, 230, 223, 0.86); }
.vtn-card-heat .vtn-card-sub-dim { color: rgba(232, 230, 223, 0.5); font-variant-numeric: tabular-nums; }

.vtn-card-glyph {
  font: 600 16px/1 var(--font-display, 'Cormorant Garamond', serif);
  color: var(--layer-color, #888);
  text-shadow: 0 0 6px color-mix(in oklab, var(--layer-color, #888) calc(50% * var(--intensity, 0.5)), transparent);
}

.vtn-card-heat:hover {
  transform: translateX(2px);
  border-color: color-mix(in oklab, var(--layer-color, #888) 60%, transparent);
  box-shadow: 0 4px 18px -8px color-mix(in oklab, var(--layer-color, #888) 70%, transparent);
}

/* Intensity > 0.7: outer glow — the body burns */
.vtn-card-heat.hot {
  box-shadow:
    inset 0 0 22px color-mix(in oklab, var(--layer-color, #888) 14%, transparent),
    0 0 14px color-mix(in oklab, var(--layer-color, #888) 24%, transparent);
}

/* Streak: same layer twice in a row → cards merge top, sense of flow */
.vtn-card-heat.streak {
  margin-top: -4px;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
  border-top-color: transparent;
}

/* Header card — dominant layer summary, always sits on top */
.vtn-card-header {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--layer-color, #888) 22%, rgba(8, 10, 16, 0.85)) 0%,
    rgba(8, 10, 16, 0.85) 80%
  );
  border-color: color-mix(in oklab, var(--layer-color, #888) 45%, transparent);
}
.vtn-card-header .vtn-card-title { font-size: 12px; }

/* Cascade signatures — pattern recognition by border */
.vtn-card-heat.cascade-memory   { border-left: 3px solid #8b5cf6; }
.vtn-card-heat.cascade-stress   { border-left: 3px solid #ef4444; animation: vtn-pulse 2.4s ease-in-out infinite; }
.vtn-card-heat.cascade-reward   { border-left: 3px solid #fbbf24; }
.vtn-card-heat.cascade-dream    { border-left: 3px solid #22d3ee; }

@keyframes vtn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.0); }
  50%      { box-shadow: 0 0 14px 0 rgba(239, 68, 68, 0.35); }
}

/* Neurochem chips — small, dense, readable */
.vtn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.vtn-chip {
  font: 600 9px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 230, 223, 0.85);
  font-variant-numeric: tabular-nums;
}
.vtn-chip-dopamine       { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.vtn-chip-serotonin      { color: #86efac; border-color: rgba(134, 239, 172, 0.35); }
.vtn-chip-gaba           { color: #93c5fd; border-color: rgba(147, 197, 253, 0.35); }
.vtn-chip-norepinephrine { color: #fca5a5; border-color: rgba(252, 165, 165, 0.35); }
.vtn-chip-arousal        { color: #f9a8d4; border-color: rgba(249, 168, 212, 0.35); }
.vtn-chip-valence        { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.35); }

/* ── Footer strip (Phase 2 b6) ─────────────────────────────────────── */
.vtn-ft-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px;
  height: 100%;
  color: rgba(230, 238, 255, 0.75);
  overflow-x: auto;
}
.vtn-ft-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.vtn-ft-div {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.vtn-ft-spacer { flex: 1 1 auto; }

.vtn-ft-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(210, 222, 240, 0.72);
  font: 600 10px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.vtn-ft-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.10);
}
.vtn-ft-btn svg { width: 18px; height: 18px; }
.vtn-ft-btn[aria-pressed="true"] {
  color: #cfe2ff;
}
.vtn-ft-btn.is-off {
  color: rgba(210, 222, 240, 0.28);
}
.vtn-ft-preset {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 10px;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE LAYOUT — unified at 820px breakpoint
   ───────────────────────────────────────────────────────────────────
   Problems solved:
   • sidebars + stage + footer stacking crushed everything
   • 4-col right-tabs wrapped SOUL QUEUE behind the tab strip border
   • LORE / footer buttons overlapped neighbours on narrow screens
   • tapping one button often hit an adjacent one
   ───────────────────────────────────────────────────────────────────
   Mobile plan:
   • stage = full viewport (body is the hero)
   • sidebars become bottom-sheet drawers behind pill toggles
   • each pill toggle sits alone with ≥16px clearance on every side
   • right-sidebar tabs: 2×2 grid, full SOUL QUEUE label fits
   • footer: two rows with wrap, ≥12px gap, no horizontal scroll
   • every tap target ≥44×44 with 8px inter-target gutter
   ═══════════════════════════════════════════════════════════════════ */

/* Sheet overlay shared surface — used for both drawers.
   Bodies add .is-open; a JS hook toggles that class. */
.vtn-sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.55);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.vtn-sheet-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Floating pill toggles — only on mobile, positioned so neighbours
   can't touch them even with fat fingers. */
.vtn-mobile-pill {
  display: none; /* desktop hidden */
  position: fixed;
  z-index: 95;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(12, 18, 28, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(124, 196, 255, 0.28);
  border-radius: 22px;
  color: #cfe2ff;
  font: 600 10px/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.vtn-mobile-pill.is-left  { left: 12px;  top: calc(env(safe-area-inset-top, 0px) + 10px); }
.vtn-mobile-pill.is-right { right: 12px; top: calc(env(safe-area-inset-top, 0px) + 10px); }
.vtn-mobile-pill:active { transform: scale(0.96); }

@media (max-width: 820px) {
  /* Shell becomes stage + footer only; sidebars detach into drawers */
  .vtn-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
      "stage"
      "footer";
    min-height: 100vh;
    min-height: 100svh;
  }

  .vtn-mobile-pill { display: inline-flex; align-items: center; justify-content: center; }

  /* Sidebars become bottom sheets, hidden by default, slide up when open */
  .vtn-sidebar-left,
  .vtn-sidebar-right {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 72vh;
    max-height: 72svh;
    min-height: 40vh;
    background: rgba(10, 14, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    transform: translateY(100%);
    transition: transform 0.22s ease;
    z-index: 100;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  }
  .vtn-sidebar-left.is-open,
  .vtn-sidebar-right.is-open { transform: translateY(0); }

  /* Drawer grab-handle hint */
  .vtn-sidebar-left::before,
  .vtn-sidebar-right::before {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
    margin: 10px auto 4px;
  }

  /* Stage fills the visible viewport; nothing else covers it */
  .vtn-stage {
    min-height: calc(100vh - 68px);
    min-height: calc(100svh - 68px);
  }

  /* Footer: wrap to two rows, no scrollbar, big comfortable targets */
  .vtn-footer {
    height: auto;
    min-height: 60px;
    grid-area: footer;
  }
  .vtn-ft-inner {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 8px 10px;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  }
  .vtn-ft-group { gap: 6px; flex-wrap: wrap; justify-content: center; }
  .vtn-ft-spacer { display: none; } /* no push-apart on mobile — groups wrap naturally */
  .vtn-ft-div    { display: none; } /* dividers just add overlap on wrap — hide on mobile */
  .vtn-ft-btn {
    min-width: 48px;
    min-height: 44px;
    padding: 0 10px;
    flex: 0 0 auto;
  }

  /* Right sidebar tabs: 2×2 grid so SOUL QUEUE fits as one label */
  .vtn-right-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .vtn-right-tab {
    min-height: 48px;
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 0 8px;
    white-space: nowrap;
  }

  /* Left sidebar tab row — 4 tiles fit tightly on narrow screens */
  .vtn-tabs { gap: 8px; }
  .vtn-tab  { min-height: 48px; }

  /* Identity / chem / layer blocks compress gracefully — bottom padding
     keeps legend clear of the floating "leave a memory" pill on mobile too. */
  .vtn-side-inner { gap: 14px; padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 96px); }
  .vtn-side-right-inner { gap: 10px; padding: 10px 12px 16px; max-height: none; }
  .vtn-card-list { max-height: none; overflow-y: visible; }

  .vtn-chem-row { grid-template-columns: 72px 1fr 30px; }
}

/* Very small phones — squeeze everything slightly more without overlap */
@media (max-width: 380px) {
  .vtn-ft-btn       { min-width: 44px; padding: 0 8px; font-size: 9px; }
  .vtn-right-tab    { font-size: 9.5px; letter-spacing: 0.10em; }
  .vtn-mobile-pill  { min-width: 54px; padding: 0 10px; font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════════════
   KILL LEGACY PHASE-1 UI — the brain.html file carries two generations
   of shell stacked on top of each other. Phase-1: header, .tab-bar,
   .sidebar (leftSidebar/rightSidebar), mobile bottom bar, lore toggle.
   Phase-2 (current): .vtn-shell grid with #sidebarLeft/#sidebarRight/
   #footerStrip. All Phase-1 handlers target dead ids or superseded
   panels. Hide them so the user only sees what actually works.
   ═══════════════════════════════════════════════════════════════════ */
.header,
.tab-bar,
#mainTabs,
.legend,
.sidebar,
#leftSidebar,
#rightSidebar,
#leftSidebarOverlay,
#rightSidebarOverlay,
#mobileBottomBar,
#loreToggle,
#lorePanel,
#mobileLoreToggle {
  display: none !important;
}

/* The new Phase-2 shell must own the whole viewport now */
.vtn-shell {
  position: relative;
  z-index: 5;
}

/* Style the dedicated SCAN button so its label is unmistakable */
.vtn-ft-scan {
  min-width: 72px;
  background: rgba(124, 196, 255, 0.14);
  border: 1px solid rgba(124, 196, 255, 0.28);
  color: #cfe2ff;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.vtn-ft-scan:hover {
  background: rgba(124, 196, 255, 0.22);
  border-color: rgba(124, 196, 255, 0.45);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE SAFE ZONES — keep other floating UI from colliding with the
   BODY / MIND pills at the top, or the footer strip at the bottom.
   Targets every known fixed overlay in the app.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  /* Top center safe zone — push any floating top element below the pill row */
  .vtn-sensor-btn,
  #vtn-sensor,
  #soul-auth-indicator,
  #vtnAuthIndicator,
  .vtn-auth-indicator,
  .vtn-top-chip,
  .vtn-top-hud {
    top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
  }

  /* DirRM floating player — lift above footer and clear of right pill */
  #dirrmPlayer,
  .dirrm-player,
  .vtn-dirrm-player {
    right: 10px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 70px) !important;
    max-width: calc(100vw - 20px) !important;
  }

  /* Peel tab (right edge info panel) — lives on right edge; hide behind
     sheet when the MIND drawer is open so it can't poke through */
  .vtn-peel-tab,
  #vtnPeelTab {
    top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
  }
  body:has(.vtn-sidebar-right.is-open) .vtn-peel-tab,
  body:has(.vtn-sidebar-right.is-open) #vtnPeelTab { visibility: hidden; }

  /* Chat dock — lift above footer if present */
  .vtn-chat-dock,
  #vtnChatDock,
  #chatDock {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px) !important;
    right: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }

  /* Any .dir-* / .vtn- overlay we didn't explicitly name: if it uses
     position:fixed top:0, the generic nudge won't reach it, but at least
     ensure they can't overlap the pills — add a uniform tap buffer. */
  .vtn-mobile-pill { pointer-events: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   FORK B · SESSION 1 — Subconscious / Genetics / Immune strips
   Live consciousness strips inside left sidebar.
   All surfaces stay under 0.25 max opacity rule.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Subconscious ticker ─────────────────────────────────────────── */
.vtn-subc { margin-top: 14px; }
.vtn-subc-thought {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(220, 210, 255, 0.85);
  font-style: italic;
  min-height: 34px;
  padding: 8px 10px;
  background: rgba(120, 90, 200, 0.08);
  border-left: 2px solid rgba(180, 124, 255, 0.45);
  border-radius: 0 3px 3px 0;
  transition: opacity 0.4s ease;
  opacity: 1;
}
.vtn-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(180, 124, 255, 0.5);
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.3s, box-shadow 0.3s;
}
.vtn-live-dot.is-pulse {
  background: rgba(180, 124, 255, 1);
  box-shadow: 0 0 8px rgba(180, 124, 255, 0.8);
}

/* ── Genetic expression list ─────────────────────────────────────── */
.vtn-genetics { margin-top: 14px; }
.vtn-gene-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vtn-gene-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  font-size: 11px;
}
.vtn-gene-name {
  grid-column: 1;
  grid-row: 1 / 3;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: rgba(255, 124, 180, 0.95);
  font-weight: 600;
}
.vtn-gene-track {
  grid-column: 2;
  grid-row: 1;
  height: 4px;
  background: rgba(255, 124, 180, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.vtn-gene-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 124, 180, 0.7), rgba(255, 180, 200, 0.9));
  border-radius: 2px;
  transition: width 0.8s ease;
}
.vtn-gene-desc {
  grid-column: 2;
  grid-row: 2;
  color: rgba(200, 200, 220, 0.55);
  font-size: 10px;
  letter-spacing: 0.2px;
}

/* ── Immune strip ────────────────────────────────────────────────── */
.vtn-immune { margin-top: 14px; }
.vtn-imm-state {
  font-size: 10px;
  color: rgba(124, 255, 240, 0.7);
  margin-left: 6px;
  font-style: italic;
  transition: color 0.4s;
}
.vtn-imm-bar {
  height: 6px;
  background: rgba(124, 255, 240, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.vtn-imm-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, rgba(124, 255, 240, 0.5), rgba(124, 200, 255, 0.7));
  border-radius: 3px;
  transition: width 0.6s ease, background 0.3s ease;
}
.vtn-imm-fill.is-flare {
  background: linear-gradient(90deg, rgba(255, 180, 80, 0.85), rgba(255, 100, 60, 0.95));
  box-shadow: 0 0 12px rgba(255, 140, 60, 0.6);
  animation: vtn-imm-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes vtn-imm-pulse {
  from { filter: brightness(0.9); }
  to   { filter: brightness(1.15); }
}

/* ── Mobile — keep the strips readable, condense padding ─────────── */
@media (max-width: 860px) {
  .vtn-subc-thought { font-size: 11px; padding: 6px 8px; min-height: 30px; }
  .vtn-gene-row     { grid-template-columns: 54px 1fr; font-size: 10px; }
  .vtn-gene-name    { font-size: 9.5px; }
  .vtn-gene-desc    { font-size: 9px; }
}
