/* Notizen-Sync – Gestaltung im Stil von iOS */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .18);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --indigo: #5856d6;
  --teal: #30b0c7;
  --pink: #ff2d55;
  --gray: #8e8e93;
  --bar: rgba(249, 249, 249, .78);
  --bar-line: rgba(0, 0, 0, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
  --backdrop: rgba(0, 0, 0, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .32);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --indigo: #5e5ce6;
    --teal: #40c8e0;
    --pink: #ff375f;
    --bar: rgba(22, 22, 23, .78);
    --bar-line: rgba(255, 255, 255, .12);
    --shadow: none;
    --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
    --backdrop: rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --card-2: #2c2c2e; --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .32); --label: #ffffff; --label-2: rgba(235, 235, 245, .6);
  --label-3: rgba(235, 235, 245, .3); --sep: rgba(84, 84, 88, .55); --blue: #0a84ff; --green: #30d158;
  --red: #ff453a; --orange: #ff9f0a; --indigo: #5e5ce6; --teal: #40c8e0; --pink: #ff375f;
  --bar: rgba(22, 22, 23, .78); --bar-line: rgba(255, 255, 255, .12); --shadow: none;
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, .5); --backdrop: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.022em; -webkit-font-smoothing: antialiased; min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
svg { display: block; }
.noscript { padding: 40px 16px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ Navigation */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding-top: var(--safe-top);
  transition: background .25s, box-shadow .25s;
}
.nav-inner {
  max-width: 720px; margin: 0 auto; height: 44px; padding: 0 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.nav-title { font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.scrolled .nav, .nav.solid { background: var(--bar); box-shadow: 0 .5px 0 var(--bar-line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.scrolled .nav-title, .nav.solid .nav-title { opacity: 1; transform: none; }
.nav-back, .nav-action {
  border: 0; background: none; color: var(--blue); display: inline-flex; align-items: center; gap: 2px;
  height: 44px; padding: 0 8px; font-size: 17px; justify-self: start;
}
.nav-action { justify-self: end; font-weight: 600; }
.nav-back svg { width: 22px; height: 22px; margin-left: -6px; }
.nav-back:active, .nav-action:active { opacity: .4; }

.page {
  max-width: 720px; margin: 0 auto;
  padding: calc(var(--safe-top) + 52px) 16px calc(var(--safe-bottom) + 110px);
}
.page.no-tabs { padding-bottom: calc(var(--safe-bottom) + 40px); }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .011em; margin: 0 4px 18px; }
.subtitle { color: var(--label-2); margin: -10px 4px 22px; font-size: 15px; }

/* ------------------------------------------------------------------ Übergänge */

.view { animation: fadeIn .45s var(--ease) both; }
.view.push { animation: pushIn .5s var(--spring) both; }
.view.pop { animation: popIn .5s var(--spring) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes pushIn { from { opacity: 0; transform: translateX(28%); } }
@keyframes popIn { from { opacity: 0; transform: translateX(-18%); } }
.stagger > * { animation: rise .55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(n+7) { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------------ Gruppen & Zeilen */

.section { margin-bottom: 28px; }
.section-head { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); margin: 0 16px 7px; }
.section-foot { font-size: 13px; color: var(--label-2); margin: 7px 16px 0; line-height: 1.4; }
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; width: 100%;
  padding: 10px 16px; background: none; border: 0; text-align: left; color: var(--label);
  transition: background .15s;
}
.row + .row::before, .row + .field::before, .field + .row::before, .field + .field::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep);
}
.row.has-icon + .row::before, .row + .row.has-icon::before { left: 60px; }
button.row:active, label.row:active, a.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; font-size: 13px; color: var(--label-2); margin-top: 1px; }
.row .value { color: var(--label-2); white-space: nowrap; }
.row .chev { width: 8px; height: 13px; color: var(--label-3); flex: none; }
.row.blue { color: var(--blue); }
.row.red { color: var(--red); }
.row.center { justify-content: center; }
.row[disabled] { opacity: .4; pointer-events: none; }

.ic {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff;
}
.ic svg { width: 18px; height: 18px; }
.ic.blue { background: var(--blue); } .ic.green { background: var(--green); } .ic.orange { background: var(--orange); }
.ic.red { background: var(--red); } .ic.indigo { background: var(--indigo); } .ic.teal { background: var(--teal); }
.ic.gray { background: var(--gray); } .ic.pink { background: var(--pink); }
.ic.plain { background: none; color: var(--blue); }

.badge { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-2); margin-left: 6px; vertical-align: 1px; }
.badge.blue { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.badge.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.badge.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }

