/* Daylo – Gestaltung. Mobile zuerst, dann Tablet und Desktop. */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece5;
  --text: #1f2a2a;
  --muted: #56625f;
  --border: #dcd6ca;
  --accent: #1f6f66;
  --accent-strong: #185a53;
  --on-accent: #ffffff;
  --accent-soft: #dcefeb;
  --danger: #b3261e;
  --danger-soft: #fbe3e1;
  --late: #9a3c00;
  --ok: #1d6b3a;
  --demo-soft: #fbefd5;
  --focus: #1a5fb4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .06);
  --radius: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917;
    --surface: #1d2422;
    --surface-2: #26302d;
    --text: #e8eeec;
    --muted: #a9b5b2;
    --border: #35423e;
    --accent: #6cc7b9;
    --accent-strong: #8ad6ca;
    --on-accent: #0b2420;
    --accent-soft: #1e3a36;
    --danger: #ff8a80;
    --danger-soft: #3d2120;
    --late: #ffb26b;
    --ok: #7fd69c;
    --demo-soft: #3a3020;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--on-accent); padding: 12px 16px; border-radius: 10px;
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

/* ---------- Kopfzeile ---------- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: calc(8px + var(--safe-t)) 8px 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.app-header h1 { flex: 1; font-size: 1.5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header #back-btn { margin-left: -8px; }
.header-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 48px; height: 48px; display: inline-grid; place-items: center;
  background: transparent; border: 0; border-radius: 12px; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Inhalt ---------- */
main {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 96px + var(--safe-b));
}

.today-date { color: var(--muted); font-size: 1.05rem; margin-bottom: 12px; }

.section { margin: 20px 0; }
.section-title { font-size: 1.05rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.count {
  font-size: .85rem; background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 0 9px; min-width: 26px; text-align: center; font-weight: 600;
}
.section-warn .section-title { color: var(--late); }

details.section > summary {
  cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center;
  padding: 0 4px; border-radius: 10px;
}

/* Einklappbare Abschnitte */
details.fold > summary.fold-head {
  list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 8px 0 4px;
  font-size: 1.05rem; font-weight: 700; margin-bottom: 4px;
}
details.fold > summary.fold-head::-webkit-details-marker { display: none; }
details.fold > summary.fold-head:hover { background: var(--surface-2); }
.fold-title { flex: 0 1 auto; }
.fold-chev {
  margin-left: auto; width: 10px; height: 10px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg); transition: transform .15s; margin-right: 6px; margin-top: -4px;
}
details.fold:not([open]) .fold-chev { transform: rotate(-45deg); margin-top: 0; }
details.fold.section-warn .fold-title { color: var(--late); }
@media (prefers-reduced-motion: reduce) { .fold-chev { transition: none; } }

/* Listen */
.list, .cards, .plain { list-style: none; margin: 0; padding: 0; }
.list {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.row {
  display: flex; align-items: center; gap: 4px; min-height: 60px;
  padding: 4px 8px 4px 4px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row-main {
  flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; justify-content: center;
  text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: 10px; cursor: pointer;
}
.row-main:hover { background: var(--surface-2); }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.row-place { font-size: .95rem; overflow-wrap: anywhere; }
.is-done .row-title { text-decoration: line-through; color: var(--muted); }
.late { color: var(--late); font-weight: 600; }
.ok { color: var(--ok); }

/* Große Checkbox (48 px Tippfläche) */
.check {
  flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
}
.check input, .check-label input[type=checkbox] {
  -webkit-appearance: none; appearance: none; margin: 0;
  width: 28px; height: 28px; border: 2px solid var(--muted); border-radius: 8px;
  background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none;
}
.check input:checked, .check-label input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after, .check-label input[type=checkbox]:checked::after {
  content: ""; width: 7px; height: 14px; border: solid var(--on-accent);
  border-width: 0 3px 3px 0; transform: translate(0, -2px) rotate(45deg);
}
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Karten */
.cards { display: grid; gap: 12px; }
.card {
  display: block; width: 100%; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; border: 0; text-align: left; margin: 12px 0;
}
.cards .card, .cards > li > .card { margin: 0; }
.card-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 64px; }
.card-link:hover { background: var(--surface-2); }
.card-link > span:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.card-title { font-weight: 600; font-size: 1.05rem; display: block; overflow-wrap: anywhere; }
.chev { font-size: 1.6rem; color: var(--muted); line-height: 1; }
.card details { margin: 8px 0; }
.card summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent-strong); font-weight: 600; }
.card ol { margin: 4px 0 8px; padding-left: 22px; }
.big-number { font-size: 1.8rem; font-weight: 700; margin: 0 0 8px; }

.meter { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0 12px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter-over span { background: var(--late); }

.badge {
  display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); margin-top: 4px;
}

