/* The Resources page (src/resources/index.html) only; no other page loads this file. The filter rules themselves are generated from the
   data into styles-resources-rules.css by tools/make_resources.py. One accent colour for everything interactive: --neon-cyan.
   Contrast, computed with the WCAG formula (tests/test_resources_page.py recomputes these from the tokens in styles.css):
     text on a card (#0a0a0a): --ink-primary 17.37:1, --ink-secondary 7.57:1, --muted 7.04:1, --neon-cyan links 14.39:1
     text on the page (#050505): --ink-primary 17.88:1, --neon-cyan 14.81:1; a chosen pill (cyan at 12% over a card): --ink-primary 13.98:1
     UI parts (need 3:1): the --neon-cyan focus ring 14.39:1 on a card, 14.81:1 on the page, 11.58:1 beside a chosen pill;
     the pill border (white at 45% over a card) 4.48:1; the --rose-pink rule of the crisis line 7.90:1 */

.res-head .lede { margin-bottom: 0.9rem; }
.res-crisis {
    max-width: 44rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--rose-pink);
    border-radius: 0 6px 6px 0;
    background: var(--bg-panel);
    color: var(--ink-primary);
    line-height: 1.5;
}
.res-count { max-width: 44rem; margin: 0 0 1rem; color: var(--ink-secondary); line-height: 1.5; }

.res-persona-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 1.75rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: var(--bg-panel);
}
.res-persona-kicker {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--neon-cyan);
}
.res-persona-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.res-persona-btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 1.4rem;
    background: var(--bg-panel);
    color: var(--ink-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
}
.res-persona-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}
.res-persona-btn:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 2px;
}
.res-persona-btn.is-active,
.res-persona-btn[aria-pressed="true"] {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.12);
    color: var(--ink-primary);
    font-weight: 600;
}

.res-body { display: grid; gap: 2.5rem; padding-bottom: 2.5rem; }

/* the map slot (the map's own styles are in styles-resources-map.css). The colours below are what the generated filter rules use for a
   country's dots: lit while it has rows for the current choice, unlit (the land colour, #3b2a50 = --rmap-land) when it has none. */
:root { --res-map-lit: var(--neon-cyan); --res-map-unlit: #3b2a50; }
@media (forced-colors: active) { :root { --res-map-lit: Highlight; --res-map-unlit: GrayText; } }
.res-map .rmap-credit { margin-bottom: 0; }
/* a wide screen would draw the map 1,300 px wide and 570 px tall, pushing the list down: 60rem is the widest map tier's design width */
.res-map .rmap { max-width: 60rem; }
/* styles.css gives every link `transition: all`; on a marker that would animate its place and its visibility when the map changes width tier
   (and, for 0.3 s after the first layout, show a marker the phone tier leaves off). Markers change state at once. */
.rmap .mk { transition: none; }
.res-skip { margin: 0 0 0.25rem; }
.res-skip a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--neon-cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* the country jump list */
.res-jump-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
.res-jump ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0; padding: 0; list-style: none; }
.res-jump a, .res-back a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--neon-cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* the filters: shown only where :has() works (the rules need it); with CSS off or in an older browser every row shows and no control is offered */
.res-filters[hidden] { display: none; }
@supports selector(:has(*)) {
    .res-filters[hidden] { display: block; }
}
@supports not selector(:has(*)) {
    .res-filters { display: none !important; }
}
.res-filters { padding: 1.25rem; border: 1px solid var(--border-glass); border-radius: 8px; background: var(--bg-panel); }
.res-filters h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.res-filters-note { max-width: 44rem; margin: 0 0 1.25rem; color: var(--ink-secondary); font-size: 0.95rem; line-height: 1.5; }
.res-group { min-width: 0; margin: 0 0 1.25rem; padding: 0; border: 0; }
.res-group legend { margin: 0 0 0.6rem; padding: 0; font-weight: 600; color: var(--ink-primary); }
.res-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.res-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.45rem 1rem 0.45rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 1.4rem;
    color: var(--ink-primary);
    line-height: 1.3;
    cursor: pointer;
}
.res-pill input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--neon-cyan); cursor: pointer; }
.res-pill:hover { border-color: var(--neon-cyan); }
.res-pill:has(input:checked) { border-color: var(--neon-cyan); background: rgba(0, 243, 255, 0.12); font-weight: 600; }
/* the ring is drawn on the whole pill, as a real outline (it survives forced colours, where shadows are dropped) */
.res-pill input:focus-visible { outline: none; box-shadow: none; }
.res-pill:has(input:focus-visible) { outline: 3px solid var(--neon-cyan); outline-offset: 2px; }
.res-showing { margin: 0; color: var(--ink-secondary); line-height: 1.5; }
.res-show-aud, .res-show-cat { color: var(--ink-primary); font-weight: 600; }