/* ------------------------------------------------------------------ Eingaben */

.field { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 16px; gap: 12px; }
.field label { width: 112px; flex: none; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 48px; font-size: 17px; }
.field input::placeholder { color: var(--label-3); }
.field.stack { display: block; padding: 11px 16px; }
.field.stack label { display: block; width: auto; font-size: 13px; color: var(--label-2); margin-bottom: 2px; }
.field.stack input { height: 28px; width: 100%; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; }

.strength { height: 4px; border-radius: 2px; background: var(--fill); margin: 8px 16px 0; overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; border-radius: 2px; transition: width .35s var(--ease), background .35s; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; font-size: 15px; line-height: 1.4; color: var(--label-2); cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label-3);
  flex: none; margin: 0; display: grid; place-items: center; transition: background .2s, border-color .2s; cursor: pointer; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: translate(0, -1px) rotate(45deg); }

/* ------------------------------------------------------------------ Knöpfe */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border: 0;
  border-radius: 12px; font-size: 17px; font-weight: 600; background: var(--blue); color: #fff;
  transition: transform .18s var(--ease), opacity .18s, background .2s;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn.secondary { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); }
.btn.plain { background: none; color: var(--blue); font-weight: 400; height: 44px; }
.btn.danger { background: var(--red); }
.btn.dark { background: var(--label); color: var(--bg); }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.loading { pointer-events: none; }
.btn.loading .lbl { opacity: 0; }
.btn .spin { position: absolute; }
.btn { position: relative; }
.stack-gap > * + * { margin-top: 10px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.4px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Willkommen */

.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--safe-top) + 40px) 24px calc(var(--safe-bottom) + 28px); max-width: 480px; margin: 0 auto; }
.app-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 22px; display: grid; place-items: center;
  background: linear-gradient(160deg, #4facfe 0%, #2a6ff0 55%, #5b3df5 100%); color: #fff;
  box-shadow: 0 12px 30px rgba(42, 111, 240, .35), inset 0 1px 0 rgba(255,255,255,.25);
  animation: float 6s ease-in-out infinite; }
.app-icon svg { width: 52px; height: 52px; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }
.hero-title { font-size: 34px; font-weight: 700; text-align: center; margin: 0 0 8px; letter-spacing: .01em; }
.hero-sub { text-align: center; color: var(--label-2); margin: 0 auto 30px; max-width: 340px; }
.features { margin: 0 0 34px; display: grid; gap: 20px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .ic { width: 40px; height: 40px; border-radius: 10px; }
.feature .ic svg { width: 22px; height: 22px; }
.feature b { display: block; font-weight: 600; }
.feature span { color: var(--label-2); font-size: 15px; }
.legal { text-align: center; font-size: 13px; color: var(--label-2); margin-top: 22px; }
.legal a { margin: 0 8px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--label-2); font-size: 13px; margin: 18px 4px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: .5px solid var(--sep); }

/* ------------------------------------------------------------------ Übersicht */

