/*
 * Canonical public compositions for AVDS4.
 *
 * Load order is intentional: tokens -> primitives -> product CSS -> this file.
 * The few !important declarations below neutralise legacy product rules that
 * otherwise force a conflicting grid or absolute positioning on public pages.
 */

:root {
  --av-public-ink: hsl(var(--foreground));
  --av-public-muted: hsl(var(--muted-foreground));
  --av-public-line: hsl(var(--border));
  --av-public-panel: hsl(var(--card));
  --av-public-canvas: hsl(var(--background));
  --av-public-subtle: hsl(var(--muted));
  --av-public-input-line: hsl(var(--input));
  --av-public-gold: hsl(var(--chart-1));
}

html[data-product] :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid hsl(var(--ring));
  outline-offset: 3px;
}

html[data-product="antifake"] .af-service-shell {
  width: min(calc(100% - 2rem), 76rem);
  margin-inline: auto;
}

html[data-product="antifake"] .af-service-hero {
  min-height: 0;
  margin-block: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: var(--av-public-ink);
  background: linear-gradient(
    112deg,
    var(--av-public-panel),
    var(--av-public-subtle)
  );
  border: 1px solid var(--av-public-line);
  border-radius: 1rem;
  box-shadow: none;
}

html[data-product="antifake"] .af-service-hero :is(h1, .af-service-hero__title) {
  max-width: 19ch;
  margin: .25rem 0 .85rem;
  color: var(--av-public-ink);
  font-family: var(--font-sans);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}

html[data-product="antifake"] .af-service-hero > p:not(.af-kicker),
html[data-product="antifake"] .af-service-hero__lead {
  max-width: 65ch;
  margin: 0;
  color: var(--av-public-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
}

html[data-product="antifake"] .af-service-hero .af-kicker {
  margin: 0 0 .5rem;
  color: var(--av-public-muted);
}

/* Compatibility override: old guide CSS fixes this layout to a narrow column. */
html[data-product="antifake"] .af-guide-shell .guide-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem) !important;
  gap: clamp(2rem, 5vw, 4rem) !important;
  align-items: start;
  max-width: none;
  margin: 0 0 clamp(2.5rem, 6vw, 5rem);
}

html[data-product="antifake"] .guide-content {
  min-width: 0;
  max-width: 48rem;
}

html[data-product="antifake"] .guide-sidebar {
  display: block;
  min-width: 0;
  align-self: stretch;
}

html[data-product="antifake"] .guide-sidebar-inner {
  position: sticky;
  top: 7.85rem;
  padding: 1.15rem;
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .875rem;
}

/* Keep the existing guide contents usable outside its compact two-column mode. */
@media (min-width: 761px) {
  html[data-product="antifake"] .antifake-guide-page .guide-toc-title {
    margin: 0 0 .5rem;
    font-size: .875rem;
  }

  html[data-product="antifake"] .antifake-guide-page .guide-toc-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .25rem;
    overflow: visible;
    padding-bottom: 0;
  }

  html[data-product="antifake"] .antifake-guide-page .guide-toc-link {
    display: flex;
    min-width: 0;
    min-height: 2rem;
    padding: .25rem .375rem;
    border-radius: .375rem;
    white-space: normal;
  }

  html[data-product="antifake"] .antifake-guide-page .guide-toc-link:is(:hover, .is-active) {
    color: var(--av-public-ink);
    background: var(--av-public-subtle);
  }
}

/* A short viewport must still be able to scroll through the complete sidebar. */
@media (min-width: 901px) and (max-height: 719px) {
  html[data-product="antifake"] .guide-sidebar-inner { position: static; }
}

html[data-product="antifake"] .guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .875rem;
}

html[data-product="antifake"] .guide-type-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem 1rem;
  min-height: 0;
  padding: 1.15rem;
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .875rem;
}

html[data-product="antifake"] .guide-type-icon {
  position: static !important;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--av-public-ink);
  background: var(--av-public-subtle);
  border-radius: .55rem;
}

html[data-product="antifake"] .guide-type-card :is(h3, p, .guide-example) {
  grid-column: 2;
  margin: 0;
}

