/* Farben und Maße orientieren sich an den semantischen Farben der Apple Human Interface Guidelines. */
:root {
  color-scheme: light dark;
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --fill: rgba(120, 120, 128, .12);
  --fill-strong: rgba(120, 120, 128, .22);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .78);
  --label-3: rgba(60, 60, 67, .45);
  --separator: rgba(60, 60, 67, .22);
  --tint: #CC4A00;
  --on-tint: #FFFFFF;
  --tint-soft: rgba(204, 74, 0, .12);
  --red: #D70015;
  --green: #248A3D;
  --glass: rgba(255, 255, 255, .68);
  --glass-edge: rgba(255, 255, 255, .75);
  --shadow-float: 0 10px 34px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
  --radius-group: 22px;
  --gutter: 16px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --keyboard: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-raised: #2C2C2E;
    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, .72);
    --label-3: rgba(235, 235, 245, .4);
    --separator: rgba(84, 84, 88, .65);
    --tint: #FF9F0A;
    --on-tint: #000000;
    --tint-soft: rgba(255, 159, 10, .18);
    --red: #FF453A;
    --green: #30D158;
    --glass: rgba(44, 44, 46, .62);
    --glass-edge: rgba(255, 255, 255, .14);
    --shadow-float: 0 10px 34px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; height: 100%; }
@supports (font: -apple-system-body) {
  @media (pointer: coarse) { html { font: -apple-system-body; } }
}
body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font); font-size: 1rem; line-height: 1.3;
  color: var(--label); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
a { color: var(--tint); }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.icon { display: inline-flex; width: 1.3em; height: 1.3em; flex: none; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }

/* Seiten und Navigation */
#app { position: fixed; inset: 0; overflow: hidden; }
.page {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior-y: contain;
  background: var(--bg); -webkit-overflow-scrolling: touch;
}
.page-enter-push { animation: enter-push .36s var(--ease); z-index: 2; }
.page-exit-push { animation: exit-push .36s var(--ease) forwards; z-index: 1; }
.page-enter-pop { animation: enter-pop .36s var(--ease); z-index: 1; }
.page-exit-pop { animation: exit-pop .36s var(--ease) forwards; z-index: 2; }
@keyframes enter-push { from { transform: translateX(100%); } }
@keyframes exit-push { to { transform: translateX(-28%); filter: brightness(.9); } }
@keyframes enter-pop { from { transform: translateX(-28%); filter: brightness(.9); } }
@keyframes exit-pop { to { transform: translateX(100%); } }

.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); align-items: center; gap: 8px;
  min-height: calc(52px + var(--safe-top));
  padding: calc(var(--safe-top) + 6px) var(--gutter) 6px;
  transition: background-color .2s, box-shadow .2s;
}
.navbar.scrolled, .navbar.always {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 .5px 0 var(--separator);
}
.nav-title {
  font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .18s;
}
.navbar.scrolled .nav-title, .navbar.always .nav-title { opacity: 1; }
.nav-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-side.right { justify-content: flex-end; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 20px;
  color: var(--tint); background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), 0 1px 6px rgba(0, 0, 0, .08);
  white-space: nowrap;
}
.nav-btn:active { transform: scale(.94); }
.page-body {
  max-width: 720px; margin: 0 auto;
  padding: 0 var(--gutter) calc(112px + var(--safe-bottom));
}
.page-body.no-tabs { padding-bottom: calc(40px + var(--safe-bottom)); }
.large-title { font-size: 2rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 14px; overflow-wrap: anywhere; }
.lead { color: var(--label-2); margin: -8px 0 16px; }

.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(max(var(--safe-bottom), 12px) + 2px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  width: min(calc(100% - 40px), 380px); padding: 4px; border-radius: 34px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), var(--shadow-float);
}
body.keyboard-open .tabbar { display: none; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 54px; border-radius: 28px; color: var(--label); font-size: .62rem; font-weight: 500;
  transition: background-color .2s, color .2s;
}
.tab .icon { font-size: 1.15rem; }
.tab.active { color: var(--tint); background: var(--fill); font-weight: 600; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; line-height: 18px; font-weight: 600; text-align: center;
}

