/* styles.css — helles Schema (P1), ohne Dark Mode, ohne Fremd-Schriften. */
:root {
    color-scheme: light;
    --grund: #ffffff;
    --flaeche: #f4f7fa;
    --linie: #d8e0e8;
    --text: #1b2430;
    --gedaempft: #566476;
    --marke: #1f5f8b;
    --marke-dunkel: #174a6c;
    --gut: #1d6b42;
    --fehler: #a32222;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    font-size: 1.0625rem;
}

a { color: var(--marke-dunkel); text-underline-offset: 2px; }
a:hover { color: var(--marke); }

.sprung {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--marke);
    color: #fff;
    padding: .5rem .75rem;
    z-index: 10;
}
.sprung:focus { left: .5rem; top: .5rem; }

.innen { width: min(64rem, 100% - 2.5rem); margin-inline: auto; }

.kopf { border-bottom: 1px solid var(--linie); background: var(--grund); }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; padding: .9rem 0; }
.marke { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .01em; }
.marke-punkt { width: .8rem; height: .8rem; border-radius: 50%; background: var(--marke); display: inline-block; }
.sprachen { display: flex; gap: .9rem; font-size: .95rem; }
.sprachen a[aria-current="page"] { color: var(--text); font-weight: 650; text-decoration: none; }

main { padding: 2.4rem 0 3.5rem; }

.hero { padding: 1.2rem 0 2rem; max-width: 52rem; }
.kicker { margin: 0 0 .6rem; color: var(--marke); font-weight: 650; font-size: .95rem; letter-spacing: .02em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.18; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.25; margin: 0 0 .8rem; }
h3 { font-size: 1.08rem; margin: 0 0 .35rem; }
p { margin: 0 0 .9rem; }

.unterzeile { font-size: 1.15rem; color: var(--gedaempft); max-width: 46rem; }
.claim { font-weight: 600; }
.nurlesen { margin-top: 1rem; padding: .7rem .9rem; border-left: 4px solid var(--marke); background: var(--flaeche); }