.hero-card { background: var(--card); border-radius: 20px; padding: 22px 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px; overflow: hidden; position: relative; }
.hero-card .orb { width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #34d399, #10b981); box-shadow: 0 8px 20px rgba(16, 185, 129, .3); }
.hero-card .orb.idle { background: linear-gradient(160deg, #60a5fa, #2563eb); box-shadow: 0 8px 20px rgba(37, 99, 235, .3); }
.hero-card .orb.warn { background: linear-gradient(160deg, #fbbf24, #f59e0b); box-shadow: 0 8px 20px rgba(245, 158, 11, .3); }
.hero-card .orb svg { width: 30px; height: 30px; }
.hero-card .orb.idle svg { animation: rotate 8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.hero-card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.hero-card p { margin: 2px 0 0; color: var(--label-2); font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 28px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--label-2); display: flex; align-items: center; gap: 6px; }
.stat .l i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.banner { display: flex; gap: 12px; align-items: center; background: color-mix(in srgb, var(--orange) 14%, var(--card));
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.banner .grow { flex: 1; font-size: 15px; }
.banner b { display: block; }
.banner button { border: 0; background: var(--orange); color: #fff; font-weight: 600; border-radius: 999px; padding: 7px 14px; font-size: 15px; }

.steps { counter-reset: s; padding: 4px 0; }
.steps .step { display: flex; gap: 12px; padding: 10px 16px; align-items: flex-start; font-size: 15px; }
.steps .step::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; margin-top: -1px; }

.empty { text-align: center; padding: 34px 20px; color: var(--label-2); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; }
.empty .ic svg { width: 30px; height: 30px; }
.empty b { display: block; color: var(--label); font-size: 17px; margin-bottom: 4px; }

.profile { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 26px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, #a5b4fc, #6366f1); margin-bottom: 8px; }
.avatar.sm { width: 36px; height: 36px; font-size: 16px; margin: 0; flex: none; }
.profile b { font-size: 22px; }
.profile span { color: var(--label-2); font-size: 15px; }

/* ------------------------------------------------------------------ Tab-Leiste */

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding-bottom: var(--safe-bottom);
  background: var(--bar); box-shadow: 0 -.5px 0 var(--bar-line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.tabbar-inner { display: flex; max-width: 520px; margin: 0 auto; }
.tab { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px; color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: .01em; transition: color .2s; }
.tab svg { width: 26px; height: 26px; transition: transform .35s var(--spring); }
.tab.active { color: var(--blue); }
.tab.active svg { transform: scale(1.06); }
.tab:active svg { transform: scale(.88); }
@media (min-width: 768px) {
  .tabbar { left: 50%; right: auto; bottom: calc(var(--safe-bottom) + 18px); transform: translateX(-50%); border-radius: 999px;
    padding: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.12), 0 0 0 .5px var(--bar-line); }
  .tabbar-inner { gap: 4px; }
  .tab { flex-direction: row; gap: 8px; padding: 9px 18px; border-radius: 999px; font-size: 15px; }
  .tab svg { width: 20px; height: 20px; }
  .tab.active { background: var(--fill); }
}

/* ------------------------------------------------------------------ Sheets */

#layer { position: relative; z-index: 50; }
.backdrop { position: fixed; inset: 0; background: var(--backdrop); animation: fade .35s ease both; }
.backdrop.out { animation: fadeOut .3s ease both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: var(--sheet-shadow);
  padding: 0 16px calc(var(--safe-bottom) + 20px); animation: sheetIn .55s var(--spring) both; touch-action: pan-y; }
.sheet.out { animation: sheetOut .35s var(--spring) both; }
.sheet.dragging { animation: none; transition: none; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; border-radius: 18px; padding-bottom: 20px;
    transform: translate(-50%, -50%); animation: modalIn .45s var(--spring) both; max-height: 86dvh; }
  .sheet.out { animation: modalOut .25s ease both; }
  @keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
  @keyframes modalOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
  .grabber { display: none; }
}
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 4px; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 50px; margin: 0 -8px 8px;
  position: sticky; top: 0; background: var(--bg); z-index: 1; }
.sheet-head b { font-weight: 600; }
.sheet-head .nav-action { justify-self: end; }
.sheet-head .nav-back { font-weight: 400; }
.sheet-hero { text-align: center; margin: 8px 0 22px; }
.sheet-hero .ic { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px; }
.sheet-hero .ic svg { width: 34px; height: 34px; }
.sheet-hero h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.sheet-hero p { margin: 0; color: var(--label-2); font-size: 15px; }

.token { background: var(--card); border-radius: 12px; padding: 14px 16px; font-size: 15px; word-break: break-all; line-height: 1.45;
  user-select: all; -webkit-user-select: all; }

/* Aktionsblatt (wie iOS) */
.actions { position: fixed; left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 8px); animation: sheetIn .5s var(--spring) both;
  max-width: 440px; margin: 0 auto; }
.actions.out { animation: sheetOut .3s var(--spring) both; }
.actions .group { border-radius: 14px; background: var(--card); margin-bottom: 8px; }
.actions .head { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--label-2); }
.actions .act { display: block; width: 100%; height: 57px; border: 0; background: none; color: var(--blue); font-size: 20px; position: relative; }
.actions .head + .act::before, .actions .act + .act::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: .5px solid var(--sep); }
.actions .act.red { color: var(--red); }
.actions .act.bold { font-weight: 600; }
.actions .act:active { background: var(--fill); }

/* Erfolgshäkchen */
.check-anim { width: 88px; height: 88px; margin: 6px auto 16px; }
.check-anim circle { stroke: var(--green); stroke-width: 4; fill: none; stroke-dasharray: 251; stroke-dashoffset: 251;
  animation: draw .7s var(--ease) forwards; transform: rotate(-90deg); transform-origin: center; }
.check-anim path { stroke: var(--green); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------------ Hinweis-Toast */

#toast { position: fixed; z-index: 80; top: calc(var(--safe-top) + 10px); left: 50%; transform: translate(-50%, -140%);
  background: var(--card); color: var(--label); border-radius: 999px; padding: 10px 18px 10px 12px; display: flex; gap: 8px;
  align-items: center; font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 0 .5px var(--bar-line);
  transition: transform .5s var(--spring); max-width: calc(100vw - 32px); }
#toast.show { transform: translate(-50%, 0); }
#toast svg { width: 22px; height: 22px; flex: none; }
#toast.ok svg { color: var(--green); } #toast.err svg { color: var(--red); }

/* ------------------------------------------------------------------ Segment-Umschalter */

.segmented { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 9px;
  padding: 2px; margin: 0 0 22px; }
.segmented button { position: relative; z-index: 1; border: 0; background: none; height: 32px; font-size: 14px; font-weight: 500;
  color: var(--label); border-radius: 7px; transition: font-weight .2s; }
.segmented button.on { font-weight: 600; }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 7px; background: var(--card);
  box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .35s var(--spring); }
.seg-thumb.right { transform: translateX(100%); }
:root[data-theme="dark"] .seg-thumb { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-thumb { background: #636366; } }

.segmented.four { grid-template-columns: repeat(4, 1fr); }
.segmented.four button { font-size: 13px; transition: background .25s, box-shadow .25s; }
.segmented.four button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
:root[data-theme="dark"] .segmented.four button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented.four button.on { background: #636366; } }

/* ------------------------------------------------------------------ Admin-Panel */

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .s { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.chart-card .segmented { margin-bottom: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.chart-total { font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1; font-variant-numeric: tabular-nums; }
.chart-info { text-align: right; min-height: 18px; }
.chart { width: 100%; height: 140px; display: block; overflow: visible; }
.chart .grid { stroke: var(--sep); stroke-dasharray: 3 4; }
.chart .bar { fill: var(--blue); transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--spring) both; cursor: pointer; transition: opacity .2s; }
.chart .bar.zero { fill: var(--fill-2); }
.chart:hover .bar:not(.on) { opacity: .55; }
.chart .bar.on { opacity: 1; }
.chart .bar:nth-child(3n) { animation-delay: .03s; } .chart .bar:nth-child(3n+1) { animation-delay: .06s; }
@keyframes grow { from { transform: scaleY(0); } }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-2); margin-top: 6px; }
.plat { margin-top: 10px; display: grid; gap: 10px; }
.plat-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: 15px; }
.plat-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.plat-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--blue)); transition: width .9s var(--spring); }
.row .title.wrap { white-space: normal; overflow: visible; line-height: 1.3; }
.row.ev { align-items: flex-start; }
.row.ev .ic { margin-top: 2px; }
.ev-delta { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill);
  border-radius: 5px; padding: 0 5px; font-variant-numeric: tabular-nums; }
