/* PLS Fördermittel-Check – helles Header, gedämpftes Rot */

:root {
    --pls-red: #b42318;
    --pls-red-dark: #8f1c14;
    --color-primary: var(--pls-red);
    --color-bg: #f6f4f2;
    --color-surface: #ffffff;
    --color-text: #1c1c1c;
    --color-muted: #5c5856;
    --color-border: #ddd6d0;
    --header-h: 64px;
    --filter-w: 250px;
    --chat-w: 288px;
    --color-alert-info: #ddf4ff;
    --color-alert-success: #dafbe1;
    --color-alert-warning: #fff8c5;
    --color-alert-danger: #ffebe9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Source Sans 3", system-ui, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.45;
}

.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 0.75rem;
    top: 0.75rem;
    z-index: 50;
    background: #fff;
    padding: 0.4rem 0.7rem;
    color: var(--pls-red);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 0 var(--color-border);
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.site-nav {
    display: flex;
    flex: none;
    margin-left: auto;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.brand-logo { display: block; }

.nav-news {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--pls-red);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    background: #fff;
}
.nav-news:hover { color: var(--pls-red); }
.nav-news.is-on {
    color: var(--pls-red);
    background: #f8eceb;
    border-color: var(--pls-red);
}
.nav-news-icon { flex: none; }

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
}

.brand-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--color-muted);
}

main { padding: 0; }

.alert {
    padding: 0.75rem 1rem;
    margin: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}
.alert-info { background: var(--color-alert-info); }
.alert-success { background: var(--color-alert-success); }
.alert-warning { background: var(--color-alert-warning); }
.alert-danger { background: var(--color-alert-danger); }

.proto { max-width: 1280px; margin: 0 auto; padding: 1rem 1.25rem 2rem; }

.search-bar {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border: 2px solid var(--pls-red);
    background: #fff;
    height: 52px;
}
.search-bar input {
    flex: 1;
    border: 0;
    outline: none;
    padding: 0 12px;
    font: inherit;
}
.btn-primary {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pls-red);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.55rem 1.15rem;
    min-height: 2.5rem;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.btn-primary:hover { background: var(--pls-red-dark); }
.search-bar .btn-primary {
    height: 100%;
    min-height: 0;
    padding: 0 1.25rem;
    border-radius: 0;
}

.proto-grid {
    display: grid;
    grid-template-columns: var(--filter-w) minmax(0, 1fr) var(--chat-w);
    gap: 1.25rem;
    align-items: start;
}
.proto-grid--detail {
    grid-template-columns: minmax(0, 1fr) var(--chat-w);
}

