:root {
  --grund: #0b0d12;
  --grund-2: #12151d;
  --karte: #171b25;
  --rand: #262c3a;
  --text: #e8ecf4;
  --text-leise: #98a2b8;
  --akzent: #67e8f9;
  --akzent-2: #a78bfa;
  --warn: #fb7185;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Ohne das gewinnt jedes display: flex/grid gegen das hidden-Attribut. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* ruhiger Farbschimmer im Hintergrund */
  content: "";
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(40% 60% at 20% 30%, rgba(103, 232, 249, .10), transparent 70%),
    radial-gradient(40% 60% at 80% 20%, rgba(167, 139, 250, .10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
kbd {
  background: var(--karte); border: 1px solid var(--rand); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: inherit;
}
code { background: var(--karte); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ------------------------------------------------------------- Anmeldung */

.tor {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--grund);
}
.tor-karte {
  width: min(360px, 90vw);
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: 20px;
  padding: 36px 30px 30px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
.tor-zeichen { font-size: 42px; color: var(--akzent); line-height: 1; }
.tor-karte h1 { margin: 12px 0 4px; font-size: 26px; letter-spacing: -.02em; }
.tor-karte p { margin: 0 0 22px; color: var(--text-leise); font-size: 14px; }
.tor-karte input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: var(--grund-2); border: 1px solid var(--rand); border-radius: 10px;
}
.tor-karte input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.tor-karte button {
  width: 100%; padding: 12px; border-radius: 10px; font-weight: 600;
  background: linear-gradient(135deg, var(--akzent), var(--akzent-2)); color: #0b0d12;
}
.tor-fehler { margin-top: 12px; color: var(--warn); font-size: 14px; }

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

.kopf {
  position: sticky; top: 0; z-index: 20;
  padding: 18px 22px 0;
  background: rgba(11, 13, 18, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rand);
}
.marke {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.marke-zeichen { color: var(--akzent); font-size: 20px; }

.suchzeile { display: flex; gap: 10px; }
.suchzeile input {
  flex: 1; padding: 13px 16px;
  background: var(--grund-2); border: 1px solid var(--rand); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.suchzeile input:focus {
  outline: none; border-color: var(--akzent);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, .12);
}
.suchzeile button {
  padding: 13px 22px; border-radius: 12px; font-weight: 600; white-space: nowrap;
  background: linear-gradient(135deg, var(--akzent), var(--akzent-2)); color: #0b0d12;
  transition: transform .12s, opacity .15s;
}
.suchzeile button:hover { transform: translateY(-1px); }
.suchzeile button:disabled { opacity: .5; cursor: progress; transform: none; }

.filter {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 2px; font-size: 13px; color: var(--text-leise);
}
.feld { display: flex; align-items: center; gap: 6px; }
.feld input {
  width: 62px; padding: 5px 8px; text-align: center;
  background: var(--grund-2); border: 1px solid var(--rand); border-radius: 7px;
}
.schalter { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.schalter input { accent-color: var(--akzent); width: 15px; height: 15px; cursor: pointer; }
.wachs { flex: 1; }
.zaehler { font-variant-numeric: tabular-nums; }
.zaehler b { color: var(--text); }

.balken { height: 2px; background: var(--rand); overflow: hidden; }
.balken > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--akzent), var(--akzent-2));
  transition: width .25s ease;
}

/* ----------------------------------------------------------------- Inhalt */

main { position: relative; z-index: 1; padding: 22px; padding-bottom: 120px; }

.leer { max-width: 560px; margin: 12vh auto; text-align: center; color: var(--text-leise); }
.leer-zeichen { font-size: 54px; color: var(--akzent); opacity: .55; }
.leer h2 { margin: 18px 0 10px; font-size: 21px; color: var(--text); font-weight: 600; }
.leer p { margin: 0 0 10px; font-size: 14px; }
.leer strong { color: var(--akzent); }
.leer-klein { font-size: 13px; opacity: .75; }

.raster { columns: 300px; column-gap: 14px; }
@media (min-width: 1500px) { .raster { columns: 5; } }

.karte {
  break-inside: avoid; margin-bottom: 14px; position: relative;
  border-radius: var(--radius); overflow: hidden;
  background: var(--karte); border: 1px solid var(--rand);
  cursor: pointer;
  animation: rein .35s ease both;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
@keyframes rein { from { opacity: 0; transform: translateY(10px); } }
.karte:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.karte.gewaehlt {
  border-color: var(--akzent);
  box-shadow: 0 0 0 2px var(--akzent), 0 14px 34px rgba(0, 0, 0, .4);
}
.karte img { display: block; width: 100%; height: auto; background: var(--grund-2); }

.karte-fuss {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 12px; color: var(--text-leise);
}
.karte-mass { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.karte-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  direction: rtl; text-align: left; flex: 1;
}

.haken {
  position: absolute; top: 10px; left: 10px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .75);
  background: rgba(0, 0, 0, .38); backdrop-filter: blur(4px);
  display: grid; place-items: center;
  font-size: 13px; color: transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.karte.gewaehlt .haken {
  background: var(--akzent); border-color: var(--akzent); color: #0b0d12; font-weight: 700;
}
.lupe-knopf {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px);
  color: #fff; font-size: 13px; opacity: 0; transition: opacity .15s;
}
.karte:hover .lupe-knopf { opacity: 1; }

.nachricht {
  max-width: 620px; margin: 40px auto; padding: 16px 20px; text-align: center;
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  color: var(--text-leise); font-size: 14px;
}
.nachricht.schlimm { border-color: var(--warn); color: var(--warn); }

/* ------------------------------------------------------------- Aktionen */

.leiste {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 30; display: flex; align-items: center; gap: 10px;
  width: min(680px, calc(100vw - 40px));
  padding: 11px 14px;
  background: rgba(23, 27, 37, .93); backdrop-filter: blur(16px);
  border: 1px solid var(--rand); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  animation: hoch .22s ease both;
}
@keyframes hoch { from { opacity: 0; transform: translate(-50%, 14px); } }
.leiste-zahl { font-size: 14px; color: var(--text-leise); white-space: nowrap; }
.leiste-zahl b { color: var(--akzent); font-size: 16px; }

button.still {
  padding: 9px 14px; border-radius: 10px; font-size: 14px;
  background: var(--grund-2); border: 1px solid var(--rand); color: var(--text-leise);
  transition: color .15s, border-color .15s;
}
button.still:hover { color: var(--text); border-color: var(--text-leise); }
button.haupt {
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--akzent), var(--akzent-2)); color: #0b0d12;
  transition: transform .12s, opacity .15s;
}
button.haupt:hover { transform: translateY(-1px); }
button.haupt:disabled { opacity: .45; cursor: progress; transform: none; }
button.haupt.breit { width: 100%; padding: 12px; margin-top: 4px; }
button.haupt.klein { padding: 7px 13px; font-size: 13px; }