html[data-product="antifake"] .guide-type-card h3,
html[data-product="antifake"] .guide-step h3,
html[data-product="antifake"] .guide-tools-list h3,
html[data-product="antifake"] .guide-actions-list h3,
html[data-product="antifake"] .guide-faq h3 {
  color: var(--av-public-ink);
  font-family: var(--font-sans);
}

html[data-product="antifake"] .guide-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  padding: 0;
  list-style: none;
}

html[data-product="antifake"] .guide-check-item {
  position: relative;
  min-height: 3.4rem;
  padding: .8rem .9rem .8rem 2.6rem;
  color: var(--av-public-ink);
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .7rem;
  line-height: 1.35;
}

html[data-product="antifake"] .guide-check-item::before {
  position: absolute;
  top: .8rem;
  left: .9rem;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--av-public-muted);
  border-radius: .2rem;
  content: "";
}

html[data-product="antifake"] .guide-step {
  padding: 1.35rem 0;
  border-top: 1px solid var(--av-public-line);
}

html[data-product="antifake"] .af-tools-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .52fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  align-items: start;
}

html[data-product="antifake"] .af-tools-hero > :not(.af-tools-hero__route) {
  grid-column: 1;
}

html[data-product="antifake"] .af-tools-hero__route {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin: 0;
  padding: 1.2rem 1.3rem;
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .875rem;
}

html[data-product="antifake"] .af-tools-hero__route :is(strong, ol) { margin: 0; }
html[data-product="antifake"] .af-tools-hero__route ol { display: grid; gap: .65rem; padding-left: 1.25rem; margin-top: .7rem; color: var(--av-public-muted); }
html[data-product="antifake"] .af-tools-hero__route a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
html[data-product="antifake"] .af-tools-hero__route a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

html[data-product="antifake"] .af-tools-privacy {
  grid-column: 1 / -1;
  padding: 0;
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .75rem;
}

html[data-product="antifake"] .af-tools-privacy summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.25rem;
  padding: .75rem 1rem;
  color: var(--av-public-ink);
  cursor: pointer;
}

html[data-product="antifake"] .af-tools-privacy summary svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
html[data-product="antifake"] .af-tools-privacy p { max-width: 72ch; margin: 0; padding: 0 1rem 1rem 3rem; color: var(--av-public-muted); line-height: 1.5; }

html[data-product="antifake"] .af-mission-console,
html[data-product="antifake"] .af-tools-role-matrix,
html[data-product="antifake"] .af-tool-form,
html[data-product="antifake"] .af-osint-group,
html[data-product="antifake"] .af-research-evidence-principles > article {
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .875rem;
  box-shadow: none;
}

html[data-product="antifake"] .af-mission-console { padding: clamp(1.25rem, 3vw, 2rem); }
html[data-product="antifake"] .af-mission-console__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
html[data-product="antifake"] .af-mission-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; min-height: 6.5rem; padding: 1rem; color: var(--av-public-ink); border: 1px solid var(--av-public-line); border-radius: .75rem; }
html[data-product="antifake"] .af-mission-card__icon { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border: 1px solid var(--av-public-line); border-radius: .6rem; }
html[data-product="antifake"] .af-mission-card__icon svg { width: 1.25rem; height: 1.25rem; }
html[data-product="antifake"] .af-mission-card :is(small, strong, em) { display: block; }
html[data-product="antifake"] .af-mission-card small { color: var(--av-public-muted); font-style: normal; }
html[data-product="antifake"] .af-mission-card strong { margin: .15rem 0; }
html[data-product="antifake"] .af-mission-card em { color: var(--av-public-muted); font-size: .9rem; font-style: normal; }

html[data-product="antifake"] .af-tools-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 2.75rem;
  padding: .65rem .8rem;
  color: var(--av-public-ink);
  background: var(--av-public-canvas);
  border: 1px solid var(--av-public-input-line);
  border-radius: .55rem;
  font: inherit;
}

/* Compatibility boundary for the pre-AVDS product stylesheet: every public
   field and button in the governed main region remains keyboard- and
   touch-reachable. The important flag is intentionally limited to this final
   public layer because older page modules set more-specific compact heights. */
