:root {
  color-scheme: dark;
  --bg: #070d1f;
  --surface-low: #09122b;
  --surface: #0a1839;
  --surface-high: #0b1d48;
  --surface-bright: #082768;
  --surface-variant: #0a2257;
  --text: #dfe4ff;
  --muted: #96a9e6;
  --outline: rgba(50, 69, 124, 0.16);
  --outline-strong: rgba(50, 69, 124, 0.4);
  --primary: #7bd0ff;
  --primary-deep: #004c69;
  --tertiary: #919bff;
  --secondary: #909fb4;
  --green: #43b27a;
  --danger: #ee7d77;
  --gold: #a7a65e;
  --shadow: 0 24px 48px rgba(123, 208, 255, 0.06);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --space-2: 0.45rem;
  --space-3: 0.7rem;
  --space-4: 0.95rem;
  --space-5: 1.15rem;
  --space-6: 1.3rem;
  --space-8: 1.8rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at top left, rgba(123, 208, 255, 0.06), transparent 22%),
    radial-gradient(circle at top right, rgba(145, 155, 255, 0.06), transparent 18%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

a, button, input { font: inherit; }
button { cursor: pointer; }

.dashboard-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 14px;
  min-height: 100vh;
}

.sidebar,
.main-content {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel-surface {
  background: linear-gradient(180deg, rgba(13, 22, 46, 0.98), rgba(10, 18, 39, 0.98));
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.sidebar-brand,
.side-block,
.hero-panel,
.scope-panel,
.signals-panel,
.content-section {
  padding: 14px;
}

.sidebar-brand {
  background:
    radial-gradient(circle at top left, rgba(145, 155, 255, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(17, 28, 58, 0.98), rgba(9, 18, 43, 0.98));
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--muted);
}

.sidebar-brand h2,
.hero-main h1,
.section-header h3,
.section-title-row h3 {
  margin: 0;
  font-family: Manrope, sans-serif;
}
.sidebar-brand h2 {
  font-size: 1.6rem;
  line-height: 1.02;
}
.sidebar-copy,
.hero-copy,
.hero-meta,
.section-subtitle,
.empty,
.muted,
.history-button span,
.priority-item b,
.reason,
.video-flag,
.source,
.score-meter span {
  color: var(--muted);
}
.sidebar-copy,
.hero-copy,
.hero-meta,
.section-subtitle {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.history-list,
.priority-stack,
.card-stack,
.video-grid {
  display: grid;
  gap: 10px;
}

.history-button {
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: rgba(16, 34, 57, 0.9);
  color: var(--text);
  transition: background 0.18s ease, transform 0.18s ease;
}
.history-button:hover,
.history-button.active {
  background: linear-gradient(135deg, rgba(34, 78, 87, 0.9), rgba(28, 78, 54, 0.88));
}
.history-button strong {
  display: block;
  font-size: 0.82rem;
}
.history-button span {
  margin-top: 0.3rem;
  display: block;
  font-size: 0.68rem;
}

.priority-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(16, 25, 50, 0.9);
}
.priority-item span { font-size: 0.72rem; font-weight: 800; }
.priority-item b { font-size: 0.66rem; }
.priority-critical span { color: var(--text); }
.priority-review span { color: var(--text); }
.priority-watch span { color: var(--text); }
.priority-low span { color: var(--text); }

.main-content {
  display: grid;
  align-content: start;
  gap: 14px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 18px;
  align-items: stretch;
}
.hero-main {
  min-width: 0;
}
.hero-main h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.03;
  max-width: 760px;
}
.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}
.hero-stat {
  padding: 12px;
  border-radius: 12px;
  min-height: 88px;
}
.hero-stat span {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: rgba(223, 228, 255, 0.72);
  margin-bottom: 0.45rem;
}
.hero-stat strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
}
.stat-lilac { background: linear-gradient(180deg, rgba(80, 74, 142, 0.6), rgba(32, 38, 73, 0.9)); }
.stat-green { background: linear-gradient(180deg, rgba(37, 94, 77, 0.7), rgba(25, 67, 50, 0.92)); }
.stat-gold { background: linear-gradient(180deg, rgba(112, 112, 67, 0.56), rgba(53, 54, 39, 0.92)); }

