:root {
  color-scheme: light;

  --color-primary: #0f5e59;
  --color-primary-hover: #0a4440;
  --color-primary-tint: rgba(15, 94, 89, 0.08);
  --color-primary-tint-strong: rgba(15, 94, 89, 0.09);
  --color-primary-border: rgba(15, 94, 89, 0.16);
  --color-text: #142321;
  --color-text-secondary: #3e4c49;
  --color-text-muted: #55635f;
  --color-text-article: #2b3a37;
  --color-background: #edf1ef;
  --color-alert: #d49a3a;
  --color-alert-text: #8a4e12;
  --color-alert-bg: rgba(255, 250, 242, 0.62);
  --color-alert-border: rgba(212, 154, 58, 0.28);
  --color-alert-tint: rgba(212, 154, 58, 0.16);
  --color-value-normal: #1f7a6d;
  --color-value-warning: #d49a3a;
  --color-value-high: #b9472f;
  --color-value-low: #5b7fa6;
  --color-hairline: rgba(20, 35, 33, 0.07);
  --color-control-border: rgba(20, 35, 33, 0.12);
  --color-hairline-soft: rgba(20, 35, 33, 0.05);
  --color-on-primary: #fff;
  --color-logo-mark: #0f5e59;
  --color-logo-tube: #fff;
  --color-logo-accent: #f2c48d;
  --color-glow-primary: rgba(15, 94, 89, 0.13);
  --color-glow-gold: rgba(212, 154, 58, 0.11);
  --color-grid-line: rgba(15, 60, 58, 0.045);

  --surface-bg: rgba(255, 255, 255, 0.56);
  --surface-bg-panel: rgba(255, 255, 255, 0.6);
  --surface-bg-soft: rgba(255, 255, 255, 0.5);
  --surface-border: 1px solid rgba(255, 255, 255, 0.85);
  --shadow-inset-highlight: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  --shadow-surface:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 20px 40px -30px rgba(16, 44, 41, 0.32);

  --radius-card-min: 20px;
  --radius-card-max: 28px;
  --radius-card: 22px;
  --radius-panel: 24px;
  --radius-control: 14px;
  --radius-small: 12px;
  --radius-badge: 8px;

  --space-0-5: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-2-5: 10px;
  --space-3: 12px;
  --space-3-5: 14px;
  --space-4: 16px;
  --space-4-5: 18px;
  --space-5: 20px;
  --space-5-5: 22px;
  --space-6: 24px;
  --space-6-5: 26px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --control-height: 44px;
  --bottom-nav-height: 64px;
  /* The room the bottom bar takes on a phone, safe area included. */
  --bottom-bar-space: calc(
    var(--bottom-nav-height) +
    env(safe-area-inset-bottom)
  );

  --text-2xs: 0.75rem;
  --text-xs: 0.8125rem;
  --text-caption: 0.875rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.125rem;
  --text-lead: 1.1875rem;
  --text-h3: 1.1875rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.375rem;
  --text-3xl: 1.5rem;
  --text-h2: 1.625rem;
  --text-h1: 2.75rem;
  --text-h1-mobile: 1.875rem;

  --page-width: 1240px;
  --page-padding: 24px;
  --page-gap: 40px;
  --prose-width: 720px;

  /* Backgrounds of the home feed cards on phones, taken in turn. */
  --feed-tone-1: #0e3634;
  --feed-tone-2: #14302a;
  --feed-tone-3: #36191f;
  --feed-tone-4: #272140;
  --feed-tone-5: #12263b;
  --feed-glow: rgba(255, 255, 255, 0.09);
  --feed-fade: rgba(10, 18, 17, 0.55);
  --feed-fade-strong: rgba(10, 18, 17, 0.62);
  --feed-header-height: 64px;
  --feed-band-height: 64px;
  --feed-grid-size: 28px;
  --feed-glow-size: 28rem 22rem;
  --feed-actions-gutter: 84px;
  --feed-actions-lift: 130px;
  --feed-action-size: 52px;
  --feed-action-icon: 28px;
  --feed-icon-shadow: rgba(0, 0, 0, 0.35);
  --text-feed-name: 2.5rem;

  --focus-ring: 2px solid var(--color-primary);

  --motion-duration: 300ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-press-scale: 0.97;

  --font-family:
    "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration: 0s;
    --motion-press-scale: 1;
  }
}