html[data-product="antifake"] main[data-av-quality-scope] :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .af-btn,
  .av-btn
) {
  min-height: 2.75rem !important;
}

html[data-product="antifake"] main[data-av-quality-scope] :is(.af-btn, .av-btn) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

html[data-product="ortcom"] main[data-av-quality-scope] :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  button,
  .btn,
  .av-btn
) {
  min-height: 2.75rem;
}

html[data-product="antifake"] [data-theme-toggle] {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

/* Public actions use the same reachable target size in every composition.
   This deliberately lives in the canonical layer so compact legacy links do
   not turn into undersized controls on a single page. */
html[data-product="antifake"] :is(.af-guide-shell, .af-tools-shell, .af-research-shell, .af-bulletins-shell) .af-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
}

html[data-product="antifake"] .af-tools-shell .af-tool-suggestion {
  min-height: 2.5rem;
  padding: .45rem .7rem;
}

html[data-product="antifake"] .af-guide-shell .af-sidebar-cta {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  padding: 1rem;
  background: var(--av-public-panel);
  border: 1px solid var(--av-public-line);
  border-radius: .875rem;
}

html[data-product="antifake"] .af-guide-shell .af-sidebar-cta-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--av-public-ink);
  background: var(--av-public-subtle);
  border-radius: .65rem;
}

html[data-product="antifake"] .af-guide-shell .af-sidebar-cta :is(h2, p) { margin: 0; }
html[data-product="antifake"] .af-guide-shell .af-sidebar-cta h2 { font-size: 1rem; line-height: 1.25; }
html[data-product="antifake"] .af-guide-shell .af-sidebar-cta p { color: var(--av-public-muted); font-size: .9rem; line-height: 1.45; }
html[data-product="antifake"] .af-guide-shell .af-sidebar-cta h2 { grid-column: 2; }
html[data-product="antifake"] .af-guide-shell .af-sidebar-cta p { grid-column: 1 / -1; }
html[data-product="antifake"] .af-guide-shell .af-sidebar-report-button { grid-column: 1 / -1; width: 100%; }

html[data-product="antifake"] .af-tools-shell details > summary {
  min-height: 3.25rem;
  padding: .85rem 1rem;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary,
html[data-product="antifake"] .af-tools-shell .af-osint-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(14rem, .75fr) auto;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary > span:first-child {
  display: grid;
  gap: .18rem;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary > span:nth-child(2) {
  color: var(--av-public-muted);
  font-size: .9rem;
  line-height: 1.4;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary > b {
  padding: .3rem .5rem;
  color: var(--av-public-ink);
  background: var(--av-public-subtle);
  border: 1px solid var(--av-public-line);
  border-radius: .45rem;
  font-size: .78rem;
  white-space: nowrap;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  padding: 1rem;
}

html[data-product="antifake"] .af-tools-shell .af-tools-role-card {
  min-height: 8.5rem;
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--av-public-line);
  border-radius: .7rem;
  color: var(--av-public-ink);
  background: var(--av-public-panel);
}

html[data-product="antifake"] .af-tools-shell .af-tool-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
}

html[data-product="antifake"] .af-tools-shell .af-tool-panel > summary > span:nth-child(2) {
  display: grid;
  gap: .2rem;
  min-width: 0;
}

html[data-product="antifake"] .af-tools-shell .af-tool-panel > summary small {
  color: var(--av-public-muted);
  line-height: 1.4;
}

html[data-product="antifake"] .af-research-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, .62fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
html[data-product="antifake"] .af-research-hero__aside { display: grid; gap: .8rem; }
html[data-product="antifake"] .af-research-shell .af-research-language-notice { margin: 1rem 0; }
html[data-product="antifake"] .af-research-shell .af-research-language-notice .av-alert__message a {
  display: block;
  width: fit-content;
  margin-top: .4rem;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .2em;
}
html[data-product="antifake"] .af-research-shell .af-research-language-notice .av-alert__message a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
html[data-product="antifake"] .af-research-hero__facts,
html[data-product="antifake"] .af-research-hero__formats { background: var(--av-public-panel); border: 1px solid var(--av-public-line); border-radius: .8rem; overflow: hidden; }
html[data-product="antifake"] .af-research-evidence-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
html[data-product="antifake"] .af-research-evidence-principles > article { padding: 1.15rem; }
html[data-product="antifake"] .af-research-evidence-principles :is(h3, p) { margin: 0; }
html[data-product="antifake"] .af-research-evidence-principles h3 { color: var(--av-public-ink); font-size: 1rem; }
html[data-product="antifake"] .af-research-evidence-principles p { margin-top: .55rem; color: var(--av-public-muted); line-height: 1.45; }

@media (max-width: 620px) {
  html[data-product="antifake"] body.antifake-research-page .af-research-shell .af-research-hero__actions .af-btn {
    min-height: 2.75rem;
  }
}

html[data-product="antifake"] .af-bulletin-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .45fr) auto max-content; gap: .75rem; align-items: end; padding: 1rem; background: var(--av-public-panel); border: 1px solid var(--av-public-line); border-radius: .875rem; }
html[data-product="antifake"] .af-bulletin-filters label { display: grid; gap: .35rem; color: var(--av-public-muted); font-size: .85rem; font-weight: 700; }
html[data-product="antifake"] .af-bulletin-filters select { width: 100%; min-height: 2.75rem; padding-inline: .8rem; color: var(--av-public-ink); background: var(--av-public-canvas); border: 1px solid var(--av-public-input-line); border-radius: .55rem; font: inherit; }
html[data-product="antifake"] .af-bulletin-filters > .af-btn { min-height: 2.75rem; white-space: nowrap; }
html[data-product="antifake"] .af-bulletin-filters-summary { margin: 0 0 .72rem; color: var(--av-public-muted); white-space: nowrap; }

