.ahead-md-public {
  width: 100%;
  max-width: 100%;
  --ahead-md-border: #d1d5db;
  --ahead-md-text: #111827;
  --ahead-md-muted: #4b5563;
  --ahead-md-surface: #ffffff;
  --ahead-md-surface-alt: #f9fafb;
  --ahead-md-accent: #4c1130;
  --ahead-md-focus: #1d4ed8;
  --ahead-md-success-bg: #dff6e7;
  --ahead-md-success-text: #0f5132;
  --ahead-md-watch-bg: #fff3cd;
  --ahead-md-watch-text: #664d03;
  --ahead-md-danger-bg: #f8d7da;
  --ahead-md-danger-text: #842029;
  --ahead-md-neutral-bg: #e5e7eb;
  --ahead-md-neutral-text: #1f2937;
  --ahead-md-radius: 12px;
  --ahead-md-gap: 16px;
  --ahead-md-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
  --ahead-md-on-accent: #ffffff;
  color: var(--ahead-md-text);
  overflow-wrap: anywhere;
}

.ahead-md-public *,
.ahead-md-public *::before,
.ahead-md-public *::after {
  box-sizing: border-box;
}

.ahead-md-public a {
  color: var(--ahead-md-accent);
}

.ahead-md-public a:focus,
.ahead-md-public button:focus,
.ahead-md-public input:focus,
.ahead-md-public select:focus,
.ahead-md-public [tabindex="0"]:focus {
  outline: 3px solid var(--ahead-md-focus);
  outline-offset: 2px;
}

.ahead-md-public__header,
.ahead-md-card,
.ahead-md-public__summary-card {
  background: var(--ahead-md-surface);
  border: 1px solid var(--ahead-md-border);
  border-radius: var(--ahead-md-radius);
  box-shadow: var(--ahead-md-shadow);
}

.ahead-md-public__header,
.ahead-md-card {
  padding: calc(var(--ahead-md-gap) * 1.25);
  margin-bottom: var(--ahead-md-gap);
}

.ahead-md-public__header h2,
.ahead-md-card h2,
.ahead-md-card h3,
.ahead-md-card h4 {
  margin-top: 0;
  color: var(--ahead-md-text);
}

.ahead-md-public__intro,
.ahead-md-card__direction,
.ahead-md-card__eyebrow,
.ahead-md-trend__legend,
.ahead-md-evidence-list,
.ahead-md-detail__back {
  color: var(--ahead-md-muted);
}

.ahead-md-public__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ahead-md-gap);
  margin-bottom: var(--ahead-md-gap);
}

.ahead-md-public__summary-card {
  padding: calc(var(--ahead-md-gap) * 0.9);
}

.ahead-md-public__summary-card strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
}

.ahead-md-public__filters {
  display: flex;
  flex-direction: column;
  gap: var(--ahead-md-gap);
  margin-bottom: var(--ahead-md-gap);
  padding: calc(var(--ahead-md-gap) * 1.1);
  background: var(--ahead-md-surface-alt);
  border: 1px solid var(--ahead-md-border);
  border-radius: var(--ahead-md-radius);
}

/* Row 1: text/select fields in an even responsive grid. Keeping these in their
 * own row (no tall fieldset mixed in) gives consistent column heights and
 * removes the large empty gap the single auto-fit grid produced. */
.ahead-md-public__filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ahead-md-gap);
  align-items: end;
}

/* Row 3: comparison mode on the left, actions on the right. */
.ahead-md-public__filter-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ahead-md-gap);
  padding-top: var(--ahead-md-gap);
  border-top: 1px solid var(--ahead-md-border);
}

.ahead-md-public__toggle {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 260px;
}

.ahead-md-public__filter-fields label span,
.ahead-md-public__toggle span,
.ahead-md-public__filters legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ahead-md-public__filter-fields label {
  display: flex;
  flex-direction: column;
}

.ahead-md-public__filters input,
.ahead-md-public__filters select {
  width: 100%;
}