/* Phone look: always dark, whatever the system color setting says. */
@media (max-width: 640px) {
  :root {
    color-scheme: dark;

    --color-primary: #8ed3c0;
    --color-primary-hover: #b4e4d6;
    --color-primary-tint: rgba(142, 211, 192, 0.12);
    --color-primary-tint-strong: rgba(142, 211, 192, 0.16);
    --color-primary-border: rgba(142, 211, 192, 0.28);
    --color-text: #fff;
    --color-text-secondary: rgba(255, 255, 255, 0.75);
    --color-text-muted: rgba(255, 255, 255, 0.68);
    --color-text-article: rgba(255, 255, 255, 0.82);
    --color-background: #0d1716;
    --color-alert-text: #f2c48d;
    --color-alert-bg: rgba(212, 154, 58, 0.12);
    --color-alert-border: rgba(212, 154, 58, 0.4);
    --color-alert-tint: rgba(212, 154, 58, 0.2);
    --color-value-normal: #5fd0b8;
    --color-value-warning: #e2b05e;
    --color-value-high: #f08a73;
    --color-value-low: #8db4e0;
    --color-hairline: rgba(255, 255, 255, 0.1);
    --color-control-border: rgba(255, 255, 255, 0.18);
    --color-hairline-soft: rgba(255, 255, 255, 0.07);
    --color-on-primary: #0d1716;
    --color-glow-primary: rgba(142, 211, 192, 0.1);
    --color-glow-gold: rgba(212, 154, 58, 0.07);
    --color-grid-line: rgba(255, 255, 255, 0.035);

    --surface-bg: rgba(255, 255, 255, 0.06);
    --surface-bg-panel: rgba(255, 255, 255, 0.08);
    --surface-bg-soft: rgba(255, 255, 255, 0.05);
    --surface-border: 1px solid rgba(255, 255, 255, 0.12);
    --shadow-inset-highlight: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    --shadow-surface:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 20px 40px -30px rgba(0, 0, 0, 0.6);

    --color-nav-bg: rgba(13, 23, 22, 0.85);
    --color-nav-bg-solid: var(--color-background);
    --color-nav-border: rgba(255, 255, 255, 0.12);
    --color-nav-text: rgba(255, 255, 255, 0.68);
    --color-nav-text-current: #fff;
    --color-nav-band: rgba(142, 211, 192, 0.16);
  }
}

/* Readex Pro v27, self-hosted. Subsets and unicode-range copied from Google's v27 stylesheet; vietnamese is dropped. */
/* arabic */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("/fonts/readex-pro-v27-arabic.woff2") format("woff2");
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin-ext */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("/fonts/readex-pro-v27-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("/fonts/readex-pro-v27-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

body {
  background-color: var(--color-background);
  background-image:
    radial-gradient(
      56rem 36rem at 92% -8%,
      var(--color-glow-primary),
      transparent 62%
    ),
    radial-gradient(
      44rem 30rem at -4% 38%,
      var(--color-glow-gold),
      transparent 60%
    ),
    linear-gradient(var(--color-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
  background-size:
    auto,
    auto,
    32px 32px,
    32px 32px;
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  line-height: 1.7;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

p,
ul,
ol,
dl,
dd {
  margin: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--motion-duration) var(--motion-ease);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* Hidden on screen, still read by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  h1 {
    font-size: var(--text-h1-mobile);
  }

  h2 {
    font-size: var(--text-2xl);
  }
}

/* Forms of the admin list and of the delete confirmation page. */
.status-actions,
.confirm-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.status-actions .button {
  height: 40px;
  padding: 0 var(--space-4);
}

.status-note {
  color: var(--color-text-muted);
}

/* The admin list is wider than the prose column of the other message pages. */
.admin-list-page {
  max-width: none;
}

/* The messages table of /admin/reports. */
.reports-table .message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.reports-table td {
  vertical-align: top;
}

.sender-line {
  display: block;
  overflow-wrap: anywhere;
}

/* A new-message count beside its link on /admin. */
.admin-new-count {
  color: var(--color-text-muted);
}

/* The form that bans an address by hand on /admin/bans. */
.ban-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: var(--prose-width);
}

.ban-form input:not([type="hidden"]),
.ban-form select {
  height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  font: inherit;
}

.ban-hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.ban-form .button {
  align-self: flex-start;
}

.bilingual-ar,
.bilingual-en {
  display: block;
}

.bilingual-en {
  color: var(--color-text-muted);
  font-weight: 400;
}

.bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    height: var(--bottom-bar-space);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom)
      env(safe-area-inset-left);
    border-top: 1px solid var(--color-nav-border);
    background: var(--color-nav-bg-solid);
  }

  @supports (backdrop-filter: blur(1px)) {
    .bottom-nav {
      background: var(--color-nav-bg);
      backdrop-filter: blur(16px);
    }
  }

  .bottom-nav a {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-0-5);
    min-height: 48px;
    color: var(--color-nav-text);
    font-size: var(--text-2xs);
    text-decoration: none;
    transition: transform var(--motion-duration) var(--motion-ease);
  }

  .bottom-nav a:active {
    transform: scale(var(--motion-press-scale));
  }

  .bottom-nav a:hover {
    color: var(--color-nav-text);
    text-decoration: none;
  }

  .nav-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav a[aria-current="page"] {
    color: var(--color-nav-text-current);
    font-weight: 600;
  }

  /* Soft band behind the current item. */
  .bottom-nav a[aria-current="page"]::before {
    content: "";
    position: absolute;
    inset: var(--space-1) var(--space-2);
    z-index: -1;
    border-radius: var(--radius-small);
    background: var(--color-nav-band);
  }
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

