/* Kockás Füzet – nyilvános arculat. Az admin a main-dashboard.css-t használja. */

:root {
    --paper: #F4EFE6;
    --surface: #FFFCF7;
    --surface-pure: #FFFFFF;
    --ink: #1A2744;
    --ink-secondary: #3E4C63;
    --meta: #3E4C63;
    --line: #E4DDD0;
    --petrol: #0E6B72;
    --petrol-hover: #0A555B;
    --petrol-soft: #E6F3F3;
    --warm: #9A4E24;
    --warm-soft: #F8EDE4;
    --danger: #8E2F2F;
    --danger-soft: #F8E8E6;
    --ok: #1F6B45;
    --ok-soft: #E7F3EC;
    --warning: #8A5A12;
    --warning-soft: #F8F0E0;
    --focus: #0E6B72;
    --ink-hover: #121C33;
    --ink-active: #0C1424;
    --header-h: 64px;
    --font-serif: Fraunces, "Source Serif 4", "Times New Roman", serif;
    --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
}

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

html {
    scroll-padding-top: 80px;
}

body.kf-page {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
    font-variant-numeric: tabular-nums lining-nums;
    background-color: var(--paper);
    background-image:
        linear-gradient(to right, rgba(26, 39, 68, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26, 39, 68, 0.045) 1px, transparent 1px);
    background-size: 24px 24px;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    scroll-margin-top: 80px;
}

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

h1, h2, h3, .kf-brand-name, .kf-serif {
    font-family: var(--font-serif);
    font-weight: 560;
    font-optical-sizing: auto;
    letter-spacing: 0;
    text-transform: none;
}

.kf-title {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.08;
    color: var(--ink);
}

.kf-section-title {
    margin: 0 0 12px;
    font-size: 26px;
    line-height: 1.15;
}
.kf-section-title span {
    display: inline-block;
    padding: 8px;
    background: var(--surface-pure);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 26px;
}

.kf-block-title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.25;
}

.kf-kicker {
    margin: 0 0 8px;
    color: var(--petrol);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.kf-lead {
    margin: 0 0 12px;
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 560;
    line-height: 1.2;
}

.kf-dek {
    margin: 0 0 8px;
    max-width: 42rem;
}

.kf-meta,
.kf-unit,
.kf-chart-note,
.kf-copy,
.kf-card dt,
.kf-legend-list li,
.kf-map-dock p {
    color: var(--meta);
    font-size: 15px;
    line-height: 1.45;
}

.kf-num {
    font-variant-numeric: tabular-nums lining-nums;
}

a {
    color: var(--petrol);
}

a:hover {
    color: var(--petrol-hover);
}

.kf-header,
.kf-footer,
.kf-panel,
.kf-metrics,
.kf-tool,
.kf-chart,
.kf-popup,
.kf-table-wrap,
.kf-card,
.kf-note,
.kf-prose,
.kf-map-dock,
.kf-filters,
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background-color: var(--surface);
    background-image: none;
}

.kf-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.kf-header-inner,
.kf-frame {
    width: calc(100% - 32px);
    margin-inline: auto;
}

.kf-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kf-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    margin-right: 12px;
}

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

a.kf-brand,
.kf-brand .kf-brand-name {
    font-family: Fraunces, "Source Serif 4", "Times New Roman", serif;
    font-size: 22px;
    font-weight: 560;
    font-optical-sizing: auto;
    line-height: 1;
    color: #1A2744;
}

.kf-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.kf-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink-secondary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.kf-nav a:hover {
    color: var(--ink);
    background: transparent;
    border-bottom-color: var(--petrol);
}

.kf-nav a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.kf-nav-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.kf-nav-toggle-icon,
.kf-nav-toggle-icon::before,
.kf-nav-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    position: relative;
}

.kf-nav-toggle-icon {
    margin: 0 auto;
}

.kf-nav-toggle-icon::before,
.kf-nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.kf-nav-toggle-icon::before { top: -6px; }
.kf-nav-toggle-icon::after { top: 6px; }

.kf-main {
    flex: 1 0 auto;
    width: 100%;
}

