/* SplitPilot – gleiches Designsystem wie MeilenPilot / RoutePilot (Glas-Karten, Blobs, Plus Jakarta Sans) */
:root {
  --bg: #f4f5fb; --bg2: #e9ebf7; --surface: rgba(255,255,255,.72); --surface-solid: #fff;
  --line: rgba(20,24,60,.10); --line-strong: rgba(20,24,60,.18);
  --text: #12142b; --muted: #5d6283; --faint: #8a8fae;
  --accent: #6b4dff; --accent2: #00b89c; --gold: #d99a1e; --accent-soft: rgba(107,77,255,.12);
  --good: #0f9f74; --warn: #d97706; --bad: #dc3b4b; --info: #3b6cf6;
  --shadow: 0 10px 40px -12px rgba(30,30,90,.22); --shadow-lg: 0 30px 80px -20px rgba(40,30,120,.35);
  --blob1: #a594ff; --blob2: #ffd58a; --blob3: #5ee7d0;
  --radius: 22px; --ease: cubic-bezier(.22,1,.36,1); --spring: cubic-bezier(.34,1.56,.64,1);
  --picker-filter: none; --sheet-bg: #fbfbfe;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090a16; --bg2: #0f1124; --surface: rgba(22,24,48,.62); --surface-solid: #15172e;
    --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.16);
    --text: #eef0ff; --muted: #a2a7cc; --faint: #6d7299;
    --accent: #8b74ff; --accent2: #1fe0c0; --gold: #f5b942; --accent-soft: rgba(139,116,255,.16);
    --good: #34d399; --warn: #fbbf24; --bad: #ff7a85; --info: #7aa2ff;
    --shadow: 0 10px 40px -12px rgba(0,0,0,.6); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.7);
    --blob1: #5b3df5; --blob2: #a8670f; --blob3: #0aa88f;
    --picker-filter: invert(1); --sheet-bg: #111327;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090a16; --bg2: #0f1124; --surface: rgba(22,24,48,.62); --surface-solid: #15172e;
  --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.16);
  --text: #eef0ff; --muted: #a2a7cc; --faint: #6d7299;
  --accent: #8b74ff; --accent2: #1fe0c0; --gold: #f5b942; --accent-soft: rgba(139,116,255,.16);
  --good: #34d399; --warn: #fbbf24; --bad: #ff7a85; --info: #7aa2ff;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.6); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.7);
  --blob1: #5b3df5; --blob2: #a8670f; --blob3: #0aa88f;
  --picker-filter: invert(1); --sheet-bg: #111327;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden; transition: background .5s var(--ease), color .5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); font-weight: 600; text-decoration: none; }
.num, .amt { font-variant-numeric: tabular-nums; }

/* ---------- animierter Hintergrund ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 600px at 50% -10%, var(--bg2), var(--bg)); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.b1 { width: 520px; height: 520px; background: var(--blob1); top: -140px; left: -120px; animation: float1 22s ease-in-out infinite; }
.b2 { width: 440px; height: 440px; background: var(--blob2); top: 28%; right: -160px; opacity: .4; animation: float2 26s ease-in-out infinite; }
.b3 { width: 380px; height: 380px; background: var(--blob3); bottom: -160px; left: 30%; opacity: .3; animation: float3 30s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(140px, 90px) scale(1.12); } }
@keyframes float2 { 50% { transform: translate(-120px, 60px) scale(.9); } }
@keyframes float3 { 50% { transform: translate(-80px, -120px) scale(1.15); } }
.grain { position: absolute; inset: 0; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Kopf ---------- */
.top { max-width: 820px; margin: 0 auto; padding: 22px 24px 0; padding-top: max(22px, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--text); }
.brand-coin { transform-box: fill-box; transform-origin: center; animation: coinIn .9s var(--spring) both; }
.brand-coin.c2 { animation-delay: .12s; }
@keyframes coinIn { from { transform: translateX(-6px) scale(.3); opacity: 0; } }
.brand:hover .c1 { animation: nudgeL .6s var(--ease); } .brand:hover .c2 { animation: nudgeR .6s var(--ease); }
@keyframes nudgeL { 40% { transform: translateX(-2px); } } @keyframes nudgeR { 40% { transform: translateX(2px); } }
.back-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 1rem; padding: 8px 10px 8px 2px; margin-left: -6px; border-radius: 12px; transition: transform .25s var(--ease); }
.back-btn:active { transform: scale(.95); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; transition: transform .3s var(--ease), border-color .3s; flex: none; color: var(--text); }
.icon-btn:hover { border-color: var(--line-strong); }
#themeBtn:hover { transform: rotate(-18deg) scale(1.06); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.small { width: 36px; height: 36px; border-radius: 12px; }

