/* =========================================================
   JENAVUS GHOST SUITE — Command Center Styles (Rebuilt)
   ========================================================= */

:root {
  --bg-primary: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2235;
  --bg-section: #0d1220;
  --border-subtle: #1e293b;
  --border-glow: #00d4ff;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #00d4ff;
  --accent-blue: #3b82f6;
  --accent-purple: #7b61ff;
  --accent-gold: #f59e0b;
  --color-online: #22c55e;
  --color-progress: #eab308;
  --color-down: #ef4444;
  --color-scheduled: #818cf8;
  --color-unknown: #64748b;
  --status-live: #22c55e;
  --status-dev: #eab308;
  --status-offline: #ef4444;
  --status-progress: #f59e0b;
  --status-unknown: #64748b;
  --div-command: #ef4444;
  --div-strategy: #3b82f6;
  --div-growth: #22c55e;
  --div-engineering: #f97316;
  --div-legal: #a855f7;
  --div-finance: #f59e0b;
  --div-support: #64748b;
  --div-security: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ── Background Grid ───────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Universal Status Dot Classes ──────────────────────── */

/* Green — Online / Healthy */
.status-online {
  background: var(--color-online) !important;
  box-shadow: 0 0 8px var(--color-online);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Yellow — In Progress / Building */
.status-progress {
  background: var(--color-progress) !important;
  box-shadow: 0 0 8px var(--color-progress);
  animation: pulse-dot-slow 3s ease-in-out infinite;
}

/* Red — Down / Error */
.status-down {
  background: var(--color-down) !important;
  box-shadow: 0 0 8px var(--color-down);
  animation: none;
}

/* Blue/Purple — Scheduled / Sleeping */
.status-scheduled {
  background: var(--color-scheduled) !important;
  box-shadow: 0 0 10px rgba(129,140,248,0.5);
  animation: glow-subtle 3s ease-in-out infinite;
}

/* Gray — Unknown / Planned — flashing */
.status-unknown, .status-planned {
  background: var(--color-unknown) !important;
  box-shadow: 0 0 8px rgba(100,116,139,0.4);
  animation: pulse-unknown 2.5s ease-in-out infinite;
}

@keyframes pulse-unknown {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(100,116,139,0.3); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(100,116,139,0.6); }
}

/* Status text color helpers */
.text-online { color: var(--color-online) !important; }
.text-progress { color: var(--color-progress) !important; }
.text-down { color: var(--color-down) !important; }
.text-scheduled { color: var(--color-scheduled) !important; }
.text-unknown, .text-planned { color: var(--color-unknown) !important; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes pulse-dot-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

@keyframes glow-subtle {
  0%, 100% { box-shadow: 0 0 6px rgba(129,140,248,0.3); }
  50% { box-shadow: 0 0 14px rgba(129,140,248,0.6); }
}

/* ── Layout ────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ── Header ────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 32px 0 24px;
  position: relative;
}

.header__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 8px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #00d4ff 0%, #7b61ff 50%, #00d4ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(0,212,255,0.3));
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.header__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 6px;
}

.header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header__time {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.header__status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-online);
  box-shadow: 0 0 8px var(--color-online);
  animation: pulse-dot 2s ease-in-out infinite;
}

.header__status-dot.degraded {
  background: var(--color-progress);
  box-shadow: 0 0 8px var(--color-progress);
}

.header__status-dot.down {
  background: var(--color-down);
  box-shadow: 0 0 8px var(--color-down);
}

.header__divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  margin: 20px auto 0;
  opacity: 0.4;
}

/* ── Status Legend ──────────────────────────────────────── */
.status-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Section ───────────────────────────────────────────── */
.section {
  margin-top: 36px;
}

.section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-left: 4px;
}

.section__icon {
  font-size: 1.1rem;
}

.section__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section__line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Revenue App Cards ─────────────────────────────────── */
.grid-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.5s ease forwards;
  cursor: pointer;
}

.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, rgba(0,212,255,0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0,212,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(0,212,255,0.05);
}

.app-card:hover::before { opacity: 1; }

.app-card:active {
  transform: scale(0.98);
}

.app-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.app-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.12);
  flex-shrink: 0;
}

.app-card__badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.badge-live { background: rgba(34,197,94,0.12); color: var(--status-live); border: 1px solid rgba(34,197,94,0.25); }
.badge-dev { background: rgba(234,179,8,0.12); color: var(--status-dev); border: 1px solid rgba(234,179,8,0.25); }
.badge-offline { background: rgba(239,68,68,0.12); color: var(--status-offline); border: 1px solid rgba(239,68,68,0.25); }
.badge-progress { background: rgba(245,158,11,0.12); color: var(--status-progress); border: 1px solid rgba(245,158,11,0.25); }
.badge-unknown { background: rgba(100,116,139,0.12); color: var(--status-unknown); border: 1px solid rgba(100,116,139,0.25); }

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-live .badge__dot { background: var(--status-live); box-shadow: 0 0 6px var(--status-live); }
.badge-dev .badge__dot { background: var(--status-dev); box-shadow: 0 0 6px var(--status-dev); }
.badge-offline .badge__dot { background: var(--status-offline); }
.badge-progress .badge__dot { background: var(--status-progress); animation: pulse-dot 1.5s ease infinite; }
.badge-unknown .badge__dot { background: var(--status-unknown); }

.app-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.app-card__desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.app-card__url {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  margin-bottom: 12px;
  word-break: break-all;
  opacity: 0.7;
}

