/* ============================================================================
   brief.pk Design System - CSS Custom Properties
   ============================================================================ */

:root {
  /* brief.pk brand - deeper, more authoritative */
  --brand-navy:   #111827;
  --brand-navy-2: #1f2937;
  --brand-red:    #dc2626;
  --brand-red-2:  #b91c1c;
  --brand-blue:   #0369a1;
  --brand-blue-dim: #075985;

  /* Surfaces */
  --bg-app:       #f8fafc;
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;
  --surface-3:    #e2e8f0;
  --panel-border: #dbe3ee;

  /* Typography */
  --text-main:    #0f172a;
  --text-dim:     #334155;
  --text-muted:   #5f6c7d;

  /* Accents */
  --accent-red:   #dc2626;
  --accent-amber: #b45309;
  --accent-green: #059669;
  --accent-blue:  #2563eb;
  --chg-up:   #15803d;
  --chg-down: #dc2626;
  --chg-flat: #b45309;

  /* Fonts */
  --ui-font:      'Inter', system-ui, -apple-system, sans-serif;
  --mono-font:    'JetBrains Mono', monospace;
  --brand-font:   'Playfair Display', serif;

  /* Elevation & Glass */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --glass-bg:   rgba(255, 255, 255, 0.7);
  --glass-blur: blur(12px);
  --btn-radius: 8px;
  --btn-border: #d4d4d8;
  --btn-focus: rgba(2, 132, 199, 0.28);
}

[data-theme="dark"] {
  --bg-app:       #020617;
  --surface:      #0f172a;
  --surface-2:    #111c32;
  --surface-3:    #1e293b;
  --panel-border: #23314a;
  --text-main:    #e2e8f0;
  --text-dim:     #94a3b8;
  --text-muted:   #64748b;
  --chg-up:   #4ade80;
  --chg-down: #f87171;
  --chg-flat: #fbbf24;
  --brand-blue:   #38bdf8;
  --brand-blue-dim: #7dd3fc;
  --glass-bg:     rgba(15, 23, 42, 0.8);
  --btn-border: #334155;
  --btn-focus: rgba(157, 234, 255, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--ui-font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
button {
  font: inherit;
}

button,
.refresh-btn,
.pk-layer-btn,
.focus-toggle,
.dark-toggle,
.search-clear,
.clear-filter-btn,
.pop-tab,
.perf-tab,
.ai-refresh-btn,
.dossier-btn,
.scroll-top-btn {
  box-shadow: none;
}

button:focus-visible,
.refresh-btn:focus-visible,
.pk-layer-btn:focus-visible,
.focus-toggle:focus-visible,
.dark-toggle:focus-visible,
.search-clear:focus-visible,
.clear-filter-btn:focus-visible,
.pop-tab:focus-visible,
.perf-tab:focus-visible,
.ai-refresh-btn:focus-visible,
.dossier-btn:focus-visible,
.scroll-top-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--btn-focus);
}

.page-bg {
  position: fixed;
  inset: 0;
  background: var(--bg-app);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(239, 68, 68, 0.05) 0px, transparent 50%);
  z-index: -1;
}

/* ─── Header ─────────────────────────────────── */
.intel-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(26, 111, 168, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.intel-topline {
  background: var(--brand-navy);
  padding: 5px 20px;
  font-family: var(--mono-font);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.55);
  gap: 8px;
}

.intel-topline-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-pill {
  color: #22c55e;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 9px;
}

.top-sep { color: rgba(255,255,255,0.2); }

.top-meta {
  color: rgba(255,255,255,0.55);
}

.top-clock {
  font-family: var(--mono-font);
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.intel-mainbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  gap: 14px;
}

.brand-lockup { flex-shrink: 0; }

.brand-title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-word {
  font-family: var(--brand-font);
  font-size: 30px;
  font-weight: 900;
  color: var(--brand-navy);
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-dot {
  color: var(--brand-red);
}

.brand-suffix {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.brand-beta {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-navy);
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid var(--brand-navy);
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 2px;
}

[data-theme="dark"] .brand-beta {
  color: #9deaff;
  background: rgba(157, 234, 255, 0.14);
  border-color: rgba(157, 234, 255, 0.3);
}

.macro-stats-grid {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
  border-left: 2px solid var(--panel-border);
  border-right: 2px solid var(--panel-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.macro-stats-grid::-webkit-scrollbar {
  display: none;
}

.stat-blip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  white-space: nowrap;
  padding: 4px 12px;
  border-right: 1px solid var(--panel-border);
  flex-shrink: 0;
  scroll-snap-align: start;
}

.stat-blip:last-child { border-right: none; }

.sb-label {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--mono-font);
  font-weight: 600;
  letter-spacing: 0.07em;
}

.sb-val {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono-font);
  color: var(--text-main);
  line-height: 1;
}

.header-social-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.header-social-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 600;
  padding: 5px 9px;
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  transition: all 0.18s ease;
  background: var(--surface-2);
  letter-spacing: 0.02em;
}

.header-social-links a:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: var(--surface-3);
}

@media (max-width: 1360px) {
  .intel-mainbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .macro-stats-grid {
    order: 3;
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--panel-border);
    padding: 12px 0 0;
  }
}

@media (max-width: 850px) {
  .stat-blip {
    padding: 3px 9px;
  }
}

@media (max-width: 640px) {
  .sb-label {
    font-size: 7px;
  }

  .sb-val {
    font-size: 11px;
  }

  .macro-stats-grid {
    padding: 0 4px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--panel-border);
    padding-top: 6px;
  }

  .stat-blip {
    padding: 2px 8px;
  }
}

/* ─── Feed load bar (tracks real /api round-trips) ─── */
.feed-load-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 1px 0 rgba(26, 111, 168, 0.06);
  position: relative;
}

.feed-load-bar.is-active {
  box-shadow: 0 1px 0 rgba(26, 111, 168, 0.06), 0 2px 14px rgba(220, 38, 38, 0.14);
}

.feed-load-track {
  height: 6px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.feed-load-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-navy-2) 0%, var(--brand-navy) 55%, var(--accent-green) 100%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 0 2px 2px 0;
  position: relative;
  z-index: 1;
}

.feed-load-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  z-index: 2;
}

.feed-load-bar.is-active .feed-load-shimmer {
  opacity: 1;
  animation: feedLoadShimmer 1.4s linear infinite;
}

@keyframes feedLoadShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

[data-theme="dark"] .feed-load-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(125, 211, 252, 0.35) 50%,
    transparent 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  .feed-load-bar.is-active .feed-load-shimmer { animation: none; opacity: 0.6; transform: none; }
}

.feed-load-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 20px 8px;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.feed-load-pct {
  min-width: 2.75rem;
  color: var(--brand-navy);
}

.feed-load-steps {
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .feed-load-bar {
  background: #0d2035;
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .feed-load-track {
  background: #1e4060;
}

[data-theme="dark"] .feed-load-pct {
  color: #7dd3fc;
}

[data-theme="dark"] .feed-load-steps {
  color: #94a3b8;
}

/* ═══ FLOATING SYNC PILL (persistent data freshness indicator) ═══════════ */
.sync-pill {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  max-width: min(360px, calc(100vw - 32px));
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  font-family: var(--mono-font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease,
              background 0.25s ease;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}

.sync-pill-label,
.sync-pill-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sync-pill-label { max-width: 220px; }

.sync-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green, #16a34a);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55);
  flex-shrink: 0;
}

.sync-pill-label {
  color: var(--text);
  font-weight: 800;
}

.sync-pill-meta {
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 10.5px;
}

/* Loading state: prominent, pulsing, unmistakable */
.sync-pill[data-state="loading"] {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.08), rgba(26, 111, 168, 0.08));
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 6px 22px rgba(220, 38, 38, 0.18);
  transform: scale(1.02);
}

.sync-pill[data-state="loading"] .sync-pill-dot {
  background: #dc2626;
  animation: syncPillPulse 1.1s ease-out infinite;
}

.sync-pill[data-state="loading"] .sync-pill-label {
  color: #dc2626;
}

.sync-pill[data-state="loading"] .sync-pill-meta {
  color: var(--text);
  font-weight: 700;
}

.sync-pill[data-state="error"] {
  border-color: rgba(220, 38, 38, 0.55);
  background: rgba(254, 226, 226, 0.6);
}

.sync-pill[data-state="error"] .sync-pill-dot {
  background: #dc2626;
}

.sync-pill[data-state="error"] .sync-pill-label {
  color: #b91c1c;
}

@keyframes syncPillPulse {
  0%   { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0.55); transform: scale(1); }
  70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);    transform: scale(1.25); }
  100% { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0);    transform: scale(1); }
}

[data-theme="dark"] .sync-pill {
  background: #0d2035;
  border-color: #1e4060;
  color: #94a3b8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .sync-pill-label {
  color: #e2e8f0;
}

[data-theme="dark"] .sync-pill-meta {
  color: #94a3b8;
}

[data-theme="dark"] .sync-pill[data-state="loading"] {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.18), rgba(26, 111, 168, 0.22));
  border-color: rgba(220, 38, 38, 0.55);
}

[data-theme="dark"] .sync-pill[data-state="loading"] .sync-pill-label,
[data-theme="dark"] .sync-pill[data-state="error"] .sync-pill-label {
  color: #fca5a5;
}

[data-theme="dark"] .sync-pill[data-state="error"] {
  background: rgba(127, 29, 29, 0.35);
}

@media (max-width: 640px) {
  .sync-pill {
    top: auto;
    bottom: 14px;
    right: 12px;
    padding: 6px 10px 6px 9px;
    font-size: 10px;
    max-width: calc(100vw - 24px);
  }
  .sync-pill-label { max-width: 160px; }
  .sync-pill-meta { display: none; }
  .sync-pill[data-state="loading"] .sync-pill-meta { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .sync-pill { transition: none; }
  .sync-pill[data-state="loading"] .sync-pill-dot { animation: none; }
}

/* ── Body-wide "refreshing" subtle fade on feed content (very subtle) ── */
body.is-refreshing .feed-load-bar.is-active { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .feed-load-fill {
    transition: none;
  }
}

/* ─── Tickers ─────────────────────────────────── */
.ticker-stack {
  margin: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.market-ticker-wrap {
  display: flex;
  align-items: center;
  background: var(--brand-navy);
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  height: 38px;
  box-shadow: var(--shadow-md);
}

.flash-ticker-wrap {
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #0d3d5e 0%, #0e4d6e 100%);
  border-top: 2px solid rgba(157, 234, 255, 0.35);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  height: 36px;
  box-shadow: var(--shadow-sm);
}

/* Dossier sits under the stacked tickers; hide when empty so no stray gap */
.flash-dossier-container:empty {
  display: none;
}

.flash-dossier-container:not(:empty) {
  margin: 12px 0 0;
}

.ticker-title {
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 100%;
  font-family: var(--mono-font);
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border-right: 1px solid rgba(255,255,255,0.12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.flash-title {
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 100%;
  font-family: var(--mono-font);
  font-size: 10px;
  background: var(--brand-red);
  color: #ffffff;
  border-right: 1px solid rgba(255,255,255,0.15);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-viewport, .flash-viewport {
  overflow: hidden;
  height: 100%;
  flex: 1;
}

.ticker-track, .flash-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: marquee 100s linear infinite;
  will-change: transform;
}

.ticker-track:hover, .flash-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-chip {
  white-space: nowrap;
  padding: 0 18px;
  font-size: 12px;
  font-family: var(--mono-font);
  color: rgba(255,255,255,0.7);
  border-right: 1px solid rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.ticker-chip strong {
  color: #ffffff;
  font-weight: 700;
}

.flash-item {
  white-space: nowrap;
  padding: 0 24px;
  font-size: 12.5px;
  font-family: var(--ui-font);
  color: rgba(255,255,255,0.85);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.flash-item:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
}

/* Non-link pulse chips in the ticker (brief's Pulse narrative, not headlines). */
.flash-item.flash-item--pulse {
  cursor: default;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.flash-item.flash-item--pulse:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
}

.chg-up   { color: var(--chg-up) !important; }
.chg-down { color: var(--chg-down) !important; }
.chg-flat { color: var(--chg-flat) !important; }

.refresh-btn {
  border: 1px solid var(--brand-red);
  background: var(--brand-red);
  color: #ffffff;
  padding: 0 14px;
  height: 100%;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
  flex-shrink: 0;
}

.refresh-btn:hover {
  background: var(--brand-red-2);
  border-color: var(--brand-red-2);
}

.refresh-btn:active {
  transform: scale(0.98);
}

/* Dashboard Shell */
.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 20px;
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ─── Rails & Blocks ──────────────────────────── */
.rail-block, .rail-widget, .lane-block, .ai-stats-card, .large-tv-card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.rail-block:hover, .rail-widget:hover, .lane-block:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(56, 189, 248, 0.2);
}

.rail-widget {
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.rail-widget .perf-list {
  overflow-y: auto;
  flex: 1;
}

.rail-widget .perf-list::-webkit-scrollbar { width: 3px; }
.rail-widget .perf-list::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 2px; }

/* Pakistan Telemetry board (city matrix + national KPIs) */
.pk-tel-widget {
  max-height: min(520px, 78vh);
}

.pk-tel-widget .pk-tel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.pk-tel-widget .pk-tel-scroll::-webkit-scrollbar {
  width: 4px;
}

.pk-tel-widget .pk-tel-scroll::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 2px;
}

.pk-tel-tagline {
  margin: 0;
  padding: 6px 12px 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #fafbfd 0%, #f5f7fb 100%);
}

.pk-tel-kpis {
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--panel-border);
  background: #ffffff;
}

.pk-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.pk-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 7px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f8fc 100%);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  color: inherit;
}

.pk-kpi:hover {
  border-color: rgba(26, 111, 168, 0.35);
}

.pk-kpi--active {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 1px rgba(26, 39, 68, 0.12);
  background: linear-gradient(180deg, #eef6ff 0%, #e4f0fc 100%);
}

.pk-kpi-abbr {
  font-family: var(--mono-font);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pk-kpi-l {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.2;
}

.pk-kpi-v {
  font-family: var(--mono-font);
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-navy);
}

.pk-kpi-suffix {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 1px;
}

.pk-tel-table-host {
  min-height: 0 !important;
  padding: 0 !important;
  border-bottom: none !important;
  background: transparent !important;
}

.pk-tel-context {
  padding-top: 0;
  border-top: 1px solid var(--panel-border);
}

.pk-tel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono-font);
  font-size: 10px;
}

.pk-tel-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 5px;
  text-align: right;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: linear-gradient(180deg, #f0f4fa 0%, #e8edf5 100%);
  border-bottom: 1px solid var(--panel-border);
}

.pk-tel-table thead th:first-child {
  text-align: left;
}

.pk-tel-table .pk-col-em {
  color: var(--brand-navy);
  box-shadow: inset 0 -2px 0 var(--brand-red);
}

.pk-tel-table tbody th,
.pk-tel-table tbody td {
  padding: 6px 5px;
  border-bottom: 1px solid var(--panel-border);
  text-align: right;
}

.pk-tel-table tbody th.pk-city {
  text-align: left;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
}

.pk-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pk-cell {
  transition: background 0.12s ease;
}

.pk-cell.tone-normal {
  background: rgba(34, 197, 94, 0.11);
}

.pk-cell.tone-watch {
  background: rgba(245, 158, 11, 0.14);
}

.pk-cell.tone-elevated {
  background: rgba(249, 115, 22, 0.15);
}

