/* ==========================================================================
   Visionboard - Design "Postkarte & Archiv"

   Ein Reisealbum, kein Formular: Fuellertinte auf gealtertem Papier, Etiketten
   wie getippt, gestrichelte Linien wie die Perforation eines Briefmarkenbogens.
   Karten liegen auf der Seite wie eingeklebte Fotos - klare Kante, kaum Rundung.

   Farbe bedeutet etwas und wird sparsam ausgegeben:
     Stempelblau  das Aktive - Knoepfe, Straehnen, Fortschritt
     Stempelrot   das Dringende - ueberfaellig, Warnung
     Olivgruen    das Erledigte

   Alle Farben, Radien und Groessen stehen hier oben als Variablen. Wer das
   Aussehen aendern will, aendert sie hier - nicht in den Bausteinen.
   ========================================================================== */

:root {
  /* Farben */
  --ink: #1f2d4a;            /* Fuellertinte: Text, dunkle Flaechen */
  --ink-80: rgba(31, 45, 74, 0.8);
  --ink-60: rgba(31, 45, 74, 0.6);
  --ink-45: rgba(31, 45, 74, 0.45);
  --ink-30: rgba(31, 45, 74, 0.3);
  --ink-12: rgba(31, 45, 74, 0.16);
  --ink-07: rgba(31, 45, 74, 0.1);
  --ink-04: rgba(31, 45, 74, 0.05);

  --papier: #ede7da;         /* gealtertes Papier - der Albumbogen */
  --karte: #fbf8f1;          /* das eingeklebte Blatt, eine Spur heller */
  --hell: #ffffff;

  --akzent: #2b4c7e;         /* Stempelblau - das Aktive */
  --akzent-satt: #1d3a66;
  --akzent-weich: #e2e8f2;
  --akzent-rand: #c3d0e4;

  --gut: #4a6b3a;            /* Olivgruen: erledigt */
  --gut-weich: #e6ecdd;
  --warn: #b23a2f;           /* verblasstes Stempelrot: ueberfaellig */
  --warn-weich: #f6e3df;

  /* Prioritaeten */
  --prio-1: #b23a2f;
  --prio-2: #b08234;
  --prio-3: #8d97a8;

  /* Radien - Kante statt Rundung. Ein eingeklebtes Foto hat keine Pille. */
  --r-pill: 3px;
  --r-lg: 5px;
  --r-md: 4px;
  --r-sm: 3px;

  /* Schatten liegen flach und knapp - das Blatt liegt auf, es schwebt nicht. */
  --schatten: 0 1px 0 rgba(31, 45, 74, 0.05), 0 1px 3px rgba(31, 45, 74, 0.07);
  --schatten-tief: 0 2px 4px rgba(31, 45, 74, 0.1), 0 8px 22px rgba(31, 45, 74, 0.14);

  /* Schriften */
  --schrift-titel: Bitter, Georgia, "Times New Roman", serif;
  --schrift-text: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --schrift-tipp: "Courier Prime", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --spalte: 520px;           /* Breite der Inhaltsspalte auf grossen Bildschirmen */
  --nav-h: 112px;            /* Platz, den die schwebende Leiste unten braucht */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--schrift-text);
  color: var(--ink);
  /* Eine sehr feine Koernung ueber dem Papier. Sie ist kaum zu sehen und genau
     deshalb richtig: Sie nimmt der Flaeche das Digitale, ohne sich vorzudraengen. */
  background-color: var(--papier);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.45;
}

/* Auf dem Handy fuellt die App den Bildschirm, auf dem Rechner steht sie als
   ruhige Spalte in der Mitte. */
.page {
  width: 100%;
  max-width: var(--spalte);
  margin: 0 auto;
  /* Der untere Rand haelt die schwebende Leiste frei. Auf Handys mit
     Home-Indikator sitzt sie um dessen Hoehe weiter oben - ohne den Zuschlag
     verschwindet das letzte Element hinter ihr. */
  padding: 24px 18px calc(var(--nav-h) + env(safe-area-inset-bottom));
  position: relative;
}

@media (max-width: 359px) {
  .page { padding-left: 14px; padding-right: 14px; }
}
@media (min-width: 600px) {
  .page { padding-top: 40px; }
}

/* --------------------------------------------------------------------------
   Typografie
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  margin: 0;
  font-family: var(--schrift-titel);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.h1 { font-size: 29px; line-height: 1.15; letter-spacing: -0.015em; }
.h2 { font-size: 19px; line-height: 1.25; }
.h3 { font-size: 15px; line-height: 1.3; }

.lead { margin: 6px 0 20px; font-size: 14px; color: var(--ink-60); }
/* Das Etikett eines Abschnitts - wie mit der Schreibmaschine auf einen
   Kofferanhaenger getippt. */