.search { margin: 0 0 10px; }
.search input { width: 100%; height: 36px; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px; font-size: 16px; outline: none; }
.warn-text { color: var(--orange) !important; }
.profile .badge { margin: 0 4px 0 0; }

/* ------------------------------------------------------------------ Rechtstexte */

.legal-doc { background: var(--card); border-radius: var(--radius); padding: 6px 18px 18px; box-shadow: var(--shadow); font-size: 15px; line-height: 1.55; }
.legal-doc h2 { font-size: 17px; font-weight: 600; margin: 20px 0 6px; }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { margin: 0 0 10px; padding-left: 20px; }
.legal-doc li { margin: 4px 0; }
.legal-doc .skeleton { margin-top: 12px; }
.check a { color: var(--blue); }

/* ------------------------------------------------------------------ Anleitung */

.guide-pane { animation: fadeIn .35s var(--ease) both; }
.guide-hero { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.guide-hero .ic { width: 44px; height: 44px; border-radius: 12px; }
.guide-hero .ic svg { width: 24px; height: 24px; }
.guide-hero b { display: block; font-size: 17px; }
.guide-hero span { color: var(--label-2); font-size: 15px; }
.guide-intro { color: var(--label-2); font-size: 15px; margin: 0 4px 22px; line-height: 1.45; }
.guide-step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; margin-bottom: 30px; position: relative; }
.guide-step::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: -26px; border-left: 2px solid var(--fill-2); }
.guide-step.last::before { display: none; }
.gs-num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center; position: relative; z-index: 1; }
.gs-num svg { width: 18px; height: 18px; }
.gs-body { min-width: 0; }
.gs-body h3 { margin: 4px 0 6px; font-size: 19px; font-weight: 700; letter-spacing: .005em; }
.gs-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
.gs-body .group { margin: 0 0 12px; }
.gs-list { margin: 0 0 12px; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.gs-list li { margin: 6px 0; }
.gs-label { color: var(--label-2); font-size: 13px !important; text-transform: uppercase; letter-spacing: .02em; margin: 14px 0 6px !important; }
.gs-note { color: var(--label-2); font-size: 14px !important; }

.pill { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 500; line-height: 1.45;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); word-break: break-all; }
.pill.var { background: color-mix(in srgb, var(--blue) 14%, transparent); }
.pill.var::before { content: "◆"; font-size: 9px; margin-right: 4px; vertical-align: 2px; opacity: .8; }

