/* =====================================================================
   ATC Hütten-App – Designsystem
   Leitmotiv: Schwarzwald-Wegweiser. Tannengrün als Grundfarbe,
   Wegweiser-Gelb für Orientierung (aktive Navigation, Hauptaktionen),
   Bollenhut-Rot nur für Warnungen und "ungelesen".
   Aufbau: Schriften · Tokens · Basis · Layout · Komponenten · Seiten
   ===================================================================== */

/* ---------- Schriften (lokal, keine externen Requests) ---------- */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --fog: #edf1ee;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --ink: #142a25;
  --ink-2: #33463f;
  --muted: #56675f;
  --line: #d3ddd7;
  --line-strong: #b6c5bd;

  --fir: #1e4a3e;
  --fir-hover: #163a30;
  --fir-tint: #dde9e3;
  --fir-text: #1e4a3e;
  --on-fir: #ffffff;

  --rail: #11302a;
  --rail-ink: #c9dcd3;
  --rail-muted: #86a398;

  --signal: #f2c12e;
  --signal-hover: #e5b31c;
  --signal-ink: #261e02;
  --signal-tint: #fbf1cc;

  --bollen: #c42032;
  --bollen-tint: #f9e2e4;
  --bollen-ink: #8a1222;

  --ok: #2e7a4e;
  --ok-tint: #e0f0e6;
  --ok-ink: #1d5535;

  --link: #1e4a3e;

  --occ-0: #cfe3d8;
  --occ-1: #7fb59b;
  --occ-2: #e8b83a;
  --occ-3: #c42032;

  --font-body: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-sign: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;

  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --r-pill: 999px;

  --shadow-pop: 0 14px 44px rgba(12, 38, 32, 0.24);
  --shadow-lift: 0 2px 10px rgba(12, 38, 32, 0.08);

  --rail-w: 264px;
  --page-max: 940px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fog: #0d1b18;
    --surface: #142722;
    --surface-2: #19302a;
    --ink: #e3ede8;
    --ink-2: #c3d2cb;
    --muted: #97aaa1;
    --line: #26403a;
    --line-strong: #35564c;

    --fir: #2c6955;
    --fir-hover: #357a63;
    --fir-tint: #1d3a32;
    --fir-text: #93d1b8;
    --on-fir: #ffffff;

    --rail: #0a1714;
    --rail-ink: #c9dcd3;
    --rail-muted: #7d9a8f;

    --signal-tint: #3a3214;
    --bollen: #e24a5c;
    --bollen-tint: #3d1b21;
    --bollen-ink: #ffb8c1;
    --ok: #4fb27a;
    --ok-tint: #193a29;
    --ok-ink: #a9e5c2;

    --link: #93d1b8;

    --occ-0: #24443b;
    --occ-1: #3f8a6c;
    --occ-2: #d9a92c;
    --occ-3: #e24a5c;

    --shadow-pop: 0 14px 44px rgba(0, 0, 0, 0.55);
    --shadow-lift: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-sign);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: 0.005em;
}
h1 { font-size: 2.35rem; }
h2 { font-size: 1.65rem; margin-top: 1.6em; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 0.9em; }
small, .small { font-size: 0.875rem; }
strong { font-weight: 700; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

img, video { max-width: 100%; display: block; }
svg.icon { flex-shrink: 0; vertical-align: middle; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--signal); color: var(--signal-ink); }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout: App-Rahmen ---------- */
.shell { min-height: 100vh; }

.main {
  padding: 1.25rem 1rem calc(var(--tabbar-h) + var(--safe-b) + 2rem);
}
.page {
  max-width: var(--page-max);
  margin: 0 auto;
}
.page-narrow { max-width: 640px; }
.page-wide { max-width: 1180px; }

/* Mobile Kopfleiste */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.5rem 1rem;
  padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
  background: var(--rail);
  color: #fff;
}
.appbar-title {
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Marke: Wegmarken-Raute + Schriftzug */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: var(--signal);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-sign); font-weight: 700; font-size: 1.55rem; letter-spacing: 0.06em; }
.brand-sub { font-size: 0.78rem; color: var(--rail-muted); margin-top: 0.2rem; }
.appbar .brand-mark { width: 24px; height: 24px; }

/* Desktop-Navigationsleiste */
.rail { display: none; }

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }
  .appbar, .tabbar { display: none; }
  .rail {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--rail);
    color: var(--rail-ink);
    padding: 1.5rem 0 1.25rem 1rem;
  }
  .rail .brand { color: #fff; padding: 0 1rem 1.75rem 0.25rem; }
  .main { padding: 2.25rem 2.5rem 4rem; }
}

.nav-group { margin-bottom: 1.1rem; }
.nav-group-title {
  font-size: 0.8rem;
  color: var(--rail-muted);
  padding: 0 0.75rem 0.35rem;
}

/* Wegweiser-Schild: aktiver Menüpunkt bekommt das gelbe Schild mit Pfeilspitze */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  margin-right: 0.9rem;
  color: var(--rail-ink);
  text-decoration: none;
  font-size: 1rem;
  border-radius: var(--r-s);
  position: relative;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-link[aria-current="page"] {
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  margin-right: 0;
  border-radius: 3px 0 0 3px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
}
.nav-link .dot { margin-left: auto; }
.nav-link[aria-current="page"] .dot { box-shadow: 0 0 0 2px var(--signal); }

.rail-foot {
  margin-top: auto;
  padding: 1rem 1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.rail-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--rail-ink);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.6rem;
  border-radius: var(--r-s);
}
.rail-user:hover { background: rgba(255, 255, 255, 0.07); }
.rail-user span { font-size: 0.95rem; line-height: 1.2; }

