:root {
  --surface-h: 228;
  --accent-h: 206;
  --accent-c: 0.07;

  --bg: oklch(14.5% 0.008 var(--surface-h));
  --bg-2: oklch(17.5% 0.009 var(--surface-h));
  --bg-3: oklch(21% 0.011 var(--surface-h));
  --bg-4: oklch(25.5% 0.013 var(--surface-h));
  --bg-5: oklch(31% 0.014 var(--surface-h));
  --nav-bg: oklch(14.5% 0.008 var(--surface-h) / 0.92);

  --text: oklch(93% 0.006 var(--surface-h));
  --text-2: oklch(81% 0.011 var(--surface-h));
  --text-3: oklch(70% 0.012 var(--surface-h));
  --text-soft: oklch(61% 0.011 var(--surface-h));
  --text-inv: oklch(18% 0.01 var(--surface-h));

  --accent: oklch(73% var(--accent-c) var(--accent-h));
  --accent-soft: oklch(73% var(--accent-c) var(--accent-h) / 0.10);
  --accent-border: oklch(73% var(--accent-c) var(--accent-h) / 0.22);

  --green: oklch(78% 0.15 157);
  --green-soft: oklch(78% 0.15 157 / 0.12);
  --amber: oklch(80% 0.12 79);
  --amber-soft: oklch(80% 0.12 79 / 0.12);
  --red: oklch(68% 0.17 24);
  --red-soft: oklch(68% 0.17 24 / 0.14);
  --blue: oklch(71% 0.10 244);
  --blue-soft: oklch(71% 0.10 244 / 0.12);

  --border: oklch(100% 0 0 / 0.08);
  --border-2: oklch(100% 0 0 / 0.14);
  --line: oklch(100% 0 0 / 0.06);
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.18);

  --display: "Chivo", "Arial Narrow", sans-serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "Courier New", monospace;

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --nav-height: 72px;
  --shell-width: 1320px;
  --content-width: 780px;
}

[data-theme="light"] {
  --bg: oklch(97.5% 0.005 var(--surface-h));
  --bg-2: oklch(99% 0.003 var(--surface-h));
  --bg-3: oklch(95.5% 0.007 var(--surface-h));
  --bg-4: oklch(91.5% 0.009 var(--surface-h));
  --bg-5: oklch(87% 0.010 var(--surface-h));
  --nav-bg: oklch(98% 0.004 var(--surface-h) / 0.92);

  --text: oklch(21% 0.011 var(--surface-h));
  --text-2: oklch(37% 0.012 var(--surface-h));
  --text-3: oklch(53% 0.010 var(--surface-h));
  --text-soft: oklch(64% 0.009 var(--surface-h));
  --text-inv: oklch(98.5% 0.003 var(--surface-h));

  --border: oklch(22% 0.011 var(--surface-h) / 0.09);
  --border-2: oklch(22% 0.011 var(--surface-h) / 0.14);
  --line: oklch(22% 0.011 var(--surface-h) / 0.07);
  --shadow: 0 12px 32px rgba(31, 36, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-2) 18%, var(--bg) 82%) 0%, var(--bg) 100%);
  color: var(--text);
  font: 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
  color: var(--text-2);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

.mono-meta,
.meta-label,
.eyebrow,
.section-kicker {
  font-family: var(--mono);
}

.shell-body {
  color-scheme: dark;
}

[data-theme="light"] .shell-body,
[data-theme="light"] body {
  color-scheme: light;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header-inner {
  width: min(calc(100% - 32px), var(--shell-width));
  margin: 0 auto;
  min-height: var(--nav-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: color-mix(in oklab, var(--bg-3) 96%, var(--bg) 4%);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand-name {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-3);
  background: color-mix(in oklab, var(--bg-3) 90%, var(--bg) 10%);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.nav-link,
.utility-link,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
}

.nav-link:hover,
.utility-link:hover,
.theme-toggle:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--bg-3) 94%, var(--bg) 6%);
}

.nav-link.active,
.utility-link.active {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in oklab, var(--bg-3) 90%, var(--bg) 10%);
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-4) 78%, var(--bg) 22%);
  color: var(--text-3);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.utility-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.utility-link-strong {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
}

