:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #191b1f;
  --muted: #626a73;
  --line: #d9d6cc;
  --soft: #ece8de;
  --accent: #116466;
  --high: #b63d2b;
  --medium: #2563a9;
  --low: #6b7280;
  --shadow: 0 16px 40px rgba(25, 27, 31, 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-wrap: break-word;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 245, 241, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; }

.nav { display: flex; gap: 6px; }

.nav a,
.action,
.filter-button,
.global-search button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 12px;
}

.nav a:hover,
.action:hover,
.filter-button:hover,
.filter-button.active,
.global-search button:hover { border-color: var(--ink); }

.global-search {
  display: grid;
  width: min(360px, 34vw);
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.global-search input,
.search-row input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: end;
  padding: 42px 0 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: 0; }
h1 { font-size: clamp(32px, 5vw, 58px); max-width: 960px; }
h2 { font-size: clamp(24px, 4vw, 38px); }
h3 { font-size: 19px; }
h1, h2, h3, p, li, a, span { overflow-wrap: anywhere; }

.deck { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 19px; }
.hero-meta { display: grid; gap: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric { min-height: 88px; padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.metric b { display: block; font-size: 28px; }
.metric span { color: var(--muted); font-size: 13px; }

.section { padding: 34px 0; border-bottom: 1px solid var(--line); }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.brief-main { min-width: 0; }
.sidebar { position: sticky; top: 88px; display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.sidebar h2 { font-size: 18px; }
.sidebar-list { display: grid; gap: 8px; }
.tag-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); color: var(--ink); padding: 8px 0; text-decoration: none; }
.tag-link small { color: var(--muted); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-note { max-width: 520px; color: var(--muted); font-size: 14px; }
.summary-text { max-width: 920px; margin: 0; font-size: 19px; }
.focus-list, .source-list, .topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; padding: 6px 9px; text-decoration: none; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.topic-card, .item-card, .archive-row, .source-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.topic-card { min-height: 210px; padding: 18px; }
.rank { color: var(--muted); font-size: 13px; font-weight: 800; }
.badge { display: inline-flex; align-items: center; border: 1px solid currentColor; font-size: 12px; font-weight: 800; line-height: 1; padding: 5px 7px; }
.badge.high { color: var(--high); }
.badge.medium { color: var(--medium); }
.badge.low { color: var(--low); }
.topic-card p, .item-card p, .archive-row p { color: var(--muted); }

.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.category-tabs .filter-button { max-width: 260px; flex: 0 0 auto; scroll-snap-align: start; white-space: normal; }
.category-panel { margin-top: 18px; }
.item-list { display: grid; gap: 14px; }
.item-card { padding: 18px; }
.item-card:target, .item-card.highlighted { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(17, 100, 102, 0.18), var(--shadow); }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 13px; }
.facts { margin: 12px 0 0; padding-left: 20px; }
.related-items { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.related-items strong { display: block; margin-bottom: 6px; }
.related-link { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; border: 1px solid var(--line); color: var(--ink); padding: 8px; text-decoration: none; }
.related-link span { color: var(--muted); font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-box { margin-top: 12px; padding: 12px; background: var(--soft); }
.detail-box strong { display: block; margin-bottom: 4px; }
.archive-list, .source-grid { display: grid; gap: 12px; }
.archive-row, .source-card { display: block; padding: 16px; text-decoration: none; }
.archive-row { color: inherit; }
.archive-links { display: grid; gap: 8px; margin-top: 14px; }
.archive-link { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--ink); padding-top: 8px; text-decoration: none; }
.archive-link span { color: var(--muted); font-size: 13px; }
.source-card p { margin-bottom: 0; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 18px 0; }
.error, .loading { border: 1px solid var(--line); background: var(--surface); padding: 24px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 22px clamp(18px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .hero, .two-col, .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav, .nav a, .global-search { width: 100%; }
  .topic-grid, .metric-grid, .search-row { grid-template-columns: 1fr; }
  .section-head, .item-top, .site-footer { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 36px; }
}