.ahead-md-public__filters input,
.ahead-md-public__filters select,
.ahead-md-public__reset {
  min-height: 44px;
  border: 1px solid #6b7280;
  border-radius: max(0px, calc(var(--ahead-md-radius) - 4px));
  padding: 0.65rem 0.75rem;
  background: var(--ahead-md-surface);
  text-decoration: none;
}

/* Checkboxes/radios must not inherit the full-width, tall field styling above,
 * or they render as oversized blocks that push their labels onto a new line
 * (e.g. the Jurisdictions filter list). Keep them at their natural size. */
.ahead-md-public__filters input[type="checkbox"],
.ahead-md-public__filters input[type="radio"] {
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0;
  border-radius: 0;
  flex: 0 0 auto;
}

.ahead-md-public__filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.ahead-md-public__filter-actions button,
.ahead-md-public__filter-actions .ahead-md-public__reset {
  width: auto;
}

.ahead-md-public__filters button {
  min-height: 44px;
  background: var(--ahead-md-accent);
  color: var(--ahead-md-on-accent, #ffffff);
  border: 0;
  border-radius: max(0px, calc(var(--ahead-md-radius) - 4px));
  padding: 0.8rem 1rem;
  cursor: pointer;
}

.ahead-md-public__filter-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ahead-md-public__checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  padding: 0;
}

.ahead-md-public__checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--ahead-md-border);
  border-radius: 999px;
  background: var(--ahead-md-surface);
  line-height: 1.2;
  cursor: pointer;
}

.ahead-md-public__checkboxes label:hover {
  border-color: var(--ahead-md-accent);
}

.ahead-md-public__checkboxes label:focus-within {
  outline: 2px solid var(--ahead-md-focus);
  outline-offset: 2px;
}

.ahead-md-public__checkboxes label:has(input:checked) {
  border-color: var(--ahead-md-accent);
  box-shadow: inset 0 0 0 1px var(--ahead-md-accent);
}

.ahead-md-public__checkboxes input[type="checkbox"] {
  accent-color: var(--ahead-md-accent);
}

.ahead-md-public__checkboxes label span {
  display: inline;
  font-weight: 400;
  margin: 0;
}

.ahead-md-public__checkboxes input[type="checkbox"] {
  margin: 0;
}

.ahead-md-public__cards {
  display: grid;
  gap: var(--ahead-md-gap);
}

.ahead-md-card {
  overflow: hidden;
}

.ahead-md-card__header {
  display: flex;
  justify-content: space-between;
  gap: var(--ahead-md-gap);
  align-items: start;
  flex-wrap: wrap;
}

.ahead-md-card__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.ahead-md-card__footer-meta,
.ahead-md-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: var(--ahead-md-gap);
}

.ahead-md-card__footer-meta span {
  font-size: 0.95rem;
  color: var(--ahead-md-muted);
}

.ahead-md-card__status-stack {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.ahead-md-status,
.ahead-md-workflow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.ahead-md-status__icon {
  font-size: 1rem;
}

.ahead-md-status--on-track { background: var(--ahead-md-success-bg); color: var(--ahead-md-success-text); }
.ahead-md-status--watch { background: var(--ahead-md-watch-bg); color: var(--ahead-md-watch-text); }
.ahead-md-status--off-track { background: var(--ahead-md-danger-bg); color: var(--ahead-md-danger-text); }
.ahead-md-status--n-a { background: var(--ahead-md-neutral-bg); color: var(--ahead-md-neutral-text); }

.ahead-md-workflow {
  background: var(--ahead-md-surface-alt);
  color: var(--ahead-md-text);
  border: 1px solid var(--ahead-md-border);
}

.ahead-md-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: calc(var(--ahead-md-gap) * 0.75);
  margin: var(--ahead-md-gap) 0;
}

.ahead-md-metadata div {
  background: var(--ahead-md-surface-alt);
  border-radius: max(0px, calc(var(--ahead-md-radius) - 2px));
  padding: 0.85rem;
  border: 1px solid var(--ahead-md-border);
}