.filter-col {
    min-width: 0;
}
.filter-col h2 { font-size: 1rem; margin: 0 0 0.75rem; }
.acc-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    background: none;
    border: 0;
    padding: 0.45rem 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.acc-mark {
    width: 1rem;
    color: var(--pls-red);
    flex: none;
}
.filter-list { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.filter-list[hidden] { display: none; }
.filter-list label { display: flex; gap: 0.4rem; font-size: 0.9rem; cursor: pointer; padding: 0.2rem 0; }
.filter-list input { accent-color: var(--pls-red); }
.filter-list .is-zero { color: #999; }

.result-col {
    min-width: 0;
    background: #fcfbfa;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem 1.05rem 1.25rem;
}
.result-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.hits { margin: 0; font-size: 1.25rem; color: var(--pls-red); }
.sort { margin: 0; font-size: 0.9rem; }
.sort a { color: var(--color-text); }
.sort a.is-on { font-weight: 700; color: var(--pls-red); }
.note, .muted, .empty { color: var(--color-muted); font-size: 0.9rem; }

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
    margin: 0 0 0.7rem;
    box-shadow: 0 1px 2px rgba(28, 28, 28, 0.04);
}
.card:hover {
    border-color: #cfc6bf;
    box-shadow: 0 2px 10px rgba(28, 28, 28, 0.06);
}
.card-layout {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
}
.geber-mark {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.1;
    padding: 4px;
    word-break: break-word;
}
.geber-mark--bund { background: #e7eef6; color: #1e3a5f; }
.geber-mark--land { background: #e7f1ea; color: #1d4a32; }
.geber-mark--eu { background: #ece6f6; color: #3b2d6b; }
.geber-mark--bank { background: #f4e8ee; color: #6b1d45; }
.geber-mark--kommune { background: #efe8df; color: #5a3d1c; }
.geber-mark--unknown { background: #eeeae6; color: #5c5856; }
.card-kicker { margin: 0; color: var(--pls-red); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.card-title { margin: 0.3rem 0 0.25rem; font-size: 1rem; line-height: 1.3; }
.card-title a { color: var(--color-text); text-decoration: none; }
.card-title a:hover { color: var(--pls-red); text-decoration: underline; }
.card-geber { margin: 0 0 0.55rem; font-size: 0.8rem; color: var(--color-muted); }
.meta { display: grid; grid-template-columns: minmax(140px, 28%) 1fr; gap: 0.25rem 1rem; margin: 0; font-size: 0.9rem; }
.meta dt { font-weight: 700; margin: 0; }
.meta dd { margin: 0; }

.pager { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pager a, .pager span { min-width: 2rem; text-align: center; color: var(--pls-red); }
.pager .current { font-weight: 700; color: var(--color-text); border-bottom: 2px solid var(--color-text); }

.chat-panel {
    background: #f3efec;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    min-height: 28rem;
    max-height: calc(100vh - var(--header-h) - 1.5rem);
    position: sticky;
    top: calc(var(--header-h) + 0.5rem);
}
.chat-panel-head { padding: 0.85rem 0.9rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.chat-panel-kicker { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pls-red); }
.chat-scope { font-weight: 700; margin: 0.35rem 0 0.25rem; overflow-wrap: anywhere; }
.chat-hint { margin: 0; font-size: 0.8rem; color: var(--color-muted); }
.chat-log { flex: 1; overflow: auto; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-bubble { padding: 0.55rem 0.7rem; border-radius: 8px; font-size: 0.88rem; white-space: pre-wrap; }
.chat-bubble--bot { background: #fff; border: 1px solid var(--color-border); }
.chat-bubble--user { background: #f4d6d3; align-self: flex-end; }
.chat-compose { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.65rem 0.9rem 0.85rem; border-top: 1px solid var(--color-border); }
.chat-compose textarea { font: inherit; border: 1px solid var(--color-border); border-radius: 4px; padding: 0.4rem; resize: vertical; }
.chat-compose button { align-self: flex-end; background: var(--pls-red); color: #fff; border: 0; padding: 0.35rem 0.8rem; cursor: pointer; font-weight: 600; }

.crumb { margin: 0 0 1rem; }
.crumb a { color: var(--pls-red); }
.detail-head {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    margin-bottom: 0.6rem;
}
.detail-title { margin: 0; font-size: 1.45rem; font-weight: 600; }
.detail-col h2 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.detail-col h3 { font-size: 0.95rem; }
.prose { white-space: pre-wrap; font-size: 0.95rem; }
.ext a { color: var(--pls-red); }
.facts { padding-left: 1.1rem; }

.news-col { min-width: 0; }
.news-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.news-item {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin: 0 0 0.7rem;
}
.news-date { margin: 0; font-size: 0.8rem; color: var(--color-muted); }
.news-title { margin: 0.25rem 0 0.35rem; font-size: 1.05rem; }
.news-title a { color: var(--color-text); text-decoration: none; }
.news-title a:hover { color: var(--pls-red); text-decoration: underline; }
.news-teaser { margin: 0 0 0.4rem; font-size: 0.92rem; }
.news-links { margin: 0; font-size: 0.88rem; }
.news-links a { color: var(--pls-red); }

.form-col {
    min-width: 0;
    background: #fcfbfa;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem 1.05rem 1.4rem;
}
.profil-form fieldset {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem 0.9rem;
    background: #fff;
}
.profil-form legend { font-weight: 700; }
.profil-form fieldset.inner {
    margin: 0.6rem 0;
    background: #faf8f6;
}
.profil-form .is-secondary { opacity: 0.78; }
.field { margin: 0 0 0.7rem; }
.field label { display: block; font-weight: 600; margin: 0 0 0.25rem; }
.field input[type="text"], .field input[type="password"], .field select, .field textarea {
    width: 100%;
    font: inherit;
    border: 1px solid #e6d9a8;
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    background: #fffbeb;
}
.field input[type="text"]:focus, .field input[type="password"]:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid #e8d48b;
    outline-offset: 1px;
    background: #fff8d6;
}
.badge-muss, .badge-kann, .badge-opt {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.25rem;
}
.badge-muss { color: var(--pls-red); }
.badge-kann { color: #6b5c1d; }
.badge-opt { color: var(--color-muted); }
.chip-list { list-style: none; margin: 0.3rem 0 0; padding: 0; columns: 2; }
.chip-list li { break-inside: avoid; padding: 0.15rem 0; }
.inline { margin-right: 1rem; }
.vorhaben-switch { margin: 0 0 0.9rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0.25rem 0 0;
    padding: 0.85rem 0 0.15rem;
    border-top: 1px solid var(--color-border);
}

.login-wrap {
    max-width: 24rem;
    margin: 2.5rem auto;
    padding: 0 1rem;
}
.login-card {
    background: #fcfbfa;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.2rem 1.2rem 1.4rem;
}
.login-card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.login-hint { margin: 0 0 1rem; color: var(--color-muted); }
.login-card .btn-primary { width: 100%; margin-top: 0.4rem; }

@media (max-width: 1100px) {
    .proto-grid {
        grid-template-columns: 210px minmax(0, 1fr) 250px;
    }
}

@media (max-width: 900px) {
    .proto-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .proto-grid--detail {
        grid-template-columns: 1fr;
    }
    .chat-panel {
        grid-column: 1 / -1;
        position: static;
        max-height: 24rem;
        min-height: 16rem;
    }
}

@media (max-width: 720px) {
    .proto-grid, .proto-grid--detail {
        grid-template-columns: 1fr;
    }
    .chat-panel { position: static; max-height: none; grid-column: auto; }
}
