/* Wachbuch Klar 2 – Web-PWA
   Ruhige Flächen, Farbe nur für Zustand. Ein Markenelement: die
   Warnmarkierung (Schrägstreifen wie am Heck eines Rettungswagens).
   Offline-fähig: lokale Atkinson Hyperlegible Next, keine CDN-Abhängigkeiten.
   Tokens gleichnamig in clients/Wachbuch-Client lib/theme/design_tokens.dart. */

/* Das hidden-Attribut muss jede Layout-Regel gewinnen: sonst macht
   display:flex/-grid ein per JS oder Template verstecktes Element wieder
   sichtbar (z. B. das Installationsbanner). */
[hidden] { display: none !important; }

/* Schrift: core/static/core/fonts.css (wird vor app.css geladen). */

/* Tokens: core/static/core/tokens.css (wird vor app.css geladen). */

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-left: var(--safe-left);
  background: transparent;
  font-size: 1rem;
  line-height: 1.5;
}
h1, h2, h3 {
  overflow-wrap: anywhere;
  letter-spacing: -.01em;
  color: var(--brand-ink);
  font-weight: 700;
  line-height: 1.2;
}
/* Uhrzeiten, Beträge und Zähler stehen spaltengenau untereinander. */
time, .amount, .kpi-value, .nav-badge, td, .tabular { font-variant-numeric: tabular-nums; }
a { color: var(--accent-dark); text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .app-nav a,
  .button,
  .list-row,
  .more-list a,
  .quick-actions a {
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(.25rem); }
  to { opacity: 1; transform: none; }
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -5rem;
  left: calc(1rem + var(--safe-left));
  padding: .75rem 1rem;
  color: var(--on-primary);
  background: var(--brand);
  border-radius: var(--radius);
}
.skip-link:focus { top: calc(1rem + var(--safe-top)); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* —— App shell: official service header —— */

.header-inner {
  width: min(var(--content), calc(100% - 2rem));
  min-height: 3.75rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  position: relative;
}

/* Der Wachenname steht mittig in der Kopfzeile, ohne die Navigation zu
   verschieben. Auf schmalen Anzeigen tritt er zurück, statt umzubrechen. */
.calendar-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
}

.calendar-heading h1 {
  margin: 0;
}

.brand-logo {
  display: block;
  height: 2.6rem;
  width: auto;
}