/* Mobile Tab-Leiste */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: var(--tabbar-h);
  padding: 0.3rem 0.1rem;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.75rem;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
}
.tab-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: var(--r-pill);
  position: relative;
}
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab[aria-current="page"] .tab-icon { background: var(--signal); color: var(--signal-ink); }
.tab-icon .dot { position: absolute; top: 2px; right: 10px; }

/* Bottom-Sheet "Mehr" (mobil) */
.sheet-nav a, .sheet-nav button.sheet-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 52px;
  padding: 0.5rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sheet-nav a[aria-current="page"] { font-weight: 700; }
.sheet-nav a[aria-current="page"] .icon { color: var(--fir-text); }
.sheet-nav .dot { margin-left: auto; }
.sheet-nav-title { font-size: 0.85rem; color: var(--muted); margin: 1.1rem 0 0.1rem; }

/* ---------- Seitenkopf ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}
.page-head h1 { margin: 0; }
.page-head p { margin: 0.35rem 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  min-height: 36px;
}
.back-link:hover { color: var(--ink); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 0.75rem;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.95rem; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: var(--fir);
  color: var(--on-fir);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--fir-hover); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn-signal { background: var(--signal); color: var(--signal-ink); }
.btn-signal:hover { background: var(--signal-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn-quiet:hover { background: var(--fir-tint); color: var(--ink); }

.btn-danger { background: var(--bollen); color: #fff; }
.btn-danger:hover { background: var(--bollen-ink); }

.btn-danger-ghost {
  background: transparent;
  color: var(--bollen);
  border-color: currentColor;
}
.btn-danger-ghost:hover { background: var(--bollen-tint); }

.btn-sm { min-height: 38px; padding: 0.35rem 0.8rem; font-size: 0.92rem; }
.btn-icon { width: 46px; padding: 0; }
.btn-icon.btn-sm { width: 38px; }
.btn-block { width: 100%; }

.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--on-fir) var(--on-fir) transparent transparent;
  animation: spin 0.7s linear infinite;
}
.btn-signal[aria-busy="true"]::after { border-color: var(--signal-ink) var(--signal-ink) transparent transparent; }
.btn-ghost[aria-busy="true"]::after, .btn-quiet[aria-busy="true"]::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn-row-end { justify-content: flex-end; }

/* ---------- Formulare ---------- */
.field { margin-bottom: 1.1rem; }
.field > label, .field-label {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}
.field-optional { font-weight: 400; color: var(--muted); }
.hint { font-size: 0.88rem; color: var(--muted); margin-top: 0.35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="search"], input[type="url"],
select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fir-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 70%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356675f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.4rem;
}
input[type="date"] { min-width: 0; }

.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 600px) {
  .field-row-2 { grid-template-columns: 1fr 1fr; }
  .field-row-zip { grid-template-columns: 9rem 1fr; }
}

/* Checkbox / Radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-weight: 400;
  cursor: pointer;
  line-height: 1.35;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 0.05rem 0 0;
  flex-shrink: 0;
  accent-color: var(--fir);
  cursor: pointer;
}
.check-list { display: grid; gap: 0 1rem; }
@media (min-width: 600px) { .check-list-2 { grid-template-columns: 1fr 1fr; } }

/* Segment-Auswahl (z.B. Sichtbarkeit, Mitgliedschaft, Status) */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.35rem 0.9rem;
  border-radius: 7px;
  font-weight: 400;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink-2);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(12, 38, 32, 0.15);
}
.segmented label:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 1px; }
.segmented-block { display: flex; }
.segmented-block label { flex: 1; justify-content: center; }

/* Datei-Auswahl */
.file-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.file-pick input[type="file"] {
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 100%;
}
.file-pick input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 42px;
  padding: 0.4rem 1rem;
  margin-right: 0.75rem;
  border-radius: var(--r-s);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.form-section + .form-section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.form-section h3 { margin-bottom: 0.9rem; }

/* ---------- Flächen ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
@media (min-width: 600px) { .panel { padding: 1.5rem 1.6rem; } }
.panel > :last-child { margin-bottom: 0; }
.panel-title {
  font-family: var(--font-sign);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.panel-head .panel-title { margin: 0; }
.panel-flush { padding: 0; overflow: hidden; }

/* Hervorgehobene Aufgaben (z.B. offene Anfragen) */
.task {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--signal-tint);
  border: 1px solid color-mix(in srgb, var(--signal) 60%, transparent);
  border-radius: var(--r-l);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; margin: 0 0 0.25rem; }
.task p { margin: 0 0 0.6rem; }

