/* ==========================================================================
   SocialCareScore — design system v1.0
   Mobile-first · WCAG 2.2 AA · system fonts · no external requests
   Tokens and validation notes: docs/03-design-system.md
   ========================================================================== */

:root {
    color-scheme: light;

    /* Ink and surfaces */
    --ink: #1a1c2e;
    --text-secondary: #52514e;
    --text-muted: #6b6a65;
    --page: #f6f6f3;
    --surface: #ffffff;
    --surface-sunken: #efeee9;
    --hairline: #e1e0d9;
    --border: #c3c2b7;
    --border-strong: #767570;

    /* Brand */
    --brand: #4a3aa7;
    --brand-dark: #342a80;
    --brand-tint: #efedf9;

    /* Feedback */
    --success: #006300;
    --success-tint: #eaf5ea;
    --error: #b3261e;
    --error-dark: #7a1a14;
    --error-tint: #fcefee;
    --warning-ink: #8a5a00;
    --warning-tint: #fdf5e1;
    --info: #1c5cab;
    --info-tint: #eef4fc;
    --focus: #ffdd00;

    /* Status — always paired with an icon and a text label */
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-serious: #ec835a;
    --status-critical: #d03b3b;

    /* Score bands — diverging blue/orange with neutral midpoint (validated ordinal arms) */
    --band-strong: #1c5cab;
    --band-strong-text: #ffffff;
    --band-good: #6da7ec;
    --band-good-text: #1a1c2e;
    --band-mixed: #e6e5e0;
    --band-mixed-text: #1a1c2e;
    --band-improvement: #e78662;
    --band-improvement-text: #1a1c2e;
    --band-concerns: #9c390b;
    --band-concerns-text: #ffffff;
    --band-none: #ffffff;
    --band-none-text: #52514e;

    /* Charts */
    --series-1: #2a78d6;
    --series-1-track: #cde2fb;
    --series-muted: #898781;
    --chart-grid: #e1e0d9;
    --chart-axis: #c3c2b7;

    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.375rem;
    --text-xl: 1.75rem;
    --text-2xl: 2.25rem;
    --text-hero: 3.5rem;

    /* Spacing (4px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-card: 0 1px 2px rgba(26, 28, 46, 0.06), 0 1px 1px rgba(26, 28, 46, 0.04);
    --container: 72rem;
    --measure: 42rem;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    font-size: 106.25%; /* 17px, respects user font settings */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (min-width: 40em) {
    html { font-size: 112.5%; } /* 18px */
}

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--ink);
    background: var(--page);
    overflow-wrap: break-word;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4 {
    margin: 0 0 var(--space-4);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); margin-top: var(--space-7); }
h3 { font-size: var(--text-md); margin-top: var(--space-5); }
h4 { font-size: var(--text-base); margin-top: var(--space-4); }

@media (min-width: 40em) {
    h1 { font-size: var(--text-2xl); }
}

p, ul, ol, dl, table, blockquote, figure {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-dark);
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
}

a:focus-visible {
    outline: 3px solid transparent; /* invisible normally; drawn in a system colour in Windows contrast themes */
    color: var(--ink);
    background-color: var(--focus);
    box-shadow: 0 -2px var(--focus), 0 4px var(--ink);
    text-decoration: none;
}

strong, b { font-weight: 700; }

hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin-block: var(--space-6);
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

.num,
.data-table .num {
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

@media (min-width: 40em) {
    .container { padding-inline: var(--space-5); }
}

.site-main {
    display: block;
    padding-block: var(--space-5) var(--space-8);
}

.site-main:focus { outline: none; box-shadow: none; }

.section { margin-block: var(--space-7); }
.section:first-child { margin-top: 0; }

.section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
}

.section__header h2 { margin: 0; }

.grid {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 48em) {
    .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
    .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: absolute;
    left: var(--space-2);
    top: -10rem;
    z-index: 1000;
    padding: var(--space-2) var(--space-4);
    background: var(--focus);
    color: var(--ink);
    font-weight: 700;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: var(--space-2);
}