/* Listen */
.group { margin-bottom: 26px; }
.group-title { font-size: 1.18rem; font-weight: 700; margin: 0 4px 8px; }
.group-footer { font-size: .8rem; color: var(--label-2); margin: 8px 16px 0; }
.group-body { background: var(--surface); border-radius: var(--radius-group); overflow: hidden; }
.sheet .group-body { background: var(--surface-raised); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px;
  padding: 10px 16px; text-align: left; position: relative;
}
.group-body > * + * { box-shadow: inset 0 .5px 0 var(--separator); }
button.row:active, a.row:active { background: var(--fill); }
a.row { color: inherit; text-decoration: none; }
.row-text { flex: 1; min-width: 0; }
.row-title { overflow-wrap: anywhere; }
.row-sub { font-size: .8rem; color: var(--label-2); margin-top: 2px; overflow-wrap: anywhere; }
.row-right { color: var(--label-2); display: flex; align-items: center; gap: 6px; flex: none; }
.row.destructive { color: var(--red); }
.row.tinted { color: var(--tint); }
.chevron { color: var(--label-3); font-size: .78rem; }

.thumb {
  width: 60px; height: 60px; border-radius: 13px; object-fit: cover; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--fill); font-size: 1.5rem; color: var(--label-3);
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--label-2); margin-top: 3px; }
.meta span { display: inline-flex; align-items: center; gap: 3px; }

/* Kochbücher als Buchcover */
.c-orange { --book: #B8500A; } .c-red { --book: #B8232C; } .c-pink { --book: #B9235A; }
.c-purple { --book: #7B3FA0; } .c-indigo { --book: #4A47B8; } .c-blue { --book: #0B63C5; }
.c-teal { --book: #0E7680; } .c-green { --book: #2B7A3D; } .c-brown { --book: #7D5A3C; } .c-gray { --book: #5F6368; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 14px; margin-bottom: 28px; }
.book {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 5 / 6; width: 100%; padding: 14px 14px 13px 24px;
  border-radius: 6px 16px 16px 6px; color: #fff; text-align: left; text-decoration: none; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%), var(--book);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .25s var(--ease);
}
.book::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 13px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .08) 70%, rgba(255, 255, 255, .18) 92%, rgba(0, 0, 0, .12));
}
.book:active { transform: scale(.96); }
.book-emoji { font-size: 2.6rem; line-height: 1.1; }
.book-name { margin-top: auto; font-size: 1.06rem; font-weight: 700; line-height: 1.18; letter-spacing: -.01em; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-count { font-size: .76rem; opacity: .9; margin-top: 3px; }
.book-tag { position: absolute; top: 12px; right: 10px; display: inline-flex; padding: 5px; border-radius: 50%; background: rgba(0, 0, 0, .24); font-size: .68rem; }
.book.add {
  background: none; color: var(--tint); box-shadow: inset 0 0 0 1.5px var(--fill-strong);
  align-items: center; justify-content: center; gap: 6px; font-weight: 600; padding: 14px; font-size: .9rem;
}
.book.add::before { display: none; }
.book.add .icon { font-size: 1.5rem; }

.suggest-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; margin-bottom: 26px;
  border-radius: var(--radius-group); background: var(--surface); text-align: left;
}
.suggest-card:active { background: var(--fill); }
.die { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 13px; background: var(--tint); color: var(--on-tint); font-size: 1.3rem; flex: none; }
.suggest-title { font-weight: 600; }
.suggest-sub { font-size: .82rem; color: var(--label-2); margin-top: 1px; }

.search { position: relative; margin-bottom: 18px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--label-2); font-size: .85rem; pointer-events: none; }
.search input { width: 100%; height: 42px; border: 0; border-radius: 21px; padding: 0 16px 0 36px; background: var(--fill); font-size: 1rem; outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--label-2); opacity: 1; }

