/* ---- Design-Tokens (identisch zu den bestätigten cxa-*-Mockups) ---- */
:root {
  --bg: #F7F4EF;
  --surface: #FFFFFF;
  --surface-quiet: #F1EEE7;
  --text: #1C1B19;
  --muted: #8B8579;
  --accent: var(--accent);
  --accent-soft: #ECEEFC;
  --gold: #D98F2B;
  --gold-soft: #FBEFDD;
  --error: #C0392B;
  --error-soft: #FBEAE8;
  --shadow: 0 1px 2px rgba(28,27,25,0.03), 0 16px 40px rgba(28,27,25,0.07);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Inter", BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

a { color: var(--accent); text-decoration: none; }

/* ---- Layout ---- */
.screen { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 20px 12px;
  position: sticky; top: 0; background: rgba(247,244,239,0.92);
  backdrop-filter: blur(16px); z-index: 10;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.icon-btn-light {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow); border: none; display: flex; align-items: center;
  justify-content: center; font-size: 1rem; color: var(--text); flex-shrink: 0;
}

h1.page-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 4px; }
p.page-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px;
  transition: transform 0.15s ease;
}
.card:active { transform: scale(0.985); }
.card-body { padding: 18px 20px; }
.card-cover {
  height: 140px; background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%);
  position: relative;
}
.card-cover.alt { background: linear-gradient(150deg, #E2E8F0 0%, #CBD5E1 55%, #94A3B8 100%); }
.card-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 2px; }
.card-sub { font-size: 0.85rem; color: var(--muted); margin: 0; }

/* ---- Buttons ---- */
.btn-primary {
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 16px; padding: 15px; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 12px 24px rgba(74,92,224,0.28);
}
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }
.btn-ghost {
  width: 100%; background: var(--surface); color: var(--text); border: none;
  border-radius: 16px; padding: 14px; font-weight: 650; font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.btn-danger-ghost {
  background: var(--error-soft); color: var(--error); border: none;
  border-radius: 14px; padding: 12px 16px; font-weight: 650; font-size: 0.88rem;
}
.btn-small { padding: 10px 16px; border-radius: 12px; font-size: 0.85rem; font-weight: 650; border: none; }
.btn-small.primary { background: var(--accent); color: white; }
.btn-small.ghost { background: var(--surface-quiet); color: var(--text); }

/* ---- Inputs ---- */
label.field-label { display: block; font-size: 0.78rem; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 13px 14px; border: none; border-radius: 14px;
  background: var(--surface-quiet); font-size: 0.95rem; color: var(--text); margin-bottom: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }

/* ---- Chips ---- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-chip {
  border: none; background: var(--surface-quiet); border-radius: 14px;
  padding: 10px 16px; font-size: 0.88rem; font-weight: 600; color: var(--text);
}
.choice-chip.selected { background: var(--accent); color: white; }
.pos-chip { background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding: 8px 13px; font-size: 0.82rem; font-weight: 600; }
.pos-chip .qty { color: var(--accent); font-weight: 700; margin-right: 3px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 650; }
.badge.error { background: var(--error-soft); color: var(--error); }
.badge.warning { background: var(--gold-soft); color: var(--gold); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.role { background: var(--surface-quiet); color: var(--muted); }

/* ---- Empty / Loading / Error States ---- */
.empty-state, .error-state {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty-state-text, .error-state-text { font-size: 0.95rem; margin-bottom: 16px; }
.error-state-text { color: var(--error); }
.skeleton { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px; }
.skeleton-line { height: 14px; border-radius: 7px; background: var(--surface-quiet); margin-bottom: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---- Bottom Nav / FAB ---- */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(247,244,239,0.92); backdrop-filter: blur(20px);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 rgba(28,27,25,0.05);
}

.mic-fab {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--text); color: white; border: none; border-radius: 20px;
  padding: 18px; font-weight: 700; font-size: 1rem; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.mic-fab.recording { background: var(--error); }
.mic-fab:disabled { opacity: 0.45; }

.section-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 22px 0 10px; text-transform: none; }

/* ---- Sheet (Modal) ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(28,27,25,0.4); display: flex;
  align-items: flex-end; z-index: 100;
}
.sheet {
  background: var(--bg); width: 100%; max-height: 88vh; overflow-y: auto;
  border-radius: 28px 28px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}
.sheet-handle { width: 40px; height: 4px; background: var(--surface-quiet); border-radius: 2px; margin: 0 auto 16px; }
.sheet-title { font-size: 1.2rem; font-weight: 750; margin: 0 0 16px; }
.disclosure-toggle { color: var(--accent); font-size: 0.85rem; font-weight: 650; background: none; border: none; padding: 8px 0; }

/* ---- Question Cards (Requirement Engine) ---- */
.question-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.q-context { font-size: 0.76rem; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.q-text { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; }

.auth-card { max-width: 380px; margin: 10vh auto 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px 30px; }
.logo-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin-bottom: 22px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }

.divider-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; margin: 4px 0 14px; }

/* ==========================================================================
   Mikro-Interaktionen (Bugfix-/Polish-Runde)

   Bewusst reine CSS-Animationen/-Transitions, KEINE npm-Abhängigkeit: das
   Frontend hat keinen Build-Schritt (ES-Module direkt im Browser, kein
   Bundler) – eine Animationsbibliothek einzuführen wäre selbst eine
   Architekturänderung (Bundler nötig), obwohl reines CSS hier für JEDE
   geforderte Interaktion ausreicht. Genau das war die Vorgabe: keine
   Dependency, wenn ein leichtgewichtiger Weg ohne sie zum Ziel führt.
   ========================================================================== */