/* ---------- Hero ---------- */
.hero { max-width: 820px; margin: 0 auto; text-align: center; padding: 34px 24px 6px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); backdrop-filter: blur(10px); margin: 0 0 20px; }
h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.04; letter-spacing: -.045em; margin: 0 0 18px; font-weight: 800; }
.grad { background: linear-gradient(100deg, var(--accent), var(--gold) 55%, var(--accent)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 7s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.lead { max-width: 600px; margin: 0 auto 26px; color: var(--muted); font-size: 1.04rem; }
.reveal { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) forwards; }
.reveal:nth-child(2) { animation-delay: .08s; } .reveal:nth-child(3) { animation-delay: .16s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes riseFrom { from { opacity: 0; transform: translateY(18px); } }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }
main.narrow { max-width: 820px; }
.view { animation: tabIn .45s var(--ease); }

/* ---------- Tabs (Desktop: schwebende Pille oben) ---------- */
.tabs {
  position: sticky; top: 12px; z-index: 40; width: max-content; max-width: 100%;
  margin: 4px auto 22px; display: flex; gap: 2px; padding: 5px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--shadow);
}
.tabs button {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 8px;
  border: 0; background: none; color: var(--muted); padding: 10px 16px; border-radius: 15px;
  font-weight: 700; font-size: .92rem; white-space: nowrap; transition: color .3s, transform .2s; overflow: hidden;
}
.tabs button:active { transform: scale(.96); }
.tabs button svg { width: 18px; height: 18px; flex: none; transition: transform .45s var(--spring); }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #fff; }
.tabs button.active svg { transform: scale(1.12); }
.tabs .add-tab { order: 10; margin-left: 6px; color: #fff; background: linear-gradient(120deg, var(--accent2), color-mix(in srgb, var(--accent2) 55%, var(--accent))); box-shadow: 0 8px 20px -10px var(--accent2); }
.tabs .add-tab:hover { color: #fff; }
.tab-pill {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: 0; border-radius: 15px;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--gold)));
  box-shadow: 0 8px 22px -8px var(--accent);
  transition: left .5s var(--ease), width .5s var(--ease);
}
.tabs.no-anim .tab-pill { transition: none; }

