/* Todo – Apple-inspiriertes UI */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --panel: rgba(255, 255, 255, .7);
  --card: rgba(255, 255, 255, .82);
  --solid: #fff;
  --text: #1c1c1e;
  --text2: #636366;
  --text3: #aeaeb2;
  --sep: rgba(60, 60, 67, .14);
  --fill: rgba(120, 120, 128, .12);
  --fill2: rgba(120, 120, 128, .2);
  --accent: #007aff;
  --danger: #ff3b30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .07);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .22);
  --aurora: .55;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --c: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --panel: rgba(28, 28, 30, .66);
    --card: rgba(44, 44, 46, .7);
    --solid: #1c1c1e;
    --text: #f5f5f7;
    --text2: #a1a1a6;
    --text3: #636366;
    --sep: rgba(84, 84, 88, .5);
    --fill: rgba(120, 120, 128, .22);
    --fill2: rgba(120, 120, 128, .34);
    --accent: #0a84ff;
    --danger: #ff453a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
    --aurora: .4;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { display: block; }

/* ───────── Aurora-Hintergrund ───────── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; opacity: var(--aurora); transition: opacity 1s; }
.aurora i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(90px); will-change: transform; }
.aurora i:nth-child(1) { background: #5ac8fa; top: -22vmax; left: -14vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #af52de; bottom: -28vmax; right: -16vmax; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: #ff9f0a; width: 40vmax; height: 40vmax; top: 30%; left: 44%; opacity: .55; animation: drift3 38s ease-in-out infinite alternate; }
body.in-app .aurora { opacity: calc(var(--aurora) * .55); }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, -14vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-24vmax, 10vmax) scale(1.25); } }

/* ───────── Anmeldung ───────── */
#auth, #paywall {
  position: fixed; inset: 0; display: grid; place-items: center; overflow: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.auth-card {
  position: relative; width: min(400px, 100%); padding: 36px 30px 24px; text-align: center;
  background: var(--panel); border: 1px solid var(--sep); border-radius: 30px;
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-lg);
  animation: card-in .9s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(28px) scale(.96); } }
.auth-logo { border-radius: 18px; box-shadow: 0 12px 30px rgba(0, 122, 255, .4); animation: logo-in 1s var(--spring) .15s both, bob 6s ease-in-out 1.2s infinite; }
@keyframes logo-in { from { opacity: 0; transform: scale(.4) rotate(-18deg); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
.auth-card h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-top: 16px; }
.auth-sub { color: var(--text2); margin: 4px 0 24px; text-wrap: balance; }

.segmented { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: var(--fill); border-radius: 12px; margin-bottom: 18px; }
.segmented button { position: relative; z-index: 1; min-height: 38px; font-size: 15px; font-weight: 600; color: var(--text2); transition: color .25s; border-radius: 9px; }
.segmented button[aria-selected="true"] { color: var(--text); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; background: var(--solid); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); transition: transform .45s var(--spring); }
.segmented[data-mode="register"] .seg-pill { transform: translateX(100%); }

.fields { background: var(--card); border: 1px solid var(--sep); border-radius: 16px; overflow: hidden; text-align: left; }
.field { display: grid; grid-template-columns: 86px 1fr; align-items: center; min-height: 50px; padding: 0 16px; border-top: 1px solid var(--sep); overflow: hidden; transition: min-height .4s var(--ease), opacity .3s, border-color .3s; }
.field:first-child, .field.first { border-top-color: transparent; }
.field.off { min-height: 0; height: 0; opacity: 0; border-top-color: transparent; pointer-events: none; }
.field > span { font-size: 15px; font-weight: 500; }
.field input { width: 100%; min-height: 48px; border: 0; background: transparent; outline: none; font-size: 16px; }
.field input::placeholder, .title::placeholder, .notes::placeholder { color: var(--text3); }
.field:focus-within { background: var(--fill); }

