:root {
  --bg: #f6f1e8;
  --bg-accent: #efe6d6;
  --paper: #fffdf8;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #d9d0c0;
  --accent: #245c55;
  --accent-soft: #d8ece7;
  --warn-bg: #fff4e5;
  --warn-ink: #6a3d00;
  --warn-line: #e8c48a;
  --covid: #b85c38;
  --other: #3a6d8c;
  --rollout: rgba(184, 140, 60, 0.18);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(40, 28, 12, 0.06);
  --font: "Noto Sans", "Liberation Sans", "DejaVu Sans", "Segoe UI", "Helvetica Neue",
    "Helvetica", "Arial", "Noto Sans CJK HK", "Noto Sans CJK TC", "Noto Sans TC",
    "PingFang HK", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK SC",
    "PingFang SC", "Source Han Sans HC", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fdecd3 0%, transparent 50%),
    var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--paper);
  padding: 8px 12px;
  z-index: 20;
  border-radius: 8px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.4rem 1.2rem 0.4rem;
}
.eyebrow {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}
h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.25;
  font-weight: 700;
}
.lang-switch {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow);
}
.lang-btn {
  border: 0;
  background: transparent;
  min-width: 2.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
}
.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}
main, footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
}
.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: none;
  margin: 0.6rem 0 1rem;
}
.disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.disclaimer a { color: inherit; }
.chart-panel, .search-panel, .about {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}
.chart-head, .search-form {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}
.chart-sub, .tips, .footnote, .chart-scope, .status, .meta, footer {
  color: var(--muted);
  font-size: 0.92rem;
}
.chart-wrap {
  position: relative;
  margin-top: 0.6rem;
  height: 280px;
  min-height: 220px;
}
.empty {
  margin: 2rem 0;
  text-align: center;
  color: var(--muted);
}
.search-form { display: block; }
.qbox input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  margin: 0.6rem 0 0.7rem;
}
.qbox input:focus, select:focus, .field input:focus, .btn:focus-visible, .lang-btn:focus-visible {
  outline: 3px solid #9ad4cb;
  outline-offset: 1px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  align-items: center;
}
.chip, .field {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-accent);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.92rem;
}
.field input, .field select {
  font: inherit;
  border: 0;
  background: #fff;
  border-radius: 8px;
  padding: 0.15rem 0.3rem;
}
.btn {
  font: inherit;
  font-weight: 650;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn:disabled { opacity: 0.6; cursor: default; }
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  align-items: center;
  flex: 1 1 auto;
}
.filter-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  margin-right: 0.15rem;
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.7rem;
}
.results-toolbar .status { margin: 0; flex: 1 1 auto; }
.status[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.4em;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
}
@keyframes spin { to { transform: rotate(360deg); } }
.search-panel.is-loading .card { opacity: 0.72; }
.results { display: grid; gap: 0.8rem; margin-top: 0.8rem; }
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: #fff;
}
.card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.date { font-weight: 650; }
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 650;
}
.badge.warn { background: #fde3d8; color: #8a3b1c; }
.badge.soft { background: var(--bg-accent); color: var(--muted); }
.snippet { margin: 0.2rem 0; }
.snippet mark { background: #ffe08a; padding: 0 0.1em; }
.meta { margin: 0.3rem 0 0.5rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linkish {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.linkish:hover { text-decoration: underline; }
.more-wrap { text-align: center; margin: 1rem 0 0.2rem; }
.about-body p { margin: 0.5rem 0; }
.about-body a { color: var(--accent); }
footer { padding-bottom: 3rem; }
footer.site-footer {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
footer.site-footer p {
  margin: 0 0 0.7rem;
  max-width: 100%;
}
footer.site-footer p:last-child { margin-bottom: 0; }


/* Report dialog */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 21, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem 2rem;
  overflow: auto;
  z-index: 30;
}
.dialog {
  background: var(--paper);
  width: min(860px, 100%);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(28, 25, 21, 0.2);
  padding: 1.2rem 1.2rem 1.5rem;
}
.dialog h2 { margin-top: 0.2rem; }
.dialog-close {
  float: right;
  border: 0;
  background: var(--bg-accent);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  font: inherit;
}
.narrative, .translation {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  margin: 0.4rem 0 0.8rem;
}
.translation { background: #f3faf8; }
.notice {
  background: var(--warn-bg);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  color: var(--warn-ink);
  font-size: 0.92rem;
}
.vax-table-wrap { overflow-x: auto; margin: 0.6rem 0 1rem; }
.vax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.vax-table th, .vax-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.vax-table th {
  font-weight: 650;
  color: var(--muted);
  font-size: 0.8rem;
}
.vax-table td.lot { font-variant-numeric: tabular-nums; word-break: break-all; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; }
  .lang-switch { align-self: flex-start; }
  .chart-wrap { height: 220px; min-height: 180px; }
  .filters { gap: 0.55rem 0.5rem; }
  .chip, .field {
    font-size: 0.9rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.75rem;
  }
  .field {
    flex: 1 1 100%;
    justify-content: space-between;
    border-radius: 12px;
  }
  .field input, .field select { min-width: 0; flex: 1; }
  .field input[type="date"] { min-width: 9rem; }
  .qbox input[type="search"] { font-size: 16px; }
  .filter-actions { width: 100%; }
  .filter-actions .btn[type="submit"] { flex: 1; min-height: 2.7rem; }
  .results-toolbar { flex-direction: column; align-items: stretch; }
  .card-top { gap: 0.3rem; }
  .dialog { padding: 1rem; border-radius: 16px; }
  .overlay { padding: 2vh 0.5rem 1rem; }
  .vax-table { min-width: 28rem; }
}

/* Site navigation across VAERS, literature, and studies pages */
.top {
  flex-wrap: wrap;
  align-items: flex-end;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.2rem;
  align-items: center;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.site-nav a:hover { background: var(--accent-soft); }
.site-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--muted);
  margin-right: 0.25rem;
}
.badge.preprint { background: #fff4e5; color: var(--warn-ink); }
.badge.pdf, .badge.journal { background: var(--accent-soft); color: var(--accent); }
.lit-card h3, .study-card > h3 { margin: 0.2rem 0 0.35rem; font-size: 1.08rem; line-height: 1.35; }
.lit-card .meta, .study-card .meta, .citation { color: var(--muted); font-size: 0.92rem; margin: 0.15rem 0; }
.lit-card .cats, .study-card .cats { font-size: 0.85rem; color: var(--accent); margin: 0.2rem 0 0.4rem; }
.lit-card .snippet { margin: 0.3rem 0 0.5rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.btn.small { padding: 0.28rem 0.7rem; font-size: 0.85rem; min-height: 2rem; border-radius: 999px; }
mark { background: #f6e3a1; padding: 0 0.1em; }
.muted { color: var(--muted); }

.study-section { margin: 2rem 0 2.5rem; }
.section-intro { max-width: none; }
.study-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem 1.4rem;
  margin: 1.1rem 0 1.6rem;
}
.study-card .summary { margin: 0.8rem 0 1rem; }
.study-card h3 { margin: 1rem 0 0.35rem; font-size: 1.05rem; }
.official-links { font-size: 0.92rem; }
.official-links a { color: var(--accent); }
.finding-list { margin: 0.3rem 0 0.8rem; padding-left: 1.15rem; }
.finding-list li { margin: 0.45rem 0; }
.finding-list p { margin: 0; }
.src-line { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem !important; }
.study-chart { margin: 1.2rem 0 0.4rem; }
.study-chart-wrap { height: 260px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem; }
.study-chart figcaption { margin-top: 0.5rem; }

@media (max-width: 800px) {
  .site-nav { width: 100%; order: 3; }
  .lang-switch { margin-left: auto; }
}
@media (max-width: 640px) {
  .study-chart-wrap { height: 280px; }
  .card-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Grouped nav, mission, official sources, extra charts, inserts/flu/donate */
.site-nav {
  gap: 0.85rem 1.2rem;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-group-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}
.nav-group.secondary .nav-group-links a {
  font-weight: 560;
  font-size: 0.86rem;
  color: var(--muted);
}
.nav-group.secondary a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}
.nav-group-links { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.mission {
  max-width: 1080px;
  margin: 0.4rem auto 0.2rem;
  padding: 0.65rem 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.mission-line { margin: 0 0 0.4rem; }
.mission-line:last-child { margin-bottom: 0; }
.mission strong { color: var(--accent); margin-right: 0.35rem; }
.covid-kicker {
  margin: 0.4rem 0 1rem;
  max-width: none;
}
.covid-kicker h2 { margin-bottom: 0.25rem; }
.chart-wrap.tall { height: 360px; }
.chart-wrap.hk { height: 460px; }
.table-toggle { margin-top: 0.4rem; }
.data-table-wrap { overflow: auto; margin-top: 0.6rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 0.25rem 0.4rem; text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tr[aria-selected="true"], .data-table tbody tr:hover { background: var(--accent-soft); }
.official-sources {
  background: var(--bg-accent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin: 0.6rem 0;
  font-size: 0.9rem;
}
.official-sources-label { margin: 0 0 0.25rem; font-weight: 700; }
.official-sources ul { margin: 0.15rem 0 0.4rem; padding-left: 1.1rem; }
.official-sources a { color: var(--accent); }
.official-id-note, .official-local-note, .search-official-note {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.search-official-note { margin: 0.5rem 0 0; }
.donate-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  box-shadow: var(--shadow);
  max-width: 40rem;
}
.donate-card .btn { display: inline-block; text-decoration: none; margin: 0.8rem 0 0.4rem; }
.insert-list { display: grid; gap: 0.7rem; }
.insert-card { cursor: pointer; }
.insert-card h3 { margin: 0.2rem 0; font-size: 1.02rem; }
.section-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0 1rem; }
.section-nav a { font-size: 0.85rem; color: var(--accent); }
.label-en, .label-zh { white-space: pre-wrap; line-height: 1.5; }
.label-zh { background: #f7fbf9; border-left: 3px solid var(--accent); padding: 0.8rem 0.9rem; border-radius: 0 10px 10px 0; margin-top: 0.6rem; }
.translate-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  margin: 0.6rem 0;
}
.baseline-caption { font-weight: 650; }
@media (max-width: 800px) {
  .chart-wrap.hk { height: 520px; }
  .mission { padding-left: 1.2rem; padding-right: 1.2rem; }
}

.translate-box { margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid rgba(28,25,21,0.12); }
.translate-warn, .licence-note { background: #fff6e8; border-left: 3px solid #b85c38; padding: 0.5rem 0.7rem; margin: 0.6rem 0; }
.label-en, .label-zh { white-space: pre-wrap; font-size: 0.95rem; line-height: 1.5; }
.label-zh { margin-top: 0.4rem; }
.section-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin: 0.6rem 0 1rem; font-size: 0.9rem; }


/* ===== Site chrome, mobile layout, What’s next? (shared across pages) ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
input, select, textarea {
  font-size: 16px;
  max-width: 100%;
}
.field input, .field select, .qbox input[type="search"], input[type="date"], input[type="search"] {
  font-size: 16px;
}

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.2rem 0.35rem;
}
.brand { min-width: 0; grid-column: 1; grid-row: 1; }
.brand-link {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.site-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 11px;
  display: block;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(36, 92, 85, 0.08);
}
.brand-text { min-width: 0; }
.brand-text .eyebrow {
  display: block;
  margin: 0;
}
.site-title, h1.site-title {
  margin: 0.12rem 0 0;
  font-size: clamp(1.05rem, 2.5vw, 1.5rem);
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: normal;
}
.site-tagline {
  display: block;
  margin: 0.22rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: break-word;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.site-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  width: 100%;
  order: unset;
  align-items: flex-start;
}
.nav-group-links a {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
}
.page-title {
  margin: 0.85rem 0 0.35rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mission { overflow-wrap: break-word; }

.chart-panel, .search-panel, .about, .study-card, .content-card {
  max-width: 100%;
}
.chart-wrap, .study-chart-wrap, .chart-panel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chart-wrap canvas, .study-chart-wrap canvas {
  max-width: 100%;
}

.content-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.3rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
  max-width: 46rem;
}
.content-card h2 { margin: 0 0 0.45rem; }
.content-card .btn { display: inline-block; text-decoration: none; margin: 0.7rem 0 0.35rem; }
.content-card .footnote { margin: 0.35rem 0 0; }
#copy-status { min-height: 1.3em; }

.civic-place {
  margin: 1.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.civic-place h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.civic-place .caveat { margin: 0 0 0.5rem; }
.civic-links { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.civic-links li {
  display: grid;
  gap: 0.15rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-accent);
  border-radius: 12px;
}
.civic-kind {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.civic-links a, .civic-place a { color: var(--accent); overflow-wrap: anywhere; }
.civic-url {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 900px) {
  .top {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .header-tools {
    grid-row: 1;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    justify-content: space-between;
  }
  .brand { grid-row: 2; grid-column: 1 / -1; }
  .site-nav { grid-row: 3; grid-column: 1 / -1; display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .top.is-nav-open .site-nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0.15rem 0 0.5rem;
  }
  .nav-group-links {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .nav-group-links a {
    min-height: 44px;
    border-radius: 12px;
    padding: 0.45rem 0.8rem;
  }
  .site-logo { width: 44px; height: 44px; flex-basis: 44px; border-radius: 10px; }
  .site-title, h1.site-title { font-size: 1.14rem; }
  .site-tagline { font-size: 0.86rem; }
  .lang-btn { min-height: 40px; min-width: 2.5rem; }
}
@media (min-width: 901px) {
  .nav-toggle { display: none !important; }
  .site-nav {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 1.4rem;
    row-gap: 0.15rem;
  }
  .site-nav .nav-group { display: contents; }
  .site-nav .nav-group-label { grid-row: 1; align-self: end; line-height: 1.2; }
  .site-nav .nav-group-links { grid-row: 2; }
  .top.is-nav-open .site-nav { display: grid !important; }
}
@media (max-width: 640px) {
  .top { padding: 0.85rem 1rem 0.25rem; }
  main, footer { padding-left: 1rem; padding-right: 1rem; }
  .mission { padding-left: 1rem; padding-right: 1rem; }
  .content-card, .chart-panel, .search-panel, .about, .study-card, .donate-card, .disclaimer {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }
  .chart-wrap { height: 220px; min-height: 180px; }
  .chart-wrap.tall { height: 300px; }
  .chart-wrap.hk { height: 440px; }
  .study-chart-wrap { height: 240px; }
}

/* Overflow guards: long <select> options, URLs, and narrow viewports */
.filters, .filter-group, .filter-actions, .search-form, .qbox {
  max-width: 100%;
  min-width: 0;
}
.field, .chip {
  max-width: 100%;
  min-width: 0;
}
.field select, .field input {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}
.lede, .page-title, .mission, .citation, .snippet, .meta,
.official-links, .official-links a, .source-list, .source-list a,
.section-intro, h2, h3, .covid-kicker, footer.site-footer, footer.site-footer p {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
a { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .field input[type="date"] { min-width: 0; }
}

.study-card, .finding-list, .finding-list li, .finding-list p, .licence-note {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}


/* Field labels stay on one line; inputs take leftover width */
.field > span {
  flex: 0 0 auto;
  white-space: nowrap;
}
.study-chart-wrap.tall-line { height: 320px; min-height: 280px; }
@media (max-width: 700px) {
  .study-chart-wrap.tall-line { height: 360px; min-height: 320px; }
}

/* Literature category list: wrap long bilingual option labels */
.custom-select { position: relative; flex: 1 1 auto; min-width: 0; max-width: 100%; }
.custom-select-btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
  background: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.15rem 1.4rem 0.15rem 0.3rem;
  cursor: pointer;
  min-height: 2.2rem;
}
.custom-select-btn::after {
  content: "▾";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.custom-select { }
.custom-select-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(70vh, 22rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.25rem;
}
.custom-select-list button {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  color: var(--ink);
}
.custom-select-list button:hover,
.custom-select-list button[aria-selected="true"] {
  background: var(--accent-soft);
}
.field:has(.custom-select) { width: 100%; }