/* Rezept */
.hero { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; margin-bottom: 16px; }
.recipe-desc { color: var(--label-2); margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--fill); font-size: .85rem; color: var(--label); text-decoration: none; }
.notice { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--fill); color: var(--label-2); font-size: .87rem; margin-bottom: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 8px; min-height: 36px; }
.section-head .group-title { margin: 0; }
.ing { display: flex; gap: 12px; padding: 12px 16px; align-items: baseline; }
.ing-qty { flex: 0 0 5.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ing-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.steps { list-style: none; margin: 0 0 26px; padding: 0; }
.step { display: flex; gap: 12px; margin-bottom: 16px; line-height: 1.42; }
.step-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-soft); color: var(--tint); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.step-text { flex: 1; min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 0 20px;
  border-radius: 25px; font-weight: 600; background: var(--tint); color: var(--on-tint); text-align: center;
  transition: transform .15s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.secondary { background: var(--tint-soft); color: var(--tint); }
.btn.plain { background: none; color: var(--tint); font-weight: 500; }
.btn + .btn { margin-top: 10px; }
.mb { margin-bottom: 26px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 14px 8px; background: var(--surface); }
.tile { text-align: center; min-width: 0; }
.tile-value { font-size: 1.12rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-label { font-size: .68rem; color: var(--label-2); margin-top: 1px; overflow-wrap: anywhere; }

/* Steuerelemente */
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 18px; height: 36px; }
.stepper button { width: 44px; height: 36px; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; color: var(--label); }
.stepper .value { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper.large { height: 52px; border-radius: 26px; }
.stepper.large button { width: 68px; height: 52px; font-size: 1.5rem; color: var(--tint); }
.stepper.large .value { min-width: 56px; font-size: 1.4rem; }
.stepper-center { display: flex; justify-content: center; margin: 2px 0 6px; }
.stepper-caption { text-align: center; color: var(--label-2); font-size: .85rem; margin-bottom: 20px; }

.segmented { display: flex; padding: 2px; border-radius: 18px; background: var(--fill); margin-bottom: 14px; }
.segmented button { flex: 1; min-height: 36px; border-radius: 16px; font-size: .84rem; font-weight: 500; padding: 0 8px; }
.segmented button.active { background: var(--surface-raised); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--fill); font-size: .85rem; white-space: nowrap; }
.chip.active { background: var(--tint); color: var(--on-tint); font-weight: 600; }

.switch { appearance: none; -webkit-appearance: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--fill-strong); cursor: pointer; transition: background-color .22s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

.input-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; }
.input-row label { flex: 0 0 auto; min-width: 5.5rem; }
.input-row input, .input-row select { flex: 1; min-width: 0; width: 100%; height: 48px; border: 0; background: none; outline: 0; font-size: max(1rem, 16px); text-align: left; }
.block-input { display: block; width: 100%; border: 0; background: none; outline: 0; padding: 14px 16px; font-size: max(1rem, 16px); line-height: 1.35; resize: vertical; }
.group-body:has(.block-input:focus-visible, .input-row :focus-visible) { box-shadow: 0 0 0 2px var(--tint); }

.photo-pick { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-group); background: var(--surface-raised); color: var(--tint); overflow: hidden; margin-bottom: 12px; font-weight: 500; }
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-pick .icon { font-size: 1.6rem; }

