/* ============================================================
   OPS VIEWER — INTELLIGENCE FILTER
   Dark-first, mobile-first editorial reader
   ============================================================ */

/* ---- FONT IMPORTS ---- */
/* Loaded via <link> in HTML */

/* ============================================================
   DESIGN TOKENS — DARK THEME (default)
   ============================================================ */
:root,
[data-theme="dark"] {
  /* ── Cool Slate — night-reading palette ── */
  --bg:               #0d1117;
  --bg-card:          #161b22;
  --bg-card-hover:    #1c2230;
  --bg-elevated:      #21262d;
  --border:           rgba(139,148,158,0.12);
  --border-strong:    rgba(139,148,158,0.22);

  /* Text — cool off-white, not harsh */
  --text-primary:     #e6edf3;
  --text-secondary:   #8b949e;
  --text-muted:       #484f58;

  /* Intel accent — soft terminal blue */
  --accent:           #58a6ff;
  --accent-glow:      rgba(88,166,255,0.12);
  --accent-hover:     #79b8ff;

  /* Signal accent — muted gold */
  --signal-accent:    #d29922;
  --signal-glow:      rgba(210,153,34,0.10);

  /* Health — desaturated red, still urgent */
  --health-alert:     #f85149;
  --health-bg:        rgba(248,81,73,0.07);
  --health-border:    rgba(248,81,73,0.30);

  /* Domain colors — all muted to match slate palette */
  --geo-color:        #d29922;
  --geo-bg:           rgba(210,153,34,0.08);

  --invest-color:     #3fb950;
  --invest-bg:        rgba(63,185,80,0.08);

  --ai-color:         #58a6ff;
  --ai-bg:            rgba(88,166,255,0.08);

  --advisory-color:   #bc8cff;
  --advisory-bg:      rgba(188,140,255,0.08);

  --shadow-sm:        0 1px 3px rgba(1,4,9,0.6);
  --shadow-md:        0 4px 16px rgba(1,4,9,0.7);
  --shadow-lg:        0 8px 32px rgba(1,4,9,0.8);

  --radius-sm:        8px;
  --radius-md:        12px;
  --radius-lg:        16px;
  --radius-pill:      999px;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;

  --header-height: 56px;
  --tab-height:    44px;
  --preview-banner-height: 30px;

  color-scheme: dark;
}

/* ============================================================
   LIGHT THEME OVERRIDE
   ============================================================ */
[data-theme="light"] {
  /* Cool slate light — neutral, easy daytime read */
  --bg:               #f0f2f5;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f6f8fa;
  --bg-elevated:      #eaeef2;
  --border:           rgba(31,35,40,0.10);
  --border-strong:    rgba(31,35,40,0.20);

  --text-primary:     #1f2328;
  --text-secondary:   #57606a;
  --text-muted:       #8c959f;

  --accent:           #0969da;
  --accent-glow:      rgba(9,105,218,0.10);
  --accent-hover:     #0550ae;

  --signal-accent:    #9a6700;
  --signal-glow:      rgba(154,103,0,0.08);

  --health-alert:     #cf222e;
  --health-bg:        rgba(207,34,46,0.05);
  --health-border:    rgba(207,34,46,0.25);

  --geo-color:        #9a6700;
  --geo-bg:           rgba(154,103,0,0.06);

  --invest-color:     #1a7f37;
  --invest-bg:        rgba(26,127,55,0.06);

  --ai-color:         #0969da;
  --ai-bg:            rgba(9,105,218,0.06);

  --advisory-color:   #8250df;
  --advisory-bg:      rgba(130,80,223,0.06);

  color-scheme: light;
}

/* ============================================================
   GLOBAL RESET + BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   DESIGN PREVIEW BANNER
   ============================================================ */
.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--preview-banner-height);
  background: var(--signal-accent);
  color: #000;
  font-family: 'Satoshi', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
}

.preview-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 700;
  color: rgba(0,0,0,0.5);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.preview-banner-close:hover { color: #000; background: rgba(0,0,0,0.1); }

/* Push everything below the banner */
body {
  padding-top: var(--preview-banner-height);
}

/* ============================================================
   STICKY HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: var(--preview-banner-height);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .site-header {
  background: rgba(12,12,18,0.92);
}
[data-theme="light"] .site-header {
  background: rgba(245,245,248,0.92);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-logo {
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
}
.header-logo:hover { opacity: 0.8; text-decoration: none; }

.header-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.header-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-md);
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}

.header-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.meta-chip {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  white-space: nowrap;
  line-height: 1.6;
}

/* Hide meta chips on very small phones */
@media (max-width: 430px) {
  .header-meta { display: none; }
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Show/hide sun/moon based on theme */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============================================================
   TAB BAR
   ============================================================ */
.tab-bar {
  position: sticky;
  top: calc(var(--preview-banner-height) + var(--header-height));
  z-index: 99;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--tab-height);
}
[data-theme="dark"] .tab-bar { background: rgba(12,12,18,0.95); }
[data-theme="light"] .tab-bar { background: rgba(245,245,248,0.95); }

.tab-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: stretch;
  padding: 0 16px;
  gap: 4px;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: 'Satoshi', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  height: 100%;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.15s;
}