.header-station {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0 .5rem;
  max-width: 40%;
  text-align: center;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.brand {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  text-decoration: none;
}
.brand strong, .brand small, .identity strong, .identity span { display: block; }
.brand strong { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.account { display: flex; align-items: center; gap: 1rem; }
.identity { min-width: 0; text-align: right; }
.identity strong, .identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity span { color: var(--muted); font-size: .8rem; }
.logout-form button {
  min-height: var(--touch);
  padding: 0 .9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}
.logout-form button:hover { background: var(--surface-soft); }

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.language-switch button {
  min-height: var(--touch);
  padding: .2rem .9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.language-switch button:hover {
  background: var(--surface-soft);
}
.language-switch button[aria-current="true"] {
  font-weight: 700;
}

/* —— Startseite: Gestaltung in public.css; hier nur die volle Breite —— */
.is-landing .page-shell {
  width: 100%;
  max-width: none;
  padding: 0 0 2rem;
}

.connection-chip {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: .65rem 1rem;
  color: var(--warning);
  background: var(--warning-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warning-accent) 45%, transparent);
  text-align: center;
  font-weight: 700;
}
.demo-banner {
  display: none !important;
}
.demo-banner strong { font-weight: 700; letter-spacing: .02em; }
.demo-banner span { color: var(--warning); }
.demo-accounts code {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: .3rem;
  background: var(--accent-soft);
  font-size: .95em;
}
.install-banner {
  width: min(var(--content), calc(100% - 2rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem auto 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.install-banner strong, .install-banner span { display: block; }
.install-banner span { color: var(--muted); font-size: .92rem; }
.install-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.app-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: min(var(--content), calc(100% - 2rem));
  display: flex;
  gap: .25rem;
  margin: 0 auto;
  /* Bei vielen Bereichen wird die Leiste waagerecht schiebbar – mit Maus,
     Touchpad oder Finger. Der Slider bleibt sichtbar. */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding-bottom: 2px;
}

.nav-inner::-webkit-scrollbar {
  height: 6px;
}

.nav-inner::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.nav-inner > a {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.more-list {
  display: flex;
  flex-direction: column;
}

.sortable-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.sortable-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: grab;
}

.sortable-list li.is-dragging { opacity: .55; }
.sortable-list .drag-handle { color: var(--muted); letter-spacing: .1em; }
.sortable-list li { flex-wrap: wrap; }
.sortable-list .sort-buttons { margin-left: auto; display: inline-flex; gap: .25rem; }
.sortable-list .sort-buttons .button { min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; }

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0;
}
.app-nav a {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: 0 1rem;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.app-nav a:hover { background: var(--surface-soft); color: var(--text); }
.app-nav a[aria-current="page"] {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
}
.nav-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  opacity: .95;
}
.nav-icon svg { width: 1.2rem; height: 1.2rem; display: block; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  min-height: 1.4rem;
  margin-left: .2rem;
  padding: 0 .35rem;
  color: var(--on-strong);
  background: var(--danger);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

.page-shell {
  width: min(var(--content), calc(100% - 2rem));
  min-height: calc(100dvh - 11rem);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.site-footer {
  width: min(var(--content), calc(100% - 2rem));
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 1.25rem 0 calc(1.25rem + var(--safe-bottom));
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .85rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; }
.footer-links a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}
.app-version { color: var(--muted); }
.key-fingerprint { font-family: var(--mono, monospace); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.messages { max-width: 48rem; margin-bottom: 1.5rem; }
.message {
  padding: .85rem 1rem;
  color: var(--text);
  background: var(--info-soft);
  border-left: 4px solid var(--info);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.message + .message { margin-top: .5rem; }
.message.error { background: var(--danger-soft); border-color: var(--danger); }

.page-heading { max-width: 48rem; margin-bottom: 1.75rem; }
.page-heading.narrow, .narrow { max-width: 42rem; }
.heading-with-action {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.page-heading h1 {
  margin: .15rem 0 .5rem;
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  line-height: 1.12;
}
.page-heading .lead { margin-top: .35rem; }
.context-line {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  letter-spacing: .01em;
}
.lead { max-width: 65ch; margin: 0; color: var(--muted); font-size: 1.05rem; }
.status-summary { display: flex; flex-wrap: wrap; gap: .55rem; margin: .9rem 0 0; }
.status-pill {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .625rem;
  text-decoration: none;
  font-weight: 650;
}
.status-pill strong { font-size: 1.05rem; }
.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 1.5rem;
}
.quick-actions a {
  min-height: 5.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
  padding: 1rem 1.1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  text-decoration: none;
}
.quick-actions a:hover {
  border-color: var(--brand);
  border-left-color: var(--brand);
  background: var(--surface-soft);
}
.quick-actions strong, .quick-actions span { display: block; }
.quick-actions span { color: var(--muted); font-size: .9rem; font-weight: 500; }

.button {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.15rem;
  border: 2px solid transparent;
  border-radius: .75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button.primary {
  color: var(--on-primary);
  background: var(--brand);
}
.button.primary:hover { background: var(--brand-deep); }
.button.secondary {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--brand);
}
.button.secondary:hover { background: var(--primary-container); }
.back-link {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  margin: -1rem 0 1rem;
  font-weight: 650;
}
.text-action {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, .8fr);
  gap: 1.5rem;
  align-items: start;
}
.section-block {
  min-width: 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.section-block.flush { padding: 0; overflow: hidden; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.section-heading h2, .section-block h2 { margin: 0; font-size: 1.2rem; }
.section-heading a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
}
.mfa-secret { margin: 0 0 1.25rem; padding: 1rem 0; }
.mfa-key, .mfa-uri {
  display: block;
  margin: .5rem 0 1rem;
  padding: .75rem 1rem;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .92rem;
}
.hint { margin: 0; color: var(--muted); font-size: .9rem; }

.item-list { display: grid; }
.list-row {
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-soft); }
.row-content { min-width: 0; }
.row-content strong, .row-content small { display: block; }
.row-content strong { overflow-wrap: anywhere; }
.row-content small, .list-row time { color: var(--muted); font-size: .85rem; }
.list-row time { white-space: nowrap; }

.status-label {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 1.75rem;
  padding: .2rem .55rem;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: .5rem;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.agenda { display: grid; }
.agenda-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.agenda-row:last-child { border-bottom: 0; }
.agenda-row > time { color: var(--brand); }
.agenda-row > time strong, .agenda-row > time span { display: block; }
.agenda-row > div { min-width: 0; }
.agenda-row h2, .agenda-row div > strong {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.agenda-row p { max-width: 65ch; margin: .25rem 0; color: var(--muted); }
.agenda-row small { color: var(--muted); }
.compact-agenda .agenda-row { padding-inline: 0; font-size: .9375rem; }
.compact-agenda .agenda-row p { font-size: .875rem; }
.compact-agenda .agenda-row[class*="agenda-holiday"],
.compact-agenda .agenda-row[class*="agenda-waste"],
.compact-agenda .agenda-row[class*="agenda-birthday"] {
  padding-left: .85rem;
}

.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.filter-nav a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  padding: .55rem .85rem;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.filter-nav a[aria-current="page"] {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
}
.pagination {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.pagination a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  padding: 0 .5rem;
  font-weight: 650;
}
.pagination span { color: var(--muted); font-size: .9rem; }

.content-flow { display: grid; gap: 1rem; }
.prose p { max-width: 70ch; margin-bottom: 0; font-size: 1.05rem; line-height: 1.65; }
.summary-list {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.summary-list > div {
  display: grid;
  grid-template-columns: minmax(8rem, .65fr) 1.35fr;
  gap: 1rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
}
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.inline-form { display: flex; align-items: flex-end; gap: 1rem; }
.inline-form .field { flex: 1; margin: 0; }
.list-row > .inline-form { min-width: 0; }
.list-row > .inline-form input,
.list-row > .inline-form select { min-width: 0; max-width: 100%; }
.details-block, .details-help {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.details-block summary, .details-help summary {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  padding: .7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
.details-block[open] summary, .details-help[open] summary { border-bottom: 1px solid var(--line); }
.details-help { margin-bottom: 1.25rem; }
.details-help p { padding: 0 1rem 1rem; }
.revision-list > div {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.revision-list > div:last-child { border-bottom: 0; }

.form-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.form-card p, .field { margin: 0 0 1.25rem; }
.form-card label, .field label { display: block; margin-bottom: .35rem; font-weight: 700; }
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: .75rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: .75rem;
}
.form-card input:not([type="checkbox"]):not([type="radio"]):focus,
.form-card select:focus,
.form-card textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
}
.form-card textarea, .field textarea { min-height: 9rem; resize: vertical; }
.form-card input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  margin-right: .5rem;
  vertical-align: middle;
}
.form-card p:has(> input[type="checkbox"]) {
  min-height: var(--touch);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.form-card p:has(> input[type="checkbox"]) label {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.form-card p:has(> input[type="checkbox"]) input { margin: 0; }
.field-hint, .helptext {
  display: block;
  margin: -.1rem 0 .45rem;
  color: var(--muted);
  font-size: .9rem;
}
.errorlist {
  margin: 0 0 .4rem;
  padding-left: 1.25rem;
  color: var(--danger);
  font-weight: 650;
}
.error-summary {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--danger-soft);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
}
.error-summary h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.error-summary p { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.balance-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.balance-row > div {
  min-width: 12rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.balance-row span, .balance-row strong { display: block; }
.balance-row span { color: var(--muted); font-size: .9rem; }
.balance-row strong { margin-top: .15rem; font-size: 1.65rem; color: var(--brand-ink); }

.payment-hints {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.payment-hints h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.payment-hints .payment-note { margin: 0 0 .5rem; color: var(--text); }
.payment-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.payment-options li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.payment-link {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.iban-label { color: var(--muted); font-size: .85rem; font-weight: 700; }
.iban-value, .payment-options code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.copy-iban {
  min-height: var(--touch);
  padding: .35rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}
.copy-iban:hover { background: var(--bg-accent); }
.copy-iban.copied { color: var(--success); border-color: var(--success); }
.payment-privacy { margin: .75rem 0 0; color: var(--muted); font-size: .82rem; }

.table-wrap {
  position: relative; /* hält .sr-only im Scrollbereich (siehe .table-responsive) */
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.responsive-table { width: 100%; border-collapse: collapse; }
.responsive-table caption { padding: .8rem 1rem; text-align: left; font-weight: 750; }
.responsive-table th, .responsive-table td {
  padding: .75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}
.responsive-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .82rem;
}
.responsive-table td small { display: block; color: var(--muted); }
.responsive-table .amount {
  text-align: right;
  color: var(--success);
  font-weight: 750;
  white-space: nowrap;
}
.responsive-table .amount.negative { color: var(--danger); }

.birthday-list-clean article {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.birthday-list-clean article:last-child { border-bottom: 0; }
.birthday-list-clean time { color: var(--brand); font-weight: 750; }
.feed-list-clean article { padding: 1rem; border-bottom: 1px solid var(--line); }
.feed-list-clean article:last-child { border-bottom: 0; }
.feed-list-clean article > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  color: var(--muted);
  font-size: .85rem;
}
.feed-list-clean h2 { margin: .25rem 0; font-size: 1.05rem; }
.feed-list-clean p { max-width: 70ch; margin: .25rem 0 0; color: var(--muted); }
.notice {
  max-width: 70ch;
  padding: .75rem 1rem;
  background: var(--warning-soft);
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.sources { margin-top: 1rem; }
.sources > div {
  display: grid;
  gap: .15rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.sources span { color: var(--muted); font-size: .85rem; }

.more-list {
  max-width: 48rem;
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.more-list a {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .85rem 1.1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.more-list a:last-child { border-bottom: 0; }
.more-list a:hover { background: var(--surface-soft); }
.more-list strong, .more-list span { display: block; }
.more-list span { color: var(--muted); font-size: .9rem; }

/* Modern Wachen-Zentrale Hub / More Menu UI */
.more-hub-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 76rem;
  margin: 0 auto;
}

.more-search-box {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.more-search-box:focus-within { border-color: var(--brand); outline: 3px solid var(--focus); outline-offset: 1px; }
.more-search-box .icon { color: var(--muted); }
.more-search-input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}
.more-category-block { display: flex; flex-direction: column; gap: .75rem; }
.more-category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
}
.more-category-title { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.more-category-count { color: var(--muted); font-size: .875rem; font-weight: 600; }
.more-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: .75rem;
}
/* Karte: Symbol, Titel, kurzer Text. Ruhig – kein Anheben beim Überfahren. */
.more-card-item {
  min-height: 5.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .25rem .9rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.more-card-item:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.more-card-top { display: contents; }
.more-card-icon {
  grid-row: span 2;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.more-card-icon .icon { width: 1.5rem; height: 1.5rem; }
.more-card-tag {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
  padding: .1rem .5rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
}
.more-card-title { display: block; margin-bottom: .2rem; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.more-card-desc { display: block; font-size: .9rem; color: var(--muted); line-height: 1.4; }

.member-list-clean article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem 6rem auto;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.member-list-clean article:last-child { border-bottom: 0; }
.member-list-clean article div { min-width: 0; }
.member-list-clean article div strong,
.member-list-clean article div span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-list-clean article div span { color: var(--muted); font-size: .85rem; }
.member-list-clean article > a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}
.access-panel {
  max-width: 26rem;
  margin: 5vh auto 0;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius-lg);
}
.access-panel h1 {
  margin: .25rem 0 .75rem;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
}
.access-panel .form-card {
  padding: 0;
  border: 0;
  background: transparent;
}
.offline-panel .form-actions { margin-top: 1.25rem; }
.empty-state { margin: 0; padding: 1rem; color: var(--muted); }

.day-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 1rem;
}
.day-switcher strong { text-align: center; }
.task-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.legend-chip,
.status-label.band-daily,
.status-label.band-weekday,
.status-label.band-extra {
  min-height: 1.75rem;
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: .5rem;
  font-size: .78rem;
  font-weight: 750;
}
.legend-chip.band-daily,
.status-label.band-daily,
.task-band.band-daily,
.week-task.band-daily { --band: var(--success); --band-soft: var(--success-soft); }
.legend-chip.band-weekday,
.status-label.band-weekday,
.task-band.band-weekday,
.week-task.band-weekday { --band: var(--warning); --band-soft: var(--warning-soft); }
.legend-chip.band-extra,
.status-label.band-extra,
.task-band.band-extra,
.week-task.band-extra { --band: var(--brand); --band-soft: var(--accent-soft); }
.legend-chip {
  color: var(--band);
  background: var(--band-soft);
  border: 1px solid color-mix(in srgb, var(--band) 28%, transparent);
}
.status-label.band-daily,
.status-label.band-weekday,
.status-label.band-extra {
  color: var(--band);
  background: var(--band-soft);
  border-color: color-mix(in srgb, var(--band) 28%, transparent);
}

.task-band {
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--band);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.task-band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: .85rem 1rem;
  background: var(--band-soft);
}
.task-band-head h2 { margin: 0; font-size: 1.15rem; }
.task-band-head span { color: var(--band); font-size: .9rem; font-weight: 700; }
.task-list { display: grid; }
.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--line);
}
.task-row.is-done { background: var(--surface-soft); }
/* Zeile: nur der Randstreifen (Zustand); die Pillenfläche gehört zu .urgency-pill. */
.task-row.urgency-overdue { border-left: 4px solid var(--danger); }
.task-row.urgency-critical { border-left: 4px solid var(--danger); }
.task-row.urgency-warning { border-left: 4px solid var(--warning-accent); }
.task-row.urgency-ok { border-left: 4px solid var(--success); }

.urgency-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  border-radius: .5rem;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.urgency-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}
:is(.urgency-pill, .legend-chip).urgency-ok {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}
:is(.urgency-pill, .legend-chip).urgency-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning-accent) 45%, transparent);
}
:is(.urgency-pill, .legend-chip).urgency-warning .urgency-dot { background: var(--warning-accent); }
:is(.urgency-pill, .legend-chip).urgency-critical {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
:is(.urgency-pill, .legend-chip).urgency-overdue {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  font-weight: 800;
}
:is(.urgency-pill, .legend-chip).urgency-done {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
}
.task-main {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-width: min(100%, 28rem);
  flex: 1;
}
.task-main strong, .task-main small { display: block; }
.task-main small { color: var(--muted); font-size: .85rem; }

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(10rem, 1fr));
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .5rem;
}
.week-day {
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.week-day.is-today {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.week-day > header strong,
.week-day > header span,
.week-day > header small { display: block; }
.week-day > header small { color: var(--muted); margin-top: .2rem; }
.week-day-tasks { display: grid; gap: .45rem; flex: 1; }
.week-task { margin: 0; }
.week-task button {
  width: 100%;
  min-height: var(--touch);
  display: grid;
  gap: .25rem;
  padding: .55rem .6rem;
  text-align: left;
  color: var(--text);
  background: var(--band-soft);
  border: 1px solid color-mix(in srgb, var(--band) 22%, transparent);
  border-left: 4px solid var(--band);
  border-radius: .5rem;
  cursor: pointer;
}
.week-task.is-done button { opacity: .72; }
.week-task button strong { font-size: .9rem; line-height: 1.25; }

@media (display-mode: standalone) {
  .site-footer { display: none; }
  .app-header { padding-top: .15rem; }
}

@media (max-width: 64rem) {
  .overview-layout { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .page-shell { padding-top: 1.5rem; }
}

@media (max-width: 48rem) {
  body.has-app-nav { padding-bottom: calc(var(--nav-height) + var(--safe-bottom)); }
  .header-inner, .page-shell, .site-footer, .install-banner {
    width: min(100% - 1.25rem, var(--content));
  }
  .header-inner { min-height: 3.5rem; }
  .brand-logo { height: 2.1rem; }
  .header-station { display: none; }
  .brand small, .identity strong { display: none; }
  .identity span { max-width: 11rem; color: var(--muted); }
  .app-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: none;
  }
  .nav-inner { width: 100%; justify-content: stretch; }
  .app-nav a {
    min-width: 0;
    min-height: var(--nav-height);
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    padding: .35rem .2rem;
    border-top: 3px solid transparent;
    border-bottom: 0;
    font-size: .78rem;
  }
  .app-nav a[aria-current="page"] {
    border-top-color: var(--brand);
    background: var(--primary-container);
  }
  .nav-icon { width: 1.45rem; height: 1.45rem; }
  .page-shell { min-height: calc(100dvh - 9rem); padding: 1.25rem 0 2rem; }
  .site-footer { flex-direction: column; padding-bottom: 1.5rem; }
  .heading-with-action { align-items: stretch; flex-direction: column; gap: 1rem; }
  .heading-with-action .button { align-self: stretch; }
  .page-heading { margin-bottom: 1.25rem; }
  .page-heading h1 { font-size: 1.85rem; }
  .list-row { grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: .85rem; }
  .list-row .status-label { grid-column: 1; grid-row: 1; }
  .list-row .row-content { grid-column: 1 / -1; grid-row: 2; }
  .list-row time { grid-column: 2; grid-row: 1; }
  .agenda-row { grid-template-columns: 4.2rem minmax(0, 1fr); padding-inline: .85rem; }
  .summary-list > div { grid-template-columns: 1fr; gap: .15rem; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .list-row > .inline-form { width: 100%; grid-column: 1 / -1; }
  .revision-list > div { grid-template-columns: 1fr; gap: .15rem; }
  .form-card { padding: 1rem; }
  .form-actions { flex-direction: column; }
  .form-actions .button { width: 100%; }
  .balance-row > div { min-width: 0; flex: 1; }
  .member-list-clean article { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .member-list-clean article > span:not(.status-label) { grid-column: 1; }
  .member-list-clean article .status-label { grid-column: 2; grid-row: 1; }
  .member-list-clean article > a { grid-column: 1 / -1; }
  .responsive-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: .65rem .85rem; border-top: 1px solid var(--line); }
  .responsive-table td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: .75rem;
    padding: .35rem 0;
    border: 0;
    text-align: left !important;
  }
  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
  }
  .responsive-table td[colspan] { display: block; }
  .table-wrap { overflow: visible; }
  .install-banner { flex-direction: column; align-items: stretch; }
  .install-actions .button { flex: 1; }
}

@media (max-width: 22rem) {
  .identity { display: none; }
  .app-nav a { font-size: .72rem; }
  .pagination { justify-content: space-between; gap: .25rem; }
  .pagination span { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .page-shell > *:not(.messages),
  .app-nav a,
  .button,
  .list-row,
  .more-list a,
  .quick-actions a {
    animation: none !important;
    transition: none !important;
  }
}

.account-link { color: inherit; text-decoration: none; }
.account-link:hover { text-decoration: underline; }
.avatar-panel {
  display: grid;
  gap: 1rem;
  justify-items: start;
  margin-bottom: 1.5rem;
}
.avatar-preview,
.avatar-fallback,
.chat-avatar,
.chat-avatar img {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-preview { width: 6rem; height: 6rem; border: 1px solid var(--line); }
.avatar-fallback,
.chat-avatar span {
  display: grid;
  place-items: center;
  background: var(--primary-container);
  color: var(--brand-deep);
  font-weight: 700;
  letter-spacing: .04em;
}
.chat-thread {
  max-width: 42rem;
  display: grid;
  gap: .85rem;
  margin: 0 auto 1.5rem;
}
.chat-bubble {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.chat-bubble.is-own {
  background: var(--primary-container);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
}
.chat-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .85rem;
}
.chat-bubble p { margin: 0; }
.chat-body form { margin-top: .5rem; }
.chat-compose { margin: 0 auto 2rem; }
.chat-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}
.chat-tabs a {
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
}
.chat-tabs a[aria-current="page"] {
  border-color: var(--brand);
  background: var(--primary-container);
  color: var(--brand-deep);
  font-weight: 700;
}
.crypto-tag {
  display: inline-block;
  margin-top: .35rem;
  color: var(--brand-deep);
  font-size: .8rem;
  font-weight: 600;
}
.recipient-picks {
  display: grid;
  gap: .35rem;
  margin: .5rem 0 1rem;
}
.passkey-login { margin-top: 1.5rem; }
/* Kalenderquellen auf einen Blick unterscheidbar: Feiertag, Müll, Geburtstag.
   Der Balken liegt als Rahmen AUSSERHALB des Inhalts, sonst überdeckt er die
   Datumszahlen in der ersten Spalte. */
/* Sonderzeilen leise: nur eine schmale Kante in der Kategoriefarbe – Feiertage
   sind Information, keine Warnung, und dürfen nicht lauter sein als diese. */
.agenda-holiday, .agenda-waste, .agenda-birthday { border-left: 3px solid var(--line-strong); }
.agenda-holiday { border-left-color: var(--danger); }
.agenda-waste { border-left-color: var(--success); }
.agenda-birthday { border-left-color: var(--violet); }

/* Organisationsprofile: gleiche Informationsarchitektur, eigene Aktionsfarbe.
   Jede Farbe hat eine Nachtvariante; Rettungsdienst nutzt die Grund-Tokens. */
.profile-fire {
  --brand: #9f1d20;
  --brand-deep: #7a1518;
  --accent: #9f1d20;
  --accent-dark: #7a1518;
  --accent-soft: #fbe9e6;
  --primary-container: #fbe9e6;
}
.profile-police {
  --brand: #17506b;
  --brand-deep: #103b50;
  --accent: #17506b;
  --accent-dark: #103b50;
  --accent-soft: #e1eff3;
  --primary-container: #e1eff3;
}
.profile-general {
  --brand: #3f4f61;
  --brand-deep: #2c3846;
  --accent: #3f4f61;
  --accent-dark: #2c3846;
  --accent-soft: #e8edf2;
  --primary-container: #e8edf2;
}
:root[data-theme="dark"] .profile-fire { --brand: #ff9e8f; --brand-deep: #ffbcb2; --accent: #ff9e8f; --accent-dark: #ffbcb2; --accent-soft: #3d1a17; --primary-container: #3d1a17; }
:root[data-theme="dark"] .profile-police { --brand: #8fd0e2; --brand-deep: #b5e1ed; --accent: #8fd0e2; --accent-dark: #b5e1ed; --accent-soft: #13313d; --primary-container: #13313d; }
:root[data-theme="dark"] .profile-general { --brand: #b9c6d3; --brand-deep: #d3dce5; --accent: #b9c6d3; --accent-dark: #d3dce5; --accent-soft: #222d38; --primary-container: #222d38; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .profile-fire { --brand: #ff9e8f; --brand-deep: #ffbcb2; --accent: #ff9e8f; --accent-dark: #ffbcb2; --accent-soft: #3d1a17; --primary-container: #3d1a17; }
  :root:not([data-theme="light"]) .profile-police { --brand: #8fd0e2; --brand-deep: #b5e1ed; --accent: #8fd0e2; --accent-dark: #b5e1ed; --accent-soft: #13313d; --primary-container: #13313d; }
  :root:not([data-theme="light"]) .profile-general { --brand: #b9c6d3; --brand-deep: #d3dce5; --accent: #b9c6d3; --accent-dark: #d3dce5; --accent-soft: #222d38; --primary-container: #222d38; }
}

/* —— Public navigation & privacy section styles —— */
.public-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.public-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 .75rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.public-nav a:hover {
  background: var(--surface-soft);
}
.public-nav a[aria-current="page"] {
  color: var(--brand);
  background: var(--accent-soft);
  border-color: var(--brand);
}
.public-nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 48rem) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: .5rem;
    padding-top: .4rem;
    padding-bottom: .4rem;
  }
  .public-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: .5rem;
    border-top: 1px solid var(--line);
    padding-top: .25rem;
  }
}

.privacy-blocker-warning {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--warning-soft);
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  color: var(--text);
}
.privacy-blocker-warning .blocker-title {
  margin: 0 0 .5rem;
  font-size: 1.05rem;
}
.privacy-blocker-warning p:last-child {
  margin-bottom: 0;
}

.toc {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toc-title {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
  color: var(--brand-ink);
}
.toc-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.toc-list li {
  margin: 0;
}
.toc-list a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
  padding: .25rem .5rem;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
  border-radius: var(--radius);
}
.toc-list a:hover {
  color: var(--brand-deep);
  background: var(--surface-soft);
}
.toc-list a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.privacy-section {
  scroll-margin-top: 5rem;
  margin-bottom: 2.5rem;
}
.privacy-section h2 {
  scroll-margin-top: 5rem;
}
.cookie-attributes {
  margin: .5rem 0 0;
  padding-left: 1.25rem;
}
.cookie-attributes li {
  margin-bottom: .25rem;
}

/* Ersteinrichtung: Code-Eingabe am Touch-Bildschirm und Abschluss-Checkliste */
.setup-code-input {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-steps { display: grid; gap: 0.8rem; padding-left: 2.2rem; }
.setup-steps li { line-height: 1.5; }

/* ==========================================================================
   Wachbuch Klar 2 – App-Rahmen und Basiskomponenten
   Steht bewusst am Ende von app.css: ersetzt ältere Regeln gleicher
   Spezifität. Farben ausschließlich über Tokens (hell und Nachtdienst).
   ========================================================================== */

/* —— Icons (Sprite core/static/core/icons.svg, Partial core/_icon.html) —— */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* —— Kopfleiste —— */
.app-header {
  position: relative;
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 3.75rem; }
.brand {
  gap: .6rem;
  color: var(--text);
}
.header-station {
  color: var(--muted);
  font-weight: 600;
}
.identity span { color: var(--muted); font-size: .85rem; }
.identity strong a { color: var(--text); }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.icon-button,
.logout-form button {
  min-width: var(--touch);
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 0 .8rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}
.icon-button { padding: 0; }
.icon-button:hover,
.logout-form button:hover { background: var(--surface-soft); }
.header-login {
  color: var(--brand) !important;
  background: transparent !important;
  border-color: var(--brand) !important;
}
.header-login:hover { background: var(--accent-soft) !important; }
/* Ein Symbol je Zustand: Mond im hellen, Sonne im dunklen Modus. */
.theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: inline; }
}

/* —— Hauptnavigation —— */
.app-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.app-nav a {
  gap: .5rem;
  color: var(--muted);
  font-weight: 600;
}
.app-nav a:hover { background: var(--surface-soft); color: var(--text); }
.app-nav a[aria-current="page"] {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
}
.nav-badge {
  color: var(--on-strong);
  background: var(--stripe-red);
  font-weight: 700;
}
.nav-inner { scrollbar-color: var(--line-strong) transparent; }
.nav-inner::-webkit-scrollbar-thumb { background: var(--line-strong); }

@media (max-width: 48rem) {
  .identity span { color: var(--muted); }
  .app-nav {
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: none;
  }
  .app-nav a {
    gap: .25rem;
    border-top: 0;
    font-size: .78rem;
    font-weight: 600;
  }
  .app-nav a .icon {
    width: 3.25rem;
    height: 1.9rem;
    padding: .3rem 0;
    border-radius: 999px;
  }
  .app-nav a[aria-current="page"] { background: transparent; }
  .app-nav a[aria-current="page"] .icon { background: var(--accent-soft); }
  .logout-form .logout-label { display: none; }
}

/* —— Seitenkopf —— */
.context-line {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.page-heading h1 { letter-spacing: -.02em; }

/* —— Buttons: primary (eine je Ansicht), secondary, ghost, danger —— */
.button {
  gap: .45rem;
  border-width: 1px;
  border-radius: var(--radius);
  font-weight: 700;
}
.button.primary {
  color: var(--on-primary);
  background: var(--brand);
  border-color: var(--brand);
}
.button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.button.secondary {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--line-strong);
}
.button.secondary:hover { background: var(--accent-soft); border-color: var(--brand); }
.button.ghost {
  color: var(--brand);
  background: transparent;
  border-color: transparent;
}
.button.ghost:hover { background: var(--accent-soft); }
.button.danger {
  color: var(--danger);
  background: var(--surface);
  border-color: currentColor;
}
.button.danger:hover { background: var(--danger-soft); }
.button[disabled], .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* —— Flächen —— */
.section-block,
.card,
.form-card,
.summary-list,
.details-block,
.details-help,
.install-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card { border-radius: var(--radius-lg); }

/* Kennzahlen: Zahl groß, Bedeutung darunter; Farbe nur bei Handlungsbedarf. */
.kpi-card {
  border-left-width: 1px;
  border-left-color: var(--line);
}
.kpi-card.border-danger { border-left: 4px solid var(--danger); }
.kpi-card.border-warning { border-left: 4px solid var(--warning-accent); }
.kpi-card.border-success { border-left-color: var(--line); }
.kpi-value { font-weight: 700; letter-spacing: -.02em; }

/* Übersichtskacheln: Rand nur, wenn wirklich etwas zu tun ist. */
.quick-actions a {
  border-left: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.quick-actions a:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.quick-actions a.has-attention,
.operations-summary .quick-actions a.has-attention {
  border-left: 4px solid var(--warning-accent);
}
.quick-actions strong { font-size: 1.05rem; }

.status-pill { border-radius: var(--radius); font-weight: 600; }
.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

/* —— Etiketten: Text in Lesefarbe, Zustand als Punkt und Rand —— */
.status-label,
.badge {
  min-height: 1.75rem;
  gap: .4rem;
  padding: .15rem .55rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 700;
}
.status-label::before,
.badge-pass::before,
.badge-fail::before {
  content: "";
  width: .5rem;
  height: .5rem;
  flex: none;
  border-radius: 50%;
  background: var(--line-strong);
}
/* Zuordnung wie in der Flutter-App: dringend = danger, offen = info,
   in Arbeit = warning, wartend = neutral, erledigt = success. Die Klassen
   .danger/.warning/.info/.success sind Töne für Zustände ohne Modellstatus
   (z. B. „Außer Betrieb“, „Eingeschränkt“). */
.status-label.priority-urgent,
.status-label.danger,
.badge-fail {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.status-label.priority-urgent::before,
.status-label.danger::before,
.badge-fail::before { background: var(--danger); }
.status-label.priority-important,
.status-label.warning,
.status-label.status-in_progress {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning-accent) 55%, transparent);
}
.status-label.priority-important::before,
.status-label.warning::before,
.status-label.status-in_progress::before { background: var(--warning-accent); }
.status-label.priority-normal,
.status-label.priority-info,
.status-label.priority-event,
.status-label.neutral,
.status-label.info,
.status-label.status-open {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
.status-label.priority-normal::before,
.status-label.priority-info::before,
.status-label.priority-event::before,
.status-label.neutral::before,
.status-label.info::before,
.status-label.status-open::before { background: var(--brand); }
.status-label.status-waiting {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
.status-label.status-waiting::before { background: var(--line-strong); }
.status-label.success,
.status-label.status-done,
.badge-pass {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}
.status-label.success::before,
.status-label.status-done::before,
.badge-pass::before { background: var(--success); }

/* —— Hinweise —— */
.message,
.notice,
.alert,
.callout {
  color: var(--text);
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
}
.message.success, .alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); border-left-color: var(--success); }
.message.warning, .alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning-accent) 45%, transparent); border-left-color: var(--warning-accent); }
.message.error, .alert-danger, .alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); border-left-color: var(--danger); }
.connection-chip {
  color: var(--warning);
  background: var(--warning-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warning-accent) 45%, transparent);
}

/* —— Formulare —— */
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.field input,
.field select,
.field textarea,
.form-input,
.form-select,
.form-control {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.form-card input:not([type="checkbox"]):not([type="radio"]):focus,
.form-card select:focus,
.form-card textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.form-input:focus,
.form-select:focus,
.form-control:focus {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.helptext, .help-text {
  display: block;
  margin-top: .3rem;
  color: var(--muted);
  font-size: .9rem;
}
.errorlist, .field-error {
  margin: .3rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-weight: 600;
}
::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }

/* —— Listen —— */
.list-row:hover { background: var(--surface-soft); }

/* —— Leere Zustände: Hinweis, was als Nächstes zu tun ist —— */
.empty-state {
  padding: 1.5rem 1rem;
  color: var(--muted);
  text-align: left;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: transparent;
}
.empty-state strong { display: block; margin-bottom: .25rem; color: var(--text); }

/* —— Hilfsklassen, die Templates nutzen —— */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.row-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.form-field { margin: 0 0 1.25rem; }
.form-field label { display: block; margin-bottom: .35rem; font-weight: 700; }
.list-stack { display: grid; gap: .75rem; }

/* —— Fehlerseiten —— */
.page-error .page-shell { display: grid; place-items: start; padding-top: 2.5rem; }
.error-shell {
  width: min(40rem, 100%);
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.error-code {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.error-shell h1 { margin: .25rem 0 .75rem; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.error-message { margin: 0 0 1.5rem; color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.error-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.error-meta, .error-support { margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; }
.error-meta code { font-family: var(--mono); overflow-wrap: anywhere; }

/* —— Fuß —— */
.site-footer { color: var(--muted); border-top-color: var(--line); }

/* —— Dialoge —— */
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
}
dialog::backdrop { background: var(--scrim); }

/* Kacheln innerhalb eines Abschnitts: Fläche statt zweitem Rahmen. */
.section-block .quick-actions a {
  background: var(--surface-soft);
  border-color: transparent;
}
.section-block .quick-actions a:hover { border-color: var(--line-strong); }

@media (max-width: 48rem) {
  .app-nav a { position: relative; }
  .app-nav .nav-badge {
    position: absolute;
    top: .35rem;
    left: calc(50% + .5rem);
    margin: 0;
  }
}

/* ==========================================================================
   Übersicht: zuerst, was Aufmerksamkeit braucht
   ========================================================================== */
.dashboard-head h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }

.attention-board { margin: 0 0 1rem; }
.attention-board ul {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.attention-board li + li { border-top: 1px solid var(--line); }
.attention-row {
  min-height: 4.25rem;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .25rem 1rem;
  padding: .75rem 1rem .75rem 0;
  color: var(--text);
  text-decoration: none;
  border-left: 4px solid var(--warning-accent);
}
.attention-row.tone-danger { border-left-color: var(--danger); }
.attention-row:hover { background: var(--surface-soft); }
.attention-value {
  justify-self: end;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.tone-danger .attention-value { color: var(--danger); }
.tone-warning .attention-value { color: var(--warning); }
.attention-text strong { display: block; font-size: 1.05rem; }
.attention-text small { display: block; color: var(--muted); }
.attention-chevron { color: var(--muted); }

.calm-line {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
}
.calm-line .icon { margin-top: .15rem; color: var(--success); }
.calm-line a { color: inherit; text-decoration-color: var(--line-strong); }
.calm-line a:hover { color: var(--text); }

.overview-aside { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.task-progress {
  display: grid;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
}
.task-progress:hover { border-color: var(--line-strong); }
.task-progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.task-progress-head .tabular { font-size: 1.25rem; font-weight: 700; }
.task-progress small { color: var(--muted); }
.task-progress progress {
  width: 100%;
  height: .5rem;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
}
.task-progress progress::-webkit-progress-bar { background: var(--surface-soft); }
.task-progress progress::-webkit-progress-value { background: var(--success); border-radius: 999px; }
.task-progress progress::-moz-progress-bar { background: var(--success); border-radius: 999px; }

/* Zwei-Faktor-Einrichtung und Impressum */
.mfa-steps { display: grid; gap: 1rem; padding-left: 1.4rem; }
.mfa-qr { margin: .75rem 0; }
.mfa-qr img { display: block; background: #fff; padding: .5rem; border-radius: var(--radius); border: 1px solid var(--line); }
.mfa-key { display: inline-block; margin-top: .4rem; font-size: 1.05rem; letter-spacing: .06em; word-spacing: .3em; overflow-wrap: anywhere; }
.legal-card h2 { margin: 1.25rem 0 .35rem; font-size: 1.05rem; }
.legal-card h2:first-child { margin-top: 0; }

/* Kaffeekasse: Monatsübersicht („Mappe“), Kasse, Bezahlen */
.coffee-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.coffee-section { margin: 0 0 1.75rem; }
.coffee-section > h2, .coffee-section .heading-with-action h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
.balance-row > div.is-open { border-color: var(--warning); background: var(--warning-soft); }
.balance-row > div.is-open strong { color: var(--warning); }
.balance-row > div.is-clear strong { color: var(--success); }
.coffee-months {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: .5rem;
}
.coffee-month {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.coffee-month-name { font-weight: 700; }
.coffee-month-state { color: var(--muted); font-size: .88rem; }
.coffee-month.is-paid { border-color: var(--success); background: var(--success-soft); }
.coffee-month.is-paid .coffee-month-state { color: var(--success); font-weight: 700; }
.coffee-month.is-open { border-color: var(--warning); background: var(--warning-soft); }
.coffee-month.is-open .coffee-month-state { color: var(--warning); font-weight: 700; }
.coffee-month.is-waived .coffee-month-state { color: var(--info); }
.coffee-girocode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0;
}
.coffee-girocode img { background: #fff; padding: .4rem; border-radius: var(--radius); border: 1px solid var(--line); }
.coffee-girocode figcaption { display: flex; flex-direction: column; gap: .2rem; overflow-wrap: anywhere; }
.coffee-count-note { margin: 0 0 .75rem; color: var(--muted); }
.coffee-movements { list-style: none; margin: 0 0 1rem; padding: 0; }
.coffee-movements li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
}
.coffee-movements li span { flex: 1; min-width: 10rem; }
.amount.negative { color: var(--danger); }
.choice-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; margin: 0 0 1.25rem; border: 0; padding: 0; }
.choice-tiles legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.choice-tile {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: var(--touch);
  padding: .75rem .9rem;
  border: 2px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
}
.choice-tile:has(input:checked) { border-color: var(--brand); background: var(--primary-container); }
.choice-tile input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--brand); }
.quick-amounts { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.5rem 0 1.25rem; }
.quick-amounts a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--text);
  text-decoration: none;
  padding: .4rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}
.quick-amounts a[aria-current="true"] { border-color: var(--brand); background: var(--primary-container); }
.coffee-book th, .coffee-book td { white-space: nowrap; }
.coffee-book td.coffee-cell { text-align: center; }
.coffee-cell .coffee-badge {
  display: inline-block;
  min-width: 4.5rem;
  padding: .2rem .45rem;
  border-radius: .5rem;
  font-size: .85rem;
  font-weight: 700;
}
.coffee-badge.is-paid { color: var(--success); background: var(--success-soft); }
.coffee-badge.is-open { color: var(--warning); background: var(--warning-soft); }
.coffee-badge.is-waived { color: var(--info); background: var(--info-soft); }
.coffee-badge.is-none { color: var(--muted); }
.coffee-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.coffee-row-actions form { margin: 0; }
.coffee-waive summary { cursor: pointer; color: var(--accent-dark); font-weight: 700; font-size: .85rem; }
.coffee-waive form { display: flex; flex-direction: column; gap: .35rem; margin-top: .35rem; }
.coffee-waive input { min-height: 2.5rem; padding: .3rem .5rem; border: 1px solid var(--line-strong); border-radius: .5rem; }
@media (max-width: 40rem) {
  .coffee-section .balance-row > div, .balance-row.coffee-pots > div { min-width: 0; flex: 1 1 calc(50% - .5rem); }
  .coffee-section .balance-row strong { font-size: 1.3rem; }
}
.year-switch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .75rem;
}
.year-switch h2, .year-switch h3 { margin: 0; text-align: center; font-size: 1.15rem; }
.coffee-month.is-future, .coffee-month.is-none { opacity: .55; }
.coffee-book th.is-current, .coffee-book td.is-current { background: var(--primary-container); }
.coffee-book tfoot th, .coffee-book tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.coffee-book th[scope="row"] small { display: block; color: var(--muted); font-weight: 400; }
.coffee-badge.is-future { min-width: 1.5rem; }
.setup-steps li > span { display: block; color: var(--muted); }
.setup-steps li.is-done > strong { color: var(--success); }
.setup-steps .form-card { margin-top: .6rem; }
.coffee-book { font-size: .92rem; }
.coffee-book th, .coffee-book td { padding: .45rem .3rem; }
.coffee-book .coffee-badge { min-width: 2.4rem; padding: .2rem .35rem; }
.coffee-book .coffee-waive summary { font-size: .78rem; }
.coffee-email-pref { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0 0; color: var(--muted); }
.coffee-row-mail { margin: 0 0 .3rem; }
.coffee-mail-card { margin-top: 1rem; }
button.text-action {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  text-decoration: underline;
  cursor: pointer;
}

/* Öffentliche Demo: Banner mit Ablaufzeit und Rollenwechsel (docs/DEMO.md) */
.demo-bar {
  background: var(--warning-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--warning-accent) 55%, transparent);
  color: var(--text);
}
.demo-bar-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}
.demo-bar-text { margin: 0; flex: 1 1 22rem; }
.demo-bar-short { display: none; }
.demo-bar-role { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.demo-bar-role label { font-weight: 600; }
.demo-bar-role select { min-height: var(--touch); }
.demo-login-hint { margin-bottom: 1rem; }
.demo-login-hint p { margin: .25rem 0 0; }
.demo-bar-tour { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; flex: 1 1 100%; }
.demo-bar-tour form { margin: 0; }
.demo-bar-progress { font-weight: 600; }
.demo-bar-here { font-weight: 600; color: var(--accent-dark); }
@media (max-width: 40rem) {
  .demo-bar-inner { padding: .5rem 1rem; gap: .4rem .75rem; }
  .demo-bar-detail { display: none; }
  .demo-bar-short { display: inline; }
  .demo-bar-text { flex: 1 1 100%; }
  .demo-bar-role { flex: 1 1 auto; flex-wrap: nowrap; }
  .demo-bar-role select { flex: 1 1 auto; min-width: 0; }
  .demo-bar-role label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .demo-bar-tour { flex-wrap: nowrap; }
  .demo-bar-tour .button, .demo-bar-tour form { flex: 1 1 auto; }
  .demo-bar-tour form .button { width: 100%; }
}

/* Demo-Rundgang „Dein erster Schichtwechsel“ */
.demo-tour {
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  scroll-margin-top: 1rem;
}
.demo-tour summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  min-height: var(--touch);
}
.demo-tour-title { font-size: 1.15rem; font-weight: 700; }
.demo-tour-count { color: var(--muted); }
.demo-tour-progress { display: block; width: calc(100% - 2.5rem); margin: 0 1.25rem .75rem; height: .5rem; accent-color: var(--success); }
.demo-tour-steps { list-style: none; margin: 0; padding: 0 1.25rem 1rem; display: grid; gap: .5rem; }
.demo-tour-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.demo-tour-step form { margin: 0; }
.demo-tour-step.is-next { background: var(--accent-soft); }
.demo-tour-step.is-done { opacity: .75; }
.demo-tour-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-weight: 700;
}
.demo-tour-step.is-done .demo-tour-mark { background: var(--success); border-color: var(--success); color: var(--on-strong); }
.demo-tour-copy p { margin: .15rem 0 0; color: var(--muted); }
.demo-tour.is-complete { border-color: var(--success); }
.demo-tour-finish {
  display: grid;
  gap: .6rem;
  margin: 0 1.25rem 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--success-soft);
  border-left: 4px solid var(--success);
}
.demo-tour-finish p { margin: 0; }
.demo-tour-finish-title { font-size: 1.1rem; }
.demo-tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; }
.demo-tour-actions form { margin: 0; }
.demo-tour-finish-more { margin: 1rem 0 .25rem; }
.demo-tour-more { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
@media (max-width: 40rem) {
  .demo-tour-step { grid-template-columns: 2rem minmax(0, 1fr); }
  .demo-tour-step .button, .demo-tour-step form { grid-column: 2; justify-self: start; }
}

/* Demo: Beispielnachrichten der Signal-Gruppe */
.signal-preview { display: grid; gap: .5rem; margin: .75rem 0 1rem; padding: 1rem; border-radius: var(--radius-lg); background: var(--surface-soft); }
.signal-bubble { justify-self: start; max-width: 32rem; margin: 0; padding: .6rem .9rem; border-radius: 1rem 1rem 1rem .25rem; background: var(--surface); border: 1px solid var(--line); }

/* Lesebestätigungen einer Übergabe */
.ack-list { list-style: none; margin: .5rem 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.ack-list li { display: inline-flex; align-items: baseline; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; background: var(--success-soft); }
.ack-list time { color: var(--muted); font-size: .85rem; }

/* Posteingang für Rückmeldungen */
.feedback-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .75rem; }
.feedback-entry { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.feedback-entry.status-new { border-left: 4px solid var(--accent); }
.feedback-entry.status-done { opacity: .75; }
.feedback-meta { margin: 0 0 .5rem; color: var(--muted); }
.feedback-meta strong { color: var(--text); }
.feedback-message { margin: 0 0 .75rem; white-space: normal; overflow-wrap: anywhere; }
.feedback-contact { margin: 0 0 .75rem; }
.feedback-entry .form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.feedback-entry .form-actions form { margin: 0; }

/* Öffentliche Demo: „Demo starten“ statt „Anmelden“ im Kopf */
.header-demo { display: flex; margin: 0; }

/* Audit: lesbare Aktion, technischer Code klein darunter */
.audit-table .audit-code { font-family: var(--mono); font-size: .78rem; }

/* Demo-Kennzahlen im Feedback-Posteingang (core/demo_stats.py) */
.demo-stats { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.demo-stats h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.demo-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.demo-stats-grid div { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.demo-stats-grid dt { color: var(--muted); font-size: .88rem; }
.demo-stats-grid dd { margin: .15rem 0 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.demo-stats-grid small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.demo-stats-days summary { display: flex; align-items: center; min-height: var(--touch); font-weight: 600; cursor: pointer; }