.app-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-card__btn {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 6px;
  padding: 10px 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: rgba(0,212,255,0.2);
  touch-action: manipulation;
}

.app-card__btn:hover {
  background: rgba(0,212,255,0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0,212,255,0.15);
}

.app-card__btn--disabled {
  color: var(--text-muted);
  background: rgba(100,116,139,0.08);
  border-color: rgba(100,116,139,0.2);
  cursor: default;
  pointer-events: none;
}

.app-card__health {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-unknown);
  transition: background 0.3s, box-shadow 0.3s;
}

.health-label { letter-spacing: 0.5px; }

/* ── Division Headers ──────────────────────────────────── */
.division-group {
  margin-bottom: 24px;
}

.division-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.division-header__accent {
  width: 4px;
  height: 20px;
  border-radius: 2px;
}

.division-header__accent--command { background: var(--div-command); box-shadow: 0 0 8px var(--div-command); }
.division-header__accent--strategy { background: var(--div-strategy); box-shadow: 0 0 8px var(--div-strategy); }
.division-header__accent--growth { background: var(--div-growth); box-shadow: 0 0 8px var(--div-growth); }
.division-header__accent--engineering { background: var(--div-engineering); box-shadow: 0 0 8px var(--div-engineering); }
.division-header__accent--legal { background: var(--div-legal); box-shadow: 0 0 8px var(--div-legal); }
.division-header__accent--finance { background: var(--div-finance); box-shadow: 0 0 8px var(--div-finance); }
.division-header__accent--support { background: var(--div-support); box-shadow: 0 0 8px var(--div-support); }

.division-header__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.division-header__title--command { color: var(--div-command); }
.division-header__title--strategy { color: var(--div-strategy); }
.division-header__title--growth { color: var(--div-growth); }
.division-header__title--engineering { color: var(--div-engineering); }
.division-header__title--legal { color: var(--div-legal); }
.division-header__title--finance { color: var(--div-finance); }
.division-header__title--support { color: var(--div-support); }

.division-header__count {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
}

.division-header__line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Ghost Fleet Agent Cards ───────────────────────────── */
.grid-agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0,212,255,0.1);
}

.agent-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 0 2px 2px 0;
}

.agent-card[data-division="command"]::after { background: var(--div-command); }
.agent-card[data-division="strategy"]::after { background: var(--div-strategy); }
.agent-card[data-division="growth"]::after { background: var(--div-growth); }
.agent-card[data-division="engineering"]::after { background: var(--div-engineering); }
.agent-card[data-division="legal"]::after { background: var(--div-legal); }
.agent-card[data-division="finance"]::after { background: var(--div-finance); }
.agent-card[data-division="support"]::after { background: var(--div-support); }

.agent-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.agent-card:active {
  transform: scale(0.98);
}

.agent-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.agent-card__name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.agent-card__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-unknown);
  flex-shrink: 0;
}

.agent-card__role {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.agent-card__status-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--color-unknown);
}

.agent-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.agent-card__division {
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
}

.agent-card[data-division="command"] .agent-card__division { color: var(--div-command); }
.agent-card[data-division="strategy"] .agent-card__division { color: var(--div-strategy); }
.agent-card[data-division="growth"] .agent-card__division { color: var(--div-growth); }
.agent-card[data-division="engineering"] .agent-card__division { color: var(--div-engineering); }
.agent-card[data-division="legal"] .agent-card__division { color: var(--div-legal); }
.agent-card[data-division="finance"] .agent-card__division { color: var(--div-finance); }
.agent-card[data-division="support"] .agent-card__division { color: var(--div-support); }

.agent-card__schedule {
  color: var(--text-muted);
  font-weight: 500;
}

.agent-card__expand-hint {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.agent-card:hover .agent-card__expand-hint {
  opacity: 1;
}

/* ── Agent/App Detail Modal ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.modal-panel.active {
  transform: translateX(0);
}

/* Wide modal for briefings — fills most of the screen */
.modal-panel.wide {
  width: 90vw;
  max-width: 1100px;
  right: 0;
  left: 50%;
  transform: translateX(50%) translateY(20px);
  opacity: 0;
  border-left: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  top: 5vh;
  height: 90vh;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.modal-panel.wide.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 640px) {
  .modal-panel.wide {
    width: 100vw;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    transform: translateX(0) translateY(20px);
    opacity: 0;
  }
  .modal-panel.wide.active {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

.modal-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.modal-panel__close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.modal-content {
  padding: 32px 28px 40px;
}

.modal-header {
  margin-bottom: 24px;
  padding-right: 40px;
}

.modal-header__name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.modal-header__role {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-header__divider {
  width: 60px;
  height: 3px;
  border-radius: 2px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-division-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.modal-division-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.modal-schedule {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.modal-skills {
  list-style: none;
  padding: 0;
}

.modal-skills li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-skills li:last-child {
  border-bottom: none;
}

.modal-skills__bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-status-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-last-activity {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.modal-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  border-left: 3px solid;
}

.modal-maps-to {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-style: italic;
}

/* Deploy badges in modal */
.deploy-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
}

.deploy-active {
  background: rgba(34,197,94,0.12);
  color: var(--color-online);
  border: 1px solid rgba(34,197,94,0.3);
}

.deploy-scheduled {
  background: rgba(129,140,248,0.12);
  color: var(--color-scheduled);
  border: 1px solid rgba(129,140,248,0.3);
}

.deploy-planned {
  background: rgba(100,116,139,0.12);
  color: var(--color-unknown);
  border: 1px solid rgba(100,116,139,0.3);
}

/* ── Agent Pipeline ────────────────────────────────────── */
.pipeline-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding: 16px 8px;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.pipeline-step:hover {
  transform: translateY(-2px);
}

.pipeline-step__avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  transition: all var(--transition);
  position: relative;
}

.pipeline-step__avatar.lit {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.08);
}

.pipeline-step__label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
  max-width: 90px;
}

.pipeline-step__name {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--border-subtle);
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.pipeline-arrow.lit {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0,212,255,0.4);
}

/* ── Infrastructure Bar ────────────────────────────────── */
.infra-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.infra-item {
  flex: 1 1 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  transition: all var(--transition);
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
  cursor: pointer;
}

.infra-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.08);
}