.ing-edit { padding: 8px 8px 8px 12px; }
.ing-edit-grid { display: grid; grid-template-columns: 3.7rem 5rem minmax(0, 1fr) 36px; gap: 6px; align-items: center; }
.ing-edit input, .ing-edit select { width: 100%; height: 42px; border: 0; border-radius: 12px; background: var(--fill); padding: 0 8px; font-size: 16px; outline-offset: 0; min-width: 0; }
.icon-btn { width: 36px; height: 42px; display: flex; align-items: center; justify-content: center; color: var(--label-2); font-size: .85rem; }
.food-suggest { list-style: none; margin: 6px 36px 2px 0; padding: 4px; border-radius: 16px; background: var(--fill); }
.food-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 12px; cursor: pointer; }
.food-option[aria-selected="true"], .food-option:hover { background: var(--fill-strong); }
.food-option-text { flex: 1; min-width: 0; }
.food-option-name { overflow-wrap: anywhere; }
.food-option-sub { font-size: .74rem; color: var(--label-2); margin-top: 1px; }
.food-option-kcal { flex: none; font-size: .78rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.food-option.create { color: var(--tint); font-weight: 500; }
.food-option.create .icon { font-size: .85rem; }
.ing-nutri { display: flex; align-items: center; gap: 4px; min-height: 30px; margin-top: 4px; font-size: .78rem; color: var(--tint); text-align: left; }
.ing-nutri.unset { color: var(--label-2); }

/* Einkaufsliste */
.add-item { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; min-height: 52px; background: var(--surface); border-radius: var(--radius-group); margin-bottom: 18px; }
.add-item .plus { color: var(--tint); font-size: 1.05rem; }
.add-item input { flex: 1; min-width: 0; height: 50px; border: 0; background: none; outline: 0; font-size: max(1rem, 16px); }
.add-item button { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--tint); color: var(--on-tint); font-size: .85rem; font-weight: 600; }
.swipe { position: relative; overflow: hidden; }
.swipe-delete { position: absolute; inset: 0 0 0 auto; width: 84px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.item-row { position: relative; display: flex; align-items: center; gap: 4px; min-height: 54px; padding-right: 16px; background: var(--surface); touch-action: pan-y; transition: transform .25s var(--ease); }
.item-row.dragging { transition: none; }
.check { flex: none; width: 52px; height: 54px; display: flex; align-items: center; justify-content: center; }
.check i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--label-3); display: flex; align-items: center; justify-content: center; color: transparent; font-size: .72rem; transition: background-color .15s; }
.check.on i { background: var(--tint); box-shadow: none; color: var(--on-tint); }
.item-main { flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 6px 0; }
.item-name { overflow-wrap: anywhere; }
.item-source { font-size: .76rem; color: var(--label-2); margin-top: 1px; }
.item-qty { flex: none; color: var(--label-2); font-variant-numeric: tabular-nums; padding-left: 8px; }
.item-row.done .item-name { text-decoration: line-through; color: var(--label-2); }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--tint); color: var(--on-tint); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; flex: none; }
.avatar.small { width: 36px; height: 36px; font-size: .85rem; background: var(--fill-strong); color: var(--label); }
.profile-name { font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.ring-wrap { display: flex; justify-content: center; padding: 22px 0 8px; background: var(--surface); }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 15; }
.ring-value { fill: none; stroke: var(--tint); stroke-width: 15; stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-number { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-unit { font-size: .78rem; color: var(--label-2); }
.date-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.date-nav .nav-btn { background: var(--fill); box-shadow: none; color: var(--label); }
.date-nav .label { font-weight: 600; min-width: 9.5rem; text-align: center; }

/* Anmeldung */
.auth { max-width: 400px; margin: 0 auto; padding: calc(var(--safe-top) + 7vh) var(--gutter) calc(32px + var(--safe-bottom)); min-height: 100%; }
.auth-icon { width: 84px; height: 84px; border-radius: 19px; margin: 0 auto 18px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.auth .book { width: 130px; margin: 0 auto 18px; }
.auth h1 { font-size: 1.75rem; font-weight: 700; text-align: center; letter-spacing: -.02em; margin-bottom: 8px; overflow-wrap: anywhere; }
.auth p.sub { text-align: center; color: var(--label-2); margin-bottom: 26px; }
.auth .group { margin-bottom: 16px; }
.form-error { color: var(--red); font-size: .87rem; margin: -6px 12px 14px; }

/* Blätter, Dialoge, Hinweise */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .36); animation: fade .25s; }
.backdrop.closing { opacity: 0; transition: opacity .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; left: 50%; bottom: var(--keyboard); transform: translateX(-50%);
  display: flex; flex-direction: column; width: min(100%, 600px);
  max-height: calc(100dvh - var(--keyboard) - var(--safe-top) - 24px);
  background: var(--bg); border-radius: 30px 30px 0 0;
  animation: sheet-in .42s var(--ease); transition: transform .3s var(--ease);
}
.sheet.tall { height: calc(100dvh - var(--keyboard) - var(--safe-top) - 24px); }
.sheet.dragging { transition: none; }
.sheet.closing { transform: translate(-50%, 105%); }
@keyframes sheet-in { from { transform: translate(-50%, 105%); } }
.sheet-head { flex: none; padding: 7px 14px 8px; touch-action: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); margin: 0 auto 8px; }
.sheet-bar { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 8px; min-height: 40px; }
.sheet-title { font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-action { justify-self: start; height: 40px; padding: 0 10px; color: var(--tint); white-space: nowrap; }
.sheet-action.confirm { justify-self: end; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gutter) calc(24px + var(--safe-bottom)); }
.sheet-body .group { margin-bottom: 20px; }