.kf-frame-text {
    width: min(1120px, 100%);
}

.kf-wrap {
    padding: 32px 0 64px;
}

.kf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 2px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}

.kf-btn-ink {
    background: var(--ink);
    color: var(--surface);
}

.kf-btn-ink:hover { background: var(--ink-hover); color: var(--surface); }
.kf-btn-ink:active { background: var(--ink-active); color: var(--surface); }

.kf-btn-petrol {
    background: var(--petrol);
    color: var(--surface);
}

.kf-btn-petrol:hover { background: var(--petrol-hover); color: var(--surface); }

.kf-btn-ghost {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}

.kf-btn-ghost:hover { background: var(--warm-soft); color: var(--ink); }

.kf-btn[disabled],
.kf-btn[aria-disabled="true"] {
    background: var(--line);
    color: var(--meta);
    border-color: var(--line);
    cursor: not-allowed;
}

.kf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.kf-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 20px;
}

.kf-group {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.kf-group legend,
.kf-label {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.kf-field + .kf-field {
    margin-top: 16px;
}

.kf-fields {
    display: grid;
    gap: 16px;
}

.kf-field input,
.kf-field select,
.kf-page select.kf-input,
.kf-page input.kf-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface-pure);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
}

.kf-field input:hover,
.kf-field select:hover,
.kf-input:hover {
    border-color: var(--meta);
}

.kf-field input:focus-visible,
.kf-field select:focus-visible,
.kf-input:focus-visible {
    border-color: var(--petrol);
    outline: 2px solid var(--petrol);
    outline-offset: 2px;
}

.kf-field input:disabled,
.kf-field select:disabled {
    background: var(--paper);
    color: var(--meta);
}

.kf-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    font-size: 16px;
}

.kf-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--petrol);
}

.kf-grid-2,
.kf-grid-3,
.kf-filter-grid,
.kf-lang-type {
    display: grid;
    gap: 20px;
}

.kf-hero {
    display: grid;
    gap: 28px;
    align-items: start;
}

.kf-map-preview {
    background: var(--surface-pure);
    border: 1px solid var(--line);
}

.kf-map-preview-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

#home-map {
    height: 320px;
    background: var(--surface-pure);
}

.kf-map-caption {
    margin: 0;
    padding: 8px 12px 12px;
}

.kf-metrics {
    display: grid;
    gap: 16px 20px;
    margin: 36px 0;
    padding: 20px 0;
    background: transparent;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.kf-metrics > div {
    padding: 15px;
    background: var(--surface-pure);
    border: 1px solid var(--line);
    border-radius: 2px;
}

.kf-metric-value {
    display: block;
    color: var(--ink);
    font-size: 32px;
    font-weight: 600;
    line-height: 1;
}

.kf-metric-label {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

.kf-source {
    margin: 8px 0 0;
}

.kf-tools {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 28px 0 0;
    padding: 0;
}

.kf-tool {
    display: grid;
    align-content: start;
    gap: 12px;
    margin: 0;
    padding: 20px;
    background: var(--surface-pure);
    border: 1px solid var(--line);
    border-radius: 2px;
}

.kf-tool p {
    margin: 0;
    max-width: 46rem;
}

.kf-posts {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.kf-posts li {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.kf-posts p {
    margin: 6px 0;
}

.kf-footer {
    width: 100%;
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 28px 0 20px;
}

.kf-footer-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.kf-footer-about {
    min-width: 0;
    max-width: 40rem;
}

.kf-footer-about .kf-brand {
    margin-right: 0;
}

.kf-footer-about p,
.kf-footer-note {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
}

.kf-footer-note {
    margin-top: 20px;
    max-width: 40rem;
}

.kf-footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.kf-footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.kf-footer-links a:hover {
    color: var(--petrol-hover);
}

.kf-footer .kf-copy {
    width: 100%;
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--meta);
    font-size: 15px;
    line-height: 1.45;
}

.kf-note,
.kf-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    background: var(--petrol-soft);
    color: var(--ink);
    font-size: 16px;
}

.kf-alert-ok { background: var(--ok-soft); border-left-color: var(--ok); color: var(--ok); }
.kf-alert-empty { background: var(--warning-soft); border-left-color: var(--warning); color: var(--warning); }
.kf-alert-danger { background: var(--danger-soft); border-left-color: var(--danger); color: var(--danger); }
.kf-alert-info { background: var(--petrol-soft); border-left-color: var(--petrol); color: var(--ink); }

.kf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.kf-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 8px 0 10px;
    background: var(--petrol-soft);
    color: var(--ink);
    font-size: 14px;
}

.kf-chip button,
.kf-chip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    color: var(--ink);
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
}

