/* =====================================================================
   TEAM THEKE — Mitgliederbereich
   Hell & nüchtern (Brief §12). MOBILE-FIRST: Basis = iPhone,
   Media Queries erweitern nach oben (iPad, Desktop).
   ===================================================================== */

:root {
  --gold:        #A9821F;   /* Gold auf Hell abgedunkelt */
  --gold-soft:   #F0E6CE;
  --ink:         #1A1714;
  --ink-soft:    #6B665D;
  --line:        #E3E0D9;
  --bg:          #F7F6F3;
  --panel:       #FFFFFF;
  --ok:          #3F7D46;
  --err:         #B4402F;
  --err-bg:      #FDECE8;
  --info-bg:     #EFF3F7;
  --radius:      12px;
  --tap:         44px;      /* Mindest-Touchziel */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  /* Safe-Area für iPhone-Notch / Home-Indicator */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ------------------------------------------------------------------ */
/*  Typo                                                               */
/* ------------------------------------------------------------------ */

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--gold); }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: .35rem;
}

.muted { color: var(--ink-soft); font-size: .9rem; }

/* Goldene Hairline — Markenzeichen "Thekenkante" */
.rule {
  height: 1px;
  background: var(--gold);
  border: 0;
  width: 44px;
  margin: .75rem 0 1.25rem;
  opacity: .75;
}

/* ------------------------------------------------------------------ */
/*  Layout                                                             */
/* ------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* Zentrierte Karte (Login / Passwort setzen) */
.center-screen {
  min-height: 100vh;
  min-height: 100dvh;          /* verhindert Springen durch Safari-Adressleiste */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
}

/* ------------------------------------------------------------------ */
/*  Kopfzeile Portal                                                   */
/* ------------------------------------------------------------------ */

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .82rem;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--gold); }

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

/* Rollen-Chip */
.chip {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  white-space: nowrap;
}