:root {
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 240ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Sheets: weiches Ein-/Ausblenden ------------------------------------ */

@keyframes sheetBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetBackdropOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetSlideIn {
  from { transform: translateY(28px); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1;   }
}
@keyframes sheetSlideOut {
  from { transform: translateY(0);    opacity: 1;   }
  to   { transform: translateY(28px); opacity: 0;   }
}

.sheet-backdrop { animation: sheetBackdropIn var(--duration-base) ease-out both; }
.sheet { animation: sheetSlideIn var(--duration-slow) var(--ease-standard) both; }
.sheet-backdrop.is-closing { animation: sheetBackdropOut var(--duration-fast) ease-in both; }
.sheet-backdrop.is-closing .sheet { animation: sheetSlideOut var(--duration-fast) ease-in both; }

/* --- Tap-Feedback: Zeilen, Karten, Buttons, Chips ------------------------ */

.card, .btn-primary, .btn-ghost, .btn-small, .choice-chip,
.icon-btn-light, .pos-chip, .editable-row {
  transition: transform var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) ease-out,
              opacity var(--duration-fast) ease-out;
}
.card:not(:disabled):active,
.btn-primary:not(:disabled):active,
.btn-ghost:not(:disabled):active,
.btn-small:not(:disabled):active,
.choice-chip:not(:disabled):active,
.icon-btn-light:not(:disabled):active,
.editable-row:not(:disabled):active {
  transform: scale(0.97);
}
.card:not(:disabled):active { transform: scale(0.985); } /* Karten etwas dezenter als Buttons */

.choice-chip { transition: background-color var(--duration-fast) ease-out, color var(--duration-fast) ease-out, transform var(--duration-fast) var(--ease-standard); }

/* --- Werte-Update ohne hartes Springen ----------------------------------- */

@keyframes valueUpdated {
  0%   { opacity: 0.35; transform: translateY(2px); }
  100% { opacity: 1;    transform: translateY(0);    }
}
.value-updated { animation: valueUpdated var(--duration-base) var(--ease-standard) both; }

/* --- Editierbare Zeile (iOS-Einstellungen-Stil) -------------------------- */

.editable-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0; cursor: pointer;
}
.editable-row + .editable-row { border-top: 1px solid rgba(28,27,25,0.06); }
.editable-row .editable-label { font-size: 0.92rem; color: var(--text); font-weight: 550; }
.editable-row .editable-value { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted); }
.editable-row .editable-value.has-value { color: var(--text); font-weight: 600; }
.editable-row .chevron {
  color: var(--muted); font-size: 0.85rem; transition: transform var(--duration-fast) var(--ease-standard);
}
.editable-row:active .chevron { transform: translateX(2px); }

/* --- Disclosure ("Weitere Angaben") ohne JS-Höhenmessung ----------------- */

.disclosure-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-slow) var(--ease-standard);
}
.disclosure-body.open { grid-template-rows: 1fr; }
.disclosure-body > div { overflow: hidden; min-height: 0; }
.disclosure-toggle .chevron { display: inline-block; transition: transform var(--duration-fast) var(--ease-standard); }
.disclosure-toggle.open .chevron { transform: rotate(90deg); }

/* --- prefers-reduced-motion: alles ausschalten, nichts neu definieren --- */

@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;
  }
}

/* ==========================================================================
   Produktisierungs-Runde: Menü, Toasts, Rollen-Auswahl
   ========================================================================== */

/* --- Menü im iOS-Stil: gruppierte Zeilen mit Icon, Text, Chevron --------- */
.menu-group { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.menu-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer;
  transition: background-color var(--duration-fast) ease-out, transform var(--duration-fast) var(--ease-standard);
}
.menu-row + .menu-row { border-top: 1px solid rgba(28,27,25,0.06); }
.menu-row:not(.is-disabled):active { background: var(--surface-quiet); }
.menu-row.is-disabled { opacity: 0.5; cursor: default; }
.menu-icon {
  width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--accent-soft); color: var(--accent);
}
.menu-icon svg { width: 18px; height: 18px; }
.menu-icon.tone-gold { background: var(--gold-soft); color: var(--gold); }
.menu-icon.tone-neutral { background: var(--surface-quiet); color: var(--muted); }
.menu-icon.tone-danger { background: var(--error-soft); color: var(--error); }
.menu-text { flex: 1; min-width: 0; }
.menu-title { font-size: 0.97rem; font-weight: 650; color: var(--text); }
.menu-title.is-danger { color: var(--error); }
.menu-hint { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.menu-row .chevron { color: var(--muted); font-size: 1rem; transition: transform var(--duration-fast) var(--ease-standard); }
.menu-row:not(.is-disabled):active .chevron { transform: translateX(2px); }

.menu-header { display: flex; align-items: center; gap: 14px; padding: 10px 0 20px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; flex-shrink: 0;
}
.avatar.small { width: 40px; height: 40px; font-size: 0.9rem; }

/* --- Rollen-Auswahl als große Karten statt Dropdown ----------------------- */
.role-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--duration-fast) ease-out, transform var(--duration-fast) var(--ease-standard);
}
.role-option.selected { border-color: var(--accent); }
.role-option:active { transform: scale(0.985); }
.role-option .role-title { font-weight: 700; font-size: 0.95rem; }
.role-option .role-hint { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.role-check { margin-left: auto; color: var(--accent); font-weight: 800; opacity: 0; transition: opacity var(--duration-fast) ease-out; }
.role-option.selected .role-check { opacity: 1; }

/* --- Toast: kurze Erfolgs-/Hinweismeldung ---------------------------------- */
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 8px); } }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: white; padding: 12px 18px; border-radius: 14px; font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow); z-index: 200; animation: toastIn var(--duration-base) var(--ease-standard) both;
  max-width: calc(100% - 40px);
}
.toast.is-hiding { animation: toastOut var(--duration-fast) ease-in both; }