html[data-product="antifake"] .af-bulletin-featured { display: grid; background: var(--av-public-panel); border: 1px solid var(--av-public-line); border-radius: 1rem; overflow: hidden; }
html[data-product="antifake"] .af-bulletin-featured--with-media { grid-template-columns: minmax(15rem, .72fr) minmax(0, 1fr); }
html[data-product="antifake"] .af-bulletin-featured--without-media { grid-template-columns: 1fr; }
html[data-product="antifake"] .af-bulletin-featured__media { min-height: 100%; background: var(--av-public-subtle); }
html[data-product="antifake"] .af-bulletin-featured__media img { width: 100%; height: 100%; min-height: 14rem; object-fit: cover; }
html[data-product="antifake"] .af-bulletin-featured__body { padding: clamp(1.25rem, 3vw, 2rem); }
html[data-product="antifake"] .af-bulletin-featured :is(h2, h3, .av-feed-card__title) { font-family: var(--font-sans); }

html[data-product] .av-feed-card__media--neutral {
  display: grid;
  place-items: center start;
  min-height: 9rem;
  padding: 1.15rem;
  color: var(--av-public-muted);
  background: linear-gradient(135deg, var(--av-public-panel), var(--av-public-subtle));
  border-bottom: 1px solid var(--av-public-line);
}

html[data-product] .av-feed-card__media--neutral span { font-size: .75rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }

html[data-product="antifake"] .af-publication-card { border-color: var(--av-public-line); box-shadow: none; }
html[data-product="antifake"] .af-publication-card .av-feed-card__title { font-family: var(--font-sans); font-weight: 750; }
html[data-product="antifake"] .av-feed-card__title { font-family: var(--font-sans); }
html[data-product="antifake"] .af-publication-card :is(.av-feed-card__deck, .av-feed-card__meta) { color: var(--av-public-muted); }

html[data-product="ortcom"] :is(.av-feed-card, .ortcom-card) { border-color: var(--av-public-line); box-shadow: var(--shadow-xs); }
html[data-product="ortcom"] :is(input, select, textarea) { border-radius: .5rem; }

html[data-product="ortcom"] :is(.av-home-hero, .av-home-hero__media) {
  /* Hero copy must retain AA contrast even while media is absent or loading. */
  background-color: hsl(224 60% 12%);
}

html[data-product="ortcom"] .digest-page :is(.digest-article-card, .digest-event-item, .digest-ann-item) {
  color: var(--av-public-ink);
  background: var(--av-public-panel);
  border-color: var(--av-public-line);
}