/* --------------------------------------------------------------------------
   Header, safety bar, navigation, footer
   -------------------------------------------------------------------------- */

.demo-banner {
    padding: var(--space-2) var(--space-4);
    background: #fff3c4;
    border-bottom: 2px solid var(--warning-ink);
    color: var(--ink);
    font-size: var(--text-sm);
    text-align: center;
}

.safety-bar {
    background: var(--ink);
    color: #ffffff;
    font-size: var(--text-sm);
}

.safety-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
    padding-block: var(--space-2);
}

.safety-bar p { margin: 0; }

.safety-bar a {
    color: #ffffff;
    font-weight: 700;
}

.safety-bar a:focus-visible { color: var(--ink); }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    color: var(--ink);
    font-size: var(--text-md);
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.brand:hover { color: var(--ink); }

.brand__mark {
    width: 2rem;
    height: 2rem;
    flex: none;
}

.brand__mark-bg { fill: var(--brand); }
.brand__mark-bar { fill: #ffffff; }
.brand__name span { color: var(--brand); }

.site-nav__toggle { display: none; }

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__list a:not(.button) {
    display: inline-block;
    padding-block: var(--space-2);
    border-bottom: 3px solid transparent;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.site-nav__list a:not(.button):hover { border-bottom-color: var(--hairline); }
.site-nav__list a[aria-current="page"] { border-bottom-color: var(--brand); }
.site-nav__cta .button { min-height: 2.75rem; }

@media (max-width: 59.99em) {
    .js .site-nav__toggle {
        display: inline-flex;
        align-items: center;
        min-height: 2.75rem;
        padding: var(--space-2) var(--space-4);
        border: 2px solid var(--border-strong);
        border-radius: var(--radius);
        background: var(--surface);
        color: var(--ink);
        font: inherit;
        font-weight: 700;
        cursor: pointer;
    }

    .js .site-nav { flex-basis: 100%; }
    .js .site-nav__list { display: none; }

    .js .site-nav[data-open="true"] .site-nav__list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-block: var(--space-2);
    }

    .js .site-nav[data-open="true"] .site-nav__list a:not(.button) {
        display: block;
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--hairline);
    }

    .js .site-nav[data-open="true"] .site-nav__cta { margin-top: var(--space-3); }
    .js .site-nav[data-open="true"] .site-nav__cta .button { width: 100%; }
}

.breadcrumbs {
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li + li::before {
    content: "\203A";
    margin-right: var(--space-1);
    color: var(--text-muted);
}

.site-footer {
    padding-block: var(--space-7) var(--space-6);
    background: var(--ink);
    color: #e9e9ef;
    font-size: var(--text-sm);
}

.site-footer a { color: #ffffff; }
.site-footer a:focus-visible { color: var(--ink); }

.site-footer__grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.site-footer__heading {
    margin: 0 0 var(--space-3);
    color: #ffffff;
    font-size: var(--text-base);
}

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

.site-footer li + li { margin-top: var(--space-2); }

.site-footer__legal {
    margin: var(--space-6) 0 0;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #c9c9d3;
}

/* --------------------------------------------------------------------------
   Typography components
   -------------------------------------------------------------------------- */

.page-header {
    max-width: 48rem;
    margin-bottom: var(--space-6);
}

.page-header__eyebrow {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lead {
    max-width: var(--measure);
    color: var(--text-secondary);
    font-size: var(--text-md);
    line-height: 1.5;
}

@media (min-width: 40em) {
    .lead { font-size: var(--text-lg); line-height: 1.45; }
}

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

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2); }
.prose li > ul, .prose li > ol { margin-top: var(--space-2); margin-bottom: 0; }

.prose blockquote {
    padding-left: var(--space-4);
    border-left: 4px solid var(--hairline);
    color: var(--text-secondary);
}

.prose code,
code {
    padding: 0.1em 0.3em;
    border-radius: 3px;
    background: var(--surface-sunken);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.prose pre,
pre {
    overflow-x: auto;
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    font-size: var(--text-sm);
}

pre code { padding: 0; background: none; }

.toc {
    max-width: var(--measure);
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border-left: 4px solid var(--brand);
    background: var(--surface);
}

.toc h2 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
}

.toc ol {
    margin: 0;
    padding-left: 1.2em;
}

.toc li + li { margin-top: var(--space-1); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-5);
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--brand);
    box-shadow: 0 2px 0 var(--brand-dark);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--brand-dark);
    color: #ffffff;
}