.eyebrow {
  font-family: var(--schrift-tipp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--akzent);
}
.muted { color: var(--ink-60); }

a { color: var(--akzent-satt); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.tnum { font-family: var(--schrift-tipp); font-variant-numeric: tabular-nums; }
.stark { font-weight: 600; }

.kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.kopf .h1 { flex: 1; min-width: 0; }

.abschnitt { margin-top: 26px; }
.abschnitt-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Flaechen
   -------------------------------------------------------------------------- */
.karte {
  background: var(--karte);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-lg);
  box-shadow: var(--schatten);
  padding: 16px;
}
.karte + .karte { margin-top: 10px; }

.karte-dunkel {
  background: var(--ink);
  color: #f4f3f0;
  border: none;
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--schatten-tief);
}
.karte-dunkel .eyebrow,
.karte-dunkel .muted { color: rgba(244, 243, 240, 0.62); }

.karte-flach {
  background: var(--ink-04);
  border-radius: var(--r-md);
  padding: 14px;
}

.stack { display: flex; flex-direction: column; gap: 8px; }
.reihe { display: flex; align-items: center; gap: 10px; }
.reihe-verteilt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wachs { flex: 1; min-width: 0; }
.abschneiden { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Knoepfe
   -------------------------------------------------------------------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 11px 18px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.06s ease, background 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-primary { background: var(--ink); color: var(--karte); }
.btn-primary:hover:not(:disabled) { background: #16223a; }

.btn-akzent { background: var(--akzent); color: var(--karte); }
.btn-akzent:hover:not(:disabled) { background: var(--akzent-satt); }

.btn-soft { background: var(--ink-07); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: var(--ink-12); }

.btn-rand { background: transparent; border-color: var(--ink-30); color: var(--ink); }
.btn-rand:hover:not(:disabled) { background: var(--ink-04); }

.btn-danger { background: var(--warn); color: #fff; }

.btn-block { width: 100%; }
.btn-klein { padding: 7px 13px; font-size: 13px; }

/* Runder Knopf fuer Symbole (Zurueck, Einstellungen) */
.icon-btn {
  appearance: none;
  border: 1px solid var(--ink-30);
  background: var(--karte);
  color: var(--ink);
  border-radius: var(--r-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--ink-04); }

/* --------------------------------------------------------------------------
   Umschalter (Privat / Arbeit / Alle)
   -------------------------------------------------------------------------- */
.segment {
  display: flex;
  gap: 4px;
  background: var(--ink-07);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 16px;
}
.segment button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-60);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--r-pill);
  flex: 1;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.segment button.aktiv {
  background: var(--karte);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(31, 45, 74, 0.14);
}

/* --------------------------------------------------------------------------
   Marken und Merkzeichen
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--ink-12);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  font-family: var(--schrift-tipp);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--ink-04);
  color: var(--ink-60);
  white-space: nowrap;
}
.pill-akzent { background: var(--akzent-weich); border-color: var(--akzent-rand); color: var(--akzent-satt); }
.pill-warn { background: var(--warn-weich); border-color: #e2bdb7; color: var(--warn); }
.pill-gut { background: var(--gut-weich); border-color: #c9d6b8; color: var(--gut); }
.pill-dunkel { background: var(--ink); border-color: var(--ink); color: var(--karte); }

.prio {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--prio-3);
}
.prio-1 { background: var(--prio-1); }
.prio-2 { background: var(--prio-2); }
.prio-3 { background: var(--prio-3); }

/* --------------------------------------------------------------------------
   Listen und Zeilen
   -------------------------------------------------------------------------- */
.liste {
  background: var(--karte);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-lg);
  box-shadow: var(--schatten);
  overflow: hidden;
}
.zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  /* Gestrichelt statt durchgezogen: die Perforation eines Markenbogens. */
  border-bottom: 1px dashed var(--ink-12);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.zeile:last-child { border-bottom: none; }
button.zeile { cursor: pointer; }
button.zeile:hover { background: var(--ink-04); }