html[data-product="ortcom"] .digest-page :is(.digest-article-title, .digest-event-title, .digest-ann-title) {
  color: var(--av-public-ink);
}

html[data-product="ortcom"] .digest-page :is(.digest-article-lead, .digest-article-meta) {
  color: var(--av-public-muted);
}

html[data-product="ortcom"] .digest-page :is(.digest-cat-badge, .digest-event-type-badge) {
  color: var(--av-public-ink);
  background: var(--av-public-subtle);
  border: 1px solid var(--av-public-line);
}

@media (max-width: 900px) {
  html[data-product="antifake"] .af-guide-shell .guide-layout,
  html[data-product="antifake"] .af-tools-hero,
  html[data-product="antifake"] .af-research-hero,
  html[data-product="antifake"] .af-bulletin-featured--with-media { grid-template-columns: 1fr !important; }

  html[data-product="antifake"] .guide-sidebar-inner { position: static; }
  html[data-product="antifake"] .af-tools-hero > :not(.af-tools-hero__route),
  html[data-product="antifake"] .af-tools-hero__route { grid-column: auto; grid-row: auto; }
  html[data-product="antifake"] .af-research-evidence-principles { grid-template-columns: 1fr; }
  html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary { grid-template-columns: minmax(0, 1fr) auto; }
  html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__summary > span:nth-child(2) { display: none; }
  html[data-product="antifake"] .af-bulletin-filters { grid-template-columns: 1fr 1fr; }
  html[data-product="antifake"] .af-bulletin-filters > :is(.af-btn, p) { grid-column: auto; }
}

@media (max-width: 600px) {
  html[data-product="antifake"] .af-service-shell { width: min(calc(100% - 1.25rem), 76rem); }
  html[data-product="antifake"] .af-service-hero { padding: 1.25rem; border-radius: .75rem; }
  html[data-product="antifake"] .guide-grid,
  html[data-product="antifake"] .guide-checklist,
  html[data-product="antifake"] .af-mission-console__grid,
  html[data-product="antifake"] .af-tools-shell .af-tools-role-matrix__grid,
  html[data-product="antifake"] .af-bulletin-filters { grid-template-columns: 1fr; }
  html[data-product="antifake"] .af-tools-shell .af-tools-role-card { min-height: auto; }
  html[data-product="antifake"] .guide-type-card :is(h3, p, .guide-example) { grid-column: 1 / -1; }
  html[data-product="antifake"] .guide-type-icon { grid-column: 1; }
  html[data-product="antifake"] .af-bulletin-filters > :is(.af-btn, p) { grid-column: 1; }
  html[data-product="antifake"] .af-bulletin-filters-summary { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-product] *, html[data-product] *::before, html[data-product] *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* AVDS 4.7 public uplift v128.
   AntiFake's opening surface used a separate, light-only palette after the
   token adapter. Map that composition back to semantic AVDS surfaces, while
   retaining the Centre's blue/gold institutional signature. */
html[data-product="antifake"] {
  --af-shell-navy: hsl(var(--primary));
  --af-shell-navy-deep: hsl(var(--foreground));
  --af-hero-ink: hsl(var(--foreground));
  --af-hero-copy: hsl(var(--muted-foreground));
  --af-hero-surface: hsl(var(--background));
  --af-hero-surface-strong: hsl(var(--muted));
  --af-panel-surface: hsl(var(--card));
  --af-panel-border: hsl(var(--border));
  --af-panel-muted: hsl(var(--accent));
  --af-panel-shadow: var(--shadow-md);
  --af-action: hsl(var(--primary));
  --af-action-hover: hsl(var(--sidebar-primary));
  --ortcom-ds-border: hsl(var(--border));
  --ortcom-ds-border-soft: hsl(var(--card-border));
  --gold: hsl(var(--chart-3));
  --gold-hover: hsl(var(--chart-3));
}

html[data-product="antifake"][data-theme="dark"] {
  --af-shell-navy: hsl(var(--sidebar));
  --af-shell-navy-deep: hsl(var(--background));
  --af-hero-surface: hsl(var(--background));
  --af-hero-surface-strong: hsl(var(--secondary));
  --af-panel-surface: hsl(var(--card));
  --af-panel-border: hsl(var(--border));
  --af-panel-muted: hsl(var(--accent));
  --af-action: hsl(var(--primary));
  --af-action-hover: hsl(var(--sidebar-primary));
}

/* The shell intentionally scopes a darker primary inside the opening panel.
   Rebind the action aliases at that same scope so custom-property values do
   not retain the lighter page-level primary. */
html[data-product="antifake"][data-theme="dark"] .af-home-intro {
  --af-action: hsl(var(--primary));
  --af-action-hover: hsl(var(--primary));
}

/* The dark product shell makes its action blue deliberately lighter than the
   light theme. Its readable foreground is the dark AVDS canvas, not the
   light-theme white used by legacy button rules. */
html[data-product="antifake"][data-theme="dark"] .af-home-intro :is(
  .af-home-intro__actions .af-btn--primary,
  .af-home-check-form .af-btn
) {
  color: hsl(var(--primary-foreground)) !important;
}

html[data-product="antifake"][data-theme="dark"] .af-home-intro
  .af-home-intro__actions
  .af-btn--secondary {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--card));
}

