/* Lebensportal – ruhig, klar, für Desktop, iPhone und iPhone Duo.
   Breakpoints:
   < 600 px   iPhone / Duo zugeklappt: eine Spalte, Tab-Leiste mit 5 Einträgen
   600–879    Duo aufgeklappt (hochkant ca. 626 pt): zwei Spalten, Tab-Leiste mit allen Bereichen
   880–1279   Duo quer, kleiner Mac: Seitenleiste + zwei Spalten
   ≥ 1280     Mac: Seitenleiste + Inhalt + Hinweisspalte */

:root {
  color-scheme: light dark;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --sunken: #ecebe5;
  --line: rgba(25, 25, 15, 0.09);
  --line-2: rgba(25, 25, 15, 0.17);
  --text: #1c1c1a;
  --text-2: #5d5c57;
  --text-3: #8c8b85;
  --accent: #2860c4;
  --accent-bg: #e7eefa;
  --accent-text: #1c4c9c;
  --danger: #b3312a;
  --danger-bg: #fbe9e7;
  --warn: #8a5400;
  --warn-bg: #fbefd8;
  --ok: #2d6c20;
  --ok-bg: #e7f2de;
  --r: 14px;
  --r-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar-h: 58px;
  --pad: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515;
    --surface: #1f1f20;
    --surface-2: #1b1b1c;
    --sunken: #2b2b2d;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --text: #f2f1ec;
    --text-2: #b3b2ac;
    --text-3: #87867f;
    --accent: #7aa8f5;
    --accent-bg: #1f2c42;
    --accent-text: #b0cbf8;
    --danger: #f2928a;
    --danger-bg: #3b1e1c;
    --warn: #f1bd68;
    --warn-bg: #3a2d16;
    --ok: #a3d585;
    --ok-bg: #20331a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
h3 { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--text-2); }
.fine { font-size: 12.5px; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Grundgerüst ---------- */
.shell { min-height: 100dvh; }
.sidebar, .hints { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
  background: var(--bg);
}
.topbar .title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag { font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 3px 9px; margin-right: 4px; }
.content { padding: 4px max(var(--pad), env(safe-area-inset-right)) 24px max(var(--pad), env(safe-area-inset-left)); max-width: 1200px; }

.tabbar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tab {
  flex: 1 1 0; min-width: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h);
  color: var(--text-3); text-decoration: none;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em;
}
.tab .i { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.tab .bubble {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
}
.tab.md { display: none; }

/* ---------- Seitenleiste ---------- */
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 16px; font-weight: 650; font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark .i { width: 17px; height: 17px; stroke-width: 2; }
.nav {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-size: 14px;
}
.nav:hover { background: var(--sunken); color: var(--text); }
.nav.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--danger); background: var(--danger-bg); border-radius: 999px; padding: 0 7px; line-height: 19px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; }
.lockinfo { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); padding: 0 10px; }
.lockinfo .i { width: 15px; height: 15px; }

/* ---------- Knöpfe & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--sunken); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover { opacity: 0.88; }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 50px; font-size: 16px; width: 100%; border-radius: 12px; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn[aria-busy="true"] { opacity: 0.55; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-2);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.link { background: none; border: 0; padding: 6px 4px; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field[hidden] { display: none; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-error, .error { color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }

/* ---------- Karten, Zeilen, Abzeichen ---------- */
.hero { padding: 6px 0 2px; }
.hero p { margin-top: 4px; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px; min-width: 0; }
.kpi .l { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 21px; font-weight: 650; letter-spacing: -0.015em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.card + .card { margin-top: 0; }
.stack { display: grid; gap: 12px; align-content: start; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 28px; }
.card-h > .i { width: 18px; height: 18px; color: var(--text-3); }
.card-h h2 { flex: 1; min-width: 0; font-size: 15px; }
.card-h .more { font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.empty { color: var(--text-3); font-size: 14px; padding: 8px 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; text-decoration: none; color: inherit; }
.rows > :first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { display: block; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { flex: none; text-align: right; font-size: 13px; display: grid; gap: 3px; justify-items: end; }
.row.past .t, .row.past .s { color: var(--text-3); }
.row.done .t { color: var(--text-3); text-decoration: line-through; }
.list .row { padding: 10px 10px; margin: 0 -10px; border-radius: 10px; border-top-color: transparent; box-shadow: 0 -1px 0 var(--line); }
.list .rows > :first-child { box-shadow: none; }
.list .row:hover { background: var(--surface-2); }
.list .row.sel { background: var(--accent-bg); box-shadow: none; }
.list .row.sel + .row { box-shadow: none; }
.time { flex: none; width: 46px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sunken); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--sunken); color: var(--text-2); display: grid; place-items: center; }
.ico .i { width: 18px; height: 18px; }
.ico.big { width: 44px; height: 44px; border-radius: 12px; }
.ico.big .i { width: 22px; height: 22px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.accent { background: var(--accent-bg); color: var(--accent-text); }

.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); }
.hide-amounts .amt { filter: blur(7px); }

