:root {
    --paper: #f6f5f1;
    --surface: #ffffff;
    --surface-alt: #efede6;
    --ink: #1c2430;
    --muted: #5b6573;
    --line: #e1ddd3;
    --accent: #2e6b5b;
    --accent-ink: #ffffff;
    --accent-soft: #e0eee8;
    --public: #a8512f;
    --public-soft: #f6e4dc;
    --school: #33628f;
    --school-soft: #e0eaf4;
    --indicative: #8a6317;
    --indicative-soft: #f4ead3;
    --neutral-soft: #ebe8e1;
    --code-bg: #1f2733;
    --code-ink: #e8ecf1;
    --focus: #2e6b5b;
    --radius: 12px;
    --radius-small: 8px;
    --shadow: 0 1px 2px rgba(28, 36, 48, 0.06), 0 4px 16px rgba(28, 36, 48, 0.05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #11151b;
        --surface: #181e26;
        --surface-alt: #1e252f;
        --ink: #e6e9ed;
        --muted: #9ba5b1;
        --line: #2a323d;
        --accent: #79c2aa;
        --accent-ink: #0f1a17;
        --accent-soft: #1d3530;
        --public: #e8977a;
        --public-soft: #3a241c;
        --school: #8fb7e0;
        --school-soft: #1c2a3a;
        --indicative: #e0bb6a;
        --indicative-soft: #33291a;
        --neutral-soft: #242b35;
        --code-bg: #0b0f14;
        --code-ink: #dfe5ec;
        --focus: #79c2aa;
        --shadow: none;
        color-scheme: dark;
    }
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
p { margin: 0 0 0.9rem; }
code { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--surface-alt); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-small); z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background:
    linear-gradient(var(--surface), var(--surface)) 5px 9px / 16px 12px no-repeat,
    linear-gradient(var(--accent), var(--accent)); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 8px; top: 12px; width: 5px; height: 5px; border-radius: 1px; background: var(--public); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 550; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding-top: 32px; padding-bottom: 56px; }

.hero { padding: 24px 0 8px; max-width: 820px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 650; color: var(--accent); margin-bottom: 0.6rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 760px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4rem; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--accent); }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-primary:hover { filter: brightness(1.05); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 36px 0 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.92rem; }

.section { margin-top: 44px; }
.page-header { margin-bottom: 24px; }
.breadcrumb { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }

.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.example, .card, .endpoint { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.example p { color: var(--muted); }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px 28px; }
.feature-list li { padding-left: 16px; border-left: 3px solid var(--accent-soft); }

.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 20px 22px; }

pre.code { position: relative; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius-small); padding: 14px 16px; margin: 0.6rem 0 0; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; }
pre.code code { white-space: pre; }
.code-frame { position: relative; margin: 0.6rem 0 0; }
.code-frame pre.code { margin: 0; padding-top: 40px; }
.copy-button { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.1); color: var(--code-ink); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; font: inherit; font-size: 0.75rem; padding: 3px 8px; cursor: pointer; }
.copy-button:hover { background: rgba(255, 255, 255, 0.2); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 200px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field-action { flex: 0 0 auto; }
input[type="search"], select { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--paper); color: var(--ink); font: inherit; }
select:disabled { opacity: 0.6; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 550; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.filters-count { margin: 0 0 0 auto; color: var(--muted); font-size: 0.92rem; align-self: center; }

.legend { margin-bottom: 18px; color: var(--muted); }
.legend summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.legend dt { font-weight: 650; color: var(--ink); }
.legend dd { margin: 0; }

.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-alt); white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.countries-table tbody th { min-width: 190px; }
.years span { display: block; white-space: nowrap; }

.code { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); background: var(--surface-alt); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.code-large { font-size: 0.9rem; vertical-align: middle; }
.muted { color: var(--muted); font-size: 0.9em; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 5px; vertical-align: middle; margin-left: 4px; }
.tag-eu { background: var(--school-soft); color: var(--school); }

.badge { display: inline-block; font-size: 0.8rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; margin-right: 4px; }
.badge-public { background: var(--public-soft); color: var(--public); }
.badge-school { background: var(--school-soft); color: var(--school); }
.badge-indicative { background: var(--indicative-soft); color: var(--indicative); }
.badge-none { background: var(--neutral-soft); color: var(--muted); }
.badge-neutral { background: var(--accent-soft); color: var(--accent); }
.source-chip, .zone-chip { display: inline-block; font-size: 0.78rem; background: var(--surface-alt); border-radius: 6px; padding: 1px 7px; margin: 0 4px 4px 0; white-space: nowrap; }
.empty-state { text-align: center; color: var(--muted); padding: 24px; }

.coverage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.dot-public { background: var(--public); }
.dot-school { background: var(--school); }
.card-lead { color: var(--ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 0.93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.notes, .documents { padding-left: 20px; }
.notes li, .documents li { margin-bottom: 6px; }

.two-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; gap: 2px; padding: 10px 0 10px 14px; border-left: 2px solid var(--line); }
.timeline li + li { margin-top: 2px; }
.timeline-date { font-weight: 650; font-variant-numeric: tabular-nums; }
.timeline-name { color: var(--ink); }
.timeline-zones { font-size: 0.85rem; }

.doc-layout { display: grid; gap: 28px; }
@media (min-width: 960px) { .doc-layout { grid-template-columns: 220px 1fr; } .doc-toc { position: sticky; top: 20px; align-self: start; } }
.doc-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.doc-toc a { color: var(--muted); text-decoration: none; }
.doc-toc a:hover { color: var(--ink); }
.doc-content { min-width: 0; }
.doc-section { margin-bottom: 40px; scroll-margin-top: 16px; }
.doc-section ul { padding-left: 20px; }
.doc-section li { margin-bottom: 6px; }
.endpoint { margin: 16px 0; }
.endpoint-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1rem; }
.endpoint-path code { overflow-wrap: anywhere; }
.method { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 2px 7px; border-radius: 5px; }
.endpoint .table-scroll { margin: 10px 0; }

.playground { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.playground .field { flex: 1 1 170px; }
.playground-result { margin-top: 24px; }
.request-line { margin-bottom: 20px; }
.raw-json { margin-top: 24px; }
.raw-json summary { cursor: pointer; font-weight: 600; }
.raw-json pre { max-height: 480px; }
.error-box { background: var(--public-soft); color: var(--public); border-radius: var(--radius-small); padding: 14px 16px; margin-top: 18px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.9rem; }
.footer-inner { padding-top: 22px; padding-bottom: 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }

[hidden] { display: none !important; }