html[data-product="antifake"] .af-site-header :is(
  .af-site-report-link,
  [data-theme-toggle],
  .af-site-languages a
):focus-visible {
  outline-color: hsl(var(--ring));
  outline-offset: 3px;
}

html[data-product="antifake"] .af-home-intro__panel,
html[data-product="antifake"] .af-home-task.av-cta-tile,
html[data-product="antifake"] .af-home-priority-card.av-feed-card,
html[data-product="antifake"] .antifake-index-page .af-card.av-feed-card {
  box-shadow: var(--shadow-sm);
}

/* The search console is the primary mobile journey. Keep its direct report
   alternative visible without duplicating the "start checking" affordance
   that the adjacent form already provides. */
@media (max-width: 820px) {
  html[data-product="antifake"] .af-home-intro__actions {
    display: flex;
    margin-top: var(--avds-space-content);
  }

  html[data-product="antifake"] main[data-av-quality-scope]
    .af-home-intro__actions
    .af-btn--primary {
    display: inline-flex !important;
    min-width: min(100%, 12.5rem);
  }

  html[data-product="antifake"] .af-home-intro__actions .af-btn--secondary {
    display: none;
  }
}

/* Compact navigation has one clearly reachable information hierarchy: the
   tool route stays in the More disclosure until it is the active route. This
   removes the clipped fourth label visible on 320–420 px screens. */
@media (max-width: 420px) {
  html[data-product="antifake"] .af-site-nav__scroll > a:nth-child(4):not([aria-current="page"]) {
    display: none !important;
  }

  html[data-product="antifake"] .af-site-nav__scroll {
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  html[data-product="antifake"] .af-site-nav__scroll::-webkit-scrollbar {
    display: none;
  }

  html[data-product="antifake"] .af-site-nav__scroll > a {
    scroll-snap-align: start;
  }
}

/* ORTCOM legacy pages inherit the AVDS dark palette through the same public
   adapter. A light primary must never become the background for a white-text
   page header, and old literal-white empty/KPI cards must remain surfaces. */
html[data-site="ortcom"][data-theme="dark"] :is(
  .page-header,
  .map-header
) {
  --primary: 224 60% 22%;
  --primary-foreground: 0 0% 100%;
  background: hsl(var(--primary));
}

html[data-site="ortcom"][data-theme="dark"] :is(
  .cabinet-empty,
  .kpi-card
) {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--card));
}

html[data-site="ortcom"][data-theme="dark"] :is(
  .cabinet-empty p,
  .kpi-label
) {
  color: hsl(var(--muted-foreground));
}

html[data-site="ortcom"][data-theme="dark"] .kpi-val {
  color: hsl(var(--primary));
}

html[data-site="ortcom"][data-theme="dark"] .map-wrap {
  background: hsl(var(--muted));
}

html[data-site="ortcom"][data-theme="dark"] .map-sidebar {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--card));
}