.kf-table-wrap {
    overflow-x: auto;
    overflow-y: clip;
    max-width: 100%;
    background: var(--surface-pure);
    border: 1px solid var(--line);
}

.kf-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-pure);
    font-size: 16px;
    line-height: 1.45;
}

.kf-table th,
.kf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    background: var(--surface-pure);
}

.kf-table th {
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-transform: none;
    border-bottom: 2px solid var(--ink);
}

.kf-table td.kf-num,
.kf-table th.kf-num {
    text-align: right;
}

.kf-table tbody tr:nth-child(even) td {
    background: #F4EFE6;
}

.kf-table tbody tr:hover td {
    background: var(--warm-soft);
}

.kf-missing {
    color: var(--meta);
}

.kf-cards { display: none; }

.kf-card {
    background: var(--surface-pure);
    border: 1px solid var(--line);
    padding: 14px 14px 6px;
    margin-bottom: 12px;
}

.kf-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.kf-card dl {
    margin: 0;
}

.kf-card dt {
    color: var(--meta);
    font-size: 15px;
    font-weight: 600;
}

.kf-card dd {
    margin: 0 0 10px;
}

.kf-skeleton { display: grid; gap: 8px; margin-top: 16px; }
.kf-skeleton span { display: block; height: 16px; background: var(--line); }

.kf-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.kf-pager a,
.kf-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface-pure);
    color: var(--ink);
    text-decoration: none;
}

.kf-pager .is-current {
    border-color: var(--ink);
    font-weight: 600;
}

.kf-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    color: var(--meta);
    font-size: 14px;
}

.kf-crumb a { color: var(--petrol); }

.kf-meta-row {
    display: grid;
    gap: 12px 24px;
    margin: 12px 0 20px;
    padding: 16px 18px;
    background: var(--surface-pure);
    border: 1px solid var(--line);
    color: var(--ink);
}

.kf-school-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface-pure);
    border: 1px solid var(--line);
}

.kf-school-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

.kf-school-list a:hover { background: var(--warm-soft); }
.kf-page-hidden { display: none !important; }

.kf-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.kf-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 8px;
}

.kf-chart {
    background: var(--surface-pure);
    border: 1px solid var(--line);
    padding: 16px;
}

.kf-chart h3 { margin-top: 0; }

.kf-plot {
    position: relative;
    width: 100%;
    aspect-ratio: 2.2;
}

.kf-plot > canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
}

.kf-chart-note {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 15px;
}

.kf-chart.kf-census {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(160px, 1fr);
    gap: 12px 20px;
    align-items: start;
}

.kf-chart.kf-census > .kf-plot {
    aspect-ratio: 1;
    width: min(100%, 360px);
}

.kf-chart.kf-census > h2,
.kf-chart.kf-census > .kf-chart-note {
    grid-column: 1 / -1;
}

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

.kf-census-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 32px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.kf-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    aspect-ratio: 1;
    margin-right: 8px;
    border: 1px solid #1A2744;
    border-radius: 0;
    vertical-align: -2px;
    flex: 0 0 16px;
    box-sizing: border-box;
}

.kf-axis-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.kf-axis-legend li {
    display: flex;
    align-items: center;
    min-height: 32px;
    color: var(--ink);
    font-size: 16px;
}