.scope-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.scope-panel h3,
.section-header h3,
.section-title-row h3 {
  font-size: 1rem;
}
.scope-panel h3 { margin: 0; font-family: Manrope, sans-serif; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(16, 34, 57, 0.88);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}
.filter-chip:hover,
.filter-chip.active {
  background: rgba(35, 86, 76, 0.94);
  color: var(--text);
}
.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
}

.signals-panel,
.content-section {
  background: linear-gradient(180deg, rgba(13, 22, 46, 0.98), rgba(12, 20, 42, 0.98));
}
.section-header,
.section-title-row {
  margin-bottom: 12px;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.card-stack.rows,
.video-grid {
  grid-template-columns: 1fr;
}

.brief-card,
.signal-chip {
  background: linear-gradient(180deg, rgba(18, 31, 58, 0.96), rgba(16, 25, 48, 0.98));
  border-radius: 12px;
  padding: 12px;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  box-shadow: inset 0 0 0 1px rgba(50, 69, 124, 0.14);
}
.brief-card:hover,
.signal-chip:hover {
  background: linear-gradient(180deg, rgba(18, 43, 80, 0.98), rgba(18, 31, 58, 0.98));
  box-shadow: inset 0 0 0 1px rgba(50, 69, 124, 0.34), 0 12px 24px rgba(123, 208, 255, 0.04);
  transform: translateY(-1px);
}

.compact-topline,
.signal-chip .meta,
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.topline-left {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pill.automation, .pill.ai-dev { background: rgba(145, 155, 255, 0.15); color: #aeb5ff; }
.pill.ai { background: rgba(123, 208, 255, 0.14); color: var(--primary); }
.pill.macro { background: rgba(123, 208, 255, 0.1); color: #93d0cb; }
.pill.cybersecurity { background: rgba(238, 125, 119, 0.12); color: var(--danger); }
.pill.crypto { background: rgba(140, 220, 186, 0.14); color: #8fd7c0; }
.pill.watch { background: rgba(123, 208, 255, 0.14); color: var(--primary); }
.pill.skim { background: rgba(145, 155, 255, 0.14); color: var(--tertiary); }
.pill.skip { background: rgba(238, 125, 119, 0.14); color: var(--danger); }

.source {
  font-size: 0.62rem;
}
.title {
  margin: 10px 0 8px;
  font-size: 1rem;
  line-height: 1.28;
}
.summary,
.signal-chip .summary {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(223, 228, 255, 0.78);
}
.score-badge {
  font-size: 0.9rem;
  font-weight: 800;
  color: #9be2a5;
  white-space: nowrap;
}
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.score-meter {
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(66, 110, 98, 0.16);
}
.score-meter strong {
  display: block;
  margin-top: 3px;
  font-size: 0.88rem;
}
.card-footer {
  margin-top: 10px;
}
.reason {
  max-width: 72%;
  font-size: 0.68rem;
}
.cta {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 700;
}
.video-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.video-flag {
  font-size: 0.62rem;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.signal-chip .meta {
  margin-bottom: 8px;
}
.signal-chip .meta span:first-child {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7ccba8;
  font-weight: 800;
}
.signal-chip .meta span:last-child {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.signal-chip a {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.24;
  margin-bottom: 8px;
}
.signal-chip .score-grid {
  margin-top: 10px;
}
.signal-chip .score-meter {
  background: rgba(84, 126, 110, 0.16);
}
.signal-chip .footer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--muted);
}

.empty {
  padding: 8px 0;
  font-size: 0.82rem;
}
.is-hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(50, 69, 124, 0.7); border-radius: 999px; }

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

  .hero-panel,
  .scope-panel {
    grid-template-columns: 1fr;
  }

  .hero-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    padding: 10px;
    gap: 10px;
  }
  .hero-stat-grid,
  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-bar {
    justify-content: flex-start;
  }
}