.infra-item:active {
  transform: scale(0.98);
}

.infra-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-unknown);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.infra-item__label {
  color: var(--text-secondary);
  font-weight: 600;
}

.infra-item__port {
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  font-size: 0.65rem;
}

.infra-item__status-text {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: auto;
}

/* ── Quick Links ───────────────────────────────────────── */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-link {
  flex: 1 1 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.quick-link:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
  border-color: rgba(0,212,255,0.2);
}

.quick-link__icon {
  font-size: 1rem;
}

.quick-link__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Last Checked ──────────────────────────────────────── */
.last-checked {
  text-align: center;
  margin-top: 32px;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ── PWA Install Banner ────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #111827, #1a2235);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: var(--radius);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-banner.visible {
  transform: translateX(-50%) translateY(0);
}

.install-banner__text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.install-banner__btn {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #0a0e1a;
  background: var(--accent-cyan);
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.install-banner__btn:hover { background: #33dfff; }

.install-banner__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ── Lead Badge ────────────────────────────────────────── */
.agent-card__lead-badge {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  margin-left: 6px;
  vertical-align: middle;
}

[data-division="command"] .agent-card__lead-badge { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.3); }
[data-division="strategy"] .agent-card__lead-badge { background: rgba(59,130,246,0.12); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
[data-division="growth"] .agent-card__lead-badge { background: rgba(34,197,94,0.12); color: #22c55e; border-color: rgba(34,197,94,0.3); }
[data-division="engineering"] .agent-card__lead-badge { background: rgba(249,115,22,0.12); color: #f97316; border-color: rgba(249,115,22,0.3); }
[data-division="legal"] .agent-card__lead-badge { background: rgba(168,85,247,0.12); color: #a855f7; border-color: rgba(168,85,247,0.3); }
[data-division="finance"] .agent-card__lead-badge { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
[data-division="support"] .agent-card__lead-badge { background: rgba(100,116,139,0.12); color: #94a3b8; border-color: rgba(100,116,139,0.3); }

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 12px 10px 40px; }
  .header { padding: 20px 0 16px; }
  .header__title { letter-spacing: 4px; }
  .header__subtitle { letter-spacing: 2px; font-size: 0.75rem; }
  .header__meta { flex-direction: column; gap: 6px; }

  .status-legend {
    gap: 10px;
    padding: 8px 12px;
  }
  .legend-item {
    font-size: 0.6rem;
  }

  .grid-apps { grid-template-columns: 1fr; gap: 10px; }
  .grid-agents { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .infra-bar { gap: 8px; }
  .infra-item { flex: 1 1 100%; }
  .quick-links { gap: 8px; }
  .quick-link { flex: 1 1 100%; }
  .section { margin-top: 28px; }
  .install-banner { left: 10px; right: 10px; transform: translateX(0) translateY(100px); }
  .install-banner.visible { transform: translateX(0) translateY(0); }

  /* Modal full width on mobile */
  .modal-panel {
    width: 100vw;
    border-left: none;
  }

  .modal-content {
    padding: 24px 20px 40px;
  }

  .modal-header__name {
    font-size: 1.3rem;
  }

  /* Pipeline scroll hint */
  .pipeline-container {
    margin: 0 -10px;
    padding: 8px 10px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid-apps { grid-template-columns: repeat(2, 1fr); }
  .grid-agents { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1025px) {
  .grid-apps { grid-template-columns: repeat(4, 1fr); }
  .grid-agents { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .grid-agents { grid-template-columns: repeat(5, 1fr); }
}

/* ── Ghost Fleet Control Buttons ─────────────────────────── */
.fleet-controls {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.fleet-btn {
  flex: 1;
  padding: 6px 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
}
.fleet-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.fleet-btn:disabled { opacity: 0.3; cursor: wait; }

/* Run button — matches division color */
.fleet-btn--run { border-color: rgba(255,255,255,0.15); }
.fleet-btn--command { border-color: rgba(239,68,68,0.3); color: rgba(239,68,68,0.7); }
.fleet-btn--command:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.fleet-btn--strategy { border-color: rgba(59,130,246,0.3); color: rgba(59,130,246,0.7); }
.fleet-btn--strategy:hover { background: rgba(59,130,246,0.15); color: #3b82f6; }
.fleet-btn--growth { border-color: rgba(34,197,94,0.3); color: rgba(34,197,94,0.7); }
.fleet-btn--growth:hover { background: rgba(34,197,94,0.15); color: #22c55e; }
.fleet-btn--engineering { border-color: rgba(249,115,22,0.3); color: rgba(249,115,22,0.7); }
.fleet-btn--engineering:hover { background: rgba(249,115,22,0.15); color: #f97316; }
.fleet-btn--legal { border-color: rgba(168,85,247,0.3); color: rgba(168,85,247,0.7); }
.fleet-btn--legal:hover { background: rgba(168,85,247,0.15); color: #a855f7; }
.fleet-btn--finance { border-color: rgba(245,158,11,0.3); color: rgba(245,158,11,0.7); }
.fleet-btn--finance:hover { background: rgba(245,158,11,0.15); color: #f59e0b; }
.fleet-btn--support { border-color: rgba(100,116,139,0.3); color: rgba(100,116,139,0.7); }
.fleet-btn--support:hover { background: rgba(100,116,139,0.15); color: #94a3b8; }

/* Wake button — glows when agent is awake */
.fleet-btn--wake { border-color: rgba(255,255,255,0.1); }
.fleet-btn--lit-command { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.5); color: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.2); }
.fleet-btn--lit-strategy { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.5); color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.2); }
.fleet-btn--lit-growth { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.5); color: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.2); }
.fleet-btn--lit-engineering { background: rgba(249,115,22,0.15); border-color: rgba(249,115,22,0.5); color: #f97316; box-shadow: 0 0 10px rgba(249,115,22,0.2); }
.fleet-btn--lit-legal { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.5); color: #a855f7; box-shadow: 0 0 10px rgba(168,85,247,0.2); }
.fleet-btn--lit-finance { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.5); color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.2); }
.fleet-btn--lit-support { background: rgba(100,116,139,0.15); border-color: rgba(100,116,139,0.5); color: #94a3b8; box-shadow: 0 0 10px rgba(100,116,139,0.2); }

/* Sleep button — dimmed when sleeping */
.fleet-btn--dim { color: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.05); }

/* Pipeline running animation */
@keyframes pipeline-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.pipeline-step__avatar.running {
  animation: pipeline-pulse 1s ease-in-out infinite;
}

/* ── Dynamic Pipeline States ──────────────────────────── */
.pipeline-step__avatar.pending { opacity: 0.3; border-color: rgba(255,255,255,0.1); }
.pipeline-step__avatar.completed { border-color: #22c55e; box-shadow: 0 0 12px rgba(34,197,94,0.3); }
.pipeline-step__avatar.completed span { color: #22c55e; }
.pipeline-step__avatar.failed { border-color: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,0.3); }
.pipeline-step__avatar.failed span { color: #ef4444; }
.pipeline-step__label.running { color: var(--accent-cyan); font-weight: 600; }
.pipeline-header__task { color: var(--accent-cyan); font-size: 0.7rem; letter-spacing: 0.1em; margin-left: 8px; }
.pipeline-progress { text-align: center; margin-top: 8px; font-size: 0.7rem; color: var(--text-secondary); }
.pipeline-dimmed .pipeline-step__avatar { opacity: 0.5; }
.pipeline-dimmed .pipeline-step__label { opacity: 0.5; }
.pipeline-dimmed .pipeline-step__name { opacity: 0.5; }
.pipeline-dimmed .pipeline-arrow { opacity: 0.3; }
.pipeline-placeholder {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Multi-pipeline view */
.pipeline-multi {
  flex-direction: column;
  gap: 8px;
  min-width: unset;
}

.pipeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.pipeline-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0,212,255,0.2);
}

.pipeline-row__name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
  white-space: nowrap;
}

.pipeline-row__steps {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
}

.pipeline-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s;
}

.pipeline-mini-dot.completed { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.pipeline-mini-dot.failed { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.pipeline-mini-dot.running { animation: pipeline-pulse 1s ease-in-out infinite; }
.pipeline-mini-dot.pending { background: rgba(255,255,255,0.08); }

.pipeline-row__progress {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* =========================================================
   TAB NAVIGATION
   ========================================================= */

.tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-top: 20px;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
}
.tab-nav::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.tab-nav__btn {
  flex: 0 0 auto;
  min-width: auto;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-nav__btn:hover {
  background: rgba(0,212,255,0.05);
  color: var(--text-secondary);
}

.tab-nav__btn.active {
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.2);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* =========================================================
   BRIEFINGS
   ========================================================= */

.briefings-sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.sub-tab {
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sub-tab:hover {
  background: rgba(0,212,255,0.05);
  color: var(--text-secondary);
}

.sub-tab.active {
  background: rgba(0,212,255,0.12);
  color: var(--accent-cyan);
  border-color: rgba(0,212,255,0.3);
}

/* Color-coded briefing sub-tabs */
.sub-tab[data-subtab="agent-reports"] { color: var(--div-strategy); border-color: rgba(59,130,246,0.25); }
.sub-tab[data-subtab="agent-reports"]:hover { background: rgba(59,130,246,0.08); }
.sub-tab[data-subtab="agent-reports"].active { background: rgba(59,130,246,0.15); color: var(--div-strategy); border-color: rgba(59,130,246,0.4); }

.sub-tab[data-subtab="system-status"] { color: var(--div-engineering); border-color: rgba(249,115,22,0.25); }
.sub-tab[data-subtab="system-status"]:hover { background: rgba(249,115,22,0.08); }
.sub-tab[data-subtab="system-status"].active { background: rgba(249,115,22,0.15); color: var(--div-engineering); border-color: rgba(249,115,22,0.4); }

.sub-tab[data-subtab="market-intel"] { color: var(--div-growth); border-color: rgba(34,197,94,0.25); }
.sub-tab[data-subtab="market-intel"]:hover { background: rgba(34,197,94,0.08); }
.sub-tab[data-subtab="market-intel"].active { background: rgba(34,197,94,0.15); color: var(--div-growth); border-color: rgba(34,197,94,0.4); }

.sub-tab[data-subtab="email"] { color: var(--div-support); border-color: rgba(100,116,139,0.25); }
.sub-tab[data-subtab="email"]:hover { background: rgba(100,116,139,0.08); }
.sub-tab[data-subtab="email"].active { background: rgba(100,116,139,0.15); color: var(--div-support); border-color: rgba(100,116,139,0.4); }

.sub-tab[data-subtab="pipeline-results"] { color: var(--div-legal); border-color: rgba(168,85,247,0.25); }
.sub-tab[data-subtab="pipeline-results"]:hover { background: rgba(168,85,247,0.08); }
.sub-tab[data-subtab="pipeline-results"].active { background: rgba(168,85,247,0.15); color: var(--div-legal); border-color: rgba(168,85,247,0.4); }

.briefings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.briefings-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.briefing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.briefing-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0,212,255,0.2);
  transform: translateY(-2px);
}

.briefing-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.briefing-card__category {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.briefing-card__date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.briefing-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.briefing-card__summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.briefing-card__agent {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Briefing full content in modal */

.briefing-full-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.briefing-full-content h1 {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 20px 0 10px;
  font-weight: 800;
}

.briefing-full-content h2 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 18px 0 8px;
  font-weight: 700;
}

.briefing-full-content h3 {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin: 14px 0 6px;
  font-weight: 700;
}

.briefing-full-content h4 {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin: 12px 0 6px;
  font-weight: 600;
}

.briefing-full-content strong {
  color: var(--text-primary);
}

.briefing-full-content em {
  color: var(--text-secondary);
  font-style: italic;
}

.briefing-full-content ul {
  padding-left: 20px;
  margin: 8px 0;
}

.briefing-full-content li {
  margin: 4px 0;
}

.briefing-full-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.briefing-full-content code {
  background: rgba(0,212,255,0.08);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
}

.briefing-full-content .md-code {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 10px 0;
  white-space: pre-wrap;
}

.briefing-full-content .md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.75rem;
}

.briefing-full-content .md-table td {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.briefing-full-content .md-table tr:first-child td {
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(0,0,0,0.2);
}

/* =========================================================
   OPPORTUNITY KNOCKS IDEAS
   ========================================================= */

.section__count {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 1px;
}

.ideas-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.ideas-search {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s;
}

.ideas-search:focus {
  border-color: rgba(0,212,255,0.4);
}

.ideas-search::placeholder {
  color: var(--text-muted);
}

.ideas-sort {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.idea-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all var(--transition);
  cursor: pointer;
}

.idea-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.idea-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.idea-card__name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.idea-card__score {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.idea-card__tagline {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}

.idea-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.idea-card__category {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.idea-card__engagement {
  display: flex;
  gap: 6px;
}

.idea-eng {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.idea-eng--visits {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}

.idea-eng--opens {
  background: rgba(168,85,247,0.1);
  color: #a855f7;
}

.ideas-show-more {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
}

.ideas-show-more:hover {
  background: rgba(0,212,255,0.12);
}

@media (max-width: 640px) {
  .ideas-grid { grid-template-columns: 1fr; }
  .ideas-controls { flex-direction: column; }
}

/* Idea Modal */
.idea-modal__section {
  margin-bottom: 18px;
}

.idea-modal__section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.idea-modal__section-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.idea-modal__stat-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.idea-modal__stat {
  text-align: center;
}

.idea-modal__stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.idea-modal__stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* =========================================================
   CONTENT REVIEW
   ========================================================= */

.content-sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.content-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.08);
}

.content-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.content-card__type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.content-card__date {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
  margin-left: auto;
}

.content-badge {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.content-badge--auto { background: rgba(0,212,255,0.1); color: var(--accent-cyan); }
.content-badge--approved { background: rgba(34,197,94,0.12); color: #22c55e; }
.content-badge--denied { background: rgba(239,68,68,0.12); color: #ef4444; }

.content-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.content-card__summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card__platform {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.content-card__actions {
  display: flex;
  gap: 6px;
}

.content-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
}

.content-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.content-btn:disabled { opacity: 0.4; cursor: wait; }

.content-btn--approve { border-color: rgba(34,197,94,0.3); color: rgba(34,197,94,0.7); }
.content-btn--approve:hover { background: rgba(34,197,94,0.12); color: #22c55e; }

.content-btn--edit { border-color: rgba(0,212,255,0.3); color: rgba(0,212,255,0.7); }
.content-btn--edit:hover { background: rgba(0,212,255,0.12); color: var(--accent-cyan); }

.content-btn--deny { border-color: rgba(239,68,68,0.3); color: rgba(239,68,68,0.5); }
.content-btn--deny:hover { background: rgba(239,68,68,0.12); color: #ef4444; }

@media (max-width: 640px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   JENA VOICE WIDGET (LiveKit)
   ========================================================= */

.jena-voice-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #00d4ff, #7b68ee);
  border-radius: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.jena-voice-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 212, 255, 0.4);
}

.jena-voice-toggle__icon { font-size: 1.3rem; }
.jena-voice-toggle__label { font-size: 0.8rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }

.jena-voice-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.1);
  overflow: hidden;
}

.jena-voice-panel__header {
  padding: 14px 16px;
  background: rgba(0, 212, 255, 0.05);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.jena-voice-panel__title { font-size: 0.9rem; font-weight: 800; color: var(--accent-cyan); }
.jena-voice-panel__sub { font-size: 0.68rem; color: var(--text-muted); flex: 1; }
.jena-voice-panel__close {
  background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
}
.jena-voice-panel__close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.jena-voice-panel__visualizer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  gap: 16px;
}

.jena-voice-orb {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.15), transparent);
  border: 2px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.jena-voice-orb.connected {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
}

.jena-voice-orb.speaking {
  border-color: #00d4ff;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.3), 0 0 80px rgba(0, 212, 255, 0.1);
  animation: voice-pulse 0.8s ease-in-out infinite;
}

.jena-voice-orb__inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff, #7b68ee);
  opacity: 0.6;
}

.jena-voice-orb.connected .jena-voice-orb__inner { opacity: 0.9; }
.jena-voice-orb.speaking .jena-voice-orb__inner { opacity: 1; }

@keyframes voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.jena-voice-panel__state {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.jena-voice-panel__controls {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  justify-content: center;
}

.jena-voice-btn {
  padding: 10px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jena-voice-btn:hover { background: rgba(255,255,255,0.1); }

.jena-voice-btn--end {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.jena-voice-btn--end:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* =========================================================
   JAEL SECURITY DIVISION
   ========================================================= */

:root {
  --jael-red: #ef4444;
  --jael-red-dim: rgba(239,68,68,0.15);
  --jael-red-glow: rgba(239,68,68,0.4);
  --jael-green: #22c55e;
  --jael-yellow: #eab308;
  --jael-orange: #f97316;
}

.jael-shield-icon { display: flex; align-items: center; }

.jael-overall-grade {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 6px;
  background: var(--jael-red-dim);
  color: var(--jael-red);
  margin-left: auto;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.jael-overall-grade.grade-a { background: rgba(34,197,94,0.15); color: #22c55e; }
.jael-overall-grade.grade-b { background: rgba(59,130,246,0.15); color: #3b82f6; }
.jael-overall-grade.grade-c { background: rgba(234,179,8,0.15); color: #eab308; }
.jael-overall-grade.grade-d { background: rgba(249,115,22,0.15); color: #f97316; }
.jael-overall-grade.grade-f { background: var(--jael-red-dim); color: var(--jael-red); }

.jael-summary {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow-x: auto;
}
.jael-stat {
  flex: 1;
  min-width: 80px;
  text-align: center;
}
.jael-stat__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--jael-green);
}
.jael-stat--warn { color: var(--jael-yellow) !important; }
.jael-stat--danger { color: var(--jael-red) !important; }
.jael-stat__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.jael-sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.jael-panel { display: none; }
.jael-panel.active { display: block; }

/* JAEL App Security Cards */
.jael-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.jael-app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.jael-app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border-color: var(--jael-red-glow);
}
.jael-app-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.jael-app-card__name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  flex: 1;
}
.jael-app-card__grade {
  font-size: 1rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}
.jael-app-card__checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jael-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.jael-check__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
}
.jael-check__icon--pass { background: rgba(34,197,94,0.2); color: #22c55e; }
.jael-check__icon--fail { background: rgba(239,68,68,0.2); color: #ef4444; }
.jael-check__icon--warn { background: rgba(234,179,8,0.2); color: #eab308; }

/* JAEL Scores Grid */
.jael-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.jael-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}
.jael-score-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.jael-score-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}
.jael-score-card__grade {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.jael-score-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.jael-score-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.jael-score-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.jael-score-detail__val { font-weight: 600; }
.jael-score-detail__val--pass { color: var(--jael-green); }
.jael-score-detail__val--fail { color: var(--jael-red); }

/* JAEL Threat Feed */
.jael-threat-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}
.jael-threat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}
.jael-threat-item--critical { border-left: 3px solid var(--jael-red); }
.jael-threat-item--warning { border-left: 3px solid var(--jael-yellow); }
.jael-threat-item--info { border-left: 3px solid var(--accent-cyan); }
.jael-threat-item__time {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}
.jael-threat-item__msg { flex: 1; color: var(--text-secondary); line-height: 1.5; }
.jael-threat-item__severity {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.jael-threat-item__severity--critical { background: rgba(239,68,68,0.15); color: var(--jael-red); }
.jael-threat-item__severity--warning { background: rgba(234,179,8,0.15); color: var(--jael-yellow); }
.jael-threat-item__severity--info { background: rgba(0,212,255,0.12); color: var(--accent-cyan); }

/* JAEL Agents Grid */
.jael-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.jael-agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
}
.jael-agent-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.jael-agent-card__name {
  font-weight: 700;
  font-size: 0.88rem;
  flex: 1;
}
.jael-agent-card__status {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.jael-agent-card__status--active { background: rgba(34,197,94,0.15); color: #22c55e; }
.jael-agent-card__status--sleeping { background: rgba(100,116,139,0.15); color: #64748b; }
.jael-agent-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.jael-agent-card__tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.jael-agent-tag {
  font-size: 0.6rem;
  padding: 2px 8px;
  background: var(--jael-red-dim);
  color: var(--jael-red);
  border-radius: 4px;
  font-weight: 600;
}

/* JAEL Actions Grid */
.jael-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.jael-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.jael-action-btn:hover {
  border-color: var(--jael-red-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239,68,68,0.15);
}
.jael-action-btn__icon { font-size: 1.6rem; }
.jael-action-btn__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}
.jael-action-btn__desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* JAEL Badge Footer */
.jael-badge-footer {
  display: flex;
  justify-content: center;
  padding: 24px 0 12px 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.jael-badge-footer:hover { opacity: 1; }

/* Light theme overrides for JAEL */
body.theme-light .jael-app-card { background: var(--bg-card); }
body.theme-light .jael-score-card { background: var(--bg-card); }
body.theme-light .jael-threat-item { background: var(--bg-card); }
body.theme-light .jael-agent-card { background: var(--bg-card); }
body.theme-light .jael-action-btn { background: var(--bg-card); }
body.theme-light .jael-summary { background: var(--bg-card); }

/* Responsive */
@media (max-width: 640px) {
  .briefings-grid {
    grid-template-columns: 1fr;
  }
  .tab-nav__btn {
    padding: 8px 12px;
    font-size: 0.65rem;
    letter-spacing: 1px;
  }
  .jena-chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
  }
}

/* ── Claude Bridge Chat ─────────────────────────────────── */

.claude-conn-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-left: auto;
  flex-shrink: 0;
}
.claude-conn-status.connected {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.claude-conn-status.connecting {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.claude-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: break-word;
  animation: bubbleFadeIn 0.2s ease;
}
@keyframes bubbleFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.claude-bubble--user {
  align-self: flex-end;
  background: var(--accent-cyan);
  color: #0a0e1a;
  border-bottom-right-radius: 4px;
}
.claude-bubble--assistant {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}
.claude-bubble--assistant pre {
  background: #0d1117;
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.82rem;
  margin: 6px 0;
}
.claude-bubble--assistant code {
  background: rgba(0,212,255,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}
.claude-bubble--assistant pre code {
  background: none;
  padding: 0;
}
.claude-bubble--system {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
  padding: 4px 0;
}
.claude-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.claude-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}
.claude-typing span:nth-child(2) { animation-delay: 0.15s; }
.claude-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

/* ── Settings Tab ──────────────────────────────────────── */

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-group__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.settings-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label {
  font-size: 0.82rem;
  color: var(--text-primary);
}
.settings-row__value {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.settings-toggle-group {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  padding: 2px;
}
.settings-toggle {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-toggle.active {
  background: var(--accent-cyan);
  color: #0a0e1a;
}
.settings-btn {
  padding: 6px 20px;
  border: 1px solid var(--accent-cyan);
  background: transparent;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-btn:hover {
  background: var(--accent-cyan);
  color: #0a0e1a;
}
.settings-btn.active {
  background: var(--color-online);
  border-color: var(--color-online);
  color: #fff;
}
.settings-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Command Mode Activity Log */
.command-activity-log {
  max-height: 400px;
  overflow-y: auto;
}
.activity-entry {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.78rem;
}
.activity-entry:last-child { border-bottom: none; }
.activity-entry__time {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
}
.activity-entry__action {
  color: var(--text-primary);
  flex: 1;
}
.activity-entry__type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.activity-entry__type--approve { background: rgba(34,197,94,0.15); color: #22c55e; }
.activity-entry__type--deny { background: rgba(239,68,68,0.15); color: #ef4444; }
.activity-entry__type--view { background: rgba(59,130,246,0.15); color: #3b82f6; }
.activity-entry__type--note { background: rgba(245,158,11,0.15); color: #f59e0b; }
.activity-entry__note {
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
}

/* Content Notes (Command Mode) */
.content-notes-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.content-notes-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 8px 12px;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: border 0.2s;
}
.content-notes-input:focus { border-color: var(--accent-cyan); }
.content-notes-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

/* ── Light Theme ───────────────────────────────────────── */

body.theme-light {
  --bg-primary: #f0f2f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --bg-section: #e8edf2;
  --border-subtle: #d1d5db;
  --border-glow: #0077b5;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent-cyan: #0077b5;
}
body.theme-light::before {
  background:
    linear-gradient(rgba(0,119,181,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,119,181,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}
body.theme-light .header__title { -webkit-text-fill-color: var(--text-primary); }
body.theme-light .tab-nav__btn { color: var(--text-secondary); }
body.theme-light .tab-nav__btn.active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }
body.theme-light .briefing-card { background: var(--bg-card); }
body.theme-light .app-card { background: var(--bg-card); }
body.theme-light .agent-card { background: var(--bg-card); }
body.theme-light .content-card { background: var(--bg-card); }
body.theme-light .idea-card { background: var(--bg-card); }
body.theme-light .settings-toggle-group { background: rgba(0,0,0,0.06); }
body.theme-light .content-notes-input { background: rgba(0,0,0,0.04); }
body.theme-light .modal-panel { background: var(--bg-card); }
body.theme-light .modal-overlay { background: rgba(0,0,0,0.4); }

/* ── Briefing Card Overhaul ────────────────────────────── */

.briefing-card__expand-link {
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
}
.briefing-card__expand-link:hover { text-decoration: underline; }
.briefing-card__full-content {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
}
.briefing-card__full-content.expanded { display: block; }
.briefing-card__full-content pre {
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.75rem;
}

/* Briefing card clickable overhaul */
.briefing-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.briefing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ══════════════════════════════════════════════════════════════ */
/* TOAST NOTIFICATION                                            */
/* ══════════════════════════════════════════════════════════════ */
.gs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,212,255,0.15);
  border: 1px solid rgba(0,212,255,0.4);
  color: #00d4ff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.gs-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════════ */
/* CONTEXT WINDOW MONITOR TAB                                    */
/* ══════════════════════════════════════════════════════════════ */
.ctx-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-left: 8px;
}
.ctx-live-dot.ctx-online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.ctx-live-dot.ctx-offline { background: #ef4444; }

.ctx-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ctx-stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.ctx-stat__value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-cyan);
}
.ctx-stat__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.ctx-sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ctx-session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}
.ctx-session-card.ctx-warning { border-color: rgba(234,179,8,0.4); }
.ctx-session-card.ctx-critical { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.03); }

.ctx-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ctx-session-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.ctx-session-pct {
  font-size: 1.3rem;
  font-weight: 900;
}

.ctx-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ctx-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.ctx-session-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ctx-session-task {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 4px 8px;
  background: rgba(0,212,255,0.05);
  border-radius: 4px;
  margin: 6px 0;
}
.ctx-alert {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  margin: 6px 0;
}
.ctx-session-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.ctx-btn {
  flex: 1;
  padding: 6px 10px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.ctx-btn:hover { background: rgba(0,212,255,0.15); }
.ctx-btn--save { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #ef4444; }
.ctx-btn--save:hover { background: rgba(239,68,68,0.15); }

.ctx-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.ctx-history-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.ctx-history-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.ctx-history-meta {
  display: flex;
  gap: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════ */
/* MEGAMIND TAB                                                  */
/* ══════════════════════════════════════════════════════════════ */
.mm-mode-badge {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  margin-left: 8px;
}

.mm-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.mm-stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.mm-stat__value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-cyan);
}
.mm-stat__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.mm-sub-section { margin-bottom: 16px; }
.mm-sub-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.mm-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mm-provider-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mm-provider-dot { width: 10px; height: 10px; border-radius: 50%; }
.mm-provider-name { font-weight: 700; font-size: 0.8rem; color: var(--text-primary); }
.mm-provider-status { font-size: 0.68rem; color: var(--text-muted); }
.mm-provider-model { font-size: 0.65rem; color: var(--accent-cyan); }

.mm-sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.mm-panel { display: none; }
.mm-panel.active { display: block; }

.mm-table {
  width: 100%;
  border-collapse: collapse;
}
.mm-table th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mm-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.mm-table tr:hover { background: rgba(255,255,255,0.02); }

.mm-models-grid, .mm-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.mm-model-card, .mm-service-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.mm-model-name, .mm-service-name { font-weight: 700; font-size: 0.82rem; color: var(--text-primary); }
.mm-model-size, .mm-service-routing { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════ */
/* CLEO TAB                                                      */
/* ══════════════════════════════════════════════════════════════ */
.cleo-status-badge {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: rgba(34,197,94,0.1);
  margin-left: 8px;
}

.cleo-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.cleo-mini-stat { display: flex; flex-direction: column; gap: 2px; }
.cleo-mini-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cleo-mini-value { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }

.cleo-scan-btn {
  margin-left: auto;
  padding: 8px 16px;
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.cleo-scan-btn:hover { background: rgba(0,212,255,0.2); }
.cleo-scan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cleo-sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.cleo-panel { display: none; }
.cleo-panel.active { display: block; }

/* Drives */
.cleo-drives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.cleo-drive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.cleo-drive-icon { font-size: 1.8rem; margin-bottom: 6px; }
.cleo-drive-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 2px; }
.cleo-drive-path { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 8px; }
.cleo-drive-bar {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cleo-drive-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.cleo-drive-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
}
.cleo-drive-health { font-size: 0.65rem; font-weight: 700; margin-top: 6px; }

/* File Browser */
.cleo-browser-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.cleo-search {
  flex: 1;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}
.cleo-search:focus { border-color: var(--accent-cyan); }
.cleo-category-filter {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.78rem;
}
.cleo-breadcrumb {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cleo-files-grid { display: flex; flex-direction: column; gap: 2px; }
.cleo-file-row {
  display: grid;
  grid-template-columns: 28px 1fr 100px 70px 160px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  font-size: 0.78rem;
  transition: background 0.15s;
}
.cleo-file-row:hover { background: rgba(0,212,255,0.05); }
.cleo-file-icon { text-align: center; }
.cleo-file-name { color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cleo-file-category { color: var(--accent-cyan); font-size: 0.68rem; font-weight: 600; }
.cleo-file-size { color: var(--text-muted); font-size: 0.68rem; text-align: right; }
.cleo-file-path { color: var(--text-muted); font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cleo-file-more { padding: 8px; text-align: center; color: var(--text-muted); font-size: 0.72rem; }

/* Activity */
.cleo-activity-feed { display: flex; flex-direction: column; gap: 4px; }
.cleo-activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(0,212,255,0.3);
}
.cleo-activity-icon { font-size: 1rem; }
.cleo-activity-text { flex: 1; font-size: 0.78rem; color: var(--text-secondary); }
.cleo-activity-time { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }

/* Mobile responsive for new tabs */
@media (max-width: 600px) {
  .ctx-summary, .mm-summary { grid-template-columns: repeat(2, 1fr); }
  .mm-providers-grid { grid-template-columns: repeat(2, 1fr); }
  .cleo-drives-grid { grid-template-columns: 1fr; }
  .cleo-file-row { grid-template-columns: 28px 1fr 70px; }
  .cleo-file-category, .cleo-file-path { display: none; }
  .cleo-browser-controls { flex-direction: column; }
  .cleo-status-bar { flex-direction: column; align-items: flex-start; }
  .cleo-scan-btn { margin-left: 0; width: 100%; }
}