.tab { display: none; }
.tab.active { display: block; animation: tabIn .5s var(--ease); }
@keyframes tabIn { from { opacity: 0; transform: translateY(14px); } }
.tab.active.fresh > * { animation: riseFrom .6s var(--ease) backwards; }
.tab.active.fresh > :nth-child(2) { animation-delay: .06s; }
.tab.active.fresh > :nth-child(3) { animation-delay: .12s; }
.tab.active.fresh > :nth-child(n+4) { animation-delay: .18s; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 16px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
h2 { font-size: 1.08rem; margin: 0; letter-spacing: -.015em; }
h3 { font-size: .74rem; margin: 22px 0 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.hint { color: var(--muted); margin: 0 0 14px; font-size: .9rem; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .zero { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 14px; font-weight: 700; font-size: .92rem; color: #fff; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--gold))); box-shadow: 0 10px 24px -12px var(--accent); transition: transform .3s var(--ease), box-shadow .3s, opacity .2s; position: relative; overflow: hidden; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--accent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.big, .ghost.big { height: 54px; font-size: 1rem; border-radius: 17px; padding: 0 22px; }
.btn.block, .ghost.block { width: 100%; }
.btn.good { background: linear-gradient(120deg, var(--good), var(--accent2)); box-shadow: 0 10px 24px -12px var(--good); }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--muted); font-weight: 700; font-size: .88rem; transition: border-color .2s, color .2s, transform .2s var(--ease); position: relative; overflow: hidden; white-space: nowrap; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost:active { transform: scale(.96); }
.ghost.small { height: 34px; font-size: .8rem; padding: 0 11px; border-radius: 11px; }
.ghost.danger { color: var(--bad); }
.ghost.danger:hover { border-color: var(--bad); }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .7s ease-out; pointer-events: none; }
.ghost .ripple, .tabs button:not(.active):not(.add-tab) .ripple, .row-btn .ripple { background: color-mix(in srgb, var(--accent) 22%, transparent); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.pill { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.zero { background: var(--bg2); color: var(--muted); }
.pill.offline { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

/* ---------- Startseite ---------- */
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px; animation: riseFrom .8s .25s var(--ease) backwards; }
.group-list { display: flex; flex-direction: column; gap: 12px; }
.gcard { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; margin: 0; padding: 16px 18px; color: var(--text); text-align: left; width: 100%; cursor: pointer; transition: transform .4s var(--ease), box-shadow .4s, border-color .3s; animation: riseFrom .7s var(--ease) backwards; animation-delay: calc(.3s + var(--i, 0) * 60ms); }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.gcard:active { transform: scale(.985); }
.g-emoji { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--gold) 22%, transparent)); }
.g-main { min-width: 0; }
.g-main b { display: block; font-size: 1.05rem; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-main span { display: block; font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bal { text-align: right; }
.g-bal small { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.g-bal b { font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; }

.empty { text-align: center; padding: 38px 22px; }
.empty .big-emoji { font-size: 3rem; display: inline-block; animation: bob 3.2s ease-in-out infinite; }
.empty h2 { margin: 10px 0 6px; font-size: 1.2rem; }
.empty p { color: var(--muted); margin: 0 auto 4px; max-width: 420px; font-size: .92rem; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

.info-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; }
.info-card .t-ic { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--accent2), var(--accent)); box-shadow: 0 10px 20px -10px var(--accent); }
.info-card h4 { margin: 0 0 4px; font-size: .98rem; }
.info-card p { margin: 0 0 10px; font-size: .87rem; color: var(--muted); }
.info-card p:last-child { margin-bottom: 0; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--bg2); vertical-align: -5px; margin: 0 2px; color: var(--accent); }

/* ---------- Gruppenkopf ---------- */
.summary { position: relative; overflow: hidden; isolation: isolate; padding: 22px 22px 18px; animation: riseFrom .7s var(--ease) backwards; }
.summary::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 280px; height: 280px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); }
.s-top { display: flex; align-items: center; gap: 14px; }
.s-top .g-emoji { width: 60px; height: 60px; font-size: 2rem; flex: none; }
.s-title { min-width: 0; flex: 1; }
.s-title h1 { font-size: clamp(1.5rem, 4.6vw, 2rem); margin: 0; letter-spacing: -.035em; line-height: 1.12; overflow-wrap: anywhere; }
.s-title p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.avatars { display: flex; margin-top: 2px; }
.avatars .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface-solid); }
.avatars .av:first-child { margin-left: 0; }
.s-stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin-top: 18px; }
.s-stat { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; min-width: 0; }
.s-stat small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-stat b { display: block; font-size: 1.3rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-stat.me { border-color: transparent; background: linear-gradient(135deg, color-mix(in srgb, var(--state, var(--accent)) 16%, var(--surface-solid)), var(--surface-solid)); }
.s-stat.me b { color: var(--state, var(--text)); }
.s-stat.me span { font-size: .78rem; color: var(--muted); }

/* ---------- Avatare ---------- */
.av { --c1: #7c5cff; --c2: #f5b942; width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: .74rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); letter-spacing: 0; text-transform: uppercase; }
.av.lg { width: 42px; height: 42px; font-size: .9rem; }
.av.sm { width: 26px; height: 26px; font-size: .64rem; }
.av.more { background: var(--bg2); color: var(--muted); }

/* ---------- Ausgabenliste ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { color: var(--faint); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; }
.seg-mini { display: flex; padding: 4px; gap: 2px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.seg-mini button { border: 0; background: none; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: .82rem; color: var(--muted); transition: background .25s, color .25s; }
.seg-mini button.on { background: var(--accent-soft); color: var(--accent); }

.day { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 6px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.day-list { padding: 6px; margin: 0; }
.exp { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 10px; border-radius: 16px; border: 0; background: none; width: 100%; text-align: left; transition: background .2s, transform .2s var(--ease); animation: slideIn .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.exp:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.exp:active { transform: scale(.985); }
.exp + .exp { box-shadow: 0 -1px 0 var(--line); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }
.cat { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--cc, var(--accent)) 16%, transparent); }
.exp-main { min-width: 0; }
.exp-main b { display: block; font-size: .96rem; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-main span { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-amt { text-align: right; white-space: nowrap; }
.exp-amt b { display: block; font-size: .98rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.exp-amt span { display: block; font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.exp.transfer b { font-weight: 600; }
.exp.transfer .cat { background: color-mix(in srgb, var(--good) 14%, transparent); }

/* ---------- Salden ---------- */
.bal-row { display: grid; grid-template-columns: 34px minmax(70px, 1fr) 2fr 104px; gap: 12px; align-items: center; padding: 9px 0; }
.bal-row + .bal-row { border-top: 1px dashed var(--line); }
.bal-row .nm { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-row .nm small { color: var(--faint); font-weight: 600; }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--line); }
.bar::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; width: 0; transition: width 1s var(--ease); }
.bar i.pos { left: 50%; background: linear-gradient(90deg, var(--accent2), var(--good)); }
.bar i.neg { right: 50%; background: linear-gradient(270deg, var(--warn), var(--bad)); }
.bal-row .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.settle { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--line); margin-bottom: 10px; animation: riseFrom .6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.settle.mine { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 10px 26px -18px var(--accent); }
.flow { display: flex; align-items: center; gap: 6px; }
.flow .arrow { color: var(--faint); display: inline-flex; }
.flow .arrow svg { animation: fly 2.4s var(--ease) infinite; }
@keyframes fly { 0% { transform: translateX(-3px); opacity: .4; } 50% { transform: translateX(3px); opacity: 1; } 100% { transform: translateX(-3px); opacity: .4; } }
.settle .txt { min-width: 0; font-size: .9rem; color: var(--muted); }
.settle .txt b { color: var(--text); }
.settle .txt .amt { display: block; font-size: 1.2rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.done-state { text-align: center; padding: 26px 10px 14px; }
.done-state .big-emoji { font-size: 2.8rem; display: inline-block; animation: popIn .7s var(--spring); }
@keyframes popIn { from { transform: scale(0) rotate(-40deg); } }
.done-state h2 { margin: 8px 0 4px; }
.done-state p { color: var(--muted); margin: 0; font-size: .9rem; }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.stat b { display: block; font-size: 1.3rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp { display: flex; flex-direction: column; gap: 12px; }
.cmp-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; align-items: center; }
.cmp-row .nm { font-weight: 600; font-size: .9rem; display: flex; gap: 8px; align-items: center; min-width: 0; }
.cmp-row .nm span { color: var(--faint); font-weight: 600; font-size: .78rem; }
.cmp-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-row .track { grid-column: 1 / -1; height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cmp-row .fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--cc, var(--accent)), color-mix(in srgb, var(--cc, var(--accent)) 50%, var(--gold))); transition: width 1s var(--ease); }
.duo .track { height: 7px; }
.duo .track + .track { margin-top: -2px; }
.duo .fill.paid { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--gold))); }
.duo .fill.used { background: linear-gradient(90deg, var(--accent2), color-mix(in srgb, var(--accent2) 50%, var(--accent))); }
.legend { display: flex; gap: 16px; font-size: .78rem; color: var(--muted); font-weight: 600; margin: -4px 0 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.days { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.dbar { flex: 1 0 18px; max-width: 46px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.dbar i { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--gold))); height: 0; transition: height 1s var(--ease); min-height: 3px; }
.dbar span { font-size: .62rem; font-weight: 700; color: var(--faint); white-space: nowrap; }