.breadcrumb li + li::before {
  content: "/" / "";
  margin-inline-end: var(--space-2);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0 var(--space-5-5);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}

.button:active {
  transform: scale(var(--motion-press-scale));
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.button-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

.button-secondary {
  border: 1px solid var(--color-control-border);
  background: var(--surface-bg-panel);
  color: var(--color-text);
}

.button-secondary:hover {
  color: var(--color-text);
}

/* Shared glass surfaces. No backdrop-filter: it is costly on low-end phones. */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface-bg);
  box-shadow: var(--shadow-surface);
}

.panel {
  padding: var(--space-6);
  border: var(--surface-border);
  border-radius: var(--radius-panel);
  background: var(--surface-bg-panel);
  box-shadow: var(--shadow-surface);
}

.badge {
  align-self: flex-start;
  padding: var(--space-1) var(--space-2-5);
  border-radius: var(--radius-badge);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .card,
  .panel {
    padding: var(--space-4);
  }
}

.category-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-5) var(--space-6);
  border: var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface-bg);
  box-shadow: var(--shadow-surface);
  color: var(--color-text);
  text-decoration: none;
  transition:
    background-color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}

.category-card:active {
  transform: scale(var(--motion-press-scale));
}

.category-card:hover {
  background: var(--surface-bg-panel);
  color: var(--color-text);
  text-decoration: none;
}

.category-card-name {
  font-size: var(--text-xl);
  font-weight: 600;
}

.category-card-name-en {
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.category-card-count {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.contact-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.contact-section h2,
.contact-section > p {
  margin: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.contact-field label {
  font-size: var(--text-caption);
  font-weight: 600;
}

.contact-input {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2-5) var(--space-4);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--surface-bg-panel);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
}

textarea.contact-input {
  resize: vertical;
}

.contact-form .button {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .contact-row {
    grid-template-columns: 1fr;
  }

  .contact-form .button {
    align-self: stretch;
  }
}

/* Gold card, visually separate from the footer below it. */
.disclaimer {
  display: flex;
  align-items: center;
  gap: var(--space-4-5);
  margin-bottom: calc(var(--page-gap) * -0.6);
  padding: var(--space-6-5) var(--space-7);
  border: 1px solid var(--color-alert-border);
  border-radius: var(--radius-card);
  background: var(--color-alert-bg);
  box-shadow: var(--shadow-inset-highlight);
}

.disclaimer-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background: var(--color-alert-tint);
  color: var(--color-alert-text);
}

.disclaimer-svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.disclaimer p {
  font-size: var(--text-sm);
  line-height: 1.9;
  color: var(--color-text-secondary);
}

.disclaimer strong {
  color: var(--color-alert-text);
  font-weight: 600;
}

@media (max-width: 640px) {
  .disclaimer {
    gap: var(--space-3);
    padding: var(--space-4-5) var(--space-4);
  }
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.facts-panel h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-md);
}