/* Hinweise */
.notice {
  background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px;
}
.notice-small { font-size: .92rem; padding: 10px 14px; }
.notice-demo { background: var(--demo-soft); }
.notice-error { background: var(--danger-soft); }
.info { color: var(--muted); font-size: .95rem; }
.hint { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.all-good { color: var(--muted); padding: 8px 4px; }
.local-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.empty {
  text-align: center; padding: 32px 16px; color: var(--muted);
  border: 2px dashed var(--border); border-radius: var(--radius); margin: 16px 0;
}
.empty-title { color: var(--text); font-weight: 600; font-size: 1.05rem; }

/* Umschalter / Bereiche */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.seg {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-weight: 500;
}
.seg.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 16px; }
.chip {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left;
}
.chip-static { display: inline-flex; align-items: center; gap: 2px; padding: 0 0 0 14px; cursor: default; }
.chip-x {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.3rem;
  border-radius: 999px; color: var(--muted);
}

/* Schaltflächen */
.btn {
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
}
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.secondary { background: var(--surface); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--accent-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2a0b09; } }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--border); }
.danger-text { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.back-link { margin: -4px 0 8px -8px; padding-left: 8px; }
.link-btn {
  background: none; border: 0; color: var(--accent-strong); text-decoration: underline;
  cursor: pointer; min-height: 44px; padding: 0 4px;
}

.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.detail-head h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.detail-head h2:focus { outline: none; }

/* Eingabezeilen */
input[type=text], input[type=search], input[type=date], input[type=time], input[type=datetime-local], input[type=email], input[type=password], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 17px; /* ab 16 px zoomt iOS nicht */
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface);
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
[aria-invalid=true] { border-color: var(--danger) !important; }
input[type=date], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; }

.add-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0 16px; }
.add-form.two { grid-template-columns: 1fr auto; }
.add-form .wide { grid-column: 1 / -1; }

