/* ==========================================================================
   Producer's Friend – Basis
   Design-Tokens, Reset, Header/Navigation, Burgermenü, gemeinsame Bausteine
   ========================================================================== */

:root {
  /* Farben */
  --g: #91c23c;            /* Primärgrün */
  --g-dark: #4f8d25;       /* Grün für Text/Icons auf hellem Grund */
  --g-text: #477b17;
  --g-soft: #f2f7e9;       /* Grün-Hintergrund (aktiv, Hinweise) */
  --g-border: #dfecd1;
  --g-ring: rgba(145, 194, 60, .16);
  --ink: #44483a;          /* Haupttext */
  --ink-soft: #5f6257;     /* Navigation, Sekundärtext */
  --mut: #77786f;          /* gedämpfter Text */
  --line: #e8e6df;
  --bg: #fbfaf6;
  --white: #fffefa;
  --surface: #fafcfc;

  /* Maße */
  --header-h: 72px;
  --radius-sm: 9px;
  --radius: 11px;
  --radius-lg: 16px;
  --shadow: 0 12px 38px rgba(20, 41, 74, .18);
}

/* Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.42 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }

:focus-visible { outline: 2px solid var(--g-dark); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 35px;
  height: var(--header-h);
  padding: 0 3%;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.site-header__logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 280px;
}

.site-header__logo img {
  width: auto;
  height: auto;
  max-width: 245px;
  max-height: 58px;
  object-fit: contain;
}

/* Hilfe-Symbol vor dem Benutzer: öffnet die Hilfe zur aktuellen Seite */
.help-link {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: 50%;
  color: var(--ink-soft);
}
.help-link svg { width: 26px; height: 26px; }
.help-link:hover, .help-link[aria-current="page"] { background: var(--g-soft); color: var(--g-dark); }
.dispo:not([hidden]) + .help-link { margin-left: 0; }
.help-link + .site-header__user { margin-left: -25px; }   /* enger am Benutzer als die übrigen Abstände */

/* Hilfe-Text (partials/hilfe-inhalt.php): auf hilfe.php und in der Hilfe-Leiste */
.hilfe-text { line-height: 1.6; }
.hilfe__kopf { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hilfe__kopf-icon { flex: none; width: 54px; height: 42px; padding: 6px; border-radius: 12px; background: var(--g-soft); color: var(--g-dark); }
.hilfe__kopf h2 { margin: 0 0 4px; font-size: 22px; }
.hilfe__kopf p { margin: 0; color: var(--ink-soft); }
.hilfe__zur-seite { flex: none; margin-left: auto; white-space: nowrap; }

/* Inhaltsverzeichnis: zugeklappt eine Zeile, die oben stehen bleibt und den aktuellen Abschnitt zeigt (nav.js) */
.hilfe__toc { position: sticky; top: var(--header-h); z-index: 2; margin: 4px 0 6px; padding-top: 10px; background: var(--white); font-size: 14px; }   /* Innenabstand oben deckt den Text ab, der darunter durchscrollt */
.hilfe__toc summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink-soft); cursor: pointer; list-style: none; }
.hilfe__toc summary::-webkit-details-marker { display: none; }
.hilfe__toc summary:hover, .hilfe__toc[open] summary { border-color: var(--g); }
.hilfe__toc.is-stuck summary { box-shadow: 0 6px 16px rgba(68, 72, 58, .12); }
.hilfe__toc-icon { flex: none; width: 18px; height: 18px; color: var(--g-dark); }
.hilfe__toc-label { flex: none; color: var(--mut); font-weight: 700; }
.hilfe__toc-aktuell { flex: 1; min-width: 0; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hilfe__toc-chev { flex: none; width: 18px; height: 18px; color: var(--mut); transition: transform .15s; }
.hilfe__toc[open] .hilfe__toc-chev { transform: rotate(180deg); }
.hilfe__toc ol { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: min(60vh, 420px); overflow-y: auto; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 12px 30px rgba(68, 72, 58, .18); list-style: none; counter-reset: toc; }
.hilfe__toc li { counter-increment: toc; }
.hilfe__toc a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--ink-soft); text-decoration: none; line-height: 1.35; }
.hilfe__toc a::before { content: counter(toc); flex: none; width: 1.4em; color: var(--mut); font-size: 12.5px; font-weight: 700; text-align: right; line-height: 1.6; }
.hilfe__toc a:hover { background: var(--g-soft); color: var(--g-dark); }
.hilfe__toc a[aria-current] { color: var(--g-dark); font-weight: 700; }