.facts-list {
  display: flex;
  flex-direction: column;
}

.facts-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2-5) 0;
  border-top: 1px solid var(--color-hairline);
  font-size: var(--text-caption);
}

.facts-row dt {
  flex: none;
  color: var(--color-text-muted);
}

.facts-row dd {
  font-weight: 500;
  text-align: end;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .facts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .facts-row {
    flex-direction: column;
    gap: var(--space-0-5);
    padding: var(--space-3) var(--space-3-5);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-control);
    background: var(--surface-bg-soft);
  }

  .facts-row dd {
    text-align: start;
  }
}

.import-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.import-report ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface-bg);
  box-shadow: var(--shadow-surface);
}

.file-report h3 {
  font-size: var(--text-h3);
  overflow-wrap: anywhere;
}

.file-result {
  align-self: flex-start;
  padding: var(--space-0-5) var(--space-2-5);
  border-radius: var(--radius-badge);
  font-size: var(--text-caption);
  font-weight: 600;
}

.file-result-added,
.file-result-updated {
  background: var(--color-primary-tint-strong);
  color: var(--color-primary);
}

.file-result-unchanged {
  background: var(--color-hairline);
  color: var(--color-text-secondary);
}

.file-result-rejected {
  background: var(--color-alert-tint);
  color: var(--color-value-high);
}

.finding-list h4 {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.finding-list ul {
  margin: var(--space-1) 0 0;
  padding-inline-start: var(--space-5);
  font-size: var(--text-caption);
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5-5) var(--space-7);
  border: var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface-bg-soft);
}

.footer-name {
  color: var(--color-text);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-copyright {
  margin: 0;
  margin-inline-start: auto;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.footer-links a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--color-text);
}

.footer-links a[aria-current="page"] {
  font-weight: 600;
}

@media (max-width: 640px) {
  .footer-copyright {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}

.form-errors {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-alert-border);
  border-radius: var(--radius-control);
  background: var(--color-alert-bg);
  color: var(--color-alert-text);
}

.form-errors > p,
.form-errors ul {
  margin: 0;
}

.form-errors ul {
  padding-inline-start: var(--space-5);
}

.form-errors a {
  color: inherit;
}

/* Raised above the paragraph rules of the pages that hold a form. */
p.field-error,
.static-page p.field-error {
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption);
  line-height: inherit;
  color: var(--color-value-high);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-value-high);
}