/* ---------- Listen (Zeilen statt Kartenstapel) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-boxed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  margin-bottom: 1rem;
}
.row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.list > .row:last-child, .list > li:last-child > .row { border-bottom: 0; }
.row-link { color: inherit; text-decoration: none; }
a.row:hover, .row-link:hover { background: var(--surface-2); }
.row-body { flex: 1; min-width: 0; }
.row-title {
  font-weight: 700;
  display: block;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub { display: block; color: var(--muted); font-size: 0.92rem; line-height: 1.35; margin-top: 0.15rem; }
.row-sub-clamp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-aside { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.row-date {
  flex-shrink: 0;
  width: 3.4rem;
  text-align: center;
  line-height: 1;
}
.row-date b { display: block; font-family: var(--font-sign); font-size: 1.7rem; }
.row-date span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ---------- Avatare ---------- */
.avatar {
  --s: 40px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--fir-tint);
  color: var(--fir-text);
  display: inline-grid;
  place-items: center;
  font-family: var(--font-sign);
  font-weight: 700;
  font-size: calc(var(--s) * 0.42);
  line-height: 1;
  letter-spacing: 0.02em;
  border: 0;
  padding: 0;
  overflow: hidden;
}
button.avatar, [data-user-card].avatar { cursor: pointer; }
.avatar-xs { --s: 24px; }
.avatar-sm { --s: 32px; }
.avatar-lg { --s: 56px; }
.avatar-xl { --s: 112px; }
.avatar-group { background: var(--fir); color: var(--on-fir); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
[data-user-card]:not(.avatar) { cursor: pointer; }

/* ---------- Badges / Punkte ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge-fir { background: var(--fir-tint); color: var(--fir-text); border-color: transparent; }
.badge-signal { background: var(--signal-tint); color: var(--ink); border-color: color-mix(in srgb, var(--signal) 55%, transparent); }
.badge-ok { background: var(--ok-tint); color: var(--ok-ink); border-color: transparent; }
.badge-bollen { background: var(--bollen-tint); color: var(--bollen-ink); border-color: transparent; }
.badge-tag { background: transparent; color: var(--fir-text); border-color: var(--fir-text); font-weight: 700; }

/* Bollen: der rote Punkt für "ungelesen" */
.dot {
  display: inline-grid;
  place-items: center;
  min-width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--bollen);
  color: #fff;
  flex-shrink: 0;
}
.dot-count {
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Meta-Zeilen (Icon + Text) ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; color: var(--muted); font-size: 0.92rem; }
.meta-item { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- Hinweise ---------- */
.notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 1rem;
  font-size: 0.98rem;
}
.notice > .icon { margin-top: 0.15rem; }
.notice p { margin: 0; }
.notice p + p { margin-top: 0.4rem; }
.notice-info { background: var(--fir-tint); border-color: transparent; }
.notice-info > .icon { color: var(--fir-text); }
.notice-warn { background: var(--signal-tint); border-color: color-mix(in srgb, var(--signal) 55%, transparent); }
.notice-error { background: var(--bollen-tint); border-color: transparent; color: var(--bollen-ink); }
.notice-success { background: var(--ok-tint); border-color: transparent; color: var(--ok-ink); }

/* ---------- Leere Zustände ---------- */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-l);
  margin-bottom: 1rem;
}
.empty .icon { color: var(--line-strong); margin: 0 auto 0.6rem; display: block; }
.empty p { margin: 0 auto 1rem; max-width: 36ch; }
.empty p:last-child { margin-bottom: 0; }

/* ---------- Aufklapper ---------- */
details.fold { margin-bottom: 0.75rem; }
details.fold > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0;
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: 1.3rem;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: '';
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin-right: 0.15rem;
}
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary .muted { font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; }

details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  z-index: 90;
  left: 50%;
  transform: translateX(-50%);
  top: calc(64px + env(safe-area-inset-top, 0px));
  width: min(94vw, 460px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { top: 1.25rem; left: calc(50% + var(--rail-w) / 2); } }
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  border-radius: var(--r-m);
  background: var(--ink);
  color: var(--fog);
  box-shadow: var(--shadow-pop);
  font-size: 0.98rem;
  animation: toast-in 0.25s var(--ease);
}
.toast > .icon { margin-top: 0.15rem; }
.toast-msg { flex: 1; min-width: 0; }
.toast-success > .icon { color: #7fd6a4; }
.toast-error { background: var(--bollen); color: #fff; }
.toast-info > .icon { color: var(--signal); }
.toast-close {
  background: none; border: 0; color: inherit; opacity: 0.8;
  cursor: pointer; padding: 0.15rem; margin: -0.1rem -0.1rem 0 0;
  display: grid; place-items: center; min-width: 32px; min-height: 32px;
}
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* Hinweis mit sensiblem Inhalt (z.B. neues Passwort) – bleibt stehen */
.secret {
  background: var(--surface);
  border: 2px solid var(--signal);
  border-radius: var(--r-l);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}
.secret-value {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.4rem 0 0.6rem;
}
.secret-value code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background: var(--signal-tint);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-s);
  overflow-wrap: anywhere;
}

/* ---------- Dialoge / Sheets ---------- */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 24, 20, 0.55);
  padding: 0;
  animation: fade-in 0.15s ease-out;
}
.dialog[hidden] { display: none; }
.dialog-box {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 1.25rem 1.25rem calc(1.25rem + var(--safe-b));
  box-shadow: var(--shadow-pop);
  animation: sheet-in 0.22s var(--ease);
}
.dialog-box::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  border-radius: 4px;
  background: var(--line-strong);
  margin: -0.4rem auto 1rem;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.dialog-head h2, .dialog-head h3 { margin: 0; font-size: 1.5rem; }
.dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }
.dialog-actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) {
  .dialog { align-items: center; padding: 1.5rem; }
  .dialog-box { border-radius: var(--r-l); padding: 1.5rem; }
  .dialog-box::before { display: none; }
  .dialog-actions .btn { flex: 0 0 auto; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
body.no-scroll { overflow: hidden; }

/* Kontaktkarte */
.contact-card { text-align: center; }
.contact-card .avatar { margin: 0 auto 0.75rem; }
.contact-card h3 { margin: 0 0 0.35rem; font-size: 1.6rem; }
.contact-card .badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; margin-bottom: 1rem; }
.contact-lines { text-align: left; border-top: 1px solid var(--line); }
.contact-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  min-height: 48px;
}
a.contact-line:hover { background: var(--surface-2); }
.contact-line .icon { color: var(--fir-text); }
.contact-line span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Fortschritt ---------- */
.progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--fir-tint);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--fir);
  transition: width 0.2s;
}

/* =====================================================================
   SEITEN
   ===================================================================== */