.search-box { margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.answer h2 { margin-bottom: 8px; }
.answer-group { font-size: 1rem; margin: 12px 0 4px; color: var(--muted); }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.plain li:last-child { border-bottom: 0; }
.answer:focus { outline: none; }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-head .icon-btn { font-size: 1.8rem; line-height: 1; color: var(--accent-strong); }
.cal-title { flex: 1; text-align: center; font-size: 1.2rem; }
.cal {
  width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.cal th { font-size: .8rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal td { padding: 0; }
.cal-day {
  width: 100%; aspect-ratio: 1 / 1; min-height: 44px; max-height: 72px; border: 0; border-radius: 12px; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 0;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.is-past .cal-num { color: var(--muted); }
.cal-day.is-today .cal-num { color: var(--accent-strong); font-weight: 800; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.is-selected { background: var(--accent); }
.cal-day.is-selected .cal-num { color: var(--on-accent); }
.cal-day.is-selected .dot { background: var(--on-accent); }
.cal-num { font-weight: 600; font-size: 1rem; line-height: 1; }
.dots { display: flex; gap: 3px; height: 6px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--muted); }
.dot-event { background: var(--accent); }
.dot-bday { background: var(--late); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--muted); margin: 10px 2px 0; }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-day-title { margin-top: 20px; font-size: 1.15rem; }

.gbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 14px;
  margin-bottom: 12px; font-size: .92rem; color: var(--muted);
}
.gbar-ok { color: var(--ok); }
.gbar-warn { background: var(--danger-soft); color: var(--text); }

/* ---------- Anmeldung & Google ---------- */
.connect-block h3 { display: flex; align-items: center; gap: 8px; }
.connect-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.apple-btn { background: #000; color: #fff; gap: 8px; }
@media (prefers-color-scheme: dark) { .apple-btn { background: #fff; color: #000; } }
.google-btn { background: #fff; color: #1f1f1f; border: 1px solid #747775; gap: 10px; }
.google-btn:hover { background: #f2f2f2; }
.google-btn:disabled { opacity: .6; cursor: wait; }
.settings-sub { margin-top: 12px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-pair .field { margin-bottom: 0; }
.field-pair-hint { margin: 6px 0 16px; }
.guest-hint { margin: -4px 0 16px; }
.guests li { padding: 4px 0; }
.guest-accepted { color: var(--ok); }
.guest-declined { color: var(--danger); }

/* ---------- Pro ---------- */
.pro-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; margin-right: 4px; align-self: center;
  border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, #f5c542, #e8962e); color: #3a2400;
}
.pro-chip:hover { filter: brightness(1.05); }
.pro-hero { text-align: center; padding: 8px 0 12px; }
.pro-star { font-size: 2.4rem; line-height: 1; margin: 0; color: #e8a52e; }
.pro-hero h3 { font-size: 1.3rem; margin: 4px 0; }
.pro-price { font-size: 1.15rem; margin: 4px 0; }
.pro-price strong { font-size: 1.6rem; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 16px; }
@media (max-width: 380px) { .plans { grid-template-columns: 1fr; } }
.plan-card { border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.plan-card h4 { margin: 0; font-size: 1.05rem; }
.plan-group { border-color: #e8a52e; }
.plan-current { box-shadow: 0 0 0 2px var(--accent) inset; }
.plan-price { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.plan-price strong { font-size: 1.4rem; }
.plan-price span { color: var(--muted); font-size: .85rem; }
.plan-card .btn { margin-top: auto; }
.invite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.invite-code { font: 700 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; background: var(--surface-2); padding: 6px 14px; border-radius: 12px; }
.group-head h3 { font-size: 1.3rem; margin: 0 0 12px; }
.price-old { color: var(--muted); font-size: 1.1rem; margin-right: 4px; }
.discount-badge { display: inline-block; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .9rem; padding: 4px 12px; border-radius: 999px; margin: 4px 0; }
.pro-features { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 10px; }
.pro-features li { display: flex; gap: 12px; align-items: flex-start; }
.pro-ico { font-size: 1.4rem; line-height: 1.2; flex: none; width: 28px; text-align: center; }
.pro-buy { background: linear-gradient(135deg, #f5c542, #e8962e); color: #3a2400; }
.tag-soon { background: var(--surface-2); color: var(--muted); }
.tag-pro { background: linear-gradient(135deg, #f5c542, #e8962e); color: #3a2400; }
.tag-new { background: var(--accent); color: var(--on-accent); }

/* ---------- Nachrichten & Sprechblase ---------- */
.news-btn { position: relative; }
.news-badge {
  position: absolute; top: 6px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.news-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-item.is-new .news-title { color: var(--accent-strong); }
.news-update { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; border: 0; margin-bottom: 8px; }
.news-title { font-weight: 700; margin: 0 0 2px; }
.news-text { white-space: pre-line; margin: 6px 0; }
.bubble {
  position: fixed; z-index: 30; right: 16px; top: calc(68px + var(--safe-t)); max-width: min(380px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px 18px 4px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: bubble-in .25s ease-out;
}
.bubble[hidden] { display: none; }
@keyframes bubble-in { from { transform: translateY(-8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }
.bubble-ico { font-size: 1.4rem; flex: none; }
.bubble-text { flex: 1; min-width: 0; font-size: .92rem; line-height: 1.35; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.bubble-open { cursor: pointer; }
.bubble-x { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; border-radius: 999px; cursor: pointer; flex: none; }
.bubble-x:hover { background: var(--surface-2); }
@media (max-width: 480px) { .pro-chip { padding: 0 9px; font-size: .82rem; } }

/* ---------- Konto-Knopf in der Kopfzeile ---------- */
.account-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; margin-right: 4px; align-self: center;
  border-radius: 999px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent-strong);
  font-weight: 700; font-size: .9rem; cursor: pointer;
}
.account-chip:hover { background: var(--accent-soft); }
.account-chip.is-signed-in { padding: 0; width: 36px; justify-content: center; border: 0; background: var(--accent); color: var(--on-accent); }
.account-chip.is-signed-in svg { display: none; }
@media (max-width: 480px) {
  .account-chip:not(.is-signed-in) { padding: 0 8px; }
  .account-chip:not(.is-signed-in) #account-label { display: none; }
  .header-actions .icon-btn { width: 40px; }
}
[dir="rtl"] .account-chip { margin-right: 0; margin-left: 4px; }
.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; border: 0; padding: 0; }
.type-choice legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
/* Konto-Auswahl: zwei Wege (Privat / Gruppe) */
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 14px; }
@media (max-width: 380px) { .ways { grid-template-columns: 1fr; } }
.way-card { display: flex; flex-direction: column; gap: 6px; border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface); }
.way-card h4 { margin: 0; font-size: 1.05rem; }
.way-card .btn-row { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.way-group { border-color: #e8a52e; }
.way-badge { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; margin: 0 0 14px; font-weight: 600; }
.way-badge.way-group { background: color-mix(in srgb, #e8a52e 20%, var(--surface)); }
.plans-one { grid-template-columns: 1fr; }
.type-option { position: relative; display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; background: var(--surface); }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: var(--accent-soft); }
.type-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.type-ico { font-size: 1.5rem; line-height: 1; }
.type-title { font-weight: 700; }
.login-required { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }

/* ---------- Rezepte ---------- */
.recipe-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tag { font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.tag-anfaenger { background: var(--accent-soft); color: var(--accent-strong); }
.tag-fortgeschritten { background: var(--demo-soft); }
.tag-profi { background: var(--danger-soft); }

/* ---------- Finanzen ---------- */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  }
}
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 420px) { .stat-row { grid-template-columns: 1fr 1fr; } .stat-row .stat:last-child { grid-column: 1 / -1; } }
.chart-card { padding: 16px; }
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.pie-box { flex: none; margin: 0 auto; width: 200px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.donut { width: 200px; height: 200px; display: block; overflow: visible; }
.slice { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; cursor: pointer; transition: opacity .15s; }
.donut.has-hover .slice:not(.is-hover) { opacity: .35; }
.pie-caption { font-size: .85rem; color: var(--muted); text-align: center; margin: 0; min-height: 2.6em; }
:root { --pie-rest: #c9cfcc; }
@media (prefers-color-scheme: dark) { :root { --pie-rest: #4a5552; } }
.cmp { display: grid; gap: 10px; margin: 4px 0 10px; }
.cmp-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px; }
.cmp-label { font-size: .92rem; color: var(--muted); font-weight: 600; }
.cmp-track { height: 24px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.cmp-bar { display: block; height: 100%; border-radius: 0 6px 6px 0; }
.cmp-in { background: var(--accent); }
.cmp-out { background: var(--late); }
.cmp-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 88px; }
.cmp-note { margin: 0; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 200px; display: grid; gap: 2px; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: default; }
.legend li.is-hover { background: var(--surface-2); }
.legend-name { flex: 1; min-width: 0; }
.legend-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.row-swatch { margin: 0 4px 0 14px; }
.swatch-in { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .slice { transition: none; } }

/* ---------- Notizen ---------- */
.note-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-height: 96px; }
.note-card:hover { background: var(--surface-2); }
.note-text { white-space: pre-line; overflow-wrap: anywhere; color: var(--text); font-size: .95rem; }
@media (min-width: 600px) { .notes-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Schwebender Plus-Knopf (Daumenbereich) ---------- */
.fab {
  position: fixed; z-index: 15; right: 16px;
  bottom: calc(var(--nav-h) + 16px + var(--safe-b));
  min-height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1.02rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.fab-plus { font-size: 1.6rem; line-height: 1; margin-top: -2px; }
.fab[hidden] { display: none; }

/* ---------- Untere Navigation ---------- */
.bottom-nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-brand { display: none; }
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 600;
  min-height: 48px; position: relative;
}
.bottom-nav button[aria-current=page] { color: var(--accent-strong); }
.bottom-nav button[aria-current=page]::before {
  content: ""; position: absolute; top: 6px; width: 56px; height: 32px; border-radius: 999px;
  background: var(--accent-soft); z-index: -1;
}
.bottom-nav button svg { margin-top: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 40; left: 16px; right: 16px;
  bottom: calc(var(--nav-h) + 84px + var(--safe-b));
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #22302d; color: #fff; padding: 10px 10px 10px 16px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); min-height: 52px;
}
.toast[hidden] { display: none; }
.toast-error { background: #8c1d18; }
.toast-btn {
  background: transparent; color: #9fe3d8; border: 0; font-weight: 700; cursor: pointer;
  min-height: 44px; padding: 0 10px; border-radius: 10px; flex: none;
}
.toast-btn:focus-visible { outline-color: #fff; }

/* ---------- Bottom-Sheet-Dialog ---------- */
.sheet {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 24px - var(--safe-t));
  margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text); overflow: hidden;
  display: none; flex-direction: column;
}
.sheet[open] { display: flex; animation: sheet-in .2s ease-out; }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 8px 8px 20px; border-bottom: 1px solid var(--border);
}
.sheet-head h2 { font-size: 1.2rem; }
.sheet-head h2:focus { outline: none; }
.sheet-body { overflow-y: auto; padding: 16px 20px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.optional { color: var(--muted); font-weight: 400; }
.check-label { display: flex !important; align-items: center; gap: 12px; min-height: 48px; font-weight: 400 !important; cursor: pointer; }
.check-label input[type=radio] { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); flex: none; }
.form-error { color: var(--danger); font-weight: 600; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sheet-actions .btn { width: 100%; }
.settings-block { padding: 4px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.settings-block:last-child { border-bottom: 0; }
.settings-block h3 { font-size: 1.05rem; margin-bottom: 6px; }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  main { padding-left: 24px; padding-right: 24px; }
  .add-form.two { grid-template-columns: 2fr 1fr auto; }
  .add-form.two .wide { grid-column: auto; }
  .sheet { margin: auto; border-radius: 22px; max-height: min(86dvh, 760px); }
  .sheet-actions { flex-direction: row; flex-wrap: wrap; }
  .sheet-actions .btn { width: auto; }
}

/* ---------- Desktop: Navigation als Seitenleiste ---------- */
@media (min-width: 900px) {
  :root { --side-w: 232px; }
  body { padding-left: var(--side-w); }
  .bottom-nav {
    top: 0; right: auto; width: var(--side-w); height: auto; overflow-x: visible;
    grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px;
    padding: 20px 12px; border-top: 0; border-right: 1px solid var(--border);
  }
  .nav-brand { display: block; font-weight: 700; font-size: 1.15rem; padding: 4px 12px 16px; color: var(--accent-strong); }
  .bottom-nav button {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px;
    font-size: 1rem; min-height: 48px; border-radius: 12px;
  }
  .bottom-nav button:hover { background: var(--surface-2); }
  .bottom-nav button svg { margin: 0; }
  .bottom-nav button[aria-current=page] { background: var(--accent-soft); }
  .bottom-nav button[aria-current=page]::before { display: none; }
  .app-header { padding-left: 24px; }
  .app-header > * { max-width: none; }
  main { padding-bottom: 120px; }
  .fab { bottom: 24px; right: 24px; }
  .toast { bottom: 96px; left: calc(var(--side-w) + 16px); }
  /* Rechts-nach-links (Arabisch): Seitenleiste rechts */
  [dir="rtl"] body { padding-left: 0; padding-right: var(--side-w); }
  [dir="rtl"] .bottom-nav { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--border); }
  [dir="rtl"] .app-header { padding-left: 8px; padding-right: 24px; }
  [dir="rtl"] .fab { right: auto; left: 24px; }
  [dir="rtl"] .toast { left: 16px; right: calc(var(--side-w) + 16px); }
}

/* ---------- Rechts-nach-links (Arabisch), alle Größen ---------- */
[dir="rtl"] .fab { right: auto; left: 16px; }
[dir="rtl"] .bubble { right: auto; left: 16px; border-radius: 18px 18px 18px 4px; }
[dir="rtl"] .app-header { padding: calc(8px + var(--safe-t)) 16px 8px 8px; }
[dir="rtl"] .app-header #back-btn { margin-left: 0; margin-right: -8px; transform: scaleX(-1); }
[dir="rtl"] .pro-chip { margin-right: 0; margin-left: 4px; }
[dir="rtl"] .chev, [dir="rtl"] .cal-head .icon-btn { transform: scaleX(-1); }
[dir="rtl"] .row-main, [dir="rtl"] .bubble-text, [dir="rtl"] .card { text-align: right; }
[dir="rtl"] .row-swatch { margin: 0 14px 0 4px; }
[dir="rtl"] .legend-val { text-align: left; }
[dir="rtl"] .fold-chev { margin-left: 6px; margin-right: auto; }
[dir="rtl"] .cmp-val { text-align: left; }
[dir="rtl"] .card ol { padding-left: 0; padding-right: 22px; }

/* =====================================================================
   Neon-Design (Dunkel + Lime aus dem Logo). Steht absichtlich am Ende
   und überschreibt die Grundfarben oben – immer dunkel, auch im Hellmodus.
   ===================================================================== */
:root {
  --bg: #07090f;
  --surface: #10141f;
  --surface-2: #181e2d;
  --text: #f2f5fb;
  --muted: #8b95ab;
  --border: #222a3b;
  --accent: #c6f432;
  --accent-strong: #d4ff4a;
  --on-accent: #0a0d14;
  --accent-soft: rgba(198, 244, 50, .12);
  --neon-2: #a855f7;
  --neon-3: #22d3ee;
  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, .14);
  --late: #ffb547;
  --ok: #4ade80;
  --demo-soft: rgba(168, 85, 247, .14);
  --focus: #22d3ee;
  --glow: 0 0 24px rgba(198, 244, 50, .35);
  --shadow: 0 0 0 1px var(--border);
  --radius: 20px;
  --pie-rest: #2a3347;
  color-scheme: dark;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(600px 400px at 100% -10%, rgba(168, 85, 247, .18), transparent 70%),
    radial-gradient(500px 380px at -10% 30%, rgba(198, 244, 50, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, h4, .card-title, .big-number, .stat-value, .cal-title, .pro-price strong {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif; letter-spacing: -.01em;
}
::selection { background: var(--accent); color: var(--on-accent); }

/* Kopfzeile: Glas-Effekt + Logo */
.app-header {
  background: rgba(7, 9, 15, .72); border-bottom: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.app-header h1 { font-size: 1.7rem; font-weight: 700; }
.brand-mark { width: 36px; height: 26px; flex: none; margin-right: 8px; filter: drop-shadow(0 0 10px rgba(198, 244, 50, .35)); }
[dir="rtl"] .brand-mark { margin-right: 0; margin-left: 8px; }
@media (max-width: 480px) {
  .app-header { padding-left: 12px; }
  .app-header h1 { font-size: 1.35rem; }
  .brand-mark { width: 30px; height: 22px; margin-right: 6px; }
  .header-actions { gap: 0; }
  .header-actions .icon-btn { width: 38px; }
  .pro-chip { padding: 0 8px; margin-right: 2px; }
  .account-chip { margin-right: 2px; }
}
.icon-btn:hover { background: rgba(255, 255, 255, .06); }

.today-date { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.section-title, details.fold > summary.fold-head { text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; color: var(--muted); font-weight: 700; }
.count { background: var(--accent-soft); color: var(--accent); }
.section-warn .section-title, details.fold.section-warn .fold-title { color: var(--late); }

/* Listen und Karten */
.list, .card, .stat, .cal, .plan-card, .way-card, .type-option {
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent), var(--surface);
  border: 1px solid var(--border); box-shadow: none;
}
.card-link:hover, .note-card:hover, .row-main:hover { background: var(--surface-2); }
.card-link:hover { border-color: rgba(198, 244, 50, .4); }
.row { border-bottom-color: var(--border); }
.chev { color: var(--accent); }
.card summary { color: var(--accent); }

/* Hinweise */
.notice { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.notice-demo { border-left-color: var(--neon-2); background: var(--demo-soft); }
.notice-error { border-left-color: var(--danger); background: var(--danger-soft); }
.empty { border: 1.5px dashed #2c3650; background: rgba(255, 255, 255, .015); }

/* Knöpfe */
.btn { border-radius: 14px; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.97); }
a.btn { text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.secondary { background: var(--surface-2); border-color: var(--border); }
.btn.secondary:hover { border-color: rgba(198, 244, 50, .5); background: var(--surface-2); }
.btn.ghost, .link-btn { color: var(--accent); }
.btn.danger { color: #1a0509; }

.seg { background: var(--surface); border-color: var(--border); color: var(--muted); font-weight: 600; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.chip { background: var(--surface-2); border-color: var(--border); }

/* Eingaben */
input[type=text], input[type=search], input[type=date], input[type=time], input[type=datetime-local], input[type=email], input[type=password], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 17px;
  background: #0c1019; border: 1.5px solid var(--border); border-radius: 14px; color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 244, 50, .18); outline: none; }
::placeholder { color: #5d6780; }
.check input, .check-label input[type=checkbox] { background: transparent; border-color: #4a5570; border-radius: 9px; }
.check input:checked, .check-label input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(198, 244, 50, .5); }

/* Passwort mit Auge */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 54px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px; color: var(--muted); cursor: pointer;
}
.pw-eye:hover, .pw-eye[aria-pressed=true] { color: var(--accent); }
[dir="rtl"] .pw-wrap input { padding-right: 14px; padding-left: 54px; }
[dir="rtl"] .pw-eye { right: auto; left: 4px; }

/* Kopfzeilen-Knöpfe */
.pro-chip, .pro-buy, .tag-pro { background: linear-gradient(135deg, var(--neon-2), #ec4899); color: #fff; box-shadow: 0 0 16px rgba(168, 85, 247, .45); }
.account-chip { border-color: var(--accent); color: var(--accent); }
.account-chip:hover { background: var(--accent-soft); }
.account-chip.is-signed-in { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.news-badge { background: #ec4899; box-shadow: 0 0 10px rgba(236, 72, 153, .7); }
.pro-star { color: var(--neon-2); }
.plan-group, .way-group { border-color: var(--neon-2); }

/* Plus-Knopf */
.fab {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 0 1px rgba(198, 244, 50, .4), 0 8px 30px rgba(198, 244, 50, .35);
}
.fab:active { transform: scale(.96); }

/* Untere Navigation: Glas + leuchtender Punkt */
.bottom-nav {
  background: rgba(10, 13, 20, .82); border-top: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.bottom-nav button { color: #6f7a92; }
.bottom-nav button[aria-current=page] { color: var(--accent); }
.bottom-nav button[aria-current=page]::before { background: var(--accent-soft); box-shadow: 0 0 18px rgba(198, 244, 50, .25); }
.bottom-nav button[aria-current=page] svg { filter: drop-shadow(0 0 6px rgba(198, 244, 50, .7)); }
.nav-brand { color: var(--accent); }

/* Kalender */
.cal-day:hover { background: var(--surface-2); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.is-today .cal-num { color: var(--accent); }
.cal-day.is-selected { background: var(--accent); box-shadow: var(--glow); }
.cal-day.is-selected .cal-num, .cal-day.is-today.is-selected .cal-num { color: var(--on-accent); font-weight: 800; }
.cal-day.is-selected .dot { background: var(--on-accent); }
.dot-event { background: var(--accent); }
.dot-bday { background: #ec4899; }
.cal-head .icon-btn { color: var(--accent); }

/* Meldungen, Dialog, Sprechblase */
.toast { background: #161c2b; border-color: rgba(198, 244, 50, .25); }
.toast-error { background: #3a0f1a; border-color: rgba(255, 92, 122, .5); }
.toast-btn { color: var(--accent); }
.sheet { background: #0e121c; border: 1px solid var(--border); border-bottom: 0; }
.sheet::backdrop { background: rgba(3, 4, 8, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-head { border-bottom-color: var(--border); }
.bubble { background: #141a28; border-color: rgba(198, 244, 50, .3); }

/* Finanzen */
.meter span, .cmp-in, .swatch-in { background: var(--accent); }
.meter { background: var(--surface-2); }

/* Rezepte */
.tag { background: var(--surface-2); color: var(--text); }
.tag-anfaenger { background: var(--accent-soft); color: var(--accent); }
.tag-fortgeschritten { background: rgba(34, 211, 238, .14); color: var(--neon-3); }
.tag-profi { background: rgba(236, 72, 153, .16); color: #f472b6; }
.tag-source { background: rgba(168, 85, 247, .16); color: #c084fc; }
.import-box {
  background: linear-gradient(135deg, rgba(198, 244, 50, .10), rgba(168, 85, 247, .10)), var(--surface);
  border: 1px solid rgba(198, 244, 50, .25); border-radius: var(--radius); padding: 16px; margin: 0 0 16px;
}
.import-box .add-form { margin: 0; }
.recipe-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 600px) { .recipe-grid { grid-template-columns: 1fr 1fr; } }
.recipe-card { padding: 0; overflow: hidden; margin: 0; }
.recipe-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.recipe-img-empty { display: grid; place-items: center; font-size: 2.6rem; background: linear-gradient(135deg, rgba(198, 244, 50, .15), rgba(168, 85, 247, .15)); }
.recipe-body { padding: 14px 16px 6px; }
.ing-list { margin: 4px 0 8px; padding-left: 20px; }
.ing-list li { padding: 2px 0; }
[dir="rtl"] .ing-list { padding-left: 0; padding-right: 20px; }

/* Desktop-Seitenleiste */
@media (min-width: 900px) {
  .bottom-nav { border-right: 1px solid rgba(255, 255, 255, .06); }
  .bottom-nav button:hover { background: rgba(255, 255, 255, .05); }
  .bottom-nav button[aria-current=page] { background: var(--accent-soft); }
  .nav-brand { display: flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-size: 1.35rem; }
  .nav-brand::before { content: ""; width: 30px; height: 30px; background: url("../icons/logo-dark.svg") center / contain no-repeat; }
}
@media (prefers-reduced-motion: reduce) { .btn, .fab { transition: none; } }

/* Datenschutz & Impressum */
.sheet-locked .sheet-head [data-action="close-sheet"] { display: none; }
.legal-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.legal-steps li { flex: 1; text-align: center; font-size: .8rem; font-weight: 700; padding: 6px 4px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.legal-steps li.current { background: var(--accent); color: var(--on-accent); }
.legal-steps li.done { background: var(--accent-soft); color: var(--accent); }
.legal-text h3 { font-size: 1.15rem; margin: 18px 0 8px; }
.legal-text h3:first-child { margin-top: 4px; }
.legal-text h4 { font-size: .98rem; margin: 14px 0 4px; }
.legal-text p { font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; }
.legal-accept { position: sticky; bottom: calc(-20px - var(--safe-b)); background: var(--surface); padding: 12px 0 calc(8px + var(--safe-b)); margin-top: 12px; border-top: 1px solid var(--border); }
.sheet .legal-accept { background: #0e121c; }
[data-theme="light"] .sheet .legal-accept { background: var(--surface); }

/* KI-Antwort */
.ai-text { white-space: pre-line; overflow-wrap: anywhere; margin: 8px 0 4px; line-height: 1.55; }
.answer-ai { border-color: rgba(198, 244, 50, .35); }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 10px 0 4px; }
.dots-anim { display: inline-flex; gap: 4px; }
.dots-anim span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ai-dot 1s infinite ease-in-out; }
.dots-anim span:nth-child(2) { animation-delay: .15s; }
.dots-anim span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dots-anim span { animation: none; opacity: .7; } }
[data-theme="light"] .answer-ai { border-color: var(--border); }

/* Logo: Kreis hell im Neon-Design, dunkelblau (Original) im hellen Design */
.logo-ring { fill: #f2f5fb; }

/* ---------- Einstellungen: Reiter + Design-Auswahl ---------- */
/* Großes Fenster für die Einstellungen */
.sheet.sheet-wide { height: min(88dvh, 820px); }
@media (min-width: 600px) { .sheet.sheet-wide { max-width: 820px; width: calc(100% - 48px); max-height: min(88dvh, 820px); } }
.sheet-wide .sheet-body { flex: 1; }
/* Reiter links, Inhalt rechts */
.settings-layout { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: start; }
@media (max-width: 599px) { .sheet-wide .sheet-body { padding-left: 12px; } .stab { padding: 6px 8px; font-size: .8rem; } }
@media (min-width: 600px) { .settings-layout { grid-template-columns: 150px 1fr; gap: 24px; } }
.settings-tabs { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; }
.stab {
  min-height: 40px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  text-align: left; font-size: .85rem; font-weight: 600; color: var(--muted); line-height: 1.2; hyphens: auto;
}
.stab:hover { background: var(--surface-2); color: var(--text); }
.stab.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .stab { text-align: right; }
[dir="rtl"] .stab.active { box-shadow: inset -3px 0 0 var(--accent); }
.settings-panel { min-width: 0; }
.settings-panel .settings-block:first-child h3 { margin-top: 2px; }
@media (max-width: 380px) { .settings-panel .theme-choice { grid-template-columns: 1fr; } }
.theme-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 8px; }
.theme-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface);
}
.theme-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.theme-title { font-weight: 700; }
.theme-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; height: 64px; padding: 8px; border-radius: 10px; margin-bottom: 4px; }
.theme-preview span { border-radius: 6px; }
.theme-preview span:first-child { grid-column: 1 / -1; }
.theme-neon .theme-preview { background: #07090f; }
.theme-neon .theme-preview span { background: #181e2d; }
.theme-neon .theme-preview span:last-child { background: #c6f432; box-shadow: 0 0 10px rgba(198, 244, 50, .6); }
.theme-hell .theme-preview { background: #e4e7ec; border: 1px solid #d0d5de; }
.theme-hell .theme-preview span { background: #f3f4f7; border: 1px solid #d0d5de; }
.theme-hell .theme-preview span:last-child { background: #121a29; }

/* =====================================================================
   Helles Design („dezent“): ruhige Farben, Dunkelblau aus dem Logo als
   Hauptfarbe, kein Leuchten. Aktiv mit <html data-theme="light">.
   ===================================================================== */
:root[data-theme="light"] {
  --bg: #e4e7ec;
  --surface: #f3f4f7;
  --surface-2: #e8ebf0;
  --text: #070b14;
  --muted: #333b4d;
  --border: #c2c8d3;
  --accent: #121a29;
  --accent-strong: #0b111c;
  --on-accent: #ffffff;
  --accent-soft: rgba(18, 26, 41, .07);
  --neon-2: #7c3aed;
  --neon-3: #0e7490;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --late: #a14d00;
  --ok: #1d7a3e;
  --demo-soft: #f3eefd;
  --focus: #2563eb;
  --glow: none;
  --shadow: 0 1px 2px rgba(18, 26, 41, .05), 0 4px 14px rgba(18, 26, 41, .05);
  --pie-rest: #d5dae3;
  color-scheme: light;
}
[data-theme="light"] body { background: var(--bg); }
[data-theme="light"] .logo-ring { fill: #121a29; }
[data-theme="light"] .brand-mark { filter: none; }
[data-theme="light"] .app-header { background: rgba(228, 231, 236, .88); border-bottom-color: var(--border); }
[data-theme="light"] .icon-btn:hover { background: var(--surface-2); }
[data-theme="light"] .today-date { color: var(--muted); }
[data-theme="light"] .count { background: var(--surface-2); color: var(--muted); }
[data-theme="light"] .list, [data-theme="light"] .card, [data-theme="light"] .stat, [data-theme="light"] .cal,
[data-theme="light"] .plan-card, [data-theme="light"] .way-card, [data-theme="light"] .type-option {
  background: var(--surface); border-color: var(--border); box-shadow: var(--shadow);
}
[data-theme="light"] .card-link:hover { border-color: var(--border); }
[data-theme="light"] .notice { background: var(--surface); border-color: var(--border); border-left-color: #c6f432; }
[data-theme="light"] .notice-demo { background: var(--demo-soft); border-left-color: var(--neon-2); }
[data-theme="light"] .notice-error { background: var(--danger-soft); border-left-color: var(--danger); }
[data-theme="light"] .empty { border-color: #cfd5df; background: transparent; }
[data-theme="light"] .btn.secondary { background: var(--surface); }
[data-theme="light"] .btn.secondary:hover { border-color: #b8c0cd; }
[data-theme="light"] .btn.danger { color: #fff; }
[data-theme="light"] .seg { background: var(--surface); }
[data-theme="light"] .seg.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: none; }
[data-theme="light"] input[type=text], [data-theme="light"] input[type=search], [data-theme="light"] input[type=date],
[data-theme="light"] input[type=time], [data-theme="light"] input[type=datetime-local], [data-theme="light"] input[type=email],
[data-theme="light"] input[type=password], [data-theme="light"] input[type=url], [data-theme="light"] input[type=number],
[data-theme="light"] input:not([type]), [data-theme="light"] select, [data-theme="light"] textarea { background: #fafbfc; }
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus { box-shadow: 0 0 0 3px rgba(18, 26, 41, .12); }
[data-theme="light"] ::placeholder { color: #5d6578; }
[data-theme="light"] body { font-weight: 500; }
[data-theme="light"] .row-title, [data-theme="light"] .card-title, [data-theme="light"] .empty-title { font-weight: 600; }
[data-theme="light"] .bottom-nav button { color: #3a4255; }
[data-theme="light"] .today-date, [data-theme="light"] .section-title, [data-theme="light"] details.fold > summary.fold-head { color: #2a3142; }
[data-theme="light"] .check input, [data-theme="light"] .check-label input[type=checkbox] { border-color: #9aa3b5; }
[data-theme="light"] .check input:checked, [data-theme="light"] .check-label input[type=checkbox]:checked { box-shadow: none; }
[data-theme="light"] .pro-chip, [data-theme="light"] .pro-buy, [data-theme="light"] .tag-pro { box-shadow: none; }
[data-theme="light"] .account-chip.is-signed-in { box-shadow: none; }
[data-theme="light"] .news-badge { box-shadow: none; }
[data-theme="light"] .fab { box-shadow: 0 6px 18px rgba(18, 26, 41, .25); }
[data-theme="light"] .bottom-nav { background: rgba(243, 244, 247, .94); border-top-color: var(--border); }
[data-theme="light"] .bottom-nav button { color: var(--muted); }
[data-theme="light"] .bottom-nav button[aria-current=page] { color: var(--accent); }
[data-theme="light"] .bottom-nav button[aria-current=page]::before { box-shadow: none; background: #e6f9a8; }
[data-theme="light"] .bottom-nav button[aria-current=page] svg { filter: none; }
[data-theme="light"] .cal-day.is-selected { box-shadow: none; }
[data-theme="light"] .dot-event { background: #7aa300; }
[data-theme="light"] .toast { background: #121a29; border-color: transparent; }
[data-theme="light"] .toast-btn { color: #c6f432; }
[data-theme="light"] .toast-error { background: #8c1d18; }
[data-theme="light"] .sheet { background: var(--surface); border-color: var(--border); }
[data-theme="light"] .sheet::backdrop { background: rgba(18, 26, 41, .4); }
[data-theme="light"] .bubble { background: var(--surface); border-color: var(--border); }
[data-theme="light"] .meter span, [data-theme="light"] .cmp-in, [data-theme="light"] .swatch-in { background: #7aa300; }
[data-theme="light"] .tag-anfaenger { background: #eef8d2; color: #4d6600; }
[data-theme="light"] .tag-fortgeschritten { background: #e0f4f8; color: var(--neon-3); }
[data-theme="light"] .tag-profi { background: #fce7f1; color: #a3195b; }
[data-theme="light"] .tag-source { background: #f1ebfd; color: var(--neon-2); }
[data-theme="light"] .import-box { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
[data-theme="light"] .recipe-img-empty { background: var(--surface-2); }
@media (min-width: 900px) {
  [data-theme="light"] .bottom-nav { border-right-color: var(--border); }
  [data-theme="light"] .bottom-nav button:hover { background: var(--surface-2); }
  [data-theme="light"] .nav-brand::before { background-image: url("../icons/logo.svg"); }
}