.form-trap {
  display: none;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  border: var(--surface-border);
  border-radius: var(--radius-card-min);
  background: var(--surface-bg-panel);
  box-shadow: var(--shadow-surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.brand-name {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-0-5);
  margin-inline-start: var(--space-3);
}

.main-nav a {
  padding: var(--space-2-5) var(--space-4);
  border-radius: var(--radius-small);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition:
    color var(--motion-duration) var(--motion-ease),
    background-color var(--motion-duration) var(--motion-ease);
}

.main-nav a:hover {
  background: var(--color-primary-tint);
  color: var(--color-text);
}

.main-nav a[aria-current="page"] {
  background: var(--color-primary-tint-strong);
  color: var(--color-text);
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-header {
    gap: var(--space-2);
    padding: var(--space-3);
  }

  /* The bottom bar has the same destinations. */
  .main-nav,
  .site-header .search-form {
    display: none;
  }
}

/* The actions column of a phone card (save, share, report) and the share
   status line. */
@media (max-width: 640px) {
  /* The column on the left edge: an icon with its word under it. */
  .home-feed .feed-actions {
    position: absolute;
    inset-inline-end: var(--space-3);
    bottom: calc(var(--bottom-bar-space) + var(--feed-actions-lift));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  .feed-actions .action-button {
    flex-direction: column;
    gap: var(--space-1);
    min-width: var(--feed-action-size);
    min-height: var(--feed-action-size);
    padding: 0;
    border: 0;
    background: transparent;
    font-size: var(--text-2xs);
    font-weight: 400;
  }

  /* The share button keeps its place until the script shows it, so the column
     does not grow after load. Without scripting it takes no room at all. */
  .feed-actions .action-button[hidden] {
    visibility: hidden;
  }

  @media (scripting: none) {
    .feed-actions .action-button[hidden] {
      display: none;
    }
  }

  .feed-actions .action-icon {
    width: var(--feed-action-icon);
    height: var(--feed-action-icon);
    filter: drop-shadow(0 2px 6px var(--feed-icon-shadow));
  }

  /* The one status line of the page: empty (invisible, still announced) until
     the script puts text in it. */
  .share-status {
    position: fixed;
    inset-inline: var(--space-4);
    bottom: calc(var(--bottom-bar-space) + var(--space-2));
    z-index: 8;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-nav-border);
    border-radius: var(--radius-small);
    background: var(--color-nav-bg-solid);
    font-size: var(--text-caption);
    text-align: center;
  }

  .share-status:empty {
    visibility: hidden;
  }
}

/* The phone home page, the end of the feed and the header over the cards. */
@media (max-width: 640px) {
  /* The end area is at least one screen minus the bottom bar tall, with the
     end text at its bottom just above the disclaimer and the footer, so the
     last card never shows on the final screen. There are two snap stops: this
     end area first, then the page end (disclaimer and footer). */
  .home-feed .feed-end {
    flex-flow: row wrap;
    align-content: flex-end;
    align-items: center;
    gap: var(--space-4);
    min-height: calc(100vh - var(--bottom-bar-space));
    padding: calc(
        var(--feed-header-height) +
        env(safe-area-inset-top) +
        var(--space-6)
      )
      0 var(--space-6);
    scroll-snap-align: end;
    scroll-margin-bottom: var(--bottom-bar-space);
  }

  @supports (height: 100svh) {
    .home-feed .feed-end {
      min-height: calc(100svh - var(--bottom-bar-space));
    }
  }

  /* The page end is the last snap point, so the disclaimer and footer stay
     reachable above the bottom bar. */
  html:has(.home-feed) body > footer {
    scroll-snap-align: end;
    scroll-margin-bottom: calc(var(--bottom-bar-space) + var(--space-4));
  }

  .feed-end .feed-end-text {
    display: block;
    color: var(--color-primary);
    font-size: var(--text-md);
    font-weight: 600;
    flex-basis: 100%;
  }

  /* The two links share a row, which keeps the end text below the header on
     the shortest screens. */
  .feed-end .more-link,
  .feed-end .feed-back {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
  }

  .feed-end .feed-back {
    padding: 0 var(--space-4);
    border: 1px solid var(--color-control-border);
    border-radius: var(--radius-small);
    background: var(--surface-bg-panel);
    color: var(--color-text);
    font-size: var(--text-caption);
    font-weight: 600;
  }

  /* The header lies over the cards; the bottom band fades them under the bar. */
  html:has(.home-feed) .site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 5;
    height: calc(var(--feed-header-height) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    border: 0;
    border-radius: 0;
    background: linear-gradient(var(--feed-fade), transparent);
    box-shadow: none;
  }

  html:has(.home-feed) body::after {
    content: "";
    position: fixed;
    inset: auto 0 0;
    z-index: 9;
    height: calc(var(--bottom-bar-space) + var(--feed-band-height));
    background: linear-gradient(to top, var(--feed-fade-strong), transparent);
    pointer-events: none;
  }
}

/* The phone home page, cards: one full-screen card per test, the page scroll
   snapping to one at a time. Keyed on .home-feed, which exists only while there
   is at least one published test. Actions: home-feed-actions.css; end area and
   header: home-feed-end.css. */
.test-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
}

.feed-position {
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
}

.feed-tone-1 {
  --feed-tone: var(--feed-tone-1);
}
.feed-tone-2 {
  --feed-tone: var(--feed-tone-2);
}
.feed-tone-3 {
  --feed-tone: var(--feed-tone-3);
}
.feed-tone-4 {
  --feed-tone: var(--feed-tone-4);
}
.feed-tone-5 {
  --feed-tone: var(--feed-tone-5);
}