.ahead-md-metadata dt { font-weight: 700; }
.ahead-md-metadata dd { margin: 0.4rem 0 0; }

.ahead-md-card__section + .ahead-md-card__section {
  margin-top: var(--ahead-md-gap);
}

.ahead-md-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--ahead-md-border);
  border-radius: max(0px, calc(var(--ahead-md-radius) - 2px));
}

.ahead-md-activity-table,
.ahead-md-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.ahead-md-activity-table th,
.ahead-md-activity-table td,
.ahead-md-history-table th,
.ahead-md-history-table td {
  border-bottom: 1px solid var(--ahead-md-border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  color: var(--ahead-md-text);
  background: var(--ahead-md-surface);
}

.ahead-md-activity-table tbody tr:nth-child(even) td,
.ahead-md-history-table tbody tr:nth-child(even) td {
  background: var(--ahead-md-surface-alt);
}

.ahead-md-activity-table th,
.ahead-md-history-table th {
  background: var(--ahead-md-surface-alt);
  color: var(--ahead-md-text);
  font-weight: 700;
  border-bottom: 2px solid var(--ahead-md-border);
}

.ahead-md-history-table caption {
  text-align: left;
  padding: 0.85rem 0.75rem;
  font-weight: 700;
  color: var(--ahead-md-text);
}

/* Status overview table (top of dashboard) */
.ahead-md-public__overview {
  margin-bottom: var(--ahead-md-gap);
  overflow-x: auto;
}

.ahead-md-overview-table {
  width: 100%;
  min-width: 48rem;
  table-layout: auto;
  border-collapse: collapse;
  background: var(--ahead-md-surface);
  border: 1px solid var(--ahead-md-border);
  border-radius: var(--ahead-md-radius);
  overflow: hidden;
}

.ahead-md-overview-table__status-col {
  width: 12rem;
}

.ahead-md-overview-table__count-col {
  width: 8rem;
}

.ahead-md-overview-table__measures-col {
  width: auto;
}

.ahead-md-overview-table caption {
  text-align: left;
  padding: 0.75rem 0.85rem;
  font-weight: 700;
  color: var(--ahead-md-text);
}

.ahead-md-overview-table th,
.ahead-md-overview-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--ahead-md-border);
  color: var(--ahead-md-text);
  word-break: normal;
  overflow-wrap: normal;
}

.ahead-md-overview-table thead th {
  background: var(--ahead-md-surface-alt);
  font-weight: 700;
  border-top: 0;
}