.action-list { position: fixed; z-index: 51; left: 50%; bottom: calc(max(var(--safe-bottom), 10px)); transform: translateX(-50%); width: min(calc(100% - 20px), 420px); animation: sheet-in .36s var(--ease); transition: transform .25s var(--ease); }
.action-list.closing { transform: translate(-50%, 130%); }
.action-group { background: var(--surface-raised); border-radius: 24px; overflow: hidden; margin-bottom: 8px; }
.action-group > * + * { box-shadow: inset 0 .5px 0 var(--separator); }
.action-head { padding: 13px 18px; text-align: center; font-size: .82rem; color: var(--label-2); }
.action-btn { display: block; width: 100%; min-height: 54px; padding: 8px 16px; font-size: 1.04rem; color: var(--tint); }
.action-btn:active { background: var(--fill); }
.action-btn.destructive { color: var(--red); }
.action-btn.cancel { font-weight: 600; }

.alert { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(calc(100% - 64px), 300px); background: var(--surface-raised); border-radius: 26px; padding: 20px 18px 12px; text-align: center; box-shadow: var(--shadow-float); animation: alert-in .24s var(--ease); }
.backdrop.alert-bg { z-index: 60; }
@keyframes alert-in { from { transform: translate(-50%, -50%) scale(1.12); opacity: 0; } }
.alert h2 { font-size: 1rem; font-weight: 700; margin-bottom: 5px; overflow-wrap: anywhere; }
.alert p { font-size: .85rem; color: var(--label); margin-bottom: 14px; overflow-wrap: anywhere; white-space: pre-line; user-select: text; -webkit-user-select: text; }
.alert-actions { display: flex; gap: 8px; }
.alert-actions button { flex: 1; min-height: 44px; border-radius: 22px; background: var(--fill); font-weight: 600; font-size: .92rem; }
.alert-actions button.primary { background: var(--tint); color: var(--on-tint); }
.alert-actions button.destructive { color: var(--red); }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(max(var(--safe-bottom), 12px) + 86px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 40px); padding: 11px 18px; border-radius: 24px; background: var(--glass); -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); box-shadow: inset 0 0 0 .5px var(--glass-edge), var(--shadow-float); font-size: .9rem; font-weight: 500; animation: toast-in .35s var(--ease); }
.toast button { color: var(--tint); font-weight: 600; min-height: 26px; }
.toast.closing { opacity: 0; transition: opacity .2s; }
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } }

/* Leere Zustände und Laden */
.empty { text-align: center; padding: 44px 24px; color: var(--label-2); }
.empty .icon { font-size: 2.3rem; color: var(--label-3); margin-bottom: 10px; }
.empty h2 { font-size: 1.15rem; font-weight: 700; color: var(--label); margin-bottom: 5px; }
.empty .btn { width: auto; display: inline-flex; margin-top: 16px; min-height: 44px; }

/* Vorschlag */
.suggest-stage { min-height: 300px; margin-bottom: 14px; }
.pick { border-radius: 24px; background: var(--surface-raised); overflow: hidden; }
.pick.rolling { animation: roll .4s var(--ease); }
@keyframes roll { 0% { transform: translateX(46px) rotate(2.5deg) scale(.97); opacity: 0; } 100% { transform: none; opacity: 1; } }
.pick-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pick-cover { width: 100%; aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; font-size: 4.2rem; background: linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%), var(--book); }
.pick-text { padding: 14px 16px 16px; }
.pick-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pick-desc { color: var(--label-2); font-size: .9rem; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-text .meta { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  :root { --gutter: 24px; }
  .sheet { bottom: calc(var(--keyboard) + 24px); border-radius: 30px; max-height: calc(100dvh - var(--keyboard) - 64px); }
  .sheet.tall { height: calc(100dvh - var(--keyboard) - 64px); }
}
@media (max-width: 345px) {
  .ing-edit-grid { grid-template-columns: 3.2rem 4.4rem minmax(0, 1fr) 30px; }
  .tile-value { font-size: 1rem; }
}