/* the list */
.res-none { margin: 0 0 1rem; padding: 0.85rem 1rem; border: 1px dashed rgba(255, 255, 255, 0.45); border-radius: 8px; color: var(--ink-primary); }
.res-country { scroll-margin-top: 1rem; }
.res-jump { scroll-margin-top: 1rem; }
.res-country h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.res-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.res-row { display: block; padding: 1.25rem 1.25rem 1.1rem; border: 1px solid var(--border-glass); border-radius: 8px; background: var(--bg-panel); }
.res-title { margin: 0 0 0.3rem; font-size: 1.25rem; }
.res-title a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--neon-cyan);
    text-decoration: underline;
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}
.res-org { margin: 0 0 0.8rem; color: var(--ink-secondary); font-size: 0.95rem; line-height: 1.4; }
.res-summary { margin: 0 0 0.8rem; color: var(--ink-primary); font-size: 1.0625rem; line-height: 1.5; }
.res-es-label { display: block; margin-bottom: 0.15rem; color: var(--ink-secondary); font-size: 0.82rem; }
.res-who { margin: 0 0 0.6rem; color: var(--ink-secondary); font-size: 1rem; line-height: 1.5; }
.res-format { margin: 0 0 0.3rem; color: var(--ink-secondary); font-family: var(--font-mono); font-size: 0.85rem; }
.res-checked { margin: 0; color: var(--muted); font-size: 0.9rem; }
.res-checked time, .res-basis { font-family: var(--font-mono); font-size: 0.85rem; }
.res-basis { white-space: nowrap; }   /* how the row was checked wraps as one phrase, never as "· a" / "person opened this page" */
.res-back { margin: 0.75rem 0 0; }
.res-about { padding-bottom: 3rem; }
.res-about .quiet { max-width: 46rem; }