@media (max-width: 640px) {
  html:has(.home-feed) {
    scroll-snap-type: y mandatory;
  }

  /* The cards run edge to edge and start at the top of the screen. */
  html:has(.home-feed) body {
    padding-top: 0;
  }

  html:has(.home-feed) main,
  html:has(.home-feed) .home-feed,
  .home-feed .card-grid {
    gap: 0;
  }

  html:has(.home-feed) .home-categories {
    display: none;
  }

  /* A full-screen card never shrinks: it would show the page behind it. */
  .home-feed .test-card:has(.card-link:active) {
    transform: none;
  }

  .home-feed .test-card {
    gap: var(--space-4);
    height: 100vh;
    margin-inline: calc(50% - 50vw);
    padding-block: calc(var(--feed-header-height) + env(safe-area-inset-top))
      calc(var(--bottom-bar-space) + var(--space-6));
    padding-inline: var(--space-6) var(--feed-actions-gutter);
    border: 0;
    border-radius: 0;
    background-color: var(--feed-tone);
    background-image:
      radial-gradient(
        var(--feed-glow-size) at 100% 0%,
        var(--feed-glow),
        transparent 60%
      ),
      linear-gradient(var(--color-grid-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
    background-size:
      auto,
      var(--feed-grid-size) var(--feed-grid-size),
      var(--feed-grid-size) var(--feed-grid-size);
    box-shadow: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  @supports (height: 100svh) {
    .home-feed .test-card {
      height: 100svh;
    }
  }

  .home-feed .test-card-name-en {
    align-self: flex-end;
    margin-block: var(--space-4) auto;
    font-size: var(--text-feed-name);
    font-weight: 500;
    line-height: 1.05;
    text-align: left;
  }

  .home-feed .test-card-summary {
    flex-grow: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
  }

  .home-feed .test-card-footer {
    display: none;
  }

  .home-feed .feed-position {
    display: inline;
  }

  .home-feed .feed-sample {
    display: block;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: var(--space-5);
}

.more-link {
  align-self: flex-start;
  font-weight: 600;
}

.feed-end {
  display: flex;
  flex-direction: column;
}

/* The feed-only parts are not displayed (the phone feed styles show them again). */
.feed-position,
.feed-sample,
.feed-actions,
.feed-end-text,
.feed-back {
  display: none;
}

/* Computers: cards 13 to 30 are not displayed, the empty share status takes no
   room, and what the phone feed visually hides is shown again. */
@media (min-width: 641px) {
  .card-grid > .test-card:nth-child(n + 13),
  .share-status {
    display: none;
  }

  .phone-hidden {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
}

.import-page > .import-refusal {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-alert-border);
  border-radius: var(--radius-control);
  background: var(--color-alert-bg);
  color: var(--color-alert-text);
}

.upload-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  border: var(--surface-border);
  border-radius: var(--radius-panel);
  background: var(--surface-bg);
  box-shadow: var(--shadow-surface);
}

.upload-form label {
  font-weight: 600;
}

.upload-form input[type="file"] {
  max-width: 100%;
  font-size: var(--text-sm);
}

body {
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
  min-height: 100vh;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding) var(--space-8);
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  min-width: 0;
}

/* Page title with a lead paragraph under it (home, category). */
.page-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--prose-width);
}

/* Lead sizing is shared with the static-page paragraphs (mobile rule below too). */
.lead,
.static-page p {
  font-size: var(--text-lead);
  line-height: 1.9;
}

.lead {
  color: var(--color-text-secondary);
}

.page-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

@media (max-width: 640px) {
  body {
    --page-gap: var(--space-7);
    --page-padding: var(--space-4);
    padding-top: max(var(--space-4), env(safe-area-inset-top));
    padding-right: max(var(--page-padding), env(safe-area-inset-right));
    padding-bottom: calc(var(--bottom-bar-space) + var(--space-4));
    padding-left: max(var(--page-padding), env(safe-area-inset-left));
  }

  main {
    gap: var(--space-8);
  }

  .lead,
  .static-page p {
    font-size: var(--text-md);
  }
}

.logo-mark {
  fill: var(--color-logo-mark);
}

.logo-tube {
  fill: none;
  stroke: var(--color-logo-tube);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-level {
  fill: none;
  stroke: var(--color-logo-accent);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.message-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--prose-width);
  padding: var(--space-8) 0;
}

.message-page > p {
  font-size: var(--text-lead);
  color: var(--color-text-secondary);
}

.message-page .button {
  align-self: flex-start;
}

