:root {
    --bg: #f7f4ee;
    --bg-alt: #efeae1;
    --surface: #fffdf8;
    --surface-2: #fbf8f2;
    --ink: #17211f;
    --ink-soft: #394541;
    --muted: #68736f;
    --line: #ddd6c9;
    --line-strong: #c9c0b0;
    --accent: #0f766e;
    --accent-dark: #0b5d56;
    --accent-soft: #dbeee9;
    --cinnabar: #b8422e;
    --cinnabar-soft: #f6e1dc;
    --gold: #a8783c;
    --gold-soft: #f5ead7;
    --gold-dark: #7a5524;
    --shadow: 0 1px 2px rgba(23, 33, 31, .04), 0 12px 32px rgba(23, 33, 31, .06);
    --radius: 16px;
    --radius-sm: 10px;
    --container: 1240px;
    --sans: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "Noto Sans SC", sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", serif;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

[dir="rtl"] {
    --sans: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif;
}

[data-theme="dark"] {
    --bg: #111714;
    --bg-alt: #161e1a;
    --surface: #18211d;
    --surface-2: #1c2722;
    --ink: #eef2ea;
    --ink-soft: #d2dbd4;
    --muted: #9aa9a2;
    --line: #2c3933;
    --line-strong: #3c4c44;
    --accent: #5fc3b5;
    --accent-dark: #8bd8cb;
    --accent-soft: #1e3933;
    --cinnabar: #ef8e78;
    --cinnabar-soft: #3a211c;
    --gold: #d3a86a;
    --gold-soft: #33291b;
    --gold-dark: #e8c68e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

[data-theme="dark"] .hero-panel::before,
[data-theme="dark"] .hero::after { opacity: .35; }
[data-theme="dark"] .brand-mark { filter: brightness(1.15); }

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

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

html { color-scheme: light dark; }
html, body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 {
    font-family: var(--serif);
    overflow-wrap: break-word;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.01em;
    color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); margin: 0 0 .55rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-inline-start: 1.25rem; }
::selection { background: var(--accent); color: #fff; }

.container {
    width: min(var(--container), calc(100% - 3rem));
    margin-inline: auto;
}

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

.skip-link {
    position: fixed;
    inset-block-start: -100px;
    inset-inline-start: 1rem;
    z-index: 1000;
    padding: .7rem 1rem;
    background: var(--ink);
    color: var(--surface);
    border-radius: 8px;
}
.skip-link:focus { inset-block-start: 1rem; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.demo-banner,
.announcement {
    background: var(--cinnabar);
    color: #fff;
    font-size: .82rem;
    line-height: 1.5;
    text-align: center;
    padding: .45rem 1rem;
}
.announcement { background: var(--ink); }
.demo-banner span { display: block; max-width: 1000px; margin-inline: auto; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    min-height: 74px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--ink);
    flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}
.brand-tagline {
    color: var(--muted);
    font-size: .72rem;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.primary-nav {
    display: flex;
    align-items: center;
    gap: .15rem;
    margin-inline-start: .6rem;
}
.primary-nav a {
    padding: .45rem .7rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: .88rem;
    font-weight: 550;
}
.primary-nav a:hover { background: var(--surface-2); color: var(--ink); }
.primary-nav a.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.theme-toggle {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--accent-dark); }
.theme-toggle .theme-moon { display: none; }
html[data-effective-theme="dark"] .theme-toggle .theme-sun { display: none; }
html[data-effective-theme="dark"] .theme-toggle .theme-moon { display: block; }
.mobile-theme-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-block: .6rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: .86rem;
    font-weight: 550;
}
.header-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: .1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: .2rem .25rem .2rem .7rem;
}
.header-search input {
    width: 150px;
    border: 0;
    background: transparent;
    outline: 0;
    font-size: .82rem;
    padding: .3rem 0;
}
.header-search button {
    border: 0;
    background: var(--surface-2);
    color: var(--ink-soft);
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.header-search button:hover { background: var(--accent-soft); color: var(--accent-dark); }

.lang-switch, .currency-switch { position: relative; }
.currency-switch summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .42rem .6rem;
    font-size: .8rem;
    cursor: pointer;
    background: var(--surface);
    color: var(--ink-soft);
    white-space: nowrap;
}
.currency-switch summary::-webkit-details-marker { display: none; }
.currency-switch summary:hover { border-color: var(--line-strong); }
.currency-symbol { font-weight: 700; color: var(--accent-dark); }
.currency-label { font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.currency-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + .5rem);
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .3rem;
    z-index: 60;
}
.currency-menu button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    border-radius: 7px;
    padding: .45rem .55rem;
    font-size: .82rem;
    cursor: pointer;
}
.currency-menu button:hover { background: var(--surface-2); }
.currency-menu button.is-current { background: var(--accent-soft); color: var(--accent-dark); }
.currency-note { font-size: .68rem; color: var(--muted); max-width: 60ch; }
.money-value { white-space: nowrap; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.chart-axis { direction: ltr; unicode-bidi: isolate; }
.lang-switch summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .42rem .65rem;
    font-size: .8rem;
    cursor: pointer;
    background: var(--surface);
    color: var(--ink-soft);
    white-space: nowrap;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { border-color: var(--line-strong); }
.lang-switch .chevron { transition: transform .2s ease; }
.lang-switch[open] .chevron { transform: rotate(90deg); }
.lang-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + .5rem);
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .35rem;
    max-height: 60vh;
    overflow: auto;
    z-index: 60;
}
.lang-menu a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem .6rem;
    border-radius: 8px;
    font-size: .86rem;
    color: var(--ink-soft);
}
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a.is-current { background: var(--accent-soft); color: var(--accent-dark); }
.lang-code { color: var(--muted); font-size: .7rem; font-family: var(--mono); }
.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    width: 40px; height: 40px;
    place-items: center;
    color: var(--ink);
}
.nav-toggle .close-icon { display: none; }
.nav-toggle[aria-expanded="true"] .menu-icon { display: none; }
.nav-toggle[aria-expanded="true"] .close-icon { display: block; }
.mobile-nav { border-top: 1px solid var(--line); background: var(--surface); }
.mobile-nav nav {
    display: flex;
    flex-direction: column;
    padding-block: .6rem;
}
.mobile-nav a {
    padding: .7rem .2rem;
    border-bottom: 1px solid var(--line);
    font-weight: 550;
    color: var(--ink-soft);
}
.mobile-nav a:last-child { border-bottom: 0; }
@media (min-width: 1101px) {
    .mobile-nav { display: none !important; }
}