html[data-site="ortcom"][data-theme="dark"] .panel-hero {
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
}

html[data-site="ortcom"][data-theme="dark"] :is(
  .panel-hero-title,
  .sidebar-close,
  .panel-expand
) {
  color: hsl(var(--primary-foreground));
}

html[data-site="ortcom"][data-theme="dark"] .panel-hero-sub {
  color: hsl(var(--primary-foreground) / 0.82);
}

html[data-site="ortcom"][data-theme="dark"] .map-layer-btn {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--card));
}

html[data-site="ortcom"][data-theme="dark"] .map-layer-btn.active {
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
}


/* A related article without a cleared picture uses the existing text card. */
.article-page .article-sidebar .list-item.article-sidebar-item--text {
  grid-template-columns: minmax(0, 1fr);
}

/* Existing AccentCard remains text-only when no cleared picture is present. */
.category-page .category-listing-card--text .category-card-date {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: var(--text-sm);
  margin-bottom: 0.6rem;
}
.category-page .category-listing-card--text .category-card-lead {
  color: hsl(var(--muted-foreground));
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0.65rem 0 0;
}

.category-page #articlesGrid .category-listing-card--text .card-title {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0 !important;
  font-size: 1rem !important;
  line-height: 1.45 !important;
}
.category-page #articlesGrid .category-listing-card--text .card-title a {
  display: inline;
}
/* Preserve separate media destinations when the footer becomes one column. */
.site-footer .footer-grid > div:nth-child(5) .footer-links a {
  display: block;
}

.category-page #articlesGrid .category-listing-card--text {
  display: block;
}
.category-page #articlesGrid .category-listing-card--text .card-title a {
  font-size: inherit;
  line-height: inherit;
}

/* The category photo keeps its subjects visible at the tablet breakpoint. */
.category-page #articlesGrid .category-listing-card .card-img {
  width: 100%;
  min-width: 0;
  height: auto !important;
  max-height: none;
  aspect-ratio: auto;
}
.category-page #articlesGrid .category-listing-card .card-img img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 16.25rem;
  object-fit: contain;
}

/* Presidential CCS archive: product-owned responsive grid; FeedCard owns its appearance. */
.presidential-archive__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.presidential-archive__grid > div { display: flex; min-width: 0; }
.presidential-archive__grid > div > .av-feed-card { width: 100%; height: 100%; }
@media (max-width: 1023px) { .presidential-archive__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .presidential-archive__grid { grid-template-columns: minmax(0, 1fr); } }
/* Four real controls, without the legacy optional-category grid column. */
.presidential-archive__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem) minmax(9rem, 12rem) max-content;
  align-items: end;
  gap: 0.75rem;
}
.presidential-archive__form > .av-field { min-width: 0; }
.presidential-archive__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}
.presidential-archive__actions .view-toggle { margin-left: auto; }
@media (max-width: 1023px) {
  .presidential-archive__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presidential-archive__form .filter-group--search,
  .presidential-archive__actions { grid-column: 1 / -1; }
}

/* Service information: reader overview, current leadership, then contact tasks.
   Existing AVDS PageHeader, PersonCard, Card and Button own the primitives. */