.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-bg); color: var(--accent-text); border-radius: var(--r); padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.banner p { flex: 1 1 220px; }
.banner a { font-weight: 600; color: inherit; }
.note { font-size: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); color: var(--text-2); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.danger { background: var(--danger-bg); color: var(--danger); }
.notes { white-space: pre-wrap; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 4px 0 12px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }

.list-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.list-h .grow { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); }

/* ---------- Liste + Detail (Duo aufgeklappt: nebeneinander) ---------- */
.split { display: grid; gap: 12px; align-items: start; }
.split.has-sel > .pane-list { display: none; }
.split:not(.has-sel) > .pane-detail { display: none; }
.pane-list, .pane-detail { min-width: 0; }
.detail-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-h .grow { flex: 1; min-width: 0; }
.detail-h h2 { font-size: 18px; overflow-wrap: anywhere; }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 16px; margin: 6px 0 14px; font-size: 14px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl dd .badge { margin-left: 6px; vertical-align: 1px; }
.placeholder { display: grid; gap: 10px; justify-items: start; }

/* ---------- Finanzen ---------- */
.two-col { display: grid; gap: 12px; align-items: start; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.track { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.acct { display: flex; align-items: center; gap: 11px; }
.acct .v { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }

/* ---------- Kalender ---------- */
.day.today { border-color: var(--accent); }
.day-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.day-h h2 { font-size: 15px; }

/* ---------- Aufgaben ---------- */
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; }
.task-row .check { flex: 1; min-width: 0; }
.task-row .del { width: 34px; height: 34px; color: var(--text-3); }

/* ---------- Hinweise ---------- */
.hint { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.hint:first-of-type { border-top: 0; }
.hint .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--text-3); }
.hint.danger .dot { background: var(--danger); }
.hint.warn .dot { background: var(--warn); }
.hint .ht { font-size: 13.5px; }
.hint .ha { margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.claude-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-3); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.claude-note .i { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- Sperre & Einrichtung ---------- */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.lock-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px 26px; display: grid; gap: 14px; text-align: center; }
.lock-card.wide { width: min(540px, 100%); text-align: left; }
.lock-icon { width: 76px; height: 76px; margin: 0 auto 4px; border-radius: 24px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; }
.lock-card.wide .lock-icon { margin: 0 0 4px; }
.lock-icon .i { width: 40px; height: 40px; stroke-width: 1.5; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.recovery { font: 600 18px/1.7 var(--mono); letter-spacing: 0.05em; text-align: center; background: var(--sunken); border-radius: 12px; padding: 14px 10px; user-select: all; -webkit-user-select: all; }
.recovery-form { display: grid; gap: 10px; text-align: left; }
.recovery-form input { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Sichtschutz & Meldung ---------- */
.shield { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); color: var(--text-3); }
.shield[hidden] { display: none; }
.shield-i { width: 44px; height: 44px; }
.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 500;
  max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }

