/* ============================================================================
   Foto Finder - Gestaltung
   Bild: ein Fotolabor. Dunkle Arbeitsschiene links, heller Leuchttisch rechts,
   Funde als Kontaktabzuege. Alles aus eigenen Mitteln, keine fremden Server.
   ========================================================================== */

:root {
    /* Flaechen und Linien */
    --grund:        #f4f6f7;
    --flaeche:      #ffffff;
    --flaeche-2:    #fafbfc;
    --flaeche-3:    #eef1f3;
    --linie:        #e0e5e9;
    --linie-stark:  #c8d0d6;

    /* Schrift */
    --text:         #151a1f;
    --text-2:       #5a646d;
    --text-3:       #8d979f;
    --text-invers:  #ffffff;

    /* Akzent: Petrol - die Farbe der Arbeitsflaeche, sparsam eingesetzt */
    --akzent:       #0f6e6e;
    --akzent-hell:  #14898a;
    --akzent-blass: #e4f1f1;
    --akzent-linie: #9fcccc;

    /* Zustandsfarben, bewusst getrennt vom Akzent */
    --kritisch:       #a13224;
    --kritisch-blass: #fbecea;
    --kritisch-linie: #eec4bf;
    --warnung:        #8a5a00;
    --warnung-blass:  #fcf3e2;
    --warnung-linie:  #ecd9ae;
    --gut:            #2f6b45;
    --gut-blass:      #e8f2ec;
    --gut-linie:      #b6d6c2;

    /* Navigationsschiene */
    --schiene:        #101519;
    --schiene-2:      #192127;
    --schiene-text:   #9aa6b0;
    --schiene-aktiv:  #ffffff;
    --schiene-linie:  rgba(255, 255, 255, .08);

    --radius:      12px;
    --radius-klein: 8px;
    --schiene-breite: 236px;
    --heben: 0 1px 2px rgba(16, 21, 25, .06), 0 8px 24px -12px rgba(16, 21, 25, .18);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --grund:        #0c1014;
        --flaeche:      #141a20;
        --flaeche-2:    #192128;
        --flaeche-3:    #202a32;
        --linie:        #232e37;
        --linie-stark:  #33414d;

        --text:         #e7ecf0;
        --text-2:       #9aa6b1;
        --text-3:       #6f7c87;

        --akzent:       #3aa9a4;
        --akzent-hell:  #4cc2bc;
        --akzent-blass: #102c2c;
        --akzent-linie: #1e4c4c;

        --kritisch:       #e08276;
        --kritisch-blass: #321916;
        --kritisch-linie: #55271f;
        --warnung:        #d7a341;
        --warnung-blass:  #2c2312;
        --warnung-linie:  #4a3a18;
        --gut:            #74bd90;
        --gut-blass:      #152a1e;
        --gut-linie:      #26452f;

        --schiene:      #090c0f;
        --schiene-2:    #121a20;
        --heben: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px -14px rgba(0, 0, 0, .7);
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--akzent-hell); }
h1, h2, h3 { letter-spacing: -.012em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--akzent-hell); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- Geruest */
.rahmen { display: flex; min-height: 100vh; }