.form-msg { min-height: 20px; margin: 10px 4px; font-size: 14px; color: var(--danger); text-wrap: balance; }
.form-msg.ok { color: #248a3d; }
@media (prefers-color-scheme: dark) { .form-msg.ok { color: #30d158; } }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

.btn-primary {
  position: relative; width: 100%; min-height: 50px; border-radius: 14px; font-weight: 600; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, #2f9bff, #007aff 55%, #5856d6); background-size: 180% 100%;
  box-shadow: 0 8px 22px rgba(0, 122, 255, .35);
  transition: transform .2s var(--spring), background-position .6s, box-shadow .3s, opacity .2s;
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 10px 28px rgba(0, 122, 255, .45); }
.btn-primary:active { transform: scale(.97); }
.btn-primary[disabled] { opacity: .6; pointer-events: none; }
.btn-primary.busy span { opacity: 0; }
.btn-primary.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link { color: var(--accent); font-size: 15px; min-height: 44px; padding: 0 10px; border-radius: 10px; transition: opacity .2s; }
.link:hover { opacity: .7; }
.link.danger { color: var(--danger); }
#auth-alt { margin-top: 8px; }

/* schwebende Deko-Karten */
.floaters { position: fixed; inset: 0; pointer-events: none; }
.floater {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  font-weight: 500; font-size: 15px; white-space: nowrap; background: var(--panel); border: 1px solid var(--sep); border-radius: 16px;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: var(--shadow);
  animation: float-in 1.2s var(--ease) both, floaty 9s ease-in-out infinite;
}
.fc { width: 22px; height: 22px; border-radius: 50%; background: currentColor; box-shadow: inset 0 0 0 2px currentColor, inset 0 0 0 4.5px var(--solid); }
.c-green { color: #34c759; } .c-blue { color: #007aff; } .c-orange { color: #ff9500; } .c-pink { color: #ff2d55; }
.f1 { top: 16%; left: 9%; rotate: -7deg; animation-delay: .3s, 1.5s; }
.f2 { top: 24%; right: 8%; rotate: 5deg; animation-delay: .45s, .2s; }
.f3 { bottom: 20%; left: 12%; rotate: 4deg; animation-delay: .6s, .9s; }
.f4 { bottom: 14%; right: 13%; rotate: -5deg; animation-delay: .75s, 2.1s; }
@keyframes float-in { from { opacity: 0; scale: .7; } }
@keyframes floaty { 50% { translate: 0 -16px; } }
@media (max-width: 900px) { .floaters { display: none; } }

/* ───────── App-Layout ───────── */
#app { position: fixed; inset: 0; display: grid; grid-template-columns: 320px 1fr; animation: app-in .7s var(--ease) both; }
@keyframes app-in { from { opacity: 0; transform: scale(.985); } }

#sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); border-right: 1px solid var(--sep);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 10px 18px; }
.side-head img { border-radius: 8px; }
.side-head strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 600; background: linear-gradient(135deg, #5ac8fa, #007aff 60%, #5856d6); transition: transform .25s var(--spring); position: relative; }
.avatar::after { content: ""; position: absolute; inset: -4px; }
.avatar:hover { transform: scale(1.08); }
.avatar:active { transform: scale(.94); }
.side-scroll { flex: 1; overflow-y: auto; padding: 6px 14px 14px; overscroll-behavior: contain; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  --c: var(--accent);
  display: grid; grid-template-columns: auto 1fr; row-gap: 8px; align-items: center; padding: 11px 12px 10px; text-align: left;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .3s var(--spring), background .25s, color .25s, box-shadow .25s;
}
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: scale(.96); }
.tile .glyph { width: 32px; height: 32px; }
.tile .num { justify-self: end; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .name { grid-column: 1 / -1; font-size: 15px; font-weight: 600; color: var(--text2); transition: color .25s; }
.tile[aria-current="true"] { background: var(--c); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 40%, transparent); }
.tile[aria-current="true"] .name { color: rgba(255, 255, 255, .9); }
.tile[aria-current="true"] .glyph { background: #fff; color: var(--c); }

.glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; font-size: 15px; font-weight: 700; flex: none; transition: background .25s, color .25s; }
.glyph svg { width: 58%; height: 58%; }
.glyph.emoji { font-size: 16px; }

.side-label { margin: 22px 6px 8px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.lists { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.lists:empty { display: none; }
.list-row { --c: var(--accent); position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 14px 8px 10px; text-align: left; transition: background .2s; }
.list-row + .list-row::before, li + li > .list-row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 1px solid var(--sep); }
.list-row:hover { background: var(--fill); }
.list-row[aria-current="true"] { background: var(--fill2); }
.list-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .num { color: var(--text2); font-variant-numeric: tabular-nums; }
.list-row .chev { color: var(--text3); display: none; }
.bump { animation: bump .45s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35); } }
.no-lists { color: var(--text2); font-size: 15px; padding: 4px 6px; }

.side-foot { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sep); }
.add-list { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; color: var(--accent); font-weight: 600; border-radius: 10px; transition: transform .2s var(--spring), opacity .2s; }
.add-list:active { transform: scale(.96); }
.add-list svg { width: 22px; height: 22px; }

/* ───────── Hauptbereich ───────── */
#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; --c: var(--accent); }
.main-head { display: flex; align-items: center; min-height: 52px; padding: env(safe-area-inset-top) 14px 0; }
.spacer { flex: 1; }
.back { display: none; align-items: center; gap: 2px; min-height: 44px; padding-right: 10px; color: var(--accent); font-size: 17px; }
.back svg { width: 22px; height: 22px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--c); transition: background .2s, transform .2s var(--spring); }
.icon-btn:hover { background: var(--fill); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 24px; height: 24px; }
.main-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.main-inner { max-width: 760px; margin: 0 auto; padding: 0 28px calc(80px + env(safe-area-inset-bottom)); }

.title-row { display: flex; align-items: baseline; gap: 16px; margin: 4px 0 14px; }
.title-row h1 { flex: 1; min-width: 0; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--c); overflow-wrap: anywhere; }
.view-count { font-size: 34px; line-height: 1.15; font-weight: 300; color: var(--c); font-variant-numeric: tabular-nums; }
.swap .title-row { animation: title-in .5s var(--ease) both; }
@keyframes title-in { from { opacity: 0; transform: translateX(-14px); } }

