/* einkauf.schleinzer.app – Aussehen. Farben und Maße laut Design-Canvas (Aubergine, Schriftpaar A). */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/figtree.woff2') format('woff2');
}

:root {
  --aubergine: #5B2A4E;
  --aubergine-dunkel: #47203D;
  --salbei: #7F9A7A;
  --salbei-hell: #A9C2A3;
  --salbei-zart: #E2EADE;
  --grund: #F6F2EF;
  --tinte: #231A20;
  --grau: #665B62;
  --linie: #E7DED9;
  --linie-stark: #CDC0B9;
  --erledigt: #EEE7E3;
  --fehler: #A8402E;
  --weiss: #FFFFFF;
  --abdunkeln: rgba(35, 26, 32, 0.45);
  --titel: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --text: 'Figtree', 'Avenir Next', system-ui, sans-serif;
  --rand: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--aubergine); }
[hidden] { display: none !important; }
.versteckt {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.seite {
  max-width: 900px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) calc(env(safe-area-inset-right) + var(--rand))
           calc(env(safe-area-inset-bottom) + 40px) calc(env(safe-area-inset-left) + var(--rand));
}
.seite.schmal { max-width: 520px; }

.oberzeile {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--grau); font-weight: 600;
}
.titel-gross {
  font-family: var(--titel); font-weight: 700; letter-spacing: -0.02em;
  font-size: 32px; line-height: 1.05; margin: 0;
}