.page-shell {
  width: min(calc(100% - 32px), var(--shell-width));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash-message {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
}

.flash-success {
  border-color: color-mix(in oklab, var(--green) 30%, var(--border));
  background: color-mix(in oklab, var(--green-soft) 38%, var(--bg-3) 62%);
}

.flash-error {
  border-color: color-mix(in oklab, var(--red) 30%, var(--border));
  background: color-mix(in oklab, var(--red-soft) 36%, var(--bg-3) 64%);
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 18px 0 26px;
  border-bottom: 1px solid var(--line);
}

.page-intro-copy {
  max-width: 78ch;
  display: grid;
  gap: 12px;
}

.page-intro-copy p {
  max-width: 72ch;
}

.eyebrow,
.section-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.page-intro-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.meta-pair {
  display: grid;
  gap: 4px;
  min-width: 120px;
}

.meta-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.meta-value {
  color: var(--text);
  font-size: 0.9rem;
}

.today-layout,
.digest-layout,
.watch-layout,
.archive-layout {
  display: grid;
  gap: 32px;
  padding-top: 28px;
}

.today-layout {
  grid-template-columns: minmax(0, 1.4fr) 330px;
}

.digest-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.watch-layout {
  grid-template-columns: minmax(0, 1.15fr) 340px;
}

.archive-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.today-main,
.digest-main,
.watch-main,
.archive-main {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.today-rail,
.digest-rail,
.watch-rail,
.archive-rail {
  display: grid;
  gap: 18px;
  align-self: start;
}

.lead-brief,
.flat-section,
.rail-panel,
.watch-summary-band,
.login-shell,
.panel {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.lead-brief {
  padding: 28px;
  display: grid;
  gap: 18px;
}

.lead-meta-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-title,
.digest-lead-title {
  max-width: 18ch;
}

.lead-title a,
.digest-lead-title a,
.list-row-title a {
  color: var(--text);
}

.lead-title a:hover,
.digest-lead-title a:hover,
.list-row-title a:hover {
  color: var(--accent);
}

.lead-summary,
.digest-lead-summary {
  max-width: 70ch;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.btn-primary {
  background: color-mix(in oklab, var(--accent) 22%, var(--bg-3));
  border-color: var(--accent-border);
  color: var(--text);
}

.btn-primary:hover {
  background: color-mix(in oklab, var(--accent) 28%, var(--bg-3));
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--bg-3) 90%, var(--accent) 10%);
}

.btn-block {
  width: 100%;
}

.lead-stats,
.market-strip,
.metric-stack,
.tag-list {
  display: grid;
  gap: 10px;
}

.lead-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.lead-stat {
  display: grid;
  gap: 6px;
}

.lead-stat-label,
.metric-label {
  color: var(--text-3);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-stat-value,
.metric-value {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}

.metric-value-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.flat-section {
  padding: 22px 22px;
  display: grid;
  gap: 18px;
  box-shadow: none;
}

.flat-section-tight {
  padding-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.section-header > div {
  display: grid;
  gap: 6px;
}

.section-meta,
.section-link {
  flex-shrink: 0;
}

.section-link {
  color: var(--text-2);
  font-weight: 600;
}

.section-link:hover {
  color: var(--accent);
}

.market-strip {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.market-tile {
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  display: grid;
  gap: 6px;
}

.market-tile-crypto {
  background: color-mix(in oklab, var(--bg-3) 86%, var(--accent-soft) 14%);
}

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

.market-symbol {
  color: var(--text);
  font-weight: 700;
}

.market-name {
  color: var(--text-2);
  font-size: 0.88rem;
}

.market-price {
  color: var(--text);
  font-size: 0.94rem;
}

.market-change {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-3);
}

.market-change.up {
  color: var(--green);
}

.market-change.down {
  color: var(--red);
}

.row-list,
.mini-row-list,
.timeline-list {
  display: grid;
}

.list-row,
.mini-row,
.timeline-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:first-child,
.mini-row:first-child,
.timeline-row:first-child {
  padding-top: 0;
}

.list-row:last-child,
.mini-row:last-child,
.timeline-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.list-row-spacious {
  padding-top: 18px;
  padding-bottom: 18px;
}

.list-row-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.list-row-title {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.list-row-copy {
  max-width: 78ch;
}

.list-row-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--text-3);
  font-size: 0.8rem;
  text-align: right;
}

.rail-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
  box-shadow: none;
}

.rail-panel-muted {
  background: color-mix(in oklab, var(--bg-3) 86%, var(--bg) 14%);
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rail-copy {
  color: var(--text-2);
}

.metric-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text-2);
  font-size: 0.78rem;
}

.watch-summary-band {
  margin-top: 28px;
  padding: 24px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  box-shadow: none;
}

.watch-summary-band-stable {
  background: color-mix(in oklab, var(--bg-2) 90%, var(--green-soft) 10%);
}

.watch-summary-band-elevated {
  background: color-mix(in oklab, var(--bg-2) 88%, var(--amber-soft) 12%);
}

.watch-summary-band-high {
  background: color-mix(in oklab, var(--bg-2) 86%, var(--red-soft) 14%);
}

.private-page-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0 4px;
}

.subnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-2);
}

.subnav-link:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--accent) 8%);
}

.subnav-link.active {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in oklab, var(--bg-3) 90%, var(--bg) 10%);
}

.watch-summary-copy {
  display: grid;
  gap: 10px;
}

.watch-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  align-self: start;
}

.watch-metric {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  display: grid;
  gap: 6px;
}

.watch-metric-label {
  color: var(--text-3);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.watch-metric-value {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.threat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.threat-stable {
  color: var(--green);
  background: var(--green-soft);
}

.threat-elevated {
  color: var(--amber);
  background: var(--amber-soft);
}

.threat-high {
  color: var(--red);
  background: var(--red-soft);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.evidence-block {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  display: grid;
  gap: 8px;
}

.evidence-label,
.evidence-meta {
  color: var(--text-3);
  font-size: 0.72rem;
}

.evidence-meta {
  font-family: var(--mono);
}

.timeline-row {
  grid-template-columns: 92px minmax(0, 1fr);
}

.timeline-time {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.timeline-body {
  display: grid;
  gap: 5px;
}

.timeline-title {
  color: var(--text);
  font-weight: 700;
}

.timeline-copy {
  color: var(--text-2);
}

.mini-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.digest-lead {
  display: grid;
  gap: 12px;
}

.digest-masthead,
.watch-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
}

.digest-masthead-main,
.watch-header-main {
  display: grid;
  gap: 8px;
  max-width: 72ch;
}

.digest-masthead-tools {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.digest-select-wrap {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.digest-select {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 94%, var(--bg) 6%);
  color: var(--text);
}

.digest-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0 0;
}

.digest-strip-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 95%, var(--bg) 5%);
}

.digest-strip-label {
  color: var(--text-3);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.digest-strip-value {
  color: var(--text);
  font-weight: 600;
}

.sidebar-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  padding-top: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
}

.sidebar-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-2) 92%, var(--bg) 8%);
}

.sort-controls {
  margin-bottom: 12px;
}

.sort-controls label {
  color: var(--text-3);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.sidebar-nav-item:hover {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
}

.sidebar-nav-item.active {
  color: var(--text);
  border-color: var(--border-2);
  background: color-mix(in oklab, var(--bg-3) 94%, var(--bg) 6%);
}

.article-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-4) 88%, var(--bg) 12%);
  color: var(--text-3);
  font: 0.72rem/1 var(--mono);
}

.content-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  min-width: 0;
  align-items: start;
}

.article-column {
  min-width: 0;
}

.right-rail {
  display: grid;
  gap: 16px;
}

.source-section {
  display: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in oklab, var(--bg-2) 92%, var(--bg) 8%);
  overflow: hidden;
}

.source-section.is-active {
  display: block;
}

.source-section-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
}

.source-section-header h2 {
  font-size: 0.98rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-content {
  padding: 18px;
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-3) 96%, var(--bg) 4%);
}

.article-item:hover {
  border-color: var(--border-2);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
}

.article-item h3 {
  margin: 4px 0 0;
  font: 600 1rem/1.35 var(--sans);
  letter-spacing: -0.01em;
}

.article-item h3 a {
  color: var(--text);
}