/* Page transitions and smooth scroll. Reduced motion gets none of it. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: var(--motion-duration);
    animation-timing-function: var(--motion-ease);
  }

  .site-header {
    view-transition-name: site-header;
  }

  .bottom-nav {
    view-transition-name: bottom-nav;
  }

  ::view-transition-group(site-header),
  ::view-transition-group(bottom-nav) {
    animation-name: none;
    animation-duration: var(--motion-duration);
  }

  ::view-transition-old(site-header),
  ::view-transition-new(site-header),
  ::view-transition-old(bottom-nav),
  ::view-transition-new(bottom-nav) {
    animation-timing-function: var(--motion-ease);
  }

  html {
    scroll-behavior: smooth;
  }
}

/* The wrapper scrolls on its own, so the page never scrolls sideways. */
.ranges-scroll {
  overflow-x: auto;
}

.ranges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ranges-table th,
.ranges-table td {
  padding: var(--space-2-5) var(--space-3);
  border-bottom: 1px solid var(--color-hairline);
  text-align: start;
  vertical-align: top;
}

.ranges-table th {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  font-weight: 600;
  white-space: nowrap;
}

.ranges-table td {
  color: var(--color-text-article);
}

/* The report page: the design's dialog card, one centred card on the page. */
.report-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 520px;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  border: var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface-bg);
  box-shadow: var(--shadow-surface);
}

.report-card > p {
  margin: 0;
  color: var(--color-text-secondary);
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.report-reasons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3-5) var(--space-4);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--surface-bg-panel);
  cursor: pointer;
  transition:
    border-color var(--motion-duration) var(--motion-ease),
    background-color var(--motion-duration) var(--motion-ease);
}

.report-reason:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
}

.report-other {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.report-other textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-small);
  background: var(--surface-bg-panel);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  resize: vertical;
}

.report-other textarea[aria-invalid="true"] {
  border-color: var(--color-value-high);
}

/* The box shows only while «سبب آخر» is chosen. A browser without :has() drops
   both rules and always shows the box. */
.report-form:not(:has(input[name="reason"]:checked))
  .report-other:not(:has(textarea[aria-invalid="true"])),
.report-form:has(input[name="reason"]:not([value="other"]):checked)
  .report-other:not(:has(textarea[aria-invalid="true"])) {
  display: none;
}

/* Cancel is the narrower button, send the wider one. */
.report-actions {
  display: flex;
  gap: var(--space-3);
}

.report-actions .button-secondary {
  flex: 1;
}

.report-actions .button-primary {
  flex: 2;
}

@media (max-width: 640px) {
  .report-card {
    margin-block: var(--space-4);
    padding: var(--space-4);
  }
}

/* What is specific to the save button; the shared look is in test-actions.css. */
.save-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.save-button[aria-pressed="true"] .save-icon {
  fill: var(--color-primary);
  stroke: var(--color-primary);
}

@media (scripting: none) {
  .save-control {
    display: none;
  }
}

.saved-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-hairline-soft);
  border-radius: var(--radius-control);
  overflow: hidden;
}

/* An author display rule would otherwise beat the hidden attribute. */
.saved-list[hidden],
.saved-empty[hidden],
.saved-unavailable[hidden] {
  display: none;
}

.saved-row {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--color-hairline-soft);
}

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

.saved-row .test-row {
  flex: 1;
  border-top: 0;
}

.saved-remove {
  margin-inline: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-hairline-soft);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  transition:
    color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}

.saved-remove:active {
  transform: scale(var(--motion-press-scale));
}

.saved-remove:hover {
  color: var(--color-text);
}

.search-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.search-input {
  height: var(--control-height);
  min-width: 0;
  width: 16rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: var(--surface-bg-panel);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  appearance: none;
}

.search-form .button {
  height: var(--control-height);
}

@media (max-width: 640px) {
  .search-form {
    flex: 1 1 100%;
    margin-inline-start: 0;
  }

  .search-input {
    flex: 1 1 auto;
    width: auto;
  }
}

/* The form on /search sits under the heading, not pushed to the header's end. */
main .search-form {
  margin-inline-start: 0;
  max-width: var(--prose-width);
}

main .search-input {
  flex: 1 1 auto;
  width: auto;
}

.static-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--prose-width);
}

/* The row under the title block: the save button and the report link. */
.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-4);
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-4);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-small);
  background: var(--surface-bg-panel);
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
  transition:
    background-color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
}

.action-button:active {
  transform: scale(var(--motion-press-scale));
}