/* ---------- Einstellungen ---------- */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.li + .li { border-top: 1px dashed var(--line); }
.li .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .nm small { font-weight: 600; color: var(--faint); margin-left: 6px; }
.li .acts { display: flex; gap: 6px; }
.row-btn { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-solid); display: grid; place-items: center; color: var(--muted); transition: border-color .2s, color .2s; position: relative; overflow: hidden; }
.row-btn:hover { border-color: var(--accent); color: var(--accent); }
.row-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.invite { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line); }
.invite code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.inline-add { display: flex; gap: 8px; margin-top: 12px; }
.inline-add .field { flex: 1; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 25%, var(--line)); }

/* ---------- Formulare ---------- */
.field {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px;
  border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint);
  transition: border-color .25s, box-shadow .25s; min-width: 0;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input, .field select, .field textarea {
  border: 0; outline: 0; background: transparent; padding: 2px 0 0; width: 100%; min-width: 0;
  font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text);
}
.field select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath d='m7 10 5 5 5-5' stroke='%238a8fae' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right center; }
.field select:disabled { opacity: .6; cursor: not-allowed; }
.field input::placeholder { color: var(--faint); font-weight: 500; }
.field input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; filter: var(--picker-filter); }
.field input[type="date"] { min-height: 24px; -webkit-appearance: none; appearance: none; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields .full { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.err { color: var(--bad); font-size: .85rem; font-weight: 600; margin: 10px 0 0; min-height: 0; }
.err:empty { display: none; }

/* Betrag groß */
.amount-box { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 20px; background: var(--surface-solid); border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s; }
.amount-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.amount-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; padding: 0; }
.amount-box input::placeholder { color: var(--line-strong); }
.amount-box select { border: 0; outline: 0; background: var(--bg2); border-radius: 12px; padding: 8px 10px; font-weight: 800; font-size: 16px; color: var(--accent); appearance: none; -webkit-appearance: none; cursor: pointer; text-align: center; }
.rate-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin-top: 8px; padding: 0 4px; }
.rate-row input { width: 92px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-solid); font-weight: 700; font-size: 16px; outline: 0; }
.rate-row input:focus { border-color: var(--accent); }
.rate-row b { color: var(--text); }