@media (min-width: 768px) {
    .res-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* From 901px the header is sticky (styles.css), so a jump to a country must land below it. html already keeps 5rem (scroll-padding-top); this
   adds the rest. Header heights measured on 2026-10-10 with eight tabs, before it shrinks on scrolling: 206px from 641 to 1040px wide, 161px from
   1080 to 1240px, 117px from 1280px (the breakpoints below leave a margin on each side of those changes). With ten tabs (Atlas and Letter added) the header measures 150 to 161px from 1280px, so the last rule keeps 5.5rem: 80 + 88 = 168px. */
@media (min-width: 901px) {
    .res-country, .res-jump { scroll-margin-top: 9rem; }
}
@media (min-width: 1100px) {
    .res-country, .res-jump { scroll-margin-top: 6.25rem; }
}
@media (min-width: 1280px) {
    .res-country, .res-jump { scroll-margin-top: 5.5rem; }
}

@media (forced-colors: active) {
    .res-pill:has(input:checked) { border-width: 3px; }
    .res-pill:has(input:focus-visible) { outline: 3px solid Highlight; }
}

/* International CF Community Resources (T-0195) */
.res-international {
    margin-top: 2.5rem;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-glass);
}
.res-intl-header {
    margin-bottom: 1.5rem;
}
.res-intl-header .card-badge {
    display: inline-block;
    margin-bottom: 0.5rem;
}
.res-intl-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink-primary);
    margin: 0.25rem 0 0.5rem 0;
    line-height: 1.25;
}
.res-intl-sub {
    font-size: 0.95rem;
    color: var(--ink-secondary);
    margin: 0;
    line-height: 1.5;
    max-width: 50rem;
}
.res-intl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .res-intl-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.res-intl-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
}
.res-intl-card:hover {
    border-color: rgba(0, 243, 255, 0.45);
}
.res-intl-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.res-intl-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
}
.res-intl-name a {
    color: var(--ink-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}
.res-intl-name a:hover,
.res-intl-name a:focus-visible {
    color: var(--neon-cyan);
    text-decoration: underline;
}
.res-intl-desc {
    font-size: 0.92rem;
    color: var(--ink-secondary);
    line-height: 1.45;
    margin: 0;
}
.res-intl-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Print: every row, whatever the filters say, with each outbound address written out */
@media print {
    .res-filters, .res-jump, .res-back, .res-none { display: none !important; }
    .res-country { display: block !important; }
    .res-list { display: block !important; }
    .res-row { display: block !important; margin: 0 0 0.75rem; break-inside: avoid; background: none; border-color: #999; }
    .res-crisis { background: none; }
    .res-row *, .res-crisis, .res-count, .res-title a { color: #000 !important; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; overflow-wrap: anywhere; }
}

/* Schematic Figures & SVG Animations (Wave 8 / T-0212) */
.schematic-figure {
  margin: 2rem 0;
  padding: 1.25rem;
  background: rgba(14, 21, 36, 0.72);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.schematic-figure .schematic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.schematic-figure .schematic-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neon-cyan, #00f3ff);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.schematic-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: rgba(5, 7, 12, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.schematic-figure figcaption {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: var(--ink-secondary, #94a3b8);
  line-height: 1.45;
  margin: 0;
}

.schematic-figure figcaption .schematic-disclaimer {
  display: block;
  color: var(--lime, #b8ff00);
  margin-top: 0.25rem;
}

.bench-anim-toggle-btn {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-secondary, #94a3b8);
  cursor: pointer;
}

.bench-anim-toggle-btn:hover,
.bench-anim-toggle-btn:focus-visible {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--neon-cyan, #00f3ff);
  color: var(--neon-cyan, #00f3ff);
}

.bench-anim-toggle-btn[aria-pressed="true"] {
  background: rgba(255, 189, 46, 0.15);
  border-color: #ffbd2e;
  color: #ffbd2e;
}

.svg-draw-line {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.svg-pulse-node {
  opacity: 0.9;
}
/* -------------------------------------------------------------
   Global 22-Country Healthcare Equity Navigator & Compass Styles (T-0397)
   ------------------------------------------------------------- */
.compass-navigator-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(5, 7, 12, 0.75);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}

.compass-region-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.compass-region-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.badge-na { color: var(--neon-cyan, #00f3ff); }
.badge-latam { color: var(--rose-pink, #ff7a90); }
.badge-eu { color: var(--lime, #b8ff00); }
.badge-mideast { color: #ffb300; }
.badge-aus { color: #cf5cff; }

.compass-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compass-chip {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  color: var(--ink-secondary, #94a3b8);
  font-family: var(--font-sans, sans-serif);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.compass-chip:hover {
  background: rgba(0, 243, 255, 0.06);
  border-color: rgba(0, 243, 255, 0.4);
  color: var(--ink-primary, #f8fafc);
}

.compass-chip:focus-visible {
  outline: 3px solid var(--neon-cyan, #00f3ff);
  outline-offset: 2px;
}

.compass-chip.is-active,
.compass-chip[aria-pressed="true"] {
  background: rgba(0, 243, 255, 0.14);
  border-color: var(--neon-cyan, #00f3ff);
  color: var(--neon-cyan, #00f3ff);
  font-weight: 600;
}

.chip-flag {
  font-size: 1.1rem;
  line-height: 1;
}

/* Healthcare Equity & Diagnostic Access Indicators Display Card */
.compass-equity-card {
  margin-top: 0.85rem;
  padding: 1.15rem;
  background: rgba(14, 21, 36, 0.85);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.equity-card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.65rem;
}

.equity-country-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.equity-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.equity-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-primary, #f8fafc);
}

.equity-region-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.35);
  color: var(--neon-cyan, #00f3ff);
}

.equity-indicators-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .equity-indicators-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.equity-indicator-block {
  background: rgba(5, 7, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.indicator-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neon-cyan, #00f3ff);
}

.indicator-text {
  font-size: 0.88rem;
  color: var(--ink-secondary, #cbd5e1);
  line-height: 1.45;
  margin: 0;
}

.res-intl-drawer {
  margin-top: 0.75rem;
}

.res-intl-drawer-summary {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 243, 255, 0.28);
  color: var(--ink-primary, #f8fafc);
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Modulator Liver Safety & openFDA Regulatory Comparator (T-0438) */
.res-safety {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--bg-panel, #0a0a0a);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
}
.safety-controls-grid {
  margin: 1.25rem 0;
}
.safety-control-label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neon-cyan, #00f3ff);
  margin-bottom: 0.5rem;
}
.safety-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.safety-regimen-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink-primary, #f8fafc);
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.safety-regimen-btn:hover {
  border-color: var(--neon-cyan, #00f3ff);
  color: var(--neon-cyan, #00f3ff);
}
.safety-regimen-btn.is-active,
.safety-regimen-btn[aria-pressed="true"] {
  background: rgba(0, 243, 255, 0.14);
  border-color: var(--neon-cyan, #00f3ff);
  color: #ffffff;
}
.safety-readout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}
@media (min-width: 768px) {
  .safety-readout-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.safety-card {
  background: rgba(5, 7, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.safety-card-lbl {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neon-cyan, #00f3ff);
}
.safety-card-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-primary, #f8fafc);
  line-height: 1.4;
}
.safety-card-sub {
  font-size: 0.82rem;
  color: var(--ink-secondary, #cbd5e1);
  line-height: 1.45;
  margin: 0.25rem 0 0;
}
.warning-present {
  color: #f87171 !important;
}
.warning-absent {
  color: #34d399 !important;
}