.pk-cell.tone-critical {
  background: rgba(220, 38, 38, 0.16);
}

.pk-cell.tone-muted {
  background: rgba(148, 163, 184, 0.12);
}

.pk-map-head {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f5fa 100%);
}

.pk-layer-btn {
  flex: 1;
  border: 1px solid var(--btn-border);
  background: var(--surface);
  border-radius: var(--btn-radius);
  padding: 9px 8px;
  min-height: 40px;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.08s ease;
}

.pk-layer-btn.active {
  background: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

.pk-layer-btn:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.pk-layer-btn:active {
  transform: scale(0.98);
}

.pk-map-canvas {
  position: relative;
  min-height: 230px;
  padding: 10px;
  border-bottom: 1px solid var(--panel-border);
  background: radial-gradient(circle at 52% 30%, #f5f8fd 0%, #edf2f9 70%, #e7edf6 100%);
}

.pk-map-stage {
  position: relative;
  height: 210px;
}

.pk-map-outline {
  position: absolute;
  inset: 10px 8px;
  width: calc(100% - 16px);
  height: calc(100% - 20px);
}

.pk-map-outline path {
  fill: rgba(26, 39, 68, 0.08);
  stroke: rgba(26, 39, 68, 0.22);
  stroke-width: 1.1;
}

.pk-node {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
}

.pk-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(13, 61, 94, 0.2), 0 2px 6px rgba(13, 61, 94, 0.2);
}

.pk-node-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.pk-node-meta {
  font-family: var(--mono-font);
  font-size: 9px;
  color: var(--text-muted);
}

.pk-node.normal .pk-node-dot { background: var(--chg-up); }
.pk-node.watch .pk-node-dot { background: var(--accent-amber); }
.pk-node.elevated .pk-node-dot { background: #c2410c; }
.pk-node.critical .pk-node-dot { background: #dc2626; }
.pk-node.muted .pk-node-dot { background: #64748b; }

.pk-node.critical .pk-node-dot,
.pk-node.elevated .pk-node-dot {
  animation: pkPulse 1.8s ease-in-out infinite;
}

@keyframes pkPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(13, 61, 94, 0.2), 0 2px 6px rgba(13, 61, 94, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.14), 0 2px 8px rgba(13, 61, 94, 0.24); }
}

.pk-map-empty {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}

.pk-tel-widget .pk-map-empty {
  height: 88px;
}

.pk-map-hotspots {
  padding: 10px 12px 12px;
}

.pk-hotspot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--mono-font);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pk-hotspot-head strong {
  color: var(--brand-navy);
  font-size: 12px;
}

.pk-flight-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.pk-flight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: linear-gradient(180deg, #f8faff 0%, #f2f6fd 100%);
  font-family: var(--mono-font);
}

.pk-flight-row span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pk-flight-row strong {
  font-size: 10px;
  color: var(--brand-navy);
}

.pk-flight-explain {
  margin-bottom: 8px;
  padding: 7px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: #f9fbff;
}

.pk-flight-explain p {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.pk-flight-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pk-flight-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono-font);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.pk-flight-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.pk-flight-legend .dot.normal { background: var(--chg-up); }
.pk-flight-legend .dot.watch { background: var(--accent-amber); }
.pk-flight-legend .dot.elevated { background: #c2410c; }
.pk-flight-legend .dot.critical { background: #dc2626; }

.pk-hotspot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pk-hotspot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 7px 9px;
}

.pk-hotspot-empty {
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pk-hotspot-footnote {
  margin-top: 8px;
  font-family: var(--mono-font);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-top: 1px dashed var(--panel-border);
  padding-top: 7px;
}

.left-rail, .right-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-lane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-lane-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.main-lane-dual > * {
  min-width: 0;
}

@media (min-width: 1200px) {
  .main-lane-dual {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

@media (min-width: 1500px) {
  .main-lane-dual {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

.rail-label, .widget-head, .lane-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid var(--brand-red);
  padding: 10px 16px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lane-head {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.lane-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-navy);
  font-family: var(--mono-font);
}

.lane-head-badge {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--panel-border);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.category-head {
  padding: 11px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid var(--brand-red);
  font-family: var(--mono-font);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--brand-navy);
  letter-spacing: 0.1em;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.category-head span:last-child {
  background: var(--brand-navy);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  min-width: 24px;
  text-align: center;
}

.breaking-queue {
  background: var(--surface);
  overflow: hidden;
}

.breaking-item {
  display: grid;
  grid-template-columns: 32px 1fr 90px;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
}

.breaking-item:last-child { border-bottom: none; }

.breaking-item:hover {
  background: var(--surface-2);
}

.breaking-rank {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
}

.breaking-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--text-main);
}

.breaking-item:hover .breaking-title {
  color: var(--brand-navy-2);
}

.breaking-snippet {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
  margin-top: 6px;
  max-width: 52rem;
}

.breaking-item--intel-search .breaking-title {
  margin-bottom: 4px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
}

.badge.high { 
  background: rgba(239, 68, 68, 0.1); 
  color: #ef4444; 
  border-color: rgba(239, 68, 68, 0.2); 
}
.badge.med { 
  background: rgba(180, 83, 9, 0.1); 
  color: var(--accent-amber); 
  border-color: rgba(180, 83, 9, 0.2); 
}

[data-theme="dark"] .badge.med { background: rgba(180, 83, 9, 0.22); }

.rel-badge {
  font-family: var(--mono-font);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: rgba(56, 189, 248, 0.1);
}
.rel-badge.rel-high { background: rgba(56, 189, 248, 0.2); border-color: var(--brand-blue); }
.rel-badge.rel-critical { 
  background: rgba(239, 68, 68, 0.1); 
  border-color: var(--brand-red); 
  color: var(--brand-red);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.time-col {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-weight: 700;
}

/* ─── Category Sections ──────────────────────── */
.category-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.category-section {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cards-grid {
  display: flex;
  flex-direction: column;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 16px 11px 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  color: inherit;
}

.news-card:last-child { border-bottom: none; }

.news-card:hover { background: var(--surface-2); }

/* Read / seen state — subtle fade so the card stays accessible but recedes */
.news-card--read {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.news-card--read:hover {
  opacity: 1;
}
.news-card--read .card-headline {
  color: var(--text-muted);
}

/* Bookmark toggle button — sits in the card footer row */
.card-bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.card-bookmark-btn:hover {
  color: var(--brand-blue);
  transform: scale(1.15);
}
.card-bookmark-btn.is-bookmarked {
  color: var(--accent-amber);
}

/* Trending badge */
.card-trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-red);
  background: color-mix(in srgb, var(--brand-red) 12%, transparent);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Priority left-border accent */
.news-card[data-priority="high"]     { border-left-color: var(--brand-red); }
.news-card[data-priority="breaking"] { border-left-color: var(--brand-red); }
.news-card[data-priority="normal"]   { border-left-color: var(--accent-amber); }

.card-priority-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-red);
}

.news-card[data-priority="normal"] .card-priority-label {
  color: var(--accent-amber);
}

.card-headline {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-main);
}

.news-card:hover .card-headline { 
  color: var(--brand-blue); 
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.card-source {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-time {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Charts Strip */
.tv-charts-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 16px;
}

.tv-widget-card {
  height: 140px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .tv-charts-strip {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    margin: 0 12px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .tv-charts-strip::-webkit-scrollbar {
    display: none;
  }

  .tv-widget-card {
    flex: 0 0 200px;
    width: 200px;
    min-width: 200px;
    height: 130px;
    scroll-snap-align: start;
    border-radius: 10px;
  }

  .kse-local-card {
    flex: 0 0 160px;
    width: 160px;
    min-width: 160px;
    padding: 10px 12px;
  }

  .kse-local-value {
    font-size: 26px;
  }

  .kse-local-change {
    font-size: 11px;
    margin-top: 4px;
  }

  .kse-local-sub {
    font-size: 10px;
  }
}

.kse-local-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(15, 87, 136, 0.06), rgba(15, 87, 136, 0.015));
}

.kse-local-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kse-local-title {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-navy);
}

.kse-local-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.kse-local-value {
  align-self: end;
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.kse-local-change {
  margin-top: 8px;
  font-family: var(--mono-font);
  font-size: 13px;
  font-weight: 700;
}

.kse-local-change.up { color: var(--up); }
.kse-local-change.down { color: var(--down); }
.kse-local-change.flat { color: var(--text-muted); }

.kse-local-foot {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Main Lane */
.interactive-tv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.large-tv-card, .ai-stats-card {
  height: 420px;
  display: flex;
  flex-direction: column;
}

/* PSX Signals Matrix */
.intel-signals-pack {
  flex: 1;
  overflow-y: auto;
  font-family: var(--mono-font);
  min-height: 0;
}

.intel-signals-pack::-webkit-scrollbar { width: 4px; }
.intel-signals-pack::-webkit-scrollbar-track { background: var(--surface-2); }
.intel-signals-pack::-webkit-scrollbar-thumb { background: var(--brand-navy-2); border-radius: 2px; }

.signal-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.2s;
}

.signal-row:hover { background: var(--surface-2); }

.signal-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.signal-time { color: var(--text-muted); font-size: 11px; }

.signal-company {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.signal-subject {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.4;
}

.sec-econ-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px 14px;
}

/* ── Unified Research Hub ──────────────────────────────────────── */
.research-hub {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.research-hub-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  background: var(--brand-navy);
  border-bottom: 2px solid var(--brand-red);
  flex-wrap: wrap;
}

[data-theme="dark"] .research-hub-head {
  background: #0d1e36;
}

.research-hub-eyebrow {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.15);
}

.research-hub-sub {
  font-family: var(--mono-font);
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
}

.research-hub-deepdive-link {
  margin-left: auto;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: none;
  border-radius: 7px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.research-hub-deepdive-link:hover {
  background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12);
  transform: translateY(-1px);
  color: #0f172a;
}
.research-hub-deepdive-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* Two-column layout */
.research-hub-columns {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
  .research-hub-columns {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
}

/* Each self-contained column */
.research-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.research-col--macro {
  border-right: 1px solid var(--panel-border);
}

@media (max-width: 1099px) {
  .research-col--macro {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
}

/* Macro pjt-card: borderless/transparent inside column */
.research-col--macro .pjt-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 16px;
}

.research-col--macro .pakistan-trajectory-section {
  min-width: 0;
}

/* Security panel: borderless inside column */
.sec-econ-main {
  min-height: 0;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.sec-econ-inner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--panel-border);
}

.sec-econ-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sec-econ-inner-title {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-navy);
}

.sec-econ-inner-sub {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .sec-econ-inner-title {
  color: var(--brand-blue-dim);
}

/* Research workspace — inline per-column, always visible */
.research-col-workspace {
  border-top: 2px solid var(--brand-red);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Row 1: Title + utility actions ── */
.rcws-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 9px;
  background: color-mix(in srgb, var(--brand-navy) 6%, var(--surface));
  border-bottom: 1px solid var(--panel-border);
}

.rcws-label {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-navy);
  white-space: nowrap;
}

[data-theme="dark"] .rcws-label {
  color: var(--brand-blue-dim);
}

.rcws-utils {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.rcws-util-btn {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.rcws-util-btn:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: color-mix(in srgb, var(--brand-navy) 6%, var(--surface));
}

/* ── Row 2: Mode tabs + inline compare ── */
.rcws-tabs-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--surface-2);
  flex-wrap: wrap;
  min-height: 36px;
}

.rcws-tab {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  height: 36px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.rcws-tab:hover {
  color: var(--brand-navy);
}

.rcws-tab.is-active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-red);
  font-weight: 800;
}

[data-theme="dark"] .rcws-tab:hover,
[data-theme="dark"] .rcws-tab.is-active {
  color: var(--brand-blue-dim);
}

[data-theme="dark"] .rcws-tab.is-active {
  border-bottom-color: var(--brand-red);
}

/* Hint text that lives in the tabs row */
.rcws-hint {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.7;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}

@media (max-width: 860px) {
  .rcws-hint { display: none; }
}

/* Compare selector — lives inline in tabs row */
.rcws-compare-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-right: 2px;
}