/* --- Statuswechsel animiert (aktiv/deaktiviert) --------------------------- */
.card.is-inactive { opacity: 0.55; }
.card { transition: transform var(--duration-fast) var(--ease-standard), opacity var(--duration-base) ease-out, background-color var(--duration-fast) ease-out; }

/* ==========================================================================
   Design-Übertragung: Kennzahlen-Kacheln, Begrüßungs-Header, Mini-Stats

   Übernimmt Qualitätsebene/Kartenstruktur/Typografie einer Referenz-
   Vorlage – bewusst NUR für echte, aus der API geladene Zahlen (Kunde,
   Adresse, Fotos, Projekt-Status/Fortschritt aus der Vorlage sind hier
   bewusst NICHT übernommen, da dafür keine echten Daten existieren).
   ========================================================================== */

.greeting-title { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 2px 0 3px; }
.greeting-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 20px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stat-tile { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 13px 14px; }
.stat-icon {
  width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; margin-bottom: 9px; font-size: 0.95rem;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.tone-blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.tone-green { background: var(--success-soft); color: var(--success); }
.stat-icon.tone-purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon.tone-orange { background: var(--gold-soft); color: var(--gold); }
.stat-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; }
.stat-label { font-size: 0.76rem; font-weight: 600; margin-top: 2px; color: var(--muted); }
.stat-hint { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

.mini-stats { display: flex; gap: 10px; margin: 4px 0 20px; }
.mini-stat { flex: 1; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 14px 10px; text-align: center; }
.mini-stat-value { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.mini-stat-label { font-size: 0.72rem; color: var(--muted); font-weight: 650; margin-top: 3px; }

/* ==========================================================================
   Media-Runde: Hero-Coverbilder (Projekt/Raum)

   Bewusst CSS background-image statt <img src> für Cover: ein
   fehlgeschlagenes Laden zeigt dann einfach den darunterliegenden
   Gradient weiter, NIE das kaputte Bild-Icon (Auftrag, Punkt 1:
   "hochwertiger neutraler Fallback, kein kaputtes Image-Icon").
   ========================================================================== */

.hero-cover {
  position: relative; height: 210px; overflow: hidden;
  background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%);
  background-size: cover; background-position: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 4px;
}
.hero-cover.alt { background: linear-gradient(150deg, #E2E8F0 0%, #CBD5E1 55%, #94A3B8 100%); }
.hero-cover-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}
.hero-nav-btn {
  position: absolute; top: calc(14px + env(safe-area-inset-top));
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(28,27,25,0.38); backdrop-filter: blur(8px);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; z-index: 2;
}
.hero-nav-btn.left { left: 14px; }
.hero-nav-btn.right { right: 14px; }
.hero-title-overlay {
  position: absolute; left: 20px; right: 20px; bottom: 16px; color: #fff; z-index: 1;
}
.hero-title-overlay h1 {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 3px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35); line-height: 1.15;
}
.hero-title-overlay p { font-size: 0.85rem; margin: 0; opacity: 0.94; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ==========================================================================
   Team-/Präsenz-Runde: Status-Chip, Baukalender
   ========================================================================== */

.presence-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 650; padding: 4px 10px 4px 8px; border-radius: 100px;
}
.presence-dot { width: 7px; height: 7px; border-radius: 50%; }
.presence-chip.tone-active { background: var(--success-soft); color: var(--success); }
.presence-chip.tone-active .presence-dot { background: var(--success); }
.presence-chip.tone-recent { background: var(--gold-soft); color: var(--gold); }
.presence-chip.tone-recent .presence-dot { background: var(--gold); }
.presence-chip.tone-muted { background: var(--surface-quiet); color: var(--muted); }
.presence-chip.tone-muted .presence-dot { background: var(--muted); }

/* --- Baukalender --- */

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.cal-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-weekday { text-align: center; font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 20px; }
.cal-grid.is-week .cal-day { aspect-ratio: auto; height: 64px; gap: 2px; }
.cal-day-weekday { font-size: 0.68rem; color: var(--muted); font-weight: 650; }
.cal-grid.is-week .cal-day.is-today .cal-day-weekday { color: rgba(255,255,255,0.8); }
.cal-day {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 0.85rem;
  background: var(--surface); box-shadow: 0 1px 2px rgba(28,27,25,0.03);
  color: var(--text); position: relative;
}
.cal-day.is-outside { opacity: 0.32; box-shadow: none; background: transparent; }
.cal-day.is-today { background: var(--accent); color: #fff; font-weight: 800; }
.cal-day.is-selected:not(.is-today) { box-shadow: 0 0 0 2px var(--accent) inset; }
.cal-day-dots { display: flex; gap: 3px; }
.cal-day-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-day.is-today .cal-day-dot { background: #fff; }

.event-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); margin-bottom: 10px;
}
.event-stripe { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.event-stripe.kind-baustellentermin { background: var(--accent); }
.event-stripe.kind-besprechung { background: var(--gold); }
.event-stripe.kind-montage { background: var(--success); }
.event-stripe.kind-pruefung { background: var(--purple); }
.event-stripe.kind-lieferung { background: var(--teal); }
.event-stripe.kind-dokumentation { background: var(--muted); }
.event-stripe.kind-sonstiges { background: var(--muted); }
.event-time { font-size: 0.78rem; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.event-title { font-size: 0.96rem; font-weight: 700; margin: 0 0 2px; }
.event-meta { font-size: 0.8rem; color: var(--muted); }
.event-status-badge {
  font-size: 0.72rem; font-weight: 650; padding: 3px 9px; border-radius: 100px; flex-shrink: 0;
}
.event-status-badge.status-geplant { background: var(--accent-soft); color: var(--accent); }
.event-status-badge.status-offen { background: var(--surface-quiet); color: var(--muted); }
.event-status-badge.status-in_arbeit { background: var(--gold-soft); color: var(--gold); }
.event-status-badge.status-erledigt { background: var(--success-soft); color: var(--success); }
.event-status-badge.status-abgesagt { background: var(--error-soft); color: var(--error); }

.event-avatars { display: flex; margin-top: 8px; }
.event-avatars .avatar { margin-right: -8px; border: 2px solid var(--surface); width: 26px; height: 26px; font-size: 0.62rem; }
.event-avatar-more { background: var(--surface-quiet); color: var(--muted); }

.filter-chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.filter-chip-row::-webkit-scrollbar { display: none; }

/* ==========================================================================
   Master-Referenz, Block 1: Bottom Navigation
   ========================================================================== */

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(247,244,239,0.94); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(28,27,25,0.07);
  padding: 8px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; flex: 1; padding: 4px 2px; color: var(--muted);
  transition: transform var(--duration-fast) var(--ease-standard), color var(--duration-fast) ease-out;
}
.bottom-nav-tab:not(:disabled):active { transform: scale(0.92); }
.bottom-nav-icon svg { width: 22px; height: 22px; display: block; }
.bottom-nav-label { font-size: 0.66rem; font-weight: 650; }
.bottom-nav-tab.is-active { color: var(--accent); }

#view-root.has-bottom-nav { padding-bottom: 78px; }

/* Home-spezifische Suche - dieselbe Feld-Optik wie sonst, keine Neuerfindung */
#home-search { -webkit-appearance: none; appearance: none; }

/* Team-Status-Runde: zusätzliche Präsenz-Chip-Töne für den Arbeitskontext-
   Status (getrennt von der Aktivitäts-Präsenz, siehe components.js). */
.presence-chip.tone-onsite { background: var(--success-soft); color: var(--success); }
.presence-chip.tone-onsite .presence-dot { background: var(--success); }
.presence-chip.tone-office { background: var(--accent-soft); color: var(--accent); }
.presence-chip.tone-office .presence-dot { background: var(--accent); }

/* Master-Referenz, Block 4: kleine Cover-Vorschau auf Raumkarten (floor.js) */
.room-thumb {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%);
  background-size: cover; background-position: center;
}

/* ==========================================================================
   Visuelles Angleichen an die Masterreferenz (Feinschliff-Runde)
   ========================================================================== */

/* --- Projektkarten als große Cover-Hero-Cards, kein separater weißer
   Kartenkörper mehr: Name/Status/Metadaten liegen direkt auf dem Bild. --- */
.project-hero-card {
  position: relative; height: 168px; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px; box-shadow: var(--shadow); cursor: pointer;
  background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%);
  background-size: cover; background-position: center;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.project-hero-card:active { transform: scale(0.98); }
.project-hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 38%, rgba(0,0,0,0.64) 100%);
}
.project-hero-status { position: absolute; top: 12px; right: 12px; z-index: 1; }
.project-hero-text { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; color: #fff; }
.project-hero-title {
  font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 2px; line-height: 1.2;
  text-shadow: 0 1px 5px rgba(0,0,0,0.35);
}
.project-hero-sub { font-size: 0.78rem; margin: 0; opacity: 0.92; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* --- Team-heute-Kachel + Kalender-Kurzvorschau (echte Daten, kompakt) --- */
.today-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.today-card-title { font-size: 0.92rem; font-weight: 700; margin: 0 0 2px; }
.today-card-sub { font-size: 0.8rem; color: var(--muted); margin: 0; }
.mini-event-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); margin-bottom: 8px;
}
.mini-event-stripe { width: 3px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.mini-event-time { font-size: 0.74rem; color: var(--muted); font-weight: 650; }
.mini-event-title { font-size: 0.88rem; font-weight: 650; margin: 1px 0 0; }

/* --- Bottom-Nav: aktiver Tab mit dezentem Hintergrund-Pill statt nur
   Farbwechsel - deutlicher erkennbar, wie in der Referenz. --- */
.bottom-nav-tab.is-active .bottom-nav-icon {
  background: var(--accent-soft); border-radius: 10px; padding: 3px 10px; margin-bottom: 1px;
}

/* --- Section-Header mit Link (z.B. "Aktuelle Projekte" / "Alle anzeigen") --- */
.section-header-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.section-header-row .section-label { margin: 0; }
.section-header-link {
  font-size: 0.82rem; font-weight: 650; color: var(--accent); background: none; border: none; padding: 4px 2px;
}

/* ==========================================================================
   Runde 26: Landing / Login / Registrierung nach Referenz "Konzept A"
   Kein Foto-Asset (nichts Erfundenes/Fremdes eingebettet) - der Hero nutzt
   den etablierten Gradient der App, Typografie und Struktur folgen der Referenz.
   ========================================================================== */

.auth-screen { min-height: 100vh; display: flex; flex-direction: column; }

.landing-hero {
  position: relative; flex: 1; min-height: 62vh; padding: calc(28px + env(safe-area-inset-top)) 24px 28px;
  display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
  background: linear-gradient(160deg, #6F7FA8 0%, #3C4C72 45%, #1F2A44 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.landing-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.42) 100%);
}
.landing-hero > * { position: relative; z-index: 1; }
.landing-brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.landing-tagline { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.8; margin: 6px 0 auto; }
.landing-claim { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; margin: 26px 0 10px; }
.landing-sub { font-size: 0.92rem; line-height: 1.45; opacity: 0.92; margin: 0 0 20px; max-width: 34ch; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.landing-feature {
  background: rgba(255,255,255,0.14); backdrop-filter: blur(10px); border-radius: 14px;
  padding: 12px 8px; text-align: center; font-size: 0.72rem; font-weight: 650; line-height: 1.25;
}
.landing-feature svg { width: 20px; height: 20px; display: block; margin: 0 auto 6px; }
.landing-actions { padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); }
.landing-actions .btn-primary { margin-bottom: 10px; }
.landing-footnote { text-align: center; font-size: 0.6rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin-top: 14px; }

.auth-page { padding: calc(16px + env(safe-area-inset-top)) 20px 24px; max-width: 480px; margin: 0 auto; }
.auth-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.auth-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px; }
.auth-sub { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin: 0 0 18px; }

.step-dots { display: flex; gap: 6px; }
.step-dot { width: 34px; height: 4px; border-radius: 4px; background: var(--surface-quiet); }
.step-dot.is-done { background: var(--accent); }

.icon-field {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 12px;
}
.icon-field svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.icon-field .icon-field-body { flex: 1; min-width: 0; }
.icon-field .icon-field-label { font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.icon-field input { margin: 0; padding: 4px 0 0; border: none; background: transparent; box-shadow: none; border-radius: 0; font-size: 0.96rem; }
.icon-field input:focus { outline: none; box-shadow: none; }
.icon-field .icon-toggle { background: none; border: none; color: var(--muted); padding: 4px; }

.switch-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-size: 0.86rem; }
.switch { position: relative; width: 40px; height: 24px; border-radius: 24px; background: var(--surface-quiet); border: none; padding: 0; transition: background var(--duration-fast) ease-out; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform var(--duration-fast) var(--ease-standard); }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(16px); }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.8rem; margin: 6px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(28,27,25,0.08); }

