* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #24282d;
    background: #e9edf0;
    line-height: 1.45;
}

a { color: #06f; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.site-shell {
    max-width: 1370px;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 18px rgba(42, 52, 61, .18);
}

.site-header { border-bottom: 1px solid #d7dde2; }
.utility-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    min-height: 34px;
    padding: 0 1.65rem;
    border-bottom: 1px solid #d7dde2;
    font-size: .98rem;
    color: #4c555c;
}
.utility-nav a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #06f;
}
.utility-nav .utility-highlight { color: #d82735; }

.section-icon {
    flex: 0 0 auto;
    width: 1.05em;
    height: 1.05em;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.16em;
}

.masthead {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(260px, 1fr);
    align-items: center;
    gap: 1.8rem;
    padding: 1.25rem 1.65rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    width: min(100%, 310px);
}
.brand:hover { text-decoration: none; }
.brand-logo {
    display: block;
    width: 100%;
    height: auto;
}
.site-search {
    position: relative;
    max-width: 680px;
}
.site-search input {
    width: 100%;
    height: 58px;
    border: 1px solid #cbd3da;
    border-radius: 3px;
    padding: 0 1rem 0 3.4rem;
    color: #24282d;
    font: inherit;
    font-size: 1.15rem;
    background: #fff;
}
.site-search input::placeholder { color: #9aa4af; }
.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    width: 1.05rem;
    height: 1.05rem;
    border: 3px solid #333;
    border-radius: 50%;
    transform: translateY(-58%);
}
.search-icon::after {
    content: "";
    position: absolute;
    right: -.55rem;
    bottom: -.55rem;
    width: .75rem;
    height: 3px;
    background: #333;
    transform: rotate(45deg);
    transform-origin: left center;
}

.site-main { padding: 0 1.65rem 1.6rem; }
.page-grid {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
}
.content-panel { min-width: 0; }
.left-rail {
    padding-top: 5.9rem;
}

.breadcrumb {
    grid-column: 1 / -1;
    margin: 0 0 1rem;
    padding: .65rem 1rem;
    color: #6c747b;
    font-size: 1.05rem;
    background: #e8f3cc;
    border-top: 3px solid #93bd2e;
}
.breadcrumb a { margin-right: .45rem; }
.breadcrumb span { margin-left: .45rem; }

h1 {
    margin: 1.2rem 0 .45rem;
    padding-bottom: .15rem;
    border-bottom: 3px solid #93bd2e;
    color: #24282d;
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: 0;
}
.content-panel-banken h1:first-of-type::before,
.content-panel-schulen h1:first-of-type::before,
.content-panel-statistik h1:first-of-type::before,
.content-panel-wahlen h1:first-of-type::before {
    display: inline-block;
    margin-right: .42rem;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: .82em;
    line-height: 1;
    vertical-align: .03em;
}
.content-panel-banken h1:first-of-type::before { content: "🏛️"; }
.content-panel-schulen h1:first-of-type::before { content: "🏫"; }
.content-panel-statistik h1:first-of-type::before { content: "📊"; }
.content-panel-wahlen h1:first-of-type::before { content: "🗳️"; }
h2 {
    margin: 1.75rem 0 .75rem;
    padding-bottom: .2rem;
    border-bottom: 1px solid #cfd5da;
    color: #6d861f;
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: 0;
}
h3 { color: #6d861f; font-size: 1.1rem; }

.lead {
    margin: 1rem 0 1.2rem;
    padding: 1rem 1.15rem;
    color: #24282d;
    font-size: 1.05rem;
    background: #f9fafb;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
}

.rail-map {
    position: relative;
    padding: .35rem .35rem 0;
    border-bottom: 1px solid #cfd5da;
    background: #fff;
}
.map-up-link {
    position: absolute;
    z-index: 2;
    top: .55rem;
    right: .55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    color: #2853b9;
    background: rgba(255, 255, 255, .88);
    border: 1px solid #cfd5da;
    border-radius: 4px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}
.map-up-link:hover,
.map-up-link:focus {
    color: #153783;
    background: #fff7df;
}
.de-svg-map {
    display: block;
    width: 100%;
    height: auto;
}
.de-svg-map path {
    fill: #fff0bd;
    stroke: #93bd2e;
    stroke-width: .4;
    stroke-linejoin: round;
    transition: fill .12s ease-out;
}
.de-svg-map a { cursor: pointer; }
.de-svg-map a:hover path,
.de-svg-map a:focus path,
.de-svg-map a.is-active path {
    fill: #eda73d;
    outline: none;
}
.de-svg-map a.is-current path {
    fill: #d88922;
    stroke: #6f821f;
}
.de-svg-map-kreise path { stroke-width: .25; }

table.data tr.is-active td { background: #fff7df !important; }
.de-svg-map .de-svg-cs {
    fill: #5c5044;
    font-family: inherit;
    font-size: 5px;
    font-weight: 700;
    pointer-events: none;
}

.rail-links {
    border-top: 1px solid #d8dde2;
    border-left: 1px solid #d8dde2;
    border-right: 1px solid #d8dde2;
}
.rail-links a {
    display: flex;
    align-items: center;
    gap: .42rem;
    padding: .78rem .55rem;
    border-bottom: 1px solid #d8dde2;
    background: #fff;
    font-size: .98rem;
}
.rail-links a:first-child {
    background: #ffedb3;
}
.rail-links a.is-current {
    background: #eef6ff;
    font-weight: 700;
    color: #193d63;
}

/* Compact federal-state overview used on the home page. */
.de-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .45rem;
    margin: 1rem 0 1.5rem;
    padding: .85rem;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
    background: #f9fafb;
}
.de-map .state {
    min-height: 54px;
    padding: .55rem .65rem;
    color: #06f;
    border: 1px solid #d8dde2;
    border-radius: 3px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.de-map .state:hover,
.de-map .state.is-active {
    color: #0645ad;
    border-color: #93bd2e;
    background: #fff7df;
    text-decoration: none;
}
.de-map .state-name { font-weight: 600; }
.de-map .state-pop {
    color: #59626b;
    font-size: .82rem;
    margin-top: .1rem;
    font-variant-numeric: tabular-nums;
}

table.data {
    width: 100%;
    margin: .85rem 0 1.2rem;
    border-collapse: collapse;
    border: 1px solid #d4d9dd;
    background: #fff;
    font-size: .96rem;
}
table.data th,
table.data td {
    padding: .55rem .7rem;
    border-bottom: 1px solid #e1e5e8;
    vertical-align: top;
}
table.data th {
    color: #24282d;
    background: #eef2f6;
    font-weight: 700;
    text-align: left;
}
table.data tr:nth-child(even) td { background: #fbfbfb; }
table.data th:not(:first-child),
table.data td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.compact th,
table.compact td {
    padding: .35rem .5rem;
}

.link-count-list {
    columns: 2 220px;
    column-gap: 2.2rem;
    margin: .85rem 0 1.25rem;
    padding-left: 1.15rem;
    font-size: 1rem;
}
.link-count-list li {
    break-inside: avoid;
    margin: 0 0 .38rem;
    padding: .08rem .18rem;
    border-radius: 3px;
}
.link-count-list li.is-active { background: #fff7df; }
.link-count-list span {
    color: #59626b;
    font-variant-numeric: tabular-nums;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .8rem;
}
.result-panel {
    min-width: 0;
    padding: .85rem;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
    background: #fff;
}
.result-panel h3 {
    margin: .1rem 0 .5rem;
    color: #6d861f;
    font-size: 1rem;
}

.school-category-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .25rem;
    margin: .85rem 0 1.25rem;
    padding: 0 0 0;
    border-bottom: 1px solid #cfd5da;
}
.school-category-card {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 42px;
    padding: .55rem .75rem .5rem;
    border: 1px solid #d4d9dd;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    background: #f9fafb;
    color: #06f;
    position: relative;
    top: 1px;
    white-space: nowrap;
}
.school-category-link:hover {
    background: #fff;
    text-decoration: none;
}
.school-category-card.is-current {
    color: #24282d;
    background: #fff;
    border-color: #cfd5da;
    border-top: 3px solid #93bd2e;
    padding-top: .45rem;
    font-weight: 700;
}
.school-category-card span { display: inline-block; }
.school-category-name {
    color: inherit;
    font-size: .95rem;
    font-weight: 700;
}
.school-category-count {
    margin: 0;
    padding: .05rem .38rem;
    color: #24282d;
    background: #eef2f6;
    border-radius: 999px;
    font-size: .82rem;
    line-height: 1.35;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.school-category-description {
    display: none !important;
}

.school-category-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .7rem;
    margin: .85rem 0 1.25rem;
}
.school-category-summary-card {
    min-height: 118px;
    padding: .8rem .85rem;
    border: 1px solid #d4d9dd;
    border-top: 4px solid #93bd2e;
    border-radius: 4px;
    background: #fff;
}
.school-category-summary-card:nth-child(2) { border-top-color: #d6a034; }
.school-category-summary-card:nth-child(3) { border-top-color: #d94b43; }
.school-category-summary-card:nth-child(4) { border-top-color: #2878b9; }
.school-category-summary-card:nth-child(5) { border-top-color: #7b6b58; }
.school-category-summary-name {
    color: #59626b;
    font-size: .9rem;
    font-weight: 700;
}
.school-category-summary-count {
    margin: .18rem 0 .12rem;
    color: #24282d;
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.school-category-summary-description {
    color: #59626b;
    font-size: .9rem;
}

.location-rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .55rem;
    margin: .85rem 0 1.25rem;
}
.location-rank {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: .15rem .65rem;
    align-items: baseline;
    min-height: 68px;
    padding: .62rem .7rem;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
    background: #fff;
}
.location-rank:hover {
    border-color: #93bd2e;
    background: #fff7df;
    text-decoration: none;
}
.location-rank.is-active {
    border-color: #93bd2e;
    background: #fff7df;
}
.location-rank-name {
    min-width: 0;
    color: #06f;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.location-rank-state {
    grid-column: 1;
    color: #59626b;
    font-size: .86rem;
}
.location-rank-count {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: #24282d;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

table.schools th:not(:first-child),
table.schools td:not(:first-child) {
    text-align: left;
    font-variant-numeric: normal;
}
table.schools th:last-child,
table.schools td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.catchments th:not(:first-child),
table.catchments td:not(:first-child) {
    text-align: left;
    font-variant-numeric: normal;
}
.contact {
    white-space: nowrap;
}
.contact a {
    display: inline-block;
    margin-right: .08rem;
}
.contact a.contact-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    color: #06f;
    border: 1px solid #cbd3da;
    border-radius: 3px;
    vertical-align: middle;
}
.contact a.contact-icon-link:hover,
.contact a.contact-icon-link:focus {
    color: #153783;
    background: #fff7df;
    border-color: #93bd2e;
    text-decoration: none;
}
.contact-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.muted {
    color: #626a71;
    font-size: .92em;
}
.note {
    margin: 1rem 0;
    background: #fff7df;
    border: 1px solid #efd58a;
    border-left: 4px solid #d79500;
    border-radius: 3px;
    padding: .7rem .85rem;
}

dl.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .55rem 1.5rem;
    margin: 1rem 0 1.4rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
    background: #f9fafb;
}
dl.facts dt {
    color: #6d861f;
    font-weight: 500;
}
dl.facts dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.location-map-section {
    margin: 1.4rem 0;
}
.location-map {
    height: 360px;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
}
.location-map .leaflet-control-attribution {
    display: none;
}

.statistik-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: .85rem 0 1rem;
}
.statistik-subnav a {
    padding: .35rem .55rem;
    border: 1px solid #d4d9dd;
    border-radius: 3px;
    background: #fff;
}
.statistik-subnav a.is-current {
    color: #24282d;
    background: #ffedb3;
    border-color: #ddc06c;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
}
.indicator {
    padding: .8rem;
    border: 1px solid #d4d9dd;
    border-radius: 4px;
    background: #fff;
}

svg, canvas, img { max-width: 100%; height: auto; }
footer {
    margin-top: 1.5rem;
    padding: 1rem 1.65rem 1.4rem;
    border-top: 1px solid #d7dde2;
    color: #6b747c;
    font-size: .85rem;
    text-align: center;
}

@media (max-width: 1120px) {
    .page-grid {
        grid-template-columns: 180px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .site-shell {
        width: 100%;
        box-shadow: none;
    }
    .utility-nav {
        overflow-x: auto;
        padding: 0 .8rem;
        white-space: nowrap;
    }
    .masthead {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem .8rem;
    }
    .brand { width: min(100%, 280px); }
    .site-search input { height: 46px; }
    .site-main { padding: 0 .8rem 1rem; }
    .page-grid { display: block; }
    .left-rail {
        padding-top: 0;
        margin-bottom: 1rem;
    }
    .rail-map { display: none; }
    .rail-links {
        display: flex;
        overflow-x: auto;
        border: 1px solid #d8dde2;
    }
    .rail-links a {
        white-space: nowrap;
        border-bottom: 0;
        border-right: 1px solid #d8dde2;
    }
    .breadcrumb {
        margin-left: -.8rem;
        margin-right: -.8rem;
        border-radius: 0;
    }
    h1 { font-size: 2rem; }
    table.data {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    dl.facts {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
}

@media (max-width: 1120px) {
    table.data {
        display: block;
        overflow-x: visible;
        border: 0;
        background: transparent;
        white-space: normal;
    }
    table.data thead { display: none; }
    table.data tbody,
    table.data tr,
    table.data td {
        display: block;
        width: 100%;
    }
    table.data tr {
        margin: .75rem 0;
        border: 1px solid #d4d9dd;
        background: #fff;
    }
    table.data td {
        display: grid;
        grid-template-columns: minmax(5.75rem, 34%) minmax(0, 1fr);
        gap: .6rem;
        border-bottom: 1px solid #e8edf1;
        text-align: left !important;
        font-variant-numeric: normal !important;
        overflow-wrap: anywhere;
    }
    table.data.compact td {
        grid-template-columns: minmax(4.75rem, 34%) minmax(0, 1fr);
    }
    table.data td:last-child { border-bottom: 0; }
    table.data tr:nth-child(even) td { background: transparent; }
    table.data td::before {
        content: attr(data-label);
        color: #59626b;
        font-weight: 700;
    }
    table.data td[colspan] {
        display: block;
    }
    table.data td[colspan]::before {
        content: none;
    }
}

/* ---- IBAN tool (/iban) ---- */
.iban-form {
    margin: 1rem 0 1.4rem;
}
.iban-form label {
    display: block;
    margin-bottom: .4rem;
    color: #24282d;
    font-weight: 700;
}
.iban-form-row {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}
.iban-form input {
    flex: 1 1 22rem;
    min-width: 0;
    height: 52px;
    padding: 0 1rem;
    border: 1px solid #cbd3da;
    border-radius: 3px;
    font: inherit;
    font-size: 1.2rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: #fff;
}
.iban-form input::placeholder {
    color: #9aa4af;
    text-transform: none;
    letter-spacing: 0;
}
.iban-form button {
    height: 52px;
    padding: 0 1.6rem;
    border: 1px solid #6d861f;
    border-radius: 3px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    background: #93bd2e;
    cursor: pointer;
}
.iban-form button:hover { background: #84ab27; }

.iban-result { margin-top: 1.4rem; }

.iban-status {
    margin: 0 0 1.1rem;
    padding: .85rem 1.1rem;
    border-radius: 4px;
    font-size: 1.05rem;
    border: 1px solid #d4d9dd;
    background: #f9fafb;
}
.iban-status.is-valid {
    background: #e8f3cc;
    border-color: #93bd2e;
    border-left: 4px solid #6d861f;
}
.iban-status.is-invalid {
    background: #fdecec;
    border-color: #e3a3a3;
    border-left: 4px solid #c0392b;
}

.iban-display {
    margin: 0 0 1.3rem;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}
.iban-display code {
    letter-spacing: .06em;
}

.iban-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.3rem;
    font-variant-numeric: tabular-nums;
}
.iban-tile {
    flex: 1 1 auto;
    min-width: 0;
    padding: .55rem .8rem;
    border-radius: 4px;
    background: #eef2f6;
    border: 1px solid #d4d9dd;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.iban-tile-label {
    font-size: .85rem;
    color: #4a525a;
    line-height: 1.2;
    margin-bottom: .25rem;
}
.iban-tile-value {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: .06em;
    word-break: break-all;
}
.iban-flag {
    margin-right: .2rem;
    letter-spacing: 0;
}

.iban-seg-countryCode { background: #e8f3cc; border-color: #93bd2e; }
.iban-seg-controlNumber,
.iban-seg-checkDigit,
.iban-seg-cin { background: #fff7df; border-color: #efd58a; }
.iban-seg-bankCode,
.iban-seg-abi,
.iban-seg-bankIdentifier,
.iban-seg-sortCode { background: #e3eefb; border-color: #a9c6e8; }
.iban-seg-branchCode,
.iban-seg-cab { background: #ece3fb; border-color: #c3aee8; }
.iban-seg-accountNumber,
.iban-seg-accountIdentifier { background: #f3f4f6; border-color: #cbd3da; }

.iban-pair-hover {
    background: #fff3b0 !important;
    border-color: #d4a73a !important;
    box-shadow: 0 0 0 2px rgba(212, 167, 58, .35);
}

ul.iban-checks {
    margin: .6rem 0 1.3rem;
    padding: 0;
    list-style: none;
}
ul.iban-checks li {
    padding: .45rem .2rem .45rem 1.7rem;
    border-bottom: 1px solid #e1e5e8;
    position: relative;
    transition: background-color .15s;
}
ul.iban-checks li:last-child { border-bottom: 0; }
ul.iban-checks li::before {
    position: absolute;
    left: .2rem;
    font-weight: 700;
}
ul.iban-checks li.ok::before { content: "\2713"; color: #6d861f; }
ul.iban-checks li.bad::before { content: "\2717"; color: #c0392b; }
ul.iban-checks li.na::before { content: "\2013"; color: #8a929a; }
ul.iban-checks li[class*="iban-pair-"] { cursor: default; }

@media (max-width: 640px) {
    .iban-form input { flex-basis: 100%; }
    .iban-form button { width: 100%; }
}