/* Icons */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 28px; height: 28px; }

/* Type helpers */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .7rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin: 0 0 .55rem;
}
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.text-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 600;
    font-size: .86rem;
    color: var(--accent-dark);
}
.text-link:hover { gap: .4rem; }
.page-lede {
    font-size: 1.04rem;
    color: var(--ink-soft);
    max-width: 75ch;
    line-height: 1.65;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    padding-block: 2rem 1.25rem;
}
.page-header-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.page { padding-block: 1.2rem 3.5rem; }
.section { padding-block: 2.4rem; }
.section-tight { padding-block: 1rem; }
.section-alt {
    background: var(--bg-alt);
    border-block: 1px solid var(--line);
    margin-block: 1rem;
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-block-end: 1.35rem;
}
.section-head p { margin: .2rem 0 0; color: var(--muted); max-width: 65ch; }
.section-title { font-size: 1.2rem; margin-block: 0 1rem; }

/* Buttons and chips */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .62rem 1rem;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.2;
    transition: background .15s ease, transform .15s ease;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button:active { transform: translateY(1px); }
.button-ghost {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--line);
}
.button-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .34rem .7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .82rem;
    font-weight: 550;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip-nav-lg { margin-block: .6rem 1rem; }
.chip-nav-light .chip { background: transparent; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: .74rem;
    font-weight: 700;
}
.badge-demo { background: var(--cinnabar-soft); color: var(--cinnabar); }
.pill {
    display: inline-block;
    padding: .24rem .62rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--surface);
    font-size: .72rem;
    font-weight: 600;
}
.pill-soft { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.pill-link { text-decoration: none; }
.pill-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.year-badge {
    font-family: var(--mono);
    font-size: .72rem;
    padding: .2rem .5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: 3.2rem 2.4rem;
    border-bottom: 1px solid var(--line);
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(50rem 22rem at 85% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%),
        radial-gradient(32rem 18rem at 5% 110%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%);
}
.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
    gap: 3rem;
    align-items: center;
}
.hero-copy h1 { max-width: 15ch; }
.hero-lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 58ch; }
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: .45rem .45rem .45rem .9rem;
    box-shadow: var(--shadow);
    max-width: 560px;
}
.search-bar .icon { color: var(--muted); }
.search-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: .55rem 0;
    outline: 0;
}
.search-bar button {
    border: 0;
    background: var(--ink);
    color: var(--surface);
    padding: .62rem 1rem;
    border-radius: 9px;
    font-weight: 600;
    font-size: .86rem;
}
.search-bar button:hover { background: var(--accent-dark); }
.search-bar-small { max-width: 440px; margin-block: 1rem 1.5rem; }
.search-hint { color: var(--muted); font-size: .8rem; margin: .5rem 0 0; }
.hero-meta {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    margin-block-start: 1.4rem;
    color: var(--muted);
    font-size: .82rem;
}
.hero-meta strong { color: var(--ink); font-size: .95rem; }
.hero-panel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.hero-panel::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--cinnabar));
    border-radius: 22px 22px 0 0;
}
.hero-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-block: 1rem;
}
.hero-stats > div {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .7rem .8rem;
}
.hero-stats strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.5rem;
    line-height: 1.15;
    margin-block-start: .1rem;
}
.stat-label {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .02em;
}
.stat-unit { font-size: .7rem; color: var(--muted); }
.hero-chart { margin-block: .2rem .4rem; }