/* --- Runde 26: Team-Zusammenfassung auf Projektkarten --- */
.project-hero-team { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.project-hero-team .event-avatars .avatar { border-color: rgba(0,0,0,0.35); }
.project-hero-team-text { font-size: 0.76rem; opacity: 0.92; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.icon-btn-light svg { width: 18px; height: 18px; display: block; }

/* --- Runde 27: Suchfeld nach Referenz (kein Standard-Input-Look) --- */
.search-field {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 14px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  border: 1px solid transparent; margin-bottom: 16px;
  transition: border-color var(--duration-fast) ease-out, box-shadow var(--duration-fast) ease-out;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.search-field svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-field input {
  flex: 1; min-width: 0; margin: 0; padding: 0; border: none; background: transparent; box-shadow: none;
  border-radius: 0; font-size: 0.95rem; -webkit-appearance: none; appearance: none;
}
.search-field input:focus { outline: none; box-shadow: none; }
.search-field input::-webkit-search-decoration, .search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--surface-quiet);
  color: var(--muted); font-size: 0.95rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}

/* --- Runde 27: dezente Audit-Zeile im Positions-Sheet --- */
.audit-line { font-size: 0.72rem; color: var(--muted); line-height: 1.5; margin: 14px 0 0; text-align: center; }

/* ==========================================================================
   Runde 28: Master-Polish - verbindliche Angleichung an die Referenz.
   Ein Block, der die Maße der Komponenten gezielt strafft (Radien, Schatten,
   Abstände, Chips, Avatare, Hero, Karten). Keine neue Designrichtung.
   ========================================================================== */

:root {
  --shadow: 0 1px 2px rgba(28,27,25,0.04), 0 10px 26px rgba(28,27,25,0.07);
  --radius-lg: 20px;
  --radius-md: 14px;
}

/* Typografie & Grundabstände */
.page-title { font-size: 1.45rem; letter-spacing: -0.02em; margin: 4px 0 2px; }
.page-sub { margin: 0 0 14px; }
.section-label { font-size: 0.78rem; margin: 16px 0 8px; letter-spacing: 0.01em; }
.section-header-row { margin: 14px 0 8px; }
.card { margin-bottom: 10px; }
.card-body { padding: 14px 16px; }
.card-title { font-size: 0.98rem; }
.card-sub { font-size: 0.8rem; }
.topbar { min-height: 48px; }
.topbar-title { font-size: 0.98rem; }
.greeting-title { font-size: 1.5rem; margin: 0 0 2px; }
.greeting-sub { font-size: 0.86rem; margin: 0 0 14px; }

/* Chips & Badges: kleiner, sauberer, Pill-Form */
.choice-chip { padding: 7px 13px; font-size: 0.8rem; border-radius: 999px; }
.badge { padding: 2px 8px; font-size: 0.66rem; }
.presence-chip { padding: 3px 9px 3px 7px; font-size: 0.7rem; }
.presence-dot { width: 6px; height: 6px; }
.event-status-badge { font-size: 0.66rem; padding: 2px 8px; }
.chip-row, .filter-chip-row { gap: 6px; margin-bottom: 12px; }

/* Avatare: 40 / 32 / 24 wie in der Referenz */
.avatar { width: 40px; height: 40px; font-size: 0.9rem; }
.avatar.small { width: 32px; height: 32px; font-size: 0.72rem; }
.event-avatars .avatar { width: 24px; height: 24px; font-size: 0.58rem; margin-right: -7px; border-width: 2px; }
.menu-header .avatar { width: 48px; height: 48px; font-size: 1.05rem; }

/* Kennzahlen: kompakter, näher am 2x2-Raster der Referenz */
.stat-grid { gap: 8px; margin-bottom: 14px; }
.stat-tile { padding: 11px 12px; }
.stat-icon { width: 28px; height: 28px; border-radius: 9px; margin-bottom: 7px; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font-size: 1.25rem; }
.stat-label { font-size: 0.72rem; }
.mini-stats { gap: 8px; margin: 2px 0 14px; }
.mini-stat { padding: 10px 8px; }
.mini-stat-value { font-size: 1.1rem; }
.mini-stat-label { font-size: 0.68rem; }

/* Team-heute / Kalender-Vorschau: ruhiger, dichter */
.today-card { padding: 12px 14px; margin-bottom: 8px; }
.today-card-title { font-size: 0.88rem; }
.today-card-sub { font-size: 0.76rem; }
.mini-event-row { padding: 9px 12px; margin-bottom: 6px; }
.mini-event-title { font-size: 0.84rem; }

/* Projektkarten: Bild dominant, Text/Status im Bild */
.project-hero-card { height: 176px; margin-bottom: 12px; }
.project-hero-scrim { background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.68) 100%); }
.project-hero-title { font-size: 1.08rem; }
.project-hero-sub, .project-hero-team-text { font-size: 0.74rem; }
.project-hero-status { top: 10px; right: 10px; }