.rcws-compare-lbl {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.rcws-compare-select {
  font-family: var(--mono-font);
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

/* Macro insight grid inside the workspace column — tighter */
.research-col-workspace .pjt-insight-grid {
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 16px;
}

@media (max-width: 1400px) {
  .research-col-workspace .pjt-insight-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.research-col-workspace .pjt-insight-text {
  font-size: 13px;
  line-height: 1.6;
}

.research-col-workspace .pjt-insight-aside {
  padding: 12px 14px;
  gap: 12px;
  position: static;
}

/* ── Content body ── */
.rcws-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.rcws-body .pjt-insight-grid,
.rcws-body .sec-econ-insight,
.rcws-body .sec-econ-sources,
.rcws-body .sec-compare-panel {
  margin: 0;
  padding: 0;
}

/* Sources list in rcws-body */
.rcws-body .sec-src-title {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.rcws-body .sec-src-list {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.rcws-body .sec-src-list span {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  white-space: nowrap;
}

/* Legacy workspace switch still in DOM but not used — hide */
.workspace-switch { display: none; }
.workspace-panel[hidden] { display: none; }

.research-workspace-inner {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workspace-switch {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.workspace-tab {
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: 999px;
  font: 700 10px/1 var(--mono-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 10px;
  cursor: pointer;
}

.workspace-tab.is-active {
  background: color-mix(in srgb, var(--brand-navy) 13%, var(--surface));
  color: var(--brand-navy);
  border-color: color-mix(in srgb, var(--brand-navy) 45%, var(--panel-border));
}

.workspace-panel {
  min-width: 0;
}

.research-workspace .pjt-insight-details,
.research-workspace .sec-econ-advanced {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface-2);
}

.research-workspace .pjt-insight-details {
  border-top: 1px solid var(--panel-border);
}

.sec-econ-brief {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-navy) 6%, var(--surface)) 0%, var(--surface) 100%);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.sec-econ-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sec-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sec-range-head {
  display: flex;
  gap: 6px;
}

.sec-range-tab {
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: 999px;
  font: 700 10px/1 var(--mono-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 9px;
  cursor: pointer;
}

.sec-range-tab.is-active {
  background: color-mix(in srgb, var(--brand-navy) 13%, var(--surface));
  color: var(--brand-navy);
  border-color: color-mix(in srgb, var(--brand-navy) 45%, var(--panel-border));
}

.sec-compare-lbl {
  font: 700 10px/1 var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sec-compare-select {
  min-width: 140px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-main);
  font: 600 11px/1.2 var(--ui-font);
  padding: 6px 8px;
}

.sec-compare-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.sec-compare-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.sec-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sec-compare-chart {
  margin-top: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 6px;
}

.sec-compare-svg {
  width: 100%;
  height: 78px;
  display: block;
}

.sec-compare-cell {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: baseline;
}

.sec-compare-name {
  grid-column: 1 / -1;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sec-compare-stat {
  margin-top: 0;
  font-size: 11px;
  font-family: var(--mono-font);
  color: var(--text-main);
}

.sec-econ-tab {
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: 999px;
  font: 700 10px/1 var(--mono-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 9px;
  cursor: pointer;
}

.sec-econ-tab.is-active {
  background: color-mix(in srgb, var(--brand-navy) 13%, var(--surface));
  color: var(--brand-navy);
  border-color: color-mix(in srgb, var(--brand-navy) 45%, var(--panel-border));
}

.sec-econ-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 900px) {
  .sec-econ-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sec-kpi {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
}

.sec-kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
}

.sec-kpi-val {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.sec-kpi-meta {
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
}

.sec-c {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 1px 5px;
  font-family: var(--mono-font);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sec-c--reported { background: rgba(34, 197, 94, 0.13); color: #15803d; border-color: rgba(22, 163, 74, 0.24); }
.sec-c--estimated { background: rgba(245, 158, 11, 0.15); color: #b45309; border-color: rgba(180, 83, 9, 0.24); }
.sec-c--mixed { background: rgba(14, 116, 144, 0.15); color: #0f4c81; border-color: rgba(8, 145, 178, 0.24); }

.sec-econ-chart {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px;
}

.sec-series-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sec-series-head strong {
  color: var(--text-main);
  font-size: 12px;
}

.sec-series-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sec-what-changed {
  margin: 2px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: color-mix(in srgb, var(--brand-navy) 5%, var(--surface-2));
  color: var(--text-dim);
  font-size: 10.5px;
  line-height: 1.45;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sec-spark {
  width: 110px;
  height: 28px;
  flex-shrink: 0;
  color: var(--brand-navy);
}

.sec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 66px;
  gap: 8px;
  align-items: center;
}

.sec-row-label {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.25;
}

.sec-row-tag {
  margin-left: 5px;
  border-radius: 999px;
  padding: 1px 5px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  font-family: var(--mono-font);
  font-size: 8.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sec-row-bar-wrap {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-navy) 8%, var(--surface-2));
  overflow: hidden;
}

.sec-row-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-navy), color-mix(in srgb, var(--brand-navy) 60%, #0ea5e9));
}

.sec-row-val {
  font-family: var(--mono-font);
  font-size: 11px;
  text-align: right;
  color: var(--text-main);
}

.sec-series-foot {
  margin-top: 9px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sec-econ-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sec-analysis-btn {
  border-width: 1px;
  border-style: solid;
  border-color: var(--panel-border);
  background: var(--surface);
}

.sec-analysis-btn.is-active {
  border-color: color-mix(in srgb, var(--brand-red) 45%, var(--panel-border));
  color: var(--brand-red);
  background: color-mix(in srgb, var(--brand-red) 7%, var(--surface));
}

.sec-econ-insight,
.sec-econ-sources {
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.sec-insight-meta {
  display: block;
  margin: 4px 0 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono-font);
  letter-spacing: 0.03em;
}

/* ── AI badge ───────────────────────────────────────────── */
.sec-ai-badge {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-navy) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-navy) 25%, transparent);
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.sec-insight-thesis {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0 0 10px;
}

.sec-insight-caveats,
.sec-insight-conf {
  font-size: 11px;
  color: var(--text-dim);
  margin: 6px 0 0;
}

.sec-insight-empty {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Data Brief (shown when no AI insight loaded) ─────── */
.sec-data-brief {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sec-brief-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sec-brief-tag {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-red) 25%, transparent);
  color: var(--brand-red);
}

.sec-brief-conf {
  display: flex;
}

.sec-brief-cta {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

/* 4-stat strip */
.sec-brief-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 860px) {
  .sec-brief-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sec-brief-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.sec-bs-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sec-bs-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.sec-bs-val.pos { color: #16a34a; }
.sec-bs-val.neg { color: #dc2626; }

[data-theme="dark"] .sec-bs-val.pos { color: #4ade80; }
[data-theme="dark"] .sec-bs-val.neg { color: #f87171; }

.sec-bs-meta {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.2;
}

.sec-brief-narrative {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  border-left: 3px solid var(--brand-red);
}

.sec-changes-panel {
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sec-change-chip {
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  padding: 3px 7px;
  font-size: 10px;
  color: var(--text-dim);
}

.sec-econ-insight strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sec-econ-insight p,
.sec-src-list {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-main);
}

.sec-econ-advanced {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}

.sec-econ-advanced summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono-font);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}

.sec-econ-advanced summary::-webkit-details-marker {
  display: none;
}

.sec-econ-advanced-inner {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec-econ-advanced[open] .sec-econ-advanced-inner {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, var(--surface)) 0%, var(--surface-2) 100%);
}

.sec-src-title {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.focus-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 12px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.focus-toggle:hover {
  border-color: rgba(26, 111, 168, 0.45);
  background: var(--surface-2);
}

.focus-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand-navy);
  cursor: pointer;
}

.focus-toggle span {
  line-height: 1.35;
}

.left-rail .rail-block {
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(13, 61, 94, 0.08);
}

.left-rail .rail-label {
  background: linear-gradient(90deg, #f6f8fc 0%, #eff3f9 100%);
  border-left-width: 4px;
}

.popular-widget {
  position: relative;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: none;
}

.popular-widget > .rail-label--stories {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-left-width: 3px;
  padding: 10px 14px;
}

.popular-tabs {
  display: flex;
  padding: 4px;
  gap: 2px;
  margin: 0 10px 10px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
}

.popular-widget .pop-tab {
  flex: 1;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 7px 8px;
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.popular-widget .pop-tab:hover {
  color: var(--text-main);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.popular-widget .pop-tab.active {
  background: var(--surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--panel-border);
  transform: none;
  border-bottom: none;
}

.popular-list {
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pop-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pop-item:hover {
  background: var(--surface-2);
}

.pop-item + .pop-item {
  border-top: 1px solid transparent;
}

.pop-thumb {
  --pop-hue: 220;
  flex: 0 0 60px;
  width: 60px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--panel-border);
  position: relative;
  background: transparent;
}

.pop-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    140deg,
    hsl(var(--pop-hue) 45% 92%) 0%,
    hsl(var(--pop-hue) 35% 84%) 100%
  );
}

.pop-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

.pop-thumb-initial {
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--pop-hue) 55% 28%);
  letter-spacing: -0.02em;
}

.pop-content {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.pop-title {
  font-family: var(--ui-font);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-main);
  letter-spacing: -0.005em;
}

.pop-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--text-muted);
  font-family: var(--ui-font);
}

.pop-meta .pop-src {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.pop-meta-sep {
  opacity: 0.4;
  user-select: none;
}

.pop-meta .time-fresh,
.pop-meta .time-recent,
.pop-meta .time-stale {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
}

.pulse-widget {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.pulse-board {
  padding: 0 12px 12px;
}

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

.pulse-metric {
  background: linear-gradient(145deg, #ffffff 0%, #f2f6ff 100%);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 9px 10px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pulse-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(26, 111, 168, 0.12);
}

.pulse-metric span {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pulse-metric strong {
  font-family: var(--mono-font);
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-navy);
  line-height: 1;
}

@media (max-width: 1100px) {
  .dashboard-shell {
    grid-template-columns: 240px 1fr;
  }

  .main-lane-dual {
    grid-template-columns: 1fr;
  }

  .right-rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 850px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .left-rail, .right-rail {
    grid-column: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .category-sections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .left-rail, .right-rail {
    grid-template-columns: 1fr;
  }

  .category-sections {
    grid-template-columns: 1fr;
  }

  .main-lane {
    padding: 0;
  }

  .main-lane-dual {
    gap: 12px;
  }

  .interactive-tv-grid {
    grid-template-columns: 1fr;
  }

  .large-tv-card, .ai-stats-card {
    height: 380px;
  }
.time-col { display: none; }
}

/* NEW: PERFORMANCE WIDGET (popular / stories styles live under .popular-widget above) */
.perf-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.perf-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface); border: 1px solid var(--panel-border); border-radius: 4px; font-family: var(--mono-font); font-size: 10.5px; transition: transform 0.15s ease; }
.perf-row:hover { transform: translateX(2px); border-color: var(--brand-navy); }
.perf-sym { font-weight: 800; color: var(--text-main); width: 65px; }
.perf-val { color: var(--text-dim); flex: 1; text-align: right; margin-right: 8px; font-weight: 600; }
.perf-chg { font-weight: 800; width: 60px; text-align: right; }
.perf-chg.up { color: var(--accent-green); }
.perf-chg.down { color: var(--accent-red); }

/* ─── Market Snapshot ────────────────────────── */
.market-snapshot { padding: 4px 0; }

.rail-widget.mkt-snapshot-widget {
  max-height: min(820px, 86vh);
}

.market-snapshot--extended {
  max-height: calc(86vh - 120px);
  min-height: 200px;
  overflow-y: auto;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.market-snapshot--extended::-webkit-scrollbar { width: 4px; }
.market-snapshot--extended::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 2px;
}

.mkt-snap-stale {
  margin: 0 12px 8px;
  padding: 6px 8px;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-amber);
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: 6px;
}

.mkt-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px 4px;
}

.mkt-panel {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #fcfdff 0%, #f7f9fc 100%);
  box-shadow: 0 1px 0 rgba(26, 111, 168, 0.06);
}

.mkt-panel-title {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-navy);
  background: rgba(157, 234, 255, 0.12);
  border-bottom: 1px solid var(--panel-border);
}

.mkt-subhint {
  padding: 6px 12px 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-muted);
}

.mkt-panel-rows .mkt-row:last-child {
  border-bottom: none;
}

.mkt-snap-foot {
  margin: 10px 12px 4px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}

.mkt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--panel-border);
  min-width: 0;
}
.mkt-row:last-child { border-bottom: none; }

.mkt-row--ref {
  background: rgba(148, 163, 184, 0.06);
}

.mkt-row--ref .mkt-label {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.mkt-label {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  width: 72px;
  flex-shrink: 0;
}

.market-snapshot--extended .mkt-label {
  width: auto;
  min-width: 100px;
  max-width: 42%;
  line-height: 1.25;
}

.mkt-val {
  font-family: var(--mono-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1 1 0;
  min-width: 0;
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mkt-val--text {
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  color: var(--text-dim);
}

.mkt-row-hint {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.55;
  cursor: help;
}

.mkt-chg {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.mkt-chg.chg-up   { color: var(--chg-up); background: #f0fdf4; }
.mkt-chg.chg-down { color: var(--brand-red-2);   background: #fff1f2; }
.mkt-chg.chg-flat { color: var(--text-muted); }

[data-theme="dark"] .mkt-panel {
  background: linear-gradient(180deg, #0d2035 0%, #0a1828 100%);
  border-color: #1e4060;
}

[data-theme="dark"] .mkt-panel-title {
  background: rgba(157, 234, 255, 0.06);
  border-bottom-color: #1e4060;
  color: #9deaff;
}

[data-theme="dark"] .mkt-row--ref {
  background: rgba(30, 64, 96, 0.35);
}

[data-theme="dark"] .mkt-val--text {
  color: #cbd5e1;
}

[data-theme="dark"] .mkt-snap-stale {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

/* PSX Live Signals Widget */
.intel-signals-pack {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.signal-row {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.2s;
}

.signal-row:hover {
  background: rgba(157, 234, 255, 0.12);
}

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

.signal-symbol {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--surface-3);
  border: 1px solid var(--panel-border);
  padding: 2px 8px;
  border-radius: 4px;
}

.signal-time {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
}

.signal-company {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.signal-subject {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-main);
}

.signal-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* Professional Sidebar Enhancements */
.nav-list { list-style: none; padding: 4px 0; }
.nav-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-list li:hover {
  background: var(--surface-3);
  color: var(--brand-navy);
  border-left-color: var(--brand-red);
}
.nav-list li .count {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-3, var(--surface-2));
  padding: 2px 6px;
  border-radius: 4px;
}

/* ─── Nav / Category Active State ─────────────── */
.nav-list li.active,
.nav-list li[data-active="true"] {
  background: var(--surface-3);
  color: var(--brand-navy);
  border-left-color: var(--brand-red);
  font-weight: 700;
}

/* ─── Signals Tabs ────────────────────────────── */
.signals-tabs {
  display: flex;
  background: var(--surface-2);
  border-bottom: 1px solid var(--panel-border);
}

.signals-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono-font);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.signals-tab:hover {
  color: var(--text-main);
  background: var(--surface-3);
}

.signals-tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-red);
  background: var(--surface);
  font-weight: 900;
}

/* ─── Freshness / Keyword / Priority widgets ──── */
.kw-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--panel-border); font-size: 12px; }
.kw-row:last-child { border-bottom: none; }
.kw-word { font-weight: 700; color: var(--text-main); }
.kw-count { font-family: var(--mono-font); font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--surface-3); padding: 2px 6px; border-radius: 3px; }

.fresh-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 16px; border-bottom: 1px solid var(--panel-border); font-size: 12px; }
.fresh-row:last-child { border-bottom: none; }
.fresh-src { font-weight: 600; color: var(--text-dim); }
.fresh-age { font-family: var(--mono-font); font-size: 10px; color: var(--text-muted); }
.fresh-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-right: 8px; }
.fresh-dot.live { background: var(--accent-green); }
.fresh-dot.recent { background: var(--accent-amber); }
.fresh-dot.stale { background: #64748b; }

/* ─── Category Section Radius ─────────────────── */
.category-head { border-top-left-radius: 10px; border-top-right-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   NEW PHASE 1–4 ADDITIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Topline right cluster ───────────────────── */
.intel-topline-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Live dot ────────────────────────────────── */
.live-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Dark mode toggle ────────────────────────── */
.dark-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  min-height: 34px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

.dark-toggle:hover {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.dark-toggle:active {
  transform: scale(0.98);
}

/* ─── Header actions area ─────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Header search ───────────────────────────── */
.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search {
  width: 220px;
  height: 38px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0 32px 0 14px;
  font-family: var(--ui-font);
  font-size: 13px;
  color: var(--text-main);
  background: var(--surface-2);
  outline: none;
  transition: all 0.2s ease;
}

.header-search:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
  background: var(--surface);
  width: 280px;
}

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

/* type="search" draws a second clear control in WebKit; we use one custom ✕ only */
.header-search::-webkit-search-cancel-button,
.header-search::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-icon {
  position: absolute;
  right: 30px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  display: none; /* hidden — using clear btn instead */
}

.search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 4px;
  line-height: 1;
  border-radius: 4px;
  min-width: 28px;
  min-height: 28px;
  transition: color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.search-clear:hover {
  color: var(--brand-red);
  background: #fee2e2;
}

.search-clear:active {
  transform: scale(0.96);
}

/* ─── Substack CTA ────────────────────────────── */
.substack-cta {
  background: var(--brand-red) !important;
  color: #ffffff !important;
  border-color: var(--brand-red) !important;
  font-weight: 700 !important;
}

.substack-cta:hover {
  background: var(--brand-red-2) !important;
  border-color: var(--brand-red-2) !important;
  color: #ffffff !important;
}

/* ─── Rail label row (with clear btn) ────────── */
.rail-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid var(--brand-red);
}

.rail-label-row .rail-label {
  border: none;
  background: none;
  border-left: none;
  flex: 1;
}

/* ─── Clear filter button ─────────────────────── */
.clear-filter-btn {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-red);
  background: none;
  border: 1px solid var(--brand-red);
  border-radius: var(--btn-radius);
  padding: 6px 10px;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  flex-shrink: 0;
}

.clear-filter-btn:hover {
  background: var(--brand-red);
  color: #ffffff;
}

.clear-filter-btn:active {
  transform: scale(0.98);
}

/* ─── Focus count badge ───────────────────────── */
.focus-count {
  font-family: var(--mono-font);
  font-size: 9px;
  color: var(--text-muted);
  padding: 4px 12px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Nav item active state ───────────────────── */
.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--brand-navy);
  border-left-color: var(--brand-red);
}

.nav-item.active {
  background: var(--surface-3);
  color: var(--brand-navy);
  border-left-color: var(--brand-red);
  font-weight: 700;
}

.nav-item .count {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
}

.nav-item.active .count {
  background: var(--brand-navy);
  color: #ffffff;
}

/* ─── Today's Briefing ────────────────────────── */
.todays-briefing {
  padding: 4px 0;
}

.briefing-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.briefing-item:last-child { border-bottom: none; }

.briefing-item:hover {
  background: var(--surface-2);
  border-left-color: var(--brand-red);
}

.briefing-cat {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-red);
}