/* Kopf der Liste */
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kopf-links { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.titel-liste { min-height: 44px; display: flex; align-items: center; }
.leise.abstand { margin: -4px 0 12px; }
.kopf-knoepfe { display: flex; gap: 8px; padding-bottom: 2px; flex: none; }
.rund {
  width: 44px; height: 44px; border-radius: 999px; background: var(--weiss);
  border: 1px solid var(--linie); display: inline-flex; align-items: center; justify-content: center;
  color: var(--aubergine); padding: 0;
}
.rund svg { width: 20px; height: 20px; }
.rund.an { background: var(--aubergine); border-color: var(--aubergine); color: var(--weiss); }
.rund.dreht svg { animation: drehen 0.8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

svg.strich { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hinweis { font-size: 13px; color: var(--grau); display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hinweis .punkt { width: 8px; height: 8px; border-radius: 999px; background: var(--salbei); flex: none; }
.modus-hinweis {
  margin-top: 10px; font-size: 14px; color: var(--aubergine); font-weight: 600;
  background: var(--salbei-zart); border-radius: 12px; padding: 10px 14px;
}

/* Eingabe */
.eingabe {
  margin-top: 18px; display: flex; align-items: center; gap: 10px; height: 52px;
  padding: 0 6px 0 14px; background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px;
}
.eingabe:focus-within { border: 2px solid var(--aubergine); padding-left: 13px; }
.eingabe > svg { width: 22px; height: 22px; flex: none; color: var(--aubergine); }
.eingabe input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 17px; height: 100%;
}
.eingabe input::placeholder { color: var(--grau); opacity: 1; }
.leeren {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--linie);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
}
.leeren svg { width: 18px; height: 18px; }

/* Abteilungen und Kacheln */
.gruppe { margin-top: 22px; }
.gruppe-titel {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: var(--grau); margin: 0 0 8px;
}
.kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) {
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
}
.kachel {
  position: relative; aspect-ratio: 1; min-width: 0; min-height: 96px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 18px; padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  text-align: left; color: var(--tinte);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: transform 0.08s ease;
}
.kachel:active { transform: scale(0.97); }
.kachel svg.icon { width: 26px; height: 26px; color: var(--aubergine); flex: none; }
.kachel-text { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; }
.kachel-name {
  font-size: 15px; font-weight: 600; line-height: 1.2; hyphens: auto; -webkit-hyphens: auto;
  overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Lange Wörter (ab 11 Zeichen) etwas kleiner, damit sie seltener getrennt werden müssen. */
.kachel.lang .kachel-name { font-size: 13.5px; }
.kachel-zusatz {
  font-size: 12px; line-height: 1.25; color: var(--grau);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kachel.erledigt { background: var(--erledigt); border-color: transparent; color: var(--grau); }
.kachel.erledigt svg.icon { color: var(--grau); }
.kachel.drauf { background: var(--salbei-zart); border-color: transparent; }
.kachel .haken {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 999px;
  background: var(--aubergine); color: var(--weiss); display: flex; align-items: center; justify-content: center;
}
.kachel .haken svg { width: 14px; height: 14px; stroke-width: 3; }
.kachel.frei { background: transparent; border: 2px dashed var(--linie-stark); }
.kachel.frei svg.icon { color: var(--aubergine); }
.such-hinweis { font-size: 13px; color: var(--grau); margin-top: 12px; }

.leer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0 20px; }
.leer .kreis {
  width: 72px; height: 72px; border-radius: 999px; border: 3px solid var(--aubergine);
  display: flex; align-items: center; justify-content: center; color: var(--aubergine);
}
.leer .kreis svg { width: 36px; height: 36px; stroke-width: 2.4; }
.leer-text { font-family: var(--titel); font-size: 26px; font-weight: 700; }
.laden { color: var(--grau); padding: 40px 0; text-align: center; }

.fuss {
  margin-top: 36px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--grau);
}
.fuss a { color: var(--grau); }

/* Hinweis unten mit Rückgängig */
.toast {
  position: fixed; z-index: 30;
  left: calc(env(safe-area-inset-left) + var(--rand)); right: calc(env(safe-area-inset-right) + var(--rand));
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  max-width: 520px; margin: 0 auto; min-height: 52px; padding: 4px 6px 4px 18px; border-radius: 16px;
  background: var(--tinte); color: var(--weiss); display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.toast button {
  background: none; border: 0; color: var(--salbei-hell); font-weight: 700; min-height: 44px; padding: 0 12px; flex: none;
}

/* Blätter von unten und Dialoge */
.abdunkeln { position: fixed; inset: 0; background: var(--abdunkeln); z-index: 40; }
.blatt {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  background: var(--weiss); border-radius: 22px 22px 0 0; max-height: 90dvh; overflow-y: auto;
  padding: 10px calc(env(safe-area-inset-right) + var(--rand)) calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + var(--rand));
  display: flex; flex-direction: column; gap: 14px;
}
.griff { width: 40px; height: 5px; border-radius: 999px; background: var(--linie); align-self: center; flex: none; }
.blatt-titel { font-family: var(--titel); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px; margin: 0; }
.blatt-titel svg.icon { width: 28px; height: 28px; color: var(--aubergine); }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld label, .feld .bez { font-size: 13px; font-weight: 600; color: var(--grau); }
.feld input, .feld select {
  height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--linie);
  background: var(--grund); font-size: 17px; width: 100%;
}
.feld input:focus, .feld select:focus { outline: 2px solid var(--aubergine); outline-offset: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linie);
  background: var(--weiss); font-size: 14px; font-weight: 500;
}
.chip.an { background: var(--aubergine); border-color: var(--aubergine); color: var(--weiss); font-weight: 700; }
.meta { font-size: 13px; color: var(--grau); }
.knopfreihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.knopf {
  min-height: 52px; border-radius: 14px; border: 1px solid var(--linie); background: var(--weiss);
  font-size: 16px; font-weight: 600; padding: 0 16px; color: var(--tinte);
}
.knopf.haupt { background: var(--aubergine); border-color: var(--aubergine); color: var(--weiss); font-weight: 700; }
.knopf.gefahr { color: var(--fehler); }
.knopf:disabled { background: var(--linie); border-color: var(--linie); color: var(--grau); cursor: default; }


