/* =====================================================================
   Mein ABW – Gestaltung
   Ruhig, freundlich, gut lesbar. Große Schrift, große Bedienflächen.
   ===================================================================== */
:root {
  --petrol: #155E75;
  --petrol-dark: #0F4A5C;
  --petrol-soft: #E3F0F3;
  --tuerkis: #27B6A8;
  --tuerkis-soft: #DDF5F2;
  --koralle: #EF6A5B;
  --gelb: #F4B942;
  --gelb-soft: #FDF3DC;
  --gelb-text: #7A5300;
  --gruen: #2E9E6B;
  --gruen-soft: #E1F4EA;
  --rot: #C93C3C;
  --rot-soft: #FBE7E5;
  --bg: #F4F8FA;
  --card: #FFFFFF;
  --text: #172033;
  --muted: #56627A;
  --line: #DCE5EA;
  --radius: 22px;
  --radius-s: 14px;
  --shadow: 0 2px 4px rgba(23, 32, 51, .04), 0 8px 24px rgba(23, 32, 51, .07);
  --tap: 60px;
  --nav-h: 78px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
html.text-l { font-size: 125%; }
html.text-xl { font-size: 137.5%; }
html.admin-mode { font-size: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; overflow-wrap: break-word; text-wrap: balance; }
.hello > div, .banner > div, .fact .grow, .list-item .grow { min-width: 0; overflow-wrap: break-word; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--petrol); }
:focus-visible { outline: 3px solid var(--tuerkis); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.pre { white-space: pre-line; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--petrol); color: #fff;
  padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top));
  display: flex; align-items: center; gap: .75rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 14px; background: #fff; padding: 3px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.brand-sub { font-size: .75rem; opacity: .85; line-height: 1.2; }
.topbar .spacer { flex: 1; }

/* ---------- Hauptbereich ---------- */
main.page { max-width: 680px; margin: 0 auto; padding: 1rem 1rem calc(var(--nav-h) + 2rem + env(safe-area-inset-bottom)); }
.admin-shell main.page { max-width: 1100px; padding-bottom: 3rem; }

/* ---------- Untere Navigation (Klient:innen) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
  border-top: 1px solid var(--line); display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(23, 32, 51, .06);
}
.bottomnav a {
  flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600; position: relative;
}
.bottomnav a svg { width: 30px; height: 30px; }
.bottomnav a.active { color: var(--petrol); }
.bottomnav a.active::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 4px; border-radius: 0 0 4px 4px; background: var(--tuerkis); }
.badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--koralle); color: #fff; font-size: .75rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* ---------- Karten ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; margin-bottom: .6rem; color: var(--petrol); }
.card-title svg { width: 28px; height: 28px; flex: none; }

/* Begrüßung mit Milo */
.hello { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg, #fff 0%, var(--tuerkis-soft) 100%); }
.hello img { width: 104px; height: 104px; flex: none; object-fit: contain; }
.hello h1 { font-size: 1.35rem; margin-bottom: .2rem; }
.hello p { margin: 0; color: var(--muted); }
.milo-box { text-align: center; padding: 1.5rem 1rem; }
.milo-box img { width: 170px; height: 170px; margin: 0 auto 1rem; object-fit: contain; }
.milo-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50vh; gap: 1rem; color: var(--muted); }
.milo-loader img { width: 96px; height: 96px; animation: bob 1.4s ease-in-out infinite; object-fit: contain; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .milo-loader img { animation: none; } * { transition: none !important; } }