/* Navigation — mobil horizontal scrollbar statt Hamburger-Menü */
.nav {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  padding: 0 .5rem;
  max-width: 1080px;
  margin: 0 auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 .7rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

/* ------------------------------------------------------------------ */
/*  Formulare — iOS-tauglich                                           */
/* ------------------------------------------------------------------ */

.field { margin-bottom: 1rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  /* 16px verhindert das Auto-Zoom von iOS-Safari beim Fokussieren */
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
  min-height: var(--tap);
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

/* Checkbox mit ausreichend großem Tap-Bereich */
.check {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .88rem;
  line-height: 1.5;
  min-height: var(--tap);
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: .15rem 0 0;
  accent-color: var(--gold);
  flex: 0 0 auto;
}
.check span { font-weight: 400; }

/* ------------------------------------------------------------------ */
/*  Buttons — immer mind. 44px hoch                                    */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: .7rem 1.15rem;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .04em;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:active { background: #8F6D19; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:active { background: #EFEDE8; }

.btn-block { width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
  min-height: var(--tap);
  padding: 0 .25rem;
}

/* ------------------------------------------------------------------ */
/*  Hinweise / Flash                                                   */
/* ------------------------------------------------------------------ */

.alert {
  border-radius: 10px;
  padding: .75rem .9rem;
  font-size: .88rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error   { background: var(--err-bg); color: var(--err); border-color: #F3C9C0; }
.alert-info    { background: var(--info-bg); color: #2C4C66; border-color: #D5E0EA; }
.alert-success { background: #EAF4EB; color: var(--ok); border-color: #C9E2CC; }

/* ------------------------------------------------------------------ */
/*  Karten-Listen statt breiter Tabellen (mobil bedienbar)             */
/* ------------------------------------------------------------------ */

.stack { display: grid; gap: .75rem; }

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem;
}

.tile h3 { font-size: 1rem; margin-bottom: .15rem; }

/* ------------------------------------------------------------------ */
/*  Seitenkopf mit Aktion                                              */
/* ------------------------------------------------------------------ */

.page-head {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.page-head .btn { width: 100%; }

/* ------------------------------------------------------------------ */
/*  Personen-Karten (statt breiter Tabelle — mobil bedienbar)          */
/* ------------------------------------------------------------------ */

.person {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}
.person.is-inaktiv { opacity: .6; }

.avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  border: 1px solid var(--line);
}

.person-body { flex: 1 1 auto; min-width: 0; }
.person-name { font-weight: 700; }
.person-meta {
  font-size: .82rem; color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* Klarname neben dem Anzeigenamen — bewusst exakt wie .person-meta gesetzt,
   nur inline. Er soll die Zeile ergänzen, nicht mit ihr konkurrieren. */
.person-klarname {
  font-weight: 400;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-left: .4rem;
  white-space: nowrap;   /* „Sebastian J.“ bleibt zusammen, auch auf dem Handy */
}

/* Skill-Plaketten */
.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.badge {
  font-size: .72rem; font-weight: 600;
  padding: .18rem .5rem; border-radius: 999px;
  background: #EFEDE8; color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge-ok      { background: var(--gold-soft); color: var(--gold); border-color: #E4D3A9; }
.badge-warten  { background: #FFF6E3; color: #8A6A15; border-color: #F0DCB0; }
.badge-inaktiv { background: #EFEDE8; color: var(--ink-soft); }
.badge-fehlt   { background: var(--err-bg); color: var(--err); border-color: #F3C9C0; }

/* Zeile mit Skill + Aktion */
.skill-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.skill-row:last-of-type { border-bottom: none; }
.skill-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/*  Formular-Abschnitte                                                */
/* ------------------------------------------------------------------ */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1rem;
  margin-bottom: 1rem;
}
.panel > h2 {
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .9rem;
}

.form-grid { display: grid; gap: 0; }

.actions {
  display: flex; flex-direction: column; gap: .6rem;
  margin-top: 1.25rem;
}

.danger-zone { border-color: #F0D2CB; }
.danger-zone > h2 { color: var(--err); }
.btn-danger { background: var(--err); color: #fff; }

.empty {
  text-align: center; padding: 2rem 1rem;
  color: var(--ink-soft); font-size: .9rem;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ------------------------------------------------------------------ */
/*  Übersicht                                                          */
/* ------------------------------------------------------------------ */

.dash-kopf { margin-bottom: 1.75rem; }
.dash-kopf h1 { margin: 0 0 .1rem; }
.dash-kopf p { margin: 0; font-size: .9rem; }

.zone { margin-bottom: 2rem; }
.zone-kopf { display: flex; align-items: center; gap: 1rem; margin-bottom: .7rem; }
.zone-kopf .zone-titel { margin-bottom: 0; }
.zone-kopf .btn { margin-left: auto; }

.zone-titel {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin: 0 0 .7rem;
}

/* Ruhezustand — wenn nichts zu tun ist, soll das auch so aussehen */
.ruhe {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; font-size: .92rem;
}
.ruhe strong { display: block; margin-bottom: .15rem; }
.ruhe span { color: var(--ink-soft); font-size: .88rem; }

/* Aufgabenliste */
.aufgaben {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}

.aufgabe {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; min-height: var(--tap);
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.aufgabe:last-child { border-bottom: 0; }
.aufgabe:hover { background: #FAF9F6; }
.aufgabe:active { background: #F2F0EB; }

.aufgabe-zahl {
  flex: 0 0 auto; min-width: 30px; height: 30px; padding: 0 .4rem;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums;
  background: var(--gold-soft); color: var(--gold);
}
.aufgabe-zahl.dringend { background: var(--err-bg); color: var(--err); }
.aufgabe-zahl.leise { background: #EFEDE8; color: var(--ink-soft); }

.aufgabe-text { flex: 1; min-width: 0; }
.aufgabe-was { display: block; font-size: .92rem; line-height: 1.35; }
.aufgabe-wann { display: block; font-size: .78rem; color: var(--ink-soft); }
.aufgabe-pfeil { flex: 0 0 auto; color: var(--ink-faint, #9A958B); font-size: 1.2rem; line-height: 1; }

/* Veranstaltungsliste */
.ev-liste { display: grid; gap: .6rem; }

.ev-zeile {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem;
  text-decoration: none; color: var(--ink);
}
.ev-zeile:hover { border-color: var(--gold); }

.ev-kopf { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.ev-titel { font-weight: 700; font-size: 1rem; }
.ev-meta { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: .15rem; }
.ev-meta strong { color: var(--ink); font-weight: 600; }

.ev-einsatz {
  display: block; font-size: .82rem; color: var(--gold);
  margin-top: .35rem; font-weight: 600;
}

.ev-stand { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; }
.ev-stand .balken { flex: 1; }
.ev-zahl {
  font-size: .82rem; font-weight: 700; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ev-zahl.voll { color: var(--ok); }

.mehr {
  display: inline-block; margin-top: .7rem;
  font-size: .85rem; font-weight: 600; color: var(--gold); text-decoration: none;
  min-height: var(--tap); display: inline-flex; align-items: center;
}

/* Ruhige Navigation */
.quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick a {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 0 .85rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink-soft);
  font-size: .85rem; text-decoration: none;
}
.quick a:hover { border-color: var(--gold); color: var(--gold); }

@media (min-width: 768px) {
  .ev-liste { grid-template-columns: 1fr 1fr; }
  .zone { margin-bottom: 2.5rem; }
}

/* ------------------------------------------------------------------ */
/*  Besetzung: Bereich → Position → Leute                              */
/* ------------------------------------------------------------------ */

.fortschritt { display: flex; align-items: center; gap: .7rem; }
.balken { flex: 1; height: 7px; background: #EFEDE8; border-radius: 4px; overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--gold); transition: width .3s ease; }
.fortschritt-zahl { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bereich-kopf { display: flex; align-items: baseline; gap: .5rem; }
.bereich-name { font-weight: 700; font-size: 1.05rem; }
.bereich-zahl {
  margin-left: auto; font-size: .85rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.position { border-top: 1px solid var(--line); padding: .85rem 0; }
.position:first-of-type { margin-top: .7rem; }
.position-kopf { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .55rem; }
.position-name { font-weight: 700; font-size: .98rem; }
.position-zeit { font-size: .85rem; color: var(--ink-soft); }

.stand {
  margin-left: auto; font-size: .72rem; font-weight: 700;
  padding: .18rem .5rem; border-radius: 999px; white-space: nowrap;
}
.stand.offen { background: #FFF6E3; color: #8A6A15; border: 1px solid #F0DCB0; }
.stand.voll { background: #EAF4EB; color: var(--ok); border: 1px solid #C9E2CC; }

.leute { display: flex; flex-wrap: wrap; gap: .4rem; }

.person {
  font-family: inherit; font-size: .88rem; padding: .42rem .7rem;
  border-radius: 8px; border: 1px solid var(--line); background: #F4F2ED;
  color: var(--ink); cursor: pointer; min-height: 38px;
  display: inline-flex; align-items: center; gap: .3rem;
}
.person.best { background: #EAF4EB; border-color: #C9E2CC; color: var(--ok); }
.person .haken { font-size: .75rem; }

.plus {
  font-family: inherit; font-size: .88rem; font-weight: 700;
  padding: .42rem .8rem; border-radius: 8px;
  border: 1px dashed var(--gold); background: transparent; color: var(--gold);
  cursor: pointer; min-height: 38px;
}
.plus:active { background: var(--gold-soft); }

.pool-chip {
  font-size: .85rem; background: #F4F2ED; border: 1px solid var(--line);
  padding: .4rem .7rem; border-radius: 8px;
  display: inline-flex; gap: .35rem; align-items: center;
}
.pool-chip small { color: var(--ink-soft); }

.zufuegen {
  font-family: inherit; font-size: .88rem; font-weight: 600; color: var(--gold);
  background: transparent; border: 0; padding: .6rem 0; cursor: pointer;
  min-height: var(--tap); text-align: left; width: 100%;
}
.zufuegen.rahmen {
  border: 1px dashed var(--line); border-radius: var(--radius);
  text-align: center; margin-bottom: .85rem; background: var(--panel);
}
.bereich-fuss { border-top: 1px solid var(--line); margin-top: .2rem; }

/* Rückfrage-Panel (Serverweg ohne JavaScript) */
.panel-frage { border-color: #F0DCB0; background: #FFFDF7; }
.panel-frage h2 { color: #8A6A15; }

/* Ersatz-Formulare, wenn kein JavaScript läuft */
.fallback { display: none; }

/* ------------------------------------------------------------------ */
/*  Blatt von unten (Auswahl)                                          */
/* ------------------------------------------------------------------ */

.schatten {
  position: fixed; inset: 0; background: rgba(20,17,14,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 40;
}
.schatten.auf { opacity: 1; pointer-events: auto; }

.blatt {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--panel); border-radius: 16px 16px 0 0;
  padding: 1.1rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease;
  max-height: 82vh; max-height: 82dvh; overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,.16);
}
.blatt.auf { transform: translateY(0); }
.blatt h2 { font-size: 1.05rem; margin: 0 0 .1rem; outline: none; }
.blatt .unter { font-size: .85rem; color: var(--ink-soft); margin: 0 0 .9rem; }

.griff { width: 38px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto .9rem; }

.gruppe {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint, #9A958B); font-weight: 700; margin: 1rem 0 .4rem;
}

.zeile {
  width: 100%; display: flex; align-items: center; gap: .7rem; text-align: left;
  font-family: inherit; font-size: .95rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: .7rem .2rem; min-height: 52px; cursor: pointer;
}
.zeile:active { background: #F4F2ED; }
.zeile:last-of-type { border-bottom: 0; }
.zeile.belegt .zeile-name { color: var(--ink-soft); }
.zeile.belegt .zeile-info { color: var(--gold); }
.zeile.konflikt .zeile-info { color: var(--err); font-weight: 600; }

.kann {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; font-size: .7rem;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.kann.ja { background: #EAF4EB; color: var(--ok); border: 1px solid #C9E2CC; }
.kann.nein { background: #F1EFEA; color: var(--ink-soft); border: 1px dashed #CFCBC2; }

.zeile-text { flex: 1; min-width: 0; }
.zeile-name { font-weight: 600; line-height: 1.3; display: block; }
.zeile-info { font-size: .78rem; color: var(--ink-soft); display: block; }
.zeile-zahl {
  font-size: .78rem; color: var(--ink-soft); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.legende {
  font-size: .78rem; color: var(--ink-soft);
  display: flex; gap: .9rem; align-items: center; flex-wrap: wrap;
  padding: .5rem 0 .2rem;
}
.legende span { display: inline-flex; align-items: center; gap: .35rem; }

.warnung {
  background: #FFF6E3; border: 1px solid #F0DCB0; border-radius: 10px;
  padding: .85rem; margin: .6rem 0 .75rem;
}
.warnung p { margin: 0 0 .6rem; font-size: .9rem; color: #8A6A15; }
.warnung p:last-of-type { margin-bottom: .8rem; }

/* Rot, wenn es an die 70-Tage-Grenze geht */
.warnung-rot { background: var(--err-bg); border-color: #F3C9C0; }
.warnung-rot p { color: var(--err); }
.warn-rot { color: var(--err) !important; font-weight: 600; }

/* Tage-Zähler in der Auswahlliste */
.zeile-zahl.zahl-gelb { color: #8A6A15; font-weight: 700; }
.zeile-zahl.zahl-rot  { color: var(--err); font-weight: 700; }

/* Aufklappbare Formulare — ohne JavaScript, tap-freundlich */
details > summary {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: .25rem; }

/* Eckdaten-Zeilen dürfen auf schmalen Screens umbrechen */
.skill-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Rechtstexte am Fuß jeder Portalseite — dezent, aber mit tap-tauglichen Zielen */
.portal-fuss {
  text-align: center;
  font-size: .8rem;
  padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom));
  color: var(--ink-soft);
}
.portal-fuss a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);   /* auch die Fußzeile bleibt mit dem Daumen treffbar */
  padding: 0 .5rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.portal-fuss a:hover { color: var(--gold); text-decoration: underline; }
.portal-fuss span { opacity: .5; }

/* ------------------------------------------------------------------ */
/*  Cocktailbuch                                                       */
/* ------------------------------------------------------------------ */

.cocktail-suche { margin-bottom: 1rem; }

/* Filterleiste — waagerecht scrollbar, damit sie auf dem Handy nicht
   in vier Reihen umbricht */
.filter-reihe {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: .5rem;
  margin-bottom: 1.25rem;
}
.filter-reihe::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
}
.filter-chip.is-an {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 700;
}

/* Zutatenzeile im Formular.
   Auf dem Handy zweizeilig: Menge und Einheit oben, die Zutat darunter über
   die volle Breite. Alles nebeneinander ließe fürs Wichtigste — den Namen —
   nur rund 120 px übrig, und "Holunderblütensirup" passt da nicht rein. */
.zutat-zeile {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .4rem;
  margin-bottom: .75rem;
}
.zutat-zeile input[name="zutat[]"] { grid-column: 1 / -1; }

@media (min-width: 480px) {
  /* Ab hier ist Platz für alles in einer Zeile */
  .zutat-zeile {
    grid-template-columns: 4.5rem 7rem 1fr;
    margin-bottom: .5rem;
  }
  .zutat-zeile input[name="zutat[]"] { grid-column: auto; }
}

/* Zutatenliste in der Ansicht — Mengen untereinander bündig */
.zutaten-liste { list-style: none; margin: 0; padding: 0; }
.zutaten-liste li {
  display: flex;
  gap: .7rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.zutaten-liste li:last-child { border-bottom: 0; }

.zutat-menge {
  flex: 0 0 5.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.zutat-name { flex: 1; min-width: 0; }

/* Zubereitung: Zeilenumbrüche des Textfelds bleiben erhalten */
.anleitung { margin: 0; line-height: 1.6; }

/* Nur für Screenreader — sichtbare Beschriftung wäre hier doppelt gemoppelt */
.visuell-versteckt {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Code-Eingabe beim zweiten Faktor — gut lesbar und mit Abstand,
   damit sich beim Abtippen vom Handy niemand verzählt */
.code-feld {
  font-size: 1.9rem !important;
  letter-spacing: .35em;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-left: .35em !important;   /* gleicht den Abstand hinter der letzten Ziffer aus */
}

/* ------------------------------------------------------------------ */
/*  Werkzeuge                                                          */
/* ------------------------------------------------------------------ */

.tool-kachel {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-decoration: none;
  color: var(--ink);
}
.tool-kachel:hover { border-color: var(--gold); }
.tool-kachel:active { background: #FAF9F6; }

.tool-name { display: block; font-weight: 700; font-size: 1.05rem; }
.tool-text { display: block; margin-top: .1rem; font-size: .85rem; color: var(--ink-soft); }

/* Schmale Zahlenfelder stehen auch auf dem Handy nebeneinander —
   ein einzelnes „2“ braucht keine volle Bildschirmbreite */
.zahlen-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 .75rem; }
@media (min-width: 480px) {
  .zahlen-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Ergebnis des Personalrechners — Bezeichnung links, Zahl rechts, sonst nichts */
.erg-panel { border-color: #E4D3A9; background: #FFFDF7; }

.erg-zeile,
.erg-summe,
.erg-vortag { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.erg-zeile { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.erg-zeile:last-child { border-bottom: 0; }

.erg-label { font-weight: 600; font-size: .95rem; }

.erg-zahl {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.erg-zahl.gross { font-size: 1.7rem; color: var(--gold); line-height: 1; }
.erg-zahl small { font-weight: 400; color: var(--ink-soft); }

.erg-summe { margin-top: .4rem; padding-top: .8rem; border-top: 2px solid var(--gold); }

.erg-vortag {
  margin-top: .9rem; padding-top: .7rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
}
.erg-vortag .erg-label { font-weight: 400; font-size: .85rem; }
.erg-vortag .erg-zahl { font-size: .95rem; }

/* ------------------------------------------------------------------ */
/*  Ab iPad aufwärts                                                   */
/* ------------------------------------------------------------------ */

@media (min-width: 768px) {
  h1 { font-size: 1.9rem; }
  .wrap { padding: 2rem 1.5rem 4rem; }
  .card { padding: 2.25rem 2rem; }
  .stack { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  .page-head {
    flex-direction: row; align-items: center; justify-content: space-between;
  }
  .page-head .btn { width: auto; }

  .panel { padding: 1.5rem; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
  .form-grid .full { grid-column: 1 / -1; }

  .actions { flex-direction: row; }
  .actions .btn { min-width: 160px; }
}

@media (min-width: 1024px) {
  .stack { grid-template-columns: repeat(3, 1fr); }
}

/* Wer Bewegung reduziert haben will, bekommt keine Übergänge */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