.button:focus-visible,
a.button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 0;
    background: var(--focus);
    box-shadow: 0 2px 0 var(--ink);
    color: var(--ink);
}

.button--secondary {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: none;
    color: var(--brand);
}

.button--secondary:hover {
    background: var(--brand-tint);
    color: var(--brand-dark);
}

.button--emergency {
    background: var(--error);
    box-shadow: 0 2px 0 var(--error-dark);
}

.button--emergency:hover { background: var(--error-dark); }

.button--small {
    min-height: 2.25rem;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-sm);
}

.button--block { width: 100%; }

.button[disabled],
.button[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    margin-block: var(--space-5);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Callouts, cards, steps, accordions, contact lists
   -------------------------------------------------------------------------- */

.callout {
    max-width: var(--measure);
    margin-block: var(--space-5);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--hairline);
    border-left: 6px solid var(--info);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.callout > :last-child { margin-bottom: 0; }

.callout__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-md);
}

.callout--info { background: var(--info-tint); border-left-color: var(--info); }
.callout--warning { background: var(--warning-tint); border-left-color: var(--warning-ink); }
.callout--emergency { background: var(--error-tint); border-left-color: var(--error); }
.callout--success { background: var(--success-tint); border-left-color: var(--success); }
.callout--wide { max-width: none; }

.card-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    margin-block: var(--space-5);
    padding: 0;
    list-style: none;
}

.card {
    position: relative;
    padding: var(--space-5);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.card > :last-child { margin-bottom: 0; }

.card__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-md);
}

.card__body { color: var(--text-secondary); }
.card__body > :last-child { margin-bottom: 0; }

.card--link .card__title a {
    color: var(--ink);
    text-decoration: none;
}

.card--link .card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.card--link:hover { border-color: var(--brand); }
.card--link:hover .card__title a { text-decoration: underline; }

.card--link .card__title a:focus-visible {
    background: none;
    box-shadow: none;
}

.card--link:focus-within {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
}

.steps {
    max-width: var(--measure);
    margin: var(--space-5) 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps > li {
    position: relative;
    padding: 0 0 var(--space-5) 3.25rem;
    counter-increment: step;
}

.steps > li + li { margin-top: 0; }

.steps > li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--brand);
    color: #ffffff;
    font-weight: 700;
}

.steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 2.5rem;
    bottom: var(--space-1);
    left: calc(1.125rem - 1px);
    width: 2px;
    background: var(--hairline);
}

.steps > li > h3:first-child,
.steps > li > h2:first-child {
    margin-top: 0.3rem;
}

