:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17202a;
  --muted: #64707d;
  --line: #e3e7ec;
  --brand: #0f766e;
  --brand-soft: #e6f4f2;
  --pos: #15803d;
  --neg: #c2410c;
  --pos-soft: #e8f6ec;
  --neg-soft: #fdeee6;
  --warn-soft: #fff7e0;
  --cat: #6366f1;
  --acc: #0891b2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1418;
    --card: #182027;
    --text: #e7ecf0;
    --muted: #93a1ad;
    --line: #2a353f;
    --brand: #2dd4bf;
    --brand-soft: #123a37;
    --pos: #4ade80;
    --neg: #fb923c;
    --pos-soft: #13301f;
    --neg-soft: #3a2214;
    --warn-soft: #3a3014;
    --cat: #a5b4fc;
    --acc: #67e8f9;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #062421; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; font-size: 17px; display: inline-grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.danger:hover { background: var(--neg-soft); color: var(--neg); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- Kopfzeile & Navigation ---------- */
/* Kopfzeile: leicht durchscheinend („Glas“), Menü als abgerundete Leiste mit gleitender Pille */
:root { --track: #e9edf1; --pill-bg: #ffffff; --pill-line: #1f2937; --pill-shadow: 0 2px 8px rgba(16, 24, 40, .12); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --track: #0c1115; --pill-bg: rgba(255, 255, 255, .09); --pill-line: rgba(255, 255, 255, .88); --pill-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
}
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand img { border-radius: 9px; box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 35%, transparent); }
.tabs {
  position: relative; display: flex; gap: 2px; margin: 0 auto; padding: 4px;
  border-radius: 99px; background: var(--track); border: 1px solid var(--line);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.tab-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; opacity: 0; z-index: 0; pointer-events: none;
  border-radius: 99px; background: var(--pill-bg); border: 1.5px solid var(--pill-line); box-shadow: var(--pill-shadow);
  transition: left .38s cubic-bezier(.34, 1.32, .5, 1), width .38s cubic-bezier(.34, 1.32, .5, 1), opacity .2s;
}
@media (prefers-reduced-motion: reduce) { .tab-indicator { transition: none; } }
/* Menü: jedes Ziel hat eine eigene Akzentfarbe (--nav-c), Icon in einem farbigen Kästchen */
.nav-btn {
  --nav-c: var(--brand);
  border: 0; background: transparent; padding: 6px 12px 6px 6px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  color: var(--nav-c); background: color-mix(in srgb, var(--nav-c) 14%, transparent);
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-btn:hover { color: var(--text); background: color-mix(in srgb, var(--nav-c) 8%, transparent); }
.nav-btn:hover .nav-ico { transform: translateY(-1px); }
.nav-btn.active { color: var(--text); background: color-mix(in srgb, var(--nav-c) 14%, transparent); }
.nav-btn.active .nav-ico { color: #fff; background: var(--nav-c); box-shadow: 0 4px 12px color-mix(in srgb, var(--nav-c) 45%, transparent); }
.nav-btn:focus-visible { outline: 2px solid var(--nav-c); outline-offset: 2px; }
/* Menüpunkte in der Leiste: farbiges Icon direkt vor dem Wort, keine Kästchen */
.tabs .nav-btn { position: relative; z-index: 1; padding: 8px 15px 8px 13px; gap: 7px; border-radius: 99px; background: transparent; font-size: 14.5px; }
.tabs .nav-ico { width: auto; height: auto; background: none; border-radius: 0; box-shadow: none; }
.tabs .nav-ico svg { width: 17px; height: 17px; }
.tabs .nav-btn:hover { background: transparent; color: var(--text); }
.tabs .nav-btn:hover .nav-ico { transform: none; }
.tabs .nav-btn.active { background: transparent; color: var(--text); font-weight: 700; }
.tabs .nav-btn.active .nav-ico { color: var(--nav-c); background: none; box-shadow: none; }
.tabs .nav-btn:not(.active) .nav-ico { opacity: .85; }
.tabs .nav-btn:focus-visible { outline-offset: -2px; }
.top-right .icon-btn svg { width: 18px; height: 18px; }
.top-right { display: flex; align-items: center; gap: 10px; }
/* Kopfzeile rechts: Status-Plakette · Profil-Chip · Sperren */
.status-pill {
  --c: var(--pos);
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  transition: color .2s, background .2s, border-color .2s;
}
.status-pill.local   { --c: var(--brand); }
.status-pill.saving  { --c: #eab308; }
.status-pill.offline { --c: #f97316; }
.status-pill.error   { --c: #ef4444; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); animation: pill-pulse 2.4s ease-out infinite; }
.status-pill.saving .pill-dot { animation-duration: .9s; }
.status-pill.error .pill-dot, .status-pill.offline .pill-dot { animation: none; }
.pill-ico { display: grid; place-items: center; }
.pill-ico svg { width: 14px; height: 14px; }
@keyframes pill-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.user-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 2px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text);
}
.user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  --h: 170;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 45) 70% 45%));
  box-shadow: 0 2px 6px hsl(var(--h) 60% 40% / .35);
}
.lock-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.lock-btn svg { width: 17px; height: 17px; }
.lock-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.lock-btn:focus-visible, .user-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 1500px) {
  .user-chip { padding: 0 2px; }           /* nur der Avatar */
  .user-name { display: none; }
}
/* Mittelbreite Fenster: nur der aktive Menüpunkt zeigt seinen Namen, die anderen nur ihr Icon */
@media (max-width: 1420px) {
  .tabs .nav-btn:not(.active) { padding: 8px 11px; }
  .tabs .nav-btn:not(.active) .nav-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pill-dot { animation: none; } }
.topbar .nav-btn { white-space: nowrap; }
.sync { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sync.ok { color: var(--pos); }
.sync.saving { color: var(--muted); }
.sync.offline, .sync.error { color: var(--neg); }
.bottom-nav { display: none; }

.main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 110px; }