/* Aufgaben */
.task { position: relative; display: flex; align-items: flex-start; gap: 4px; }
.task::after { content: ""; position: absolute; left: 44px; right: 0; bottom: 0; border-bottom: 1px solid var(--sep); }
.task.stagger { animation: row-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(12px); } }
.task.leaving { pointer-events: none; }

.check { position: relative; flex: none; width: 44px; height: 46px; display: grid; place-items: center; }
.check i { position: relative; width: 23px; height: 23px; border-radius: 50%; border: 1.6px solid var(--text3); display: grid; place-items: center; transition: border-color .25s, transform .3s var(--spring); }
.check i::before { content: ""; position: absolute; inset: 2.4px; border-radius: 50%; background: var(--c); transform: scale(0); transition: transform .4s var(--spring); }
.check svg { position: relative; width: 11px; height: 11px; color: #fff; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .25s ease-out; }
.check:hover i { border-color: var(--c); }
.check:active i { transform: scale(.82); }
.check.ghost::before { content: ""; width: 23px; height: 23px; border-radius: 50%; border: 1.6px dashed var(--text3); transition: border-color .25s, transform .4s var(--spring); }
.new-task:focus-within .check.ghost::before { border-color: var(--c); border-style: solid; transform: scale(1.08); }
.task.done .check i { border-color: var(--c); }
.task.done .check i::before { transform: scale(1); }
.task.done .check svg { stroke-dashoffset: 0; transition-delay: .12s; }
.task.pop .check i { animation: pop .5s var(--spring); }
@keyframes pop { 30% { transform: scale(.75); } 65% { transform: scale(1.2); } }

.spark { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--c); pointer-events: none; animation: spark .6s ease-out forwards; }
@keyframes spark { from { transform: rotate(var(--a)) translateY(-8px) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(-26px) scale(0); opacity: 0; } }