/* ------------------------------------------------------------- Werkbank */

.huelle {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
  animation: auf .2s ease both;
}
@keyframes auf { from { opacity: 0; } }

.werkbank {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(440px, 100vw);
  background: var(--grund-2); border-left: 1px solid var(--rand);
  display: flex; flex-direction: column;
  animation: schieb .25s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes schieb { from { transform: translateX(100%); } }
.werkbank-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--rand);
}
.werkbank-kopf h2 { margin: 0; font-size: 17px; }
.schliessen {
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--text-leise); font-size: 15px;
  transition: background .15s, color .15s;
}
.schliessen:hover { background: var(--karte); color: var(--text); }

.werkbank-koerper { padding: 20px; overflow-y: auto; flex: 1; }
.werkbank-hinweis { margin: 0 0 12px; font-size: 13px; color: var(--text-leise); }
.werkbank-hinweis b { color: var(--akzent); }

.werkbank textarea {
  width: 100%; padding: 12px 14px; resize: vertical;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 12px;
}
.werkbank textarea:focus {
  outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(103, 232, 249, .12);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 16px; }
.chips button {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--karte); border: 1px solid var(--rand); color: var(--text-leise);
  transition: color .15s, border-color .15s, background .15s;
}
.chips button:hover { color: var(--text); border-color: var(--akzent); background: var(--grund); }