.seitenleiste {
    width: var(--schiene-breite);
    flex: 0 0 var(--schiene-breite);
    background: var(--schiene);
    color: var(--schiene-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(0, 0, 0, .4);
}

.marke {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 18px 18px;
    border-bottom: 1px solid var(--schiene-linie);
    color: #fff;
}
.marke .zeichen { flex: 0 0 auto; display: grid; place-items: center; }
.marke .name { font-size: 15.5px; font-weight: 640; letter-spacing: -.01em; line-height: 1.2; }
.marke .unter { display: block; font-size: 11px; font-weight: 400; color: #6f7d88; letter-spacing: .02em; margin-top: 2px; }

.menue { list-style: none; margin: 0; padding: 10px 10px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.menue a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--schiene-text);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-klein);
    position: relative;
}
.menue a svg { flex: 0 0 auto; opacity: .75; }
.menue a:hover { background: var(--schiene-2); color: #dfe6ec; }
.menue a.aktiv { background: var(--schiene-2); color: var(--schiene-aktiv); font-weight: 560; }
.menue a.aktiv svg { opacity: 1; color: var(--akzent-hell); }
.menue a.aktiv::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--akzent-hell);
}
.menue .trenner {
    margin: 16px 10px 5px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #5d6a75;
    font-weight: 600;
}
.menue .beschriftung { flex: 1; }
.menue .zaehler {
    background: var(--kritisch);
    color: #fff;
    border-radius: 99px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.kopfzeile {
    background: color-mix(in srgb, var(--flaeche) 86%, transparent);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--linie);
    padding: 13px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.kopfzeile h1 { margin: 0; font-size: 19px; font-weight: 620; }
.kopf_rechts { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.kopf_rechts .wer { display: flex; align-items: center; gap: 8px; }
.kopf_rechts .kreis {
    width: 27px; height: 27px; border-radius: 50%;
    background: var(--akzent-blass); color: var(--akzent);
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    border: 1px solid var(--akzent-linie);
}
.bereich { padding: 26px 28px 64px; }

/* ----------------------------------------------------------------- Karten */
.karte {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.karte_kopf {
    padding: 14px 18px;
    border-bottom: 1px solid var(--linie);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.karte_kopf h2 { margin: 0; font-size: 14px; font-weight: 640; letter-spacing: .005em; }
.karte_koerper { padding: 18px; }
.karte_koerper > :first-child { margin-top: 0; }
.karte_koerper > :last-child { margin-bottom: 0; }

.raster { display: grid; gap: 18px; }
.raster.spalten2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster.spalten3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster.spalten4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --------------------------------------------------------------- Kennzahlen
   Eine Leitzahl gross, die Nebenwerte klein - Hierarchie statt vier gleicher
   Kacheln. */
.lage {
    display: grid;
    grid-template-columns: minmax(240px, 1.1fr) 2fr;
    gap: 18px;
    margin-bottom: 22px;
}
.leitzahl {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}
.leitzahl.achtung { border-color: var(--kritisch-linie); background: linear-gradient(180deg, var(--kritisch-blass), var(--flaeche) 70%); }
.leitzahl .zahl { font-size: 46px; font-weight: 680; line-height: 1; letter-spacing: -.03em; }
.leitzahl.achtung .zahl { color: var(--kritisch); }
.leitzahl .was { font-size: 13.5px; color: var(--text-2); }
.leitzahl .marke_oben { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); font-weight: 650; }

.nebenwerte {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    overflow: hidden;
}
.nebenwerte > div { padding: 18px 20px; border-right: 1px solid var(--linie); display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.nebenwerte > div:last-child { border-right: none; }
.nebenwerte .zahl { font-size: 26px; font-weight: 640; letter-spacing: -.02em; line-height: 1.1; }
.nebenwerte .was { font-size: 12.5px; color: var(--text-2); }

/* Alte Kachelform, weiterhin fuer einzelne Werte nutzbar */
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; }
.kennzahl .wert { font-size: 27px; font-weight: 640; letter-spacing: -.02em; line-height: 1.2; }
.kennzahl .bezeichnung { font-size: 12.5px; color: var(--text-2); }
.kennzahl.warnung .wert { color: var(--kritisch); }
.kennzahl.gut .wert { color: var(--gut); }

/* --------------------------------------------------------------- Tabellen */
table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
table.liste th {
    text-align: left;
    padding: 9px 14px;
    background: var(--flaeche-2);
    border-bottom: 1px solid var(--linie);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-3);
    font-weight: 650;
    white-space: nowrap;
}
table.liste td { padding: 12px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
table.liste tr:last-child td { border-bottom: none; }
table.liste tbody tr:hover, table.liste tr:hover { background: var(--flaeche-2); }
table.liste td.rechts, table.liste th.rechts { text-align: right; }
table.liste small { color: var(--text-2); }
.tabelle_umbruch { overflow-x: auto; }

/* -------------------------------------------------------------- Formulare */
label.feld { display: block; margin-bottom: 15px; }
label.feld > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=file], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--linie-stark);
    border-radius: var(--radius-klein);
    font-size: 14px;
    font-family: inherit;
    background: var(--flaeche);
    color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--akzent);
    box-shadow: 0 0 0 3px var(--akzent-blass);
}
input:disabled, select:disabled { background: var(--flaeche-3); color: var(--text-2); }
textarea { min-height: 92px; resize: vertical; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238d979f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.hilfe { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.45; }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
legend { font-size: 12.5px; font-weight: 650; padding: 0 6px; }
.schalter { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; font-size: 14px; }
.schalter input { width: 16px; height: 16px; accent-color: var(--akzent); }
.filterleiste { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filterleiste label.feld { margin-bottom: 0; min-width: 165px; }

/* --------------------------------------------------------------- Knoepfe */
.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-klein);
    border: 1px solid transparent;
    background: var(--akzent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.knopf:hover { background: var(--akzent-hell); color: #fff; }
.knopf.hell { background: var(--flaeche); color: var(--text); border-color: var(--linie-stark); }
.knopf.hell:hover { background: var(--flaeche-3); color: var(--text); border-color: var(--linie-stark); }
.knopf.gefahr { background: var(--kritisch); }
.knopf.gefahr:hover { background: color-mix(in srgb, var(--kritisch) 84%, #000); }
.knopf.klein { padding: 6px 11px; font-size: 12.5px; }
.knopf.gefahr_text { background: var(--flaeche); color: var(--kritisch); border-color: var(--kritisch-linie); }
.knopf.gefahr_text:hover { background: var(--kritisch-blass); color: var(--kritisch); }
.knopfreihe .trennstrich { width: 1px; align-self: stretch; background: var(--linie); margin: 0 3px; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.knopfreihe { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------ Hinweise, Merkmale */
.hinweis {
    padding: 12px 16px;
    border-radius: var(--radius-klein);
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-left-width: 3px;
    line-height: 1.5;
}
.hinweis.erfolg  { background: var(--gut-blass);      border-color: var(--gut-linie);      border-left-color: var(--gut);      color: var(--gut); }
.hinweis.fehler  { background: var(--kritisch-blass); border-color: var(--kritisch-linie); border-left-color: var(--kritisch); color: var(--kritisch); }
.hinweis.warnung { background: var(--warnung-blass);  border-color: var(--warnung-linie);  border-left-color: var(--warnung);  color: var(--warnung); }
.hinweis.info    { background: var(--akzent-blass);   border-color: var(--akzent-linie);   border-left-color: var(--akzent);   color: var(--akzent); }
.hinweis strong { color: inherit; }
.hinweis a { color: inherit; font-weight: 600; }

.merkmal {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 620;
    white-space: nowrap;
    border: 1px solid transparent;
}
.merkmal::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.merkmal.neu      { background: var(--kritisch-blass); border-color: var(--kritisch-linie); color: var(--kritisch); }
.merkmal.geprueft { background: var(--akzent-blass);   border-color: var(--akzent-linie);   color: var(--akzent); }
.merkmal.erlaubt  { background: var(--gut-blass);      border-color: var(--gut-linie);      color: var(--gut); }
.merkmal.kontakt  { background: var(--warnung-blass);  border-color: var(--warnung-linie);  color: var(--warnung); }
.merkmal.erledigt,
.merkmal.falsch,
.merkmal.grau     { background: var(--flaeche-3); border-color: var(--linie); color: var(--text-2); }
.merkmal.grau::before { background: var(--text-3); }

/* ----------------------------------------------------------------- Bilder */
.bildkachel {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-klein);
    overflow: hidden;
    transition: border-color .12s ease, transform .12s ease;
}
.bildkachel:hover { border-color: var(--linie-stark); }
.bildkachel img { width: 100%; height: 148px; object-fit: cover; display: block; background: var(--flaeche-3); }
.bildkachel .titel { padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.bildkachel .titel small { color: var(--text-2); font-size: 11.5px; }

/* Vergleich: zwei Kontaktabzuege nebeneinander */
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vergleich .seite { display: flex; flex-direction: column; gap: 10px; }
.vergleich h3 {
    font-size: 11px; margin: 0;
    text-transform: uppercase; letter-spacing: .09em;
    color: var(--text-3); font-weight: 650;
}
.vergleich .abzug {
    background: var(--flaeche-3);
    border: 1px solid var(--linie);
    border-radius: var(--radius-klein);
    padding: 10px;
    display: grid;
    place-items: center;
    min-height: 220px;
}
.vergleich img { max-width: 100%; max-height: 360px; display: block; border-radius: 3px; }

/* Aehnlichkeit als Messleiste mit Skala */
.messleiste { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.messleiste .schiene_ { flex: 1; height: 5px; border-radius: 99px; background: var(--flaeche-3); overflow: hidden; min-width: 54px; }
.messleiste .schiene_ span { display: block; height: 100%; border-radius: 99px; background: var(--akzent); }
.messleiste.hoch .schiene_ span { background: var(--kritisch); }
.messleiste .zahl { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Alte Balkenform bleibt nutzbar */
.balken { height: 5px; background: var(--flaeche-3); border-radius: 99px; overflow: hidden; min-width: 70px; }
.balken span { display: block; height: 100%; background: var(--akzent); }
.balken.hoch span { background: var(--kritisch); }

/* ------------------------------------------------------------- Anmeldung */
.anmeldung {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--grund);
}
.anmeldung .buehne {
    background: linear-gradient(160deg, var(--schiene) 0%, #16232a 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    color: #cfd8e0;
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    overflow: hidden;
}
.anmeldung .buehne::after {
    /* angedeutete Kontaktbogen-Raster im Hintergrund */
    content: "";
    position: absolute;
    inset: auto -60px -80px auto;
    width: 420px; height: 420px;
    background-image: linear-gradient(var(--schiene-linie) 1px, transparent 1px), linear-gradient(90deg, var(--schiene-linie) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotate(-8deg);
    opacity: .7;
    pointer-events: none;
}
.anmeldung .buehne .marke { border: none; padding: 0; }
.anmeldung .buehne .satz { font-size: 25px; line-height: 1.35; color: #fff; font-weight: 600; letter-spacing: -.015em; max-width: 19ch; position: relative; }
.anmeldung .buehne .punkte { display: flex; flex-direction: column; gap: 11px; font-size: 13.5px; position: relative; }
.anmeldung .buehne .punkte div { display: flex; gap: 10px; align-items: flex-start; }
.anmeldung .buehne .punkte svg { flex: 0 0 auto; margin-top: 2px; color: var(--akzent-hell); }
.anmeldung .formular { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.anmeldung .kasten { width: 100%; max-width: 372px; }
.anmeldung .kasten h1 { margin: 0 0 6px; font-size: 21px; font-weight: 640; }
.anmeldung .kasten p.unter { margin: 0 0 26px; color: var(--text-2); font-size: 13.5px; }
.anmeldung .knopf { width: 100%; margin-top: 4px; padding: 11px 16px; font-size: 14px; }

/* ------------------------------------------------------------- Kleinkram */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre.mono {
    background: var(--schiene);
    color: #cfe3e3;
    padding: 14px 16px;
    border-radius: var(--radius-klein);
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
    margin: 0 0 12px;
    border: 1px solid rgba(255, 255, 255, .06);
}
.leer { text-align: center; padding: 44px 20px; color: var(--text-2); font-size: 13.5px; }
.blaettern { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; border-top: 1px solid var(--linie); }
.blaettern a, .blaettern span {
    padding: 6px 12px; border: 1px solid var(--linie); border-radius: var(--radius-klein);
    text-decoration: none; font-size: 13px; background: var(--flaeche); color: var(--text);
}
.blaettern a:hover { border-color: var(--linie-stark); }
.blaettern span.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); font-weight: 620; }

hr.fein { border: none; border-top: 1px solid var(--linie); margin: 18px 0; }

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

/* ------------------------------------------------------------- Schmalbild */
@media (max-width: 1080px) {
    .lage { grid-template-columns: 1fr; }
    .raster.spalten4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .rahmen { flex-direction: column; }
    .seitenleiste { width: 100%; flex: none; height: auto; position: static; border-right: none; border-bottom: 1px solid rgba(0,0,0,.4); }
    .marke { padding: 14px 16px; }
    .menue { flex-direction: row; flex-wrap: wrap; padding: 10px; gap: 6px; }
    .menue a { padding: 7px 11px; }
    .menue a.aktiv::before { display: none; }
    .menue .trenner { display: none; }
    .kopfzeile { padding: 12px 16px; }
    .bereich { padding: 18px 16px 56px; }
    .raster.spalten4, .raster.spalten3, .raster.spalten2 { grid-template-columns: 1fr; }
    .nebenwerte { grid-template-columns: 1fr; }
    .nebenwerte > div { border-right: none; border-bottom: 1px solid var(--linie); }
    .nebenwerte > div:last-child { border-bottom: none; }
    .vergleich { grid-template-columns: 1fr; }
    .anmeldung { grid-template-columns: 1fr; }
    .anmeldung .buehne { padding: 30px 24px; gap: 26px; }
    .anmeldung .buehne .satz { font-size: 21px; }
}