/* ---------- Anmeldung / Fehlerseiten ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--rail);
}
.auth-hero {
  padding: calc(2rem + env(safe-area-inset-top, 0px)) 1.25rem 1.5rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-hero .brand { margin-bottom: 1.5rem; }

/* Wegweiser-Pfosten mit Schildern */
.signpost {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-left: 14px;
}
.signpost::before {
  content: '';
  position: absolute;
  left: 0;
  top: -8px;
  bottom: -22px;
  width: 10px;
  border-radius: 3px 3px 0 0;
  background: #6b5a42;
}
.sign {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
  min-width: 200px;
  padding: 0.4rem 1.6rem 0.4rem 0.8rem;
  background: var(--signal);
  color: var(--signal-ink);
  font-family: var(--font-sign);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
  border-radius: 2px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}
.sign small { font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; }
.sign-back {
  align-self: flex-start;
  margin-left: -14px;
  padding: 0.4rem 0.8rem 0.4rem 1.6rem;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
}
.auth-card {
  background: var(--fog);
  border-radius: 22px 22px 0 0;
  padding: 2rem 1.25rem calc(2rem + var(--safe-b));
}
.auth-card-inner { max-width: 440px; margin: 0 auto; }
.auth-card h1 { font-size: 2rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 1.5rem; }
@media (min-width: 760px) {
  .auth {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
  .auth-hero { justify-content: center; padding: 3rem; }
  .auth-card {
    border-radius: 28px 0 0 28px;
    display: flex;
    align-items: center;
    padding: 3rem;
  }
  .auth-card-inner { width: 100%; }
}

/* ---------- Startseite ---------- */
.greeting { margin-bottom: 1.5rem; }
.greeting h1 { margin-bottom: 0.2rem; }
.greeting p { margin: 0; color: var(--muted); }

/* Belegung der nächsten 14 Tage */
.hut {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 1.15rem 1rem 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 600px) { .hut { padding: 1.4rem 1.5rem 1.2rem; } }
.hut-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.hut-head h2 { margin: 0; font-size: 1.55rem; }
.hut-strip {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
}
.hut-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  text-decoration: none;
  color: var(--muted);
}
.hut-bar {
  width: 100%;
  height: 76px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hut-bar > span { display: block; width: 100%; background: var(--occ-1); }
.hut-bar > span.lvl-2 { background: var(--occ-2); }
.hut-bar > span.lvl-3 { background: var(--occ-3); }
.hut-wd { font-size: 0.7rem; line-height: 1; }
.hut-dn { font-family: var(--font-sign); font-weight: 600; font-size: 1rem; line-height: 1; color: var(--ink); }
.hut-day.is-today .hut-bar { border: 2px solid var(--signal); }
.hut-day.is-today .hut-dn { background: var(--signal); color: var(--signal-ink); border-radius: 3px; padding: 0 3px; }
.hut-day.is-weekend .hut-wd { color: var(--ink-2); font-weight: 700; }
.hut-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.75rem; font-size: 0.82rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.swatch-1 { background: var(--occ-1); }
.swatch-2 { background: var(--occ-2); }
.swatch-3 { background: var(--occ-3); }
@media (max-width: 420px) {
  .hut-strip { gap: 2px; }
  .hut-bar { height: 60px; }
  .hut-wd { font-size: 0.62rem; }
  .hut-dn { font-size: 0.85rem; }
}

.dash-grid { display: grid; gap: 0 1.25rem; }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Kalender ---------- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.cal-nav h2 { margin: 0; font-size: 1.7rem; text-align: center; flex: 1; }
.cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  margin-bottom: 1rem;
}
.cal-weekdays, .cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.cal-day {
  position: relative;
  min-height: 74px;
  padding: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
}
.cal-days > .cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-empty { background: var(--surface-2); }
button.cal-day { cursor: pointer; }
button.cal-day:hover { background: var(--surface-2); }
.cal-day-top { display: flex; justify-content: space-between; align-items: center; gap: 2px; }
.cal-dn {
  font-family: var(--font-sign);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}
.cal-day.is-today .cal-dn { background: var(--signal); color: var(--signal-ink); }
.cal-day.is-past .cal-dn { color: var(--muted); }
.cal-occ { font-size: 0.68rem; font-weight: 700; color: var(--muted); }
.cal-entry {
  display: block;
  font-size: 0.7rem;
  line-height: 1.25;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--fir);
  color: var(--on-fir);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-entry.is-continued { background: var(--fir-tint); color: var(--fir-text); }
.cal-more { font-size: 0.68rem; color: var(--muted); padding-left: 2px; }
.cal-bar {
  margin-top: auto;
  height: 4px;
  border-radius: 2px;
  background: var(--occ-0);
  overflow: hidden;
}
.cal-bar > span { display: block; height: 100%; background: var(--occ-1); }
.cal-bar > span.lvl-2 { background: var(--occ-2); }
.cal-bar > span.lvl-3 { background: var(--occ-3); }
@media (min-width: 700px) {
  .cal-day { min-height: 104px; padding: 6px; }
  .cal-entry { font-size: 0.78rem; padding: 2px 6px; }
  .cal-occ { font-size: 0.75rem; }
}
@media (max-width: 480px) {
  .cal-day { min-height: 60px; padding: 3px 2px; }
  .cal-dn { font-size: 0.95rem; padding: 1px 3px; }
  .cal-entry { font-size: 0.6rem; padding: 0 2px; }
  .cal-occ { font-size: 0.6rem; }
}

.agenda-item .row-date b { font-size: 1.45rem; }
.agenda-range { font-size: 0.85rem; color: var(--muted); }

.day-entry + .day-entry { border-top: 1px solid var(--line); margin-top: 0.9rem; padding-top: 0.9rem; }
.day-entry-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.4rem; }
.day-entry-head strong { flex: 1; min-width: 0; line-height: 1.25; }
.day-entry p { margin: 0.2rem 0; }