.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 20; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 14px 22px;
  font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(15, 118, 110, .35);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fab { color: #062421; } }
.fab .plus { font-size: 20px; line-height: 1; }

/* ---------- Übersicht ---------- */
.month-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.month-nav h2 { font-size: 22px; min-width: 190px; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.hero.good { background: var(--pos-soft); border-color: transparent; }
.kpi.hero.good b { color: var(--pos); }
.kpi.hero.bad { background: var(--neg-soft); border-color: transparent; }
.kpi.hero.bad b { color: var(--neg); }
.notice { background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }

.bar-row { margin-bottom: 10px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-top small { color: var(--muted); margin-left: 6px; font-size: 12px; }
.bar-top b { font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--bg); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; }
.bar .out { background: var(--neg); }
.bar .in { background: var(--pos); }
.bar .cat { background: var(--cat); }
.bar .acc { background: var(--acc); }

.tl-head, .tl-row { display: grid; grid-template-columns: 92px 1fr 110px 110px; gap: 10px; align-items: center; }
.tl-head { font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tl-head span:nth-child(n+3) { text-align: right; }
.tl-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl-row:last-child { border-bottom: 0; }
.tl-row.past { opacity: .55; }
.tl-date { color: var(--muted); font-size: 13px; }
.tl-what { display: flex; flex-direction: column; min-width: 0; }
.tl-what small { color: var(--muted); font-size: 12px; }
.tl-amt, .tl-saldo { text-align: right; font-variant-numeric: tabular-nums; }
.tl-amt.in { color: var(--pos); font-weight: 600; }
.tl-amt.out { color: var(--neg); font-weight: 600; }
.tl-saldo { color: var(--muted); }
.tl-saldo.neg { color: var(--neg); }

.big-num { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-row:last-of-type { border-bottom: 0; }
.mini-row span { display: flex; flex-direction: column; min-width: 0; }
.mini-row small { color: var(--muted); font-size: 12px; }
.mini-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }

.ol-row { display: grid; grid-template-columns: 130px 1fr 100px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.ol-row b { text-align: right; font-variant-numeric: tabular-nums; }
.ol-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.ol-bar span { display: block; height: 100%; border-radius: 99px; }
.ol-bar .pos { background: var(--pos); }
.ol-bar .neg { background: var(--neg); }

/* ---------- Listen ---------- */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .btn { margin-left: auto; }
.page-title { font-size: 22px; margin-bottom: 16px; }
.page-head .page-title { margin: 0; }
.list { display: grid; gap: 14px; }
.count { background: var(--bg); color: var(--muted); font-size: 12px; border-radius: 99px; padding: 1px 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-main small { color: var(--muted); font-size: 13px; }
.row-main .debt-info { color: var(--text); }
.row-main .note { font-style: italic; }
.row-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amt.in { color: var(--pos); }
.row-amt.out { color: var(--neg); }
.row-actions { display: flex; }
.row.finished, .debt-item.finished { opacity: .55; }
.badge { font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.badge.ok { background: var(--pos-soft); color: var(--pos); }

.empty { text-align: center; padding: 40px 20px; max-width: 520px; margin: 30px auto; }
.empty-ico { font-size: 44px; }
.empty h2 { margin: 8px 0; }
.empty p { color: var(--muted); }

/* ---------- Schulden ---------- */
.debt-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.debt-head { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.debt-head span { font-weight: 700; color: var(--neg); }
.debt-item { padding: 8px 0; border-top: 1px dashed var(--line); }
.debt-item small { display: block; color: var(--muted); font-size: 13px; }
.debt-line { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.progress span { display: block; height: 100%; background: var(--brand); }

/* ---------- Einstellungen ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line);
  border-radius: 99px; padding: 6px 12px; background: var(--card); font-size: 14px;
}
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 0 0 4px; }
.chips.select .chip { cursor: pointer; }
.chips.select .chip.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chips.select .chip.sel { color: #062421; } }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label > input, label > select, label > textarea { display: block; margin-top: 5px; }
.opt { color: var(--muted); font-weight: 400; }
input, select, textarea {
  border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.form-error { color: var(--neg); font-size: 14px; min-height: 0; margin-bottom: 8px; }
.form-error:empty { margin: 0; }

.seg { display: flex; background: var(--bg); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 30%; }

/* ---------- Anmeldung ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth { width: 100%; max-width: 400px; padding: 28px; }
.auth-logo { text-align: center; }
.auth h1 { text-align: center; font-size: 24px; margin: 8px 0 4px; }
.auth > p.muted { text-align: center; font-size: 14px; margin: 0 0 18px; }
.auth .hint { margin: 14px 0 0; }
.auth.wide-auth { max-width: 560px; }
.auth .back { margin: -8px 0 0 -8px; }
.auth-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.profile-list { display: grid; gap: 8px; }
.profile-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px;
}
.profile-card:hover { border-color: var(--brand); background: var(--brand-soft); }
/* langes Drücken: kein System-Menü und keine Textauswahl */
.profile-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.profile-row { display: flex; gap: 6px; align-items: stretch; }
.profile-row .profile-card { flex: 1; min-width: 0; }
.pf-more {
  flex: none; width: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1;
}
.pf-more:hover { border-color: var(--brand); color: var(--brand); }
.pf-tip { margin: 10px 0 0 !important; font-size: 12px; }
.action-sheet { max-width: 360px !important; padding: 18px !important; display: grid; gap: 8px; }
.action-sheet h3 { margin: 0 0 6px; text-align: center; }
.sheet-item {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.sheet-item svg { width: 18px; height: 18px; }
.sheet-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.sheet-item.danger { color: #ef4444; }
.sheet-item.danger:hover { border-color: #ef4444; background: color-mix(in srgb, #ef4444 10%, transparent); }
.sheet-item.ghost { border-color: transparent; color: var(--muted); }
@media (max-width: 600px) {
  .sheet-backdrop { align-items: flex-end !important; }
  .action-sheet { width: calc(100% - 16px) !important; margin-bottom: 8px; border-radius: 20px !important; }
}
.danger-card h3 { color: #ef4444; }
.pf-ico { font-size: 26px; }
.pf-main { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pf-main b { font-size: 16px; }
.pf-go { font-size: 22px; color: var(--muted); }
.pf-name { font-size: 18px; }
.mode-badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 9px; }
.mode-badge.local { background: var(--pos-soft); color: var(--pos); }
.mode-badge.sync { background: var(--brand-soft); color: var(--brand); }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mode-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px;
}
.mode-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.mode-card:hover, .mode-card.sel { border-color: var(--brand); background: var(--brand-soft); }
.sync-setup { margin-top: 10px; }
.sync-setup summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; }
.sync-setup .inline-form { margin-top: 8px; }
.sync.local { color: var(--pos); }
@media (max-width: 600px) { .mode-pick { grid-template-columns: 1fr; } }

/* ---------- Fragebogen ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 20, .5);
  display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.steps { display: flex; gap: 5px; }
.dot { width: 22px; height: 5px; border-radius: 99px; background: var(--line); }
.dot.done { background: var(--brand); opacity: .5; }
.dot.cur { background: var(--brand); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px 20px 6px; overflow-y: auto; }
.modal > .form-error { padding: 0 20px; }
.modal-foot { display: flex; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); }
.q { font-size: 19px; margin-bottom: 16px; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 10px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px;
}
.choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.choice.sel { border-color: var(--brand); background: var(--brand-soft); }
.choice b { font-size: 15px; }
.choice small { color: var(--muted); font-size: 13px; }
.choice-ico { font-size: 24px; }
.choice-grid.two .choice { padding: 22px 18px; }
.choice-grid.two .choice b { font-size: 18px; }
.choice.in:hover, .choice.in.sel { border-color: var(--pos); background: var(--pos-soft); }
.choice.out:hover, .choice.out.sel { border-color: var(--neg); background: var(--neg-soft); }

.preview { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }

.toast-root, #toast-root { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .4s; text-align: center;
}
.toast.hide { opacity: 0; }
.toast.has-action { display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 14px; }
.toast button {
  border: 0; background: var(--brand); color: #fff; font-weight: 700; border-radius: 99px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
#toast-root { pointer-events: none; }
#toast-root .toast { pointer-events: auto; max-width: min(560px, calc(100vw - 32px)); }

.btn.danger-text { color: var(--neg); }
.btn.danger-text:hover { background: var(--neg-soft); }
.tl-row.clickable { cursor: pointer; border-radius: 8px; }
.tl-row.clickable:hover { background: var(--bg); }
.recent { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.recent-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px; align-items: center; padding: 4px 0; font-size: 14px; }
.recent-what { display: flex; flex-direction: column; min-width: 0; }
.recent-what small { color: var(--muted); font-size: 12px; }
.recent-row > b { font-variant-numeric: tabular-nums; margin-right: 4px; }

/* ---------- Schnell-Hinzufügen im Dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head .month-nav { margin-bottom: 0; }
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.in-btn { background: var(--pos-soft); border-color: transparent; color: var(--pos); }
.btn.out-btn { background: var(--neg-soft); border-color: transparent; color: var(--neg); }
.btn.in-btn:hover { border-color: var(--pos); }
.btn.out-btn:hover { border-color: var(--neg); }
.btn-row.center { justify-content: center; }
.card h3 .push { margin-left: auto; font-weight: 600; }

/* ---------- Konten ---------- */
.acc-table { font-size: 14px; }
.acc-tr { display: grid; grid-template-columns: 1fr 95px 95px 95px; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.acc-tr:last-child { border-bottom: 0; }
.acc-tr > :not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.acc-tr.head { font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 0; }
.acc-tr.head span { color: var(--muted); }

.filter { margin: 0 0 14px; }
.chip.add { border-style: dashed; color: var(--brand); cursor: pointer; }
.chip.own { border-color: var(--brand); }
.newcat { display: inline-flex; gap: 6px; align-items: center; flex: 1 1 240px; }
.newcat input { padding: 6px 10px; }
.newcat-row { margin: -8px 0 14px; }
.cat-list { margin: 8px 0 12px; }
.cat-row { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cat-row span { flex: 1; display: flex; flex-direction: column; }
.cat-row small { color: var(--muted); font-size: 12px; }
.list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.list-tools .q-label { margin: 0; }
.list-tools .chips { margin: 0; }
.chip.toggle { cursor: pointer; margin-left: auto; }
.chip.toggle.sel { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.next-pay { color: var(--text) !important; }
.next-pay.soon b { color: var(--neg); }
@media (max-width: 600px) { .chip.toggle { margin-left: 0; } }

.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-weight: 600; font-size: 13px;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 4px;
}
.type-btn span { font-size: 22px; }
.type-btn:hover, .type-btn.sel { border-color: var(--brand); background: var(--brand-soft); }

.acc-group { margin-bottom: 14px; }
.acc-group-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.acc-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.acc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px;
}
.acc-card small { color: var(--muted); font-size: 12px; }
.acc-card:hover, .acc-card.sel { border-color: var(--brand); background: var(--brand-soft); }
.acc-card.none { border-style: dashed; }

.modal-backdrop.top { z-index: 55; }

/* ---------- Konten-Ansicht (wie Online-Banking) ---------- */
.acc-section { padding-bottom: 6px; }
.acc-panel {
  display: grid; grid-template-columns: 300px 1fr 230px; gap: 28px; align-items: start;
  padding: 20px 4px; border-top: 1px solid var(--line);
}
.acc-section h3 + .acc-panel { border-top: 0; padding-top: 6px; }

.pcard {
  position: relative; aspect-ratio: 1.586; border-radius: 14px; padding: 14px 16px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18); display: flex; flex-direction: column;
}
.pcard::after {   /* dezenter Glanz */
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 120%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent); pointer-events: none;
}
.pcard-top { display: flex; flex-direction: column; line-height: 1.2; }
.pcard-top b { font-size: 16px; }
.pcard-top span { font-size: 12px; opacity: .85; }
.pcard-mid { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pcard-chip {
  width: 38px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #f7d27a, #c9962e 55%, #f2c75c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.pcard-nfc { font-size: 14px; opacity: .8; letter-spacing: -2px; transform: scaleY(1.3); }
.pcard-big { font-size: 26px; }
.pcard-holder { margin-top: auto; font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; min-height: 18px; }
.pcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 4px; font-size: 12px; }
.pcard-bottom small { display: block; font-size: 9px; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.pcard-num { font-family: Consolas, "Courier New", monospace; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-valid { font-family: Consolas, "Courier New", monospace; text-align: right; white-space: nowrap; }
.pcard-logo { position: absolute; right: 14px; top: 12px; font-size: 22px; background: rgba(255, 255, 255, .9); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }

.acc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.af small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.af > div { font-size: 15px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; overflow-wrap: anywhere; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .02em; }
.icon-btn.tiny { width: 28px; height: 28px; font-size: 14px; }
.badge.warn { background: var(--neg-soft); color: var(--neg); }

.acc-actions { display: flex; flex-direction: column; gap: 10px; }
.acc-actions .btn { border-radius: 999px; padding: 10px 16px; text-align: center; white-space: normal; }
.btn.outline { background: transparent; border: 1.5px solid var(--brand); color: var(--brand); }
.btn.outline:hover { background: var(--brand-soft); }
.btn.outline.danger { border-color: var(--line); color: var(--neg); }
.btn.outline.danger:hover { border-color: var(--neg); background: var(--neg-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.swatch { width: 34px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.auto { width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; background: var(--bg); border-color: var(--line); }
.swatch.sel { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 1100px) {
  .acc-panel { grid-template-columns: 280px 1fr; }
  .acc-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .acc-actions .btn { flex: 1 1 180px; }
}
@media (max-width: 700px) {
  .acc-panel { grid-template-columns: 1fr; gap: 16px; }
  .pcard { max-width: 340px; }
  .acc-fields { gap: 12px 16px; }
  .acc-actions .btn { flex: 1 1 140px; padding: 9px 10px; font-size: 14px; }
}

/* ---------- Sparen ---------- */
.pot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; margin-top: 14px; }
.pot-card { display: flex; flex-direction: column; gap: 6px; }
.pot-head { display: flex; align-items: center; gap: 12px; }
.pot-ico { font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--pos-soft); border-radius: 12px; flex: none; }
.pot-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pot-title b { font-size: 17px; }
.pot-title small, .pot-sub { color: var(--muted); font-size: 13px; }
.pot-loc { font-size: 14px; background: var(--bg); border-radius: 8px; padding: 6px 10px; align-self: flex-start; }
.pot-value { font-size: 28px; font-weight: 700; color: var(--pos); margin-top: 4px; }
.pot-goal .progress { height: 10px; margin: 4px 0; }
.pot-goal small { color: var(--muted); font-size: 13px; }
.pot-plan { font-size: 13px; background: var(--brand-soft); border-radius: 8px; padding: 6px 6px 6px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pot-plan > span:first-child { flex: 1; min-width: 180px; }
.pot-plan-actions { display: flex; align-items: center; gap: 4px; }
.pot-plan-actions .btn { padding: 3px 9px; font-size: 12px; }
.pot-move { align-items: center; }
.pot-move > span:first-child { flex: 1; }
.pot-move .icon-btn.tiny { width: 26px; height: 26px; font-size: 13px; flex: none; }
.icon-spacer { width: 26px; flex: none; }
.pot-moves { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.pot-move { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.pot-move span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pot-move b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pot-move small { font-weight: 400; color: var(--muted); }
.pot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pot-note { font-size: 13px; color: var(--muted); font-style: italic; }
.type-grid.six { grid-template-columns: repeat(3, 1fr); }
.type-grid.six .type-btn { font-size: 12px; text-align: center; }
.coin-input { width: 140px; padding: 5px 10px; }
.warn-hint { background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; margin: 6px 0 14px !important; color: var(--text) !important; }

/* ---------- Tortendiagramm ---------- */
/* Kategorie-Farben: feste Reihenfolge, auf Farbschwäche geprüfte Palette – hell und dunkel getrennt abgestimmt */
:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --s-other: #a8a6a0; --s-free: #e3f3e6; --s-free-line: #2f8f3a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --s-other: #6b6a65; --s-free: #17331f; --s-free-line: #4ade80;
  }
}
.pie-card .up-head { margin-bottom: 2px; }
.pie-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; margin-top: 8px; }
.pie { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.slice { stroke: var(--card); stroke-width: 2; transition: opacity .15s; cursor: default; }
.slice.s1 { fill: var(--s1); } .slice.s2 { fill: var(--s2); } .slice.s3 { fill: var(--s3); }
.slice.s4 { fill: var(--s4); } .slice.s5 { fill: var(--s5); } .slice.other { fill: var(--s-other); }
.slice.free { fill: var(--s-free); stroke: var(--s-free-line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pie-big { font-size: 26px; font-weight: 700; text-anchor: middle; fill: var(--text); }
.pie-big.neg { fill: var(--neg); font-size: 20px; }
.pie-small { font-size: 12px; text-anchor: middle; fill: var(--muted); }
.pie-focus .slice:not(.hl) { opacity: .3; }
.pie-legend { display: grid; gap: 2px; }
.pie-row { display: grid; grid-template-columns: 14px 1fr auto 52px; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 14px; }
.pie-row.hl { background: var(--bg); }
.pie-row b { font-variant-numeric: tabular-nums; }
.pie-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pie-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw { width: 14px; height: 14px; border-radius: 4px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); }
.sw.s4 { background: var(--s4); } .sw.s5 { background: var(--s5); } .sw.other { background: var(--s-other); }
.sw.free { background: var(--s-free); border: 1.5px dashed var(--s-free-line); }
.pie-row:has(.sw.free) { font-weight: 600; }
@media (max-width: 700px) {
  .pie-wrap { grid-template-columns: 1fr; gap: 12px; }
  .pie { max-width: 220px; }
}

/* ---------- Dashboard-Bausteine ---------- */
.dash-grid { align-items: stretch; }
.w { display: flex; flex-direction: column; min-width: 0; position: relative; }
.w-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.w-body > .card { flex: 1; }
.w-body > .kpis { margin-bottom: 0; }
.w-body > .notice { margin: 14px 0 0; }
.w-body > .up-card { margin-bottom: 0; }

.w-edit { border: 2px dashed var(--brand); border-radius: calc(var(--radius) + 6px); padding: 6px; background: var(--brand-soft); cursor: grab; }
.w-edit .w-body { pointer-events: none; }     /* im Anpassen-Modus nichts versehentlich anklicken */
.w-edit.dragging { opacity: .4; }
.w-edit.drop-before { box-shadow: -6px -6px 0 -2px var(--brand); }
.w-edit.drop-after { box-shadow: 6px 6px 0 -2px var(--brand); }
.w-hidden .w-body { opacity: .35; filter: grayscale(1); }
.w-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 4px 8px; }
.w-bar b { font-size: 13px; flex: 1; min-width: 120px; }
.w-handle { font-size: 18px; color: var(--brand); cursor: grab; line-height: 1; }
.w-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.w-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.w-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.w-btn:disabled { opacity: .35; cursor: default; }
.w-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.edit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px;
}
.center-text { text-align: center; margin-top: 16px; }

/* Karten untereinander (Schulden-Seite) */
.stack { display: grid; gap: 14px; }
.stack .up-card { margin-bottom: 0; }
/* Gläubiger-Blöcke (Schulden-Seite) */
.dg-list { display: grid; gap: 14px; }
.dg { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg); }
.dg-icon { font-size: 24px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--card); border-radius: 12px; flex: none; }
.dg-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dg-title b { font-size: 17px; }
.dg-title small { color: var(--muted); font-size: 13px; }
.dg-total { text-align: right; display: flex; flex-direction: column; }
.dg-total small { color: var(--muted); font-size: 12px; }
.dg-total b { font-size: 22px; color: var(--neg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dg-split { padding: 10px 16px 0; margin: 0; }

.dl { padding: 4px 16px 8px; }
.dl-row {
  display: grid; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(200px, 2.2fr) minmax(95px, 1fr) minmax(115px, 1fr) minmax(115px, 1fr) minmax(150px, 1.4fr) minmax(95px, auto);
}
.dl-row:last-child { border-bottom: 0; }
.dl-row.finished { opacity: .5; }
.dl-row.soon .c2 b, .dl-row.soon .c2 span { color: var(--neg); }
.dl-name { min-width: 0; }
.dl-title { display: flex; align-items: flex-start; gap: 4px; }
.dl-title b { font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dl-title .icon-btn { width: 30px; height: 30px; font-size: 15px; flex: none; margin-top: -4px; }
.dl-name .up-tags { margin-top: 5px; }
.dl-cell { display: flex; flex-direction: column; line-height: 1.25; }
.dl-cell small, .dl-open small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.dl-cell b { font-size: 14px; font-variant-numeric: tabular-nums; }
.dl-cell span { font-size: 12px; color: var(--muted); }
.dl-prog .progress { margin: 0 0 4px; height: 8px; }
.dl-prog small { font-size: 12px; color: var(--muted); }
.dl-open { display: flex; flex-direction: column; text-align: right; }
.dl-open b { font-size: 16px; color: var(--neg); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1000px) {
  .dl-row {
    grid-template-columns: 1fr 1fr 1fr; row-gap: 10px;
    grid-template-areas: "name name open" "c1 c2 c3" "prog prog prog";
  }
  .dl-name { grid-area: name; }
  .dl-open { grid-area: open; }
  .dl-row > .c1 { grid-area: c1; }
  .dl-row > .c2 { grid-area: c2; }
  .dl-row > .c3 { grid-area: c3; }
  .dl-prog { grid-area: prog; }
  .dg-head { padding: 12px; }
  .dl { padding: 4px 12px 8px; }
  .dg-split { padding: 10px 12px 0; }
}

/* ---------- Nächste Abbuchungen ---------- */
.up-card { margin-bottom: 14px; }
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.up-head h3 { margin: 0; }
.seg.small-seg { margin: 0; padding: 3px; }
.seg.small-seg button { padding: 5px 10px; font-size: 13px; flex: 0 0 auto; }
.up-summary { margin: 8px 0 12px; font-size: 14px; }
.up-list { display: grid; gap: 8px; }
.up-item {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center; cursor: pointer;
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.up-item:hover { border-color: var(--brand); }
.up-item.near { border-left-color: #d97706; }
.up-item.soon { border-left-color: var(--neg); background: var(--neg-soft); }
.up-date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; background: var(--bg); border-radius: 10px; padding: 6px 0; }
.up-date b { font-size: 22px; }
.up-date small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.up-main { min-width: 0; }
.up-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.up-title b { font-size: 15px; }
.up-when { font-size: 12px; font-weight: 700; color: var(--muted); }
.up-item.soon .up-when { color: var(--neg); }
.up-item.near .up-when { color: #d97706; }
.up-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.up-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { font-size: 12px; background: var(--bg); border-radius: 6px; padding: 2px 8px; color: var(--text); }
.tag.acc { background: var(--brand-soft); font-weight: 600; }
.tag.rate { background: var(--warn-soft); }
.tag.warn { background: var(--neg-soft); color: var(--neg); }
.tag.pay { font-weight: 700; border: 1px solid var(--line); background: var(--card); }
.tag.pay-paylater { background: #fff1d6; border-color: #f0b44c; color: #8a4b00; }
.tag.pay-raten { background: #ede9fe; border-color: #a78bfa; color: #5b21b6; }
.tag.pay-abo { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag.pay-paylater { background: #3a2a0c; border-color: #a16207; color: #fcd34d; }
  :root:not([data-theme="light"]) .tag.pay-raten { background: #2a2145; border-color: #7c3aed; color: #c4b5fd; }
  :root:not([data-theme="light"]) .tag.pay-abo { background: #0c2a3a; border-color: #0369a1; color: #7dd3fc; }
}
.row-main .up-tags { margin: 4px 0 2px; }
.debt-item .up-tags { margin: 4px 0; }
.up-tags.split { margin: 0 0 6px; }
.budget-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px; }
.budget-hint { font-size: 13px; background: var(--brand-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.budget-hint.warn { background: var(--neg-soft); }
.tag.budget { background: var(--pos-soft); color: var(--pos); font-weight: 600; }
@media (max-width: 600px) { .budget-pick { grid-template-columns: 1fr; } }
.pay-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pay-box .notice { margin-top: 8px; }
.up-amt { font-size: 17px; font-weight: 700; color: var(--neg); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Schnell-Eintrag ---------- */
.btn.quick-btn { background: var(--warn-soft); border-color: transparent; }
.btn.quick-btn:hover { border-color: #d97706; }
.page-head .push-right { margin-left: auto; }
.page-head .push-right .btn { margin-left: 0; }
.amount-big { font-size: 13px; color: var(--muted); }
.amount-wrap { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.amount-wrap input { font-size: 30px; font-weight: 700; padding: 10px 14px; text-align: right; font-variant-numeric: tabular-nums; }
.amount-wrap span { font-size: 26px; font-weight: 700; color: var(--muted); }
.q-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0 6px; }
.chips.tight { margin: 0 0 10px; gap: 6px; }
.chips.tight .chip { padding: 5px 11px; font-size: 13px; }
input.mb { margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Hinzufügen-Menü */
.fab-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-wrap .fab { position: static; }
.fab-menu { display: none; flex-direction: column; gap: 8px; align-items: stretch; }
.fab-wrap.open .fab-menu { display: flex; }
.fab-menu button {
  border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 16px; cursor: pointer;
  font-weight: 600; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.fab-menu button:hover { border-color: var(--brand); }
.modal.narrow { max-width: 520px; }

/* ---------- Tablet / Handy ---------- */
@media (max-width: 1100px) {
  .tabs { display: none; }
  .topbar { padding: 10px 16px; justify-content: space-between; }
  .user { display: none; }
  /* Handy: schwebende, abgerundete Leiste (Glas) mit gleitender Pille – wie die obere Leiste am PC */
  .bottom-nav {
    display: flex; position: fixed; z-index: 15;
    left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 5px; border-radius: 26px;
    background: color-mix(in srgb, var(--card) 84%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
  }
  .bottom-nav .tab-indicator { top: 5px; bottom: 5px; border-radius: 21px; }
  .bottom-nav .nav-btn {
    position: relative; z-index: 1; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px;
    padding: 7px 2px 6px; border-radius: 21px; background: transparent; font-size: 11px;
  }
  .bottom-nav .nav-btn:hover, .bottom-nav .nav-btn.active { background: transparent; }
  .bottom-nav .nav-btn.active { color: var(--text); font-weight: 700; }
  .bottom-nav .nav-ico { width: auto; height: auto; background: none; border-radius: 0; box-shadow: none; }
  .bottom-nav .nav-btn.active .nav-ico { color: var(--nav-c); background: none; box-shadow: none; }
  .bottom-nav .nav-btn:not(.active) .nav-ico { opacity: .85; }
  .bottom-nav .nav-ico svg { width: 21px; height: 21px; }
  .bottom-nav .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 16px 16px 160px; }
  .fab-wrap { bottom: calc(90px + env(safe-area-inset-bottom)); right: 16px; }
  .fab { padding: 12px 18px; }
  #toast-root { bottom: 150px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi.hero { grid-column: 1 / -1; order: -1; }
  .kpi b { font-size: 21px; }
  .card { padding: 14px; }
  .month-nav h2 { font-size: 18px; min-width: 0; flex: 1; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid.two { grid-template-columns: 1fr 1fr; }
  .tl-head { display: none; }
  .tl-row { grid-template-columns: 1fr auto; grid-template-areas: "what amt" "date saldo"; row-gap: 0; }
  .tl-what { grid-area: what; }
  .tl-amt { grid-area: amt; }
  .tl-date { grid-area: date; font-size: 12px; }
  .tl-saldo { grid-area: saldo; font-size: 12px; }
  .ol-row { grid-template-columns: 95px 1fr 88px; font-size: 13px; }
  .dash-head { flex-direction: column; align-items: stretch; }
  .quick-add .btn { flex: 1; padding: 9px 8px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .up-item { grid-template-columns: 48px 1fr; gap: 10px; padding: 10px; }
  .up-amt { grid-column: 2; font-size: 16px; }
  .up-date b { font-size: 19px; }
  .amount-wrap input { font-size: 26px; }
  .acc-tr { grid-template-columns: 1fr 80px 80px; }
  .acc-tr > :nth-child(4) { display: none; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .acc-pick { grid-template-columns: 1fr; }
  .modal-foot .btn-row .btn { padding: 9px 12px; }
  .modal-foot > .btn.ghost[data-action$="close"] { display: none; }   /* Schließen geht über ✕ */
  .modal-foot > .btn-row { flex: 1; flex-wrap: nowrap; }
  .modal-foot > .btn-row .btn { flex: 1; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; max-width: none; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sync { font-size: 11px; }
}

/* Schmale Handys: 7 Menüpunkte – längere Wörter bekommen etwas mehr Platz (muss am Dateiende stehen) */
@media (max-width: 420px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 15px; gap: 8px; }
  .top-right { gap: 6px; }
  .status-pill { padding: 0 9px 0 8px; font-size: 11.5px; gap: 5px; }
  .bottom-nav { left: 8px; right: 8px; padding: 4px; }
  .bottom-nav .tab-indicator { top: 4px; bottom: 4px; }
  .bottom-nav .nav-btn { font-size: 9.5px; padding: 7px 1px 6px; letter-spacing: -.1px; flex: 1 1 auto; min-width: auto; }
  .bottom-nav .nav-label { overflow: visible; }
  .bottom-nav .nav-ico svg { width: 20px; height: 20px; }
}

/* ---------- Bestätigungsfenster (z. B. „Haushaltsbuch sperren?“) ---------- */
.confirm-backdrop { z-index: 70; place-items: center !important; padding: 16px !important; animation: fade-in .15s ease-out; }
.confirm-box {
  max-width: 400px !important; border-radius: 20px !important; padding: 26px 24px 20px; text-align: center;
  animation: pop-in .22s cubic-bezier(.34, 1.4, .5, 1);
}
.confirm-ico { display: grid; place-items: center; margin: 0 auto 12px; font-size: 30px; }
.confirm-lock {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}
.confirm-lock svg { width: 26px; height: 26px; }
.confirm-box h3 { font-size: 19px; margin-bottom: 8px; }
.confirm-box p { color: var(--muted); font-size: 14px; margin: 0 0 20px; line-height: 1.5; }
.confirm-box p b { color: var(--text); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { border-radius: 99px; padding: 11px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.confirm-actions .btn svg { width: 16px; height: 16px; }
.confirm-actions .btn.ghost { border: 1px solid var(--line); color: var(--text); }
.btn.danger-solid { background: var(--neg); border-color: var(--neg); color: #fff; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .confirm-backdrop, .confirm-box { animation: none; } }
.confirm-lock.danger { color: var(--neg); background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.btn.danger-solid:hover { filter: brightness(1.08); }
.btn.danger-solid:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.confirm-type { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; margin: -6px 0 16px; }
.confirm-type b { color: var(--text); }
/* Löschen immer eindeutig rot (im dunklen Modus ist --neg orange) */
.btn.danger-solid { background: #ef4444; border-color: #ef4444; color: #fff; }
.confirm-lock.danger { color: #ef4444; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); }
.confirm-lock.warn { color: #eab308; background: rgba(234, 179, 8, .13); border-color: rgba(234, 179, 8, .4); }
.confirm-actions.single { grid-template-columns: 1fr; }
.confirm-value { margin: -6px 0 16px; text-align: center; font-size: 16px; font-weight: 600; }

/* ---------- Kontoauszug-Import ---------- */
.imp-modal { max-width: 860px; }
.imp-drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 16px 0 12px; padding: 30px 16px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 16px; background: var(--bg); text-align: center; font-weight: 400; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.imp-drop b { color: var(--text); font-size: 16px; }
.imp-drop u { color: var(--brand); }
.imp-drop:hover, .imp-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.imp-drop.disabled { opacity: .5; cursor: not-allowed; }
.imp-drop-ico { font-size: 34px; }
.imp-help { margin-top: 6px; font-size: 14px; }
.imp-help summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.imp-help ul { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.imp-error { margin: 0 0 12px; background: var(--neg-soft); }
.imp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.imp-preview { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.imp-preview table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.imp-preview th, .imp-preview td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.imp-preview th { background: var(--bg); }
.imp-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tag.imp-t-match, .tag.booked { background: var(--pos-soft); color: var(--pos); font-weight: 700; }
.tag.imp-t-new { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.tag.booked { font-size: 11px; padding: 1px 6px; vertical-align: 1px; }
.imp-list { display: grid; gap: 6px; }
.imp-row {
  display: grid; grid-template-columns: 82px 1fr auto 260px; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; font-size: 14px;
}
.imp-row.a-match { border-left-color: var(--pos); }
.imp-row.a-new { border-left-color: var(--brand); }
.imp-row.a-ignore { opacity: .6; }
.imp-date { color: var(--muted); font-size: 13px; }
.imp-main { display: flex; flex-direction: column; min-width: 0; }
.imp-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-reason { color: #d97706 !important; }
.imp-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.imp-act { display: flex; flex-direction: column; gap: 4px; }
.imp-act select { padding: 6px 8px; font-size: 13px; }
.booked-info { color: var(--pos) !important; }
@media (max-width: 760px) {
  .imp-row { grid-template-columns: 1fr auto; grid-template-areas: "main amt" "date date" "act act"; row-gap: 4px; }
  .imp-main { grid-area: main; } .imp-amt { grid-area: amt; } .imp-date { grid-area: date; } .imp-act { grid-area: act; }
}
.pot-head .icon-btn + .icon-btn { margin-left: -6px; }
/* Liste der Import-Vorgänge */
.imp-hist { display: grid; gap: 8px; }
.imp-hist-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.imp-hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-hist-main small { color: var(--muted); font-size: 12.5px; }
.imp-hist-main .up-tags { margin-top: 4px; }
.btn.outline.danger { border-color: var(--line); color: #ef4444; background: transparent; }
.btn.outline.danger:hover { border-color: #ef4444; background: rgba(239, 68, 68, .1); }
.inline-link { padding: 2px 6px !important; margin-left: 4px; }
@media (max-width: 600px) { .imp-hist-row { flex-direction: column; align-items: stretch; } }

/* ---------- Zahlung aussetzen ---------- */
.up-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.skip-btn { padding: 4px 10px !important; font-size: 12px !important; opacity: .75; }
.up-item:hover .skip-btn, .skip-btn:focus-visible { opacity: 1; }
.up-item.skipped { opacity: .6; border-style: dashed; background: transparent; }
.up-item.skipped .up-when { color: var(--muted); }
.tag.skip-tag { background: var(--warn-soft); display: inline-flex; align-items: center; gap: 4px; }
.tag-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0 0 0 2px; line-height: 1; }
.tag-x:hover { color: #ef4444; }
.skip-box { max-width: 460px !important; }
.skip-label { text-align: left; font-size: 13px; color: var(--muted); }
.skip-label select { margin-top: 5px; }
.skip-modes { margin-bottom: 10px; }
.skip-box .budget-hint { text-align: left; }
@media (max-width: 600px) {
  .up-right { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}
/* Sonderzahlung */
.tag.extra-tag { background: var(--pos-soft); color: var(--pos); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.extra-btn { font-weight: 700; }
.name-chips { margin: -8px 0 14px; }

/* ---------- Auswahlmenü an der Status-Plakette ---------- */
.status-wrap { position: relative; display: inline-flex; }
button.status-pill { cursor: pointer; font-family: inherit; }
button.status-pill:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
button.status-pill:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.pill-caret { font-size: 10px; opacity: .75; margin-left: -1px; transition: transform .15s; }
.status-pill[aria-expanded="true"] .pill-caret { transform: rotate(180deg); }
.status-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 300px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); animation: pop-in .16s ease-out;
}
.sm-head { padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.sm-head small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sm-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  border: 0; background: transparent; border-radius: 10px; padding: 9px 10px; font-weight: 600; color: var(--text);
}
.sm-item > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.sm-item small { color: var(--muted); font-weight: 400; font-size: 12px; }
.sm-item:hover { background: var(--bg); }
.sm-item.on { background: var(--brand-soft); }
.sm-item.small { padding: 7px 10px; font-size: 13.5px; }
.sm-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); flex: none; font-size: 14px; }
.sm-ico svg { width: 15px; height: 15px; }
.sm-check { color: var(--brand); font-weight: 800; }
.sm-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* Fenster „Mit Server verbinden“ */
.connect-box { max-width: 480px !important; }
.conn-proto { margin: 0 0 12px; }
.conn-grid { display: grid; grid-template-columns: 1fr 100px; gap: 10px; text-align: left; }
.conn-note { text-align: left; margin: 0 0 14px !important; }
.conn-code { display: block; text-align: left; margin-top: 10px; }
.conn-code input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.server-fields input[name="setupCode"] { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
@media (max-width: 600px) { .server-fields { grid-template-columns: 1fr; } }
.confirm-actions.three { grid-template-columns: auto 1fr 1fr; }
@media (max-width: 600px) {
  .status-menu { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .confirm-actions.three { grid-template-columns: 1fr 1fr; }
  .confirm-actions.three .btn.ghost { grid-column: 1 / -1; order: 3; }
}

/* ---------- Haushalt & Familie ---------- */
.fam-wrap { position: relative; display: inline-flex; }
button.fam-btn { cursor: pointer; font-family: inherit; gap: 6px; }
button.fam-btn:hover { border-color: var(--brand); }
.fam-btn .pill-caret { margin-left: 0; }
.fam-btn[aria-expanded="true"] .pill-caret { transform: rotate(180deg); }
.fam-btn.in-ctx { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 14%, var(--bg)); }
.fam-menu { width: 320px; }
@media (max-width: 1500px) { .fam-btn { padding: 0 8px 0 2px; } }
@media (max-width: 600px) { .fam-btn { padding: 0 2px; } .fam-btn .pill-caret { display: none; } }

.ctx-banner {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 10px 12px 10px 10px; border-radius: 14px;
  background: color-mix(in srgb, #f59e0b 12%, var(--card)); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent);
}
.ctx-banner.ro { background: color-mix(in srgb, #3b82f6 10%, var(--card)); border-color: color-mix(in srgb, #3b82f6 40%, transparent); }
.ctx-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ctx-banner small { color: var(--muted); font-size: 12.5px; }
.ctx-ico { font-size: 22px; width: 28px; text-align: center; }
@media (max-width: 600px) { .ctx-banner { flex-wrap: wrap; } .ctx-banner .btn { width: 100%; } }

/* Nur ansehen: nichts zum Hinzufügen anbieten */
body.readonly .fab-wrap, body.readonly .quick-add,
body.readonly #main [data-action="add"], body.readonly #main [data-action="quick"], body.readonly #main [data-action="edit"],
body.readonly #main [data-action="delete"], body.readonly #main [data-action="bonus-new"], body.readonly #main [data-action="skip-open"],
body.readonly #main [data-action="extra-open"], body.readonly #main [data-action="budget-new"], body.readonly #main [data-action="imp-open"],
body.readonly #main [data-action="pot-new"], body.readonly #main [data-action="pot-tx"], body.readonly #main [data-action="pot-edit"],
body.readonly #main [data-action="pot-delete"], body.readonly #main [data-action="acc-new"], body.readonly #main [data-action="acc-edit"],
body.readonly #main [data-action="acc-quick"], body.readonly #main [data-action="acc-delete"] { display: none !important; }

.avatar.big { width: 64px; height: 64px; font-size: 28px; margin: 0 auto; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.who-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; color: var(--text); font-family: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.who-card:hover, .who-card:focus-visible { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.who-card .avatar { width: 48px; height: 48px; font-size: 20px; }
.who-card b { font-size: 15px; }
.who-card small { color: var(--muted); font-size: 12px; }
.pin-input { font-size: 22px !important; letter-spacing: .5em; text-align: center; }

.fam-card .inline-form { margin: 4px 0 12px; }
.fam-list { display: grid; gap: 8px; margin: 0 0 14px; }
.fam-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
}
.fam-main { display: flex; flex-direction: column; min-width: 0; }
.fam-main small { color: var(--muted); font-size: 12.5px; }
.fam-perm-wrap { display: flex; flex-direction: column; gap: 3px; }
.fam-perm-wrap small { font-size: 11.5px; }
.seg.fam-perm { margin: 0; padding: 3px; background: var(--card); }
.seg.fam-perm button { padding: 5px 9px; font-size: 12.5px; flex: 0 0 auto; }
.fam-btns { display: flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .fam-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .fam-perm-wrap { grid-column: 1 / -1; order: 5; }
  .fam-row .fam-empty { display: none; }
}
/* ---------- Erster Start / Mit Server verbinden ---------- */
.welcome h1 { margin-top: 6px; }
.welcome-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.welcome-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 14px; line-height: 1.45; }
.welcome-list li > span:first-child { font-size: 22px; line-height: 1.1; }
.welcome-note { margin: -8px 0 6px !important; }
.start-pick .mode-card > b { font-size: 16px; }
.check-row { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; margin: 4px 0 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.srv-title { font-size: 22px !important; }
.srv-leave { display: block; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 12%, transparent); }
.srv-test-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; min-height: 34px; }
.srv-mode button { font-size: 13px; }
.neg-text { color: #ef4444; }
.pos-text { color: var(--pos); font-weight: 600; }
.conn-pw { text-align: left; margin-top: 8px; }
.conn-pw p { margin: 0 0 6px; }
.form-box { max-width: 440px !important; text-align: left; }
.form-box h3, .form-box .confirm-ico { text-align: center; }
.form-box .skip-label { display: block; margin-bottom: 10px; }

.upd-bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 6px 0 4px; }
.upd-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .2s; }

.fam-main .srv-hint { margin-top: 2px; }
.fam-main .srv-hint.ok { color: var(--pos); }
.fam-main .srv-hint.warn { color: #f59e0b; }
.fam-howto { line-height: 1.5; margin-top: 12px; }
.fam-howto .mono { overflow-wrap: anywhere; }
.fetch-who { margin: 4px 0 14px; }
.fetch-who button { font-size: 13px; padding: 8px 6px; }
.member-box { max-width: 520px !important; text-align: left; overflow-y: auto; overscroll-behavior: contain; }
.member-box h3, .member-box .confirm-ico { text-align: center; }
.md-form .seg { margin-bottom: 10px; }
.md-form .skip-label { display: block; margin-bottom: 10px; }
.md-note { margin: -2px 0 10px !important; text-align: left; }
.member-box .form-error { min-height: 0; margin: 0 0 10px; }