.fehler {
  margin-top: 12px; padding: 11px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .35); color: var(--warn);
}

.plan {
  margin-top: 20px; padding: 16px; border-radius: var(--radius);
  background: var(--karte); border: 1px solid var(--rand);
}
.plan-text { margin: 0 0 14px; font-size: 13.5px; color: var(--text-leise); font-style: italic; }
.plan-schritte { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }

.schritt {
  padding: 11px 13px; border-radius: 10px;
  background: var(--grund-2); border: 1px solid var(--rand);
}
.schritt-kopf {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; margin-bottom: 2px;
}
.schritt-kopf span:first-child { color: var(--akzent); }
.schritt-weg { color: var(--text-leise); font-size: 15px; line-height: 1; padding: 0 3px; }
.schritt-weg:hover { color: var(--warn); }
.schritt-werte { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 7px; }
.schritt-wert { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-leise); }
.schritt-wert input, .schritt-wert select {
  padding: 3px 7px; min-width: 58px;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 6px;
  font-size: 12px; color: var(--text);
}
.schritt-wert input[type="color"] { padding: 1px; width: 30px; min-width: 30px; height: 24px; }

.ergebnis { margin-top: 20px; }
.ergebnis-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ergebnis-kopf h3 { margin: 0; font-size: 15px; }
.ergebnis-liste { display: flex; flex-direction: column; gap: 10px; }

.ergebnis-zeile {
  display: flex; align-items: center; gap: 11px;
  padding: 9px; border-radius: 11px;
  background: var(--karte); border: 1px solid var(--rand);
}
.ergebnis-zeile img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  background: var(--grund-2); flex-shrink: 0;
}
.ergebnis-daten { flex: 1; min-width: 0; font-size: 12px; color: var(--text-leise); }
.ergebnis-daten b {
  display: block; color: var(--text); font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ergebnis-zeile.kaputt { border-color: rgba(251, 113, 133, .4); }
.ergebnis-zeile.kaputt .ergebnis-daten { color: var(--warn); }
.ergebnis-laden {
  padding: 6px 11px; border-radius: 8px; font-size: 12px;
  background: var(--grund-2); border: 1px solid var(--rand); color: var(--text-leise);
}
.ergebnis-laden:hover { color: var(--akzent); border-color: var(--akzent); }

/* -------------------------------------------------------------- Lupe */

.lupe {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(5, 6, 9, .93); backdrop-filter: blur(6px);
  animation: auf .18s ease both;
}
.lupe img { max-width: 92vw; max-height: 84vh; border-radius: 10px; object-fit: contain; }
.lupe-text {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: var(--text-leise);
  background: rgba(23, 27, 37, .9); padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--rand); max-width: 90vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lupe-zu {
  position: absolute; top: 20px; right: 22px;
  width: 38px; height: 38px; font-size: 17px;
  background: var(--karte); border: 1px solid var(--rand);
}

@media (max-width: 640px) {
  .kopf { padding: 14px 14px 0; }
  main { padding: 14px; padding-bottom: 110px; }
  .raster { columns: 1; }
  .suchzeile { flex-direction: column; }
  .leiste { gap: 7px; padding: 10px; }
  .leiste-zahl { font-size: 13px; }
  button.still, button.haupt { padding: 8px 11px; font-size: 13px; }
}

/* ----------------------------------------------------- Namensfeld fuers ZIP */

.zip-huelle {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(5, 6, 9, .6); backdrop-filter: blur(3px);
  animation: auf .16s ease both;
}
.zip-feld {
  width: min(420px, calc(100vw - 40px));
  padding: 20px;
  background: var(--karte);
  border: 1px solid var(--rand); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: hoch2 .18s ease both;
}
@keyframes hoch2 { from { opacity: 0; transform: translateY(8px); } }
.zip-feld label { display: block; font-size: 13px; color: var(--text-leise); margin-bottom: 9px; }
.zip-zeile { display: flex; align-items: center; gap: 8px; }
.zip-zeile input {
  flex: 1; min-width: 0; padding: 9px 12px;
  background: var(--grund-2); border: 1px solid var(--rand); border-radius: 9px;
}
.zip-zeile input:focus {
  outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(103, 232, 249, .12);
}
.zip-endung { color: var(--text-leise); font-size: 13px; }
.zip-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------------- Reiter */

.reiter { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--rand); }
.reiter button {
  padding: 11px 14px; font-size: 13.5px; color: var(--text-leise);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.reiter button:hover { color: var(--text); }
.reiter button.aktiv { color: var(--akzent); border-bottom-color: var(--akzent); }

.feld-titel {
  display: block; font-size: 12px; color: var(--text-leise);
  margin: 0 0 7px; text-transform: none;
}
.feld-titel span { opacity: .6; }
.werkbank-fussnote { margin: 9px 0 0; font-size: 12px; color: var(--text-leise); text-align: center; }

/* ------------------------------------------------------- Fortschritt */

.lauf {
  margin-top: 18px; padding: 14px;
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
}
.lauf-balken { height: 6px; border-radius: 999px; background: var(--grund-2); overflow: hidden; }
.lauf-balken > div {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--akzent), var(--akzent-2));
  transition: width .3s ease;
}
.lauf-text { margin-top: 10px; font-size: 12.5px; color: var(--text-leise); }
.lauf-text b { color: var(--text); font-weight: 600; }
.lauf-text .pochen { animation: pochen 1.4s ease-in-out infinite; }
@keyframes pochen { 50% { opacity: .45; } }

