/* ══════════════════════════════════════════════════════════════════════
   Design nach Apple Human Interface Guidelines (über apple-design-skill)
   - Semantische Farben (System-/Grouped-Hintergründe, Label-Stufen) für hell & dunkel
   - iOS-Textstile (Large Title 34/41 … Caption 2 11/13), Body 17 pt, nichts unter 11 pt
   - Liquid-Glass nur in der Funktionsebene (Tabbar, Navigationsleiste), Inhalte deckend
   - Tippflächen ≥ 44 × 44 pt, Kontrast ≥ 4,5 : 1
   - Rücksicht auf Reduce Motion, Reduce Transparency, Increase Contrast, Dynamic Type
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* Hintergründe (Grouped-Set, da die App überwiegend gruppierte Listen zeigt) */
  --bg-grouped: #f2f2f7;          /* systemGroupedBackground */
  --bg-elevated: #ffffff;         /* secondarySystemGroupedBackground */
  --bg-tertiary: #f2f2f7;         /* tertiarySystemGroupedBackground */
  /* Vordergrund */
  --label: #000000;
  --label-2: rgba(60, 60, 67, .78);   /* secondaryLabel – kontrastsicher (≥ 4,5 : 1) */
  --label-3: rgba(60, 60, 67, .45);   /* tertiaryLabel / Platzhalter */
  --separator: rgba(60, 60, 67, .22);
  --fill: rgba(120, 120, 128, .20);
  --fill-3: rgba(118, 118, 128, .12);
  /* Akzent: nur für Hauptaktionen & Status. Weiß darauf = 5,1 : 1 */
  --tint: #e0353a;
  --tint-text: #d1262c;
  --tint-soft: rgba(224, 53, 58, .12);
  --red: #ff3b30;
  --red-text: #d70015;
  --green: #34c759;
  --green-text: #248a3d;
  --orange-text: #c93400;
  --seg-selected: #ffffff;
  /* Glas (Web-Annäherung an Liquid Glass) */
  --glass-bg: rgba(250, 250, 252, .72);
  --glass-border: rgba(255, 255, 255, .6);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .06);
  --radius-card: 12px;
  --radius-ctl: 10px;
  --tabbar-h: 62px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Alias-Namen, die im JS-Code verwendet werden */
  --bg: var(--bg-tertiary);
  --card: var(--bg-elevated);
  --text: var(--label);
  --muted: var(--label-2);
  --line: var(--separator);
  --accent: var(--tint);
  --danger: var(--red-text);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-grouped: #000000;
    --bg-elevated: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .7);
    --label-3: rgba(235, 235, 245, .35);
    --separator: rgba(84, 84, 88, .65);
    --fill: rgba(120, 120, 128, .36);
    --fill-3: rgba(118, 118, 128, .24);
    --tint: #e0353a;
    --tint-text: #ff6961;
    --tint-soft: rgba(255, 105, 97, .18);
    --red: #ff453a;
    --red-text: #ff6961;
    --green: #30d158;
    --green-text: #30d158;
    --orange-text: #ffb340;
    --seg-selected: #636366;
    --glass-bg: rgba(30, 30, 32, .62);
    --glass-border: rgba(255, 255, 255, .12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  }
}

/* Erhöhter Kontrast */
@media (prefers-contrast: more) {
  :root {
    --label-2: rgba(60, 60, 67, .92);
    --separator: rgba(60, 60, 67, .5);
    --tint: #b8141c;
    --tint-text: #a8000a;
    --glass-bg: rgba(250, 250, 252, .95);
    --glass-border: rgba(0, 0, 0, .3);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --label-2: rgba(235, 235, 245, .88);
      --separator: rgba(160, 160, 170, .8);
      --tint-text: #ff8a85;
      --glass-bg: rgba(20, 20, 22, .95);
      --glass-border: rgba(255, 255, 255, .35);
    }
  }
}

