/* Mobile first. Colours and fonts from the design draft (see projekt.md). */

/* Self-hosted fonts, see /assets/fonts/README.md for source and licence. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/space-grotesk-variable.woff2") format("woff2");
}

:root {
    --color-background: #f4f6fb;
    --color-text: #14213d;
    --color-accent: #1d4ed8;
    --color-accent-2: #c2410c;
    --color-card: #ffffff;
    --color-border: #d9dfec;
    --color-muted: #3b4763;
    --color-on-dark: #ffffff;
    --color-on-dark-muted: #c7d2e8;
    --color-dark-tile: #22335c;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
    --focus-ring: 3px solid var(--color-accent-2);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 72.5rem;
    margin: 0 auto;
    padding: 0 1rem;
}

h1,
h2,
h3,
.site-name {
    font-family: var(--font-heading);
}

h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.2;
    margin: 1.5rem 0 1rem;
}

/* Long German compounds (law titles) are hyphenated by the browser (lang="de") instead of being cut anywhere. */
h1,
h2,
h3,
h4,
.card {
    -webkit-hyphens: auto;
    hyphens: auto;
}

a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

main:focus {
    outline: none;
}

/* Skip link: hidden until focused, then clearly visible. */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -10rem;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 1rem;
    background: var(--color-card);
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

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

.site-name {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0;
    color: var(--color-text);
    font-size: 1.375rem;
    font-weight: 700;
    text-decoration: none;
}

.site-logo {
    flex: none;
    stroke: var(--color-accent);
}

.site-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.site-nav {
    flex: 1 1 auto;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    border-radius: 10px;
    color: var(--color-text);
    font-weight: 600;
    text-decoration: none;
}

.site-nav a:hover {
    background: var(--color-background);
    text-decoration: underline;
}