/* "Wer schläft wo?"-Zeilen */
.sleep-rows { display: grid; gap: 0.6rem; margin-bottom: 0.75rem; }
.sleep-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 5.5rem minmax(0, 1.4fr) 46px;
  gap: 0.5rem;
  align-items: center;
}
@media (max-width: 600px) {
  .sleep-row {
    grid-template-columns: minmax(0, 1fr) 5.5rem 46px;
    grid-template-areas: "type count remove" "note note note";
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--line);
  }
  .sleep-row select { grid-area: type; }
  .sleep-row input[type="number"] { grid-area: count; }
  .sleep-row input[type="text"] { grid-area: note; }
  .sleep-row .btn { grid-area: remove; }
}
.availability {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  margin: -0.25rem 0 1.1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-s);
  background: var(--surface-2);
}
.availability.is-tight { background: var(--signal-tint); }
.availability.is-full { background: var(--bollen-tint); color: var(--bollen-ink); }

/* ---------- Galerie ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 700px) { .album-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.album-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.album-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--fir-tint);
  display: grid;
  place-items: center;
  color: var(--fir-text);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s var(--ease); }
.album-tile:hover .album-cover img { transform: scale(1.03); }
.album-tile-title {
  font-weight: 700;
  margin-top: 0.5rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-tile-meta { font-size: 0.85rem; color: var(--muted); }

.collage {
  column-count: 2;
  column-gap: 0.6rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) { .collage { column-count: 3; } }
@media (min-width: 1000px) { .collage { column-count: 4; } }
.tile {
  position: relative;
  break-inside: avoid;
  margin-bottom: 0.6rem;
  border-radius: var(--r-s);
  overflow: hidden;
  background: var(--fir-tint);
  cursor: zoom-in;
}
.tile img, .tile video { width: 100%; height: auto; display: block; }
.tile-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tile-badge {
  position: absolute;
  top: 6px; left: 6px;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(10, 24, 20, 0.6);
  color: #fff;
  pointer-events: none;
}
.tile-fav {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 24, 20, 0.5);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s;
}
.tile-fav[aria-pressed="true"] { color: #ff6b7d; background: rgba(255, 255, 255, 0.92); }
.tile-fav.pop { transform: scale(1.18); }
.tile-tools {
  position: absolute;
  top: 6px; right: 6px;
  display: none;
  gap: 4px;
}
.is-editing .tile-tools { display: flex; }
.tile-tools button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  cursor: pointer;
}
.tile-tools button.danger { color: var(--bollen); }
.tile-tools button.is-cover { background: var(--signal); color: var(--signal-ink); }
.tile-label {
  position: absolute;
  left: 6px; bottom: 6px;
  max-width: calc(100% - 56px);
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  background: rgba(10, 24, 20, 0.66);
  color: #fff;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edit-only { display: none; }
.is-editing .edit-only { display: block; }

.dup-group { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.dup-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.dup-tile { position: relative; width: 104px; height: 104px; border-radius: var(--r-s); overflow: hidden; background: var(--fir-tint); }
.dup-tile img, .dup-tile video { width: 100%; height: 100%; object-fit: cover; }
.dup-tile .badge { position: absolute; left: 4px; bottom: 4px; }
.dup-tile button { position: absolute; top: 4px; right: 4px; }

/* Upload-Bereich */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-l);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.is-over { border-color: var(--fir-text); background: var(--fir-tint); }
.dropzone .icon { color: var(--fir-text); }
.dropzone p { margin: 0; }
.upload-status { width: 100%; text-align: left; }
.upload-status p { font-size: 0.9rem; color: var(--muted); margin: 0.4rem 0 0; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(5, 14, 12, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.lightbox[hidden] { display: none; }
.lb-stage {
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 0 88px;
}
.lb-stage img, .lb-stage video {
  max-width: 100vw;
  max-height: calc(100vh - 152px);
  object-fit: contain;
}
@media (min-width: 900px) {
  .lb-stage { padding: 72px 88px 92px; }
  .lb-stage img, .lb-stage video { max-width: calc(100vw - 176px); max-height: calc(100vh - 164px); border-radius: 4px; }
}
.lb-top, .lb-bottom {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  color: #fff;
}
.lb-top { top: 0; padding-top: calc(0.75rem + env(safe-area-inset-top, 0px)); justify-content: space-between; }
.lb-bottom { bottom: 0; padding-bottom: calc(0.75rem + var(--safe-b)); justify-content: center; flex-wrap: wrap; }
.lb-count { font-size: 0.9rem; opacity: 0.85; margin-right: auto; padding-left: 0.4rem; }
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-btn.is-on { background: var(--signal); color: var(--signal-ink); }
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  padding: 0;
  display: none;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
@media (min-width: 900px) { .lb-nav { display: inline-flex; } }
.lb-nav:disabled { opacity: 0.25; cursor: default; }
.lb-uploader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.25rem 0.8rem 0.25rem 0.25rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  min-height: 44px;
}

/* ---------- Neuigkeiten ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.post-card-img { aspect-ratio: 16 / 9; background: var(--fir-tint); display: grid; place-items: center; color: var(--fir-text); }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.post-card-body h3 {
  margin: 0;
  font-size: 1.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-teaser {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .meta { margin-top: auto; padding-top: 0.25rem; }

.article { max-width: 720px; }
.article-cover { width: 100%; border-radius: var(--r-l); margin-bottom: 1.25rem; max-height: 460px; object-fit: cover; }
.article h1 { font-size: 2.6rem; margin-bottom: 0.6rem; }
.article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-bottom: 1.25rem; color: var(--muted); font-size: 0.95rem; }
.article-byline .who { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 700; }
.prose { font-size: 1.15rem; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose img { border-radius: var(--r-m); margin: 1.25rem 0; height: auto; }
.prose a { overflow-wrap: anywhere; }
.route-box {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-left: 4px solid var(--signal);
  background: var(--surface);
  border-radius: 0 var(--r-m) var(--r-m) 0;
  padding: 0.9rem 1rem;
  margin: 0 0 1.5rem;
}
.route-box h3 { margin: 0 0 0.3rem; }
.route-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.95rem; }
.route-facts b { font-family: var(--font-sign); font-size: 1.3rem; margin-right: 0.15rem; }
.attendees { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.attendees > span:first-child { color: var(--muted); font-size: 0.95rem; }

.comments { max-width: 720px; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--line); }
.comment { display: flex; gap: 0.75rem; padding: 0.9rem 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.comment-head time { font-size: 0.82rem; color: var(--muted); }
.comment-text { margin: 0.25rem 0 0.4rem; white-space: pre-wrap; }
.comment-tools { display: flex; gap: 0.25rem; }
.comment-replies { margin-top: 0.4rem; padding-left: 0.9rem; border-left: 2px solid var(--line); }
.comment-replies .comment { padding: 0.6rem 0; }
.comment-form textarea { min-height: 90px; }

.editor-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; align-items: center; }
.attendee-picker { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0.25rem 0.75rem; background: var(--surface); }
.attendee-picker .check.is-hidden { display: none; }

/* ---------- Events ---------- */
.event {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.event-date {
  flex-shrink: 0;
  width: 4.2rem;
  text-align: center;
  border-radius: var(--r-m);
  background: var(--fir);
  color: var(--on-fir);
  padding: 0.5rem 0.25rem;
  align-self: flex-start;
}
.event-date b { display: block; font-family: var(--font-sign); font-size: 2rem; line-height: 1; }
.event-date span { display: block; font-size: 0.8rem; margin-top: 0.15rem; }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.event-desc { white-space: pre-wrap; margin: 0.6rem 0; }
.event-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.75rem; }
.event.is-past .event-date { background: var(--surface-2); color: var(--muted); }

/* ---------- Chat ---------- */
.chat-group-avatar { background: var(--fir); color: var(--on-fir); }
.member-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.75rem 0.5rem;
}
.member-pick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.5rem 0.25rem;
  border-radius: var(--r-m);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.2;
}
.member-pick a:hover { background: var(--surface); }
.member-pick span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px - var(--tabbar-h) - var(--safe-b) - 2.5rem);
}
@media (min-width: 900px) { .chat { min-height: calc(100vh - 4.5rem); } }
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.chat-head h1 { font-size: 1.75rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-log { flex: 1; padding: 1rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.chat-day {
  align-self: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.75rem;
  margin: 0.75rem 0 0.4rem;
}
.msg { display: flex; align-items: flex-end; gap: 0.5rem; max-width: 86%; }
.msg.is-own { align-self: flex-end; flex-direction: row-reverse; }
.msg.is-cont .avatar { visibility: hidden; }
.msg-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  padding: 0.5rem 0.8rem 0.4rem;
  min-width: 0;
}
.msg.is-own .msg-bubble {
  background: var(--fir);
  color: var(--on-fir);
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
}
.msg-sender { font-size: 0.8rem; font-weight: 700; color: var(--fir-text); margin-bottom: 0.1rem; }
.msg-text { white-space: pre-wrap; line-height: 1.45; }
.msg-text a { color: inherit; }
.msg-time { font-size: 0.7rem; opacity: 0.7; text-align: right; margin-top: 0.15rem; }
.msg-media { margin-top: 0.35rem; border-radius: 10px; max-height: 320px; width: auto; cursor: zoom-in; }
.msg audio { width: 240px; max-width: 100%; margin-top: 0.35rem; }
.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.14);
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.chat-composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 0.5rem);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 0.35rem;
  box-shadow: var(--shadow-lift);
}
@media (min-width: 900px) { .chat-composer { bottom: 1rem; } }
.composer-row { display: flex; align-items: flex-end; gap: 0.35rem; }
.composer-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  border: 0;
  padding: 0.6rem 0.4rem;
  resize: none;
  background: transparent;
  box-shadow: none;
}
.composer-row textarea:focus { box-shadow: none; }
.composer-row .btn { border-radius: 50%; width: 44px; min-height: 44px; padding: 0; }
.composer-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.composer-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Adressbuch ---------- */
.search {
  position: relative;
  margin-bottom: 1rem;
}
.search .icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.7rem; }
.contact-row .row-sub a { color: inherit; }
.letter {
  font-family: var(--font-sign);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fir-text);
  padding: 0.35rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