/* ───────── Grundlagen & Typografie ───────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  font-size: 17px;                 /* Body 17 pt */
  font: -apple-system-body;        /* iOS: folgt der Systemschriftgröße (Dynamic Type) */
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg-grouped); color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem; line-height: 1.294; letter-spacing: -.025em;
  overscroll-behavior-y: none;
}
h2 { font-size: 1.294rem; line-height: 1.27; font-weight: 700; letter-spacing: -.01em; margin: 8px 0 12px; } /* Title 2: 22/28 */
h3 { font-size: 1.176rem; line-height: 1.25; font-weight: 600; margin: 20px 0 8px; }                        /* Title 3: 20/25 */
p { margin: 8px 0; }
a { color: var(--tint-text); }
b, strong { font-weight: 600; }
.muted { color: var(--label-2); font-size: .882rem; line-height: 1.33; }   /* Subhead 15/20 */
.hidden { display: none !important; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 60%, transparent); outline-offset: 2px; }

/* ───────── Navigationsleiste mit Large Title ───────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: calc(env(safe-area-inset-top) + 44px);
  padding: env(safe-area-inset-top) 8px 0;
  transition: background .25s, box-shadow .25s;
}
#topbar .nav-side.right { justify-self: end; }
#navTitle { font-size: 1rem; font-weight: 600; opacity: 0; transition: opacity .2s; letter-spacing: -.025em; }
#topbar.scrolled {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 .5px 0 var(--separator);
}
#topbar.scrolled #navTitle { opacity: 1; }
main {
  max-width: 760px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 44px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px);
}
.large-title { font-size: 2rem; line-height: 1.206; font-weight: 700; letter-spacing: .012em; margin: 2px 4px 10px; } /* 34/41 bold */
#view { min-height: 50vh; }

.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill-3); color: var(--tint-text); font-size: 1.1rem;
}
.icon-btn.plain { background: none; }
.icon-btn:disabled { opacity: .3; }
.icon-btn:active { opacity: .5; }

/* ───────── Tabbar: schwebende Glas-Kapsel ───────── */
#tabbar {
  position: fixed; z-index: 30;
  left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 8px);
  max-width: 520px; margin: 0 auto; height: var(--tabbar-h);
  display: flex; gap: 2px; padding: 6px;
  border-radius: 31px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
#tabbar button {
  flex: 1; position: relative; border: 0; background: none; cursor: pointer;
  border-radius: 25px;                       /* konzentrisch zur Kapsel (31 − 6) */
  color: var(--label); font: 500 11px/1.1 inherit; font-family: inherit; letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: background .2s, color .2s;
}
#tabbar button .ico { width: 24px; height: 24px; }
#tabbar button.active { color: var(--tint-text); background: var(--fill-3); font-weight: 600; }
#tabbar button.active .ico { fill: currentColor; --cut: var(--bg-elevated); }  /* gefülltes Symbol = ausgewählt */
.badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  background: var(--red); color: #fff; font: 600 11px/17px inherit; font-family: inherit;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; text-align: center; font-style: normal;
}

/* ───────── Steuerelemente ───────── */
input, textarea, select {
  width: 100%; font: inherit; font-size: 1rem; letter-spacing: -.02em;
  min-height: 44px; padding: 11px 14px; border-radius: var(--radius-ctl);
  border: 0; background: var(--bg-elevated); color: var(--label); outline: none;
  box-shadow: inset 0 0 0 .5px var(--separator);
}
input::placeholder, textarea::placeholder { color: var(--label-3); }
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 2px var(--tint); }
input[type=search] { background: var(--fill-3); box-shadow: none; }
textarea { min-height: 120px; resize: vertical; line-height: 1.35; }
label.field { display: block; margin: 12px 0; font-size: .765rem; color: var(--label-2); font-weight: 600; } /* Footnote */
label.field > input, label.field > textarea, label.field > select { margin-top: 6px; font-weight: 400; }

.btn {
  min-height: 44px; border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  font: 600 1rem/1.2 inherit; font-family: inherit; letter-spacing: -.02em;
  background: var(--fill-3); color: var(--tint-text);          /* Standard: grau getönt */
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  text-decoration: none; transition: opacity .15s;
}
.btn.primary { background: var(--tint); color: #fff; }        /* prominent: max. 1–2 pro Ansicht */
.btn.danger { background: transparent; color: var(--red-text); }
.btn.block { width: 100%; margin-top: 10px; }
.btn.big { min-height: 50px; font-size: 1.059rem; }
.btn:active { opacity: .55; }
.btn:disabled { opacity: .4; }
.link {
  min-height: 44px; border: 0; background: none; cursor: pointer; padding: 0 4px;
  color: var(--tint-text); font: 400 1rem inherit; font-family: inherit; letter-spacing: -.02em;
}
.link.strong { font-weight: 600; }
.link:active { opacity: .5; }

.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }
.toolbar { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 180px; }
.card { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 14px 16px; }
.empty { text-align: center; color: var(--label-2); padding: 40px 12px; font-size: 1rem; }
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.sec { font-size: .765rem; line-height: 1.38; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); margin: 22px 16px 7px; }
.sec-row { display: flex; justify-content: space-between; align-items: center; }
.sec-row .sec { margin-bottom: 0; }
.sec-row .link { margin-right: 8px; }
.footnote { color: var(--label-2); font-size: .765rem; text-align: center; margin-top: 24px; }

