/* niere.cc – Gestaltung. Mobil zuerst, hell und dunkel, ohne Fremdbestandteile. */

:root {
    --flaeche: #f7f8f7;
    --karte: #ffffff;
    --rand: #dde2de;
    --text: #1b2220;
    --text-leise: #5c6a65;
    --akzent: #1f6f5c;
    --akzent-hell: #e8f2ee;
    --akzent-dunkel: #15503f;
    --gut: #1f6f5c;
    --achtung: #8a5a10;
    --achtung-flaeche: #fdf4e3;
    --warnung: #9c2b22;
    --warnung-flaeche: #fdeeec;
    --gut-flaeche: #eaf4f0;
    --radius: 10px;
    --schatten: 0 1px 2px rgba(20, 35, 30, .06), 0 4px 16px rgba(20, 35, 30, .05);
    --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --schrift-zahl: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --flaeche: #13181a;
        --karte: #1b2225;
        --rand: #2d3639;
        --text: #e8edeb;
        --text-leise: #9eaeaa;
        --akzent: #5fc0a5;
        --akzent-hell: #1c2d29;
        --akzent-dunkel: #8ad9c2;
        --gut: #5fc0a5;
        --achtung: #e0ac5c;
        --achtung-flaeche: #2b2317;
        --warnung: #f08b80;
        --warnung-flaeche: #2e1c1a;
        --gut-flaeche: #16261f;
        --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    }
}

:root[data-theme="dark"] {
    --flaeche: #13181a;
    --karte: #1b2225;
    --rand: #2d3639;
    --text: #e8edeb;
    --text-leise: #9eaeaa;
    --akzent: #5fc0a5;
    --akzent-hell: #1c2d29;
    --akzent-dunkel: #8ad9c2;
    --gut: #5fc0a5;
    --achtung: #e0ac5c;
    --achtung-flaeche: #2b2317;
    --warnung: #f08b80;
    --warnung-flaeche: #2e1c1a;
    --gut-flaeche: #16261f;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--flaeche);
    color: var(--text);
    font: 16px/1.6 var(--schrift);
    overflow-wrap: break-word;
}

.wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: var(--akzent); }
a:hover { color: var(--akzent-dunkel); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.sprungmarke {
    position: absolute;
    left: -9999px;
}
.sprungmarke:focus {
    left: 8px; top: 8px;
    z-index: 10;
    background: var(--karte);
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 2px solid var(--akzent);
}

/* --- Kopf --------------------------------------------------------------- */

.kopf {
    background: var(--karte);
    border-bottom: 1px solid var(--rand);
}
.kopf-innen {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 12px;
}
.marke { text-decoration: none; color: inherit; display: block; }
.marke-name {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--akzent);
}
.marke-zusatz {
    display: block;
    font-size: .8rem;
    color: var(--text-leise);
}
.hauptnavi ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}
.hauptnavi a {
    display: block;
    padding: 7px 11px;
    font-size: .85rem;
    text-decoration: none;
    border: 1px solid var(--rand);
    border-radius: 999px;
    color: var(--text-leise);
    min-height: 32px;
}
.hauptnavi a:hover {
    border-color: var(--akzent);
    color: var(--akzent);
    background: var(--akzent-hell);
}

main { padding: 24px 16px 48px; }

/* --- Startseite --------------------------------------------------------- */

.einleitung { margin-bottom: 32px; }
.vorspann {
    font-size: 1.05rem;
    color: var(--text-leise);
    max-width: 62ch;
}
.kategorie { margin-bottom: 36px; }
.kategorie h2 a { text-decoration: none; }
.kategorie-kurz {
    color: var(--text-leise);
    margin: -.3em 0 1em;
    font-size: .92rem;
}

.kacheln {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}
@media (min-width: 620px) {
    .kacheln { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .kacheln { grid-template-columns: repeat(3, 1fr); }
}
.kachel a {
    display: block;
    height: 100%;
    padding: 16px;
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s;
}
.kachel a:hover {
    border-color: var(--akzent);
    transform: translateY(-1px);
}
.kachel h3 { margin-bottom: .35em; color: var(--akzent); }
.kachel p {
    margin: 0;
    font-size: .88rem;
    color: var(--text-leise);
}

.hinweisblock {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 18px;
    margin-top: 32px;
}
.hinweisblock h2 { font-size: 1.05rem; }
.hinweisblock p { margin: 0; font-size: .92rem; color: var(--text-leise); }

/* --- Rechnerseite ------------------------------------------------------- */

.brotkrumen {
    font-size: .85rem;
    color: var(--text-leise);
    margin-bottom: 12px;
}
.rechner-spalten {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
    margin: 20px 0 32px;
}
@media (min-width: 860px) {
    .rechner-spalten { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
}

.rechner-formular {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--schatten);
}
.felder {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}
@media (min-width: 520px) {
    .felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feld-breit { grid-column: 1 / -1; }
}
.feld { min-width: 0; }
.feld label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 5px;
}
.zahlfeld {
    display: flex;
    gap: 6px;
    min-width: 0;
}
.zahlfeld input,
.feld select,
.feld textarea {
    width: 100%;
    min-width: 0;
    font: inherit;
    color: var(--text);
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 8px;
    padding: 10px 11px;
}
.feld textarea { font-family: var(--schrift-zahl); font-size: .85rem; line-height: 1.5; }
.zahlfeld input { font-family: var(--schrift-zahl); }
.zahlfeld.mit-einheit input { flex: 1 1 auto; }
.zahlfeld select { flex: 0 0 auto; width: auto; max-width: 48%; padding-right: 6px; }
.zahlfeld .einheit {
    flex: 0 0 auto;
    align-self: center;
    font-size: .82rem;
    color: var(--text-leise);
    white-space: nowrap;
}
.zahlfeld input:focus,
.feld select:focus,
.feld textarea:focus {
    outline: 2px solid var(--akzent);
    outline-offset: 1px;
    border-color: var(--akzent);
}
.schalter {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500 !important;
    font-size: .85rem;
    cursor: pointer;
}
.schalter input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--akzent);
}
.feld-hinweis {
    margin: 5px 0 0;
    font-size: .78rem;
    color: var(--text-leise);
}
.feld-fehler .zahlfeld input { border-color: var(--warnung); }
.feld-meldung {
    margin: 5px 0 0;
    font-size: .8rem;
    color: var(--warnung);
    font-weight: 600;
}