.article-item h3 a:hover {
  color: var(--accent);
}

.article-date {
  color: var(--text-3);
  font: 0.72rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.article-summary {
  margin-top: 8px;
  color: var(--text-2);
}

.panel {
  overflow: hidden;
  border-radius: 14px;
}

.panel-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font: 0.78rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-list {
  display: grid;
}

.panel-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.panel-row:first-child {
  border-top: 0;
}

.panel-row:hover {
  background: color-mix(in oklab, var(--bg-3) 95%, var(--bg) 5%);
}

.row-left {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-title {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.row-meta {
  color: var(--text-3);
  font: 0.72rem/1.5 var(--mono);
}

.row-right {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
  color: var(--text-2);
}

.row-price {
  color: var(--text);
  font-weight: 600;
}

.row-change {
  font: 0.78rem/1.4 var(--mono);
}

.row-change.neutral {
  color: var(--text-3);
}

.row-change.positive {
  color: var(--green);
}

.row-change.negative {
  color: var(--red);
}

.econ-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
}

.econ-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 96%, var(--bg) 4%);
}

.watch-header {
  padding-top: 4px;
}

.watch-header-stable {
  border-bottom-color: color-mix(in oklab, var(--green) 28%, var(--line));
}

.watch-header-elevated {
  border-bottom-color: color-mix(in oklab, var(--amber) 32%, var(--line));
}

.watch-header-high {
  border-bottom-color: color-mix(in oklab, var(--red) 34%, var(--line));
}

.watch-header-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
}

.watch-header-metric,
.watch-rail-metric {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-3) 95%, var(--bg) 5%);
  display: grid;
  gap: 4px;
}

.watch-header-label {
  color: var(--text-3);
  font: 0.7rem/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.watch-header-value {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
}

.watch-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  padding-top: 24px;
  align-items: start;
}

.watch-column,
.watch-rail-compact {
  display: grid;
  gap: 18px;
}

.watch-section,
.watch-rail-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in oklab, var(--bg-2) 92%, var(--bg) 8%);
}

.watch-section {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.watch-rail-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.watch-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.watch-section-head > div {
  display: grid;
  gap: 6px;
}

.watch-signal-list,
.watch-feed,
.watch-rail-metrics {
  display: grid;
}

.watch-signal-row,
.watch-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.watch-signal-row:first-child,
.watch-feed-row:first-child {
  padding-top: 0;
}

.watch-signal-row:last-child,
.watch-feed-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.watch-signal-main,
.watch-feed-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.watch-signal-main h3,
.watch-feed-main h3 {
  font-size: 0.98rem;
}

.watch-signal-meta,
.watch-feed-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--text-3);
  font-size: 0.76rem;
  text-align: right;
}

.feed-flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.feed-flag-alert {
  color: var(--amber);
  border-color: color-mix(in oklab, var(--amber) 30%, var(--border));
  background: color-mix(in oklab, var(--amber-soft) 32%, var(--bg-3) 68%);
}

.watch-subsection {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.watch-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.watch-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 95%, var(--bg) 5%);
  color: var(--text-2);
  font-size: 0.8rem;
}

.empty-state,
.empty-inline {
  color: var(--text-2);
}

.empty-state {
  display: grid;
  gap: 12px;
}

.empty-inline {
  padding: 12px 0 2px;
}

/* Compatibility for untouched private templates */
.section {
  display: grid;
  gap: 24px;
}

.section-head {
  display: grid;
  gap: 8px;
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--line);
}

.section-head p {
  max-width: 72ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.panel {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.private-split {
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.45fr);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  margin: 0;
}

.inline-form-inline {
  display: inline;
  margin-left: 8px;
}

.text-input,
.text-area,
.panel input,
.panel select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
}

.text-area {
  min-height: 140px;
  resize: vertical;
}

.select-input {
  max-width: 180px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
}

.mini-button:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--accent) 8%);
}

.note-preview {
  max-height: 62vh;
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 94%, var(--bg) 6%);
}

.note-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.6 var(--mono);
  color: var(--text);
}

.compact-list {
  padding-left: 18px;
  color: var(--text-2);
}

.compact-list li + li {
  margin-top: 8px;
}