.sc-action { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow), 0 0 0 .5px var(--sep);
  font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.sc-line { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.sc-ic { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; margin-top: 1px; }
.sc-ic svg { width: 16px; height: 16px; }
.sc-ic.blue { background: var(--blue); } .sc-ic.green { background: var(--green); } .sc-ic.gray { background: var(--gray); }
.sc-sub { font-weight: 500; color: var(--label-2); margin: 8px 0 0 36px; font-size: 14px; }
.sc-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 12px 0 0 36px; padding-top: 10px;
  border-top: .5px solid var(--sep); font-weight: 400; font-size: 14px; align-items: center; }
.sc-grid > span:nth-child(odd) { color: var(--label-2); }
.sc-flow { position: relative; margin: 4px 0 14px; }
.sc-flow .sc-action { margin-bottom: 0; }
.sc-flow .sc-action + .sc-action { margin-top: 14px; position: relative; }
.sc-flow .sc-action + .sc-action::before { content: ""; position: absolute; left: 50%; top: -14px; height: 14px; border-left: 2px solid var(--fill-2); }

.faq details { padding: 0 16px; position: relative; }
.faq details + details::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.faq summary { list-style: none; cursor: pointer; padding: 14px 24px 14px 0; position: relative; font-size: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; border: solid var(--label-3);
  border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 14px; color: var(--label-2); font-size: 15px; line-height: 1.45; animation: fadeIn .3s var(--ease); }
.small-link { font-size: 15px; height: 36px; }

/* ------------------------------------------------------------------ Sonstiges */

.dot.orange { background: var(--orange); } .dot.yellow { background: #ffcc00; }
.dot.red { background: var(--red); } .dot.indigo { background: var(--indigo); }
.tick { width: 20px; height: 20px; color: var(--blue); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--spring); }
.row.selected .tick { opacity: 1; transform: none; }
label.row { cursor: pointer; }
.sk-a { height: 92px; margin-bottom: 18px; }
.sk-b { height: 260px; }
.spinner.big { width: 44px; height: 44px; border-width: 4px; color: var(--blue); margin: 10px auto 18px; display: block; }
.legal + .legal { display: none; }

.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.boot { display: grid; place-items: center; min-height: 100dvh; }
.boot .app-icon { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt { margin-top: 16px; }
.err-text { color: var(--red); font-size: 15px; margin: 10px 4px 0; min-height: 0; }
.err-text:empty { display: none; }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.field input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