/* Segmented Control */
.seg {
  display: flex; padding: 2px; margin: 0 0 14px; border-radius: 9px;
  background: var(--fill-3);
}
.seg button {
  flex: 1 1 0; min-height: 32px; border: 0; background: none; cursor: pointer; border-radius: 7px;
  color: var(--label); font: 500 .765rem/1 inherit; font-family: inherit; letter-spacing: -.01em;
  transition: background .2s;
}
.seg button.active { background: var(--seg-selected); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
.seg-body { min-height: 40vh; }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.chip {
  min-height: 34px; border: 0; border-radius: 17px; padding: 6px 13px; cursor: pointer;
  background: var(--bg-elevated); color: var(--label); font: .882rem inherit; font-family: inherit;
  box-shadow: inset 0 0 0 .5px var(--separator);
}
.chip.on { background: var(--tint); color: #fff; box-shadow: none; }

/* Gruppierte Liste (Inset Grouped) */
.list-card { background: var(--bg-elevated); border-radius: var(--radius-card); overflow: hidden; }
.list-row { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 10px 16px; position: relative; }
.list-row + .list-row::before { content: ''; position: absolute; top: 0; right: 0; left: 52px; border-top: .5px solid var(--separator); }
.list-row .ico, .list-row > .ico { font-size: 1.4rem; width: 28px; text-align: center; flex: none; }
.list-row .t { font-weight: 500; }
.list-row.tap { width: 100%; border: 0; background: none; color: var(--label); text-align: left; font: inherit; cursor: pointer; }
.list-row.tap:active { background: var(--fill-3); }
.list-row.add .t { color: var(--tint-text); font-weight: 400; }
.list-row b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { color: var(--label-3); font-size: 1.3rem; font-weight: 600; }

/* ───────── Einkaufsliste (Kacheln) ───────── */
.addbar { display: flex; gap: 8px; margin: 0 0 8px; }
.addbar input { flex: 1; }
.round { width: 44px; min-height: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 1.5rem; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tile {
  aspect-ratio: 1; border: 0; border-radius: 16px; background: var(--tint); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px; cursor: pointer; font-family: inherit;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .12s var(--ease);
}
.tile:active { transform: scale(.95); }
.tile .em { font-size: 34px; line-height: 1.1; }
.tile .nm { font-size: .765rem; font-weight: 600; text-align: center; line-height: 1.2; word-break: break-word; letter-spacing: 0; }
.tile .sp { font-size: .706rem; opacity: .92; text-align: center; }
.tile.done { background: var(--bg-elevated); color: var(--label-2); box-shadow: inset 0 0 0 .5px var(--separator); }
.tile.done .em { filter: grayscale(.7); opacity: .75; }

/* ───────── Rezepte ───────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rcard { border: 0; padding: 0; background: var(--bg-elevated); border-radius: 14px; overflow: hidden; text-align: left; color: var(--label); cursor: pointer; font-family: inherit; }
.rcard:active { opacity: .7; }
.rimg { aspect-ratio: 4/3; background: var(--tint-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.rtitle { font-weight: 600; padding: 8px 10px 0; font-size: .882rem; line-height: 1.25; }
.rmeta { font-size: .706rem; color: var(--label-2); padding: 2px 10px 10px; }
.hero { aspect-ratio: 16/9; border-radius: 14px; background: var(--tint-soft) center/cover no-repeat; margin: 6px 0 4px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fill-3); color: var(--tint-text); font-size: 1.3rem; cursor: pointer; }
.stepper b { min-width: 24px; text-align: center; font-size: 1.06rem; }
.ings { list-style: none; padding: 0; margin: 0; background: var(--bg-tertiary); border-radius: var(--radius-card); overflow: hidden; }
.ings li + li { border-top: .5px solid var(--separator); }
.ings label { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 14px; cursor: pointer; }
.ings input { width: 22px; height: 22px; min-height: 0; accent-color: var(--tint); flex: none; box-shadow: none; }
.ings .q { font-weight: 600; min-width: 64px; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 12px; line-height: 1.45; }
.cook {
  position: fixed; inset: 0; z-index: 60; background: var(--bg-grouped); display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 8px) 20px calc(env(safe-area-inset-bottom) + 16px);
}
.cook-head { display: flex; justify-content: space-between; align-items: center; }
.cook-step { flex: 1; overflow: auto; display: flex; align-items: center; font-size: 1.65rem; line-height: 1.4; padding: 12px 0; }
.cook-nav { display: flex; gap: 10px; }
.cook-nav .btn { flex: 1; min-height: 56px; font-size: 1.06rem; }
.progress { height: 4px; background: var(--fill); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--tint); transition: width .2s; }

/* ───────── Wir ───────── */
.love-card {
  background: linear-gradient(135deg, #d92d3a, #e8603c 60%, #e98a2b);
  color: #fff; border-radius: 20px; padding: 26px 20px; text-align: center;
}
.love-card .names { font-size: 1.18rem; font-weight: 600; }
.love-card .big { font-size: 4.2rem; font-weight: 700; line-height: 1; margin: 12px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.love-card .lbl { font-size: 1rem; }
.love-card .ymd { margin-top: 12px; font-weight: 600; background: rgba(0,0,0,.18); display: inline-block; padding: 6px 14px; border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stats div { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 12px 6px; text-align: center; }
.stats b { display: block; font-size: 1.06rem; font-variant-numeric: tabular-nums; }
.stats span { font-size: .706rem; color: var(--label-2); }

/* Zeichnen */
.canvas-wrap { display: flex; justify-content: center; }
#cv { background: #fff; border-radius: 14px; touch-action: none; display: block; box-shadow: 0 0 0 .5px var(--separator); }
.palette { display: flex; gap: 6px; justify-content: center; margin: 12px 0 8px; flex-wrap: wrap; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--bg-grouped); box-shadow: 0 0 0 1px var(--separator); cursor: pointer; padding: 0; font-size: 1rem; background: var(--bg-elevated); }
.sw.active { box-shadow: 0 0 0 3px var(--tint); }
.drawbar { display: flex; gap: 8px; align-items: center; }
.drawbar input[type=range] { flex: 1; padding: 0; min-height: 44px; accent-color: var(--tint); background: none; box-shadow: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.gitem { position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--bg-elevated); cursor: pointer; font-family: inherit; }
.gitem img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #fff; }
.gitem .gfrom { display: block; font-size: .706rem; color: var(--label-2); padding: 4px 6px; text-align: left; }
.gitem .new { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font-size: .647rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.bigimg { width: 100%; border-radius: 12px; background: #fff; display: block; }

/* ───────── Kalender ───────── */
.ev {
  display: flex; gap: 12px; align-items: center; width: 100%; min-height: 60px;
  border: 0; background: var(--bg-elevated); color: var(--label); border-radius: var(--radius-card);
  padding: 10px 14px; margin-bottom: 8px; text-align: left; cursor: pointer; font-family: inherit; font-size: 1rem;
}
.ev:active { opacity: .7; }
.evdate { width: 48px; flex: none; text-align: center; border-radius: 10px; background: var(--tint-soft); padding: 4px 0; }
.evdate b { display: block; font-size: 1.18rem; color: var(--tint-text); line-height: 1.1; }
.evdate span { font-size: .647rem; text-transform: uppercase; color: var(--tint-text); font-weight: 600; }
.evt { font-weight: 600; }
.ev.past { opacity: .6; }

/* ───────── Essensplan ───────── */
.weeknav { display: flex; align-items: center; justify-content: space-between; text-align: center; margin-bottom: 10px; }
.weeknav .icon-btn { font-size: 1.5rem; }
.day { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 6px 14px 10px; margin-bottom: 8px; }
.day.today { box-shadow: inset 0 0 0 2px var(--tint); }
.day.past { opacity: .6; }
.day-head { display: flex; align-items: center; gap: 8px; }
.day-head .link { margin-left: auto; font-size: .882rem; }
.meal { display: flex; align-items: center; gap: 10px; margin-top: 6px; width: 100%; min-height: 44px; border: 0; background: none; padding: 0; text-align: left; color: var(--label); font-family: inherit; font-size: .941rem; cursor: pointer; }
.meal.pick { background: var(--bg-tertiary); border-radius: 12px; padding: 6px; }
.meal-img { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--tint-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.meal-body { flex: 1; min-width: 0; line-height: 1.25; }
.meal-body .muted { font-size: .706rem; }
.x { width: 44px; height: 44px; border: 0; background: none; color: var(--label-3); font-size: 1rem; cursor: pointer; flex: none; }
.daygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daygrid-week { grid-column: 1 / -1; font-size: .706rem; color: var(--label-2); font-weight: 600; margin-top: 8px; }
.dchip { min-height: 48px; border: 0; background: var(--bg-tertiary); color: var(--label); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-family: inherit; position: relative; }
.dchip span { font-size: .647rem; color: var(--label-2); }
.dchip b { font-size: 1rem; }
.dchip.busy::after { content: ''; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--tint); }
.dchip:active { background: var(--tint); color: #fff; }

/* ───────── Wunschliste ───────── */
.sum-card, .budget-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.sum-card > div, .budget-sum > div { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 10px 6px; text-align: center; }
.sum-card span, .budget-sum span { display: block; font-size: .706rem; }
.sum-card b, .budget-sum b { font-size: .941rem; font-variant-numeric: tabular-nums; }
.wish { display: flex; align-items: center; gap: 12px; background: var(--bg-elevated); border-radius: var(--radius-card); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.wish.bought { opacity: .6; }
.wish.bought .wish-title { text-decoration: line-through; }
.wish-img { width: 64px; height: 64px; flex: none; border-radius: 10px; background: var(--bg-tertiary) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.wish-body { flex: 1; min-width: 0; }
.wish-title { font-weight: 600; }
.wish-price { font-weight: 600; color: var(--tint-text); margin-top: 2px; }
.check { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--separator); background: none; color: transparent; font-size: 1rem; font-weight: 700; cursor: pointer; }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ───────── Finanzen ───────── */
.money-card { background: linear-gradient(135deg, #1f4e6b, #43386b); color: #fff; border-radius: 20px; padding: 16px 20px 18px; }
.money-total { font-size: 2.35rem; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.money-diff { font-size: .882rem; }
.spark { width: 100%; height: 56px; margin-top: 8px; display: block; }
.eye { width: 44px; height: 44px; border: 0; background: rgba(255,255,255,.18); border-radius: 50%; font-size: 1rem; cursor: pointer; }
.bar { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.bar.big { height: 8px; }
.bar > div { height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
.pos { color: var(--green-text); }
.neg { color: var(--red-text); }

/* ───────── Dokumente ───────── */
.doc-thumb {
  width: 44px; height: 56px; flex: none; border-radius: 6px; background: var(--bg-tertiary) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: var(--red-text);
  box-shadow: inset 0 0 0 .5px var(--separator);
}
.doc-thumb:not([style]) { font-size: .706rem; }
.list-row .doc-thumb + div { padding-left: 0; }
.exp { font-size: .765rem; margin-top: 2px; }
.exp.ok { color: var(--label-2); }
.exp.warn { color: var(--orange-text); font-weight: 600; }
.exp.bad { color: var(--red-text); font-weight: 600; }
.notice { display: flex; gap: 10px; background: var(--bg-elevated); border-radius: var(--radius-card); padding: 12px 14px; margin-bottom: 4px; font-size: .882rem; box-shadow: inset 4px 0 0 var(--orange-text); }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.page { margin: 12px 0; }
.page img { width: 100%; border-radius: 12px; display: block; background: #fff; cursor: zoom-in; box-shadow: 0 0 0 .5px var(--separator); }
.page-load { padding: 28px 12px; text-align: center; color: var(--label-2); background: var(--bg-tertiary); border-radius: 12px; font-size: .882rem; }
.pdf-row { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 64px; border: 0; border-radius: 12px; background: var(--bg-tertiary); color: var(--label); padding: 10px 14px; text-align: left; font: inherit; cursor: pointer; }
.pdf-badge { background: var(--red); color: #fff; font-size: .706rem; font-weight: 700; border-radius: 6px; padding: 8px 6px; }
.note { background: var(--bg-tertiary); border-radius: 12px; padding: 10px 14px; white-space: pre-wrap; }
.fullimg { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.fullimg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fullimg .close-x { position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 8px; }
.lock { text-align: center; padding: 30px 8px; max-width: 360px; margin: 0 auto; }
.lock-icon { font-size: 52px; }
.pin { text-align: center; font-size: 1.6rem; letter-spacing: .4em; }

/* ───────── Sheets ───────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0);
  transition: background .3s; display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop.open { background: rgba(0,0,0,.35); }
.sheet {
  position: relative; width: 100%; max-width: 760px; max-height: 94dvh; overflow: auto;
  background: var(--bg-elevated); border-radius: 14px 14px 0 0;
  padding: 6px 16px calc(env(safe-area-inset-bottom) + 20px);
  transform: translateY(100%); transition: transform .35s var(--ease);
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sheet.full { height: 94dvh; }
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 4px; }
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  position: sticky; top: -6px; z-index: 2; background: var(--bg-elevated); margin: 0 -16px; padding: 0 12px;
  touch-action: none;
}
.sheet-head > :first-child { justify-self: start; }
.sheet-head > :last-child { justify-self: end; }
.sheet-head > b { font-size: 1rem; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.close-x {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 7px;
}
.close-x svg { width: 30px; height: 30px; padding: 8px; border-radius: 50%; background: var(--fill-3); stroke: var(--label-2); stroke-width: 3; stroke-linecap: round; fill: none; }
.sheet > h2:first-of-type { margin-right: 44px; }
.sheet input, .sheet textarea, .sheet select { background: var(--bg-tertiary); box-shadow: none; }
.sheet input:focus, .sheet textarea:focus, .sheet select:focus { box-shadow: inset 0 0 0 2px var(--tint); }
.sheet .list-card { background: var(--bg-tertiary); }
.sheet .seg { background: var(--fill-3); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; z-index: 90; white-space: nowrap;
  background: var(--glass-bg); color: var(--label); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  padding: 10px 18px; border-radius: 22px; font-size: .882rem; font-weight: 600; transition: opacity .25s, transform .25s var(--ease);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───────── Barrierefreiheit ───────── */
/* Reduce Transparency: Glas wird deckend */
@media (prefers-reduced-transparency: reduce) {
  #tabbar, #topbar.scrolled, #toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg-elevated); }
}
/* Reduce Motion: Bewegung durch Überblenden ersetzen */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .sheet { transform: none !important; opacity: 0; transition: opacity .2s !important; }
  .sheet-backdrop.open .sheet { opacity: 1; }
  .tile:active { transform: none; }
  #toast { transform: translateX(-50%); }
}

/* ───────── Reisen ───────── */
.trip {
  display: flex; align-items: center; gap: 12px; width: 100%; position: relative;
  border: 0; background: var(--bg-elevated); color: var(--label); border-radius: var(--radius-card);
  padding: 12px 14px; margin-bottom: 8px; text-align: left; font: inherit; cursor: pointer;
}
.trip:active { opacity: .7; }
.trip.past { opacity: .6; }
.trip.now { box-shadow: inset 0 0 0 2px var(--green); }
.trip-emoji { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--tint-soft); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.trip-body { flex: 1; min-width: 0; }
.trip-title { font-weight: 600; }
.trip-badge { display: block; font-size: .706rem; font-weight: 600; color: var(--tint-text); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 1px; }
.trip.now .trip-badge { color: var(--green-text); }
.trip-hero { display: flex; gap: 14px; align-items: center; margin: 10px 0; }
.trip-hero > span { font-size: 44px; width: 68px; height: 68px; border-radius: 18px; background: var(--tint-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.check-row .check { width: 36px; height: 36px; font-size: .9rem; }
.check-row.is-done .t { text-decoration: line-through; color: var(--label-2); }

/* ───────── Bestätigung (Action Sheet) ───────── */
.ask-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0); transition: background .25s; display: flex; align-items: flex-end; justify-content: center; padding: 0 8px calc(env(safe-area-inset-bottom) + 8px); }
.ask-backdrop.open { background: rgba(0,0,0,.4); }
.ask { width: 100%; max-width: 420px; transform: translateY(110%); transition: transform .3s var(--ease); }
.ask-backdrop.open .ask { transform: translateY(0); }
.ask-group { background: var(--glass-bg); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.ask-msg { padding: 14px 16px; text-align: center; color: var(--label-2); font-size: .765rem; display: flex; flex-direction: column; gap: 4px; border-bottom: .5px solid var(--separator); }
.ask-msg b { font-weight: 600; }
.ask-btn { display: block; width: 100%; min-height: 56px; border: 0; background: none; color: var(--tint-text); font: 400 1.06rem inherit; font-family: inherit; cursor: pointer; }
.ask-btn.destructive { color: var(--red-text); }
.ask-btn.cancel { background: var(--bg-elevated); border-radius: 14px; font-weight: 600; }
.ask-btn:active { background: var(--fill-3); }
@media (prefers-reduced-transparency: reduce) { .ask-group { background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { .ask { transform: none !important; opacity: 0; transition: opacity .2s !important; } .ask-backdrop.open .ask { opacity: 1; } }

/* ───────── Eigene Listen ───────── */
.list-emoji { width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--tint-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.list-row .list-emoji + div { margin-left: 2px; }
.count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--fill-3); color: var(--label-2); font-size: .765rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.item-text { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; padding: 4px 0; text-align: left; color: var(--label); font: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.check-row.is-done .item-text .t { text-decoration: line-through; color: var(--label-2); }

/* ───────── Filme & Serien ───────── */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 10px; }
.poster { border: 0; background: none; padding: 0; text-align: left; color: var(--label); font: inherit; cursor: pointer; min-width: 0; }
.poster:active { opacity: .7; }
.poster-img {
  aspect-ratio: 2 / 3; border-radius: 10px; background: linear-gradient(160deg, #3a3a5a, #1d1d2b) center/cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; color: #fff; text-align: center;
  box-shadow: 0 0 0 .5px var(--separator); overflow: hidden;
}
.poster-img span { font-size: 30px; }
.poster-img b { font-size: .765rem; line-height: 1.2; font-weight: 600; }
.poster-img.small { width: 64px; flex: none; font-size: 24px; }
.poster-img.big { width: 150px; margin: 0 auto 12px; font-size: 40px; }
.poster-title { font-size: .765rem; font-weight: 600; margin-top: 6px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.poster-meta { font-size: .706rem; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-stars { font-size: .706rem; color: #c98a00; letter-spacing: 1px; }
.movie-hero { display: flex; gap: 14px; margin: 12px 0; }
.movie-hero .poster-img { width: 110px; flex: none; }
.service { display: inline-block; background: var(--fill-3); border-radius: 6px; padding: 3px 8px; font-size: .765rem; font-weight: 600; }
.rate { display: flex; }
.star { width: 36px; height: 44px; border: 0; background: none; font-size: 1.4rem; color: var(--fill); cursor: pointer; padding: 0; }
.star.on { color: #f5b300; }
.pick-card { text-align: center; }

/* ───────── Kalender: Quellen ───────── */
.ev { box-shadow: inset 4px 0 0 var(--src, var(--tint)); }
.ev .evdate { background: color-mix(in srgb, var(--src, var(--tint)) 14%, transparent); }
.ev .evdate b, .ev .evdate span { color: var(--label); }
.ev.is-today { box-shadow: inset 4px 0 0 var(--src, var(--tint)), inset 0 0 0 2px color-mix(in srgb, var(--tint) 50%, transparent); }
.src-tag { flex: none; font-size: .647rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--label-2);
  padding: 3px 7px; border-radius: 6px; background: color-mix(in srgb, var(--src, var(--tint)) 14%, transparent); }
.chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--src); opacity: .35; vertical-align: 1px; }
.chip.on-src { box-shadow: inset 0 0 0 1.5px var(--src); font-weight: 600; }
.chip.on-src .dot { opacity: 1; }
.cal-status { margin: 0 4px 6px; }
.cal-status .link { min-height: 0; font-size: inherit; }
.cal-row input { min-height: 36px; padding: 6px 10px; background: transparent !important; font-weight: 600; }
.cal-url { font-size: .647rem; padding-left: 10px; word-break: break-all; }
.cal-color { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 0 0 8px transparent; }
.howto { background: var(--bg-tertiary); border-radius: 12px; padding: 10px 14px; margin: 14px 0; }
.howto summary { font-weight: 600; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.howto ol { padding-left: 20px; margin: 8px 0; }
.howto li { margin: 4px 0; }

/* ───────── Rezept-Ordner ───────── */
.folders { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -16px 2px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.folders::-webkit-scrollbar { display: none; }
.folders .chip { flex: none; white-space: nowrap; }
.chip .n { font-size: .706rem; opacity: .7; margin-left: 2px; font-variant-numeric: tabular-nums; }
.chip.add-chip { color: var(--tint-text); background: transparent; box-shadow: inset 0 0 0 1px var(--separator); }
.chip.static { cursor: default; font-size: .765rem; min-height: 28px; padding: 4px 10px; }
.folder-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }

/* ───────── Essensplan-Notizen ───────── */
.week-note { display: block; width: 100%; text-align: left; border: 0; background: var(--bg-elevated); border-radius: var(--radius-card); padding: 12px 14px; margin-bottom: 10px; font: inherit; color: var(--label); cursor: pointer; min-height: 44px; }
.week-note.has { box-shadow: inset 4px 0 0 #f5b300; }
.week-note .note-label { display: block; font-size: .706rem; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.week-note .note-text, .day-note { white-space: pre-wrap; }
.week-note .note-add { color: var(--tint-text); }
.day-note { display: block; width: 100%; text-align: left; border: 0; border-radius: 10px; background: color-mix(in srgb, #f5b300 14%, transparent); color: var(--label); padding: 8px 10px; margin: 4px 0 2px; font: inherit; font-size: .882rem; cursor: pointer; }
.day-head .note-link { margin-left: auto; font-size: .882rem; color: var(--label-2); }
.day-head .note-link + .link { margin-left: 8px; }
.meal-note { font-size: .765rem; color: var(--label-2); font-style: italic; margin-top: 1px; }

/* Zeichnungen: Restlaufzeit */
.gitem .gleft { display: block; font-size: .647rem; color: var(--label-2); padding: 0 6px 5px; text-align: left; }

/* ───────── Frage des Tages ───────── */
.q-card { background: linear-gradient(135deg, #6a3df0, #b04fd8 65%, #e0538c); color: #fff; border-radius: 20px; padding: 18px 20px 20px; margin-bottom: 14px; }
.q-date { font-size: .706rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.q-card .q-text, .q-text { font-size: 1.35rem; line-height: 1.3; font-weight: 700; margin-top: 8px; }
.q-streak { margin-top: 12px; display: inline-block; background: rgba(0,0,0,.2); border-radius: 999px; padding: 5px 12px; font-size: .882rem; font-weight: 600; }
.q-hint { margin: 4px 4px 8px; }
.q-answer { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 12px 14px; margin-bottom: 8px; white-space: pre-wrap; position: relative; }
.q-answer.mine { box-shadow: inset 4px 0 0 #8a4fe0; }
.q-answer.waiting { opacity: .8; }
.q-answer .link { position: absolute; top: 2px; right: 8px; font-size: .882rem; }
.q-who { font-size: .765rem; font-weight: 700; color: var(--label-2); margin-bottom: 2px; }
.q-past { background: var(--bg-elevated); border-radius: var(--radius-card); padding: 10px 14px; margin-bottom: 8px; }
.q-past .q-date { color: var(--label-2); }
.q-past-q { font-weight: 600; margin: 4px 0 6px; }
.q-past-a { font-size: .882rem; margin-top: 2px; white-space: pre-wrap; }

/* ───────── Mitteilungen: Schalter im iOS-Stil ───────── */
input.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; min-height: 0; padding: 0; border-radius: 16px; background: var(--fill); position: relative; cursor: pointer; flex: none; box-shadow: none; transition: background .2s; }
input.switch::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 .2s var(--ease); }
input.switch:checked { background: var(--green); }
input.switch:checked::after { transform: translateX(20px); }
.push-box .card { margin-bottom: 8px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--fill-3); padding: 1px 5px; border-radius: 5px; }