.kf-swatch-hatch {
    background: repeating-linear-gradient(135deg, #1A2744 0 2px, transparent 2px 5px);
}

.kf-swatch-cross {
    background:
        repeating-linear-gradient(90deg, #9A4E24 0 2px, transparent 2px 5px),
        repeating-linear-gradient(0deg, #9A4E24 0 2px, transparent 2px 5px);
}

.kf-swatch-dot {
    background-image: radial-gradient(#8A5A12 1.4px, transparent 1.5px);
    background-size: 6px 6px;
    background-color: #fff;
}

.kf-swatch-dash {
    background: repeating-linear-gradient(90deg, #4E5D6C 0 3px, transparent 3px 6px);
}

@media (max-width: 767px) {
    .kf-chart.kf-census { grid-template-columns: 1fr; }
}

.kf-empty-grid {
    width: 160px;
    height: 96px;
    margin-top: 16px;
    border: 1px solid var(--line);
    background-color: transparent;
    background-image:
        linear-gradient(to right, rgba(26, 39, 68, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26, 39, 68, 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
}

.kf-search-row {
    display: grid;
    gap: 16px;
    align-items: end;
}

.kf-prose {
    max-width: 68ch;
    background-color: #FFFFFF;
    background-image: none;
    padding: 24px;
}

.kf-prose img {
    max-width: 100%;
    height: auto;
}

.kf-tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: 0 8px 8px 0;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface-pure);
    color: var(--ink);
    font-size: 14px;
}

.kf-tip {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.kf-tip-btn {
    width: 44px;
    height: 44px;
    margin-left: 4px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface-pure);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
}

.kf-tip-bubble {
    display: none;
    position: absolute;
    z-index: 15;
    left: 0;
    top: calc(100% + 6px);
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    background: var(--ink);
    color: var(--surface);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.kf-tip-btn:hover + .kf-tip-bubble,
.kf-tip-btn:focus-visible + .kf-tip-bubble,
.kf-tip.is-open .kf-tip-bubble {
    display: block;
}

.kf-shape {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: -1px;
    flex: 0 0 auto;
}

.kf-shape-magyar {
    background: var(--petrol);
    border: 2px solid #fff;
    outline: 1px solid var(--ink);
}

.kf-shape-slovak {
    background: var(--ink);
    border-radius: 50%;
}

.kf-shape-mix {
    background: linear-gradient(90deg, var(--petrol) 50%, var(--ink) 50%);
    border: 2px solid #fff;
    outline: 1px solid var(--ink);
}

.kf-shape-egyeb {
    width: 10px;
    height: 10px;
    background: var(--warm);
    transform: rotate(45deg);
}

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

.kf-legend-list li,
.kf-lang-legend li {
    display: flex;
    align-items: center;
    min-height: 32px;
    color: var(--ink);
    font-size: 16px;
}

.kf-lang-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.kf-map-page .kf-main { flex: 0 0 auto; min-height: 0; }

.kf-map-layout {
    display: block;
}

.kf-map-stage {
    position: relative;
    height: calc(100vh - var(--header-h) - 52px);
    background: var(--surface-pure);
    overflow: hidden;
}

#map {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
    background: var(--surface-pure);
}

.kf-filters {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px;
}

.kf-filters.is-open {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 25;
    max-height: 70vh;
    overflow: auto;
    border-top: 1px solid var(--line);
}

.kf-map-dock {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.kf-map-dock p { margin: 0; color: var(--ink); font-size: 15px; }

.kf-map-legend {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    padding: 8px 12px;
    background: var(--surface-pure);
    border: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.kf-map-legend .kf-legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.leaflet-popup-content-wrapper {
    border-radius: 2px;
    box-shadow: none;
    border: 1px solid var(--line);
}

.leaflet-popup-content { margin: 12px 14px; min-width: 220px; }

.leaflet-control-attribution {
    font-size: 15px !important;
    line-height: 1.3;
    max-width: calc(100% - 12px);
    white-space: normal;
}

.kf-popup-name {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.kf-popup p { margin: 0 0 6px; font-size: 16px; }

.marker-cluster-custom { background: transparent; }

.kf-cluster-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--ink);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container { width: 100% !important; max-width: 100%; font-family: var(--font-sans); font-size: 16px; display: block; }

.select2-container .select2-selection--single {
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface-pure);
    box-shadow: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 12px;
    color: var(--ink);
    font-size: 16px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--petrol);
}

.select2-dropdown {
    border-color: var(--line);
    border-radius: 2px;
    background: var(--surface-pure);
}

.select2-results__option { min-height: 36px; padding: 8px 12px; }

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--petrol-soft);
    color: var(--ink);
}

.noUi-target {
    background: var(--line);
    border: 0;
    box-shadow: none;
    height: 8px;
}

.noUi-connect { background: var(--petrol); }

.noUi-handle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ink);
    border-radius: 2px;
    background: var(--surface-pure);
    box-shadow: none;
    right: -10px;
    top: -7px;
}

.noUi-handle::before,
.noUi-handle::after { display: none; }

@media (min-width: 768px) {
    :root { --header-h: 64px; }
    .kf-header-inner,
    .kf-frame { width: calc(100% - 48px); }
    .kf-title { font-size: 40px; }
    .kf-section-title { font-size: 28px; }
    .kf-metric-value { font-size: 36px; }
    .kf-grid-2 { grid-template-columns: 1fr 1fr; }
    .kf-lang-type { grid-template-columns: 1fr 1fr; align-items: start; }
    .kf-search-row { grid-template-columns: 1fr 1fr auto; }
    .kf-search-row > .kf-btn {
        width: auto;
        min-height: 44px;
        justify-self: start;
        align-self: end;
    }
    .kf-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    .kf-meta-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kf-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kf-footer-main {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 32px;
    }
    .kf-footer-about { flex: 1 1 auto; }
    .kf-footer-links {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: flex-start;
    }
    .kf-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kf-hero { grid-template-columns: 1.4fr 1fr; }
    #home-map { height: 420px; }
    .kf-table thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--surface);
        box-shadow: inset 0 -2px 0 var(--ink);
    }
    .kf-table th:first-child,
    .kf-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 4;
        background: var(--surface-pure);
    }
    .kf-table thead th:first-child {
        z-index: 6;
        background: var(--surface);
    }
}