.hilfe-text h3 { margin: 0 0 8px; font-size: 17px; }
.hilfe-text section, .hilfe-text aside { scroll-margin-top: calc(var(--header-h) + 64px); }   /* unter Header und Inhaltsverzeichnis */
.hilfe__abschnitt { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.hilfe__abschnitt p, .hilfe__abschnitt ul, .hilfe__abschnitt ol { margin: 0 0 10px; }
.hilfe__abschnitt ul, .hilfe__abschnitt ol { padding-left: 22px; }
.hilfe__abschnitt li + li { margin-top: 5px; }

/* Schnellstart als nummerierte Schritte */
.hilfe__start { margin-top: 16px; padding: 18px 20px; border-radius: 12px; background: var(--g-soft); }
.hilfe__start ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: schritt; }
.hilfe__start li { position: relative; padding-left: 38px; counter-increment: schritt; }
.hilfe__start li::before { content: counter(schritt); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--g); color: #fff; font-size: 13px; font-weight: 800; }

/* Knopf- und Feldnamen wie auf der Oberfläche */
.hl-ui { padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); font-weight: 700; white-space: nowrap; }
.hl-src { padding: 0 5px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.hl-src--app { background: #5b3f9e; color: #fff; }
.hl-src--web { background: #fff; color: #b5560c; box-shadow: inset 0 0 0 1.5px #d9822b; }
.hl-hint { padding: 9px 12px; border-left: 3px solid #e8a317; border-radius: 0 8px 8px 0; background: #fdf6e3; color: var(--ink-soft); font-size: 14px; }
/* Links im Hilfetext (z. B. Verweise auf andere Themen): grün wie die Oberfläche statt Browser-Blau */
.hilfe__start a, .hilfe__abschnitt a, .hilfe__tipps a { color: var(--g-dark); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(79, 141, 37, .35); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.hilfe__start a:hover, .hilfe__abschnitt a:hover, .hilfe__tipps a:hover { text-decoration-color: currentColor; }
.hilfe-text code { padding: 1px 5px; border-radius: 5px; background: #f1f1ec; font-size: 13px; }

.hl-table { width: 100%; margin: 6px 0 12px; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.hl-table th, .hl-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hl-table tbody tr:where(:nth-child(even)) { background: #f6f5ef; }
.hl-table th { border-bottom-color: #d9d7cf; color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.hl-table td:first-child { font-weight: 700; white-space: nowrap; }

.hilfe__tipps { margin-top: 24px; padding: 16px 20px; border: 1px dashed #c9cbbd; border-radius: 12px; }
.hilfe__tipps ul { margin: 0; padding-left: 20px; }
.hilfe__tipps li + li { margin-top: 5px; }

/* Hilfe-Leiste: fährt von rechts herein (nav.js, Inhalt von hilfe.php?seite=…&teil=inhalt) -------------- */
.help-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(580px, calc(100% - 28px));   /* schmal: Streifen der Seite bleibt sichtbar (Klick schließt) */
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: -18px 0 50px rgba(68, 72, 58, .22);
}
.help-drawer[open] { display: flex; flex-direction: column; animation: help-in .26s cubic-bezier(.2, .8, .25, 1); }
.help-drawer.is-closing { animation: help-out .2s ease-in forwards; }
.help-drawer::backdrop { background: rgba(68, 72, 58, .35); animation: help-fade .26s ease-out; }
@keyframes help-in { from { transform: translateX(100%); } }
@keyframes help-out { to { transform: translateX(100%); } }
@keyframes help-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .help-drawer[open], .help-drawer.is-closing, .help-drawer::backdrop { animation: none; } }

.help-drawer__head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.help-drawer__head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.help-drawer__head h2 svg { width: 24px; height: 24px; color: var(--g-dark); }
.help-drawer__close { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border: 0; border-radius: 50%; background: none; color: var(--mut); }
.help-drawer__close:hover { background: var(--g-soft); color: var(--ink); }
.help-drawer__close svg { width: 20px; height: 20px; }
.help-drawer__select { flex: 1; min-width: 0; max-width: 300px; height: 36px; margin-left: 8px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23777' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center / 16px; color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; appearance: none; cursor: pointer; }
.help-drawer__select:hover, .help-drawer__select:focus { border-color: var(--g); }
.help-drawer__page { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin-left: auto; border-radius: 50%; color: var(--mut); }
.help-drawer__page:hover { background: var(--g-soft); color: var(--ink); }
.help-drawer__page svg { width: 18px; height: 18px; }
.help-drawer__page + .help-drawer__close { margin-left: 0; }
.help-drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 28px; font-size: 14.5px; }
.help-drawer__body .hilfe__kopf-icon { width: 46px; height: 36px; }
.help-drawer__body .hilfe__kopf h2 { font-size: 20px; }
.help-drawer__body .hl-table { display: block; overflow-x: auto; }
.help-drawer__body section, .help-drawer__body aside { scroll-margin-top: 58px; }
.help-drawer__body .hilfe__toc { top: -18px; margin-left: -4px; margin-right: -4px; }   /* bündig oben im Scrollbereich (Innenabstand 18px) */
.help-drawer__body:focus { outline: none; }
.help-drawer__error { color: #a2321f; }

/* Benutzer oben rechts: Thumb + Name öffnen „Mein Profil“ / „Abmelden“ */
.site-header__user {
  position: relative;
  margin-left: auto;
}

.user-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 0;
  border-radius: 24px;
  background: none;
  color: var(--ink-soft);
}

.user-toggle:hover,
.user-toggle[aria-expanded="true"] { background: var(--g-soft); color: var(--g-dark); }

.user-toggle__chev { width: 16px; height: 16px; flex: none; transition: transform .15s; }
.user-toggle[aria-expanded="true"] .user-toggle__chev { transform: rotate(180deg); }

.nav-menu--user { min-width: 220px; }

.nav-menu__head {
  padding: 8px 12px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--mut);
  font-size: 12.5px;
}

.nav-menu__head b { display: block; color: var(--ink); font-size: 14px; }
.nav-menu__head small { display: block; margin-top: 3px; color: #8a6312; font-size: 11.5px; }

.avatar {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--g-border);
}

/* Icon-Sprite (Symbole werden per <use href="#i-…"> eingebunden) */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Hauptnavigation (große Icons) ------------------------------------------ */
.main-nav {
  position: relative;
  display: flex;
  height: 100%;
}

.main-nav__group {
  position: relative;
  display: flex;
  height: 100%;
  border-bottom: 3px solid transparent;
}

.main-nav__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 100%;
  padding: 0 22px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav__group > .main-nav__item { border-bottom: 0; }

.main-nav__icon { width: 40px; height: 30px; flex: none; }

.main-nav__item:hover,
.main-nav__caret:hover { color: var(--g-dark); }

.main-nav__item[aria-current="page"] {
  background: var(--g-soft);
  border-bottom-color: var(--g);
  color: var(--g-dark);
  font-weight: 700;
}

/* Aktiver Punkt mit Dropdown: Hintergrund und Linie über Link + Pfeil */
.main-nav__group:has(> .main-nav__item[aria-current="page"]) {
  background: var(--g-soft);
  border-bottom-color: var(--g);
}

.main-nav__group > .main-nav__item[aria-current="page"] { background: none; }
.main-nav__group:has(> .main-nav__item[aria-current="page"]) .main-nav__caret { color: var(--g-dark); }

/* Seite aus dem Burgermenü (z. B. Bausteine): „Mehr“ als aktiv markieren */
.main-nav__group--more:has(.nav-menu__link[aria-current="page"]) > .main-nav__item {
  background: var(--g-soft);
  box-shadow: inset 0 -3px 0 var(--g);
  color: var(--g-dark);
  font-weight: 700;
}

.main-nav__item[aria-expanded="true"],
.main-nav__caret[aria-expanded="true"] { background: var(--g-soft); color: var(--g-dark); }

.main-nav__caret {
  display: grid;
  place-items: center;
  width: 30px;
  margin-left: -14px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
}

.main-nav__caret svg { width: 18px; height: 18px; transition: transform .15s; }
.main-nav__caret[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Dropdown-Menüs --------------------------------------------------------- */
.nav-menu {
  position: absolute;
  top: 100%;
  z-index: 40;
  min-width: 250px;
  max-height: calc(100vh - var(--header-h) - 24px);
  margin-top: 6px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.nav-menu--start { left: 0; }
.nav-menu--end { right: 0; min-width: 270px; }
.nav-menu[hidden] { display: none; }

.nav-menu__list { list-style: none; margin: 0; padding: 0; }
.nav-menu__list[hidden] { display: none; }

.nav-menu__link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu__link svg { width: 20px; height: 20px; color: var(--g-dark); flex: none; }

.nav-menu__link:hover,
.nav-menu__link:focus-visible { background: var(--g-soft); color: var(--g-dark); outline: none; }

.nav-menu__link[aria-current="page"] { font-weight: 700; color: var(--g-dark); }

/* Untermenü (z. B. Buchhaltung) */
.nav-menu__link--parent[aria-expanded="true"] { color: var(--g-dark); font-weight: 600; }
.nav-menu__chev { margin-left: auto; width: 16px !important; height: 16px !important; color: var(--mut) !important; transition: transform .15s; }
.nav-menu__link--parent[aria-expanded="true"] .nav-menu__chev { transform: rotate(180deg); }

.nav-menu__list--sub {
  margin: 2px 0 4px 21px;
  padding-left: 10px;
  border-left: 2px solid var(--g-border);
}

.nav-menu__list--sub .nav-menu__link { padding: 7px 10px; font-size: 13.5px; }
.nav-menu__list--sub .nav-menu__link svg { width: 18px; height: 18px; }

.nav-menu__sep { height: 1px; margin: 6px 4px; background: var(--line); }


/* Gemeinsame Bausteine --------------------------------------------------- */
.surface {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f5f8fa;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.btn--primary { background: var(--g); border-color: var(--g); color: #fff; }
.btn--primary:hover { background: #86b634; }
.btn--soft { background: var(--g-soft); border-color: #badb92; color: var(--g-dark); }
.btn--ghost { background: var(--white); color: var(--mut); }
.btn--block { width: 100%; }
.btn--danger { background: #c8432f; border-color: #c8432f; color: #fff; }
.btn--danger:hover { background: #a9351f; border-color: #a9351f; }

/* Sicherheitsabfrage (PF.confirm in nav.js) */
.pf-confirm { width: min(420px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 16px; background: var(--white); color: var(--ink); box-shadow: 0 22px 60px rgba(68, 72, 58, .25); }
.pf-confirm::backdrop { background: rgba(68, 72, 58, .45); }
.pf-confirm__form { display: grid; gap: 10px; padding: 20px 20px 16px; }
.pf-confirm__titel { margin: 0; font-size: 18px; }
.pf-confirm__text { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.pf-confirm__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Seitenkopf: Überschrift (+ optionale Aktion rechts) und kurze Beschreibung – auf allen Seiten gleich
   <header class="page-head"><div class="page-head__row"><h1>…</h1>[Button]</div><p class="page-head__lead">…</p></header> */
.page-head { margin: 0 2px 14px; }
.page-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 44px; }   /* Höhe eines Buttons – mit und ohne Aktion gleich */
.page-head__row h1 { margin: 0 auto 0 0; font-size: 26px; line-height: 1.2; }   /* Aktion rechtsbündig */
.page-head__lead { margin: 2px 0 0; color: var(--mut); line-height: 1.5; }

/* Foto-Platzhalter (wird durch <img> ersetzt, sobald Bilder vorhanden sind) */
.photo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #e7ebe8, #cfd7d1);
}

.photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo--placeholder::before {
  content: "";
  position: absolute;
  left: 27.5%;
  top: 14%;
  width: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #b2bcb5;
  box-shadow: 0 115px 0 48px #b2bcb5;
}

/* Toast-Hinweis */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + 14px);
  z-index: 50;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.toast.is-visible { opacity: 1; }

/* Mobil ------------------------------------------------------------------ */
/* Gestapelter Header (Logo oben, Navigation als Kachelreihe): greift schon ab 1100 px,
   weil der Desktop-Header rund 1090 px Breite braucht. */
@media (max-width: 1100px) {
  :root { --header-h: 120px; }           /* Höhe des gestapelten Headers (Sticky-Abstände) */

  .site-header {
    display: block;
    height: auto;
    padding: 10px 12px 0;
  }

  .site-header__logo { width: auto; margin-bottom: 6px; }
  .site-header__logo img { max-width: 175px; max-height: 45px; }
  /* Nur das Thumb oben rechts neben dem Logo */
  .site-header__user { position: absolute; top: 12px; right: 12px; }
  .help-link { position: absolute; top: 14px; right: 58px; width: 38px; height: 38px; }
  .user-toggle { padding: 3px; }
  .user-toggle__name, .user-toggle__chev { display: none; }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: auto;
  }

  .main-nav__group { height: auto; border-bottom-width: 3px; }
  .main-nav__group > .main-nav__item { width: 100%; }

  .main-nav__item {
    flex-direction: column;
    gap: 1px;
    height: auto;
    padding: 6px 3px;
    font-size: 12.5px;
  }

  .main-nav__icon { width: 34px; height: 26px; }

  /* Pfeil sitzt als kleiner Knopf oben rechts in der Kachel */
  .main-nav__caret {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    margin: 0;
  }
}

@media (max-width: 700px) {
  .page-head { margin: 4px 2px 10px; }
  .page-head__row h1 { font-size: 22px; }
  .page-head__lead { font-size: 13px; }
  .main-nav__item { font-size: 11px; }

  /* Menüs über die volle Breite, direkt unter dem Header (top setzt nav.js) */
  .nav-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    min-width: 0;
    margin-top: 0;
    max-height: calc(100vh - var(--menu-top, 150px) - 12px);
  }

  .toast { top: auto; bottom: 90px; max-width: calc(100% - 24px); }
}

/* Kalender-Auswahl (assets/js/datepicker.js) ------------------------------ */
.date-field {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
}

.date-field > input { width: 100% !important; min-width: 0; padding-right: 36px !important; }

.date-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--g-dark);
  transform: translateY(-50%);
}

.date-btn svg { width: 18px; height: 18px; }
.date-btn:hover, .date-btn[aria-expanded="true"] { background: var(--g-soft); }

.datepicker {
  position: fixed;
  z-index: 200;
  width: 286px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.datepicker[hidden] { display: none; }

.datepicker__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }

.datepicker__head select {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 600;
}

.datepicker__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.datepicker__step:hover { background: var(--g-soft); }

.datepicker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepicker__dow { padding: 4px 0; color: var(--mut); font-size: 11px; font-weight: 700; text-align: center; }

.datepicker__day {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.datepicker__day:hover { background: var(--g-soft); }
.datepicker__day.is-weekend { color: var(--g-dark); }
.datepicker__day.is-other { color: #c2c1ba; }
.datepicker__day.is-today { box-shadow: inset 0 0 0 1.5px var(--g); font-weight: 700; }
.datepicker__day.is-selected { background: var(--g); color: #fff; font-weight: 700; }
.datepicker__day:focus-visible { outline: 2px solid var(--g-dark); outline-offset: 1px; }

.datepicker__foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.datepicker__foot button {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--g-dark);
  font-weight: 600;
}

.datepicker__foot button:hover { background: var(--g-soft); }

/* Icons in Buttons (SVG statt Zeichen ‹ › × – sitzt in allen Browsern mittig) */
.ico { display: block; width: 18px; height: 18px; flex: none; pointer-events: none; }
.sedcard__nav .ico, .sedcard__close .ico { width: 22px; height: 22px; }
.lightbox__nav .ico { width: 30px; height: 30px; }
.lightbox__close .ico { width: 22px; height: 22px; }
.cal__step .ico, .datepicker__step .ico { width: 16px; height: 16px; }
.criterion__remove .ico, .tag-chip button .ico { width: 12px; height: 12px; margin: auto; }
.cp-fields__remove .ico { width: 15px; height: 15px; margin: auto; }

/* Ladesymbol: animierter Booking-Assistent (PF.loader in nav.js) ------------------- */
.pf-loader {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--mut);
  font-size: 14px;
}
.pf-loader--inline { flex-direction: row; gap: 8px; font-size: 13px; vertical-align: middle; }
.pf-loader__icon { width: auto; height: 76px; }
.pf-loader--sm .pf-loader__icon { height: 30px; }
.pf-loader--lg .pf-loader__icon { height: 110px; }

/* Kleiner Booking-Assistent statt Kreisel (z. B. hinter Statustexten) */
.pf-mini-assistent {
  display: inline-block;
  width: 22px;
  height: 20px;
  margin-left: 8px;
  vertical-align: -5px;
  background: url("../img/assistent-animiert.svg") center / contain no-repeat;
}

/* Ladezustand über einem Bereich (z. B. Ergebnisse während einer Suche) */
.pf-loading-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(18vh, 140px);
  background: rgba(255, 254, 250, .72);
  backdrop-filter: blur(1px);
}
.pf-loading-cover[hidden] { display: none; }

/* Suchfeld mit Vorschlagsliste (combo.js) – „Auswahl öffnen“, „Neue Auswahl“ */
.pick-combo { position: relative; }
.pick-combo__box { position: relative; }
.pick-combo__box input { padding-right: 32px; text-overflow: ellipsis; }
.pick-combo.is-set:not(.is-exact) input { font-style: italic; }       /* frei getippt = „enthält“ */
.pick-combo__clear {
  position: absolute;
  right: 5px; top: 50%;
  display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  transform: translateY(-50%);
  border: 0; border-radius: 50%;
  background: none; color: var(--mut); cursor: pointer;
}
.pick-combo__clear:hover { background: #e4e6dc; color: var(--ink); }
.pick-combo__clear .ico { width: 13px; height: 13px; }
.pick-combo__clear[hidden] { display: none; }

.pick-combo__list {
  position: absolute;
  left: 0; top: calc(100% + 4px);
  z-index: 30;
  width: max(100%, 300px);
  max-width: min(420px, calc(100vw - 32px));
  max-height: 290px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.pick-combo__list[hidden] { display: none; }
.pick-combo.is-right .pick-combo__list { left: auto; right: 0; }   /* am rechten Rand (combo.js) */
.pick-combo__list [role="option"] {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  cursor: pointer;
}
.pick-combo__list [role="option"] small { flex: 0 0 auto; color: var(--mut); font-size: 12px; }
.pick-combo__list [role="option"]:hover,
.pick-combo__list [role="option"].is-active { background: var(--g-soft); }
.pick-combo__list [role="option"].is-current { font-weight: 700; }
.pick-combo__list mark { background: #fff0b3; color: inherit; border-radius: 2px; }
.pick-combo__state { padding: 8px 9px; color: var(--mut); font-size: 12.5px; }

.pick-combo__list .pick-combo__new { justify-content: flex-start; gap: 7px; margin-top: 2px; border-top: 1px dashed var(--line); border-radius: 0 0 7px 7px; color: var(--g-dark); font-weight: 600; }
.pick-combo__list .pick-combo__new .ico { flex: 0 0 auto; width: 14px; height: 14px; align-self: center; }

/* Dispo-Time: Booking-Assistent im Header vor dem Benutzer (partials/dispo.php, assets/js/dispo.js) --------
   Steht im Fluss des Headers – verdeckt nichts. is-soon = Countdown · is-final = letzte 5 Minuten · is-live = Dispo-Time */
.dispo {
  --dispo-accent: var(--g);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
  overflow: hidden;
  height: 46px;
  padding: 0 14px 0 6px;
  border: 1px solid var(--g-border);
  border-radius: 23px;
  background: var(--g-soft);
  color: var(--ink);
  line-height: 1.15;
  white-space: nowrap;
}
.dispo[hidden] { display: none; }
.dispo:not([hidden]) + .site-header__user { margin-left: 0; }
.dispo.is-new { animation: dispo-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes dispo-pop { from { transform: scale(.85); opacity: 0; } }

.dispo__assistent { flex: none; width: auto; height: 40px; margin-top: 2px; }
.dispo__text { display: grid; }
.dispo__title { color: var(--ink-soft); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.dispo__line { display: flex; align-items: baseline; gap: 6px; }
.dispo__clock { min-width: 3.4em; color: var(--g-dark); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dispo__sub { color: var(--mut); font-size: 12px; }

/* Fortschritt: im Countdown füllt er sich, in der Dispo-Time läuft er ab */
.dispo__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .05); }
.dispo__bar span { display: block; height: 100%; background: var(--dispo-accent); transform-origin: left; transform: scaleX(0); transition: transform 1s linear; }

/* letzte Minuten vor dem Start */
.dispo.is-final { --dispo-accent: #e8a317; border-color: #f2d48f; background: #fdf4dd; }
.dispo.is-final .dispo__clock { color: #8a5a00; }

/* Dispo-Time */
.dispo.is-live { --dispo-accent: #fff; border-color: #b23a28; background: #c8432f; color: #fff; box-shadow: 0 0 0 4px rgba(200, 67, 47, .18); animation: dispo-glow 2s ease-in-out infinite; }
.dispo.is-live .dispo__title { color: #fff; font-size: 12.5px; }
.dispo.is-live .dispo__clock { color: #fff; }
.dispo.is-live .dispo__sub { color: rgba(255, 255, 255, .85); }
.dispo.is-live .dispo__assistent { height: 36px; margin: 0; padding: 2px 3px 0; border-radius: 50%; background: #fff; }
.dispo.is-live .dispo__bar { background: rgba(0, 0, 0, .15); }
@keyframes dispo-glow { 50% { box-shadow: 0 0 0 7px rgba(200, 67, 47, .08); } }

/* Header-Unterkante wird während der Dispo-Time zum roten Streifen (wie der Balken im alten System) */
.is-dispo-time .site-header {
  border-bottom-color: transparent;
  background-image: repeating-linear-gradient(-45deg, #c8432f 0 12px, #e2553e 12px 24px);
  background-size: 100% 4px;
  background-position: bottom;
  background-repeat: no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .dispo.is-new, .dispo.is-live { animation: none; }
  .dispo__bar span { transition: none; }
}

/* Knapper Desktop-Header: Platz schaffen, solange der Booking-Assistent da ist (Name → nur Profilbild, kürzerer Text) */
@media (min-width: 1101px) and (max-width: 1340px) {
  .site-header:has(.dispo:not([hidden])) { gap: 22px; }
  .site-header:has(.dispo:not([hidden])) .user-toggle__name,
  .site-header:has(.dispo:not([hidden])) .user-toggle__chev { display: none; }
  .site-header:has(.dispo:not([hidden])) .user-toggle { padding: 3px; }
  .site-header:has(.dispo:not([hidden])) .help-link + .site-header__user { margin-left: -14px; }
  .site-header:has(.dispo:not([hidden])) .site-header__logo { width: auto; }
  .site-header:has(.dispo:not([hidden])) .site-header__logo img { max-width: 210px; }
  .dispo__sub { display: none; }
}

/* Gestapelter Header: oben rechts neben dem Profilbild */
@media (max-width: 1100px) {
  .dispo { position: absolute; top: 10px; right: 104px; height: 42px; }
  .dispo__assistent { height: 36px; }
}
@media (max-width: 700px) {
  .dispo { right: 100px; gap: 5px; padding-right: 10px; }
  .dispo__title, .dispo__sub { display: none; }        /* schmal: Booking-Assistent + Uhr */
  .dispo__clock { min-width: 0; font-size: 17px; }
}
@media (max-width: 480px) { .site-header__logo img { max-width: 160px; } }   /* Platz für Dispo-Pille, Hilfe und Profilbild */
@media (max-width: 380px) { .site-header__logo img { max-width: 150px; } }

@media print { .dispo, .help-link { display: none !important; } }

/* Mini-Footer (partials/mini-fuss.php) ------------------------------------ */
.mini-fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 32px;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  color: var(--mut);
  font-size: 12px;
}
.mini-fuss a { color: inherit; text-decoration: none; }
.mini-fuss a:hover { color: var(--g-dark); text-decoration: underline; }
@media print { .mini-fuss { display: none; } }