.zeile-titel { font-weight: 500; }
.zeile-unten { font-size: 12.5px; color: var(--ink-60); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.zeile-rechts {
  flex: none;
  text-align: right;
  font-family: var(--schrift-tipp);
  font-size: 12px;
  color: var(--ink-60);
}

.erledigt .zeile-titel { text-decoration: line-through; color: var(--ink-45); }

/* Der runde Haken zum Abhaken */
.haken {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  border: 1.6px solid var(--ink-30);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.haken:hover { border-color: var(--ink-60); }
.haken.an {
  background: var(--gut);
  border-color: var(--gut);
  color: var(--karte);
}

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
.feld { margin-bottom: 14px; }
.feld > label {
  display: block;
  font-family: var(--schrift-tipp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--hell);
  border: 1px solid var(--ink-30);
  border-radius: var(--r-md);
  padding: 11px 13px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
select {
  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='%2316181c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px var(--akzent-weich);
}
input::placeholder, textarea::placeholder { color: var(--ink-30); }

.feld-zeile { display: flex; gap: 10px; }
.feld-zeile > * { flex: 1; min-width: 0; }

/* Auswahl als Kacheln (Priorität, Bereich, Art) */
.wahl { display: flex; gap: 8px; }
.wahl button {
  flex: 1;
  appearance: none;
  border: 1px solid var(--ink-12);
  background: var(--karte);
  border-radius: var(--r-md);
  padding: 10px 6px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-60);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.wahl button.aktiv {
  border-color: var(--akzent);
  background: var(--akzent);
  color: var(--karte);
}

/* --------------------------------------------------------------------------
   Wochenraster (Essensplan)
   -------------------------------------------------------------------------- */
.woche { display: flex; flex-direction: column; gap: 8px; }
.tag {
  background: var(--karte);
  border: 1px solid var(--ink-07);
  border-radius: var(--r-lg);
  box-shadow: var(--schatten);
  overflow: hidden;
}
.tag.ist-heute { border-color: var(--ink); }
.tag-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--ink-04);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-60);
}
.tag.ist-heute .tag-kopf { background: var(--ink); color: #fff; }
.mahlzeit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-top: 1px solid var(--ink-07);
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mahlzeit:hover { background: var(--ink-04); }
.mahlzeit-marke {
  flex: none;
  width: 46px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mahlzeit-leer { color: var(--ink-30); }

/* --------------------------------------------------------------------------
   Balken (Protein, Budget)
   -------------------------------------------------------------------------- */
.balken {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--ink-07);
  overflow: hidden;
  margin-top: 8px;
}
.balken > span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--akzent);
}
.karte-dunkel .balken { background: rgba(255, 255, 255, 0.18); }
.karte-dunkel .balken > span { background: #f0b48c; }

/* --------------------------------------------------------------------------
   Visionboard: Straehne, Zeitstrahl, Meilensteine
   -------------------------------------------------------------------------- */

/* Die Straehne einer Routine: ein Kaestchen je Zeitraum, das letzte ist der
   laufende. */
.straehne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.straehne-reihe { display: flex; gap: 4px; }
.straehne-feld {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid var(--ink-30);
  background: transparent;
}
.straehne-feld.an { background: var(--akzent); border-color: var(--akzent); }
/* Der laufende Zeitraum bekommt einen Ring, damit man sieht, worauf sich der
   Haken bezieht. */
.straehne-feld.jetzt { outline: 1.5px solid var(--ink-30); outline-offset: 2px; }
.straehne-text {
  font-family: var(--schrift-tipp);
  font-size: 11.5px;
  color: var(--ink-60);
  font-variant-numeric: tabular-nums;
}

/* Der Zeitstrahl des Rueckblicks */
.strahl { display: flex; flex-direction: column; }
.strahl-eintrag { display: flex; gap: 14px; }
.strahl-schiene { display: flex; flex-direction: column; align-items: center; width: 10px; flex: none; }
.strahl-punkt {
  width: 9px;
  height: 9px;
  border-radius: var(--r-sm);
  background: var(--akzent);
  transform: rotate(45deg);
  margin-top: 6px;
  flex: none;
}
/* Die Schiene ist gestrichelt - ein Weg, keine Leitung. */
.strahl-linie {
  width: 0;
  flex: 1;
  border-left: 1px dashed var(--ink-30);
  margin: 4px 0 0;
}
.strahl-eintrag:last-child .strahl-linie { display: none; }
.strahl-inhalt { min-width: 0; padding-bottom: 18px; flex: 1; }

/* Fortschritt der Meilensteine */
.ms-balken {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--ink-07);
  overflow: hidden;
  margin: 6px 0 8px;
}
.ms-balken > span { display: block; height: 100%; background: var(--akzent); border-radius: var(--r-pill); }
.ms-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ms-box {
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--ink-30);
  background: var(--karte);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}
.ms-zeile.an .ms-box { background: var(--gut); border-color: var(--gut); color: var(--karte); }
.ms-zeile.an .ms-titel { text-decoration: line-through; color: var(--ink-45); }
.ms-titel { font-size: 14px; color: var(--ink-80); min-width: 0; }