/* Shown by contrast.js only; the pressed state is said in words and by the filled look. */
.contrast-toggle {
    min-height: 44px;
    min-width: 44px;
    margin: 0.25rem 0;
    padding: 0.5rem 0.875rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 2px solid var(--color-text);
    border-radius: 22px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.contrast-toggle[aria-pressed="true"] {
    background: var(--color-text);
    color: var(--color-card);
}

.contrast-toggle[aria-pressed="true"]::after {
    content: ": an";
    content: ": an" / "";
}

.contrast-toggle[aria-pressed="false"]::after {
    content: ": aus";
    content: ": aus" / "";
}

.contrast-toggle[hidden] {
    display: none;
}

/*
 * Small screens: name and contrast switch share the first line, the menu follows below (wraps
 * on very narrow screens, never hidden behind a sideways scroll). Same order for screen readers.
 */
@media (max-width: 47.9375rem) {
    .site-header .container {
        gap: 0 0.75rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .site-name {
        font-size: 1.25rem;
    }

    .contrast-toggle {
        order: 2;
        margin-left: auto;
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .site-nav {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
        margin-left: -0.5rem;
    }

    .site-nav ul {
        gap: 0;
    }

    .site-nav a {
        padding: 0 0.5rem;
        font-size: 0.9375rem;
        white-space: nowrap;
    }
}

/* Very narrow screens: the button says "Kontrast"; screen readers still hear "Hoher Kontrast". */
@media (max-width: 24.9375rem) {
    .contrast-long {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .site-nav a {
        font-size: 0.875rem;
        padding: 0 0.3125rem;
    }
}

.lead {
    font-size: 1.1875rem;
}

h2 {
    font-size: 1.375rem;
    line-height: 1.3;
    margin: 1.75rem 0 0.75rem;
}

/* Cards: one law procedure each. */
.cards {
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.card {
    margin: 0 0 1rem;
    padding: 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow-wrap: anywhere;
}

.card h2 {
    margin-top: 0;
    font-size: 1.1875rem;
}

.card h2 a,
.card h4 a {
    display: inline-block;
    min-height: 44px;
    padding: 0.25rem 0;
}

.facts {
    display: grid;
    gap: 0.25rem 1rem;
    margin: 0.75rem 0;
}

.facts div {
    display: grid;
    gap: 0 1rem;
}

.facts dt {
    font-weight: 600;
}

.facts dd {
    margin: 0;
}

/* Status as published in DIP; the colour only repeats the words. */
.status {
    display: inline-block;
    padding: 0.125rem 0.75rem;
    background: #e0e7ff;
    color: #1e3a8a;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.source,
.hint {
    margin: 0.75rem 0 0;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.source a {
    display: inline-block;
    min-height: 44px;
    padding: 0.5rem 0;
}

.breadcrumb a,
.pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
}

.pagination ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

/* Links to the official agendas: large enough to tap. */
.agenda-links a {
    display: inline-block;
    min-height: 44px;
    padding: 0.5rem 0;
}

/* Debt page: key figures, calculation, data table. */
.debt-figures {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.debt-figures div {
    padding: 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.debt-figures dt {
    font-weight: 600;
}

.debt-figures dd {
    margin: 0.25rem 0 0;
    font-family: var(--font-heading);
    /* The full amount (e.g. 1.907.079.000.000 Euro) must fit on a 320 px screen without breaking. */
    font-size: clamp(1.25rem, 6.5vw, 2.25rem);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.debt-figures .debt-figures-detail {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.calculation {
    margin: 0.75rem 0;
}

.calculation summary {
    min-height: 44px;
    padding: 0.5rem 0;
    cursor: pointer;
    font-weight: 600;
}

.table-scroll {
    overflow-x: auto;
    margin: 0 0 1rem;
}

.table-scroll:focus-visible {
    outline: var(--focus-ring);
}

/* Votes per parliamentary group: four columns, fits on a phone without scrolling. */
table.faction-votes {
    min-width: 19.5rem;
    margin: 0.75rem 0 0;
}

.faction-votes th[scope="row"] {
    font-weight: 600;
    hyphens: manual;
    overflow-wrap: normal;
    word-break: normal;
}

.faction-votes thead th,
.faction-votes td {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    white-space: nowrap;
    hyphens: manual;
}

table {
    border-collapse: collapse;
    min-width: 34rem;
    width: 100%;
    background: var(--color-card);
}

caption {
    text-align: left;
    font-weight: 600;
    padding: 0 0 0.5rem;
}

th,
td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The six zeros added to amounts published in millions: smaller, same colour (contrast unchanged). */
.zeros {
    font-size: 0.75em;
}

th:first-child,
thead th:first-child {
    text-align: left;
}

/* Budget laws per year. */
.budget-laws {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.budget-laws li {
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* Composition of the debt: thin segmented bar plus a list with swatch, name, amount and share.
   Palette validated with the dataviz validator (light surface): all checks pass; the third hue has
   2.74:1 against the surface, so every value is also given as text in the list and the table. */
.composition {
    margin: 1rem 0 1.5rem;
}

.composition figcaption {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.composition-bar {
    display: block;
    width: 100%;
    height: 1.5rem;
}

.series-1 {
    fill: #2a78d6;
}

.series-2 {
    fill: #eb6834;
}

.series-3 {
    fill: #189e6e;
}

.composition-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.composition-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    padding: 0.25rem 0;
}

.swatch {
    width: 0.75rem;
    height: 0.75rem;
    flex: none;
}

.composition-label {
    font-weight: 600;
}

.composition-value {
    font-variant-numeric: tabular-nums;
}

/* Week overview: summary per chamber. */
.week-summary {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-weight: 600;
}

.card h4 {
    font-size: 1.0625rem;
    line-height: 1.35;
    margin: 0 0 0.375rem;
}

/* Bill cost sections: original text with the line layout of the source (tables). */
.drafts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.draft {
    margin: 0 0 1.25rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--color-border);
}

.draft h3 {
    font-size: 1.125rem;
    line-height: 1.35;
    margin: 1rem 0 0.5rem;
}

.draft h4 {
    font-size: 1rem;
    margin: 1rem 0 0.25rem;
}

.original-text {
    margin: 0 0 0.5rem;
    white-space: pre-line;
}

/* AI summary: the notice is text, the border only repeats it. */
.ai-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #fff7ed;
    border-left: 4px solid var(--color-accent-2);
}

.ai-changes {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.ai-changes li {
    margin: 0 0 0.75rem;
    padding: 0.125rem 0 0.125rem 0.875rem;
    border-left: 3px solid var(--color-border);
}

.change-text {
    margin: 0;
}

.provision {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.875rem;
}

/* Sources and explanations of the system: closed by default, opened on demand (works without JavaScript). */
.notes {
    margin: 0.5rem 0;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.notes > summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    font-weight: 600;
}

.notes .hint,
.notes .source {
    margin: 0 0 0.5rem;
}

/* Subject areas from DIP: neutral labels, all the same colour (no ranking). */
.subject-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.375rem 0 0;
    padding: 0;
    list-style: none;
}

.subject-areas li {
    padding: 0.125rem 0.625rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.8125rem;
}

/* Filter by stage on the law list. */
.chip-filter ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.chip-filter a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.875rem;
    text-decoration: none;
}

.chip-filter a:hover {
    text-decoration: underline;
}

.chip-filter a[aria-current="page"] {
    background: var(--color-text);
    color: var(--color-card);
    border-color: var(--color-text);
    font-weight: 700;
}

.chip-count {
    margin-left: 0.25rem;
    opacity: 0.85;
}

.filter-label {
    margin: 0 0 0.375rem;
    font-weight: 600;
}

/* Search in the law list. */
.search-form {
    margin: 0 0 1.25rem;
}

.search-form label {
    display: block;
    margin: 0 0 0.375rem;
    font-weight: 600;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-row input[type="search"] {
    flex: 1 1 14rem;
    min-width: 0;
    min-height: 44px;
    padding: 0 0.75rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 2px solid var(--color-muted);
    border-radius: 6px;
    font: inherit;
}

.search-row button {
    min-height: 44px;
    min-width: 44px;
    padding: 0 1.25rem;
    background: var(--color-text);
    color: var(--color-card);
    border: 2px solid var(--color-text);
    border-radius: 22px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.search-form .hint {
    margin: 0.375rem 0 0;
    color: var(--color-muted);
    font-size: 0.875rem;
}

/* Subject area: one select instead of a wall of buttons; works without JavaScript. */
.area-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1rem;
}

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

.area-form select {
    min-height: 44px;
    max-width: 100%;
    padding: 0 0.75rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 2px solid var(--color-muted);
    border-radius: 6px;
    font: inherit;
}

.area-form button {
    min-height: 44px;
    min-width: 44px;
    padding: 0 1rem;
    background: var(--color-text);
    color: var(--color-card);
    border: 2px solid var(--color-text);
    border-radius: 22px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.list-summary a {
    display: inline-block;
    padding: 0.625rem 0;
    margin-left: 0.5rem;
    font-weight: 600;
}

.pagination li > a,
.pagination-gap {
    justify-content: center;
    padding: 0 0.5rem;
}

.pagination a[aria-current="page"] {
    background: var(--color-text);
    color: var(--color-card);
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

/* Footer links and the operator's address. */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-block;
    padding: 0.625rem 0;
    font-weight: 600;
}

.operator {
    margin: 0 0 1rem;
    font-style: normal;
}

.missing {
    padding: 0 0.375rem;
    background: #fff7ed;
    border: 1px dashed var(--color-accent-2);
    font-weight: 600;
}

/* Week tiles: what happened, in everyday words, before the procedural record. */
.outcomes {
    margin: 0.25rem 0 0.5rem;
    padding-left: 1.25rem;
    font-weight: 600;
}

.outcomes li {
    margin: 0 0 0.25rem;
}

.outcome-plain {
    margin: 0 0 0.25rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.tenor-label {
    color: var(--color-muted);
    font-weight: 400;
}

/*
 * Changes of a bill, grouped by kind. Every kind looks the same (no colour code); the overview
 * links jump to the groups (works without JavaScript).
 */
.change-overview ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.change-overview a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    padding: 0 0.75rem;
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-text);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.change-overview a:hover {
    text-decoration: underline;
}

.change-count {
    font-weight: 400;
}

.change-group h4 {
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.0625rem;
}
/* One-sentence summary in a tile: the first thing to read. */
.teaser {
    margin: 0.5rem 0 0.75rem;
    padding: 0.5rem 0 0.5rem 0.875rem;
    border-left: 4px solid var(--color-accent);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.45;
}

.ai-tag {
    display: inline-block;
    margin-left: 0.25rem;
    color: var(--color-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.source-compact {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
}

.source-compact a {
    min-height: 0;
    padding: 0.625rem 0;
}

/* "Auf den Punkt": the AI summary as a box above the long text. */
.on-point {
    margin: 1.25rem 0 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-card);
    border: 2px solid var(--color-accent);
    border-radius: 18px;
}

.on-point h2,
.on-point h3 {
    margin: 0 0 0.75rem;
}

.on-point > p:last-child {
    margin-bottom: 0;
}

.on-point-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 0.5rem;
}

.on-point-list dt {
    font-weight: 700;
}

.on-point-list dd {
    margin: 0;
}

/* Audit reports: numbered results and verbatim text of the Bundesrechnungshof. */
.audit-findings {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.audit-findings li {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.audit-findings a {
    display: inline-block;
    padding: 0.25rem 0;
    font-weight: 600;
}

.audit-number,
.audit-ministry {
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.original-paragraphs {
    max-width: 45rem;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 4px solid var(--color-border);
}

.original-paragraphs p {
    margin: 0 0 0.75rem;
}

/* Plenary decisions on the law detail page: a timeline, one step per sitting. Results are text
   with a symbol; colour only repeats them. */
.timeline {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.timeline-step {
    position: relative;
    margin: 0;
    padding: 0 0 1.5rem 1.75rem;
    border-left: 2px solid var(--color-border);
    margin-left: 0.5rem;
}

.timeline-step:last-child {
    border-left-color: transparent;
}

.timeline-step::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    left: -0.6875rem;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid var(--color-card);
    border-radius: 50%;
    background: var(--color-accent);
}

.step-br::before {
    background: #0f5f59;
}

.step-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    line-height: 1.35;
}

.chamber-badge {
    display: inline-block;
    padding: 0.0625rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--color-accent);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.step-br .chamber-badge {
    background: #0f5f59;
}

.step-date {
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 400;
}

.resolution {
    margin: 0 0 0.75rem;
}

.outcome-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin: 0 0 0.375rem;
}

.outcome {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
}

.outcome-yes {
    background: #dbeafe;
    color: #1e3a8a;
}

.outcome-no {
    background: #ffedd5;
    color: #9a3412;
}

.outcome-neutral {
    background: #eef1f7;
    color: var(--color-muted);
}

.outcome-line .outcome-plain {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
}

.outcome-line .tenor {
    font-weight: 600;
}

.remark {
    margin: 0 0 0.375rem;
    font-size: 0.9375rem;
}

/* Stacked bar for yes, no, abstentions. The counts are always written next to it. */
.vote-result {
    margin: 0.5rem 0;
    max-width: 36rem;
}

.vote-bar {
    display: block;
    width: 100%;
    height: 1rem;
    border-radius: 3px;
    overflow: hidden;
}

.vote-bar rect {
    stroke: var(--color-card);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.vote-yes {
    fill: #2a78d6;
}

.vote-no {
    fill: #eb6834;
}

.vote-abstain {
    fill: #7a8499;
}

.votes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0.375rem 0 0;
}

.votes div {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.votes dt {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9375rem;
}

.votes dd {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vote-bar-small {
    height: 0.5rem;
    margin-top: 0.25rem;
    min-width: 6rem;
    max-width: 14rem;
}

/* Votes on amendments and resolutions in the same sitting: indented, smaller. */
.side-votes {
    margin: 0.75rem 0 0.5rem;
    padding: 0.5rem 0 0.25rem 0.875rem;
    border-left: 3px solid var(--color-border);
}

.side-votes h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

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

.side-votes li + li {
    margin-top: 0.75rem;
}

.resolution-side .outcome {
    font-size: 0.875rem;
}

.explanation {
    margin: 0.5rem 0 0;
    font-size: 0.9375rem;
    font-style: italic;
}

.related-docs {
    margin: 0.375rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
}

.related-docs li {
    margin: 0 0 0.25rem;
}

.related-docs a {
    display: inline-block;
    min-height: 44px;
    padding: 0.625rem 0;
}

.related-hint {
    color: var(--color-muted);
}

/* Costs: overview read by the AI, then the wording of the newest draft, folded per section. */
.cost-overview {
    margin: 0 0 1.5rem;
}

.cost-areas {
    display: grid;
    gap: 1rem;
}

.cost-area {
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.cost-area h4 {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
}

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

.cost-item + .cost-item {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px dashed var(--color-border);
}

.cost-label {
    margin: 0 0 0.375rem;
    font-weight: 600;
    line-height: 1.4;
}

.cost-direction {
    display: inline-block;
    margin-right: 0.25rem;
    padding: 0 0.5rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.cost-burden .cost-direction {
    background: #ffedd5;
    color: #9a3412;
}

.cost-relief .cost-direction {
    background: #dbeafe;
    color: #1e3a8a;
}

.cost-values {
    margin: 0;
}

.cost-values div {
    display: grid;
    grid-template-columns: minmax(4.5rem, max-content) 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.125rem 0;
}

.cost-values dt {
    color: var(--color-muted);
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
}

.cost-values dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin: 0;
}

.cost-bar {
    flex: 1 1 8rem;
    height: 0.75rem;
    max-width: 22rem;
}

.cost-burden .cost-bar rect {
    fill: #eb6834;
}

.cost-relief .cost-bar rect {
    fill: #2a78d6;
}

.cost-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wording-intro {
    margin: 0.5rem 0 0.25rem;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.cost-section {
    border-top: 1px solid var(--color-border);
}

.cost-section:last-of-type {
    border-bottom: 1px solid var(--color-border);
}

.cost-section > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    font-weight: 600;
}

.cost-section > summary h4 {
    display: inline;
    margin: 0;
    font-size: 1rem;
}

.cost-section[open] > summary {
    margin-bottom: 0.25rem;
}

.versions-heading {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.0625rem;
}

.draft-versions {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.draft-versions p {
    margin: 0;
}

.draft-versions a {
    display: inline-block;
    min-height: 44px;
    padding: 0.625rem 0;
}

@media (min-width: 48rem) {
    .cost-areas {
        grid-template-columns: repeat(2, 1fr);
    }

    .cost-area-haushalt {
        grid-column: 1 / -1;
    }
}

.notice {
    padding: 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

.site-footer h2 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.site-footer p {
    max-width: 45rem;
    margin: 0;
    color: var(--color-muted);
}

.status-done {
    background: var(--color-text);
    color: var(--color-card);
}

/* Start page, after the design draft. */
.home {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    padding: 1.5rem 0 1rem;
}

.home > section > h2,
.section-head h2 {
    margin: 0 0 1rem;
    font-size: 1.75rem;
}

.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: stretch;
}

.hero-text {
    flex: 999 1 28.75rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.125rem, 5vw, 3.5rem);
    line-height: 1.08;
}

.hero-lead {
    margin: 0;
    max-width: 35rem;
    color: var(--color-muted);
    font-size: 1.25rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 3.25rem;
    padding: 0 1.5rem;
    background: var(--color-card);
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
}

.quick-links li:first-child a {
    background: var(--color-accent);
    color: var(--color-card);
}

.quick-links a:hover {
    text-decoration: underline;
}

.debt-box {
    flex: 1 1 23.75rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem;
    background: var(--color-text);
    color: var(--color-on-dark);
    border-radius: 24px;
}

.home .debt-box h2 {
    margin: 0;
    color: var(--color-on-dark-muted);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.debt-box-total {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.375rem, 3.2vw, 2.25rem);
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Numbers are not broken inside; the line may break before the unit. */
.nowrap {
    white-space: nowrap;
}

.debt-box-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.debt-box-tiles div {
    flex: 1 1 8.75rem;
    padding: 0.875rem;
    background: var(--color-dark-tile);
    border-radius: 14px;
}

.debt-box-tiles dt {
    color: var(--color-on-dark-muted);
    font-size: 0.875rem;
}

.debt-box-tiles dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.debt-box-note {
    margin: 0;
    color: var(--color-on-dark-muted);
    font-size: 0.875rem;
}

.debt-box-note a {
    display: inline-block;
    padding: 0.625rem 0;
    color: var(--color-on-dark);
    font-weight: 600;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 1.5rem;
}

.section-head a,
.more-link a {
    display: inline-block;
    padding: 0.625rem 0;
    font-weight: 600;
}

.more-link {
    margin: 0.5rem 0 0;
}

.stat-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stat-tiles li {
    flex: 1 1 6rem;
    display: flex;
    flex-direction: column;
    padding: 0.875rem 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 18px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(1.625rem, 6vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: var(--color-muted);
}

.law-cards {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.law-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: anywhere;
}

.law-card h3 {
    margin: 0;
    font-size: 1.3125rem;
    line-height: 1.3;
}

.law-card h3 a {
    display: inline-block;
    padding: 0.25rem 0;
}

.law-card p {
    margin: 0;
}

.law-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.law-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

.law-card-foot a {
    display: inline-block;
    padding: 0.625rem 0;
    font-weight: 600;
}

.ai-chip {
    padding: 0.25rem 0.625rem;
    background: var(--color-background);
    color: var(--color-muted);
    border-radius: 8px;
}

.money {
    padding: 1.75rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
}

.money p {
    margin: 0 0 1rem;
}

.money-bars {
    display: grid;
    gap: 0.875rem;
    margin: 0 0 0.5rem;
}

.money-bars div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
}

.money-bars dt,
.money-bars dd {
    font-weight: 600;
}

.money-bars dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.money-bars .money-bar {
    grid-column: 1 / -1;
}

.money-bar svg {
    display: block;
    width: 100%;
    height: 1rem;
}

.bar-track {
    fill: #e6eaf4;
}

.bar-revenue {
    fill: var(--color-accent);
}

.bar-spending {
    fill: var(--color-accent-2);
}

@media (min-width: 48rem) {
    h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .home {
        padding: 2.5rem 0 1rem;
    }

    .card {
        padding: 1.25rem 1.5rem;
    }

    .facts div {
        grid-template-columns: 12rem 1fr;
    }
}

/*
 * High contrast. The same rules twice: by the system setting (unless the visitor switched it off
 * with the button) and by the button. tests/Unit/View/StylesheetTest.php checks that both blocks
 * stay identical.
 */
@media (prefers-contrast: more) {
    :root:not(.contrast-normal) {
        --color-background: #ffffff;
        --color-text: #000000;
        --color-accent: #0b2a8a;
        --color-border: #000000;
        --color-muted: #000000;
    }

    :root:not(.contrast-normal) .status {
        background: #ffffff;
        color: #000000;
        border-color: #000000;
    }

    :root:not(.contrast-normal) .status-done,
    :root:not(.contrast-normal) .quick-links li:first-child a {
        background: #000000;
        color: #ffffff;
    }

    :root:not(.contrast-normal) .money-bar rect,
    :root:not(.contrast-normal) .composition-bar rect {
        stroke: #000000;
        stroke-width: 2;
        vector-effect: non-scaling-stroke;
    }

    :root:not(.contrast-normal) .source,
    :root:not(.contrast-normal) .hint,
    :root:not(.contrast-normal) .provision {
        color: var(--color-text);
    }

    :root:not(.contrast-normal) .ai-notice {
        background: #ffffff;
        border: 2px solid #000000;
    }

    :root:not(.contrast-normal) .swatch rect {
        stroke: #000000;
        stroke-width: 2;
    }

    :root:not(.contrast-normal) .outcome,
    :root:not(.contrast-normal) .cost-direction,
    :root:not(.contrast-normal) .chamber-badge {
        background: #ffffff;
        color: #000000;
        border-color: #000000;
    }

    :root:not(.contrast-normal) .vote-bar rect,
    :root:not(.contrast-normal) .cost-bar rect {
        stroke: #000000;
        stroke-width: 2;
        vector-effect: non-scaling-stroke;
    }

    :root:not(.contrast-normal) .related-hint,
    :root:not(.contrast-normal) .step-date,
    :root:not(.contrast-normal) .cost-values dt {
        color: var(--color-text);
    }
}

@media all {
    :root.contrast-more {
        --color-background: #ffffff;
        --color-text: #000000;
        --color-accent: #0b2a8a;
        --color-border: #000000;
        --color-muted: #000000;
    }

    :root.contrast-more .status {
        background: #ffffff;
        color: #000000;
        border-color: #000000;
    }

    :root.contrast-more .status-done,
    :root.contrast-more .quick-links li:first-child a {
        background: #000000;
        color: #ffffff;
    }

    :root.contrast-more .money-bar rect,
    :root.contrast-more .composition-bar rect {
        stroke: #000000;
        stroke-width: 2;
        vector-effect: non-scaling-stroke;
    }

    :root.contrast-more .source,
    :root.contrast-more .hint,
    :root.contrast-more .provision {
        color: var(--color-text);
    }

    :root.contrast-more .ai-notice {
        background: #ffffff;
        border: 2px solid #000000;
    }

    :root.contrast-more .swatch rect {
        stroke: #000000;
        stroke-width: 2;
    }

    :root.contrast-more .outcome,
    :root.contrast-more .cost-direction,
    :root.contrast-more .chamber-badge {
        background: #ffffff;
        color: #000000;
        border-color: #000000;
    }

    :root.contrast-more .vote-bar rect,
    :root.contrast-more .cost-bar rect {
        stroke: #000000;
        stroke-width: 2;
        vector-effect: non-scaling-stroke;
    }

    :root.contrast-more .related-hint,
    :root.contrast-more .step-date,
    :root.contrast-more .cost-values dt {
        color: var(--color-text);
    }
}

@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;
    }
}