.region-jump-panel { padding: .9rem; }
.region-jump-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .4rem;
    max-height: 340px;
    overflow: auto;
}
.region-jump {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    padding: .48rem .6rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink-soft);
    line-height: 1.25;
}
.region-jump:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.region-jump span { font-size: .82rem; font-weight: 650; }
.region-jump small { color: var(--muted); font-size: .66rem; }
@media (max-width: 720px) {
    .region-jump-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 300px; }
}

/* Stats and cards */
.stat-grid {
    display: grid;
    gap: .75rem;
    margin-block: .5rem;
}
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .9rem 1rem;
    min-width: 0;
}
.stat-value {
    display: block;
    font-family: var(--serif);
    font-size: 1.5rem;
    line-height: 1.2;
    margin-block: .15rem .1rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.stat-meta { color: var(--muted); font-size: .72rem; }
.stat strong.positive, .positive { color: var(--accent-dark); }
.stat strong.negative, .negative { color: var(--cinnabar); }

/* Province grid */
.province-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .55rem;
}
.province-card {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .7rem .8rem;
    color: var(--ink);
    min-width: 0;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.province-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--ink);
}
.province-rank { font-family: var(--mono); font-size: .62rem; color: var(--muted); }
.province-name { font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.province-pop { font-size: .78rem; color: var(--accent-dark); font-weight: 600; }
.province-meta { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Panels and layout */
.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr);
    gap: 1.1rem;
    align-items: start;
}
.split-7-5 { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .9fr); }
.side-stack { display: grid; gap: 1rem; }
.home-split { align-items: stretch; }
.home-recent-stack { display: flex; flex-direction: column; gap: 1rem; }
.home-recent-panel { display: flex; flex: 1 1 auto; flex-direction: column; }
.home-region-tabs { margin-block-end: .6rem; }
.home-region-tab-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.home-region-tab-panel[hidden] { display: none; }
.home-region-list { display: flex; flex: 1 1 auto; flex-direction: column; }
.home-region-list > li { flex: 1 1 auto; align-items: center; }
.rank-list.recent-list li { flex-direction: row; align-items: center; gap: .5rem; padding-block: .3rem; }
.rank-list.recent-list li a { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: .82rem; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.rank-list.recent-list .recent-meta { flex: 0 0 auto; color: var(--muted); font-size: .68rem; line-height: 1.2; white-space: nowrap; }
.recent-meta { color: var(--muted); font-size: .72rem; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    min-width: 0;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-block-end: .7rem;
}
.panel-head p, .panel-lede { color: var(--muted); font-size: .85rem; margin: 0 0 .7rem; }
.panel-head p { margin-block-end: 0; }
.panel-note { background: var(--surface-2); border-style: dashed; }
.panel-table { padding: 0; overflow: hidden; }
.panel-facts .fact-list { margin-block-end: .6rem; }
.fact-list { margin: 0; }
.fact-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line);
}
.fact-list > div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--muted); font-size: .8rem; }
.fact-list dd { margin: 0; text-align: end; font-weight: 600; font-size: .85rem; }
.fact-list dd small { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.rank-list { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.rank-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .85rem;
}
.rank-list li:last-child { border-bottom: 0; }
.rank-list li span { color: var(--muted); font-size: .75rem; flex-shrink: 0; }
.rank-list-numbered { counter-reset: rank; }
.rank-list-numbered li { counter-increment: rank; }
.rank-list-numbered li::before {
    content: counter(rank, decimal-leading-zero);
    font-family: var(--mono);
    color: var(--muted);
    font-size: .68rem;
    flex-shrink: 0;
    width: 1.4rem;
}
.rank-list-numbered li a { flex: 1; }
.inline-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.side-title { margin-block-start: 1rem; }
.link-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .52rem 0;
    font-size: .85rem;
}
.link-list a span { color: var(--muted); font-size: .72rem; }