/* Projekt-/Raum-Hero: kompakter und kontrastreicher */
.hero-cover { height: 188px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.hero-cover-overlay { background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.6) 100%); }
.hero-title-overlay { bottom: 14px; left: 18px; right: 18px; }
.hero-title-overlay h1 { font-size: 1.4rem; }
.hero-title-overlay p { font-size: 0.8rem; }
.hero-nav-btn { width: 34px; height: 34px; }

/* Raumkarten (Projekt/Geschoss): Bildkachel + Text, kompakt */
.room-thumb { width: 48px; height: 48px; border-radius: 10px; }

/* Suchfeld: kompakter, ruhiger */
.search-field { height: 42px; padding: 0 8px 0 12px; border-radius: 12px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(28,27,25,0.04); }
.search-field:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.search-field svg { width: 17px; height: 17px; }
.search-field input { font-size: 0.92rem; }
.search-clear { width: 22px; height: 22px; font-size: 0.85rem; }

/* Kalender: Wochenleiste kompakter, Events als klare Farbkarten */
.cal-nav { margin-bottom: 10px; }
.cal-nav-title { font-size: 1.02rem; }
.cal-grid { gap: 3px; margin-bottom: 14px; }
.cal-grid.is-week .cal-day { height: 56px; border-radius: 10px; }
.cal-day { font-size: 0.8rem; }
.event-card { padding: 11px 13px; margin-bottom: 8px; }
.event-title { font-size: 0.9rem; }
.event-time, .event-meta { font-size: 0.74rem; }
.event-stripe { width: 3px; }