/* Segment-Steuerung */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: var(--bg2); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 9px 6px; border-radius: 12px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: color .3s; }
.seg button.on { color: var(--text); }
.seg .seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 12px; background: var(--surface-solid); box-shadow: 0 4px 14px -6px rgba(0,0,0,.25); transition: transform .45s var(--ease), width .45s var(--ease); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-solid); font-weight: 700; font-size: .86rem; color: var(--muted); transition: border-color .2s, color .2s, background .2s, transform .25s var(--spring); }
.chip:active { transform: scale(.94); }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip .e { font-size: 1.1rem; }
.chip.person { padding-left: 4px; }

/* Aufteilung */
.split-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sp { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line); transition: opacity .25s, border-color .25s; }
.sp.off { opacity: .5; }
.sp .nm { font-weight: 700; font-size: .92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp .nm small { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.check { width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line-strong); background: none; display: grid; place-items: center; color: #fff; transition: background .25s, border-color .25s, transform .3s var(--spring); }
.check svg { opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on svg { opacity: 1; transform: none; }
.check:active { transform: scale(.88); }
.sp input { width: 108px; text-align: right; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg2); outline: 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg2); font-weight: 800; font-size: 1.1rem; display: grid; place-items: center; }
.stepper button:active { transform: scale(.9); }
.stepper b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.split-sum { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 10px 14px; border-radius: 14px; font-size: .86rem; font-weight: 700; background: var(--bg2); color: var(--muted); }
.split-sum.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.split-sum.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.split-all { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: .82rem; padding: 4px 6px; }

.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-solid); font-size: 1.5rem; transition: transform .3s var(--spring), border-color .2s, background .2s; }
.emoji-grid button.on { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.06); }
.emoji-grid button:active { transform: scale(.9); }
.name-list { display: flex; flex-direction: column; gap: 6px; }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row .field { flex: 1; padding: 8px 12px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-solid); font-weight: 700; text-align: left; transition: border-color .2s, background .2s, transform .25s var(--spring); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover { border-color: var(--accent); }
.who:active { transform: scale(.96); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Bottom-Sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(8,8,24,.5); animation: fadeIn .35s var(--ease); }
/* Solange ein Sheet offen ist: Hintergrund-Animationen anhalten und Glas-Effekte dahinter abschalten.
   Sonst muss iOS bei jeder Größenänderung des Sheets alle Blur-Ebenen neu rechnen (Ruckeln). */
body.locked .bg *, body.locked .grad, body.locked .big-emoji, body.locked .flow .arrow svg { animation-play-state: paused !important; }
body.locked .view .card, body.locked .view .summary, body.locked .tabs, body.locked .search, body.locked .icon-btn, body.locked .eyebrow { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.sheet-backdrop.closing { animation: fadeOut .3s var(--ease) forwards; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: fixed; z-index: 100; left: 50%; bottom: 0; width: min(600px, 100%); transform: translateX(-50%);
  max-height: min(92vh, 92dvh); display: flex; flex-direction: column;
  background: var(--sheet-bg); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.4);
  animation: sheetUp .5s var(--ease); contain: layout style;
}
.sheet.closing { animation: sheetDown .3s var(--ease) forwards; }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
@keyframes sheetDown { to { transform: translate(-50%, 100%); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 10px auto 0; flex: none; cursor: grab; touch-action: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 20px 6px; flex: none; touch-action: none; }
.sheet-head h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body h3:first-child { margin-top: 4px; }
.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 20px -20px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--sheet-bg) 26%); display: flex; gap: 8px; z-index: 10; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 721px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 28px; border-bottom: 1px solid var(--line); max-height: min(86vh, 860px); animation: popUp .45s var(--ease); }
  .sheet.closing { animation: popDown .25s var(--ease) forwards; }
  @keyframes popUp { from { transform: translate(-50%, -46%) scale(.96); opacity: 0; } }
  @keyframes popDown { to { transform: translate(-50%, -48%) scale(.97); opacity: 0; } }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 12px 12px 12px 18px; border-radius: 16px; background: #15172e; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toastIn .5s var(--spring); }