/* Ergebniszeile mit Vorher/Nachher */
.paar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.paar img {
  width: 52px; height: 52px; object-fit: cover; border-radius: 8px;
  background: var(--grund-2);
}
.paar .pfeil { color: var(--text-leise); font-size: 13px; }
.ergebnis-prompt {
  margin-top: 7px; font-size: 11.5px; line-height: 1.5;
  color: var(--text-leise); cursor: pointer;
}
.ergebnis-prompt summary { color: var(--akzent); font-size: 11.5px; }
.ergebnis-prompt p {
  margin: 6px 0 0; padding: 8px 10px; white-space: pre-wrap;
  background: var(--grund-2); border-radius: 8px; font-style: italic;
}
.ergebnis-zeile.hochkant { align-items: flex-start; }
.ergebnis-zeile .ergebnis-daten em { font-style: normal; color: var(--text-leise); }

/* ------------------------------------------------- Quelle: Adresse/Google */

.quelle { display: flex; gap: 2px; margin-bottom: 12px; }
.quelle button {
  padding: 7px 14px; border-radius: 9px; font-size: 13px; color: var(--text-leise);
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.quelle button:hover { color: var(--text); }
.quelle button.aktiv {
  color: var(--akzent); background: var(--grund-2); border-color: var(--rand);
}

.zurueck-band {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 9px 13px;
  background: var(--grund-2); border: 1px solid var(--rand); border-radius: 11px;
  font-size: 13px; color: var(--text-leise);
  animation: hoch2 .18s ease both;
}
.zurueck-band button {
  color: var(--akzent); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.zurueck-band button:hover { text-decoration: underline; }
.zurueck-band span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Trefferraster der Bildersuche */
.google-raster {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.treffer {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--karte); border: 1px solid var(--rand);
  display: flex; flex-direction: column;
  animation: rein .3s ease both;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.treffer:hover {
  transform: translateY(-2px); border-color: var(--akzent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .45);
}
.treffer-bild {
  height: 150px; background: var(--grund-2);
  display: grid; place-items: center; overflow: hidden;
}
.treffer-bild img { width: 100%; height: 100%; object-fit: cover; }
.treffer-text { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.treffer-titel {
  font-size: 12.5px; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.treffer-quelle {
  font-size: 11.5px; color: var(--text-leise);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.treffer-oeffnen { font-size: 11.5px; color: var(--akzent); opacity: 0; transition: opacity .15s; }
.treffer:hover .treffer-oeffnen { opacity: 1; }

.google-mehr { display: flex; justify-content: center; margin-top: 22px; }

.such-info {
  font-size: 12.5px; color: var(--text-leise);
  margin-bottom: 14px;
}