/* Intel active state */
.tab-intel.active {
  color: var(--accent);
}
.tab-intel.active::after {
  background: var(--accent);
}

/* Signal active state */
.tab-signal.active {
  color: var(--signal-accent);
}
.tab-signal.active::after {
  background: var(--signal-accent);
}

/* Video active state — soft red */
.tab-video.active {
  color: #e05c5c;
}
.tab-video.active::after {
  background: #e05c5c;
}

/* ============================================================
   RESEARCH QUEUE BANNER
   ============================================================ */
.research-banner {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.research-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.research-banner-icon { font-size: 14px; }

.research-banner-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
}

.research-banner-btn {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  transition: background 0.15s;
}
.research-banner-btn:hover { background: var(--accent); color: #fff; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  height: 12px;
}

.skeleton-line-sm  { width: 40%; }
.skeleton-line-md  { width: 70%; }
.skeleton-line-lg  { width: 90%; height: 18px; }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   ERROR STATE
   ============================================================ */
.error-state {
  text-align: center;
  padding: 60px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 40px;
  color: var(--health-alert);
}

.error-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.error-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.error-retry {
  margin-top: 8px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.error-retry:hover { background: var(--accent-hover); }

/* ============================================================
   SECTION HEADERS (collapsible)
   ============================================================ */
.briefing-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.section-header:hover .section-title { color: var(--text-primary); }

.section-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
  transition: color 0.15s;
}

.section-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--health-alert);
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.section-count {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
  line-height: 1.6;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.chevron.open {
  transform: rotate(0deg);
}
.chevron.closed {
  transform: rotate(-90deg);
}

.section-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.section-body.collapsed { display: none; }

@media (min-width: 768px) {
  .section-body.grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   INTEL CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Featured card: full width, larger title */
.card-featured {
  grid-column: 1 / -1;
}
.card-featured .card-title {
  font-size: var(--text-lg);
}

/* Tier 1 — indigo left border */
.card-tier1 {
  border-left: 3px solid var(--accent);
}

/* Health — red left border + tinted bg */
.card-health {
  border-left: 3px solid var(--health-border);
  background: var(--health-bg);
}
.card-health:hover {
  background: rgba(239,68,68,0.10);
}

/* Card meta row */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
}

/* Overlap badges */
.overlap-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  line-height: 1.5;
}
.overlap-high {
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
}
.overlap-med {
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.25);
}
.overlap-low {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* Velocity tag */
.velocity-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--signal-accent);
  background: var(--signal-glow);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  line-height: 1.5;
}

/* Source label in meta */
.source-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Intent commercial badge */
.intent-commercial {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--signal-accent);
  background: var(--signal-glow);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  line-height: 1.5;
}

/* Domain tags */
.domain-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.tag-ai       { color: var(--ai-color);       background: var(--ai-bg); }
.tag-geo      { color: var(--geo-color);      background: var(--geo-bg); }
.tag-invest   { color: var(--invest-color);   background: var(--invest-bg); }
.tag-health   { color: var(--health-alert);   background: var(--health-bg); }
.tag-advisory { color: var(--advisory-color); background: var(--advisory-bg); }

/* Card title */
.card-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: 1.3;
}

/* Card body */
.card-body {
  font-family: 'Satoshi', sans-serif;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Full text expand */
.card-fulltext {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  display: none;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}
.card-fulltext.expanded { display: block; }

.fulltext-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  transition: color 0.15s;
}
.fulltext-toggle:hover { color: var(--accent-hover); }

/* Action bar */
.action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 14px;
  font-family: 'Satoshi', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

/* Research — indigo filled */
.action-btn-research {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.action-btn-research:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Full text — ghost */
.action-btn-fulltext {
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-color: var(--border);
}
.action-btn-fulltext:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Keep — ghost → green active */
.action-btn-keep {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
}
.action-btn-keep:hover {
  color: #22c55e;
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
}
.action-btn-keep.active {
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.4);
}

/* Ignore — ghost → red active */
.action-btn-ignore {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
}
.action-btn-ignore:hover {
  color: var(--health-alert);
  border-color: var(--health-alert);
  background: rgba(239,68,68,0.08);
}
.action-btn-ignore.active {
  color: var(--health-alert);
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.4);
}

/* Source links */
.source-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.source-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.source-link-icon {
  opacity: 0.7;
  flex-shrink: 0;
}

/* ============================================================
   HEALTH SECTION SPECIFICS
   ============================================================ */