/* Topics and guides */
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.topic-card {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.topic-card .icon { color: var(--accent); }
.topic-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--ink);
}
.topic-card h3 { margin: .3rem 0 0; }
.topic-card p { color: var(--muted); font-size: .85rem; margin: 0; }
.compare-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.compare-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem .6rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .82rem;
    text-align: center;
    flex-wrap: wrap;
}
.compare-feature em { font-style: normal; color: var(--cinnabar); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.compare-feature:hover { border-color: var(--accent); color: var(--accent-dark); }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.guide-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    color: var(--ink);
}
.guide-card h2, .guide-card h3 { margin: .15rem 0 .2rem; }
.guide-card p { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.guide-card:hover { border-color: var(--accent); }
a.guide-card { color: var(--ink); }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
    min-width: 620px;
}
.data-table th, .data-table td {
    padding: .58rem .7rem;
    text-align: start;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td, .data-table tbody tr:last-child th { border-bottom: 0; }
.data-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-pill { text-decoration: none; border: 1px solid var(--line-strong); color: var(--accent-dark); }
.rank-pill:hover { border-color: var(--accent); background: var(--accent-soft); }
.rank-pill--province { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.rank-pill--province:hover { border-color: var(--accent-dark); background: var(--accent-soft); }
.rank-pill--city { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-dark); }
.rank-pill--city:hover { border-color: var(--gold-dark); background: var(--gold-soft); }
.rank-pill--national { border-color: var(--cinnabar); background: var(--cinnabar-soft); color: var(--cinnabar); }
.rank-pill--national:hover { border-color: var(--cinnabar); background: var(--cinnabar-soft); }

.data-table .num small { display: block; color: var(--muted); font-size: .68rem; }
.data-table .rank-cell { font-family: var(--mono); color: var(--muted); width: 3rem; }
.data-table .region-link { font-weight: 650; }
.data-table .row-sub { display: block; color: var(--muted); font-size: .7rem; }
.ranking-table tbody tr.is-top .rank-cell { color: var(--cinnabar); font-weight: 700; }
.ranking-table tbody tr[id] { scroll-margin-block-start: 110px; }
.ranking-table tbody tr.is-focused,
.ranking-table tbody tr[id]:target { background: var(--accent-soft); }
.ranking-table tbody tr.is-focused .rank-cell,
.ranking-table tbody tr[id]:target .rank-cell { color: var(--accent-dark); font-weight: 700; }
.ranking-focus-note {
    margin-block: .2rem 1rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: .84rem;
}
.ranking-focus-note a { margin-inline-start: .5rem; font-weight: 650; }
.ranking-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
    margin-block: .8rem .4rem;
}
.ranking-pager-status { color: var(--muted); font-size: .8rem; margin: 0; }
.pagination { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .3rem .55rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .78rem;
    text-decoration: none;
}
.pagination .page-link:hover { border-color: var(--accent); color: var(--accent-dark); }
.pagination .page-link.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 650;
}
.pagination .page-link.is-disabled { opacity: .45; pointer-events: none; }
.history-table tbody th { font-weight: 600; color: var(--ink-soft); white-space: nowrap; background: var(--surface-2); }
.table-note { color: var(--muted); font-size: .76rem; margin-block: .6rem; }
.table-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-block-start: .6rem; flex-wrap: wrap; }
.panel-table .data-table { min-width: 760px; }

/* Breadcrumbs */
.breadcrumbs { padding-block: .8rem 0; }
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .76rem;
    color: var(--muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: .35rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--ink-soft); }

/* Region page */
.region-header {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
    gap: 2rem;
    align-items: start;
}
.region-flags { display: flex; gap: .4rem; flex-wrap: wrap; margin-block-end: .8rem; }
.region-title-block h1 { max-width: 20ch; }
.region-title-block, .region-header > *, .page-header > *, .split-layout > *, .stat, .panel { min-width: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-block-start: 1rem; }
.region-scorecard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: var(--shadow);
}
.score-main span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.score-main strong { display: block; font-family: var(--serif); font-size: clamp(1.4rem, 3.2vw, 2.1rem); line-height: 1.1; margin-block: .15rem; overflow-wrap: anywhere; }
.score-main small { color: var(--muted); font-size: .72rem; }
.score-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    border-top: 1px solid var(--line);
    margin-block-start: .7rem;
    padding-block-start: .7rem;
}
.score-row span { display: block; font-size: .68rem; color: var(--muted); }
.score-row strong { font-size: 1.05rem; }
.score-row small { color: var(--muted); font-size: .65rem; }
.score-change {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--line);
    margin-block-start: .7rem;
    padding-block-start: .7rem;
    font-size: .75rem;
    color: var(--muted);
}
.score-change strong { font-size: 1rem; }
.census-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    margin-block-end: .7rem;
}
.census-summary > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; }
.census-summary span { display: block; font-size: .68rem; color: var(--muted); }
.census-summary strong { display: block; font-family: var(--serif); font-size: 1.2rem; margin-block: .05rem; }
.census-summary small { color: var(--muted); font-size: .68rem; }
.source-note { color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); padding-block: 1rem; }
.error-page { text-align: center; padding-block: 4rem; }
.error-code { font-family: var(--mono); font-size: 4rem; color: var(--line-strong); line-height: 1; }
.error-page .search-bar { margin-inline: auto; margin-block: 1.5rem; }
.error-page .page-actions { justify-content: center; }

