:root {
  --ink: #20242d;
  --muted: #667085;
  --line: #d9dee8;
  --paper: #f5f6f8;
  --white: #fff;
  --accent: #0f766e;
  --accent-soft: #d9f1ed;
  --red: #c2410c;
  --shadow: 0 18px 55px rgba(22, 32, 44, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.topbar,
main {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name,
.brand-sub {
  display: block;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-sub {
  color: var(--muted);
  font-size: .76rem;
}

.topnav {
  display: flex;
  gap: 10px;
}

.topnav a,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: end;
  padding: 52px 0 30px;
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4.8vw, 5rem);
  line-height: 1.03;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-text {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

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

.stat {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.stat-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: .86rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.search-field,
.select-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 36px 0 12px;
}

.section {
  padding: 46px 0 8px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.article-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.article-card:hover {
  border-color: rgba(15, 118, 110, .45);
}

.article-card--weekly {
  border-top: 4px solid var(--accent);
}

.card-top,
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .82rem;
}

.category,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #115e59;
  font-weight: 800;
}

.article-card h3 {
  margin: 26px 0 12px;
  font-size: 1.32rem;
  line-height: 1.28;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.article-type,
.highlight-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}

.article-type {
  background: var(--ink);
  color: var(--white);
}

.highlight-count {
  background: #fff4e8;
  color: var(--red);
}

.article-card p {
  color: var(--muted);
}

.score {
  margin-top: auto;
  color: var(--red);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef1f5;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.signal-title {
  font-weight: 800;
}

.signal-title a {
  text-decoration-color: rgba(15, 118, 110, .35);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.article-page {
  width: 100%;
  max-width: 820px;
  padding: 42px 0 80px;
}

.article-page h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.article-toc {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.article-toc h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.article-toc ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.article-toc a {
  color: var(--muted);
  text-decoration-color: rgba(15, 118, 110, .35);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.toc-level-3 {
  margin-left: 18px;
  font-size: .92rem;
}

.article-body {
  margin-top: 34px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.article-body h2 {
  margin: 32px 0 12px;
  font-size: 1.35rem;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  margin: 24px 0 10px;
  font-size: 1.08rem;
}

.article-body li + li {
  margin-top: 8px;
}

.source-list {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.source-list h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

@media (max-width: 760px) {
  .topbar,
  main {
    width: calc(100% - 28px);
    max-width: 1180px;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  h1 {
    font-size: 2.1rem;
    line-height: 1.12;
    word-break: break-all;
  }

  .hero-text {
    word-break: break-all;
  }

  .stats,
  .toolbar,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .stat {
    min-height: 96px;
  }

  .article-card {
    min-height: 240px;
  }

  .article-page h1 {
    max-width: 11em;
    font-size: 2rem;
    line-height: 1.15;
    line-break: strict;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .article-toc,
  .article-body {
    width: calc(100vw - 28px);
    max-width: 100%;
    padding: 24px 20px;
  }

  .article-body,
  .article-body p,
  .article-body li {
    line-break: anywhere;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
}