.dialog-huelle { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--rand); background: var(--abdunkeln); }
.dialog {
  background: var(--weiss); border-radius: 18px; padding: 22px; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.dialog h2 { font-family: var(--titel); font-size: 22px; margin: 0; }
.dialog p { margin: 0; color: var(--grau); }
.dialog .knopf { min-height: 50px; }

/* Listen verwalten und Einstellungen */
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--aubergine); font-weight: 600; text-decoration: none; }
.zurueck svg { width: 20px; height: 20px; }
.abschnitt { margin-top: 28px; }
.abschnitt h2 { font-family: var(--titel); font-size: 22px; margin: 0 0 12px; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.karten { display: flex; flex-direction: column; gap: 12px; }
.karte-kopf { display: flex; align-items: center; gap: 10px; }
.karte-name { flex: 1; min-width: 0; font-family: var(--titel); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.pfeile { display: flex; gap: 6px; flex: none; }
.pfeil {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--linie); background: var(--weiss);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--aubergine);
}
.pfeil svg { width: 20px; height: 20px; }
.pfeil:disabled { color: var(--linie-stark); cursor: default; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.aktionen .knopf { min-height: 44px; font-size: 15px; }
.abt-liste { display: flex; flex-direction: column; gap: 6px; }
.abt-zeile { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 2px 0; }
.abt-zeile svg.icon { width: 24px; height: 24px; color: var(--aubergine); flex: none; }
.abt-zeile span { flex: 1; min-width: 0; font-size: 15px; }
.wahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wahl .knopf.an { background: var(--aubergine); border-color: var(--aubergine); color: var(--weiss); }
.eigen-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--linie); }
.eigen-zeile:first-child { border-top: 0; }
.eigen-zeile .name { flex: 1 1 140px; font-weight: 600; overflow-wrap: anywhere; }
.eigen-zeile select { flex: 1 1 180px; height: 44px; border-radius: 12px; border: 1px solid var(--linie); background: var(--grund); padding: 0 10px; }
.eigen-zeile .knopf { min-height: 44px; }
.leise { color: var(--grau); }
.version { margin-top: 28px; font-size: 13px; color: var(--grau); }

/* Wer bist du? */
.wer { position: fixed; inset: 0; z-index: 60; background: var(--grund); overflow-y: auto; }
.wer .seite { padding-top: calc(env(safe-area-inset-top) + 96px); display: flex; flex-direction: column; gap: 28px; }
.wer h1 { font-family: var(--titel); font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; margin: 8px 0; }
.wer p { margin: 0; color: var(--grau); font-size: 16px; }
.wer-knoepfe { display: flex; flex-direction: column; gap: 14px; }
.wer-knopf {
  height: 96px; border-radius: 18px; border: 0; background: var(--aubergine); color: var(--weiss);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; text-align: left;
}
.wer-knopf .initiale {
  width: 52px; height: 52px; border-radius: 999px; background: rgba(255, 255, 255, 0.16);
  display: flex; align-items: center; justify-content: center; font-family: var(--titel); font-size: 24px; font-weight: 700;
}
.wer-knopf .wer-name { font-family: var(--titel); font-size: 26px; font-weight: 700; }

/* Anmeldung */
.anmeldung { min-height: 100dvh; display: flex; flex-direction: column; padding-top: calc(env(safe-area-inset-top) + 72px); }
.anmeldung .marke { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.anmeldung .app-icon { width: 88px; height: 88px; border-radius: 20px; display: block; }
.anmeldung .marke-text { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.anmeldung .oberzeile { font-size: 12px; letter-spacing: 0.2em; }
.anmeldung h1 { font-family: var(--titel); font-size: 48px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin: 0; }
.anmeldung form { display: flex; flex-direction: column; gap: 12px; margin-top: 48px; }
.anmeldung .feld input { background: var(--weiss); }
.anmeldung .feld input.falsch { border-color: var(--fehler); }
.anmeldung .feld input.falsch:focus { outline-color: var(--fehler); }
.meldung { font-size: 14px; color: var(--fehler); min-height: 0; }
.anmeldung .knopf { margin-top: 4px; font-size: 17px; }
.anmeldung .unten { margin-top: auto; padding-top: 40px; text-align: center; font-size: 14px; }
.anmeldung .unten a { color: var(--grau); }

/* Impressum */
.impressum h1 { font-family: var(--titel); font-size: 36px; margin: 8px 0 20px; letter-spacing: -0.02em; }
.impressum h2 { font-family: var(--titel); font-size: 20px; margin: 26px 0 8px; }
.impressum p { margin: 0 0 10px; }

/* Am Computer mit Maus: Inhalt breiter, alles umbrechend statt wischend */
@media (hover: hover) and (pointer: fine) {
  .kachel:hover { border-color: var(--linie-stark); }
  .chip:hover, .knopf:hover:not(:disabled), .pfeil:hover:not(:disabled), .rund:hover { border-color: var(--linie-stark); }
}