/* ---------- Profil ---------- */
.profile-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-head .avatar { --s: 96px; }
.profile-head h1 { margin: 0 0 0.25rem; }

/* ---------- Zahlung ---------- */
.bank {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
}
.bank dt { color: var(--muted); }
.bank dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.iban { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.03em; }
.qr {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border-radius: var(--r-m);
  margin: 0.75rem auto 0;
  max-width: 260px;
}
.qr svg { width: 100%; height: auto; max-width: 228px; }
@media (min-width: 760px) {
  .pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
}

/* ---------- Verwaltung ---------- */
.admin-request .row { align-items: flex-start; }
.request-dates { font-family: var(--font-sign); font-weight: 700; font-size: 1.35rem; }
.capacity-line { font-size: 0.92rem; }
.capacity-line.is-full { color: var(--bollen); font-weight: 700; }

.member-row .row-title { white-space: nowrap; }
.role-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }

.tag-editor { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tag-editor form { display: inline-flex; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.2rem 0.15rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--fir-text);
  color: var(--fir-text);
  font-weight: 700;
  font-size: 0.9rem;
}
.tag-chip button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer;
}
.tag-chip button:hover { background: var(--fir-tint); }

.invite-link { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.invite-link input { font-size: 0.9rem; }

.stat-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.stat b { font-family: var(--font-sign); font-size: 1.2rem; color: var(--ink); }
a.stat:hover { border-color: var(--line-strong); }

/* =====================================================================
   ERGÄNZUNGEN (Hilfsklassen und Details der einzelnen Seiten)
   ===================================================================== */

/* Abstände */
.mt-xs { margin-top: 0.35rem; }
.mt-s { margin-top: 0.75rem; }
.mt-m { margin-top: 1.25rem; }
.mt-l { margin-top: 2rem; }
.btn-row-center { justify-content: center; }

/* Sprunglink für Tastatur */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--signal);
  color: var(--signal-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--r-s);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }
.main:focus { outline: none; }

/* Navigation: Kleinkram */
.nav-link-btn { width: calc(100% - 0.9rem); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.rail-user small { color: var(--rail-muted); font-size: 0.8rem; }
.rail-user[aria-current="page"] { background: rgba(255, 255, 255, 0.1); }
.rail-version { margin: 0.75rem 0 0 0.75rem; font-size: 0.78rem; color: var(--rail-muted); }
.appbar-profile { display: inline-flex; border-radius: 50%; }
.appbar-profile .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.sheet-nav form { margin: 0; }

/* Dialoge */
.dialog-title { margin: 0 0 0.5rem; font-size: 1.6rem; }
.dialog-box > p:last-child { margin-bottom: 0; }

/* Formulare */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 3.2rem; }
.password-field .btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 12rem; width: auto; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.search-sm input { min-height: 42px; font-size: 1rem; }
.cover-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r-m); margin-bottom: 0.6rem; }
.danger-zone { border-color: color-mix(in srgb, var(--bollen) 35%, var(--line)); }
.danger-zone .panel-title { color: var(--bollen-ink); }
@media (prefers-color-scheme: dark) { .danger-zone .panel-title { color: var(--bollen-ink); } }

/* Listen */
.list-title {
  font-size: 1.35rem;
  margin: 1.75rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-head + .list-title { margin-top: 0; }
.row-time { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.row-thumb { width: 56px; height: 56px; border-radius: var(--r-s); object-fit: cover; flex-shrink: 0; }
.row-thumb-empty { display: grid; place-items: center; background: var(--fir-tint); color: var(--fir-text); }
.row-link > .icon:last-child { color: var(--muted); }
.is-unread .row-title { color: var(--ink); }
.is-unread .row-sub { color: var(--ink-2); font-weight: 700; }
.panel-attention { border: 2px solid var(--signal); }

/* Aufgaben als Link */
.task-link { color: inherit; text-decoration: none; align-items: center; }
.task-link:hover { border-color: var(--signal-hover); }
.task-link .task-title { margin: 0; }
.task-link .task-body p.muted { margin: 0.15rem 0 0; font-size: 0.95rem; }
.task > .icon:first-child { color: var(--ink); }

/* Seiten-Abschnitte im Profil */
.tabs-inline {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}
.tabs-inline a {
  white-space: nowrap;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  background: var(--surface);
}
.tabs-inline a:hover { border-color: var(--fir-text); }
.profile-head .role-chips { margin-top: 0.35rem; }

/* Startseite */
.hut-day {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
}
.hut-day:hover .hut-bar { border-color: var(--line-strong); }
.hut-entries { margin-top: 1rem; border-top: 1px solid var(--line); }
.hut-entries .row { padding-left: 0; padding-right: 0; }
.hut-free { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0; color: var(--ok-ink); font-weight: 700; }
.hut-free .icon { color: var(--ok); }

/* Kalender */
.cal-occ.is-full { color: var(--bollen); }
.cal-day.is-weekend:not(.is-empty) { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
button.cal-day.is-weekend:hover { background: var(--surface-2); }
.day-capacity { margin: -0.4rem 0 1rem; color: var(--muted); font-size: 0.95rem; }
.day-capacity.is-full { color: var(--bollen); font-weight: 700; }
.day-entry-head .avatar { --s: 36px; }
.sleep-fieldset { margin-bottom: 1.1rem; }

/* Galerie */
.tile { margin: 0 0 0.6rem; }
.album-desc { white-space: pre-wrap; color: var(--ink-2) !important; }
.dropzone label.btn { cursor: pointer; }
.dropzone.is-uploading label.btn { pointer-events: none; opacity: 0.5; }
.post-album { margin-top: 2rem; }

/* Beiträge */
.article-tools { margin-left: auto; }

/* Events */
.event-admin { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.event-foot form { margin: 0; }

/* Chat */
.chat-older { align-self: center; margin-bottom: 0.5rem; }
.chat-empty { text-align: center; margin: 2rem 0; }
.msg > .avatar { margin-bottom: 1.1rem; }
.is-chat .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 0.75rem); }
@media (min-width: 900px) { .is-chat .main { padding-bottom: 0.5rem; } }

/* Verwaltung */
.request-head { display: flex; gap: 0.85rem; align-items: center; }
.request-comment {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  white-space: pre-wrap;
}
.request-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.capacity-line { display: flex; gap: 0.4rem; align-items: flex-start; }
.capacity-line .icon { margin-top: 0.15rem; }
.invitation-row { align-items: flex-start; }
.invitation-row > .icon { margin-top: 0.15rem; color: var(--fir-text); }

/* System & Updates */
.version-plate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-bottom: 1.25rem;
}
.version-sign { font-size: 1.6rem; padding: 0.55rem 2.2rem 0.55rem 1rem; min-width: 0; }
.version-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; font-size: 0.92rem; }
.version-facts dt { color: var(--muted); }
.version-facts dd { margin: 0; font-weight: 700; }
.update-steps { padding-left: 1.2rem; margin: 0.75rem 0 1rem; }
.update-steps li + li { margin-top: 0.2rem; }
.update-progress { margin-top: 1.25rem; }
.update-step { font-weight: 700; margin: 0.6rem 0 0.4rem; }
.update-log {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  background: var(--rail);
  color: var(--rail-ink);
  border-radius: var(--r-s);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.changelog { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.changelog li + li { margin-top: 0.3rem; }
.backup-name { font-size: 0.92rem; overflow-wrap: anywhere; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; }

/* Fehlerseite */
.error-page { border-style: solid; background: var(--surface); }
.error-page h1 { margin-top: 0.5rem; }
.error-page .icon { color: var(--signal-hover); }

/* Desktop: Tab-Leiste aus (muss nach der Grunddefinition der .tabbar stehen) */
@media (min-width: 900px) {
  .tabbar, .appbar { display: none; }
}
button.cal-day {
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.nav-link-btn { font-size: 1rem; }
.invitation-row { flex-wrap: wrap; }
.invitation-row .row-body { flex: 1 1 14rem; }
.invitation-row .row-aside { margin-left: auto; }

/* =====================================================================
   NAVIGATION 2: Neu-Knopf, Menü, Bereichs-Tabs, Erlebnisse, Einführung
   ===================================================================== */

/* Neu-Knopf in der Seitenleiste */
.rail-new { margin: 0 1rem 1.25rem 0; justify-content: flex-start; padding-left: 0.9rem; }

/* Menü-Knopf in der Kopfleiste (mobil) */
.appbar-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.3rem 0.75rem 0.3rem 0.55rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.appbar-menu .dot { position: absolute; top: 2px; right: 2px; box-shadow: 0 0 0 2px var(--rail); }

/* Mittlerer Tab "Neu" */
.tab-new { color: var(--ink); font-weight: 700; }
.tab-new .tab-icon {
  width: 52px;
  height: 40px;
  margin-top: -6px;
  border-radius: 14px;
  background: var(--signal);
  color: var(--signal-ink);
  box-shadow: 0 3px 10px rgba(12, 38, 32, 0.25);
}

/* Aktionsliste im Neu-Dialog und Schnellzugriff */
.action-list { display: grid; gap: 0.5rem; }
.action-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  color: var(--ink);
  text-decoration: none;
  min-height: 60px;
}
.action-item:hover { border-color: var(--fir-text); background: var(--surface-2); }
.action-item strong { display: block; line-height: 1.25; }
.action-item small { display: block; color: var(--muted); font-size: 0.85rem; }
.action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--fir-tint);
  color: var(--fir-text);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 700px) { .quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick-action {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  min-height: 62px;
}
.quick-action:hover { border-color: var(--fir-text); }
.quick-action:first-child { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.quick-action:first-child .action-icon { background: rgba(255, 255, 255, 0.45); color: var(--signal-ink); }

/* Profil oben im Menü */
.sheet-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--r-m);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.sheet-profile > span { flex: 1; min-width: 0; }
.sheet-profile strong { display: block; }
.sheet-profile small { color: var(--muted); }

/* Bereichs-Tabs (Kalender: Hütte/Events, Erlebnisse: Filter) */
.section-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin: -0.25rem 0 1.25rem;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-height: 40px;
  padding: 0.35rem 0.95rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.section-tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--fog); font-weight: 700; }