/* ---------- Duo aufgeklappt (hochkant) und größer ---------- */
@media (min-width: 600px) {
  :root { --pad: 20px; }
  .tab.xs { display: none; }
  .tab.md { display: flex; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .split.has-sel > .pane-list, .split:not(.has-sel) > .pane-detail { display: block; }
  .pane-detail { position: sticky; top: calc(56px + env(safe-area-inset-top)); }
  .back-xs { display: none; }
  .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .two-col.loose { grid-template-columns: minmax(0, 1fr); } /* Vermögen: erst bei viel Platz zweispaltig */
}

/* ---------- Duo quer, Mac ---------- */
@media (min-width: 880px) {
  .shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); }
  .tabbar { display: none; }
  .main { padding-bottom: 0; }
  .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: calc(18px + env(safe-area-inset-top)) 10px 16px max(10px, env(safe-area-inset-left));
    background: var(--surface-2); border-right: 1px solid var(--line);
  }
  .compact-only { display: none !important; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .toast { bottom: 24px; }
  .content { padding-top: 8px; }
  .topbar { padding-left: 24px; }
  :root { --pad: 24px; }
}

@media (min-width: 1100px) {
  .two-col.loose { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .shell { grid-template-columns: 228px minmax(0, 1fr) 304px; }
  .hints {
    display: block; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: calc(20px + env(safe-area-inset-top)) 18px 20px;
    background: var(--surface-2); border-left: 1px solid var(--line);
  }
  .hints h2 { margin-bottom: 2px; }
  .inline-hints { display: none; }
}

@media (max-width: 420px) {
  h1 { font-size: 24px; }
  .task-add { grid-template-columns: minmax(0, 1fr) auto; }
  .task-add input[type="date"] { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Kleinkram ---------- */
.track, .fill { display: block; }
.spaced { margin-top: 12px; }
h3.sub { margin: 12px 0 2px; }
.row .s.overdue { color: var(--danger); }
.facts { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.list .row > .i { color: var(--text-3); }

/* ---------- Dateien an Dokumenten ---------- */
.file-pick { position: relative; overflow: hidden; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.viewer {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.viewer-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.viewer-bar .t { min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .grow { flex: 1; }
.viewer-body { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; -webkit-overflow-scrolling: touch; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body .muted { padding: 24px; text-align: center; max-width: 32ch; }
.file-open { all: unset; box-sizing: border-box; display: block; flex: 1; min-width: 0; cursor: pointer; border-radius: 6px; }
.file-open:hover .t { color: var(--accent-text); }
.file-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Bank ---------- */
.bank-status { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.bank-status .grow { flex: 1; min-width: 0; }
.bank-status .btn .i { width: 16px; height: 16px; }
.bank-pick { border-top: 1px solid var(--line); padding-top: 12px; }
.radios { display: flex; gap: 18px; flex-wrap: wrap; }
.steps.small { font-size: 13.5px; margin-top: 10px; }
.kpi-more { font-size: 13px; font-weight: 500; color: var(--text-2); }
.row.tx.pend .t, .row.tx.pend .amt { color: var(--text-2); }
.row.tx.pend .t { font-style: italic; }
/* Umsätze antippen und einordnen */
button.tap { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.row.tap { border-top: 1px solid var(--line); border-radius: 0; }
button.row.tap:hover .t { color: var(--accent-text); }
button.row.tap:focus-visible, button.bar-row.tap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.row.tx.open { border-bottom: 0; }
.row.tx.open .t { font-weight: 600; }
.tx-edit { margin: 0 0 10px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.tx-edit .facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 0; padding: 0; font-size: 13px; }
.tx-edit .facts dt { color: var(--text-2); }
.tx-edit .facts dd { margin: 0; overflow-wrap: anywhere; }
.tx-edit .check span { font-size: 13.5px; }
button.bar-row.tap { padding: 5px 6px; margin: 0 -6px; width: calc(100% + 12px); border-radius: 8px; }
button.bar-row.tap:hover, button.bar-row.on { background: var(--surface-2); }
button.bar-row.on .lbl { color: var(--text); font-weight: 600; }
.chip .i { width: 14px; height: 14px; vertical-align: -2px; margin-left: 2px; }
.small-text { font-size: 13.5px; }
.note.small-text p { margin: 0; }
.note details summary { cursor: pointer; font-size: 13px; color: var(--accent-text); margin-top: 6px; }
.rule-form { gap: 10px; }
.conn + .conn { border-top: 1px solid var(--line); }
.conn .row { border-top: 0; }
.conn-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 0 10px 45px; }
.conn .note { margin: 0 0 10px 45px; }
.link.danger { color: var(--danger); }

/* Vermögen */
.spaced-b { margin-bottom: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.big-num { margin: 2px 0 4px; }
.big-num .v { display: block; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.big-num .s { display: block; font-size: 13px; color: var(--text-2); }
.big-num .s + .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.chart { margin: 26px 0 8px; }
.plot { position: relative; height: 140px; touch-action: pan-y; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot .grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.plot .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.plot .pt { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.plot .pt.on { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.plot .cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); pointer-events: none; }
.plot .ylab { position: absolute; left: 0; transform: translateY(-120%); font-size: 11.5px; color: var(--text-3); pointer-events: none; }
.plot .ylab.bottom { transform: translateY(20%); }
.chart-tip { position: absolute; top: -8px; transform: translate(-50%, -100%); background: var(--text); color: var(--surface); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 1; }
.xlab { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.draft { border-top: 1px solid var(--line); padding-top: 4px; }
fieldset.acct { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 12px 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
fieldset.acct legend { font-size: 13.5px; font-weight: 600; padding: 0 6px; margin-left: -6px; }
details.positions summary { cursor: pointer; font-size: 14px; color: var(--accent-text); padding: 6px 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* Chat mit Claude (rechts unten) */
.chat-fab {
  position: fixed; z-index: 30; right: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--text); color: var(--bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.12);
}
.chat-fab .i { width: 24px; height: 24px; }
.main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px); }
.chat-panel {
  position: fixed; z-index: 40; inset: 0;
  display: flex; flex-direction: column; background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.chat-head { display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .i { width: 18px; height: 18px; color: var(--accent); }
.chat-cost { font-size: 12.5px; color: var(--text-3); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; white-space: pre-wrap; background: var(--accent-bg); padding: 8px 12px; border-radius: 16px 16px 4px 16px; }
.msg.bot { align-self: stretch; max-width: 100%; }
.msg.bot p, .msg.bot ul, .msg.bot ol { margin: 0 0 8px; }
.msg.bot ul, .msg.bot ol { padding-left: 20px; }
.msg.bot li { margin: 2px 0; }
.msg.bot code { font-family: var(--mono); font-size: 13px; background: var(--sunken); padding: 1px 4px; border-radius: 4px; }
.chat-code { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 8px; }
.chat-h { font-weight: 600; }
.msg-acts .link { display: inline-flex; align-items: center; gap: 4px; padding: 0; font-size: 12.5px; color: var(--text-3); }
.msg-acts .i { width: 14px; height: 14px; }
.chat-tool { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--text-3); }
.chat-tool .i { width: 14px; height: 14px; }
.chat-tool .spin { width: 12px; height: 12px; margin-right: 2px; }
.chat-note { margin: 0; }
.chat-empty { display: grid; gap: 12px; margin: auto 0 0; padding: 8px 0; font-size: 15px; line-height: 1.45; }
.chat-empty p { margin: 0; }
.chat-empty .btn { justify-self: start; }
.chat-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-sugg .chip { text-align: left; }
.chat-confirm { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; }
.chat-confirm.danger { border-color: var(--danger); }
.chat-confirm.declined, .chat-confirm.cancelled, .chat-confirm.failed { opacity: 0.72; }
.cc-k { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.cc-t { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.cc-l { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 2px 0 0; font-size: 14px; }
.cc-l dt { color: var(--text-2); }
.cc-l dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.cc-a { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cc-s { display: flex; align-items: center; gap: 4px; margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.cc-s .i { width: 16px; height: 16px; }
.chat-confirm.done .cc-s { color: var(--ok); }
.chat-confirm.failed .cc-s { color: var(--danger); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form textarea { min-height: 42px; max-height: 160px; resize: none; border-radius: 21px; padding: 9px 14px; line-height: 1.4; }
.chat-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--text); color: var(--bg); }
.chat-send:disabled { opacity: 0.4; cursor: default; }
.chat-send .i { width: 20px; height: 20px; }
@media (max-width: 879px) {
  .chat-open, .chat-open body { overflow: hidden; }
}
@media (min-width: 880px) {
  .main { padding-bottom: 84px; }
  .chat-fab { right: 24px; bottom: 24px; }
  .chat-panel {
    inset: auto 24px 24px auto; width: 400px; height: min(660px, calc(100dvh - 48px)); padding: 0; overflow: hidden;
    border: 1px solid var(--line-2); border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
  }
}