/* Composition */
[data-height-target] { display: flex; flex-direction: column; overflow: hidden; }
[data-height-target] > h2,
[data-height-target] > .panel-lede { flex-shrink: 0; }
[data-height-target] > .composition-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: .2rem;
}
[data-height-target] > .composition-scroll .composition { padding-block-end: .1rem; }
.composition { display: grid; gap: .55rem; }
.composition-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: .3rem .7rem; align-items: center; }
.composition-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; }
.composition-label strong { font-variant-numeric: tabular-nums; }
.composition-track { grid-column: 1 / 2; height: 6px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
.composition-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: inherit; }
.composition-pop { grid-column: 2 / 3; grid-row: 1 / span 2; text-align: end; color: var(--muted); font-size: .7rem; }

/* Charts */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart-axis-strong { font-weight: 700; fill: var(--ink-soft); }
.chart-age { font-size: 12px; fill: var(--ink-soft); paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px; stroke-linejoin: round; }
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    margin-block-start: .4rem;
    font-size: .74rem;
    color: var(--muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty { color: var(--muted); font-size: .85rem; padding: 1rem 0; }
.pyramid-chart { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.pyramid-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pyramid-chart svg { min-width: 600px; max-height: none; }
.pyramid-data { margin-block-start: 1rem; }
.pyramid-data h3 { font-family: var(--sans); font-size: .95rem; margin-block: 0 .5rem; }
.pyramid-data .table-wrap { max-height: 360px; overflow-y: auto; }
.pyramid-table { min-width: 0; }
.pyramid-table thead th { position: sticky; top: 0; z-index: 1; }

/* Ranking hub */
.ranking-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.ranking-metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}
.ranking-metric-head { display: flex; align-items: center; gap: .5rem; margin-block-end: .6rem; }
.ranking-metric-head .icon { color: var(--accent); }
.ranking-metric-head h2 { font-size: 1rem; margin: 0; font-family: var(--sans); font-weight: 650; }
.ranking-metric-links { display: flex; gap: .35rem; flex-wrap: wrap; }
.ranking-metric-links a {
    font-size: .74rem;
    padding: .28rem .5rem;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    gap: .2rem;
}
.ranking-metric-links a:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Regions index */
.city-groups { display: grid; gap: .8rem; }
.city-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.city-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-block-end: .6rem; }
.city-group-head h2 { font-size: 1.05rem; margin: 0; font-family: var(--sans); }
.city-group-head span { color: var(--muted); font-size: .72rem; }
.city-links { display: flex; flex-wrap: wrap; gap: .35rem .5rem; }
.city-links a {
    display: inline-flex;
    gap: .35rem;
    align-items: baseline;
    font-size: .82rem;
    padding: .22rem .5rem;
    border-radius: 7px;
    border: 1px solid transparent;
    color: var(--ink-soft);
}
.city-links a span { color: var(--muted); font-size: .66rem; }
.city-links a:hover { background: var(--surface-2); border-color: var(--line); color: var(--accent-dark); }

/* Compare */
.compare-form {
    display: flex;
    align-items: flex-end;
    gap: .8rem;
    flex-wrap: wrap;
}
.compare-field { flex: 1 1 260px; min-width: 0; }
.compare-field label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-block-end: .3rem; }
.compare-field select {
    width: 100%;
    padding: .62rem .7rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
}
.compare-vs-label { color: var(--cinnabar); font-size: .73rem; font-weight: 700; text-transform: uppercase; padding-block-end: .8rem; }
.form-note { flex-basis: 100%; margin: .2rem 0 0; color: var(--muted); font-size: .74rem; }
.compare-output { margin-block: 1rem; }
.comparison-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-block-end: .7rem;
}
.comparison-region { display: flex; flex-direction: column; gap: .1rem; color: var(--ink); }
.comparison-region span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.comparison-region strong { font-family: var(--serif); font-size: 1.25rem; }
.comparison-region small { color: var(--muted); font-size: .72rem; }
.comparison-region:last-child { align-items: flex-end; text-align: end; }
.comparison-vs {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--cinnabar-soft);
    color: var(--cinnabar);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}
.comparison-chart { margin-block-start: .7rem; }
.comparison-chart h3 { font-family: var(--sans); font-size: .9rem; }
.compare-table th:first-child { width: 28%; }
.compare-table .compare-section-row th {
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--sans);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding-block: .5rem;
}