.toast.no-action { padding-right: 18px; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast button { border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 800; padding: 7px 12px; border-radius: 10px; }
@keyframes toastIn { from { transform: translate(-50%, 30px) scale(.9); opacity: 0; } }

.foot { text-align: center; color: var(--faint); font-size: .76rem; padding: 10px 16px 34px; max-width: 700px; margin: 0 auto; }
.skeleton { height: 76px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--bg2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Handy ---------- */
@media (max-width: 720px) {
  .top { padding: 14px 16px 0; padding-top: max(14px, env(safe-area-inset-top)); }
  .hero { padding: 22px 16px 0; }
  .eyebrow { font-size: .66rem; letter-spacing: .1em; margin-bottom: 14px; }
  h1 { font-size: clamp(2rem, 10vw, 2.6rem); margin-bottom: 12px; }
  .lead { font-size: .95rem; margin-bottom: 20px; }
  main { padding: 0 12px 40px; }
  #view-group main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; border-radius: 20px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .home-actions { grid-template-columns: 1fr; }
  .gcard { grid-template-columns: 48px 1fr auto; padding: 14px; gap: 12px; }
  .gcard .g-emoji { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 15px; }

  /* App-artige Tab-Leiste unten (wie MeilenPilot) */
  .tabs {
    position: fixed; top: auto; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
    width: auto; max-width: none; margin: 0; padding: 6px;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    border-radius: 24px; box-shadow: var(--shadow-lg);
    animation: dockIn .8s .2s var(--spring) both;
  }
  @keyframes dockIn { from { transform: translateY(130%); } }
  .tabs button { flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: .66rem; letter-spacing: .01em; border-radius: 18px; min-height: 54px; justify-content: center; }
  .tabs button svg { width: 22px; height: 22px; }
  .tabs button.active svg { transform: translateY(-2px) scale(1.08); }
  .tab-pill { top: 6px; bottom: 6px; border-radius: 18px; }
  .tabs .add-tab { order: 0; grid-column: 3; grid-row: 1; margin: -22px auto 0; width: 62px; height: 62px; min-height: 0; padding: 0; border-radius: 22px; box-shadow: 0 14px 28px -10px var(--accent2), 0 0 0 5px var(--bg); }
  .tabs .add-tab span { display: none; }
  .tabs .add-tab svg { width: 28px; height: 28px; }
  .tabs .add-tab:active { transform: scale(.92) rotate(90deg); }
  .tabs button[data-tab="expenses"] { grid-column: 1; } .tabs button[data-tab="balances"] { grid-column: 2; }
  .tabs button[data-tab="stats"] { grid-column: 4; } .tabs button[data-tab="settings"] { grid-column: 5; }
  .tabs button { grid-row: 1; }

  .summary { padding: 18px 16px 14px; }
  .s-top .g-emoji { width: 52px; height: 52px; font-size: 1.7rem; }
  .s-stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .s-stat.me { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .s-stat.me b { font-size: 1.5rem; }
  .s-stat b { font-size: 1.12rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat b { font-size: 1.12rem; }
  .bal-row { grid-template-columns: 34px 1fr auto; gap: 4px 12px; }
  .bal-row .bar { grid-column: 2 / -1; grid-row: 2; }
  .bal-row .av { grid-row: span 2; }
  .settle { grid-template-columns: 1fr auto; padding: 12px; gap: 10px; }
  .settle .flow { grid-column: 1 / -1; }
  .exp { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 9px 6px; }
  .cat { width: 40px; height: 40px; border-radius: 13px; font-size: 1.15rem; }
  .day-list { padding: 4px 6px; }
  .sheet-body { padding: 6px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-foot { margin: 18px -16px calc(-18px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); bottom: calc(-18px - env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); gap: 5px; }
}

@media (hover: none) {
  .gcard:hover { transform: none; box-shadow: var(--shadow); }
  .exp:hover { background: none; }
}
@media (display-mode: standalone) {
  .hero { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