.service-about { padding-block:1.75rem 2.5rem; }
.service-about__header .av-breadcrumbs-wrap { margin-bottom:1rem; }
.service-about__header .av-page-header { align-items:flex-start; }
.service-about__header .av-page-header__main { align-self:flex-start; }
.service-about__header .av-page-header__title { text-align:left; }
.service-about__header .av-page-header__underline { display:none; }
.service-about__intro { max-width:55rem; margin-block:1.75rem 2.5rem; font-size:1.0625rem; line-height:1.7; }
.service-about__intro p { margin:0 0 .75rem; }
.service-about__section { margin-top:2.5rem; }
.service-about__section > h2 { margin:0 0 1.25rem; font-family:var(--font-display); font-size:1.5rem; font-weight:600; line-height:1.25; scroll-margin-top:9rem; }
.service-about__director { max-width:55rem; align-items:center; gap:2rem; }
.service-about__director .av-person-card__avatar { width:180px; height:240px; border:0; border-radius:var(--radius); object-fit:cover; object-position:center; }
.service-about__director .av-person-card__name { max-width:26rem; font-family:var(--font-display); line-height:1.25; }
.service-about__director .av-person-card__role { margin-top:.75rem; font-size:1rem; line-height:1.5; }
.service-about__photo-credit { margin:.5rem 0 0; max-width:55rem; font-size:.75rem; line-height:1.5; color:hsl(var(--muted-foreground)); }
.service-about a:not(.av-btn) { color:hsl(var(--primary)); text-underline-offset:.2em; }
.service-about a:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:3px; }
.service-about__photo-credit a { color:inherit; }
.service-about__contact-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.25rem; }
.service-about__contact-card { display:flex; flex-direction:column; align-items:flex-start; gap:.5rem; }
.service-about__contact-card h3 { margin:0 0 .25rem; font-family:var(--font-display); font-size:1.125rem; font-weight:600; line-height:1.4; }
.service-about__contact-card a { display:inline-flex; align-items:center; min-height:44px; max-width:100%; overflow-wrap:anywhere; }
.service-about__contact-card .service-about__phone { font-size:clamp(1.125rem,2.2vw,1.5rem); font-weight:600; text-decoration:none; font-variant-numeric:tabular-nums; }
.service-about__contact-card address { font-style:normal; line-height:1.6; margin:.25rem 0; }
.service-about__contact-card .av-btn { margin-top:.5rem; }
.service-about__contact-list { display:grid; gap:1.5rem; margin:2rem 0 0; }
.service-about__contact-list > div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:1rem 2rem; }
.service-about__contact-list dt { font-weight:600; line-height:1.5; }
.service-about__contact-list dd { margin:0; display:flex; flex-direction:column; align-items:flex-start; gap:.25rem; min-width:0; }
.service-about__contact-list dd > span { display:flex; align-items:center; flex-wrap:wrap; column-gap:.75rem; }
.service-about__contact-list a { display:inline-flex; align-items:center; gap:.35rem; min-height:44px; overflow-wrap:anywhere; }
.service-about__contact-list .service-about__socials { flex-direction:row; flex-wrap:wrap; column-gap:1.25rem; }
@media(max-width:639px) {
 .service-about__intro { margin-block:1.25rem 2rem; font-size:1rem; }
 .service-about__section { margin-top:2rem; }
 .service-about__director { padding:1rem; gap:1rem; }
 .service-about__director .av-person-card__avatar { width:112px; height:149px; }
 .service-about__director .av-person-card__name { font-size:1.125rem; }
 .service-about__director .av-person-card__role { font-size:.875rem; }
 .service-about__contact-cards { grid-template-columns:minmax(0,1fr); }
 .service-about__contact-list > div { grid-template-columns:minmax(0,1fr); gap:.25rem; }
}
@media(max-width:359px) {
 .service-about__director { flex-direction:column; align-items:flex-start; }
}

/* Ordinary news: a credited photograph and readable continuation paths. */
.article-page--reader .article-hero-copyright {
  max-width: 100%;
  padding: .375rem .625rem;
  background: rgb(0 0 0 / 70%);
  color: #fff;
  font-size: .8125rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.article-page--reader .article-sidebar-item--reader {
  display: block;
}
.article-page--reader .article-sidebar-item--reader .list-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  font-size: .9375rem;
  line-height: 1.5;
}
.article-page--reader .article-sidebar-item--reader .list-title a {
  display: block;
  width: 100%;
  font: inherit;
  overflow: visible;
  -webkit-line-clamp: unset;
  overflow-wrap: anywhere;
}
.article-page--reader .article-related-bottom--reader {
  display: block;
}
.article-page--reader .related-card-mini {
  align-items: flex-start;
  padding: .75rem;
}
.article-page--reader .related-card-mini-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  font-size: .9375rem;
  line-height: 1.5;
}
.article-page--reader .related-card-mini-date {
  color: hsl(var(--muted-foreground));
}
@media (max-width: 640px) {
  .article-page--reader .article-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Regional service names must remain readable beside the archive action. */
.service-about--rsk .av-page-header__title { white-space:normal; overflow:visible; text-overflow:clip; }