/* Bottom-Navigation: ruhiger, exakt ausgerichtet */
.bottom-nav { padding: 6px 4px calc(4px + env(safe-area-inset-bottom)); }
.bottom-nav-icon svg { width: 21px; height: 21px; }
.bottom-nav-label { font-size: 0.64rem; }

/* Eingabefelder & Buttons: kompakter, Referenz-Höhe */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="datetime-local"], select { padding: 11px 13px; font-size: 0.94rem; margin-bottom: 10px; }
.btn-primary { padding: 13px 18px; font-size: 0.94rem; border-radius: 14px; }
.btn-ghost { padding: 12px 18px; font-size: 0.92rem; border-radius: 14px; }
.field-label { font-size: 0.74rem; margin-bottom: 5px; }

/* Landing / Auth: feinerer Indikator, kompaktere Felder, weniger Leerraum */
.landing-claim { font-size: 1.8rem; margin: 20px 0 8px; }
.landing-sub { font-size: 0.88rem; margin-bottom: 16px; }
.landing-feature { padding: 10px 6px; font-size: 0.68rem; border-radius: 12px; }
.landing-actions { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.auth-title { font-size: 1.45rem; margin: 4px 0 2px; }
.auth-sub { font-size: 0.86rem; margin-bottom: 14px; }
.auth-topline { margin-bottom: 12px; }
.icon-field { padding: 8px 12px; margin-bottom: 9px; border-radius: 12px; }
.icon-field .icon-field-label { font-size: 0.68rem; }
.icon-field input { font-size: 0.92rem; padding-top: 2px; margin: 0; }
.step-dot { width: 28px; height: 3px; }
.switch-row { margin: 2px 0 14px; }

/* Landing-Hero: Baustellenmotiv als eigene, gezeichnete Illustration */
.landing-hero { min-height: 60vh; padding-bottom: 22px; }
.landing-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.landing-hero::after { z-index: 0; background: linear-gradient(to bottom, rgba(10,16,32,0.15) 0%, rgba(10,16,32,0) 28%, rgba(10,16,32,0.62) 100%); }

/* ==========================================================================
   Runde 29: Design-System nach Referenz (Bild 1 "Design System v1.0")
   Tokens: Primary #3B82F6, Background #F8FAFC, Text #0F172A, Success #22C55E,
   Warning #F59E0B, Accent/Lila #8B5CF6, Error nur für echte Fehler.
   Radien: Controls 12 / Cards 16 / Hero 20. Schatten sehr subtil.
   ========================================================================== */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-quiet: #EEF2F7;
  --text: #0F172A;
  --text-secondary: #334155;
  --muted: #64748B;
  --border: #E2E8F0;
  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-soft: #DBEAFE;
  --success: #22C55E;
  --success-soft: #DCFCE7;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --gold: #F59E0B;
  --gold-soft: #FEF3C7;
  --purple: #8B5CF6;
  --purple-soft: #EDE9FE;
  --teal: #0EA5E9;
  --error: #EF4444;
  --error-soft: #FEE2E2;
  --shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
}
body { -webkit-font-smoothing: antialiased; }

/* Typografie-Skala (Display / H1 / H2 / Body / Caption) */
.greeting-title, .landing-claim, .auth-title { font-weight: 800; letter-spacing: -0.025em; color: var(--text); }
.page-title { font-size: 1.5rem; font-weight: 750; }
.section-label { color: var(--text-secondary); font-weight: 650; font-size: 0.82rem; }
.card-title { color: var(--text); }
.card-sub, .stat-label, .mini-stat-label, .event-time, .event-meta, .menu-hint, .today-card-sub { color: var(--muted); }