.ahead-md-overview-table th:nth-child(2),
.ahead-md-overview-table td:nth-child(2),
.ahead-md-overview-table__count-heading,
.ahead-md-overview-table__count {
  width: 8rem;
  min-width: 8rem;
  max-width: none;
  text-align: center;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.ahead-md-overview-table__count {
  font-weight: 700;
  white-space: nowrap;
}

.ahead-md-overview-table__measures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ahead-md-overview-table__measures a {
  color: var(--ahead-md-accent);
  text-decoration: none;
}

.ahead-md-overview-table__measures a:hover,
.ahead-md-overview-table__measures a:focus {
  text-decoration: underline;
}

.ahead-md-overview-table__empty {
  color: var(--ahead-md-muted);
}

.ahead-md-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ahead-md-chip-list li {
  background: var(--ahead-md-surface-alt);
  border: 1px solid var(--ahead-md-border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.ahead-md-rich-text > *:first-child,
.ahead-md-evidence-list > li > *:first-child {
  margin-top: 0;
}

.ahead-md-evidence-list {
  padding-left: 1.2rem;
}

.ahead-md-trend {
  margin: 0 0 1rem;
  padding: 1rem;
  background: var(--ahead-md-surface-alt);
  border: 1px solid #cdd8e8;
  border-radius: max(0px, calc(var(--ahead-md-radius) - 2px));
}

.ahead-md-chart-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.ahead-md-chart-note,
.ahead-md-chart-legend-heading {
  margin: 0 0 0.65rem;
}

.ahead-md-trend__scroller {
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.ahead-md-trend__svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 14px;
}

.ahead-md-chart-grid {
  stroke: #d7deea;
  stroke-width: 1;
}

.ahead-md-chart-axis,
.ahead-md-chart-axis-label,
.ahead-md-chart-end-label {
  fill: #334155;
  stroke: none;
}

.ahead-md-chart-axis {
  stroke: #7c8aa0;
  stroke-width: 1.25;
}

.ahead-md-chart-axis-label {
  font-size: 12px;
  font-weight: 600;
}

.ahead-md-chart-line {
  stroke-width: 3.25;
  vector-effect: non-scaling-stroke;
}

.ahead-md-chart-line--series-1 { stroke: var(--ahead-md-accent); }
.ahead-md-chart-line--series-2 { stroke: #1f4f8a; }
.ahead-md-chart-line--series-3 { stroke: #6b21a8; }
.ahead-md-chart-line--series-4 { stroke: #0f766e; }

.ahead-md-chart-target {
  stroke-width: 2;
  fill: none;
}

.ahead-md-chart-target--statewide {
  stroke: #b45309;
  stroke-dasharray: 9 5;
}

.ahead-md-chart-target--jurisdiction {
  stroke: #7c3aed;
  stroke-dasharray: 3 4;
}

.ahead-md-chart-target-label {
  font-size: 12px;
  font-weight: 700;
}

.ahead-md-chart-target-label--statewide {
  fill: #b45309;
}

.ahead-md-chart-target-label--jurisdiction {
  fill: #7c3aed;
}

.ahead-md-legend-target {
  border-top-style: dashed;
}

.ahead-md-legend-target--statewide {
  color: #b45309;
}

.ahead-md-legend-target--jurisdiction {
  color: #7c3aed;
}

.ahead-md-legend-line--series-1 { color: var(--ahead-md-accent); }
.ahead-md-legend-line--series-2 { color: #1f4f8a; }
.ahead-md-legend-line--series-3 { color: #6b21a8; }
.ahead-md-legend-line--series-4 { color: #0f766e; }

.ahead-md-chart-point-shape {
  vector-effect: non-scaling-stroke;
  fill: #ffffff;
  stroke-width: 2;
}

.ahead-md-chart-point-shape--series-1 { stroke: var(--ahead-md-accent); }
.ahead-md-chart-point-shape--series-2 { stroke: #1f4f8a; }
.ahead-md-chart-point-shape--series-3 { stroke: #6b21a8; }
.ahead-md-chart-point-shape--series-4 { stroke: #0f766e; }

.ahead-md-chart-end-label {
  font-size: 12px;
  font-weight: 700;
}

.ahead-md-chart-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.ahead-md-chart-legend li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ahead-md-legend-line {
  display: inline-block;
  width: 2.5rem;
  height: 0;
  border-top: 3px solid currentColor;
}

.ahead-md-detail__back {
  margin: 0 0 0.85rem;
}

.ahead-md-public__pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: var(--ahead-md-gap) 0 0;
}

.ahead-md-public__pagination a,
.ahead-md-public__pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ahead-md-border);
  border-radius: max(0px, calc(var(--ahead-md-radius) - 4px));
  text-decoration: none;
  background: var(--ahead-md-surface);
}

@media (max-width: 720px) {
  .ahead-md-public__header,
  .ahead-md-card {
    padding: var(--ahead-md-gap);
  }

  .ahead-md-card__header {
    flex-direction: column;
  }

  .ahead-md-card__status-stack {
    justify-items: start;
  }

  .ahead-md-public__filters {
    padding: var(--ahead-md-gap);
  }

  .ahead-md-public__filter-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ahead-md-public__toggle {
    max-width: none;
  }

  .ahead-md-public__filter-actions {
    justify-content: stretch;
  }

  .ahead-md-public__filter-actions button,
  .ahead-md-public__filter-actions .ahead-md-public__reset {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .ahead-md-trend__svg {
    min-width: 680px;
  }
}

.ahead-md-public__header,
.ahead-md-public__summary > *,
.ahead-md-public__filters > *,
.ahead-md-public__cards > *,
.ahead-md-metadata > *,
.ahead-md-card__header > * {
  min-width: 0;
}

.ahead-md-public h2,
.ahead-md-public h3,
.ahead-md-public h4,
.ahead-md-public p,
.ahead-md-public li,
.ahead-md-public dd,
.ahead-md-public td,
.ahead-md-public th,
.ahead-md-public a,
.ahead-md-public code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ahead-md-table-scroll table,
.ahead-md-public__trend-shell,
.ahead-md-public__trend-scroll {
  max-width: 100%;
}

.ahead-md-public__pagination a,
.ahead-md-public__pagination span {
  min-width: 2.5rem;
}

.ahead-md-public__pagination .current {
  font-weight: 700;
  background: var(--ahead-md-accent);
  color: var(--ahead-md-on-accent, #ffffff);
  border-color: var(--ahead-md-accent);
}

@media (max-width: 640px) {
  .ahead-md-card__status-stack {
    justify-items: start;
  }

  .ahead-md-public__summary {
    grid-template-columns: 1fr 1fr;
  }
}

/* =====================================================================
 * Accessibility hardening (applies to every style pack)
 * ===================================================================== */

/* Keyboard-only focus rings via :focus-visible, in addition to the legacy
 * :focus rules above so older browsers still get a visible indicator. */
.ahead-md-public a:focus-visible,
.ahead-md-public button:focus-visible,
.ahead-md-public input:focus-visible,
.ahead-md-public select:focus-visible,
.ahead-md-public textarea:focus-visible,
.ahead-md-public [tabindex="0"]:focus-visible {
  outline: 3px solid var(--ahead-md-focus);
  outline-offset: 2px;
}

/* Respect users who ask for less motion (WCAG 2.3.3 / 2.2.2). */
@media (prefers-reduced-motion: reduce) {
  .ahead-md-public *,
  .ahead-md-public *::before,
  .ahead-md-public *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Strengthen separation for users who request more contrast. */
@media (prefers-contrast: more) {
  .ahead-md-public .ahead-md-card,
  .ahead-md-public .ahead-md-public__summary-card,
  .ahead-md-public input,
  .ahead-md-public select,
  .ahead-md-public textarea {
    border-width: 2px;
  }
  .ahead-md-public .ahead-md-status,
  .ahead-md-public .ahead-md-workflow {
    border: 1px solid currentColor;
  }
}

/* Windows High Contrast / forced-colors: keep status meaning and chart series
 * legible when the OS replaces author colors. Status is never conveyed by
 * color alone (an icon and text label are always present), and chart series
 * are distinguished by line dash + point shape, so forced colors stay usable. */
@media (forced-colors: active) {
  .ahead-md-public .ahead-md-status,
  .ahead-md-public .ahead-md-workflow {
    border: 1px solid ButtonText;
  }
  .ahead-md-public .ahead-md-chart-line,
  .ahead-md-public .ahead-md-chart-point-shape {
    stroke: CanvasText !important;
  }
  .ahead-md-public .ahead-md-chart-point-shape {
    fill: Canvas !important;
  }
  .ahead-md-public .ahead-md-trend__svg {
    forced-color-adjust: none;
  }
}

/* =====================================================================
 * Dark scheme corrections (packs that declare scheme: dark)
 * A few base rules use fixed light values; remap them to tokens so dark
 * packs stay legible. The trend chart intentionally keeps a light plotting
 * surface so axis text and points remain high-contrast inside dark cards.
 * ===================================================================== */
.ahead-md-public[data-ahead-md-scheme="dark"] .ahead-md-activity-table th,
.ahead-md-public[data-ahead-md-scheme="dark"] .ahead-md-history-table th {
  background: var(--ahead-md-surface-alt);
  color: var(--ahead-md-text);
}

.ahead-md-public[data-ahead-md-scheme="dark"] .ahead-md-trend__svg {
  border-color: var(--ahead-md-border);
}

/* =====================================================================
 * Style packs — structural identity beyond the color tokens.
 * Colors, radius, spacing and shadow already arrive as CSS variables from
 * the active pack; these rules add the typographic and shape character that
 * distinguishes one kind of site from another.
 * ===================================================================== */

/* Civic / Government — sober, system-font, crisp rules and tracked labels. */
.ahead-md-public[data-ahead-md-style="civic"] {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ahead-md-public[data-ahead-md-style="civic"] .ahead-md-card,
.ahead-md-public[data-ahead-md-style="civic"] .ahead-md-public__summary-card {
  border-width: 2px;
}
.ahead-md-public[data-ahead-md-style="civic"] .ahead-md-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}
.ahead-md-public[data-ahead-md-style="civic"] .ahead-md-public__header {
  border-bottom: 4px solid var(--ahead-md-accent);
}

/* Modern Product — rounded, lighter weight headings, pill buttons. */
.ahead-md-public[data-ahead-md-style="modern"] .ahead-md-public__header h2 {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ahead-md-public[data-ahead-md-style="modern"] .ahead-md-public__filters button {
  border-radius: 999px;
}
.ahead-md-public[data-ahead-md-style="modern"] .ahead-md-card {
  border-color: transparent;
}

/* Editorial / Nonprofit — serif headings, generous reading measure. */
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-public__header h2,
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-card h2,
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-card h3,
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-card h4 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-rich-text {
  line-height: 1.75;
  max-width: 70ch;
}
.ahead-md-public[data-ahead-md-style="editorial"] .ahead-md-card__section {
  border-left: 3px solid var(--ahead-md-accent);
  padding-left: 1rem;
}

/* Minimal / Monochrome — flat, quiet, small tracked eyebrows. */
.ahead-md-public[data-ahead-md-style="minimal"] .ahead-md-card,
.ahead-md-public[data-ahead-md-style="minimal"] .ahead-md-public__summary-card {
  box-shadow: none;
}
.ahead-md-public[data-ahead-md-style="minimal"] .ahead-md-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--ahead-md-muted);
}

/* High Contrast — heavy borders and underlined links for clarity. */
.ahead-md-public[data-ahead-md-style="high-contrast"] .ahead-md-card,
.ahead-md-public[data-ahead-md-style="high-contrast"] .ahead-md-public__summary-card,
.ahead-md-public[data-ahead-md-style="high-contrast"] input,
.ahead-md-public[data-ahead-md-style="high-contrast"] select,
.ahead-md-public[data-ahead-md-style="high-contrast"] textarea {
  border-width: 2px;
}
.ahead-md-public[data-ahead-md-style="high-contrast"] a {
  text-decoration: underline;
}
.ahead-md-public[data-ahead-md-style="high-contrast"] .ahead-md-status,
.ahead-md-public[data-ahead-md-style="high-contrast"] .ahead-md-workflow {
  border: 2px solid currentColor;
}

/* Midnight (dark) — soften card borders, accent the header. */
.ahead-md-public[data-ahead-md-style="midnight"] .ahead-md-public__header {
  border-bottom: 2px solid var(--ahead-md-border);
}

/* =====================================================================
 * Search / filter section — theme-resilience hardening
 * Host themes frequently restyle form controls (widths, fonts, colors,
 * appearance) and can break this section. These rules re-assert the
 * layout and form-control rendering with enough specificity to survive a
 * normally-behaved theme, without resorting to !important.
 * ===================================================================== */

/* Grid/flex children default to min-width:auto, so a wide <select> option or
 * a theme-forced input width can blow the track wider than its column. Pin
 * the children (and controls) to min-width:0 so they shrink to the grid. */
.ahead-md-public__filters > * {
  min-width: 0;
}

.ahead-md-public__filters label {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-weight: inherit;
  text-transform: none;
}

/* Re-assert control rendering so theme typography/colors can't make fields
 * unreadable (e.g. light text on a light field) or oddly sized. */
.ahead-md-public__filters input,
.ahead-md-public__filters select,
.ahead-md-public__filters textarea,
.ahead-md-public__reset {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ahead-md-text);
  background-color: var(--ahead-md-surface);
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

/* Native selects: let the field show the plugin's surface/text rather than a
 * theme's forced appearance, while keeping the OS dropdown affordance. */
.ahead-md-public__filters select {
  -webkit-appearance: auto;
  appearance: auto;
  height: auto;
}

/* The submit/reset buttons must win over generic theme button styling
 * (gradients, fixed widths, uppercase) but only within our scope. */
.ahead-md-public__filters button,
.ahead-md-public .ahead-md-public__reset {
  box-sizing: border-box;
  max-width: 100%;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
  box-shadow: none;
}

.ahead-md-public .ahead-md-public__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ahead-md-text);
}

/* The reset link is an <a> styled as a button; keep it readable and stop
 * theme link-underline/hover-color rules from fighting it. */
.ahead-md-public .ahead-md-public__reset:hover,
.ahead-md-public .ahead-md-public__reset:focus {
  text-decoration: none;
  color: var(--ahead-md-text);
}

/* Some themes add a default border/legend offset to fieldsets. */
.ahead-md-public__filter-fieldset legend {
  padding: 0;
  float: none;
  width: auto;
}

/* Detail toolbar: back link + print button */
.ahead-md-detail__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: var(--ahead-md-gap);
}

.ahead-md-detail__toolbar .ahead-md-detail__back {
  margin: 0;
}

.ahead-md-public .ahead-md-print-button,
.ahead-md-print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
  text-decoration: none;
  color: var(--ahead-md-on-accent, #ffffff);
  background: var(--ahead-md-accent);
  background-image: none;
  border: 1px solid var(--ahead-md-accent);
  border-radius: max(0px, calc(var(--ahead-md-radius) - 4px));
  box-shadow: none;
  cursor: pointer;
}

.ahead-md-public .ahead-md-print-button:hover,
.ahead-md-print-button:hover {
  opacity: 0.92;
  color: var(--ahead-md-on-accent, #ffffff);
  background: var(--ahead-md-accent);
}

.ahead-md-print-button__icon {
  font-size: 1.05em;
  line-height: 1;
}

/* Citation block shown on every public page */
.ahead-md-public__citation {
  margin-top: var(--ahead-md-gap);
  padding-top: 0.85rem;
  border-top: 1px solid var(--ahead-md-border);
}

.ahead-md-public__citation-line {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ahead-md-muted);
}

.ahead-md-public__citation-line--primary {
  font-weight: 600;
  color: var(--ahead-md-text);
}

/* Direct (in-page) browser printing — hide interactive chrome and flatten. */
@media print {
  .ahead-md-public__filters,
  .ahead-md-detail__toolbar,
  .ahead-md-print-button,
  .ahead-md-public__pagination {
    display: none !important;
  }

  .ahead-md-public .ahead-md-card,
  .ahead-md-public .ahead-md-public__summary-card {
    box-shadow: none;
  }

  .ahead-md-card,
  .ahead-md-card__section,
  .ahead-md-public__overview,
  table,
  figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Fit to page: remove on-screen min-widths and horizontal scrollers. */
  .ahead-md-table-scroll,
  .ahead-md-public__trend-scroll,
  .ahead-md-public__trend-shell {
    overflow: visible !important;
  }

  .ahead-md-public table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 11px;
  }

  .ahead-md-public th,
  .ahead-md-public td {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .ahead-md-trend__svg {
    min-width: 0 !important;
    width: 100% !important;
    height: auto;
  }

  .ahead-md-public img,
  .ahead-md-public svg {
    max-width: 100%;
    height: auto;
  }
}