.briefing-headline {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
}

.briefing-headline.rtl-text {
  font-family: 'Noto Nastaliq Urdu', serif;
  direction: rtl;
  text-align: right;
  font-size: 14px;
}

.briefing-time {
  font-family: var(--mono-font);
  font-size: 9px;
  color: var(--text-muted);
}

.briefing-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.briefing-skel {
  height: 44px;
  margin: 8px 14px;
  border-radius: 6px;
}

/* ─── Skeleton loading ────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

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

.skel-row {
  padding: 8px 12px;
}

/* ─── PSX Performers tabs ─────────────────────── */
.perf-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  background: var(--surface-2);
}

.perf-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 8px;
  min-height: 40px;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.perf-tab:hover {
  color: var(--text-main);
  background: var(--surface-3);
}

.perf-tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-red);
  background: var(--surface);
  font-weight: 900;
}

.psx-performers {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.psx-performers::-webkit-scrollbar { width: 3px; }
.psx-performers::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 2px; }

.perf-empty {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Search query label ──────────────────────── */
.search-query-label {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ─── Premium Site footer ─────────────────────────────── */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--panel-border);
  position: relative;
  margin-top: 48px;
  overflow: hidden;
}

.footer-glass-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-blue) 100%);
  opacity: 0.8;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.footer-logo {
  font-family: var(--brand-font);
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.footer-logo .brand-dot {
  color: var(--brand-red);
}

.footer-tagline {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-navy);
}

.footer-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  margin-top: 6px;
}

.footer-nav {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px 0;
}