/* Status-Tags wie in der Referenz: Punkt + Pill */
.presence-chip.tone-active { background: var(--success-soft); color: #15803D; }
.presence-chip.tone-active .presence-dot { background: var(--success); }
.presence-chip.tone-onsite { background: var(--warning-soft); color: #B45309; }   /* Auf Baustelle = Orange */
.presence-chip.tone-onsite .presence-dot { background: var(--warning); }
.presence-chip.tone-office { background: var(--accent-soft); color: #1D4ED8; }    /* Im Büro / In Planung = Blau */
.presence-chip.tone-office .presence-dot { background: var(--accent); }
.presence-chip.tone-recent { background: var(--warning-soft); color: #B45309; }
.presence-chip.tone-recent .presence-dot { background: var(--warning); }
.presence-chip.tone-success { background: var(--success-soft); color: #15803D; }
.presence-chip.tone-success .presence-dot { background: var(--success); }
.presence-chip.tone-muted { background: var(--surface-quiet); color: var(--muted); }
.presence-chip.tone-muted .presence-dot { background: #94A3B8; }
.badge.role { background: var(--surface-quiet); color: var(--text-secondary); }
.badge.info { background: var(--accent-soft); color: #1D4ED8; }
.badge.warning { background: var(--warning-soft); color: #B45309; }

/* Buttons wie Referenz: Primary kräftig blau, Secondary weiß mit Kontur, Ghost hellblau */
.btn-primary { background: var(--accent); box-shadow: 0 6px 16px rgba(59,130,246,0.28); }
.btn-primary:not(:disabled):active { background: #2563EB; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-danger-ghost { border: 1px solid var(--error-soft); }
.icon-btn-light { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }

/* Chips & Filter: "Alle" gefüllt blau, sonst hellgrau */
.choice-chip { background: var(--surface-quiet); color: var(--text-secondary); }
.choice-chip.selected { background: var(--accent); color: #fff; }

/* Karten: weiße Fläche, feine Kontur statt nur Schatten */
.card, .stat-tile, .mini-stat, .today-card, .mini-event-row, .event-card, .icon-field, .search-field, .menu-group {
  border: 1px solid var(--border);
}
.stat-icon.tone-blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon.tone-green { background: var(--success-soft); color: #15803D; }
.stat-icon.tone-purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon.tone-orange { background: var(--warning-soft); color: #B45309; }
.stat-value { color: var(--text); }

/* Avatare: blauer Grund, weiße Initialen, weißer Ring im Stack */
.avatar { background: var(--accent); }
.event-avatars .avatar { border: 2px solid #fff; }

/* Hero-Kachel Projekt: Status-Chip als weiße Pill auf dem Bild wie Referenz */
.project-hero-status .presence-chip { box-shadow: 0 2px 8px rgba(0,0,0,0.25); }

/* Bottom-Navigation: aktiver Tab blau + kleiner Indikator-Strich */
.bottom-nav { background: rgba(255,255,255,0.94); border-top: 1px solid var(--border); }
.bottom-nav-tab.is-active .bottom-nav-icon { background: var(--accent-soft); }

/* Menü: Icon-Container einheitlich hellblau, Listen kompakter */
.menu-icon { background: var(--accent-soft); color: var(--accent); border-radius: 12px; width: 36px; height: 36px; }
.menu-icon.tone-gold { background: var(--warning-soft); color: #B45309; }
.menu-icon.tone-neutral { background: var(--surface-quiet); color: var(--text-secondary); }
.menu-row { padding: 11px 12px; }

/* Suchfeld: ruhige Surface, feine Kontur, dezenter Fokus */
.search-field { background: var(--surface); box-shadow: none; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* Landing (hell, Referenz Bild 2): weiße Fläche, Illustration eingebettet, 2x2 Feature-Kacheln */
.landing-hero { background: linear-gradient(180deg, #F8FAFC 0%, #EAF2FE 100%); color: var(--text); border-radius: 0; min-height: auto; justify-content: flex-start; padding-top: calc(20px + env(safe-area-inset-top)); }
.landing-hero::after { display: none; }
.landing-brand { color: var(--text); }
.landing-tagline { color: var(--muted); opacity: 1; margin: 4px 0 18px; }
.landing-claim { font-size: 1.85rem; margin: 0 0 8px; }
.landing-claim .accent { color: var(--accent); }
.landing-sub { color: var(--text-secondary); opacity: 1; }
.landing-art { position: relative; inset: auto; height: 210px; border-radius: var(--radius-lg); margin: 4px 0 14px; display: block; }
.landing-features { grid-template-columns: 1fr 1fr; gap: 10px; }
.landing-feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  text-align: left; color: var(--text); font-size: 0.8rem; font-weight: 700; backdrop-filter: none;
}
.landing-feature svg { margin: 0 0 8px; width: 30px; height: 30px; padding: 6px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); box-sizing: border-box; }
.landing-feature small { display: block; font-weight: 500; color: var(--muted); font-size: 0.72rem; margin-top: 2px; }
.landing-actions { padding-top: 10px; }
.landing-actions .btn-ghost { border: none; background: transparent; color: var(--accent); font-weight: 650; }
.landing-footnote { display: none; }

/* Registrierung: Stepper + Passwortregeln wie Referenz */
.step-caption { font-size: 0.74rem; color: var(--muted); margin: 0 0 6px; }
.step-bar { display: flex; gap: 6px; margin-bottom: 16px; }
.step-bar span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-quiet); }
.step-bar span.is-done { background: var(--accent); }
.pw-rules { list-style: none; padding: 0; margin: -2px 0 12px; font-size: 0.78rem; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.pw-rules li.ok { color: #15803D; }
.pw-rules li::before { content: "✓"; font-size: 0.7rem; width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-quiet); }
.pw-rules li.ok::before { background: var(--success-soft); }
.auth-link { color: var(--accent); font-weight: 650; text-decoration: none; }

/* Projektliste (Referenz Bild 3): Thumbnail-Rows mit Status-Filter */
.project-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; }
.project-row-thumb {
  width: 64px; height: 56px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%); background-size: cover; background-position: center;
}
/* Runde 30: mehrtägige Termine dezent markieren */
.event-card.is-multiday .event-stripe { border-radius: 0; opacity: 0.85; }

/* ==========================================================================
   Runde 30: finaler Polish - Dichte, Safe-Area, ruhigere Übergänge.
   Keine neuen Tokens, keine neue Richtung.
   ========================================================================== */
.org-caption { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 650; }
.greeting-title { font-size: 1.45rem; }
.greeting-sub { margin-bottom: 12px; }

/* Dashboard-Dichte */
.stat-tile { padding: 10px 12px; }
.stat-icon { width: 26px; height: 26px; margin-bottom: 6px; }
.stat-value { font-size: 1.2rem; }
.stat-grid { margin-bottom: 12px; }
.today-card { padding: 10px 12px; }
.mini-event-row { padding: 8px 12px; }
.section-header-row { margin: 12px 0 8px; }

/* Landing: leichtere Feature-Karten, kompakter CTA, ruhiger Übergang */
.landing-feature { border-color: transparent; box-shadow: 0 1px 2px rgba(15,23,42,0.05); padding: 11px 12px; }
.landing-art { height: 200px; box-shadow: 0 10px 30px rgba(59,130,246,0.14); }
.landing-hero { padding-bottom: 12px; }
.landing-actions { padding-top: 6px; background: var(--bg); }

/* Projekt: Hero kompakt, Tabs kompakt, weniger Leerfläche */
.hero-cover { height: 172px; }
.hero-title-overlay h1 { font-size: 1.3rem; }
#project-tabs, #room-tabs { margin-bottom: 12px !important; }
.mini-stats { margin-bottom: 10px; }

/* Team: kompakte Karten */
#members-body .card-body { padding: 11px 14px !important; }

/* Kalender: kompakte Eventkarten */
.event-card { padding: 10px 12px; }
.cal-grid.is-week .cal-day { height: 52px; }

/* Bottom-Nav + Safe-Area: nicht zu hoch, keine Überlappungen */
body { padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav { padding: 5px 4px calc(6px + env(safe-area-inset-bottom)); }
#view-root.has-bottom-nav { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
.sheet { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ==========================================================================
   Runde 31: Mikrofon, Avatare mit Bild, Foto-Galerie, Aktivität
   ========================================================================== */
.mic-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 14px; }
.mic-fab-big {
  position: relative; width: 84px; height: 84px; border-radius: 50%; border: none; color: #fff;
  background: var(--accent); box-shadow: 0 10px 28px rgba(59,130,246,0.35); display: flex; align-items: center; justify-content: center;
  transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-fast) ease-out;
}
.mic-fab-big svg { width: 34px; height: 34px; }
.mic-fab-big:not(:disabled):active { transform: scale(0.94); }
.mic-fab-big.is-off { background: var(--surface-quiet); color: var(--muted); box-shadow: none; }
.mic-fab-big.recording { background: var(--error); box-shadow: 0 10px 28px rgba(239,68,68,0.35); }
.mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(239,68,68,0.45); opacity: 0; }
.mic-fab-big.recording .mic-ring { animation: micPulse 1.4s ease-out infinite; }
@keyframes micPulse { 0% { transform: scale(0.85); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
.mic-status { font-size: 0.86rem; font-weight: 650; color: var(--text-secondary); margin: 0; text-align: center; }
.mic-fab { display: none; }

.avatar { background-size: cover; background-position: center; }
.avatar.has-image .avatar-initials { visibility: hidden; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.photo-tile {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: linear-gradient(150deg, #DDE6F2 0%, #B7C6DB 55%, #8FA3C0 100%); background-size: cover; background-position: center;
}
.photo-tile .photo-cat { position: absolute; left: 6px; bottom: 6px; font-size: 0.6rem; font-weight: 650; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,0.9); color: var(--text-secondary); }
.photo-full { width: 100%; max-height: 52vh; border-radius: var(--radius-md); background: #0F172A center/contain no-repeat; aspect-ratio: 4/3; margin-bottom: 12px; }
.photo-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.photo-meta .card-sub { margin: 0; }

.audit-line { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.audit-row { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--muted); }
.audit-row .avatar { width: 22px; height: 22px; font-size: 0.55rem; }

.activity-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; }
.activity-row .avatar { flex-shrink: 0; }
.activity-summary { font-size: 0.88rem; margin: 0; }
.activity-meta { font-size: 0.74rem; color: var(--muted); margin: 2px 0 0; }
/* Runde 32: Validierungszustände hochwertig */
.icon-field.is-invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.field-error { color: var(--error); font-size: 0.78rem; margin: -4px 0 10px 4px; }
.form-error { color: #B91C1C; background: var(--error-soft); border-radius: 12px; padding: 10px 12px; font-size: 0.85rem; margin: 0 0 12px; }
.btn-primary:disabled { opacity: 0.55; }
/* Runde 32: Notizen */
.note-card { padding: 12px 14px; cursor: pointer; }
.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.note-preview { font-size: 0.9rem; line-height: 1.45; margin: 0; color: var(--text); white-space: pre-line; }
.note-full { font-size: 0.95rem; line-height: 1.5; white-space: pre-line; margin: 0 0 14px; }
.note-textarea { width: 100%; min-height: 160px; font-size: 1rem; line-height: 1.5; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); resize: vertical; margin-bottom: 12px; box-sizing: border-box; }
.note-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