/* Login */
.login-body {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  display: grid;
  gap: 14px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form input,
.login-form button {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.login-form input {
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
}

.login-form button {
  background: color-mix(in oklab, var(--accent) 24%, var(--bg-3));
  color: var(--text);
  font-weight: 700;
}

.error {
  color: var(--red);
}

@media (max-width: 1160px) {
  .site-header-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand util"
      "nav nav";
    align-items: center;
    padding: 14px 0;
  }

  .site-brand {
    grid-area: brand;
  }

  .utility-nav {
    grid-area: util;
  }

  .primary-nav {
    grid-area: nav;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .today-layout,
  .digest-layout,
  .watch-layout,
  .archive-layout,
  .sidebar-layout,
  .watch-shell,
  .content-area,
  .digest-masthead,
  .watch-header {
    grid-template-columns: 1fr;
  }

  .today-rail,
  .digest-rail,
  .watch-rail,
  .archive-rail {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .sidebar {
    position: static;
  }

  .digest-masthead-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .page-shell,
  .site-header-inner {
    width: min(calc(100% - 24px), var(--shell-width));
  }

  .page-intro,
  .watch-summary-band {
    grid-template-columns: 1fr;
  }

  .page-intro-meta {
    justify-content: flex-start;
  }

  .lead-brief,
  .flat-section,
  .rail-panel,
  .watch-summary-band,
  .panel,
  .login-shell,
  .watch-section,
  .watch-rail-panel,
  .sidebar-panel,
  .source-content,
  .source-section-header {
    padding: 20px;
  }

  .private-split {
    grid-template-columns: 1fr;
  }

  .lead-stats,
  .watch-summary-metrics,
  .watch-header-metrics {
    grid-template-columns: 1fr;
  }

  .list-row,
  .mini-row,
  .timeline-row,
  .watch-signal-row,
  .watch-feed-row {
    grid-template-columns: 1fr;
  }

  .list-row-meta,
  .watch-feed-side {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .brand-tag,
  .nav-chip {
    display: none;
  }

  .utility-nav {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-link,
  .utility-link,
  .theme-toggle {
    min-height: 36px;
    padding: 0 10px;
  }

  .market-strip,
  .evidence-grid,
  .grid,
  .today-rail,
  .digest-rail,
  .watch-rail,
  .archive-rail,
  .watch-header-metrics {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PRIVATE WORKSPACE — Vault + Research
   ═══════════════════════════════════════════════════════════════ */

:root {
  --reading: "Spectral", Georgia, serif;
}

/* ── VAULT BROWSER (index page) ──────────────────────────────────── */
.vault-browser {
  padding-top: 22px;
  display: grid;
  gap: 16px;
}

.vault-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vault-search-input {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
  font: 0.95rem/1 var(--sans);
  transition: border-color 0.14s;
  max-width: 480px;
}

.vault-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.vault-search-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 90%, var(--bg) 10%);
  color: var(--text-2);
  font: 600 0.88rem/1 var(--sans);
  transition: color 0.14s, background 0.14s;
}

.vault-search-btn:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--bg-4) 88%, var(--bg) 12%);
}

.vault-search-clear {
  font: 0.82rem/1 var(--sans);
  color: var(--text-3);
  padding: 0 6px;
  transition: color 0.14s;
}

.vault-search-clear:hover { color: var(--text-2); }

.vault-results-meta {
  font: 0.72rem/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.vault-index-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.vault-index-item {
  border-bottom: 1px solid var(--line);
}

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

.vault-index-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 13px 18px;
  color: var(--text-2);
  transition: background 0.1s, color 0.1s;
}

.vault-index-link:hover {
  background: color-mix(in oklab, var(--bg-2) 92%, var(--bg) 8%);
  color: var(--text);
}

.vault-index-title {
  font: 0.9rem/1.35 var(--sans);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-index-folder {
  font: 0.65rem/1 var(--mono);
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── TWO-COLUMN PRIVATE WORKSPACE ────────────────────────────────── */
/* Used by vault_note and research_briefings */
.private-ws,
.briefings-ws {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  margin-top: 20px;
}

.ws-sidebar,
.briefings-list-panel {
  border-right: 1px solid var(--line);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-5) transparent;
  display: grid;
  align-content: start;
}

.ws-search-form {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in oklab, var(--bg) 96%, var(--bg-2) 4%);
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

[data-theme="light"] .ws-search-form {
  background: color-mix(in oklab, var(--bg) 96%, var(--bg-3) 4%);
}

.ws-search-input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  font: 13px/1 var(--sans);
  transition: border-color 0.14s;
}

.ws-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.ws-sidebar-label,
.briefings-list-label {
  padding: 12px 14px 6px;
  font: 600 0.63rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Note list in sidebar */
.ws-note-list {
  list-style: none;
  display: grid;
}

.ws-note-link {
  display: grid;
  gap: 2px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  transition: background 0.1s, color 0.1s;
}

.ws-note-link:hover {
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
  color: var(--text);
}

.ws-note-link.is-active {
  background: color-mix(in oklab, var(--accent-soft) 55%, var(--bg-3) 45%);
  color: var(--text);
}

.ws-note-name {
  font: 0.82rem/1.35 var(--sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-note-folder-label {
  font: 0.63rem/1 var(--mono);
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* Briefings list in sidebar */
.briefings-list-item {
  display: grid;
  gap: 3px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  transition: background 0.1s, color 0.1s;
}

.briefings-list-item:hover {
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
  color: var(--text);
}

.briefings-list-item.is-active {
  background: color-mix(in oklab, var(--accent-soft) 55%, var(--bg-3) 45%);
  color: var(--text);
}

.briefings-list-topic {
  font: 0.82rem/1.35 var(--sans);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.briefings-list-date {
  font: 0.62rem/1 var(--mono);
  color: var(--text-soft);
}

/* ── WORKSPACE MAIN AREA ─────────────────────────────────────────── */
.ws-main,
.briefings-main {
  padding: 32px 44px 80px;
  min-width: 0;
}

.ws-main-inner,
.briefings-main-inner {
  max-width: 680px;
}

.ws-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font: 0.8rem/1 var(--sans);
  margin-bottom: 22px;
  transition: color 0.14s;
}

.ws-back:hover { color: var(--text-2); }

/* Note header */
.ws-note-hd {
  padding-bottom: 22px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.ws-note-title-h1 {
  font: 700 clamp(1.45rem, 2.4vw, 2.1rem)/1.15 var(--display);
  color: var(--text);
  letter-spacing: -0.035em;
}

.ws-note-filepath {
  font: 0.7rem/1 var(--mono);
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* Briefing header */
.briefing-header {
  padding-bottom: 22px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.briefing-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.briefing-meta-date {
  font: 0.7rem/1 var(--mono);
  color: var(--text-soft);
}

.briefing-title-h1 {
  font: 700 clamp(1.45rem, 2.4vw, 2.1rem)/1.15 var(--display);
  color: var(--text);
  letter-spacing: -0.035em;
}

.briefing-why {
  font: 0.86rem/1.55 var(--sans);
  color: var(--text-3);
}

/* Audio bar */
.audio-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
}

.audio-bar-label {
  font: 600 0.62rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

audio {
  flex: 1;
  height: 28px;
}

/* Placeholder when nothing selected */
.ws-placeholder,
.briefings-placeholder {
  padding: 48px 0 24px;
  display: grid;
  gap: 8px;
}

.ws-placeholder-text,
.briefings-placeholder-text {
  font: 0.88rem/1.5 var(--sans);
  color: var(--text-soft);
}

/* ── NOTE PROSE (rendered markdown) ───────────────────────────────── */
.note-prose {
  font: 1rem/1.78 var(--reading);
  color: var(--text-2);
}

.note-prose h1 {
  font: 700 1.6rem/1.2 var(--display);
  color: var(--text);
  margin: 2.2em 0 0.7em;
  letter-spacing: -0.03em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.note-prose h2 {
  font: 700 1.25rem/1.25 var(--display);
  color: var(--text);
  margin: 1.9em 0 0.6em;
  letter-spacing: -0.025em;
}

.note-prose h3 {
  font: 600 0.72rem/1 var(--mono);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1.6em 0 0.55em;
}

.note-prose h4 {
  font: 600 0.95rem/1.4 var(--sans);
  color: var(--text);
  margin: 1.4em 0 0.4em;
}

.note-prose p { margin: 0 0 1.1em; }

.note-prose ul,
.note-prose ol {
  padding-left: 1.6em;
  margin: 0 0 1.1em;
}

.note-prose li { margin-bottom: 0.35em; }

.note-prose strong { color: var(--text); font-weight: 600; }

.note-prose em { font-style: italic; }

.note-prose blockquote {
  margin: 1.4em 0;
  padding: 6px 0 6px 18px;
  border-left: 2px solid var(--border-2);
  color: var(--text-3);
  font-style: italic;
}

.note-prose code {
  font: 0.83em/1 var(--mono);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text);
}

.note-prose pre {
  background: color-mix(in oklab, var(--bg-3) 94%, var(--bg) 6%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  overflow-x: auto;
  margin: 0 0 1.2em;
}

.note-prose pre code { background: none; border: none; padding: 0; }

.note-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 0.9em;
}

.note-prose th {
  font: 600 0.67rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
}

.note-prose td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}

.note-prose tr:last-child td { border-bottom: none; }

.note-prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.note-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-border);
}

.note-prose a:hover { text-decoration-color: var(--accent); }

/* ── ASK VAULT ───────────────────────────────────────────────────── */
.ask-layout {
  max-width: 680px;
  padding-top: 24px;
  display: grid;
  gap: 24px;
}

.ask-form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  padding: 20px 22px;
  display: grid;
  gap: 12px;
}

.ask-form-kicker {
  font: 600 0.68rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ask-textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
  font: 0.95rem/1.6 var(--sans);
  resize: vertical;
  transition: border-color 0.14s;
}

.ask-textarea:focus { outline: none; border-color: var(--accent); }

.ask-result {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  overflow: hidden;
}

.ask-result-header {
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
}

.ask-result-kicker {
  font: 600 0.67rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ask-result-body {
  padding: 20px 22px;
}

.ask-sources {
  padding: 10px 22px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ask-sources-label {
  font: 600 0.63rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 4px;
}

.ask-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  font: 0.69rem/1 var(--mono);
  color: var(--text-2);
}

.ask-empty {
  padding: 24px 0 8px;
  font: 0.87rem/1.5 var(--sans);
  color: var(--text-soft);
}

/* ── STATUS CHIPS (private, distinct from .status-chip) ──────────── */
.pstatus {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font: 600 0.61rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pstatus-pending  { background: color-mix(in oklab, var(--bg-4) 88%, var(--bg) 12%); color: var(--text-3); border-color: var(--border); }
.pstatus-processing { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in oklab, var(--amber) 22%, var(--border)); }
.pstatus-complete { background: var(--green-soft); color: var(--green); border-color: color-mix(in oklab, var(--green) 20%, var(--border)); }
.pstatus-failed   { background: var(--red-soft); color: var(--red); border-color: color-mix(in oklab, var(--red) 20%, var(--border)); }

/* ── RESEARCH LAYOUT ─────────────────────────────────────────────── */
.research-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 24px;
  padding-top: 24px;
  align-items: start;
}

.research-main {
  display: grid;
  gap: 20px;
}

.research-rail {
  display: grid;
  gap: 16px;
  position: sticky;
  top: calc(var(--nav-height) + 18px);
}

/* Current topic / status card */
.research-status-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  padding: 20px 22px;
  display: grid;
  gap: 12px;
}

.research-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.research-topic-name {
  font: 700 1.05rem/1.3 var(--display);
  color: var(--text);
  letter-spacing: -0.02em;
  flex: 1;
}

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

.status-dot.pending  { background: var(--text-soft); }
.status-dot.processing { background: var(--amber); animation: pulse-research 1.4s ease-in-out infinite; }
.status-dot.complete { background: var(--green); }
.status-dot.failed   { background: var(--red); }

@keyframes pulse-research {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.research-status-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.research-meta-item {
  font: 0.7rem/1 var(--mono);
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.research-topic-why {
  font: 0.85rem/1.58 var(--sans);
  color: var(--text-3);
}

.research-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* Briefing list (in research overview + elsewhere) */
.briefing-list {
  display: grid;
}

.briefing-list-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.briefing-list-item:first-child { padding-top: 0; }
.briefing-list-item:last-child  { border-bottom: none; padding-bottom: 0; }

.briefing-list-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  align-self: center;
}

.briefing-list-title {
  font: 0.87rem/1.4 var(--sans);
  color: var(--text-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.1s;
}

.briefing-list-title:hover { color: var(--text); }

.briefing-list-date {
  font: 0.64rem/1 var(--mono);
  color: var(--text-soft);
  white-space: nowrap;
}

/* Section card (reusable panel for research pages) */
.research-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  overflow: hidden;
}

.research-card-header {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.research-card-kicker {
  font: 600 0.68rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.research-card-link {
  font: 600 0.72rem/1 var(--sans);
  color: var(--text-2);
  transition: color 0.14s;
}

.research-card-link:hover { color: var(--text); }

.research-card-body {
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}

/* ── QUEUE ITEMS ─────────────────────────────────────────────────── */
.queue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.queue-row:last-child { border-bottom: none; padding-bottom: 0; }

.queue-row-topic {
  font: 0.87rem/1.35 var(--sans);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-row-topic a { color: inherit; }
.queue-row-topic a:hover { color: var(--accent); }

.queue-row-deliv {
  font: 0.62rem/1 var(--mono);
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── GAP CARDS ───────────────────────────────────────────────────── */
.gap-list {
  display: grid;
  gap: 12px;
  padding-top: 24px;
}

.gap-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  padding: 18px 20px;
  display: grid;
  gap: 8px;
}

.gap-entry-title {
  font: 700 1rem/1.3 var(--display);
  color: var(--text);
  letter-spacing: -0.02em;
}

.gap-entry-why {
  font: 0.9rem/1.65 var(--sans);
  color: var(--text-2);
}

.gap-entry-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.gap-entry-suggestion-label {
  font: 600 0.62rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  flex-shrink: 0;
}

.gap-entry-suggestion-topic {
  font: 0.82rem/1 var(--sans);
  color: var(--text-2);
}

/* ── TOOL PAGES (brainstorm, synthesis, serendipity) ─────────────── */
.tool-layout {
  max-width: 720px;
  padding-top: 24px;
  display: grid;
  gap: 22px;
}

.tool-form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

.tool-form-kicker {
  font: 600 0.67rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.tool-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  color: var(--text);
  font: 0.95rem/1.6 var(--sans);
  resize: vertical;
  transition: border-color 0.14s;
}

.tool-textarea:focus { outline: none; border-color: var(--accent); }

.tool-result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--bg-2) 88%, var(--bg) 12%);
  overflow: hidden;
}

.tool-result-header {
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg-3) 88%, var(--bg) 12%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-result-kicker {
  font: 600 0.67rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.tool-result-body {
  padding: 20px 22px;
}

.tool-result-sources {
  padding: 10px 22px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tool-sources-label {
  font: 600 0.62rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 4px;
}

.tool-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  font: 0.68rem/1 var(--mono);
  color: var(--text-2);
}

/* Serendipity note chips */
.serendipity-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.serendipity-chip {
  font: 0.7rem/1 var(--mono);
  color: var(--text-2);
  background: color-mix(in oklab, var(--bg-3) 92%, var(--bg) 8%);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── QUEUE PAGE FULL LAYOUT ─────────────────────────────────────── */
.queue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 24px;
  padding-top: 24px;
  align-items: start;
}

.queue-main {
  display: grid;
  gap: 20px;
}

.queue-rail {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
  display: grid;
  gap: 16px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .private-ws,
  .briefings-ws {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .private-ws,
  .briefings-ws {
    grid-template-columns: 1fr;
  }

  .ws-sidebar,
  .briefings-list-panel {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 220px;
  }

  .ws-main,
  .briefings-main {
    padding: 24px 20px 48px;
  }

  .research-layout,
  .queue-layout {
    grid-template-columns: 1fr;
  }

  .research-rail,
  .queue-rail {
    position: static;
  }
}

@media (max-width: 680px) {
  .vault-search-input { max-width: 100%; }

  .ws-main,
  .briefings-main {
    padding: 20px 16px 48px;
  }

  .tool-layout {
    max-width: 100%;
  }
}