/* Datums- und Uhrzeitfelder: Safari auf dem iPhone zeichnet sie sonst als
   natives Bedienelement mit eigener Breite, Höhe und grauem Hintergrund. */
input[type="date"], input[type="time"], input[type="datetime-local"] {
    -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%;
    background-color: var(--flaeche);
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.5em; }

.knopfreihe {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.knopf {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 11px 20px;
    min-height: 44px;
    border: 1px solid var(--akzent);
    border-radius: 8px;
    background: var(--akzent);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
.knopf-leer { background: transparent; color: var(--akzent); }
.knopf-leer:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }

/* --- Ergebnis ----------------------------------------------------------- */

.ergebnis {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--rand);
    background: var(--karte);
}
.ergebnis h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-leise); }
.ergebnis-gut { border-left: 4px solid var(--gut); background: var(--gut-flaeche); }
.ergebnis-achtung { border-left: 4px solid var(--achtung); background: var(--achtung-flaeche); }
.ergebnis-warnung { border-left: 4px solid var(--warnung); background: var(--warnung-flaeche); }
.ergebnis-leer { color: var(--text-leise); }
.ergebnis-leer p { margin: 0; font-size: .92rem; }

.werte { margin: 0 0 12px; display: grid; gap: 8px; }
.wert { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.wert dt { font-size: .88rem; color: var(--text-leise); margin: 0; }
.wert dd { margin: 0; }
.wert .zahl { font-family: var(--schrift-zahl); font-weight: 600; font-size: 1.05rem; }
.wert-einheit { font-size: .8rem; color: var(--text-leise); }
.wert-haupt { padding: 8px 0; border-bottom: 1px solid var(--rand); }
.wert-haupt:last-child { border-bottom: none; }
.wert-haupt dt { font-size: .95rem; color: var(--text); font-weight: 600; }
.wert-haupt .zahl { font-size: 1.9rem; letter-spacing: -.02em; }

.einordnung { margin: 10px 0 0; font-size: .95rem; font-weight: 500; }
.ergebnis-hinweise {
    margin: 12px 0 0;
    padding-left: 20px;
    font-size: .85rem;
    color: var(--text-leise);
}
.ergebnis-hinweise li { margin-bottom: 4px; }

/* --- Infospalte --------------------------------------------------------- */

.rechner-infos { display: grid; gap: 14px; }
.info {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 16px;
}
.info h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-leise); }
.info-kurz { font-size: .8rem; color: var(--text-leise); margin: 0 0 8px; }
.formel {
    font-family: var(--schrift-zahl);
    font-size: .8rem;
    line-height: 1.7;
    margin: 0;
    overflow-wrap: anywhere;
}
.quellen, .referenzen, .verwandt {
    margin: 0;
    padding-left: 18px;
    font-size: .85rem;
}
.quellen li, .referenzen li, .verwandt li { margin-bottom: 6px; }
.referenzen { color: var(--text-leise); }

.erklaerung { max-width: 68ch; margin-bottom: 28px; }
.erklaerung p { font-size: .97rem; }
.erklaerung.redaktion { border-top: 1px solid var(--rand); padding-top: 20px; }

/* --- Textseiten und Admin ----------------------------------------------- */

.textseite { max-width: 70ch; }
.textseite h2 { margin-top: 1.6em; }
.platzhalter {
    background: var(--achtung-flaeche);
    border: 1px dashed var(--achtung);
    border-radius: var(--radius);
    padding: 16px;
    font-size: .9rem;
}
.platzhalter p:last-child { margin-bottom: 0; }
code {
    font-family: var(--schrift-zahl);
    font-size: .85em;
    background: var(--akzent-hell);
    padding: .1em .35em;
    border-radius: 4px;
}
.meldung {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 500;
}
.meldung-gut { background: var(--gut-flaeche); border-left: 4px solid var(--gut); }
.meldung-warnung { background: var(--warnung-flaeche); border-left: 4px solid var(--warnung); }
.admin { max-width: 760px; }
.admin .rechner-formular { margin-bottom: 16px; }
.anmeldung { max-width: 420px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: 7px 8px; border-bottom: 1px solid var(--rand); text-align: left; }
.tabelle th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); }
.rechts { text-align: right; font-family: var(--schrift-zahl); }

/* --- Fuß ---------------------------------------------------------------- */

.fuss {
    background: var(--karte);
    border-top: 1px solid var(--rand);
    padding: 22px 0 32px;
    font-size: .85rem;
    color: var(--text-leise);
}
.fachkreise { max-width: 70ch; }
.fuss-navi {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

@media (min-width: 700px) {
    h1 { font-size: 2.1rem; }
    .kopf-innen { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
    .hauptnavi ul { justify-content: flex-end; }
}