.body { flex: 1; min-width: 0; padding: 11px 0 11px; }
.title, .notes { display: block; width: 100%; border: 0; background: transparent; outline: none; resize: none; padding: 0; margin: 0; overflow: hidden; field-sizing: content; }
.title { font-size: 16px; line-height: 24px; min-height: 24px; text-decoration: line-through; text-decoration-color: transparent; transition: color .5s, text-decoration-color .5s; }
.task.done .title { color: var(--text3); text-decoration-color: var(--text3); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--text2); }
.meta:empty { display: none; }
.meta .due.over { color: var(--danger); }
.meta .flag { color: #ff9500; display: inline-flex; }
.meta .flag svg { width: 13px; height: 13px; }
.meta .note { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.open .meta .note { display: none; }

.details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.details > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .4s; }
.task.open .details { grid-template-rows: 1fr; }
.task.open .details > div { visibility: visible; transition-delay: 0s; }
.notes { font-size: 15px; line-height: 21px; min-height: 21px; color: var(--text2); margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 2px 4px 0; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 18px; background: var(--fill); font-size: 14px; font-weight: 500; transition: background .2s, color .2s, transform .2s var(--spring); }
.chip:hover { background: var(--fill2); }
.chip:active { transform: scale(.94); }
.chip svg { width: 16px; height: 16px; }
.chip.on { background: color-mix(in srgb, var(--k, var(--accent)) 16%, transparent); color: var(--k, var(--accent)); }
.chip.flag { --k: #ff9500; }
.chip.del { color: var(--danger); margin-left: auto; }
.chip.date { padding: 0; gap: 0; }
.chip-main { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 18px; font-weight: 500; }
.chip.date:has(.x:not([hidden])) .chip-main { padding-right: 8px; }
.chip.date .x { margin: 0 7px 0 0; }
.chip input[type="date"] { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; font-size: 16px; }
.chip.overlay input[type="date"] { inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: pointer; }
.chip.overlay .x { position: relative; z-index: 1; }
.chip.quick { color: var(--text2); }
.chip .x { display: grid; place-items: center; position: relative; z-index: 1; width: 22px; height: 22px; margin: 0 -7px 0 0; border-radius: 50%; background: var(--fill2); font-size: 13px; line-height: 1; }

.new-task::after { display: none; }
.new-task .title { text-decoration: none; }

.done-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; border-bottom: 1px solid var(--sep); }
.done-bar .link { padding: 0 4px; font-size: 15px; }
.done-bar #toggle-done { color: var(--text2); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
#toggle-done svg { width: 14px; height: 14px; transition: transform .35s var(--spring); }
#toggle-done[aria-expanded="true"] svg { transform: rotate(90deg); }

.new-task .title::placeholder { color: var(--text3); }

/* Tags und Filter */
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, transform .2s var(--spring); }
button.tag { position: relative; }
button.tag::after { content: ""; position: absolute; inset: -9px -2px; }
button.tag:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
button.tag:active { transform: scale(.93); }
.tag[aria-pressed="true"] { background: var(--accent); color: #fff; }
.meta .tag { min-height: 22px; padding: 0 8px; font-size: 12.5px; }
.filters { display: flex; align-items: center; gap: 10px; margin: -2px 0 8px; min-height: 40px; }
.search { min-width: 0; display: flex; align-items: center; gap: 6px; flex: 0 0 170px; min-height: 36px; padding: 0 10px; border-radius: 11px; background: var(--fill); color: var(--text2); transition: flex-basis .4s var(--ease), background .2s; }
.search:focus-within { flex-basis: 240px; background: var(--fill2); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; width: 0; min-width: 0; height: 36px; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--text2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tag-filter { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; padding: 5px 2px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.tag-filter::-webkit-scrollbar { display: none; }
.tag-filter .tag { min-height: 30px; padding: 0 12px; border-radius: 15px; flex: none; animation: row-in .4s var(--ease) both; }
.tag-filter .tag.reset { background: var(--fill); color: var(--text2); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px; }
.tag-cloud .tag { min-height: 32px; padding: 0 13px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow); font-size: 14.5px; }
.tag-cloud .tag[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tag-cloud .tag small { margin-left: 6px; font-size: 13px; opacity: .6; font-variant-numeric: tabular-nums; }
.tag-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; }
.tag-edit .tag { gap: 4px; padding-right: 4px; min-height: 30px; border-radius: 15px; }
.tag-edit .tag button { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 14px; line-height: 1; opacity: .7; }
.tag-edit .tag button::after { content: ""; position: absolute; inset: -8px -4px; }
.tag-edit .tag button:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 20%, transparent); }
.tag-edit input { flex: 1; min-width: 120px; height: 32px; border: 0; background: transparent; outline: none; font-size: 15px; }
.tag-edit input::placeholder { color: var(--text3); }