.health-tracks {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.health-track {
  padding: 16px 0 8px;
}

.health-track + .health-track {
  border-top: 1px solid rgba(239,68,68,0.15);
  margin-top: 4px;
}

.health-track-header {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--health-alert);
  border-bottom: 1px solid rgba(239,68,68,0.2);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.health-track-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 768px) {
  .health-track-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   SIMPLE LIST (conversation, skippable)
   ============================================================ */
.simple-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.simple-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}
.simple-list-item:last-child { border-bottom: none; }

.simple-list-bullet {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-top: 7px;
}

/* ============================================================
   CONNECTION LIST (crossdomain)
   ============================================================ */
.connection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.connection-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connection-item-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.connection-item-domains {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   YOUTUBE CARDS (Intel section)
   ============================================================ */
.youtube-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.youtube-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.youtube-yt-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff0000;
  border-radius: 8px;
  color: #fff;
}
.youtube-yt-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.youtube-info {
  flex: 1;
  min-width: 0;
}

.youtube-channel {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.youtube-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.youtube-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.youtube-watch-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  background: #ff0000;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.youtube-watch-btn:hover { background: #cc0000; text-decoration: none; color: #fff; }

/* Ground news bar */
.ground-news-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.ground-news-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bias-bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ef4444 100%);
  opacity: 0.7;
}

/* ============================================================
   SIGNAL FEED
   ============================================================ */
.signal-feed {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 8px;
  padding-bottom: 16px;
}

.signal-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.signal-group-name {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.signal-source-chip {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--signal-accent);
  background: var(--signal-glow);
  border: 1px solid rgba(245,158,11,0.28);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  line-height: 1.6;
}

/* Signal cards — more breathing room */
.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.signal-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.signal-card-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: 1.3;
}

.signal-card-body {
  font-family: 'Satoshi', sans-serif;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.signal-card-link {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
  align-self: flex-start;
}
.signal-card-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Signal YouTube cards */
.signal-youtube-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.signal-youtube-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.signal-yt-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff0000;
  border-radius: 9px;
  color: #fff;
}
.signal-yt-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.signal-yt-info {
  flex: 1;
  min-width: 0;
}

.signal-yt-channel {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.signal-yt-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.signal-yt-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 3px;
}

.signal-yt-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  background: #ff0000;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.signal-yt-btn:hover { background: #cc0000; text-decoration: none; color: #fff; }

/* ============================================================
   VIDEO TAB
   ============================================================ */
.video-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0 48px;
}

.video-feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.video-feed-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}

.video-feed-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #e05c5c;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.15s, border-color 0.15s;
}

.video-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  border-left-color: #e05c5c;
}

.video-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224,92,92,0.12);
  border-radius: 10px;
}

.video-card-icon svg {
  width: 24px;
  height: 24px;
  fill: #e05c5c;
}

.video-card-info {
  flex: 1;
  min-width: 0;
}

.video-card-channel {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #e05c5c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.video-card-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-md);
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 5px;
}

.video-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-watch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background: #e05c5c;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.video-card-watch:hover { background: #c94444; text-decoration: none; color: #fff; }

.video-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Bottom sheet on mobile */
.modal-sheet {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Centered on tablet+ */
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }
  .modal-sheet {
    border-radius: 16px;
    max-width: 560px;
    max-height: 80vh;
  }
  .modal-sheet-lg {
    max-width: 720px;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-md);
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.modal-empty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* ============================================================
   LENS MODAL — Research angle selector
   ============================================================ */
.lens-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  margin-right: 12px;
}

.lens-modal-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

/* Override modal-title inside lens heading — smaller, truncated */
.lens-modal-heading .modal-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.lens-prompt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.5;
}

.lens-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.lens-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lens-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-glow);
}

.lens-chip.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.lens-note {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: 'Satoshi', sans-serif;
  line-height: 1.5;
  padding: 10px 12px;
  resize: none;
  margin-bottom: 16px;
  transition: border-color 0.15s;
  outline: none;
}

.lens-note:focus {
  border-color: var(--accent);
}

.lens-note::placeholder {
  color: var(--text-muted);
}

.lens-submit {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #0d1117;
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: 'Satoshi', sans-serif;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.lens-submit:hover {
  background: var(--accent-hover);
}

.lens-submit:active {
  opacity: 0.85;
}

/* Light theme overrides */
[data-theme="light"] .lens-submit {
  color: #ffffff;
}

/* Research queue item */
.research-queue-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.research-queue-item:last-child { margin-bottom: 0; }

.research-queue-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.research-queue-domains {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 639px) {
  .main-content {
    padding: 16px 12px 80px;
  }

  .card { padding: 14px; }
  .signal-card { padding: 16px; }
  .signal-youtube-card { gap: 10px; }
  .signal-yt-btn { padding: 0 10px; font-size: 11px; }

  .action-bar { gap: 4px; }
  .action-btn { min-height: 36px; padding: 0 10px; font-size: 11px; }

  .header-title { font-size: var(--text-base); }
}

@media (min-width: 768px) {
  .briefing-section {
    margin-bottom: 40px;
  }
}