.accordion {
    max-width: var(--measure);
    margin-bottom: var(--space-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 2.75rem;
    padding: var(--space-3) var(--space-4);
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.accordion > summary::-webkit-details-marker { display: none; }

.accordion > summary::after {
    content: "+";
    flex: none;
    color: var(--brand);
    font-size: 1.35rem;
    line-height: 1;
}

.accordion[open] > summary::after { content: "\2212"; }

.accordion__body { padding: 0 var(--space-4) var(--space-4); }
.accordion__body > :last-child { margin-bottom: 0; }

.contact-list {
    display: grid;
    gap: var(--space-3);
    max-width: var(--measure);
}

.contact-list > div {
    padding: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.contact-list dt {
    margin-bottom: var(--space-1);
    font-weight: 700;
}

.contact-list dd {
    margin: 0;
    color: var(--text-secondary);
}

.contact-list dd + dd { margin-top: var(--space-1); }

/* --------------------------------------------------------------------------
   Tags, band chips, tables
   -------------------------------------------------------------------------- */

.tag {
    display: inline-block;
    padding: 0.1em 0.6em;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface-sunken);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.tag--brand { background: var(--brand-tint); color: var(--brand-dark); }
.tag--live { background: var(--success-tint); color: var(--success); }
.tag--warning { background: var(--warning-tint); color: var(--warning-ink); }
.tag--error { background: var(--error-tint); color: var(--error); }

.band-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.15em 0.6em;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.band-chip--strong { background: var(--band-strong); color: var(--band-strong-text); }
.band-chip--good { background: var(--band-good); color: var(--band-good-text); }
.band-chip--mixed { background: var(--band-mixed); color: var(--band-mixed-text); }
.band-chip--improvement { background: var(--band-improvement); color: var(--band-improvement-text); }
.band-chip--concerns { background: var(--band-concerns); color: var(--band-concerns-text); }
.band-chip--none { background: var(--band-none); color: var(--band-none-text); border-color: var(--border); }

.table-wrap {
    overflow-x: auto;
    margin-block: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

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

.data-table caption {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-weight: 700;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--hairline);
    text-align: left;
    vertical-align: middle;
}

.data-table thead th {
    background: var(--surface-sunken);
    font-weight: 700;
    white-space: nowrap;
}

.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table th a { color: var(--ink); }

.data-table th[aria-sort] a::after { content: " \2195"; color: var(--text-muted); }
.data-table th[aria-sort="ascending"] a::after { content: " \2191"; color: var(--ink); }
.data-table th[aria-sort="descending"] a::after { content: " \2193"; color: var(--ink); }

/* --------------------------------------------------------------------------
   Scores: hero, stat tiles, meters, change, indicators
   -------------------------------------------------------------------------- */

.score-hero {
    display: grid;
    gap: var(--space-5);
    padding: var(--space-5);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

@media (min-width: 48em) {
    .score-hero {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: var(--space-7);
        padding: var(--space-6);
    }
}

.score-hero__label {
    margin: 0 0 var(--space-1);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
}

.score-hero__figure {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}

.score-hero__value {
    font-size: var(--text-hero);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.score-hero__max {
    color: var(--text-muted);
    font-size: var(--text-lg);
    font-weight: 600;
}

.score-hero__details > :last-child { margin-bottom: 0; }

.score-hero__empty {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 700;
}

.stat-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    margin-block: var(--space-5);
}

.stat-tile {
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-tile__label {
    margin: 0 0 var(--space-1);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
}

.stat-tile__value {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.1;
}

.stat-tile__value small {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
}

.stat-tile__note {
    margin: var(--space-2) 0 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.meter {
    display: block;
    width: 100%;
    height: 8px;
    margin-top: var(--space-3);
}

.meter__track { fill: var(--series-1-track); }
.meter__fill { fill: var(--series-1); }

.change {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.change svg {
    width: 0.85em;
    height: 0.85em;
    fill: currentColor;
}

.change--up { color: var(--success); }
.change--down { color: var(--error); }
.change--flat { color: var(--text-secondary); }

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

.indicator {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--hairline);
}

.indicator:last-child { border-bottom: 0; }

.indicator__icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
}

.icon-good { fill: var(--status-good); }
.icon-warning { fill: var(--status-warning); }
.icon-serious { fill: var(--status-serious); }
.icon-critical { fill: var(--status-critical); }
.icon-ink { fill: var(--ink); }
.icon-muted { fill: var(--text-muted); }

.indicator__title {
    margin: 0;
    font-weight: 700;
}

.indicator__text {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.status-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 700;
}

.status-label svg {
    width: 1.1em;
    height: 1.1em;
    flex: none;
}

.trust-dots {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
}

.trust-dots.indicator__icon {
    width: auto;
    height: auto;
    margin-top: 0.45rem;
}

.trust-dots span {
    flex: none;
    width: 0.65rem;
    height: 0.65rem;
    border: 1px solid var(--series-1);
    border-radius: 50%;
    background: var(--surface);
}

.trust-dots span.is-on { background: var(--series-1); }

/* --------------------------------------------------------------------------
   Charts (server-rendered SVG, progressive hover layer)
   -------------------------------------------------------------------------- */

.chart {
    position: relative;
    margin: var(--space-5) 0;
    padding: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

@media (min-width: 40em) {
    .chart { padding: var(--space-5); }
}

.chart__title {
    margin: 0 0 var(--space-1);
    font-size: var(--text-md);
}

.chart__subtitle {
    margin: 0 0 var(--space-4);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.chart__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: var(--font-sans);
}

/* Line and bar charts are rendered in two layouts; show the one that suits the width. */
.chart__svg--wide { display: none; }

@media (min-width: 40em) {
    .chart__svg--narrow { display: none; }
    .chart__svg--wide { display: block; }
}

/*
 * --chart-k = viewBox width ÷ rendered width, set by app.js so chart text renders at a constant size.
 * Without JavaScript these defaults assume a phone-width chart.
 */
.chart__svg--narrow,
.tile-map { --chart-k: 1.25; }

@media (min-width: 40em) {
    .tile-map { --chart-k: 1; }
}

.chart__plot { border-radius: var(--radius-sm); }

.chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin: var(--space-3) 0 0;
    padding: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    list-style: none;
}

.chart__legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}

.legend-key {
    display: inline-block;
    flex: none;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 2px;
}

.legend-key--line {
    height: 3px;
    border-radius: 2px;
}

.key-series-1 { background: var(--series-1); }
.key-muted { background: var(--series-muted); }
.key-ink { background: var(--ink); }
.key-area {
    background: var(--series-1-track);
    background: color-mix(in srgb, var(--series-1) 10%, var(--surface)); /* matches the 10% confidence band wash */
    box-shadow: inset 0 0 0 1px var(--series-1-track);
}
.key-band-strong { background: var(--band-strong); }
.key-band-good { background: var(--band-good); }
.key-band-mixed { background: var(--band-mixed); }
.key-band-improvement { background: var(--band-improvement); }
.key-band-concerns { background: var(--band-concerns); }
.key-band-none { background: var(--band-none); box-shadow: inset 0 0 0 1px var(--border); }

.chart__table { margin-top: var(--space-3); }

.chart__table > summary {
    display: inline-block;
    min-height: 1.5rem;
    color: var(--brand);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

.chart-tooltip {
    position: absolute;
    z-index: 20;
    max-width: 17rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: var(--text-sm);
    line-height: 1.35;
    pointer-events: auto; /* hoverable, so it can be read with screen magnification (WCAG 1.4.13) */
}

.chart-tooltip strong {
    display: block;
    font-size: var(--text-base);
}

.chart-tooltip .tooltip-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.chart-tooltip .tooltip-key {
    display: inline-block;
    width: 0.9em;
    height: 3px;
    border-radius: 2px;
}

.c-grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.c-axis { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.c-tick { fill: var(--text-muted); font-size: calc(12px * var(--chart-k, 1)); }
.c-label { fill: var(--ink); font-size: calc(13px * var(--chart-k, 1)); font-weight: 600; }
.c-label--muted { fill: var(--text-secondary); font-weight: 400; }
.c-value { fill: var(--ink); font-size: calc(13px * var(--chart-k, 1)); font-weight: 700; }
.c-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-line--muted { stroke: var(--series-muted); }
.c-area { fill: var(--series-1); fill-opacity: 0.1; stroke: none; }
.c-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.c-dot--muted { fill: var(--series-muted); }
.c-bar { fill: var(--series-1); }
.c-bar-track { fill: var(--surface-sunken); }
.c-marker { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.c-whisker { stroke: var(--series-muted); stroke-width: 2; stroke-linecap: round; }
.c-crosshair { stroke: var(--text-muted); stroke-width: 1; }
.c-hit { fill: transparent; cursor: crosshair; }
.c-focus-ring { fill: none; stroke: var(--ink); stroke-width: 2; }

.fill-strong { fill: var(--band-strong); }
.fill-good { fill: var(--band-good); }
.fill-mixed { fill: var(--band-mixed); }
.fill-improvement { fill: var(--band-improvement); }
.fill-concerns { fill: var(--band-concerns); }
.fill-none { fill: var(--band-none); stroke: var(--border); stroke-width: 1; }
.text-on-strong, .text-on-concerns { fill: #ffffff; }
.text-on-good, .text-on-mixed, .text-on-improvement { fill: var(--ink); }
.text-on-none { fill: var(--text-secondary); }

/* Tile map of councils */
.tile-map { max-width: 36rem; margin-inline: auto; }
.tile-map a { cursor: pointer; }
.tile-map a:focus { outline: none; }
.tile-map a:hover .tile__rect { stroke: var(--ink); stroke-width: 2; }
.tile__rect { stroke: var(--surface); stroke-width: 2; }
.tile__rect.fill-none { stroke: var(--border); stroke-width: 1; }
/* Two-tone keyboard focus ring (yellow inside, ink outside) that shows on every tile colour */
.tile__focus { display: none; }
.tile-map a:focus-visible .tile__focus { display: inline; }
.tile__focus-inner { fill: none; stroke: var(--focus); stroke-width: 4; }
.tile__focus-outer { fill: none; stroke: var(--ink); stroke-width: 2; }
/* Tile text follows --chart-k but is capped so it still fits a tile on the smallest screens */
.tile__abbr { font-size: calc(12px * min(var(--chart-k, 1), 1.6)); font-weight: 700; }
.tile__score { font-size: calc(12px * min(var(--chart-k, 1), 1.6)); font-variant-numeric: tabular-nums; }

/* Heatmap (a real table with coloured cells) */
.heatmap {
    width: 100%;
    min-width: 40rem;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: var(--text-sm);
}

.heatmap caption {
    padding: var(--space-3) var(--space-2);
    font-weight: 700;
    text-align: left;
}

.heatmap th {
    padding: var(--space-2);
    background: var(--surface);
    font-weight: 600;
    text-align: left;
}

.heatmap thead th {
    vertical-align: bottom;
    font-size: var(--text-xs);
    line-height: 1.25;
}

.heatmap th[scope="row"] {
    position: sticky;
    left: 0;
    z-index: 1;
    white-space: nowrap;
}

.heatmap td {
    min-width: 3.25rem;
    padding: var(--space-2) var(--space-1);
    border-radius: 3px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.cell--strong { background: var(--band-strong); color: var(--band-strong-text); }
.cell--good { background: var(--band-good); color: var(--band-good-text); }
.cell--mixed { background: var(--band-mixed); color: var(--band-mixed-text); }
.cell--improvement { background: var(--band-improvement); color: var(--band-improvement-text); }
.cell--concerns { background: var(--band-concerns); color: var(--band-concerns-text); }
.cell--none { background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text-muted); font-weight: 400; }

/* Rating distribution (diverging stacked bar) */
.fill-r1 { fill: var(--band-concerns); }
.fill-r2 { fill: var(--band-improvement); }
.fill-r3 { fill: var(--band-mixed); }
.fill-r4 { fill: var(--band-good); }
.fill-r5 { fill: var(--band-strong); }
.key-r1 { background: var(--band-concerns); }
.key-r2 { background: var(--band-improvement); }
.key-r3 { background: var(--band-mixed); }
.key-r4 { background: var(--band-good); }
.key-r5 { background: var(--band-strong); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form { max-width: var(--measure); }

.form-group { margin-bottom: var(--space-6); }

.form-group--error {
    padding-left: var(--space-4);
    border-left: 4px solid var(--error);
}

fieldset {
    min-width: 0;
    margin: 0 0 var(--space-6);
    padding: 0;
    border: 0;
}

legend { padding: 0; }

.label,
.legend {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.3;
}

.legend--large {
    margin-bottom: var(--space-3);
    font-size: var(--text-lg);
}

.hint {
    display: block;
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.error-message {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--error);
    font-weight: 700;
}

.input,
.select,
.textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.select { padding-right: var(--space-6); }

.textarea {
    min-height: 10rem;
    line-height: 1.5;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: 3px solid var(--focus);
    outline-offset: 0;
    border-color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--ink);
}

.input--error,
.select--error,
.textarea--error { border-color: var(--error); }

.input--width-10 { max-width: 12em; }
.input--width-20 { max-width: 22em; }
.input--code { max-width: 16em; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.char-count {
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.char-count--over {
    color: var(--error);
    font-weight: 700;
}

.choices {
    display: grid;
    gap: var(--space-1);
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-height: 2.75rem;
    padding-block: var(--space-2);
}

.choice input {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.1rem 0 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.choice label { cursor: pointer; }

.choice__hint {
    display: block;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.choices__conditional {
    margin: var(--space-2) 0 var(--space-3) 0.7rem;
    padding-left: var(--space-5);
    border-left: 4px solid var(--hairline);
}

.rating-question {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--hairline);
}

.rating-scale {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 36em) {
    .rating-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.rating-option { position: relative; }

.rating-option input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.rating-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 4.25rem;
    padding: var(--space-2) var(--space-1);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--text-xs);
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.rating-option label:hover { border-color: var(--brand); }

.rating-option__value {
    margin-bottom: 2px;
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: 1;
}

.rating-option input:checked + label {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.rating-option input:focus-visible + label {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
}

.rating-option--na label { color: var(--text-secondary); }

.error-summary {
    max-width: var(--measure);
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border: 4px solid var(--error);
    background: var(--surface);
}

.error-summary:focus {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
}

.error-summary__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-lg);
}

.error-summary ul {
    margin: 0;
    padding-left: 1.2em;
}

.error-summary a {
    color: var(--error);
    font-weight: 700;
}

.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Live comment warnings and redaction preview */
.live-warnings {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--warning-ink);
    background: var(--warning-tint);
    font-size: var(--text-sm);
}

.live-warnings__title {
    margin: 0 0 var(--space-1);
    font-weight: 700;
}

.live-warnings ul {
    margin: 0;
    padding-left: 1.2em;
}

.live-warnings p {
    margin: var(--space-1) 0;
}

.redaction-preview {
    max-width: var(--measure);
    margin-block: var(--space-3) var(--space-5);
    padding: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

mark.redacted {
    padding: 0 0.25em;
    border-radius: 3px;
    background: var(--surface-sunken);
    box-shadow: inset 0 0 0 1px var(--border-strong);
    color: var(--ink);
    font-weight: 600;
}

.summary-list {
    max-width: var(--measure);
    margin: 0 0 var(--space-6);
}

.summary-list > div {
    display: grid;
    gap: var(--space-1) var(--space-4);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--hairline);
}

@media (min-width: 40em) {
    .summary-list > div { grid-template-columns: 16rem minmax(0, 1fr); }
}

.summary-list dt { font-weight: 700; }
.summary-list dd { margin: 0; }

.withdrawal-code {
    display: inline-block;
    margin-block: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: 0.12em;
}

/* --------------------------------------------------------------------------
   Page patterns: home, filters, lists, comments, pagination
   -------------------------------------------------------------------------- */

.home-hero {
    margin-top: calc(-1 * var(--space-5));
    margin-bottom: var(--space-7);
    padding-block: var(--space-7);
    border-bottom: 1px solid var(--hairline);
    background: var(--surface);
}

.home-hero__grid {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 60em) {
    .home-hero__grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: center;
    }
}

.home-hero h1 { font-size: var(--text-2xl); }

@media (min-width: 40em) {
    .home-hero h1 { font-size: 2.75rem; }
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    max-width: 36rem;
}

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

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

.filter-bar .form-group { margin: 0; }
.filter-bar .label { font-size: var(--text-sm); }
.filter-bar .select, .filter-bar .input { min-width: 11rem; }

.authority-list {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.authority-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

.authority-card:hover { border-color: var(--brand); }

.authority-card:focus-within {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--focus);
}

.authority-card__name {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 700;
}

.authority-card__name a {
    color: var(--ink);
    text-decoration: none;
}

.authority-card__name a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.authority-card__name a:focus-visible { background: none; box-shadow: none; }

.authority-card__meta {
    margin: var(--space-1) 0 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.authority-card__score {
    flex: none;
    text-align: right;
}

.authority-card__value {
    display: block;
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: 1.1;
}

.comment-list {
    display: grid;
    gap: var(--space-4);
    max-width: var(--measure);
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment {
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

.comment__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    margin: 0 0 var(--space-2);
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.comment__text {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.comment__footer {
    margin: var(--space-3) 0 0;
    font-size: var(--text-sm);
}

.response {
    max-width: var(--measure);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--hairline);
    border-left: 6px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-6) 0;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 var(--space-3);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-decoration: none;
}

.pagination [aria-current="page"] {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
    font-weight: 700;
}

.empty-state {
    max-width: var(--measure);
    padding: var(--space-6);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.empty-state > :last-child { margin-bottom: 0; }

.key-facts {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --------------------------------------------------------------------------
   Dashboard patterns
   -------------------------------------------------------------------------- */

.whisker {
    display: block;
    width: 120px;
    max-width: 100%;
    height: 16px;
}

.score-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.score-cell__value {
    min-width: 2.5ch;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.rank-range {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 400;
    white-space: nowrap;
}

.panel {
    margin-block: var(--space-5);
    padding: var(--space-5);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel > :last-child { margin-bottom: 0; }

.panel__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-md);
}

.facts {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.facts li {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
}

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

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: 0 0 var(--space-3);
    padding: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    list-style: none;
}

.movers {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 48em) {
    .movers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.movers ol {
    margin: 0;
    padding-left: 1.4em;
}

.movers li + li { margin-top: var(--space-2); }

.band-legend {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-4) 0;
    padding: 0;
    list-style: none;
}

.band-legend li {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
}

@media (max-width: 36em) {
    .band-legend li { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.u-mt-0 { margin-top: 0 !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mt-6 { margin-top: var(--space-6) !important; }
.u-text-secondary { color: var(--text-secondary); }
.u-text-muted { color: var(--text-muted); }
.u-nowrap { white-space: nowrap; }
.u-small { font-size: var(--text-sm); }

/* --------------------------------------------------------------------------
   Preferences, forced colours and print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .band-chip,
    .heatmap td,
    .tag,
    .button,
    .rating-option label,
    .card,
    .callout {
        border: 1px solid CanvasText;
    }

    .rating-option input:checked + label {
        outline: 4px solid Highlight;
        outline-offset: 0;
    }

    .tile__rect { stroke: CanvasText; }
    .tile__focus-inner,
    .tile__focus-outer { stroke: Highlight; }
    .legend-key { border: 1px solid CanvasText; }
    .trust-dots span { forced-color-adjust: none; border-color: CanvasText; background: Canvas; }
    .trust-dots span.is-on { background: CanvasText; }
    .meter__track { fill: Canvas; stroke: CanvasText; }
    .meter__fill { fill: Highlight; }
    mark.redacted { border: 1px solid CanvasText; }
}

@media print {
    .safety-bar,
    .site-nav,
    .site-nav__toggle,
    .site-footer nav,
    .skip-link,
    .filter-bar,
    .button,
    .chart__table > summary {
        display: none !important;
    }

    body { background: #ffffff; }

    .chart,
    .card,
    .score-hero,
    .stat-tile {
        box-shadow: none;
        break-inside: avoid;
    }

    .prose a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
    }
}