.action-button:hover {
  background: var(--color-primary-tint);
  color: var(--color-text);
  text-decoration: none;
}

.action-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.test-card {
  position: relative;
  height: 100%;
  transition: transform var(--motion-duration) var(--motion-ease);
}

.test-card-name-en {
  color: var(--color-primary);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.test-card h3 a {
  color: var(--color-text);
}

/* The heading link covers the whole card, so the card is one link. */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.test-card:has(.card-link:focus-visible) {
  outline: var(--focus-ring);
  outline-offset: var(--space-0-5);
}

.card-link:focus-visible {
  outline: 0;
}

/* The actions sit above the covered area and keep their own behaviour. */
.test-card .feed-actions {
  z-index: 1;
}

.test-card-summary {
  flex-grow: 1;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.85;
}

.test-card-footer {
  padding-top: var(--space-3-5);
  border-top: 1px solid var(--color-hairline);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.test-card:has(.card-link:active) {
  transform: scale(var(--motion-press-scale));
}

/* Panel of test rows: /tests groups, category page, related tests. */
.test-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.test-list h2 {
  padding: var(--space-5-5) var(--space-6-5);
  border-bottom: 1px solid var(--color-hairline);
  font-size: var(--text-3xl);
}

.test-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-5);
  padding: var(--space-3-5) var(--space-6-5);
  border-top: 1px solid var(--color-hairline-soft);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--motion-duration) var(--motion-ease);
}

.test-list li:first-child .test-row {
  border-top: 0;
}

.test-row:hover {
  background: var(--color-primary-tint);
  color: var(--color-text);
  text-decoration: none;
}

.test-row-name-en {
  min-width: 200px;
  color: var(--color-primary);
  font-size: var(--text-lg);
  font-weight: 500;
}

.test-row-name-ar {
  color: var(--color-text-secondary);
}

@media (max-width: 640px) {
  .test-list h2 {
    padding: var(--space-4);
  }

  .test-row {
    padding: var(--space-3) var(--space-4);
  }

  .test-row-name-en {
    min-width: 0;
  }
}

/* Test page: title block, body (facts + sections), lists, FAQ, sources, related. */
.title-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.title-name-en {
  color: var(--color-primary);
  font-size: var(--text-3xl);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.direct-answer {
  font-size: var(--text-lead);
  line-height: 1.95;
  color: var(--color-text-secondary);
}

.title-dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}

/* Narrow: facts panel, then the sections. Wide: the facts panel is a side column. */
.test-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.test-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.text-section,
.ranges,
.faq,
.sources,
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3-5);
}

.text-section p,
.faq p {
  font-size: var(--text-md);
  line-height: 2;
  color: var(--color-text-article);
}

.item-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-3-5);
}

.item-list h2,
.faq h3 {
  font-size: var(--text-h3);
}

.item-list ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline-start: var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--color-text-article);
}

.faq-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sources {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-control-border);
}

.sources h2 {
  font-size: var(--text-lg);
}

.sources ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline-start: var(--space-6);
  font-size: var(--text-caption);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.sources a {
  overflow-wrap: anywhere;
}

@media (min-width: 960px) {
  .test-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: var(--space-8);
  }

  .test-body .facts-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .test-body .test-sections {
    grid-column: 1;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .test-body,
  .test-sections {
    gap: var(--space-6);
  }

  .text-section p,
  .faq p {
    line-height: 1.9;
  }
}

/* The admin list: the wrapper scrolls on its own, so the page never scrolls sideways. */
.admin-table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.admin-table th,
.admin-table td {
  padding: var(--space-2-5) var(--space-3);
  border-bottom: 1px solid var(--color-hairline);
  text-align: start;
  vertical-align: top;
}

.admin-table th {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  color: var(--color-text-article);
}

.admin-table tr:target td {
  background: var(--color-primary-tint);
}

.admin-test-names {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.admin-test-names small {
  color: var(--color-text-muted);
}

.status-badge {
  display: inline-block;
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-badge);
  font-size: var(--text-caption);
  font-weight: 600;
}

.status-published {
  background: var(--color-primary-tint-strong);
  color: var(--color-primary);
}

.status-hidden {
  background: var(--color-alert-tint);
  color: var(--color-alert-text);
}

.status-deleted {
  background: var(--color-hairline);
  color: var(--color-text-muted);
}