.knopfreihe { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0; }
.knopf {
    display: inline-block;
    background: var(--marke);
    color: #fff;
    padding: .7rem 1.15rem;
    border-radius: .45rem;
    border: 1px solid var(--marke);
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
}
.knopf:hover { background: var(--marke-dunkel); color: #fff; }
.knopf:disabled { opacity: .6; cursor: progress; }
.knopf.zweit { background: transparent; color: var(--marke-dunkel); }
.knopf.zweit:hover { background: var(--flaeche); }

.block { padding: 1.8rem 0; border-top: 1px solid var(--linie); }
.block:first-of-type { border-top: 0; }

.nutzen { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.nutzen li { background: var(--flaeche); border: 1px solid var(--linie); border-radius: .6rem; padding: 1rem 1.1rem; }
.nutzen p { margin: 0; color: var(--gedaempft); }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.karte { border: 1px solid var(--linie); border-radius: .6rem; padding: 1.1rem 1.2rem; background: #fff; }
.karte p { margin: 0; color: var(--gedaempft); }

.schritte { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.schritte li { margin-bottom: .8rem; }
.schritte p { margin: 0; color: var(--gedaempft); }

.befehl { background: #0f1b26; color: #e8f0f7; padding: 1rem 1.1rem; border-radius: .5rem; overflow-x: auto; font-size: .92rem; }
.befehl code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }

.tabelle-rahmen { overflow-x: auto; margin: .6rem 0 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px solid var(--linie); }
thead th { background: var(--flaeche); }
tbody th { font-weight: 650; width: 38%; }

.punkte { padding-left: 1.2rem; }
.punkte li { margin-bottom: .35rem; }
.klein { color: var(--gedaempft); font-size: .92rem; }

.fragen details { border: 1px solid var(--linie); border-radius: .5rem; padding: .8rem 1rem; margin-bottom: .6rem; background: #fff; }
.fragen summary { cursor: pointer; font-weight: 650; }
.fragen details p { margin: .7rem 0 0; color: var(--gedaempft); }

.cta { background: var(--flaeche); border: 1px solid var(--linie); border-radius: .7rem; padding: 1.4rem; margin-top: 1.5rem; }

.warteliste { display: grid; gap: 1rem; max-width: 38rem; }
.feld { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; }
.feld label, .feld legend { font-weight: 650; }
input[type="email"], input[type="text"], textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--linie);
    border-radius: .4rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}
input:focus, textarea:focus, button:focus, summary:focus, a:focus { outline: 2px solid var(--marke); outline-offset: 2px; }
.arten { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .35rem .8rem; }
.art { display: flex; align-items: center; gap: .45rem; font-weight: 400; }
.art input { width: 1.05rem; height: 1.05rem; }
.datenschutz { margin: .2rem 0; }
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.5rem; margin: .2rem 0 0; font-weight: 600; }
.status.fehler { color: var(--fehler); }
.status.gut { color: var(--gut); }
.hinweis { background: #fff7e0; border: 1px solid #e8d48a; border-radius: .5rem; padding: .8rem 1rem; }

.rechtstext { max-width: 48rem; }
.rechtstext h2 { margin-top: 1.8rem; }
.faktenliste { display: grid; grid-template-columns: minmax(9rem, 16rem) 1fr; gap: .3rem 1rem; margin: 0; }
.faktenliste dt { font-weight: 650; }
.faktenliste dd { margin: 0; color: var(--gedaempft); }

.fuss { border-top: 1px solid var(--linie); background: var(--flaeche); padding: 1.6rem 0 2rem; }
.fuss-innen { display: grid; gap: .5rem; }
.fuss-marke { margin: 0; }
.fuss-nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .95rem; }
.fuss-klein { margin: 0; color: var(--gedaempft); font-size: .88rem; }

@media (max-width: 40rem) {
    .faktenliste { grid-template-columns: 1fr; }
    .faktenliste dd { margin-bottom: .5rem; }
    tbody th { width: auto; }
}

/* ── Anwendung: Explorer und Abfrage-Editor (Nr. 2838/2839) ───────────────── */
html, body { overflow-x: hidden; }
.app-seite { padding-bottom: 4rem; }
.app-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.app-kopf h1 { margin-bottom: .2rem; }
.app-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.app-werkzeuge select, .app-werkzeuge input, select, input[type="search"] {
    padding: .45rem .55rem; border: 1px solid var(--linie); border-radius: .4rem;
    font: inherit; background: #fff; color: var(--text);
}
.taste { font-size: .78rem; border: 1px solid var(--linie); border-radius: .25rem; padding: 0 .3rem; color: var(--gedaempft); }

.explorer { display: grid; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.baum-bereich { border: 1px solid var(--linie); border-radius: .55rem; background: #fff; padding: .7rem; position: sticky; top: .6rem; max-height: calc(100vh - 8rem); overflow: auto; }
.baum-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.baum { font-size: .93rem; }
.baum-gruppe { margin-bottom: .15rem; }
.baum-zeile { display: flex; align-items: center; gap: .35rem; padding: .22rem .2rem; border-radius: .3rem; cursor: default; min-height: 1.9rem; }
.baum-zeile:hover { background: var(--flaeche); }
.baum-zeile[data-tabelle] { cursor: pointer; }
.baum-pfeil { border: 0; background: transparent; color: var(--gedaempft); width: 1.4rem; min-height: 1.4rem; cursor: pointer; font: inherit; padding: 0; }
.baum-pfeil.leer { cursor: default; }
.baum-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baum-spalte .baum-text { color: var(--gedaempft); }
.baum-untertitel { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gedaempft); margin: .45rem 0 .15rem .6rem; }
.baum-aktion { margin-left: auto; border: 0; background: transparent; color: var(--gedaempft); cursor: pointer; min-width: 1.6rem; min-height: 1.6rem; font-size: 1rem; }
.baum-aktion:hover { color: var(--fehler); }
.zahl { margin-left: auto; font-size: .78rem; color: var(--gedaempft); padding-left: .4rem; white-space: nowrap; }
.baum-fuss { border-top: 1px solid var(--linie); padding-top: .5rem; margin-top: .6rem; }

.explorer-inhalt { min-width: 0; }
.reiter { display: flex; gap: .3rem; align-items: center; border-bottom: 1px solid var(--linie); margin-bottom: .7rem; flex-wrap: wrap; }
.reiter-knopf { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: .45rem .8rem; border-radius: .4rem .4rem 0 0; cursor: pointer; font: inherit; color: var(--gedaempft); }
.reiter-knopf.aktiv { background: var(--flaeche); border-color: var(--linie); color: var(--text); font-weight: 650; }
.abfrage-reiter { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--linie); margin-bottom: .6rem; }
.abfrage-reiter .reiter-knopf { display: inline-flex; align-items: center; gap: .4rem; }
.chip-weg { border: 0; background: transparent; color: var(--gedaempft); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.chip-weg:hover { color: var(--fehler); }

.tabellen-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tabellen-kopf h2 { margin: 0; font-size: 1.2rem; word-break: break-all; }
.zeilen-werkzeuge { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.zeilen-knoepfe { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.filter-formular { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.filter-formular input { min-width: 9rem; }
.filter-liste { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .6rem; }
.filter-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 1rem; padding: .15rem .55rem; font-size: .85rem; }
.klein-knopf { padding: .2rem .5rem; font-size: .8rem; }

/* Raster mit virtuellem Scrollen */
.raster-scroll { position: relative; overflow: auto; max-height: 58vh; border: 1px solid var(--linie); border-radius: .45rem; background: #fff; }
.raster-kopf { position: sticky; top: 0; z-index: 2; display: grid; background: var(--flaeche); border-bottom: 1px solid var(--linie); min-height: 2rem; }
.raster-kopf-zelle { display: flex; align-items: center; gap: .25rem; padding: .3rem .45rem; border-right: 1px solid var(--linie); font-size: .82rem; font-weight: 650; overflow: hidden; white-space: nowrap; position: relative; }
.raster-kopf-zelle.sortierbar { cursor: pointer; }
.raster-kopf-zelle .typ { font-weight: 400; color: var(--gedaempft); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
.raster-kopf-zelle .pfeil { margin-left: auto; color: var(--marke); }
.griff { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; }
.griff:hover { background: var(--marke); opacity: .35; }
.raster-flaeche { position: relative; min-width: 100%; }
.raster-fenster { position: absolute; top: 0; left: 0; display: grid; width: 100%; }
.raster-zelle { height: 32px; line-height: 32px; padding: 0 .45rem; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; cursor: copy; }
.raster-zelle:hover { background: var(--flaeche); }
.raster-wahl { height: 32px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie); }
.raster-wahl input { width: 1.05rem; height: 1.05rem; }
.raster-info { height: 32px; border: 0; background: transparent; color: var(--marke); cursor: pointer; font-size: .9rem; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie); }
.nullwert { color: var(--gedaempft); font-style: italic; }
.wert-knopf { border: 1px solid var(--linie); background: var(--flaeche); border-radius: .25rem; padding: 0 .35rem; font: inherit; font-size: .78rem; cursor: pointer; color: var(--marke-dunkel); }

.karten-ansicht { display: none; }
.karte-zeile { border: 1px solid var(--linie); border-radius: .5rem; padding: .7rem .8rem; margin-bottom: .6rem; background: #fff; }
.karte-zeile h3 { font-size: 1rem; margin: 0 0 .3rem; word-break: break-word; }
.karte-zeile details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--marke-dunkel); }

.struktur-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem); gap: 1rem; align-items: start; }
.eigenschaften { border: 1px solid var(--linie); border-radius: .5rem; background: var(--flaeche); padding: .8rem 1rem; }
.eigenschaften h2 { font-size: 1.05rem; margin-top: 0; }
.eigenschaften-liste { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0; font-size: .9rem; }
.eigenschaften-liste dt { font-weight: 650; }
.eigenschaften-liste dd { margin: 0; word-break: break-word; }

/* Dialoge */
.dialog { width: min(46rem, 100% - 2rem); border: 1px solid var(--linie); border-radius: .6rem; padding: 1.2rem; background: #fff; color: var(--text); box-shadow: 0 12px 40px rgba(20, 40, 60, .22); }
.dialog::backdrop { background: rgba(15, 27, 38, .45); }
.dialog-schliessen { float: right; }
.zeilen-felder { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .3rem .8rem; margin: .4rem 0 1rem; font-size: .92rem; }
.zeilen-felder dt { font-weight: 650; word-break: break-word; }
.zeilen-felder dd { margin: 0; word-break: break-word; }
.json-baum { list-style: none; padding-left: 1rem; margin: .1rem 0; border-left: 1px dashed var(--linie); }
.json-name { color: var(--marke-dunkel); }
.json-text { color: var(--gut); }
.json-zahl { color: var(--fehler); }
.suchtreffer { display: block; width: 100%; text-align: left; border: 1px solid var(--linie); background: #fff; border-radius: .4rem; padding: .45rem .6rem; margin-bottom: .35rem; cursor: pointer; font: inherit; }
.suchtreffer:hover { background: var(--flaeche); }
.verlauf-sql { display: block; font-size: .76rem; color: var(--gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .15rem; }
.verwaltung-eintrag { display: flex; align-items: center; gap: .3rem; }
.verwaltung-eintrag .suchtreffer { flex: 1; }
.spalten-eintrag { display: flex; align-items: center; gap: .4rem; padding: .2rem 0; font-size: .92rem; }

/* Abfrage-Editor */
.abfrage-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); gap: 1rem; align-items: start; }
.abfrage-haupt { min-width: 0; }
.editor .cm-editor { min-height: 14rem; }
.editor .cm-scroller { min-height: 14rem; max-height: 40vh; overflow: auto; }
.parameter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: .5rem 0; }
.parameter-feld { display: grid; gap: .15rem; }
.parameter-feld input { min-width: 8rem; }
.abfrage-neben { border: 1px solid var(--linie); border-radius: .55rem; background: #fff; padding: .6rem .8rem; max-height: 78vh; overflow: auto; }
.abfrage-neben details { border-bottom: 1px solid var(--linie); padding: .4rem 0; }
.abfrage-neben summary { cursor: pointer; font-weight: 650; min-height: 2rem; }
.ergebnis-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .8rem; flex-wrap: wrap; }
.ergebnis-reiter { display: flex; gap: .25rem; flex-wrap: wrap; }
.ergebnis-inhalt { margin-top: .4rem; }
.ergebnis-scroll { max-height: 42vh; }
.ergebnis-spalten { margin-bottom: .4rem; }
.meldungen .hinweis { margin-top: .5rem; }
.plan-baum { list-style: none; padding-left: 1rem; margin: .3rem 0; border-left: 1px dashed var(--linie); }
.plan-baum > li { margin: .2rem 0; }
.plan-knoten { padding: .15rem 0; }
.plan-tabelle { color: var(--marke-dunkel); }

/* Navigationsleiste unten (Handy) */
.mobil-nav { display: none; }

@media (max-width: 60rem) {
    .explorer, .abfrage-layout { grid-template-columns: minmax(0, 1fr); }
    .baum-bereich { position: static; max-height: none; }
    .struktur-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
    body { padding-bottom: 5rem; }
    .mobil-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 20;
        background: #fff;
        border-top: 1px solid var(--linie);
        box-shadow: 0 -6px 20px rgba(20, 40, 60, .08);
    }
    .mobil-nav-eintrag {
        flex: 1 1 0; min-width: 44px; min-height: 44px;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: .15rem; font-size: .72rem; color: var(--gedaempft); text-decoration: none;
        padding: .35rem .1rem;
    }
    .mobil-nav-eintrag.aktiv { color: var(--marke-dunkel); font-weight: 700; }
    .mobil-nav-punkt { width: 1.1rem; height: 1.1rem; border-radius: .25rem; border: 2px solid currentColor; display: inline-block; }
    .mobil-nav-eintrag.aktiv .mobil-nav-punkt { background: currentColor; }
    .raster-ansicht { display: none; }
    .karten-ansicht { display: block; }
    .nur-desktop { display: none; }
    .zeilen-knoepfe { margin-left: 0; }
    .knopf, .knopf.zweit { min-height: 44px; display: inline-flex; align-items: center; }
    .app-werkzeuge { width: 100%; }
    .app-werkzeuge select { flex: 1 1 10rem; }
    .dialog { width: calc(100vw - 1rem); padding: .9rem; }
    .zeilen-felder { grid-template-columns: minmax(6rem, 40%) 1fr; }
}
