/* QPM-Farben (Logo 2023): Rot #D0191F, Dunkelrot #7D0F13, Anthrazit #1D1D1B */
:root {
    --qpm-rot: #d0191f;
    --qpm-dunkelrot: #7d0f13;
    --grund: #f4f4f2;
    --flaeche: #ffffff;
    --tinte: #1d1d1b;
    --leise: #5e5e59;
    --linie: #deddd8;
    --akzent: #d0191f;          /* Knoepfe, Links, Fokus */
    --akzent-tief: #7d0f13;     /* Hover, Text auf hellem Rot */
    --akzent-hell: #fbeceb;     /* Flaechen: aktiver Reiter, Hinweise */
    --auf-akzent: #ffffff;      /* Text auf Rot */
    --link: #b3151a;
    --ok: #1d6b3a;
    --ok-grund: #e4f3e9;
    --fehler: #9b1c1c;
    --fehler-grund: #fde8e6;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #121211;
        --flaeche: #1c1c1a;
        --tinte: #ecebe7;
        --leise: #a2a19b;
        --linie: #33322e;
        --akzent: #d0191f;
        --akzent-tief: #e8383e;
        --akzent-hell: #2c2222;
        --auf-akzent: #ffffff;
        --link: #f2777b;
        --ok: #7fd19b;
        --ok-grund: #18301f;
        --fehler: #f19a8f;
        --fehler-grund: #3a1f1c;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--tinte);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--link); }
code, .mono { font-family: var(--mono); font-size: .92em; }
h1 { font-size: 1.45rem; margin: 0; text-wrap: balance; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }

/* Kopf: roter QPM-Strich oben, Logo links, Navigation rechts */
.kopf { background: var(--flaeche); border-top: 4px solid var(--qpm-rot); border-bottom: 1px solid var(--linie); }
.kopf-innen {
    max-width: 1100px; margin: 0 auto; padding: .7rem 16px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem;
}
.marke { display: flex; align-items: center; gap: .9rem; color: var(--tinte); text-decoration: none; min-width: 0; }
.marke-logo { display: block; color: var(--tinte); line-height: 0; }
.marke-logo svg { display: block; height: 42px; width: auto; }
.marke-text {
    display: block; padding-left: .9rem; border-left: 1px solid var(--linie);
    font-weight: 650; font-size: 1.02rem; letter-spacing: .01em; line-height: 1.25;
}
.marke small { display: block; font-weight: 400; color: var(--leise); font-size: .76rem; letter-spacing: 0; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.nav a, .nav .link-knopf {
    padding: .4rem .65rem; border-radius: .35rem; color: var(--tinte); text-decoration: none; font-size: .92rem;
    box-shadow: inset 0 -2px 0 transparent;
}
.nav a:hover, .nav .link-knopf:hover { background: var(--akzent-hell); }
.nav a[aria-current="page"] { color: var(--akzent-tief); font-weight: 600; box-shadow: inset 0 -2px 0 var(--qpm-rot); border-radius: .35rem .35rem 0 0; }

@media (max-width: 520px) {
    .marke-logo svg { height: 34px; }
    .marke-text { padding-left: .7rem; font-size: .95rem; }
    .marke small { display: none; }
}

.seite { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; display: grid; gap: 1.25rem; }

/* Produkt-Umschalter (Neue Lizenz) und Produktfilter (Liste) */
.reiter { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border: 1px solid var(--linie); border-radius: .5rem; background: var(--flaeche); width: fit-content; max-width: 100%; }
.reiter a { padding: .4rem .8rem; border-radius: .35rem; color: var(--tinte); text-decoration: none; font-size: .92rem; }
.reiter a:hover { background: var(--akzent-hell); }
.reiter a[aria-current="page"] { background: var(--akzent); color: var(--auf-akzent); font-weight: 600; }
[hidden] { display: none !important; }
.chip-produkt { background: var(--grund); color: var(--tinte); border: 1px solid var(--linie); font-weight: 500; white-space: nowrap; }
.tabelle td.mono { white-space: nowrap; }

.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.titelzeile.klein { margin-bottom: .5rem; }
.titelzeile.klein h2 { margin: 0; }
.zahl { font-size: .9rem; font-weight: 500; color: var(--leise); margin-left: .35rem; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: .6rem; padding: 1.25rem; min-width: 0; }
.karte.schmal { max-width: 460px; width: 100%; margin: 2rem auto 0; }
.raster { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.formular { display: grid; gap: 1rem; }
.formular h2 { margin-top: .5rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
input, select, textarea {
    font: inherit; font-weight: 400; color: var(--tinte); background: var(--flaeche);
    border: 1px solid var(--linie); border-radius: .4rem; padding: .5rem .6rem; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible {
    outline: 2px solid var(--akzent); outline-offset: 2px;
}
.zweispaltig { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hilfe { font-weight: 400; font-size: .84rem; color: var(--leise); }
.feldfehler { font-weight: 500; font-size: .85rem; color: var(--fehler); }
.leise { color: var(--leise); font-weight: 400; }
.hinweis { margin: 0; padding: .7rem .85rem; border-radius: 0 .4rem .4rem 0; background: var(--grund); border-left: 3px solid var(--qpm-rot); font-size: .9rem; }

.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem .95rem; border-radius: .4rem; border: 1px solid var(--akzent);
    background: var(--akzent); color: var(--auf-akzent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.knopf:hover { background: var(--akzent-tief); border-color: var(--akzent-tief); }
.knopf.zweit { background: var(--flaeche); color: var(--tinte); border-color: var(--linie); }
.knopf.zweit:hover { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent-tief); }
.link-knopf { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }

.meldung { margin: 0; padding: .75rem 1rem; border-radius: .45rem; border: 1px solid; }
.meldung.ok { background: var(--ok-grund); color: var(--ok); border-color: currentColor; }
.meldung.fehler { background: var(--fehler-grund); color: var(--fehler); border-color: currentColor; }

.suche { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.suche input { flex: 1 1 260px; width: auto; }

.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: .6rem; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); font-weight: 600; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.zahlen { font-variant-numeric: tabular-nums; white-space: nowrap; }
.leer { color: var(--leise); }

.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.chip-ok { background: var(--ok-grund); color: var(--ok); }
.chip-aus { background: var(--fehler-grund); color: var(--fehler); }

.angaben { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.angaben dt { color: var(--leise); }
.angaben dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.umbruch { white-space: pre-wrap; overflow-wrap: anywhere; }

.schluessel, .mailtext { font-family: var(--mono); font-size: .82rem; resize: vertical; }
.schluessel { overflow-wrap: anywhere; word-break: break-all; margin-bottom: .75rem; }
.mailtext { line-height: 1.45; }

.geschichte { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .9rem; }
.geschichte details { margin-top: .25rem; }
.geschichte code { display: block; font-size: .78rem; color: var(--leise); }

.pruefliste { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .25rem; font-size: .9rem; }
.pruefliste .ok { color: var(--ok); }
.pruefliste .nein { color: var(--fehler); font-weight: 600; }

.status-form { border-top: 1px solid var(--linie); padding-top: .75rem; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