/* Sortierung und Verschieben */
.chip.sort { flex: none; min-height: 32px; padding: 0 11px; font-size: 13.5px; color: var(--text2); }
.chip.sort svg { width: 15px; height: 15px; }
.chip.sort.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.grip { display: none; flex: none; place-items: center; width: 40px; height: 46px; margin-right: -8px; color: var(--text3); cursor: grab; touch-action: none; border-radius: 10px; transition: opacity .2s, color .2s; }
.grip svg { width: 20px; height: 20px; }
#main.can-drag #open-list .grip { display: grid; }
.list-item { position: relative; display: flex; align-items: center; }
.list-item .list-row { flex: 1; min-width: 0; }
.list-item .grip { display: grid; height: 48px; margin: 0 2px 0 -6px; }
.list-item.dragging { z-index: 5; background: var(--solid); border-radius: 14px; box-shadow: var(--shadow-lg); }
.list-item.dragging .list-row::before { display: none; }
.list-item.dragging .grip { cursor: grabbing; color: var(--accent); }
.list-item:hover .grip { opacity: 1; }
body.drag-active .list-item:not(.dragging) { pointer-events: none; }
body.drag-active .lists { overflow: visible; }
@media (hover: hover) {
  .grip { opacity: 0; }
  .task:hover .grip, .grip:focus-visible, .task.dragging .grip { opacity: 1; }
  .grip:hover { color: var(--text2); }
}
.task.dragging { z-index: 5; background: var(--solid); border-radius: 14px; box-shadow: var(--shadow-lg); }
.task.dragging::after { display: none; }
.task.dragging .grip { cursor: grabbing; color: var(--accent); }
body.drag-active { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.drag-active .task:not(.dragging) { pointer-events: none; }

/* Leerzustand */
.empty { text-align: center; padding: 8vh 20px 20px; color: var(--text2); animation: row-in .6s var(--ease) .1s both; }
.empty svg { width: 96px; height: 96px; margin: 0 auto 14px; color: var(--c); }
.empty .ring { stroke-dasharray: 252; stroke-dashoffset: 252; animation: draw .9s var(--ease) .2s forwards; }
.empty .tick { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease) .75s forwards; }
.empty .dot { transform-origin: 48px 48px; opacity: 0; animation: twinkle 2.4s ease-in-out 1.1s infinite; }
.empty .dot:nth-of-type(2) { animation-delay: 1.5s; } .empty .dot:nth-of-type(3) { animation-delay: 1.9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
.empty b { display: block; font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 2px; }

.confetti { position: fixed; z-index: 60; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; }

/* ───────── Modale ───────── */
.backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .3s both; }
.backdrop.out { animation: fade .22s reverse both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 22px; background: var(--solid); border-radius: 24px; box-shadow: var(--shadow-lg); animation: sheet-in .5s var(--spring) both; }
.backdrop.out .sheet { animation: sheet-out .22s ease-in both; }
@keyframes sheet-in { from { opacity: 0; transform: scale(.88) translateY(16px); } }
@keyframes sheet-out { to { opacity: 0; transform: scale(.95); } }
.sheet h2 { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.sheet .fields { background: var(--fill); border: 0; }
.sheet .big-glyph { width: 76px; height: 76px; margin: 0 auto 14px; font-size: 36px; box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 45%, transparent); transition: background .3s, box-shadow .3s; }
.sheet .big-glyph.emoji { font-size: 38px; }
.name-input { width: 100%; min-height: 50px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--fill); font-size: 20px; font-weight: 600; text-align: center; color: var(--c); outline: none; }
.name-input:focus-visible { outline: 2.5px solid var(--c); }
.grid-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 10px; margin-top: 12px; border-radius: 14px; background: var(--fill); }
.pick { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; }
.pick span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 19px; background: var(--k, var(--fill2)); transition: transform .3s var(--spring), box-shadow .2s; }
.pick span svg { width: 18px; height: 18px; }
.pick:hover span { transform: scale(1.12); }
.pick[aria-pressed="true"] span { box-shadow: 0 0 0 2.5px var(--solid), 0 0 0 5px var(--k, var(--text3)); }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn { flex: 1; min-height: 48px; border-radius: 14px; font-weight: 600; background: var(--fill); transition: transform .2s var(--spring), background .2s, opacity .2s; }
.btn:hover { background: var(--fill2); }
.btn:active { transform: scale(.96); }
.btn.go { background: var(--accent); color: #fff; }
.btn.go:hover { opacity: .9; }
.btn.red { color: var(--danger); }
.btn.block { width: 100%; flex: none; margin-top: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.sheet .who { text-align: center; margin-bottom: 18px; }
.sheet .who .avatar { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; display: grid; place-items: center; pointer-events: none; }
.sheet .who b { display: block; font-size: 20px; }
.sheet .who small { color: var(--text2); font-size: 15px; }
.sheet .hint { color: var(--text2); font-size: 14px; margin: 14px 4px 8px; }
.sheet .form-msg { text-align: center; }

#toast { position: fixed; z-index: 70; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: rgba(40, 40, 42, .92); color: #fff; font-size: 15px; font-weight: 500; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transform: translate(-50%, 90px); opacity: 0; transition: transform .5s var(--spring), opacity .3s; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* ───────── Abo ───────── */
.perks { text-align: left; margin: 0 auto 20px; width: fit-content; display: grid; gap: 10px; }
.perks li { position: relative; padding-left: 32px; font-size: 16px; }
.perks li::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #34c759; }
.perks li::after { content: ""; position: absolute; left: 6.5px; top: 6px; width: 9px; height: 5px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(-45deg); }
.price { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 16px; }
.price b { font-size: 40px; font-weight: 700; letter-spacing: -.02em; }
.price span { color: var(--text2); font-size: 15px; }
.pay-note { color: var(--text2); font-size: 13.5px; margin-top: 12px; text-wrap: balance; }
.pay-links { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.plan-pill { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; padding: 2px 4px 2px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; animation: row-in .5s var(--ease) both; }
.plan-pill span { color: var(--text2); min-width: 0; }
.plan-pill.warn span { color: var(--danger); }
.plan-pill .link { font-weight: 600; font-size: 14px; flex: none; }
.plan-box { margin: 14px 0 4px; padding: 14px 16px 4px; border-radius: 14px; background: var(--fill); text-align: center; }
.plan-box p { font-size: 15px; }
.plan-box small { display: block; color: var(--text2); font-size: 13.5px; margin-top: 2px; }

/* ───────── Rechtliches ───────── */
.legal-links { display: flex; justify-content: center; gap: 18px; margin-top: 6px; font-size: 13.5px; }
.legal-links a { color: var(--text2); text-decoration: none; padding: 8px 2px; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
body.legal-page { overflow: auto; }
body.legal-page .aurora { opacity: calc(var(--aurora) * .5); }
.legal { max-width: 720px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.legal a.legal-back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 14px; font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.legal-back img { border-radius: 7px; }
.legal article { padding: 30px 30px 26px; background: var(--panel); border: 1px solid var(--sep); border-radius: 26px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); animation: card-in .7s var(--ease) both; }
.legal h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; hyphens: auto; }
.legal h2 { font-size: 20px; font-weight: 700; margin: 28px 0 6px; }
.legal p { margin: 0 0 10px; line-height: 1.55; max-width: 66ch; }
.legal .stand { color: var(--text2); margin-top: 4px; }
.legal a { color: var(--accent); }
.legal-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 18px; font-size: 15px; }
.legal-foot a { padding: 10px 2px; }
@media (max-width: 760px) { .legal article { padding: 22px 20px 18px; border-radius: 22px; } .legal h1 { font-size: 30px; } }

/* ───────── Mobil ───────── */
@media (max-width: 760px) {
  #app { display: block; }
  #sidebar, #main { position: absolute; inset: 0; transition: transform .5s var(--ease), opacity .5s; }
  #sidebar { border-right: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  #main { transform: translateX(100%); background: var(--bg); visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s; }
  body.detail #main { transform: none; visibility: visible; transition-delay: 0s; box-shadow: -20px 0 60px rgba(0, 0, 0, .12); }
  body.detail #sidebar { transform: translateX(-28%); opacity: .4; }
  .back { display: inline-flex; }
  .list-row .chev { display: block; }
  .list-row[aria-current="true"], .tile[aria-current="true"] { background: transparent; }
  .tile[aria-current="true"] { background: var(--card); color: inherit; box-shadow: var(--shadow); }
  .tile[aria-current="true"] .name { color: var(--text2); }
  .tile[aria-current="true"] .glyph { background: var(--c); color: #fff; }
  .main-inner { padding-left: 14px; padding-right: 18px; }
  .filters { padding-left: 8px; }
  .search { flex-basis: 130px; }
  .search:focus-within { flex-basis: 170px; }
  .title-row { padding-left: 8px; }
  .backdrop { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 26px 26px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: sheet-up .5s var(--ease) both; }
  .backdrop.out .sheet { animation: sheet-down .25s ease-in both; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes sheet-down { to { transform: translateY(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .aurora i, .floater { animation: none; }
}

/* Listenzeilen mit Griff: Trennlinie über die ganze Zeile, kein Pfeil neben dem Griff */
.list-item + .list-item > .list-row::before { display: none; }
.list-item + .list-item::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 1px solid var(--sep); }
.list-item.dragging::before { display: none; }
.list-item:has(.grip) .chev { display: none; }