.footer-col a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.18s ease, transform 0.18s ease;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--brand-red);
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid var(--panel-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-sources-label {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.footer-sources-label .src-title {
  font-weight: 700;
  color: var(--text-muted);
}

.footer-sources-label #footerSourceList {
  font-weight: 500;
  color: var(--text-dim);
}

.footer-note {
  font-family: var(--mono-font);
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ─── Dark mode ───────────────────────────────── */
[data-theme="dark"] {
  --bg-app:       #071420;
  --surface:      #0d2035;
  --surface-2:    #112843;
  --surface-3:    #163352;
  --panel-border: #1e4060;
  --text-main:    #e2eef8;
  --text-dim:     #8ab4d4;
  --text-muted:   #4d7a9e;
  --brand-blue:   #9deaff;
}

[data-theme="dark"] .intel-header {
  background: #0d2035;
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .intel-header .logout-btn {
  border-color: #7f1d1d;
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .intel-header .logout-btn:hover {
  filter: brightness(1.08);
  border-color: #991b1b;
}

[data-theme="dark"] .intel-header .refresh-btn {
  background: linear-gradient(180deg, #163352 0%, #112843 100%);
  border-color: #1e4060;
  color: #e2eef8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .intel-header .refresh-btn:hover {
  border-color: #9deaff;
  color: #9deaff;
}

[data-theme="dark"] .page-bg {
  background: radial-gradient(ellipse at 50% 0%, rgba(157,234,255,0.06) 0%, transparent 60%), #071420;
}

[data-theme="dark"] .header-search {
  background: #112843;
  border-color: #1e4060;
  color: #e2eef8;
}

[data-theme="dark"] .header-search:focus {
  border-color: #9deaff;
  background: #163352;
  box-shadow: 0 0 0 3px rgba(157,234,255,0.12);
}

[data-theme="dark"] .intel-header .header-link-btn {
  border-color: rgba(157, 234, 255, 0.55);
  background: rgba(157, 234, 255, 0.08);
  color: var(--brand-blue);
}

[data-theme="dark"] .intel-header .header-link-btn:hover {
  border-color: #9deaff;
  background: rgba(157, 234, 255, 0.14);
  color: #e2eef8;
}

/* Dark mode — icon buttons */
[data-theme="dark"] .intel-header .header-icon-btn {
  background: linear-gradient(180deg, #112842 0%, #0d2035 100%);
  border-color: rgba(157, 234, 255, 0.25);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
}

[data-theme="dark"] .intel-header .header-icon-substack {
  color: #ff8a5c;
  border-color: rgba(255, 138, 92, 0.35);
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .intel-header .header-icon-substack:hover {
  background: linear-gradient(180deg, #ff6719 0%, #e55a00 100%);
  border-color: #ff6719;
  color: #ffffff;
  box-shadow:
    0 4px 16px rgba(255, 103, 25, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

[data-theme="dark"] .intel-header .header-icon-x {
  color: #9deaff;
  border-color: rgba(157, 234, 255, 0.35);
  background: linear-gradient(180deg, #0d2035 0%, #0a1929 100%);
}

[data-theme="dark"] .intel-header .header-icon-x:hover {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-color: #9deaff;
  color: #ffffff;
  box-shadow:
    0 4px 16px rgba(157, 234, 255, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

[data-theme="dark"] .macro-stats-grid {
  border-left-color: #1e4060;
  border-right-color: #1e4060;
}

[data-theme="dark"] .intel-mainbar {
  background: #0d2035;
}

[data-theme="dark"] .rail-block,
[data-theme="dark"] .rail-widget,
[data-theme="dark"] .lane-block,
[data-theme="dark"] .ai-stats-card,
[data-theme="dark"] .large-tv-card,
[data-theme="dark"] .category-section {
  background: #0d2035;
  border-color: #1e4060;
}

[data-theme="dark"] .rail-label,
[data-theme="dark"] .widget-head,
[data-theme="dark"] .lane-head,
[data-theme="dark"] .category-head {
  background: #112843;
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .breaking-item { color: #e2eef8; }
[data-theme="dark"] .breaking-item:hover { background: #112843; }

[data-theme="dark"] .news-card:hover { background: #112843; }

[data-theme="dark"] .briefing-item:hover { background: #112843; }

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active { background: #163352; }

[data-theme="dark"] .focus-toggle { background: #112843; border-color: #1e4060; }

[data-theme="dark"] .popular-widget > .rail-label--stories {
  color: var(--text-main);
}

[data-theme="dark"] .popular-tabs {
  background: #152238;
  border-color: #1e4060;
}

[data-theme="dark"] .popular-widget .pop-tab:hover {
  background: color-mix(in srgb, #1a3050 80%, transparent);
}

[data-theme="dark"] .popular-widget .pop-tab.active {
  background: #0d2035;
  color: var(--text-main);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .pop-item:hover {
  background: #112843;
}

[data-theme="dark"] .pop-thumb {
  background: #112843;
  box-shadow: inset 0 0 0 1px #1e4060;
}

[data-theme="dark"] .pop-thumb-fallback {
  background: linear-gradient(
    140deg,
    hsl(var(--pop-hue) 40% 22%) 0%,
    hsl(var(--pop-hue) 35% 16%) 100%
  );
}

[data-theme="dark"] .pop-thumb-initial {
  color: hsl(var(--pop-hue) 70% 82%);
}

[data-theme="dark"] .pulse-metric { background: linear-gradient(145deg, #112843 0%, #163352 100%); border-color: #1e4060; }

[data-theme="dark"] .pk-map-canvas { background: radial-gradient(circle at 52% 30%, #0e2540 0%, #091c31 70%, #071420 100%); }

[data-theme="dark"] .pk-tel-tagline {
  background: linear-gradient(180deg, #0d1f33 0%, #0a1828 100%);
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .pk-tel-kpis {
  background: #0c1c2e;
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .pk-kpi {
  background: linear-gradient(180deg, #112843 0%, #0d2035 100%);
  border-color: #1e4060;
}

[data-theme="dark"] .pk-kpi--active {
  background: linear-gradient(180deg, #163352 0%, #112843 100%);
  border-color: #2a6a9a;
}

[data-theme="dark"] .pk-kpi-v {
  color: #e8f4ff;
}

[data-theme="dark"] .pk-tel-table thead th {
  background: linear-gradient(180deg, #0f2740 0%, #0d2035 100%);
  border-bottom-color: #1e4060;
}

[data-theme="dark"] .pk-tel-table tbody th.pk-city {
  background: #0a1626;
}

[data-theme="dark"] .pk-cell.tone-normal { background: rgba(34, 197, 94, 0.14); }
[data-theme="dark"] .pk-cell.tone-watch { background: rgba(245, 158, 11, 0.12); }
[data-theme="dark"] .pk-cell.tone-elevated { background: rgba(249, 115, 22, 0.12); }
[data-theme="dark"] .pk-cell.tone-critical { background: rgba(220, 38, 38, 0.14); }
[data-theme="dark"] .pk-cell.tone-muted { background: rgba(148, 163, 184, 0.08); }

[data-theme="dark"] .pk-tel-table-host {
  background: transparent !important;
}

[data-theme="dark"] .mkt-chg.chg-up   { background: rgba(22, 163, 74, 0.18); }
[data-theme="dark"] .mkt-chg.chg-down { background: rgba(199, 0, 3, 0.18); }

[data-theme="dark"] .skel {
  background: linear-gradient(90deg, #163352 25%, #1e4060 50%, #163352 75%);
  background-size: 200% 100%;
}

[data-theme="dark"] .site-footer {
  background: #040e18;
}

[data-theme="dark"] .perf-tab.active { background: #0d2035; }
[data-theme="dark"] .perf-tabs { background: #112843; }

[data-theme="dark"] .pop-thumb-img { background: #112843; }

/* ─── Brand blue accent: hover/active states use 9DEAFF tint in light mode ── */
.nav-item.active {
  background: rgba(157, 234, 255, 0.18);
  border-left-color: var(--brand-red);
  color: var(--brand-navy);
}

.header-search:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(157, 234, 255, 0.35);
}

.pk-layer-btn.active {
  background: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

.perf-tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-red);
  background: rgba(157, 234, 255, 0.1);
}

/* ─── Briefing footer row (source + time) ─────── */
.briefing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 1px;
}

.briefing-source {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-navy);
  opacity: 0.7;
}

/* ─── Scroll-to-top button ────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--brand-navy);
  background: var(--surface);
  color: var(--brand-navy);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
  z-index: 999;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--brand-navy);
  color: #ffffff;
}

[data-theme="dark"] .scroll-top-btn {
  background: #112843;
  border-color: #9deaff;
  color: #9deaff;
}

[data-theme="dark"] .scroll-top-btn:hover {
  background: #9deaff;
  color: #071420;
}

/* ─── Mobile nav (≤640px) ─────────────────────── */
@media (max-width: 640px) {
  .intel-header .intel-mainbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 8px 12px;
  }

  .intel-header .header-toolbar-end {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .intel-header .header-search-wrap {
    flex: 1 1 100%;
    min-width: 100%;
    max-width: 100%;
  }

  .intel-header .header-search {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .intel-topline-right { gap: 6px; }
  .intel-header .logout-btn {
    min-height: 40px;
    padding: 0 14px;
  }
  .intel-header .refresh-btn {
    min-height: 40px;
  }
  .intel-header .member-cap-pill {
    min-height: 36px;
  }
  .intel-header .header-link-btn {
    min-height: 40px;
  }
  .intel-header .header-icon-btn {
    width: 40px;
    height: 40px;
  }
  .intel-header .header-icon-btn svg {
    width: 20px;
    height: 20px;
  }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .scroll-top-btn { bottom: 16px; right: 14px; width: 34px; height: 34px; font-size: 14px; }
  .pk-layer-btn,
  .perf-tab,
  .clear-filter-btn,
  .ai-refresh-btn,
  .dossier-btn {
    min-height: 44px;
  }

  .intel-header .header-refresh-text {
    display: none;
  }

  .intel-header .header-refresh-icon {
    font-size: 18px;
  }
}

/* ─── Time-age badge colours ──────────────────── */
.time-fresh  { color: var(--chg-up); font-weight: 600; }
.time-recent { color: var(--accent-amber); font-weight: 600; }
.time-stale  { color: var(--text-muted); }

[data-theme="dark"] .time-fresh  { color: #4ade80; }
[data-theme="dark"] .time-recent { color: #fbbf24; }
[data-theme="dark"] .time-stale  { color: var(--text-muted); }

/* ─── Stale chip (header signals) ────────────── */
.stale-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-amber);
  background: rgba(180, 83, 9, 0.12);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}
[data-theme="dark"] .stale-chip {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

/* ─── Breaking queue: priority left border ────── */
.breaking-item[data-priority="critical"],
.breaking-item[data-priority="urgent"] {
  border-left: 4px solid var(--brand-red);
  padding-left: 16px;
  background: rgba(199, 0, 3, 0.03);
}

.breaking-item[data-priority="high"] {
  border-left: 3px solid var(--accent-amber);
  padding-left: 17px;
}

.breaking-item[data-priority="medium"] {
  border-left: 2px solid rgba(157, 234, 255, 0.6);
  padding-left: 18px;
}

.breaking-item[data-priority="critical"]:hover,
.breaking-item[data-priority="urgent"]:hover {
  background: rgba(199, 0, 3, 0.06);
}

[data-theme="dark"] .breaking-item[data-priority="critical"],
[data-theme="dark"] .breaking-item[data-priority="urgent"] {
  background: rgba(199, 0, 3, 0.06);
}
[data-theme="dark"] .breaking-item[data-priority="critical"]:hover,
[data-theme="dark"] .breaking-item[data-priority="urgent"]:hover {
  background: rgba(199, 0, 3, 0.11);
}

/* ─── Header stat blip: KSE-100 change colour ── */
.sb-val .chg-up   { color: var(--chg-up) !important; font-size: 0.88em; }
.sb-val .chg-down { color: var(--chg-down) !important; font-size: 0.88em; }

[data-theme="dark"] .sb-val .chg-up   { color: var(--chg-up) !important; }
[data-theme="dark"] .sb-val .chg-down { color: var(--chg-down) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   AI INTELLIGENCE STRIP
   ═══════════════════════════════════════════════════════════════════════════ */

.ai-intel-strip {
  width: 100%;
  background: var(--surface);
  border-top: 3px solid var(--brand-red);
  border-bottom: 1px solid var(--panel-border);
  padding: 18px 24px 14px;
  box-shadow: 0 2px 12px rgba(26, 111, 168, 0.07);
}

/* ─── Inline variant — inside main lane ─────────── */
.ai-intel-inline {
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  border-top: 3px solid var(--brand-red);
  padding: 14px 16px 12px;
  box-shadow: 0 1px 6px rgba(26, 111, 168, 0.07);
}

.ai-inline-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: start;
}

.ai-inline-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ai-inline-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

/* Override padding for daily brief inside inline variant */
.ai-intel-inline .ai-daily-brief {
  padding: 0;
}

/* Override padding for watch/synthesis inside inline variant */
.ai-intel-inline .ai-watch-wrap {
  padding: 0;
}

.ai-intel-inline .ai-synthesis-wrap {
  padding: 8px 10px;
  margin: 0;
}

/* Compact indicators in inline mode */
.ai-intel-inline .ai-indicators-row {
  gap: 6px;
}

.ai-intel-inline .ai-ind-card {
  min-height: unset;
}

@media (max-width: 900px) {
  .ai-inline-body {
    grid-template-columns: 1fr;
  }
  .ai-inline-bottom {
    grid-template-columns: 1fr;
  }
}

/* ─── Header row ─────────────────── */
.ai-intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-intel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-navy);
}

.ai-intel-orb {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(199, 0, 3, 0.15);
  animation: orbPulse 2.4s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(199, 0, 3, 0.15); }
  50%       { box-shadow: 0 0 0 6px rgba(199, 0, 3, 0.05); }
}

.ai-intel-badge {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-navy);
  background: rgba(157, 234, 255, 0.3);
  border: 1px solid rgba(157, 234, 255, 0.6);
  border-radius: 4px;
  padding: 2px 6px;
}

.ai-intel-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-intel-age {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.ai-refresh-btn {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-navy);
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: var(--btn-radius);
  padding: 6px 10px;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s ease;
}

.ai-refresh-btn:hover {
  background: rgba(157, 234, 255, 0.2);
  border-color: var(--brand-navy);
}

.ai-refresh-btn:active {
  transform: scale(0.98);
}

/* ─── 6 Indicator cards row ──────── */
.ai-indicators-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.ai-ind-skel {
  height: 120px;
  border-radius: 8px;
}

.ai-ind-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-ind-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 111, 168, 0.12);
}

.ai-ind-border {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
}

.ai-ind-body {
  padding: 10px 10px 10px 16px;
}

.ai-ind-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-ind-score-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 5px;
}

.ai-ind-score {
  font-family: var(--mono-font);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Trend arrows */
.ai-trend {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.ai-trend-up   { color: var(--chg-up); }
.ai-trend-down { color: var(--chg-down); }
.ai-trend-flat { color: var(--chg-flat); }

/* Gauge bar */
.ai-gauge-wrap {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 7px;
}

.ai-gauge-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-ind-signal {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-ind-brief {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Synthesis paragraph ────────── */
.ai-synthesis-wrap {
  padding: 10px 14px;
  background: rgba(157, 234, 255, 0.08);
  border: 1px solid rgba(157, 234, 255, 0.3);
  border-radius: 6px;
}

/* ─── Daily Brief ─────────────────────────────────────── */
.ai-daily-brief {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-brief-label {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-navy);
  margin-bottom: 2px;
}

[data-theme="dark"] .ai-brief-label { color: #7dd3fc; }

.ai-brief-bullet {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(26, 39, 68, 0.04);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--brand-navy);
  border-radius: 6px;
  padding: 9px 11px;
}

[data-theme="dark"] .ai-brief-bullet {
  background: rgba(255,255,255,0.04);
  border-left-color: #38bdf8;
}

.ai-brief-num {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 900;
  color: var(--brand-navy);
  min-width: 16px;
  margin-top: 1px;
}

[data-theme="dark"] .ai-brief-num { color: #38bdf8; }

.ai-brief-content { display: flex; flex-direction: column; gap: 3px; }

.ai-brief-headline {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.ai-brief-detail {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ─── Sparklines ──────────────────────────────────────── */
.ai-sparkline {
  width: 56px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.85;
}

/* ─── What to Watch ───────────────────────────────────── */
.ai-watch-wrap {
  padding: 0 16px 12px;
}

.ai-watch-label {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

[data-theme="dark"] .ai-watch-label { color: #7dd3fc; }

.ai-watch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-watch-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
  background: rgba(180, 83, 9, 0.06);
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 6px;
  padding: 7px 10px;
}

[data-theme="dark"] .ai-watch-item {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.2);
}

.ai-watch-num {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent-amber);
}

/* ─── Synthesis ───────────────────────────────────────── */
.ai-synthesis-text {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-main);
  margin: 0;
}

/* ─── Error state ────────────────── */
.ai-intel-err {
  grid-column: 1 / -1;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
}

.ai-offline-panel {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
}

.ai-offline-title {
  margin: 0 0 8px;
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.ai-offline-body {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.ai-offline-body code {
  font-family: var(--mono-font);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-dim);
}

/* ─── Dark mode overrides ────────── */
[data-theme="dark"] .ai-intel-strip {
  background: #0d2035;
  border-color: var(--brand-red);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .ai-intel-title  { color: #9deaff; }
[data-theme="dark"] .ai-intel-badge  { background: rgba(157,234,255,0.1); border-color: rgba(157,234,255,0.25); color: #9deaff; }
[data-theme="dark"] .ai-ind-card     { background: #112843; border-color: #1e4060; }
[data-theme="dark"] .ai-ind-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
[data-theme="dark"] .ai-gauge-wrap   { background: #1e4060; }
[data-theme="dark"] .ai-synthesis-wrap { background: rgba(157,234,255,0.05); border-color: rgba(157,234,255,0.12); }
[data-theme="dark"] .ai-refresh-btn  { color: #9deaff; border-color: #1e4060; }
[data-theme="dark"] .ai-refresh-btn:hover { background: rgba(157,234,255,0.08); border-color: #9deaff; }
[data-theme="dark"] .ai-trend-up   { color: var(--chg-up); }
[data-theme="dark"] .ai-trend-down { color: var(--chg-down); }
[data-theme="dark"] .ai-trend-flat { color: var(--chg-flat); }

[data-theme="dark"] .ai-offline-panel {
  background: #112843;
  border-color: #1e4060;
}

[data-theme="dark"] .ai-offline-title { color: #e2eef8; }
[data-theme="dark"] .ai-offline-body { color: #94a3b8; }
[data-theme="dark"] .ai-offline-body code {
  background: #0d2035;
  color: #9deaff;
}

/* ─── Responsive — tablet collapse to 3-col ─ */
@media (max-width: 1024px) {
  .ai-indicators-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .ai-intel-strip   { padding: 14px 12px 12px; }
  .ai-indicators-row { grid-template-columns: repeat(2, 1fr); }
  .ai-intel-header  { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ═══ FLASH INTELLIGENCE OVERHAUL ════════════════════════ */

.flash-dossier-widget {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dossier-title {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-blue-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dossier-btn-group {
  display: flex;
  gap: 8px;
}

.dossier-btn {
  background: var(--surface-2);
  border: 1px solid var(--btn-border);
  color: var(--text-dim);
  font-size: 9px;
  font-family: var(--mono-font);
  padding: 6px 10px;
  border-radius: var(--btn-radius);
  min-height: 32px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
}

.dossier-btn:hover {
  background: rgba(2, 132, 199, 0.12);
  color: var(--brand-blue-dim);
  border-color: rgba(2, 132, 199, 0.35);
}

.dossier-btn:active {
  transform: scale(0.98);
}

.dossier-bullets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dossier-bullet {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.dossier-bullet::before {
  content: '▶';
  color: #ef4444;
  font-size: 8px;
  margin-top: 5px;
}

/* Narrative Threads */
.flash-thread {
  border-left: 2px solid var(--panel-border);
  margin-left: 10px;
  padding-left: 15px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thread-more-trigger {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--brand-blue-dim);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
}

/* Pulsing Alerts for Market Volatility */
.pulse-alert {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brand-red);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ═══ FLAT DESIGN SYSTEM (GLOBAL) ═══════════════════════════════════════ */
:root {
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --glass-bg: var(--surface);
  --glass-blur: none;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --control-h-sm: 32px;
  --control-h-md: 36px;
  --control-h-lg: 44px;
  --font-ui-sm: 12px;
  --font-ui-md: 13px;
  --font-label: 10px;
  --track-label: 0.06em;
}

.page-bg {
  background-image: none;
}

.intel-header,
.ticker-stack,
.flash-ticker-wrap,
.rail-block,
.rail-widget,
.lane-block,
.ai-stats-card,
.large-tv-card,
.popular-widget,
.flash-dossier-widget,
.ai-intel-strip,
.ai-intel-inline,
.ai-ind-card {
  box-shadow: none;
  backdrop-filter: none;
}

.rail-block:hover,
.rail-widget:hover,
.lane-block:hover,
.pulse-metric:hover,
.ai-ind-card:hover {
  transform: none;
  box-shadow: none;
}

.pk-map-head,
.pk-map-canvas,
.left-rail .rail-label,
.pulse-widget,
.pulse-metric,
.pk-tel-tagline,
.pk-kpi,
.pk-kpi--active,
.pk-tel-table thead th {
  background: var(--surface-2);
}

.news-card,
.briefing-item,
.popular-widget,
.flash-dossier-widget,
.ai-ind-card,
.pulse-metric {
  border: 1px solid var(--panel-border);
}

.rail-block,
.rail-widget,
.lane-block,
.ai-stats-card,
.large-tv-card,
.popular-widget,
.flash-dossier-widget,
.ai-intel-inline,
.ai-ind-card {
  border-radius: var(--radius-lg);
}

.widget-head,
.lane-head,
.category-head,
.rail-label,
.pk-map-head {
  padding: var(--space-2) var(--space-3);
}

.dashboard-shell {
  gap: var(--space-5);
  padding: var(--space-5);
}

.cards-grid {
  gap: var(--space-3);
}

.header-search {
  height: var(--control-h-md);
  padding: 0 32px 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-ui-md);
}

.refresh-btn,
.dark-toggle,
.pk-layer-btn,
.pop-tab,
.perf-tab,
.signals-tab,
.clear-filter-btn,
.ai-refresh-btn,
.dossier-btn {
  border-radius: var(--radius-md);
  min-height: var(--control-h-sm);
  font-size: var(--font-label);
  letter-spacing: var(--track-label);
}

.refresh-btn {
  padding: 0 var(--space-3);
}

.pk-layer-btn,
.perf-tab,
.signals-tab {
  min-height: var(--control-h-md);
}

.kw-row,
.fresh-row {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-ui-sm);
}

.card-headline,
.briefing-title,
.dossier-bullet {
  font-size: var(--font-ui-md);
  line-height: 1.45;
}

.card-time,
.card-source,
.kw-count,
.fresh-age {
  font-size: var(--font-label);
}

.pk-node-dot,
.ai-intel-strip,
.ai-intel-inline,
.left-rail .rail-block,
.popular-widget {
  box-shadow: none;
}

[data-theme="dark"] .page-bg {
  background: var(--bg-app);
}

[data-theme="dark"] .pk-map-canvas,
[data-theme="dark"] .pulse-metric,
[data-theme="dark"] .pk-tel-tagline,
[data-theme="dark"] .pk-kpi,
[data-theme="dark"] .pk-kpi--active,
[data-theme="dark"] .pk-tel-table thead th {
  background: var(--surface-2);
}

[data-theme="dark"] .ai-intel-strip,
[data-theme="dark"] .ai-ind-card:hover {
  box-shadow: none;
}

@media (max-width: 640px) {
  .dashboard-shell {
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .refresh-btn,
  .dark-toggle,
  .pk-layer-btn,
  .pop-tab,
  .perf-tab,
  .signals-tab,
  .clear-filter-btn,
  .ai-refresh-btn,
  .dossier-btn,
  .header-search {
    min-height: var(--control-h-lg);
  }

  .widget-head,
  .lane-head,
  .category-head,
  .rail-label,
  .pk-map-head {
    padding: var(--space-2) var(--space-2);
  }
}

/* ═══ Pakistan Trajectory (macro flagship widget) ═══════════════════════════ */
.pakistan-trajectory-section {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px 16px;
}

.pjt-card {
  padding: 0;
  overflow: hidden;
}

.pjt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

.pjt-head-text {
  min-width: 0;
  flex: 1;
}

.pjt-title {
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.pjt-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 62ch;
  font-weight: 400;
}

.pjt-inline-source {
  color: var(--brand-blue-dim);
  text-decoration: none;
  font-weight: 500;
}

.pjt-inline-source:hover {
  text-decoration: underline;
}

.pjt-badge {
  display: none;
}

.pjt-meta {
  margin: 3px 0 0;
  font-size: 11px;
  font-family: var(--mono-font);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pjt-foot-note {
  margin: 0;
  padding: 10px 16px 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--ui-font);
  border-top: 1px solid var(--panel-border);
  background: var(--surface-2);
}

/* ── KPI cards act as single-select tabs (selects the focused metric) ────── */
.pjt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--panel-border);
}

@media (max-width: 720px) {
  .pjt-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pjt-kpi {
  --pjt-accent: var(--brand-navy);
  position: relative;
  text-align: left;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  border-radius: 12px;
  padding: 11px 12px 9px;
  cursor: pointer;
  user-select: none;
  font-family: var(--ui-font);
  color: var(--text-main);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 118px;
}

.pjt-kpi:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--pjt-accent) 40%, var(--panel-border));
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.pjt-kpi.is-active {
  background: color-mix(in srgb, var(--pjt-accent) 5%, var(--surface));
  border-color: color-mix(in srgb, var(--pjt-accent) 55%, var(--panel-border));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--pjt-accent) 25%, transparent),
    0 3px 10px rgba(15, 23, 42, 0.06);
}

.pjt-kpi:focus-visible {
  outline: 2px solid var(--pjt-accent);
  outline-offset: 2px;
}

.pjt-kpi-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--pjt-accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pjt-kpi.is-active .pjt-kpi-accent {
  opacity: 1;
}

.pjt-kpi-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pjt-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pjt-kpi.is-active .pjt-kpi-label {
  color: var(--pjt-accent);
}

.pjt-kpi-year {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.pjt-kpi-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}

.pjt-kpi-num {
  font-family: var(--ui-font);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--pjt-accent);
}

.pjt-kpi-delta {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.pjt-kpi-delta--up { color: #16a34a; }
.pjt-kpi-delta--down { color: #dc2626; }
.pjt-kpi-delta--flat { color: var(--text-muted); }

.pjt-kpi-arrow {
  font-size: 9px;
  opacity: 0.85;
}

.pjt-kpi-spark {
  margin-top: auto;
  padding-top: 4px;
  height: 30px;
  opacity: 0.85;
}

.pjt-kpi:not(.is-active) .pjt-kpi-spark {
  opacity: 0.55;
}

.pjt-spark-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Focus chart (big, fixed height, interactive) ────────────────────────── */
.pjt-focus {
  padding: 16px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--panel-border);
}

.pjt-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.pjt-focus-title-group {
  min-width: 0;
}

.pjt-focus-title {
  margin: 0 0 2px;
  font-family: var(--ui-font);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.pjt-focus-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--ui-font);
  line-height: 1.4;
}

.pjt-range-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
  max-width: 100%;
}

.pjt-range-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  min-width: 34px;
}

.pjt-range-tab:hover {
  color: var(--text-main);
}

.pjt-range-tab.is-active {
  background: var(--surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--panel-border);
}

.pjt-range-tab:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
}

.pjt-chart-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 306;
  max-height: 340px;
  background: var(--surface);
  border-radius: 10px;
  overflow: visible;
}

.pjt-chart-skel {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.pjt-chart-skel[hidden] {
  display: none;
}

.pjt-chart {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: crosshair;
}

.pjt-brush {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1px solid color-mix(in srgb, var(--brand-navy) 50%, transparent);
  background: color-mix(in srgb, var(--brand-navy) 18%, transparent);
  pointer-events: none;
  z-index: 4;
}

.pjt-chart-hint {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono-font);
}

.pjt-chart .pjt-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

.pjt-chart .pjt-area {
  transition: opacity 0.2s ease;
}

.pjt-chart .pjt-anim {
  animation: pjtFadeInPath 0.35s ease-out;
}

@keyframes pjtFadeInPath {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.pjt-chart .pjt-marker {
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.18));
}

.pjt-chart .pjt-crosshair,
.pjt-chart .pjt-hover-dot {
  pointer-events: none;
}

.pjt-tooltip {
  position: absolute;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 10px 9px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
  font-family: var(--ui-font);
  min-width: 96px;
  pointer-events: none;
  animation: pjtFadeInPath 0.12s ease-out;
}

.pjt-tooltip[hidden] {
  display: none;
}

.pjt-tt-year {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pjt-tt-value {
  font-family: var(--ui-font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 2px;
}

.pjt-tt-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
}

.pjt-tt-d {
  font-weight: 500;
}

/* ── Stats strip under the chart ─────────────────────────────────────────── */
.pjt-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px 10px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
}

@media (max-width: 1100px) {
  .pjt-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pjt-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pjt-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pjt-stat-label {
  font-family: var(--ui-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pjt-stat-value {
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
}

.pjt-stat-value--up { color: #16a34a; }
.pjt-stat-value--down { color: #dc2626; }

.pjt-stat-meta {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Center column: compact footprint under KSE/USDPKR strip */
.pjt-in-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.pjt-in-main .pjt-title {
  font-size: 16px;
}

.pjt-in-main .pjt-sub {
  font-size: 12px;
  max-width: none;
}

.pjt-in-main .pjt-head {
  padding: 12px 14px 10px;
}

.pjt-in-main .pjt-kpis {
  padding: 12px 12px 10px;
  gap: 6px;
}

.pjt-in-main .pjt-kpi {
  min-height: 108px;
  padding: 10px 11px 8px;
}

.pjt-in-main .pjt-kpi-num {
  font-size: 22px;
}

.pjt-in-main .pjt-focus {
  padding: 14px 14px 12px;
}

.pjt-in-main .pjt-focus-title {
  font-size: 16px;
}

.pjt-in-main .pjt-foot-note {
  padding: 10px 14px 12px;
  font-size: 11px;
}

[data-theme="dark"] .pjt-head {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

[data-theme="dark"] .pjt-kpis {
  background: var(--surface);
}

[data-theme="dark"] .pjt-kpi {
  background: var(--surface-2);
}

[data-theme="dark"] .pjt-kpi.is-active {
  background: color-mix(in srgb, var(--pjt-accent) 10%, var(--surface-2));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--pjt-accent) 40%, transparent),
    0 3px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .pjt-range-tabs {
  background: var(--surface);
}

[data-theme="dark"] .pjt-range-tab.is-active {
  background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--panel-border);
}

[data-theme="dark"] .pjt-tooltip {
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .pjt-stats {
  background: var(--surface);
}

[data-theme="dark"] .pjt-badge {
  background: var(--surface-3);
}

[data-theme="dark"] .pjt-foot-note {
  background: var(--surface-2);
}

.pjt-insight-details {
  border-top: 1px solid var(--panel-border);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.pjt-insight-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--ui-font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dim);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}

.pjt-insight-summary:hover {
  color: var(--text-main);
}

.pjt-insight-summary::-webkit-details-marker {
  display: none;
}

.pjt-insight-summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.18s ease;
  transform-origin: 25% 50%;
  opacity: 0.75;
}

.pjt-insight-details[open] .pjt-insight-summary::before {
  transform: rotate(90deg);
}

.pjt-insight-summary:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: -2px;
}

.pjt-insight-inner {
  padding: 0 18px 20px;
}

.pjt-insight-details .pjt-insight-toolbar {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
}

.pjt-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 820px) {
  .pjt-insight-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.pjt-insight-details .pjt-insight-text {
  font-family: var(--ui-font);
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--text-main);
}

.pjt-insight-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--surface);
  font-family: var(--ui-font);
  position: sticky;
  top: 12px;
}

@media (max-width: 820px) {
  .pjt-insight-aside {
    position: static;
  }
}

.pjt-aside-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pjt-aside-head {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pjt-aside-list,
.pjt-aside-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pjt-aside-indic {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
}

.pjt-aside-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--brand-navy));
  margin-top: 5px;
}

.pjt-aside-indic-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pjt-aside-indic-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.pjt-aside-indic-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono-font);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.pjt-aside-code {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--text-muted) 60%, transparent);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.pjt-aside-code:hover,
.pjt-aside-code:focus-visible {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
  outline: none;
}

.pjt-aside-notes {
  gap: 8px;
}

.pjt-aside-notes li {
  position: relative;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.pjt-aside-notes li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.68em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.8;
}

.pjt-aside-notes strong {
  color: var(--text-main);
  font-weight: 600;
}

.pjt-aside-credit {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pjt-aside-credit a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--text-muted) 60%, transparent);
}

.pjt-aside-credit a:hover,
.pjt-aside-credit a:focus-visible {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
  outline: none;
}

[data-theme="dark"] .pjt-insight-aside {
  background: var(--surface-2);
  border-color: var(--panel-border);
}

[data-theme="dark"] .pjt-aside-code:hover,
[data-theme="dark"] .pjt-aside-code:focus-visible,
[data-theme="dark"] .pjt-aside-credit a:hover,
[data-theme="dark"] .pjt-aside-credit a:focus-visible {
  color: #7dd3fc;
  border-bottom-color: #7dd3fc;
}

.pjt-insight-p {
  margin: 0 0 16px;
  color: var(--text-main);
}

.pjt-insight-text > p:last-of-type,
.pjt-insight-text > ul:last-of-type {
  margin-bottom: 0;
}

.pjt-insight-lead {
  position: relative;
  font-size: 15.5px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text-main);
  padding-left: 14px;
  border-left: 3px solid color-mix(in srgb, var(--brand-navy) 70%, transparent);
  margin-bottom: 18px;
}

.pjt-insight-p--muted {
  color: var(--text-muted);
  font-style: italic;
}

.pjt-insight-p--small {
  font-size: 12px;
  color: var(--text-muted);
}

.pjt-insight-text code {
  font-family: var(--mono-font);
  font-size: 0.92em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-3);
}

/* Emphasize numbers and years within prose */
.pjt-n {
  font-family: var(--mono-font);
  font-feature-settings: "tnum";
  font-weight: 700;
  color: var(--brand-navy);
  background: color-mix(in srgb, var(--brand-navy) 8%, transparent);
  padding: 1px 5px 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
  white-space: nowrap;
}

.pjt-n-unit {
  font-weight: 600;
  margin-left: 1px;
  opacity: 0.8;
}

.pjt-y {
  font-family: var(--mono-font);
  font-feature-settings: "tnum";
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .pjt-n {
  color: #7dd3fc;
  background: color-mix(in srgb, #0ea5e9 18%, transparent);
}

[data-theme="dark"] .pjt-y {
  color: var(--text-muted);
}

[data-theme="dark"] .pjt-insight-lead {
  border-left-color: color-mix(in srgb, #7dd3fc 80%, transparent);
}

.pjt-dev-hint {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--panel-border);
}

.pjt-dev-hint summary {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.pjt-dev-hint summary::-webkit-details-marker {
  display: none;
}

.pjt-dev-hint[open] summary {
  margin-bottom: 6px;
}

.pjt-insight-block {
  padding: 12px 16px 16px;
  background: var(--surface-2);
}

.pjt-insight-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pjt-brief-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pjt-brief-tab {
  font-family: var(--mono-font);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pjt-brief-tab:hover {
  border-color: var(--brand-navy);
  color: var(--text-main);
}

.pjt-brief-tab.is-active {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: color-mix(in srgb, var(--brand-navy) 10%, transparent);
}

.pjt-ai-btn {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

.pjt-ai-btn:hover {
  background: var(--brand-navy-2);
}

.pjt-ai-btn:active {
  transform: scale(0.98);
}

.pjt-ai-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pjt-mode-btn,
.pjt-copy-btn {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pjt-mode-btn:hover,
.pjt-copy-btn:hover {
  border-color: var(--brand-navy);
  color: var(--text-main);
}

.pjt-mode-btn.is-active {
  border-color: var(--brand-navy);
  background: color-mix(in srgb, var(--brand-navy) 10%, transparent);
  color: var(--brand-navy);
}

.pjt-mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pjt-ai-hint {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.35;
}

.pjt-insight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.pjt-insight-chip {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid transparent;
}

.pjt-insight-chip--static {
  color: #92400e;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(180, 83, 9, 0.25);
}

.pjt-insight-chip--ai {
  color: #0f4b7d;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 116, 144, 0.26);
}

.pjt-insight-meta-txt {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--mono-font);
}

.pjt-insight-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-main);
}

.pjt-insight-main {
  min-width: 0;
}

.pjt-compare-block,
.pjt-evidence-block {
  margin-top: 14px;
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
}

.pjt-compare-head {
  margin: 0 0 8px;
  font-family: var(--mono-font);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pjt-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.pjt-compare-table th,
.pjt-compare-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--panel-border);
  text-align: left;
}

.pjt-compare-table th {
  font-family: var(--mono-font);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pjt-insight-ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
  color: var(--text-main);
}

.pjt-insight-ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.pjt-insight-ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-navy);
  opacity: 0.72;
}

[data-theme="dark"] .pjt-insight-ul li::before {
  background: #7dd3fc;
}

@media (max-width: 640px) {
  .pakistan-trajectory-section {
    padding: 0 12px 12px;
  }

  .pjt-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pjt-meta {
    align-items: flex-start;
  }
}

/* ─── Responsive hardening pass (v0.0.7+) ───────────────────────────────── */
.sec-econ-widget {
  padding: 0 8px 10px;
}

.sec-econ-toolbar,
.sec-range-head {
  flex-wrap: wrap;
}

.sec-econ-tab,
.sec-range-tab {
  min-height: 32px;
}

.main-lane-dual .sec-econ-main .sec-econ-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .left-rail,
  .right-rail {
    grid-column: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .main-lane-dual {
    grid-template-columns: 1fr;
  }

  .intel-header .intel-mainbar {
    padding: 10px 12px;
    gap: 10px;
    align-items: center;
  }
}

@media (max-width: 900px) {
  .left-rail,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .sec-econ-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sec-row {
    grid-template-columns: minmax(0, 1fr) 72px 56px;
    gap: 6px;
  }

  .sec-row-label {
    font-size: 10px;
  }
}

@media (max-width: 700px) {
  .header-social-links {
    width: 100%;
    justify-content: space-between;
  }

  .workspace-switch {
    width: 100%;
  }

  .workspace-tab {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }

  .sec-compare-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .sec-compare-select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .sec-econ-widget {
    padding: 0 6px 8px;
  }

  .sec-econ-kpis,
  .main-lane-dual .sec-econ-main .sec-econ-kpis {
    grid-template-columns: 1fr;
  }

  .sec-econ-foot .clear-filter-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .sec-row {
    grid-template-columns: minmax(0, 1fr) 62px 52px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   UX OVERHAUL: Header compression · Section nav · Breaking news priority
   ─────────────────────────────────────────────────────────────────────────── */

/* 1. COMPRESSED HEADER — mobile-first, two-row on mobile, single-row on desktop */
.intel-header {
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 2px 8px rgba(26, 39, 68, 0.07);
}

/* ── Mobile base: column layout ── */
.intel-header .intel-mainbar {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  gap: 8px;
  align-items: stretch;
}

/* Row 1: brand LEFT + actions RIGHT */
.intel-header .brand-lockup {
  order: 1;
}

.intel-header .header-toolbar-end {
  order: 2;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}

/* Search takes remaining space */
.intel-header .header-toolbar-end > .header-search-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Desktop (641px+): single row ── */
@media (min-width: 641px) {
  .intel-header .intel-mainbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 20px;
    height: 58px;
    gap: 14px;
  }

  .intel-header .brand-lockup {
    order: 1;
    flex-shrink: 0;
  }

  .intel-header .header-toolbar-end {
    order: 2;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 10px;
  }

  .intel-header .header-toolbar-end > .header-search-wrap {
    flex: 0 1 auto;
    width: clamp(220px, 26vw, 440px);
    max-width: min(440px, calc(100vw - 200px));
  }

  .intel-header .header-toolbar-end > .header-search-wrap .header-search {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

.intel-header .brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  align-items: flex-start;
}

.intel-header .brand-title {
  margin: 0;
  line-height: 1;
  text-align: left;
}

.intel-header .brand-word {
  font-size: 24px;
}

@media (min-width: 641px) {
  .intel-header .brand-word {
    font-size: 26px;
  }
}

.brand-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono-font);
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.brand-meta-row .top-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-green);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 8.5px;
}

.brand-meta-row .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
  flex-shrink: 0;
}

.brand-meta-row .top-sep {
  color: var(--panel-border);
}

.brand-meta-row .top-meta,
.brand-meta-row .top-clock {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Tighten macro tape in compressed header */
.intel-header .macro-stats-grid {
  padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.intel-header .macro-stats-grid::-webkit-scrollbar {
  display: none;
}

.intel-header .stat-blip {
  padding: 2px 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.intel-header .sb-label {
  font-size: 7.5px;
}

.intel-header .sb-val {
  font-size: 11.5px;
}

.intel-header .header-search {
  box-sizing: border-box;
}

.intel-header .member-cap-pill {
  flex-shrink: 0;
  min-height: var(--control-h-md);
  box-sizing: border-box;
}

/* brief.pk + X — blue outline buttons (logout stays red separately) */
.intel-header .header-link-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--control-h-md);
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-blue);
  background: rgba(3, 105, 161, 0.06);
  color: var(--brand-blue);
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.intel-header .header-link-btn:hover {
  background: rgba(3, 105, 161, 0.12);
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

/* ═══ PREMIUM ICON BUTTONS — Substack + X ════════════════════════════════════ */
.intel-header .header-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 -1px 0 rgba(0, 0, 0, 0.02) inset;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.intel-header .header-icon-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

/* Substack — distinct orange accent */
.intel-header .header-icon-substack {
  color: #ff6719;
  border-color: rgba(255, 103, 25, 0.25);
  background: linear-gradient(180deg, #fff8f5 0%, #ffffff 100%);
}

.intel-header .header-icon-substack:hover {
  background: linear-gradient(180deg, #ff6719 0%, #e55a00 100%);
  border-color: #ff6719;
  color: #ffffff;
  box-shadow:
    0 4px 12px rgba(255, 103, 25, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transform: translateY(-1px);
}

/* X (Twitter) — sleek black/dark */
.intel-header .header-icon-x {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.2);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.intel-header .header-icon-x:hover {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-color: #0f172a;
  color: #ffffff;
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-1px);
}

.intel-header .header-icon-btn:hover svg {
  transform: scale(1.05);
}

/* Active/press state */
.intel-header .header-icon-btn:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

/* Focus state for accessibility */
.intel-header .header-icon-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.member-cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
  font-family: var(--mono-font);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.member-cap-pill-cap {
  color: var(--brand-red);
  font-weight: 800;
}

.member-cap-pill-rank {
  color: var(--text-dim);
  font-weight: 700;
}

/* User Counter Pill (visible to all) */
.user-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: 8px;
  padding: 5px 10px;
  white-space: nowrap;
  font-family: var(--mono-font);
  cursor: default;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.user-counter-pill:hover {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}
.user-counter-icon {
  font-size: 14px;
}
.user-counter-text {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.user-counter-num {
  color: var(--brand-red);
  font-weight: 800;
  font-size: 13px;
}
.user-counter-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 10px;
}

.intel-header .dark-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.intel-header .dark-toggle:hover {
  background: var(--surface-3);
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.intel-header .logout-btn {
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: var(--control-h-md);
  height: var(--control-h-md);
  border-radius: var(--radius-md);
  border: 1px solid #b91c1c;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 14px;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.25);
}

/* Neutralize global .refresh-btn (dashboard rail red + height:100%) — neutral raised control */
.intel-header .refresh-btn {
  flex-shrink: 0;
  box-sizing: border-box;
  width: auto;
  min-width: auto;
  height: var(--control-h-md);
  min-height: var(--control-h-md);
  padding: 0 12px;
  gap: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-2) 100%);
  box-shadow: 0 1px 2px rgba(15, 35, 68, 0.08);
  color: var(--brand-navy);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.intel-header .header-refresh-icon {
  display: inline-flex;
  font-size: 15px;
  line-height: 1;
  transform: translateY(0.5px);
}

.intel-header .header-refresh-text {
  font-family: var(--ui-font);
}

.intel-header .refresh-btn:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-3) 100%);
  box-shadow: 0 2px 4px rgba(15, 35, 68, 0.1);
}

.intel-header .refresh-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.intel-header .logout-btn:hover {
  filter: brightness(1.05);
  border-color: #991b1b;
}

.intel-header .logout-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* 2. SECTION NAV — sticky below header, compact wayfinding bar */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--brand-navy);
  border-bottom: 2px solid var(--brand-red);
  box-shadow: 0 2px 8px rgba(10, 20, 40, 0.18);
}

[data-theme="dark"] .section-nav {
  background: #0d1e36;
  border-bottom-color: var(--brand-red);
}

.section-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 14px;
  min-height: 38px;
  max-width: 1800px;
  margin: 0 auto;
}

.section-nav-inner::-webkit-scrollbar { display: none; }

/* ── Billing wall (login-first pay unlock) ─────────────────────────────── */
.billing-wall {
  padding: 22px 14px 4px;
}

.billing-wall-card {
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid rgba(26, 72, 130, 0.16);
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff 0%, #f5f8ff 100%);
  box-shadow: 0 10px 24px rgba(15, 35, 68, 0.12);
  padding: 18px 18px 16px;
}

.billing-wall-eyebrow {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8db0;
  margin-bottom: 6px;
}

.billing-wall-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
  color: #14284a;
}

.billing-wall-card p {
  margin: 0;
  color: #1a3159;
  line-height: 1.45;
}

.billing-wall-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-wall-btn {
  border: 1px solid #1a4882;
  background: #1a4882;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.billing-wall-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.billing-wall-btn--ghost {
  background: transparent;
  color: #1a4882;
}

.billing-wall-meta {
  margin-top: 10px !important;
  font-family: var(--mono-font);
  font-size: 11px;
  color: #5f7398 !important;
}

body.billing-locked .ticker-stack,
body.billing-locked .tv-charts-strip,
body.billing-locked .dashboard-shell,
body.billing-locked .section-nav,
body.billing-locked .feed-load-bar,
body.billing-locked .sync-pill,
body.billing-locked .intel-search-panel,
body.billing-locked .intel-search-backdrop {
  display: none !important;
}

/* ── Intelligence Search Panel ───────────────────────────────────────────── */
.intel-search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(15, 35, 68, 0.38);
  -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .intel-search-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.intel-search-panel {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
  z-index: 1002;
}

.intel-search-panel-inner {
  border: 1px solid rgba(26, 72, 130, 0.14);
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f5f8ff 100%);
  box-shadow:
    0 4px 6px rgba(15, 35, 68, 0.06),
    0 22px 44px rgba(15, 35, 68, 0.14);
  padding: 12px 14px;
  max-height: min(72vh, 680px);
  overflow: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.intel-search-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.intel-search-title-wrap {
  min-width: 0;
}

.intel-search-eyebrow {
  display: block;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60749a;
}

.intel-search-title {
  margin: 4px 0 0;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #14284a;
}

.intel-search-close {
  flex-shrink: 0;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.intel-search-close:hover {
  background: #f1f5fb;
  border-color: #c5d4eb;
  color: var(--text-main);
}

.intel-search-summary {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #1a3159;
}

.intel-search-meta {
  margin-top: 6px;
  font-family: var(--mono-font);
  font-size: 11px;
  color: #5f7398;
}

.intel-search-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.intel-search-chips[hidden] {
  display: none !important;
}

.intel-search-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.intel-search-chip-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a8db0;
  width: 100%;
  margin: 0;
}

.intel-search-chip {
  border: 1px solid rgba(26, 72, 130, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: #1a3159;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  max-width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intel-search-chip:hover {
  background: #eef3fc;
  border-color: rgba(204, 16, 32, 0.35);
}

.intel-search-chip:active {
  transform: scale(0.98);
}

.intel-search-chip--pulse {
  border-color: rgba(204, 16, 32, 0.28);
  background: linear-gradient(135deg, #fff8f8 0%, #fff 100%);
}

.intel-search-hl {
  background: rgba(204, 16, 32, 0.14);
  color: inherit;
  font-weight: 700;
  padding: 0 1px;
  border-radius: 2px;
}

.intel-search-item--active {
  outline: 2px solid rgba(204, 16, 32, 0.45);
  outline-offset: 2px;
  border-radius: 10px;
}

.intel-search-origin {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.intel-search-origin--feed {
  background: rgba(26, 72, 130, 0.1);
  color: #1a4882;
}

.intel-search-origin--lookup {
  background: rgba(124, 45, 18, 0.1);
  color: #7c2d12;
}

.intel-search-skel {
  border-radius: 10px;
  background: linear-gradient(90deg, #e8edf6 0%, #f4f6fb 50%, #e8edf6 100%);
  background-size: 200% 100%;
  animation: intel-search-shimmer 1.1s ease-in-out infinite;
  min-height: 56px;
}

@keyframes intel-search-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.intel-search-results {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.intel-search-item {
  border: 1px solid rgba(26, 72, 130, 0.12);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 11px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.intel-search-item:hover {
  border-color: rgba(26, 111, 168, 0.28);
  box-shadow: 0 2px 8px rgba(15, 35, 68, 0.08);
}

.intel-search-item a {
  display: block;
  text-decoration: none;
  color: #0f3d73;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.intel-search-item a:hover {
  color: #1a6fb8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intel-search-item-meta {
  margin-top: 5px;
  font-size: 10.5px;
  color: #6b7f9e;
  font-family: var(--mono-font);
  letter-spacing: 0.02em;
}

.intel-search-item-snippet {
  margin-top: 6px;
  font-size: 12px;
  color: #4a5f80;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

[data-theme="dark"] .intel-search-panel-inner {
  border-color: rgba(127, 170, 235, 0.26);
  background: linear-gradient(160deg, rgba(10, 21, 38, 0.96), rgba(13, 30, 50, 0.94));
  box-shadow: 0 14px 32px rgba(3, 10, 18, 0.46);
}

[data-theme="dark"] .intel-search-title { color: #d8ecff; }
[data-theme="dark"] .intel-search-summary { color: #d3e8ff; }
[data-theme="dark"] .intel-search-meta { color: #9dbde0; }
[data-theme="dark"] .intel-search-eyebrow { color: #8caed4; }
[data-theme="dark"] .intel-search-item {
  border-color: rgba(127, 170, 235, 0.28);
  background: rgba(18, 34, 58, 0.55);
}
[data-theme="dark"] .intel-search-item:hover {
  border-color: rgba(147, 190, 255, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .intel-search-item a { color: #c8e3ff; }
[data-theme="dark"] .intel-search-item-meta { color: #93b6de; }
[data-theme="dark"] .intel-search-item-snippet { color: #b9d7fa; }

/* Bottom-anchored sheet on phones (position + height from JS + visualViewport) */
.intel-search-panel--sheet .intel-search-panel-inner {
  border-radius: 16px;
  box-shadow: 0 -8px 40px rgba(15, 35, 68, 0.22);
}

[data-theme="dark"] .intel-search-panel--sheet .intel-search-panel-inner {
  box-shadow: 0 -10px 44px rgba(3, 10, 18, 0.55);
}

@media (max-width: 700px) {
  .intel-search-title { font-size: 16px; }
  .intel-search-summary { font-size: 14px; }
  .intel-search-panel-inner {
    padding: 9px 10px;
  }
}

/* ═══ BRIEF'S PULSE (premium summary card) ═════════════════════════════ */
.briefpk-pulse-lane {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(16, 31, 61, 0.13);
  border-radius: 14px;
  background:
    radial-gradient(1300px 160px at 100% -35%, rgba(220, 38, 38, 0.09), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.94));
  box-shadow: 0 14px 30px rgba(16, 31, 61, 0.11);
  padding: 14px 16px 12px;
}

.briefpk-pulse-lane::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-red), #f97316 54%, #22c55e);
  opacity: 0.88;
  pointer-events: none;
}

.briefpk-pulse-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.briefpk-pulse-eyebrow {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5f7398;
}

.briefpk-pulse-title {
  margin: 3px 0 0;
  font-family: var(--ui-font);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #0f2344;
}

.briefpk-pulse-meta {
  text-align: right;
  display: grid;
  gap: 7px;
  justify-items: end;
}

.briefpk-pulse-state {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 35, 66, 0.12);
  background: #eff3fb;
}

.briefpk-pulse-state--green { color: #11693c; background: #e9f8ef; border-color: #95d8af; }
.briefpk-pulse-state--amber { color: #7a4a00; background: #fff3e2; border-color: #f2c487; }
.briefpk-pulse-state--orange { color: #8a3f00; background: #ffead8; border-color: #f4b37d; }
.briefpk-pulse-state--red { color: #8d1628; background: #ffe9ee; border-color: #f2a8b6; }

.briefpk-pulse-confidence {
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #4e628a;
}

.briefpk-pulse-quote {
  margin: 12px 0 10px;
  font-family: var(--ui-font);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.024em;
  color: #13284b;
}

/* Single forward-looking watch pill */
.briefpk-pulse-watch { margin-bottom: 12px; }
.briefpk-pulse-watch-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  color: #24416e;
  background: linear-gradient(180deg, #f5f9ff, #edf4ff);
  border: 1px solid #cfdbf7;
  border-radius: 8px;
  padding: 7px 11px;
}

.briefpk-pulse-foot {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed #d8e2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #5b6e93;
}

[data-theme="dark"] .briefpk-pulse-lane {
  border-color: rgba(125, 172, 243, 0.28);
  background:
    radial-gradient(1200px 160px at 100% -30%, rgba(220, 38, 38, 0.18), transparent 54%),
    linear-gradient(130deg, rgba(7, 19, 34, 0.96), rgba(13, 30, 50, 0.93));
  box-shadow: 0 22px 42px rgba(3, 10, 18, 0.46);
}
[data-theme="dark"] .briefpk-pulse-lane::before {
  opacity: 0.95;
}
[data-theme="dark"] .briefpk-pulse-watch-pill {
  background: linear-gradient(180deg, rgba(28,49,82,0.5), rgba(23,40,68,0.42));
  border-color: rgba(127,170,235,0.3);
  color: #c8e2ff;
}
[data-theme="dark"] .briefpk-pulse-eyebrow { color: #8aacd2; }
[data-theme="dark"] .briefpk-pulse-title { color: #deeeff; }
[data-theme="dark"] .briefpk-pulse-confidence { color: #9fbbde; }
[data-theme="dark"] .briefpk-pulse-quote { color: #ebf5ff; }
[data-theme="dark"] .briefpk-pulse-driver {
  color: #c8e2ff;
  background: linear-gradient(180deg, rgba(38, 60, 96, 0.5), rgba(33, 52, 84, 0.42));
  border-color: rgba(127, 170, 235, 0.36);
}
[data-theme="dark"] .briefpk-pulse-foot {
  border-top-color: rgba(125, 168, 230, 0.28);
  color: #a5c2e4;
}

@media (max-width: 980px) {
  .briefpk-pulse-title {
    font-size: 28px;
  }
  .briefpk-pulse-quote {
    font-size: 23px;
  }
}

@media (max-width: 680px) {
  .briefpk-pulse-lane {
    padding: 12px 12px 10px;
  }
  .briefpk-pulse-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .briefpk-pulse-meta {
    text-align: left;
    justify-items: start;
  }
  .briefpk-pulse-title {
    font-size: 24px;
  }
  .briefpk-pulse-quote {
    font-size: 20px;
    line-height: 1.24;
  }
}

/* ─── Pulse indicator grid ──────────────────────────────────────────── */
.briefpk-pulse-indicators { margin-top: 14px; }

.bpp-ind-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bpp-ind-card {
  border: 1px solid var(--panel-border);
  border-left: 3px solid transparent;
  border-radius: 10px;
  padding: 10px 11px 9px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(245,249,255,0.5));
  transition: box-shadow .15s ease;
}
.bpp-ind-card:hover { box-shadow: 0 4px 14px rgba(15,35,66,0.09); }
.bpp-ind-card.bpp-ind--ok   { border-left-color: var(--accent-green); }
.bpp-ind-card.bpp-ind--warn { border-left-color: var(--accent-amber); }
.bpp-ind-card.bpp-ind--bad  { border-left-color: var(--accent-red); }

.bpp-ind-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.bpp-ind-icon { font-size: 13px; flex-shrink: 0; line-height: 1; }
.bpp-ind-label {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bpp-ind-score-num {
  font-family: var(--mono-font);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  flex-shrink: 0;
  line-height: 1;
}
.bpp-trend { font-size: 12px; flex-shrink: 0; font-weight: 700; line-height: 1; }
.bpp-trend--up   { color: var(--accent-green); }
.bpp-trend--down { color: var(--accent-red); }
.bpp-trend--flat { color: var(--accent-amber); }

.bpp-ind-rail {
  height: 4px;
  border-radius: 999px;
  background: rgba(15,35,66,0.08);
  overflow: hidden;
  margin-bottom: 7px;
}
.bpp-ind-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .7s cubic-bezier(0.16,1,0.3,1);
}
.bpp-ind-fill--ok   { background: var(--accent-green); }
.bpp-ind-fill--warn { background: var(--accent-amber); }
.bpp-ind-fill--bad  { background: var(--accent-red); }

.bpp-ind-signal {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.35;
}
.bpp-ind-impact {
  margin: 0;
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* dark */
[data-theme="dark"] .bpp-ind-card {
  background: linear-gradient(180deg, rgba(22,42,72,0.55), rgba(18,35,60,0.45));
  border-color: rgba(127,170,235,0.22);
}
[data-theme="dark"] .bpp-ind-card.bpp-ind--ok   { border-left-color: #34d399; }
[data-theme="dark"] .bpp-ind-card.bpp-ind--warn  { border-left-color: #fbbf24; }
[data-theme="dark"] .bpp-ind-card.bpp-ind--bad   { border-left-color: #f87171; }
[data-theme="dark"] .bpp-ind-label  { color: #6b8cba; }
[data-theme="dark"] .bpp-ind-score-num { color: #deeeff; }
[data-theme="dark"] .bpp-ind-signal { color: #9dbfe0; }
[data-theme="dark"] .bpp-ind-impact { color: #6b8cba; }
[data-theme="dark"] .bpp-ind-rail   { background: rgba(255,255,255,0.08); }

@media (max-width: 860px) {
  .bpp-ind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .bpp-ind-grid { grid-template-columns: 1fr; }
}

/* Hash-only anchors: enforce light text on navy (covers :visited + any UA link color). */
.section-nav .snav-link,
.section-nav .snav-link:visited {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.section-nav .snav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.section-nav .snav-link--active,
.section-nav .snav-link[aria-current="location"] {
  color: #ffffff;
  border-bottom-color: var(--brand-red);
}

.snav-sep {
  flex: 1 1 auto;
  min-width: 12px;
}

/* Duplicates macro tape in the header — hiding avoids overlap + clutter. */
.section-nav .snav-markets-badge {
  display: none;
}

.snav-markets-badge {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  letter-spacing: 0.04em;
  margin-left: 4px;
  transition: color 0.2s;
}

.snav-markets-badge.up { color: var(--chg-up); }
.snav-markets-badge.down { color: var(--chg-down); }
.snav-markets-badge--fx { color: rgba(255, 255, 255, 0.65); }

[data-theme="dark"] .snav-markets-badge {
  background: rgba(255, 255, 255, 0.06);
}

/* 3. BREAKING NEWS VISUAL PRIORITY — bold hierarchy */

/* High / breaking cards get prominent treatment */
.news-card[data-priority="high"],
.news-card[data-priority="breaking"] {
  border-left-width: 4px;
  padding-left: 14px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.04) 0%, transparent 60%);
}

.news-card[data-priority="high"]:hover,
.news-card[data-priority="breaking"]:hover {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.07) 0%, var(--surface-2) 50%);
}

[data-theme="dark"] .news-card[data-priority="high"],
[data-theme="dark"] .news-card[data-priority="breaking"] {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.08) 0%, transparent 60%);
}

.news-card[data-priority="high"] .card-headline,
.news-card[data-priority="breaking"] .card-headline {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.news-card[data-priority="high"] .card-priority-label,
.news-card[data-priority="breaking"] .card-priority-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-red);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.news-card[data-priority="high"] .card-priority-label::before,
.news-card[data-priority="breaking"] .card-priority-label::before {
  content: '●';
  font-size: 6px;
  color: rgba(255,255,255,0.8);
}

/* Normal cards stay compact */
.news-card[data-priority="normal"] {
  padding: 10px 14px 9px 14px;
}

.news-card[data-priority="normal"] .card-headline {
  font-size: 13px;
  font-weight: 500;
}

/* Category section headers — styled dividers */
.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--surface-2);
  position: relative;
}

.category-head::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-blue);
  border-radius: 0 2px 2px 0;
}

.category-name {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-navy);
}

[data-theme="dark"] .category-name { color: var(--brand-blue-dim); }

/* ── Responsive: header compression on mobile ── */
@media (max-width: 1100px) {
  .intel-header .intel-mainbar {
    padding: 8px 12px;
  }

  .intel-header .macro-stats-grid {
    order: 3;
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--panel-border);
    padding: 6px 0 0;
    margin-top: 4px;
  }
}

@media (max-width: 680px) {
  .intel-header .brand-word {
    font-size: 22px;
  }

  .member-cap-pill {
    font-size: 8px;
    padding: 3px 7px;
  }

  .section-nav-inner {
    padding: 0 8px;
  }

  .section-nav .snav-link,
  .section-nav .snav-link:visited {
    padding: 7px 9px;
    font-size: 9px;
    letter-spacing: 0.07em;
  }

  .news-card[data-priority="high"] .card-headline,
  .news-card[data-priority="breaking"] .card-headline {
    font-size: 14px;
  }
}

/* ============================================================================
   MOBILE OPTIMIZATION - Enhanced breakpoints for modern phones
   ============================================================================ */

/* Small tablets and large phones (<= 768px) */
@media (max-width: 768px) {
  .dashboard-shell {
    gap: 12px;
    padding: 12px;
  }
  
  .left-rail, .right-rail {
    gap: 12px;
  }
  
  .rail-block, .rail-widget, .lane-block {
    border-radius: 10px;
  }
  
  .card-image {
    width: 80px;
    height: 56px;
  }
  
  .card-headline {
    font-size: 13px;
    line-height: 1.4;
  }
  
  .briefing-item .briefing-title {
    font-size: 13px;
  }
}

/* Standard phones (<= 480px) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  
  .intel-header .intel-mainbar {
    padding: 6px 10px;
    gap: 6px;
  }
  
  .intel-header .brand-word {
    font-size: 20px;
  }
  
  .brand-meta-row {
    font-size: 10px;
  }
  
  .top-pill {
    font-size: 9px;
    padding: 2px 6px;
  }
  
  .dashboard-shell {
    padding: 10px;
    gap: 10px;
  }
  
  .rail-label {
    padding: 8px 10px;
    font-size: 9px;
  }
  
  .news-card {
    padding: 10px;
  }
  
  .card-image {
    width: 70px;
    height: 50px;
  }
  
  .card-headline {
    font-size: 12px;
    line-height: 1.35;
  }
  
  .breaking-strip {
    font-size: 11px;
  }
  
  .briefing-item {
    padding: 10px 12px;
  }
  
  .briefing-title {
    font-size: 12px;
  }
  
  .large-tv-card, .ai-stats-card {
    height: 300px;
  }
  
  .widget-head {
    padding: 10px 12px;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .scroll-top-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
    bottom: 16px;
    right: 12px;
  }
}

/* Small phones (<= 360px) */
@media (max-width: 360px) {
  .intel-header .brand-word {
    font-size: 18px;
  }
  .intel-header .header-search {
    font-size: 16px;
  }
  
  .card-image {
    width: 60px;
    height: 44px;
  }
  
  .card-headline {
    font-size: 11px;
  }
  
  .news-card .card-meta-row {
    font-size: 9px;
  }
}

/* Touch optimization for mobile */
@media (hover: none) and (pointer: coarse) {
  .news-card:active,
  .briefing-item:active,
  .logout-btn:active,
  .search-clear:active,
  .refresh-btn:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
  
  .news-card:hover,
  .briefing-item:hover {
    transform: none;
  }
  
  .scroll-top-btn {
    bottom: 20px;
    right: 16px;
  }
}

@media (max-width: 640px) {
  .intel-search-close {
    min-height: 34px;
    padding: 6px 10px;
  }
  .rcws-tabs-row,
  .sec-tab-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rcws-tabs-row::-webkit-scrollbar,
  .sec-tab-rail::-webkit-scrollbar {
    display: none;
  }
  .rcws-tab,
  .rcws-hint,
  .rcws-compare-inline,
  .sec-tab-group,
  .sec-tab-group--range {
    flex: 0 0 auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SECURITY / RESEARCH HUB — POLISH OVERHAUL (v0.1.5)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Unified tab rail (datasets + ranges in ONE row) ───── */
.sec-tab-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--surface);
  flex-wrap: wrap;
  min-height: 40px;
}

.sec-tab-group {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.sec-tab-group--range {
  gap: 4px;
}

.sec-tab {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  height: 40px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.sec-tab:hover {
  color: var(--brand-navy);
}

.sec-tab.is-active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-red);
  font-weight: 800;
}

[data-theme="dark"] .sec-tab:hover,
[data-theme="dark"] .sec-tab.is-active {
  color: var(--brand-blue-dim);
}

.sec-range {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.sec-range:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.sec-range.is-active {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}

/* ── Widget body padding adjustment ── */
.sec-econ-widget {
  padding: 14px 16px 16px;
  gap: 12px;
}

/* ── Always-visible stat strip in workspace ── */
.rcws-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--panel-border);
}

@media (max-width: 760px) {
  .rcws-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rcws-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-right: 1px solid var(--panel-border);
  min-width: 0;
}

.rcws-stat:last-child { border-right: none; }

@media (max-width: 760px) {
  .rcws-stat:nth-child(2n) { border-right: none; }
  .rcws-stat:nth-child(1),
  .rcws-stat:nth-child(2) { border-bottom: 1px solid var(--panel-border); }
}

.rcws-stat-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.rcws-stat-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.rcws-stat-val.pos { color: #16a34a; }
.rcws-stat-val.neg { color: #dc2626; }

[data-theme="dark"] .rcws-stat-val.pos { color: #4ade80; }
[data-theme="dark"] .rcws-stat-val.neg { color: #f87171; }

.rcws-stat-meta {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── AI empty state CTA (not a fake data brief) ── */
.sec-ai-empty {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 20px 22px;
  border-radius: 10px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand-navy) 4%, var(--surface)) 0%,
    color-mix(in srgb, var(--brand-red) 3%, var(--surface)) 100%);
  border: 1px solid var(--panel-border);
}

.sec-ai-empty-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--brand-red);
  flex-shrink: 0;
}

.sec-ai-empty-body {
  flex: 1;
  min-width: 0;
}

.sec-ai-empty-body h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.005em;
}

.sec-ai-empty-body p {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.sec-ai-empty-btn {
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}

.sec-ai-empty-btn:hover {
  background: var(--brand-red);
  border-color: var(--brand-red);
  transform: translateY(-1px);
}

/* ── AI loaded state ── */
.sec-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sec-insight-ul {
  margin: 8px 0 10px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-main);
}

.sec-insight-ul li {
  margin-bottom: 4px;
}

/* ── Always-visible evidence footer ── */
.rcws-evidence-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--panel-border);
  background: var(--surface);
}

@media (max-width: 760px) {
  .rcws-evidence-foot {
    grid-template-columns: 1fr;
  }
}

.rcws-evi-col {
  padding: 10px 14px 12px;
  border-right: 1px solid var(--panel-border);
  min-width: 0;
}

.rcws-evi-col:last-child { border-right: none; }

@media (max-width: 760px) {
  .rcws-evi-col {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
  .rcws-evi-col:last-child { border-bottom: none; }
}

.rcws-evi-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rcws-evi-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rcws-evi-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.rcws-evi-year {
  color: var(--text-dim);
  font-family: var(--mono-font);
  font-size: 10.5px;
  white-space: nowrap;
}

.rcws-evi-val {
  font-weight: 700;
}

.rcws-evi-text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.rcws-evi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rcws-evi-chips span {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Cleanup: rounded corners throughout the hub ── */
.research-hub {
  border-radius: 10px;
}

.research-col-workspace {
  padding: 0;
  background: var(--surface);
}

.rcws-title-row {
  padding: 8px 14px;
  background: color-mix(in srgb, var(--brand-navy) 4%, var(--surface));
}

.rcws-body {
  padding: 14px 16px;
  gap: 12px;
  overflow-y: visible;
}

/* Tidy the macro insight grid inside the workspace */
.research-col-workspace .pjt-insight-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.research-col-workspace .pjt-insight-aside {
  padding: 12px 14px;
  border-radius: 8px;
  position: static;
  background: var(--surface-2);
}

.research-col-workspace .pjt-insight-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
}

/* ── Dense content sections (pulse + news) ── */
.rcws-section {
  border-top: 1px solid var(--panel-border);
  background: var(--surface);
}

.rcws-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px 7px;
  background: color-mix(in srgb, var(--brand-navy) 4%, var(--surface));
  border-bottom: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.rcws-section-label {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .rcws-section-label {
  color: var(--brand-blue-dim);
}

.rcws-section-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--mono-font);
  letter-spacing: 0.03em;
}

.rcws-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  animation: rcws-pulse-anim 1.8s ease-in-out infinite;
}

@keyframes rcws-pulse-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}

/* ── Cross-dataset pulse grid ── */
.rcws-pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

@media (max-width: 900px) {
  .rcws-pulse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rcws-pulse-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px 12px;
  border: none;
  border-right: 1px solid var(--panel-border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: background 0.15s;
  position: relative;
}

.rcws-pulse-card:last-child { border-right: none; }

@media (max-width: 900px) {
  .rcws-pulse-card:nth-child(2n) { border-right: none; }
  .rcws-pulse-card { border-bottom: 1px solid var(--panel-border); }
}

.rcws-pulse-card:hover {
  background: color-mix(in srgb, var(--brand-navy) 5%, var(--surface));
}

.rcws-pulse-card.is-active {
  background: color-mix(in srgb, var(--brand-red) 6%, var(--surface));
}

.rcws-pulse-card.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-red);
}

.rcws-pulse-head {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.rcws-pulse-icon {
  font-size: 10px;
  color: var(--brand-navy);
  opacity: 0.7;
}

.rcws-pulse-name {
  font-family: var(--mono-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rcws-pulse-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.rcws-pulse-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  width: 100%;
}

.rcws-pulse-year {
  color: var(--text-dim);
  font-family: var(--mono-font);
}

.rcws-pulse-delta {
  margin-left: auto;
  font-family: var(--mono-font);
  font-weight: 700;
  font-size: 9.5px;
}

.rcws-pulse-delta--up { color: #16a34a; }
.rcws-pulse-delta--down { color: #dc2626; }
.rcws-pulse-delta--flat { color: var(--text-muted); }

[data-theme="dark"] .rcws-pulse-delta--up { color: #4ade80; }
[data-theme="dark"] .rcws-pulse-delta--down { color: #f87171; }

/* ── Defense & security news feed ── */
.rcws-news-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}

.rcws-news-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--panel-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
  min-width: 0;
}

.rcws-news-item:last-child { border-bottom: none; }

.rcws-news-item:hover {
  background: color-mix(in srgb, var(--brand-navy) 4%, var(--surface));
}

.rcws-news-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono-font);
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.rcws-news-src {
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-navy);
}

[data-theme="dark"] .rcws-news-src {
  color: var(--brand-blue-dim);
}

.rcws-news-dot { opacity: 0.5; }

.rcws-news-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.rcws-news-item:hover .rcws-news-title {
  color: var(--brand-red);
}

.rcws-news-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}

/* Scrollbar styling for news list */
.rcws-news-list::-webkit-scrollbar {
  width: 6px;
}
.rcws-news-list::-webkit-scrollbar-track {
  background: transparent;
}
.rcws-news-list::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 3px;
}
.rcws-news-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════ */

/* ─── Dark mode: gap fills ────────────────────────────────────────── */

/* Pakistan map outline: light fill/stroke is invisible on dark map canvas */
[data-theme="dark"] .pk-map-outline path {
  fill: rgba(157, 210, 255, 0.09);
  stroke: rgba(157, 210, 255, 0.28);
}

/* Pakistan map node dot: dark shadow lost on dark canvas */
[data-theme="dark"] .pk-node-dot {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(157, 210, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Flight row + explain: hardcoded off-white backgrounds */
[data-theme="dark"] .pk-flight-row {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-3) 100%);
}
[data-theme="dark"] .pk-flight-explain {
  background: var(--surface-2);
}

/* badge.high: too-low opacity in dark */
[data-theme="dark"] .badge.high {
  background: rgba(239, 68, 68, 0.22);
}

/* search-clear hover: hardcoded pale-red on dark bg looks awful */
[data-theme="dark"] .search-clear:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

/* TradingView widgets: invert+hue-rotate so light-theme charts approximate
   dark mode without requiring a full widget reload */
[data-theme="dark"] .tradingview-widget-container__widget,
[data-theme="dark"] #tradingview_kse100 {
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 900px) {
  .briefpk-pulse-head {
    flex-direction: column;
    gap: 8px;
  }
  .briefpk-pulse-meta {
    text-align: left;
  }
  .briefpk-pulse-quote {
    font-size: 14px;
  }
  .briefpk-pulse-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Article Preview Drawer ───────────────────────────────────────────────── */
#article-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 95vw;
  height: 100vh;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#article-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}

.drawer-source-chip {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-blue);
  background: color-mix(in srgb, var(--brand-blue) 10%, transparent);
  border-radius: 4px;
  padding: 2px 7px;
}

.drawer-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.drawer-close-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.drawer-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-headline {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
}

.drawer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
}

.drawer-snippet {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.drawer-action-btn:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.drawer-action-btn.primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.drawer-action-btn.primary:hover {
  opacity: 0.88;
}

/* Overlay backdrop */
#article-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#article-drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  #article-drawer {
    width: 100vw;
    border-left: none;
  }
}