.section-tab-count { font-size: 0.78rem; opacity: 0.7; }

/* Erlebnisse: Kennzeichen und Mosaik für Alben */
.post-card-img { position: relative; overflow: hidden; }
.card-kind {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-pill);
  background: rgba(10, 24, 20, 0.7);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.mosaic { display: grid; gap: 2px; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.mosaic-2 { grid-template-columns: 1fr 1fr; }
.mosaic-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic-3 img:first-child { grid-row: span 2; }
.mosaic-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic-0 { display: grid; place-items: center; }
.mosaic .card-kind { z-index: 1; }

/* Einführung */
.is-tour .tabbar { display: none; }
.is-tour .main { padding-bottom: 2rem; }
.tour-progress { height: 6px; border-radius: 3px; background: var(--fir-tint); overflow: hidden; margin-bottom: 1.5rem; }
.tour-progress span { display: block; height: 100%; width: 0; background: var(--signal); transition: width 0.3s var(--ease); }
.tour:not(.is-js) .tour-progress { display: none; }
.tour-step { margin-bottom: 2rem; }
.tour.is-js .tour-step { min-height: 52vh; margin-bottom: 0; animation: fade-in 0.25s ease-out; }
.tour-sign { margin-bottom: 1rem; min-width: 0; font-size: 1.3rem; }
.tour-step h1, .tour-step h2 { margin-top: 0; font-size: 2.2rem; }
.tour-step h1:focus, .tour-step h2:focus { outline: none; }
.tour-lead { font-size: 1.2rem; }
.tour-points { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }
.tour-points li { display: flex; gap: 0.75rem; align-items: center; }
.tour-points .icon { color: var(--fir-text); }
.tour-demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1rem; margin: 0.5rem 0 1rem; }
.tour-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tour-demo-center { display: grid; place-items: center; padding: 1.5rem; }
.tour-plus { display: grid; place-items: center; width: 64px; height: 52px; border-radius: 16px; background: var(--signal); color: var(--signal-ink); box-shadow: 0 4px 14px rgba(12, 38, 32, 0.25); }
.install-steps { padding-left: 1.3rem; margin: 0 0 0.75rem; }
.install-steps li + li { margin-top: 0.35rem; }
.install-ready { margin: 0.5rem 0 1rem; }
.tour-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0 calc(0.75rem + var(--safe-b));
  background: var(--fog);
  border-top: 1px solid var(--line);
}
.tour-nav .btn-signal { margin-left: auto; }
.tour-count { color: var(--muted); font-size: 0.9rem; }
.tour:not(.is-js) #tour-next, .tour:not(.is-js) #tour-prev { display: none; }
.tour-skip { text-align: center; margin-top: 0.75rem; }
.tour-skip .link-btn { color: var(--muted); font-size: 0.9rem; }