@media (min-width: 1024px) {
    .kf-footer-links {
        flex-direction: row;
        align-items: center;
        gap: 4px 8px;
    }
    .kf-map-layout {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        height: calc(100vh - 64px);
    }
    .kf-map-stage { height: 100%; }
    .kf-filters {
        display: block;
        position: static;
        max-height: calc(100vh - 64px);
        overflow: auto;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }
    .kf-filters.is-open { position: static; max-height: calc(100vh - 64px); }
    .kf-map-dock,
    .kf-filter-close { display: none; }
    .kf-map-legend {
        left: 12px;
        right: auto;
        bottom: 12px;
        max-width: calc(100% - 24px);
        border: 1px solid var(--line);
    }
    .kf-map-legend .kf-legend-list { display: block; }
}

@media (max-width: 1023px) {
    .leaflet-bottom.leaflet-right { margin-bottom: 52px; }
}

@media (max-width: 767px) {
    :root { --header-h: 56px; }
    .kf-header { height: 56px; }
    .kf-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .kf-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 21;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }
    .kf-nav.is-open { display: flex; }
    .kf-nav a {
        min-height: 48px;
        padding: 0 16px;
        border-bottom: 0;
        border-left: 2px solid transparent;
    }
    .kf-nav a:hover,
    .kf-nav a[aria-current="page"] {
        border-bottom: 0;
        border-left-color: var(--ink);
    }
    .kf-nav a:hover { border-left-color: var(--petrol); }
    .kf-actions .kf-btn,
    .kf-search-row .kf-btn { width: 100%; }
    .kf-table-wrap { display: none; }
    .kf-cards { display: block; }
    .kf-map-page { padding-bottom: 0; }
}

@media (min-width: 1440px) {
    .kf-header-inner,
    .kf-frame {
        width: min(1280px, calc(100% - 48px));
    }
    .kf-title { font-size: 52px; }
    .kf-section-title { font-size: 32px; }
    .kf-metric-value { font-size: 40px; }
    .kf-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

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