/* Kacheln auf der Board-Uebersicht */
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kachel {
  background: var(--karte);
  border: 1px solid var(--ink-12);
  /* Der farbige Streifen links ist das Register eines Albums - er macht die
     Kachel zu einem Reiter, hinter dem etwas liegt. */
  border-left: 3px solid var(--akzent-rand);
  border-radius: var(--r-md);
  box-shadow: var(--schatten);
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.kachel:hover { border-left-color: var(--akzent); background: var(--hell); }
.kachel-titel { font-family: var(--schrift-titel); font-weight: 600; font-size: 15px; }
.kachel-zahl { font-family: var(--schrift-tipp); font-size: 11.5px; color: var(--ink-60); margin-top: 1px; }

/* Kennzahlen oben auf der Uebersicht */
.zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.zahl {
  background: var(--karte);
  border: 1px dashed var(--ink-30);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.zahl-wert {
  font-family: var(--schrift-titel);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.zahl-label {
  font-family: var(--schrift-tipp);
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--ink-60);
  margin-top: 3px;
}
.zahl.warnend .zahl-wert { color: var(--warn); }

/* --------------------------------------------------------------------------
   Leere Zustaende und Hinweise
   -------------------------------------------------------------------------- */
.leer {
  text-align: center;
  padding: 28px 20px;
  color: var(--ink-45);
  font-size: 14px;
}
.hinweis {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--akzent-weich);
  border: 1px dashed var(--akzent-rand);
  color: var(--akzent-satt);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.hinweis svg { flex: none; margin-top: 1px; }
.hinweis-grau {
  background: var(--ink-04);
  border-color: var(--ink-07);
  color: var(--ink-60);
}

/* --------------------------------------------------------------------------
   Untere Leiste
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-md);
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--ink-30);
  box-shadow: var(--schatten-tief);
  max-width: calc(100vw - 24px);
}
.nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-45);
  border-radius: var(--r-pill);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: var(--akzent-satt); background: var(--akzent-weich); }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.nav-add {
  appearance: none;
  border: none;
  margin-left: 4px;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--akzent);
  color: var(--karte);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  box-shadow: 0 3px 10px rgba(43, 76, 126, 0.34);
  -webkit-tap-highlight-color: transparent;
}
.nav-add:active { transform: scale(0.95); }

@media (max-width: 380px) {
  .nav-item { padding: 8px 9px; }
  .nav-label { font-size: 10px; }
}

/* --------------------------------------------------------------------------
   Blatt von unten und Meldungen
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(31, 45, 74, 0.34);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: einblenden 0.16s ease;
}
.sheet {
  width: 100%;
  max-width: var(--spalte);
  background: var(--papier);
  border-top: 1px solid var(--ink-30);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: hochschieben 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border: 1px solid var(--ink-30); border-radius: var(--r-lg); max-height: 80vh; }
}
@keyframes einblenden { from { opacity: 0; } }
@keyframes hochschieben { from { transform: translateY(24px); } }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 8px);
  z-index: 80;
  background: var(--ink);
  color: var(--karte);
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  box-shadow: var(--schatten-tief);
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: hochschieben 0.2s ease;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 60px auto;
  border-radius: 50%;
  border: 2.5px solid var(--ink-12);
  border-top-color: var(--ink);
  animation: drehen 0.7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Anmeldung
   -------------------------------------------------------------------------- */
.anmelden {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}
/* Die Marke oben auf der Anmeldeseite ist eine Briefmarke: heller Bogen,
   gezackter Rand, der Kompass in Stempelblau.

   Der Zackenrand sind Kreise in Papierfarbe, die auf allen vier Kanten halb
   ueber den Rand hinausragen und so in das Weiss hineinbeissen. Papierfarbe,
   nicht "transparent": Die Marke hat selbst eine weisse Grundfarbe, gegen die
   ein Loch nichts ausrichtet. */
.marke {
  width: 54px;
  height: 54px;
  border-radius: 1px;
  background-color: var(--hell);
  color: var(--akzent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  --zacke: radial-gradient(circle at center, var(--papier) 2.6px, transparent 2.7px);
  background-image: var(--zacke), var(--zacke), var(--zacke), var(--zacke);
  background-size: 9px 9px;
  background-position: 0 -4.5px, 0 calc(100% + 4.5px), -4.5px 0, calc(100% + 4.5px) 0;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

.alert {
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.alert-error { background: var(--warn-weich); color: var(--warn); }
.alert-ok { background: var(--gut-weich); color: var(--gut); }

/* Bewegungsarme Darstellung respektieren */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