/* Search */
.search-panel { margin-block-end: 1rem; }
.search-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.search-result {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
}
.search-result:hover { border-color: var(--accent); color: var(--accent-dark); }
.search-result-type { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.search-result strong { font-size: .9rem; }
.search-result > span:last-child { font-size: .7rem; color: var(--muted); }
.search-empty-note { color: var(--muted); font-size: .8rem; }

/* Articles */
.article { max-width: 980px; margin-inline: auto; }
.article-header { padding-block: 1rem 1.5rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--muted); font-size: .74rem; margin-block-start: .8rem; }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.2rem; align-items: start; }
.article-toc {
    position: sticky;
    top: 96px;
    border-inline-start: 2px solid var(--line);
    padding-inline-start: 1rem;
}
.article-toc h2 { font-size: .7rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.article-toc ol { padding-inline-start: 1rem; margin: 0; font-size: .8rem; }
.article-toc li { margin-block: .35rem; color: var(--muted); }
.article-toc a { color: var(--ink-soft); }
.article-toc a:hover { color: var(--accent-dark); }
body.has-floating-toc .article-layout { grid-template-columns: 1fr; }
body.has-floating-toc .article-toc { display: none; }

/* Floating page table of contents */
#main h2[id] { scroll-margin-block-start: 96px; }
.page-toc {
    position: fixed;
    inset-inline-end: 1rem;
    inset-block-end: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.page-toc[hidden] { display: none !important; }
body[data-consent="pending"] .page-toc { display: none !important; }
.page-toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 42px;
    padding: .55rem .9rem;
    border: 1px solid var(--accent-dark);
    border-radius: 999px;
    background: var(--accent-dark);
    color: #fff;
    box-shadow: var(--shadow);
    font: 650 .78rem/1 var(--sans);
    letter-spacing: .02em;
    cursor: pointer;
}
.page-toc-toggle:hover { background: var(--accent); border-color: var(--accent); }
.page-toc-toggle .icon { width: 17px; height: 17px; }
.page-toc-panel {
    position: absolute;
    inset-block-end: calc(100% + .55rem);
    inset-inline-end: 0;
    width: min(286px, calc(100vw - 2rem));
    max-height: min(60vh, 430px);
    overflow: auto;
    padding: .8rem;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.page-toc-panel[hidden] { display: none !important; }
.page-toc-title {
    margin: 0 0 .4rem;
    padding-inline: .45rem;
    color: var(--muted);
    font: 700 .66rem/1.2 var(--sans);
    letter-spacing: .1em;
    text-transform: uppercase;
}
.page-toc-panel ol { display: grid; gap: .12rem; margin: 0; padding: 0; list-style: none; }
.page-toc-panel a {
    display: block;
    padding: .42rem .45rem;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: .8rem;
    line-height: 1.35;
}
.page-toc-panel a:hover { background: var(--surface-2); color: var(--accent-dark); }
.page-toc-panel a.is-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}
@media (max-width: 720px) {
    #main h2[id] { scroll-margin-block-start: 18px; }
    .page-toc { inset-inline-end: .75rem; inset-block-end: calc(.75rem + env(safe-area-inset-bottom)); }
    .page-toc-toggle { min-height: 40px; padding: .5rem .75rem; }
    .page-toc-panel { max-height: 55vh; }
}
@media print {
    .page-toc { display: none !important; }
}

.prose { max-width: 72ch; }
.prose h2 { margin-block: 2rem .7rem; }
.prose h3 { margin-block: 1.5rem .5rem; }
.prose p { color: var(--ink-soft); }
.prose ul, .prose ol { color: var(--ink-soft); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.article-body section { scroll-margin-top: 92px; }
.article-faq { margin-block-start: 2rem; }
.article-static .prose { max-width: 78ch; }
.article-static .prose p { font-size: 1.02rem; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding-block: .6rem; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.faq p { color: var(--muted); font-size: .86rem; margin: .5rem 0 0; }

/* Footer */
.site-footer {
    margin-block-start: 3rem;
    background: var(--ink);
    color: #d7dfd9;
    border-top: 1px solid var(--line);
}
.site-footer a { color: #f2f6f2; }
.site-footer a:hover { color: #fff; }
.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .65fr));
    gap: 2rem;
    padding-block: 2.6rem 1.8rem;
}
.footer-brand p { color: #a9b8b0; font-size: .82rem; max-width: 44ch; }
.footer-brand .brand { color: #fff; margin-block-end: .8rem; }
.footer-brand .brand-name { color: #fff; }
.footer-disclaimer { font-size: .72rem !important; color: #8d9c94 !important; }
.footer-col h2 {
    color: #fff;
    font-family: var(--sans);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 0 0 .7rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-col li { font-size: .8rem; color: #b7c4bc; }
.footer-languages { grid-template-columns: repeat(2, max-content); column-gap: 1.2rem; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-block: .9rem 1.4rem;
    font-size: .72rem;
    color: #91a198;
}
.footer-bottom p { margin: 0; }
.site-footer .badge-demo { margin-block-start: .8rem; }

/* Empty state */
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 1.6rem;
    color: var(--muted);
    text-align: center;
}

/* Responsive */
@media (max-width: 1100px) {
    .primary-nav { display: none; }
    .nav-toggle { display: grid; }
    .province-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid { gap: 2rem; }
    .header-search input { width: 120px; }
}

@media (max-width: 900px) {
    .hero { padding-block: 2.2rem 1.8rem; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-copy h1 { max-width: 20ch; }
    .split-layout, .split-7-5 { grid-template-columns: 1fr; }
    .region-header { grid-template-columns: 1fr; }
    .ranking-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .compare-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-layout { grid-template-columns: 1fr; }
    .article-toc { position: static; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
    .search-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .container { width: min(var(--container), calc(100% - 2rem)); }
    .site-header { position: static; }
    .header-inner { min-height: 64px; gap: .7rem; }
    .header-search { display: none; }
    .brand-tagline { display: none; }
    .brand-name { font-size: .92rem; }
    .brand-mark { width: 34px; height: 34px; }
    .brand { min-width: 0; }
    .brand-copy { min-width: 0; }
    .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lang-switch summary span, .currency-switch summary .currency-label { display: none; }
    .hero-copy h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
    .hero-lede { font-size: .98rem; }
    .hero-meta { gap: .8rem; }
    .stat-grid-4, .stat-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .province-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topic-grid, .guide-grid, .guide-grid-wide, .ranking-metric-grid { grid-template-columns: 1fr; }
    .compare-feature-grid { grid-template-columns: 1fr; }
    .section-head { align-items: flex-start; flex-direction: column; gap: .7rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .page-header-actions { justify-content: flex-start; }
    .region-title-block h1 { max-width: none; }
    .census-summary { grid-template-columns: 1fr; }
    .comparison-head { grid-template-columns: 1fr; text-align: start; }
    .comparison-region:last-child { align-items: flex-start; text-align: start; }
    .comparison-vs { justify-self: start; }
    .search-result-grid { grid-template-columns: 1fr; }
    .data-table { font-size: .8rem; }
    .data-table th, .data-table td { padding: .5rem .55rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
    .footer-languages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-bottom { flex-direction: column; }
    .article-header { padding-block: .5rem 1rem; }
    .article-meta { gap: .5rem; }
    .compare-form { align-items: stretch; }
    .compare-vs-label { padding: 0; }
    .compare-field { flex-basis: 100%; }
    .composition-row { grid-template-columns: 1fr; }
    .composition-pop { grid-column: 1; grid-row: auto; text-align: start; }
    .composition-track { grid-column: 1; }
}

@media (max-width: 480px) {
    .stat-grid-4, .stat-grid-6 { grid-template-columns: 1fr 1fr; }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .hero-stats strong { font-size: 1.2rem; }
    .com-actions, .page-actions { width: 100%; }
    .page-actions .button { flex: 1; }
    .page-actions.region-actions {
        flex-wrap: nowrap;
        gap: .3rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .page-actions.region-actions::-webkit-scrollbar { display: none; }
    .page-actions.region-actions .button {
        flex: 0 0 auto;
        padding: .5rem .45rem;
        font-size: .78rem;
        white-space: nowrap;
    }
    .page-actions.region-actions .button .icon { display: none; }
    .section { padding-block: 1.6rem; }
}

@media (max-width: 380px) {
    .brand-name { max-width: 128px; }
    .lang-switch summary span { display: none; }
}

.table-wrap { -webkit-overflow-scrolling: touch; }

@media print {
    .site-header, .site-footer, .demo-banner, .announcement, .page-actions, .nav-toggle, .lang-switch, .search-bar { display: none !important; }
    body { background: #fff; color: #000; }
    .panel, .stat, .data-table { box-shadow: none; border-color: #ccc; }
    .container { width: 100%; }
    a { color: #000; text-decoration: underline; }
}

.search-suggestions {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + .35rem);
    z-index: 70;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .3rem;
    max-height: 320px;
    overflow: auto;
}
.search-suggestions a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem .6rem;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: .85rem;
}
.search-suggestions a:hover { background: var(--surface-2); color: var(--accent-dark); }
.search-suggestions a span { color: var(--muted); font-size: .72rem; }
.header-search .search-suggestions {
    inset-inline-start: auto;
    inset-inline-end: 0;
    width: 300px;
    max-width: calc(100vw - 2rem);
}
.newsletter-form { margin-block-start: 1.1rem; }
.newsletter-form h2 {
    color: #fff;
    font-family: var(--sans);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 0 0 .35rem;
}
.newsletter-form > p { color: #a9b8b0; font-size: .78rem; margin: 0 0 .5rem; }
.newsletter-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.newsletter-row input[type="email"] {
    flex: 1 1 150px;
    min-width: 0;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
    color: #fff;
    border-radius: 8px;
    padding: .48rem .6rem;
    font-size: .8rem;
}
.newsletter-row input[type="email"]::placeholder { color: #93a39a; }
.newsletter-row button {
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: .48rem .8rem;
    font-size: .78rem;
    font-weight: 600;
}
.newsletter-row button:hover { background: var(--accent-dark); }
.newsletter-note { color: #8d9c94 !important; font-size: .68rem !important; margin-block-start: .35rem !important; }
.honeypot { position: absolute !important; inset-inline-start: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.ad-container { margin-block: 1.15rem; }
.ad-container-top { padding-block-start: .9rem; }
.ad-container-bottom { padding-block-end: .5rem; }
.ad-slot {
    position: relative;
    margin-inline: auto;
    overflow: hidden;
    text-align: center;
    color: var(--muted);
}
.ad-label {
    display: block;
    font-size: .58rem;
    line-height: 1;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: .65;
    margin-block-end: .3rem;
}
.ad-slot-top, .ad-slot-bottom { min-height: 100px; max-width: 970px; }
.ad-slot-inline { min-height: 280px; max-width: 728px; }
.ad-slot-sidebar { min-height: 300px; max-width: 336px; }
.ad-slot-custom { min-height: 60px; }
.ad-slot .adsbygoogle { display: block; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
@media (max-width: 720px) {
    .ad-slot-top, .ad-slot-bottom { min-height: 90px; }
    .ad-slot-inline { min-height: 250px; }
    .ad-slot-sidebar { min-height: 250px; }
}
.compare-builder { display: block; }
.compare-builder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.compare-selected { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 2rem; margin-block-start: .3rem; }
.compare-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .35rem .28rem .65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 600;
}
.compare-chip button {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--muted);
    font-size: .85rem;
    line-height: 1;
    padding: 0;
}
.compare-chip button:hover { background: var(--cinnabar-soft); color: var(--cinnabar); }
.compare-limit { color: var(--muted); font-size: .72rem; flex-shrink: 0; padding-block-start: .2rem; }
.compare-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-block-start: .9rem;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--surface);
    padding: .35rem .55rem .35rem .75rem;
}
.compare-search .icon { color: var(--muted); }
.compare-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; padding: .45rem 0; }
.compare-suggestions {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + .35rem);
    z-index: 70;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow);
    padding: .3rem;
    max-height: 340px;
    overflow: auto;
}
.compare-suggestion {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-soft);
    padding: .5rem .6rem;
    text-align: start;
    cursor: pointer;
}
.compare-suggestion:hover { background: var(--surface-2); }
.compare-suggestion span { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.compare-suggestion strong { font-size: .86rem; }
.compare-suggestion small { color: var(--muted); font-size: .7rem; }
.compare-suggestion em { font-style: normal; color: var(--muted); font-size: .68rem; flex-shrink: 0; }
.compare-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-block-start: .8rem; }
.compare-actions .form-note { margin: 0; }
.comparison-multi-head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .8rem;
    margin-block-end: .7rem;
}
.comparison-multi-head .comparison-region { padding: .5rem .6rem; border-inline-start: 3px solid var(--accent); }
.comparison-multi-head .comparison-region:nth-child(2) { border-color: var(--cinnabar); }
.comparison-multi-head .comparison-region:nth-child(3) { border-color: var(--gold); }
.comparison-multi-head .comparison-region:nth-child(4) { border-color: #3b82f6; }
.comparison-multi-head .comparison-region:nth-child(5) { border-color: #8b5cf6; }
.comparison-multi-table { min-width: 700px; }
.comparison-multi-table thead th { vertical-align: bottom; }
.comparison-multi-table thead a { color: var(--ink-soft); }
.compare-diff { display: block; color: var(--muted); font-size: .66rem; margin-block-start: .15rem; }
.compare-diff.positive { color: var(--accent-dark); }
.compare-diff.negative { color: var(--cinnabar); }
@media (max-width: 720px) {
    .compare-builder-head { flex-direction: column; gap: .25rem; }
    .compare-limit { padding-block-start: 0; }
    .compare-actions { align-items: stretch; }
    .compare-actions .button { flex: 1; }
    .comparison-multi-table { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.consent-banner {
    position: fixed;
    inset-inline: 1rem;
    inset-block-end: 1rem;
    z-index: 90;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
    max-width: 980px;
    margin-inline: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
}
.consent-copy { max-width: 62ch; }
.consent-copy strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.consent-copy p { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.consent-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; flex-shrink: 0; }
.consent-banner[hidden] { display: none; }
body[data-consent="pending"] .ad-slot,
body[data-consent="rejected"] .ad-slot { display: none !important; }
.legal-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .72rem; }
.legal-links a, .legal-links .link-button { color: #b7c4bc; }
.legal-links a:hover, .legal-links .link-button:hover { color: #fff; }
@media (max-width: 720px) {
    .consent-banner { inset-inline: .5rem; inset-block-end: .5rem; flex-direction: column; align-items: stretch; padding: .85rem; }
    .consent-actions .button { flex: 1; }
    .legal-links { order: 2; }
}