:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --border: #d9dee7;
  --text: #121417;
  --muted: #626a75;
  --subtle: #8a929e;
  --accent: #1d4ed8;
  --accent-soft: #eaf1ff;
  --good: #0f766e;
  --bad: #b42318;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a21;
  --surface-alt: #202631;
  --topbar-bg: rgba(23, 26, 33, 0.92);
  --border: #2a303a;
  --text: #f4f6f8;
  --muted: #a8b0bc;
  --subtle: #77808e;
  --accent: #60a5fa;
  --accent-soft: #14233a;
  --good: #34d399;
  --bad: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}
.updated {
  color: var(--muted);
  font-size: 13px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.theme-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 5px 10px;
}
.theme-button:hover {
  background: var(--surface-alt);
}
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 40px;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.archive {
  position: sticky;
  top: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.archive h2 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 145px);
  overflow-y: auto;
}
.archive-link {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text);
}
.archive-link:hover {
  background: var(--surface-alt);
  text-decoration: none;
}
.archive-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.archive-title {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.archive-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}
.brief-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.brief-hero {
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 7px 0 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}
.meta-row, .stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge, .stat {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.stat-row {
  margin-top: 18px;
}
.stat {
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text);
}
.stat strong {
  margin-right: 6px;
  color: var(--good);
}
.stat.bad strong { color: var(--bad); }
.media-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.media-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 650;
  background: var(--surface);
}
.media-links audio {
  width: min(100%, 340px);
  height: 34px;
}
.brief-body {
  padding: 26px 32px 34px;
}
.brief-content {
  max-width: 780px;
}
.brief-content h1, .brief-content h2, .brief-content h3 {
  line-height: 1.25;
  letter-spacing: 0;
  margin: 1.35em 0 0.55em;
}
.brief-content h1:first-child,
.brief-content h2:first-child,
.brief-content h3:first-child {
  margin-top: 0;
}
.brief-content h1 { font-size: 26px; }
.brief-content h2 { font-size: 21px; }
.brief-content h3 { font-size: 17px; }
.brief-content p { margin: 0.75em 0; }
.brief-content ul, .brief-content ol { padding-left: 1.35rem; }
.brief-content li + li { margin-top: 0.35em; }
.brief-content blockquote {
  border-left: 3px solid var(--border);
  margin-left: 0;
  padding-left: 16px;
  color: var(--muted);
}
.brief-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}
.brief-content th, .brief-content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.brief-content th { background: var(--surface-alt); }
.brief-content code {
  background: var(--surface-alt);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.92em;
}
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 32px;
  color: var(--subtle);
  font-size: 12px;
}
@media (max-width: 860px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .topbar-actions {
    justify-content: flex-start;
  }
  .shell {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }
  .archive {
    position: static;
  }
  .archive-list {
    max-height: 260px;
  }
  .brief-hero, .brief-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}