/* Tagesüberschrift */
.day-head { margin: 1.6rem .25rem .6rem; font-weight: 800; font-size: 1.05rem; color: var(--petrol); display: flex; align-items: center; gap: .5rem; }
.day-head .pill { background: var(--petrol); color: #fff; border-radius: 999px; padding: .1rem .7rem; font-size: .85rem; }

/* Terminkarte in der Liste */
.appt {
  display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; border: 3px solid transparent; transition: transform .12s ease;
}
.appt:active { transform: scale(.99); }
.appt.st-changed { border-color: var(--gelb); }
.appt.st-cancelled { border-color: var(--rot); }
.appt.st-cancelled .appt-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.appt-cover { aspect-ratio: 16 / 8; background: var(--petrol-soft); position: relative; overflow: hidden; }
.appt-cover img { width: 100%; height: 100%; object-fit: cover; }
.appt-cover .chip { position: absolute; top: .75rem; left: .75rem; }
.cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cover-fallback svg { width: 72px; height: 72px; color: #fff; opacity: .95; }
.appt-body { padding: 1rem 1.15rem 1.15rem; }
.appt-title { font-size: 1.25rem; font-weight: 800; margin-bottom: .35rem; }
.appt-meta { display: flex; flex-direction: column; gap: .3rem; color: var(--muted); }
.meta { display: flex; align-items: flex-start; gap: .55rem; }
.meta svg { width: 24px; height: 24px; flex: none; color: var(--petrol); margin-top: .1rem; }
.appt-foot { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Status-Chips */
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px;
  font-weight: 700; font-size: .85rem; background: var(--petrol-soft); color: var(--petrol); line-height: 1.3;
}
.chip svg { width: 18px; height: 18px; }
.chip.planned { background: #fff; color: var(--petrol); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.chip.changed { background: var(--gelb); color: #3D2A00; }
.chip.cancelled { background: var(--rot); color: #fff; }
.chip.ok { background: var(--gruen-soft); color: #186B45; }
.chip.no { background: #EEF1F4; color: var(--muted); }
.chip.call { background: var(--tuerkis-soft); color: #11695F; }
.chip.important { background: var(--rot-soft); color: var(--rot); }
.chip.info { background: var(--petrol-soft); color: var(--petrol); }

/* Hinweisbanner */
.banner { border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; text-decoration: none; color: inherit; }
.banner img { width: 72px; height: 72px; flex: none; object-fit: contain; }
.banner svg { width: 32px; height: 32px; flex: none; }
.banner strong { display: block; font-size: 1.05rem; }
.banner.changed { background: var(--gelb-soft); border: 2px solid var(--gelb); }
.banner.cancelled { background: var(--rot-soft); border: 2px solid var(--rot); }
.banner.info { background: var(--petrol-soft); border: 2px solid #BFDCE4; }
.banner.ok { background: var(--gruen-soft); border: 2px solid #A9DDC2; }
.banner.private { background: var(--tuerkis-soft); border: 2px solid #A7E3DC; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: var(--tap); padding: .8rem 1.4rem;
  border-radius: 18px; border: 2px solid transparent; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer;
  text-decoration: none; background: var(--petrol); color: #fff; transition: filter .12s, transform .05s; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 72px; font-size: 1.15rem; border-radius: 20px; }
.btn.yes { background: var(--gruen); }
.btn.no { background: #fff; color: var(--rot); border-color: #EBC2BF; }
.btn.soft { background: var(--petrol-soft); color: var(--petrol); }
.btn.ghost { background: transparent; color: var(--petrol); border-color: var(--line); }
.btn.danger { background: var(--rot); }
.btn.warn { background: var(--gelb); color: #3D2A00; }
.btn.white { background: #fff; color: var(--petrol); }
.btn.small { min-height: 44px; padding: .45rem .9rem; font-size: .92rem; border-radius: 12px; }
.btn.small svg { width: 20px; height: 20px; }
.btn.selected { outline: 4px solid var(--tuerkis); outline-offset: 2px; }
.btn-col { display: flex; flex-direction: column; gap: .75rem; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--petrol); text-decoration: none; min-height: 48px; margin-bottom: .25rem; background: none; border: 0; font-size: 1rem; cursor: pointer; padding: 0; }
.back svg { width: 26px; height: 26px; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Termin-Detail ---------- */
.detail-hero { border-radius: var(--radius); overflow: hidden; background: var(--petrol-soft); aspect-ratio: 16 / 10; margin-bottom: 1rem; box-shadow: var(--shadow); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 1.7rem; font-weight: 800; margin: .5rem 0 .25rem; }
.facts { display: flex; flex-direction: column; gap: .9rem; font-size: 1.08rem; }
.fact { display: flex; gap: .85rem; align-items: flex-start; }
.fact .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--petrol-soft); color: var(--petrol); display: flex; align-items: center; justify-content: center; flex: none; }
.fact .ic svg { width: 28px; height: 28px; }
.fact .lbl { font-size: .85rem; color: var(--muted); font-weight: 600; }
.fact .val { font-weight: 700; }
.meet-photo { border-radius: var(--radius-s); overflow: hidden; margin-top: .6rem; }
.meet-photo figcaption { font-size: .85rem; color: var(--muted); padding: .4rem 0 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.checklist label { display: flex; align-items: center; gap: .8rem; min-height: 56px; padding: .5rem .9rem; border-radius: var(--radius-s); background: var(--bg); cursor: pointer; font-weight: 600; }
.checklist input { width: 30px; height: 30px; accent-color: var(--gruen); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius-s); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.gallery figcaption { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.changed-at { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 1.2rem; }

/* ---------- Nachrichten ---------- */
.chat { display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 85%; padding: .75rem 1rem; border-radius: 20px; background: #fff; box-shadow: var(--shadow); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--petrol); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble .who { font-size: .78rem; opacity: .8; font-weight: 700; margin-bottom: .15rem; }
.bubble .when { font-size: .72rem; opacity: .7; margin-top: .3rem; }
.bubble .ref { font-size: .8rem; font-weight: 700; display: flex; gap: .3rem; align-items: center; margin-bottom: .2rem; opacity: .9; }
.bubble .ref svg { width: 16px; height: 16px; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: .75rem 0 .5rem; margin-top: 1rem; }
.admin-shell .composer { bottom: 0; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field > span, .field > label.lbl { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  font: inherit; font-size: 1.05rem; padding: .8rem .95rem; border-radius: var(--radius-s); border: 2px solid var(--line);
  background: #fff; color: var(--text); width: 100%; min-height: 56px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--tuerkis); outline: none; box-shadow: 0 0 0 4px rgba(39, 182, 168, .18); }
.check { display: flex; align-items: center; gap: .7rem; min-height: 48px; cursor: pointer; font-weight: 600; }
.check input { width: 26px; height: 26px; accent-color: var(--petrol); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.check input:disabled + span { opacity: .55; }
.target { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .75rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.seg { display: flex; background: #E6EEF2; border-radius: 16px; padding: 4px; gap: 4px; margin-bottom: 1rem; }
.seg button { flex: 1; min-height: 52px; border: 0; border-radius: 12px; background: transparent; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.seg button svg { width: 22px; height: 22px; }
.seg button.on { background: #fff; color: var(--petrol); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.error-box { background: var(--rot-soft); color: #8A2020; border-radius: var(--radius-s); padding: .75rem 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; background: linear-gradient(170deg, var(--petrol) 0 34%, var(--bg) 34%); }
.login { width: 100%; max-width: 440px; }
.login .logo { text-align: center; color: #fff; margin-bottom: 1.25rem; }
.login .logo img { width: 150px; height: 150px; margin: 0 auto .4rem; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .18)); }
.login .logo h1 { font-size: 2rem; margin: 0; }
.login .logo p { margin: 0; opacity: .9; }

/* ---------- Toast & Dialog ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom)); display: flex; justify-content: center; z-index: 100; pointer-events: none; padding: 0 1rem; }
.admin-shell ~ .toast-wrap, .no-nav ~ .toast-wrap { bottom: 1.5rem; }
.toast { background: var(--text); color: #fff; padding: .9rem 1.3rem; border-radius: 16px; font-weight: 700; box-shadow: var(--shadow); max-width: 520px; animation: pop .2s ease; }
.toast.error { background: var(--rot); }
.toast.ok { background: var(--gruen); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-back { position: fixed; inset: 0; background: rgba(23, 32, 51, .5); z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-back { align-items: center; padding: 1rem; } }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 1.4rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom)); animation: pop .2s ease; }
@media (min-width: 640px) { .modal { border-radius: 26px; } }
.modal h2 { margin-bottom: 1rem; }
.modal .actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

/* Push-Vorschau (wie eine Android-Mitteilung) */
.push-preview { background: #F1F3F6; border-radius: 18px; padding: .9rem 1rem; display: flex; gap: .8rem; align-items: flex-start; border: 1px solid var(--line); }
.push-preview img { width: 40px; height: 40px; border-radius: 10px; }
.push-preview .t { font-weight: 800; font-size: .95rem; }
.push-preview .b { font-size: .95rem; }
.push-preview .app { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Meine Werte ---------- */
.chart { width: 100%; height: 180px; display: block; }
.values-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.values-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .4rem .3rem; border-bottom: 2px solid var(--line); }
.values-table td { padding: .7rem .3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.values-table td.num { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.values-table .icon-btn { color: var(--muted); }
.big-num { font-size: 2.2rem; font-weight: 800; color: var(--petrol); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Verwaltung
   ===================================================================== */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidenav { background: var(--petrol-dark); color: #fff; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: .2rem; }
.sidenav .brand { padding: .25rem .5rem 1rem; }
.sidenav a.nav { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 12px; color: #D8E9EE; text-decoration: none; font-weight: 600; position: relative; }
.sidenav a.nav svg { width: 22px; height: 22px; }
.sidenav a.nav:hover { background: rgba(255, 255, 255, .08); }
.sidenav a.nav.active { background: #fff; color: var(--petrol); }
.sidenav .count { margin-left: auto; background: var(--koralle); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 800; padding: .05rem .5rem; }
.sidenav .foot { margin-top: auto; padding: .75rem .5rem 0; font-size: .85rem; opacity: .85; }
.admin-top { display: none; }
.admin-shell > * { min-width: 0; } /* sonst macht die Reiterleiste die Seite auf dem Handy zu breit */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidenav { display: none; }
  .admin-top { display: block; position: sticky; top: 0; z-index: 20; }
  .admin-top .tabs { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem .75rem; background: var(--petrol-dark); scrollbar-width: none; }
  .admin-top .tabs a { white-space: nowrap; color: #D8E9EE; text-decoration: none; font-weight: 700; padding: .5rem .85rem; border-radius: 999px; font-size: .92rem; position: relative; }
  .admin-top .tabs a.active { background: #fff; color: var(--petrol); }
  .admin-top .tabs .count { background: var(--koralle); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; margin-left: .3rem; }
}
.page-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.page-head h1 { margin: 0; flex: 1; font-size: 1.6rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border-radius: 18px; padding: 1rem 1.1rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; border-left: 6px solid var(--tuerkis); }
.stat .n { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--petrol); }
.stat .l { color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat.alert { border-left-color: var(--koralle); }
.stat.warn { border-left-color: var(--gelb); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th { text-align: left; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: .7rem .75rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #F7FAFB; }
.list-item { display: flex; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { min-width: 0; }
.list-item .t { font-weight: 700; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--tuerkis-soft); color: var(--petrol); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.thread-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .thread-layout { grid-template-columns: 1fr; } .thread-layout.has-thread .thread-list { display: none; } }
.thread-list .list-item { padding: .7rem .6rem; border-radius: 12px; border: 0; }
.thread-list .list-item.active { background: var(--petrol-soft); }
.unread-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--koralle); flex: none; }
.img-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.img-admin .it { background: var(--bg); border-radius: 14px; overflow: hidden; }
.img-admin img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.img-admin .bar { display: flex; align-items: center; gap: .2rem; padding: .3rem; }
.img-admin .bar .icon-btn { width: 38px; height: 38px; color: var(--petrol); }
.img-admin .bar .icon-btn:hover { background: #fff; }
.img-admin .cap { font-size: .8rem; padding: 0 .5rem .5rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.pw-box { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; font-weight: 800; background: var(--gelb-soft); border: 2px dashed var(--gelb); border-radius: 14px; padding: 1rem; text-align: center; letter-spacing: .03em; user-select: all; }

/* ---------- Druck (Meine Werte) ---------- */
@media print {
  .topbar, .bottomnav, .no-print, .toast-wrap { display: none !important; }
  body { background: #fff; }
  main.page { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- Bereiche "Für mich" / WG ---------- */
.seg.areas { margin-top: 1rem; }
.seg.areas button { min-height: 60px; font-size: 1.05rem; color: var(--ink, #1f2d33); }
.seg.areas .count { background: var(--tuerkis); color: #fff; border-radius: 999px; font-size: .8rem; padding: .05rem .5rem; }
.seg.areas button.on .count { background: var(--petrol); }

/* ---------- Anmeldung mit Bildern ---------- */
.sym-slots { display: flex; justify-content: center; gap: .6rem; margin: .5rem 0 1rem; }
.sym-slot { width: 58px; height: 58px; border-radius: 16px; border: 3px dashed #C7D6DC; display: grid; place-items: center; font-size: 2rem; background: #fff; }
.sym-slot.filled { border-style: solid; border-color: var(--tuerkis); background: #E9F8F6; }
.sym-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.sym-btn { aspect-ratio: 1; border: 2px solid #E1E9ED; border-radius: 18px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; cursor: pointer; font: inherit; padding: .2rem; }
.sym-btn .e { font-size: 2.3rem; line-height: 1.1; }
.sym-btn .l { font-size: .78rem; font-weight: 700; color: var(--muted); }
.sym-btn:active, .sym-btn.hit { transform: scale(.94); border-color: var(--tuerkis); background: #E9F8F6; }
.sym-btn:disabled { opacity: .5; }
.sym-actions { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; gap: .5rem; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.hello-user { text-align: center; margin: 0 0 .5rem; }
.sym-card { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; margin: .5rem 0; }
.sym-card .it { width: 86px; text-align: center; border: 2px solid #E1E9ED; border-radius: 16px; padding: .5rem .2rem; background: #fff; }
.sym-card .it .e { font-size: 2.6rem; display: block; }
.sym-card .it .n { font-size: .7rem; color: var(--muted); font-weight: 800; }
.sym-card .it .l { font-size: .8rem; font-weight: 700; }
.print-only { display: none; }

/* ---------- Aktionen-Vorlagen ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.tpl { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); cursor: pointer; border: 0; padding: 0; text-align: left; font: inherit; display: flex; flex-direction: column; }
.tpl img, .tpl .ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #E6EEF2; display: block; }
.tpl .t { padding: .55rem .7rem .7rem; font-weight: 800; }
.tpl .s { padding: 0 .7rem .7rem; font-size: .8rem; color: var(--muted); margin-top: -.4rem; }
.tpl.off { opacity: .5; }
.tpl-pick { display: flex; gap: .8rem; align-items: center; }
.tpl-pick img { width: 120px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; flex: none; }
.tpl-pick select { flex: 1; }
@media (max-width: 560px) { .tpl-pick { flex-direction: column; align-items: stretch; } .tpl-pick img { width: 100%; } .tpl-grid { grid-template-columns: repeat(2, 1fr); } }

@media print {
  body.printing-card * { visibility: hidden !important; }
  body.printing-card .print-area, body.printing-card .print-area * { visibility: visible !important; }
  body.printing-card .print-area { position: fixed; inset: 0; padding: 2cm; background: #fff; }
  .print-only { display: block; }
}
/* Bildauswahl in der Verwaltung (kompakter) */
.sym-pick .sym-grid { grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.sym-pick .sym-btn { border-radius: 12px; }
.sym-pick .sym-btn .e { font-size: 1.6rem; }
.sym-pick .sym-btn .l { font-size: .62rem; }
.sym-pick .sym-slot { width: 48px; height: 48px; font-size: 1.6rem; color: var(--muted); }
@media (max-width: 560px) { .sym-pick .sym-grid { grid-template-columns: repeat(4, 1fr); } }

/* Persönlicher Wochenkalender */
.calendar-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.calendar-controls .field { margin: 0; min-width: 180px; }
.calendar-color-button { display: inline-flex; align-items: center; gap: .45rem; }
.person-color-dot { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #8a9da3; }
.calendar-color-palette { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 1.2rem; }
.calendar-color-swatch { display: grid; place-items: center; width: 48px; height: 48px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #a7b7bb; cursor: pointer; }
.calendar-color-swatch[aria-pressed='true'] { box-shadow: 0 0 0 3px #253c43; }
.calendar-color-swatch[aria-pressed='true']::after { content: '✓'; color: #fff; font-size: 1.3rem; font-weight: 800; }
input[type=color] { width: 80px; height: 48px; border: 1px solid #a7b7bb; border-radius: 8px; padding: 3px; cursor: pointer; }
.calendar-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.personal-preset { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.personal-preset .grow { min-width: 180px; }
/* Bildkalender mit Tages-, Wochen- und Monatsansicht */
.calendar-views { width: auto; margin: 0 0 0 auto; }
.calendar-views button { min-width: 62px; }
.calendar-presets { margin: .5rem 0 1rem; }
.calendar-presets summary { cursor: pointer; display: flex; align-items: center; gap: .55rem; color: var(--petrol); }
.calendar-presets summary::after { content: '▾'; margin-left: auto; font-size: 1rem; }
.calendar-presets[open] summary::after { transform: rotate(180deg); }
.calendar-presets summary svg { width: 22px; height: 22px; }
.calendar-presets[open] summary { margin-bottom: 1rem; }
.preset-picture { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: #e7f2f1; }
.preset-image-preview { max-width: 100%; max-height: 200px; border-radius: 12px; object-fit: contain; }
.planner-scroll, .planner-month-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.planner-scroll { max-height: 70vh; }
.planner-grid { display: grid; width: max-content; min-width: 100%; }
.planner-heading { position: sticky; top: 0; z-index: 6; min-height: 58px; background: #f1f8f9; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .5rem; color: var(--petrol-dark); font: inherit; text-align: center; cursor: pointer; }
.planner-heading span, .planner-heading strong { display: block; }
.planner-heading strong { font-size: 1rem; }
.planner-heading.today strong { color: #fff; background: var(--petrol); border-radius: 999px; padding: .1rem .5rem; display: inline-block; }
.planner-time-heading { font-size: .75rem; cursor: default; }
.planner-all-label, .planner-all-day { position: sticky; top: 58px; z-index: 5; background: #f8fbfc; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 42px; padding: .2rem; }
.planner-all-label { font-size: .7rem; color: var(--muted); }
.planner-axis { position: relative; background: #fff; border-right: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.planner-axis span { position: absolute; right: .5rem; transform: translateY(-.1rem); }
.planner-track { position: relative; min-width: 0; border-right: 1px solid var(--line); background: repeating-linear-gradient(to bottom, #fff 0, #fff 37px, #eaf0f2 37px, #eaf0f2 38px, #fff 38px, #fff 75px, #dce8eb 75px, #dce8eb 76px); }
.planner-slot { position: absolute; left: 0; width: 100%; display: flex; justify-content: flex-end; align-items: center; padding-right: .4rem; color: var(--petrol); opacity: .18; font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.planner-slot:hover, .planner-slot:focus-visible { opacity: 1; background: rgba(39, 182, 168, .12); outline: 2px solid var(--petrol); outline-offset: -2px; }
.planner-event { box-sizing: border-box; display: flex; gap: .35rem; padding: .25rem; border: 1px solid var(--planner-person-color, #077f72); border-left-width: 4px; border-radius: 8px; background: var(--planner-person-background, #e7f7f4); color: #123d48; font-size: .75rem; line-height: 1.2; text-decoration: none; min-width: 0; overflow: hidden; }
.planner-event:hover, .planner-event:focus-visible { outline: 2px solid var(--petrol); outline-offset: -2px; }
.planner-event.timed { position: absolute; z-index: 2; }
.planner-event.compact { gap: .15rem; padding: .15rem; }
.planner-event.compact .planner-picture { flex-basis: 24px; width: 24px; height: 24px; }
.planner-event.compact .planner-picture svg { width: 16px; height: 16px; }
.planner-event.compact .planner-target { display: none; }
.planner-event.compact .planner-event-copy { font-size: .68rem; }
.planner-event.compact .planner-event-copy strong, .planner-event.compact .planner-event-copy span { white-space: nowrap; }
.planner-event.cancelled { border-style: dashed; }
.planner-event-status { color: #8c2824; font-weight: 700; }
.planner-event-copy { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.planner-event-copy strong { overflow: hidden; text-overflow: ellipsis; }
.planner-event-copy span { overflow: hidden; text-overflow: ellipsis; }
.planner-target { color: #42626a; }
.planner-picture { display: block; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border-radius: 6px; background: #d7edeb; }
.planner-picture img, .planner-picture .cover-fallback { width: 100%; height: 100%; object-fit: cover; }
.planner-picture .cover-fallback svg { width: 24px; height: 24px; }
.planner-all-day .planner-event { margin-bottom: .2rem; }
.planner-month-grid { display: grid; grid-template-columns: repeat(7, minmax(145px, 1fr)); min-width: 1015px; }
.planner-month-heading { padding: .5rem; color: var(--petrol); font-weight: 800; background: #f1f8f9; border-right: 1px solid var(--line); }
.planner-month-day, .planner-month-empty { min-height: 145px; padding: .3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.planner-month-empty { background: #f8fbfc; }
.planner-month-day.today { background: #f1fbf9; }
.planner-month-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .25rem; }
.planner-month-bar button, .planner-month-add, .planner-more { border: 0; background: transparent; color: var(--petrol); font: inherit; font-weight: 800; cursor: pointer; min-width: 32px; min-height: 32px; border-radius: 8px; }
.planner-month-add { display: grid; place-items: center; font-size: 1.15rem; text-decoration: none; }
.planner-month-bar button:hover, .planner-month-add:hover, .planner-more:hover { background: var(--tuerkis-soft); }
.planner-month-day .planner-event { margin-bottom: .2rem; }
.planner-event.month-event { align-items: center; }
.planner-event.month-event .planner-picture { flex-basis: 27px; width: 27px; height: 27px; }
.planner-event.month-event .planner-picture svg { width: 17px; height: 17px; }
.planner-event.month-event .planner-event-copy span { display: none; }
.planner-more { font-size: .72rem; min-height: 28px; }
@media (max-width: 560px) { .calendar-views { margin-left: 0; } .planner-scroll { max-height: 65vh; } }
