/* ---------- Fotos zuschneiden ---------- */
.crop-wrap { position: relative; justify-self: center; align-self: center; width: fit-content; max-width: 100%; margin: 4px auto; overflow: hidden; border-radius: 8px; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-wrap img { display: block; max-width: 100%; max-height: 52vh; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; touch-action: none; }
/* Anfasser innen in den Ecken, damit sie am Bildrand nicht abgeschnitten werden */
.crop-box i { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--accent-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.crop-box i[data-c="nw"] { left: 2px; top: 2px; cursor: nwse-resize; }
.crop-box i[data-c="ne"] { right: 2px; top: 2px; cursor: nesw-resize; }
.crop-box i[data-c="sw"] { left: 2px; bottom: 2px; cursor: nesw-resize; }
.crop-box i[data-c="se"] { right: 2px; bottom: 2px; cursor: nwse-resize; }

/* ---------- Varianten ---------- */
.var-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.var-chips .chip { cursor: pointer; }
.var-chips .chip.ghost { background: transparent; border-style: dashed; color: var(--accent-ink); }
.var-chips .chip svg { width: 14px; height: 14px; vertical-align: -2px; }
.var-sheet textarea { min-height: 0; font-size: 14px; }
.var-sheet .field { margin: 0; }

/* ---------- Nährwerte ---------- */
.naehr { margin: 22px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--tint); }
.naehr .label { margin: 0 0 10px; }
.naehr-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.naehr-row span { display: grid; gap: 2px; font-size: 11.5px; color: var(--muted); }
.naehr-row b { font: 700 22px/1 var(--hand); color: var(--accent-ink); }
.naehr p { margin: 10px 0 0; font-size: 11.5px; }

/* ---------- Küchenjahr ---------- */
.rb-fav { display: flex; align-items: center; gap: 16px; }
.rb-fav div { display: grid; gap: 2px; }
.rb-fav small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rb-fav b { font: 700 30px/1 var(--hand); color: var(--accent-ink); }
.rb-top { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.rb-top li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.rb-top li b { float: right; color: var(--accent-ink); }
div.stat { cursor: default; }

/* ---------- Wochenplan: Wer kocht? ---------- */
.wk-koch { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); font-size: 11px; font-weight: 600; }
.wk-item .koch { opacity: .55; }
.wk-item .koch.on, .wk-item .koch:hover { opacity: 1; color: var(--accent-ink); }

/* ---------- Wochenplan: diese und nächste Woche ---------- */
.w2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
@media (min-width: 1000px) { .w2 { grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; } }
.w2-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font: inherit; }
.w2-title .hand { font-size: 30px; font-weight: 700; color: var(--accent-ink); }
.w2-title small { color: var(--muted); font-size: 13.5px; }
.w2-list { list-style: none; margin: 0; padding: 0; }
.w2 .past { opacity: .5; }
.w2-dish { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.w2-dish img, .w2-ph { flex: none; object-fit: cover; background: var(--tint); display: grid; place-items: center; color: var(--accent-ink); }
.w2-ph svg { width: 18px; height: 18px; }
.w2-dish small { display: block; font-size: 11.5px; color: var(--muted); }
.w2 .icon-btn { width: 30px; height: 30px; flex: none; opacity: .45; }
.w2 .icon-btn svg { width: 15px; height: 15px; }
.w2 .icon-btn:hover, .w2 .icon-btn.koch.on { opacity: 1; }
.w2-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border: 1px dashed var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.w2-add:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.w2-add svg { width: 15px; height: 15px; }

/* eine Karte je Woche, jeder Tag eine Zeile */
.w2-a .w2-list { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.w2-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 14px 10px 16px; min-height: 64px; }
.w2-row + .w2-row { border-top: 1px dashed var(--line); }
.w2-row.today { background: color-mix(in srgb, var(--tint) 70%, transparent); }
.w2-day { display: grid; line-height: 1.1; }
.w2-day b { font: 700 26px/1 var(--hand); color: var(--accent-ink); }
.w2-day small { color: var(--muted); font-size: 12px; }
.w2-day em { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.w2-dishes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.w2-chip { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; padding: 4px 4px 4px 4px; border-radius: 999px; background: var(--tint); }
.w2-chip .w2-dish img, .w2-chip .w2-ph { width: 36px; height: 36px; border-radius: 50%; }
.w2-chip .w2-dish span { font-size: 14px; font-weight: 500; line-height: 1.2; padding-right: 2px; }
.w2-a .w2-add:not(:only-child) { width: 34px; padding: 0; }
.w2-chip .w2-dish { flex: 1; }
@media (max-width: 599px) {
  .w2-row { grid-template-columns: 50px minmax(0, 1fr); gap: 8px; padding: 10px 8px 10px 12px; }
  .w2-chip { border-radius: 14px; }
}

/* ---------- Was koche ich heute: Reste ---------- */
.reste-opt { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.reste-opt .sp { margin: 0; font-size: 13.5px; }
.card .fehlt { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Einkaufen nach Laden ---------- */
.shop-stores { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.shop-stores button { border: 1px solid var(--line); background: var(--card, #fff); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.shop-stores button.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.shop-stores .ghost { border-style: dashed; color: var(--muted); }
.shoptag { border: 1px dashed var(--line); background: none; border-radius: 999px; padding: 1px 8px; margin-top: 3px; font-size: 11px; color: var(--muted); cursor: pointer; }
.shoptag.on { border-style: solid; border-color: var(--accent); background: var(--tint); color: var(--accent-ink); font-weight: 600; }

/* ---------- Konten verwalten ---------- */
.kt-liste { list-style: none; margin: 0; padding: 0; }
.kt-kopf { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kt-kopf .avatar, .kt-row .avatar { flex: none; width: 44px; height: 44px; font-size: 15px; }
.kt-name { display: grid; min-width: 0; }
.kt-name b { font-size: 15.5px; }
.kt-name small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
/* Rolle als Umschalter */
.kt-rolle { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 999px; background: var(--tint); justify-self: start; }
.kt-rolle button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.kt-rolle button.on { background: var(--card, #fff); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 45, 30, .15); }
.kt-rolle-fest { font-size: 13px; color: var(--muted); }
.kt-akt { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-akt .btn { min-height: 38px; font-size: 13.5px; }
.kt-akt .btn svg { width: 16px; height: 16px; }
.kt-akt .kt-del { color: var(--danger, #b3261e); }
/* bis 5 Konten: jede Person eine Karte */
.kt-a { display: grid; gap: 12px; }
@media (min-width: 760px) { .kt-a { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kt-card { display: grid; gap: 14px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card, #fff); }
.kt-card .kt-akt { padding-top: 12px; border-top: 1px dashed var(--line); }
.kt-card .kt-del { margin-left: auto; }
/* ab 6 Konten: schlichte Liste, alles Weitere im Blatt */
.kt-b { border: 1px solid var(--line); border-radius: 18px; background: var(--card, #fff); overflow: hidden; }
.kt-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; }
.kt-row + .kt-row { border-top: 1px dashed var(--line); }
.kt-row .kt-name { flex: 1; }
.kt-pill { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--muted); font-size: 12px; font-weight: 600; }
.kt-pill.admin { background: var(--accent-ink); color: #fff; }
.kt-sheet { gap: 10px; }
.kt-sheet .kt-kopf { padding: 0 44px 0 4px; }
.kt-sheet .kt-rolle { justify-self: stretch; }
.kt-sheet .kt-akt { display: grid; }
.kt-sheet .kt-akt .btn { justify-content: center; }
/* Neues Konto: eigene Karte unter der Liste */
form.kt-neu { margin-top: 22px !important; padding: 16px; border: 1px dashed var(--line); border-radius: 18px; }

/* Dunkler Modus: Initialen auf dem hellen Kreis dunkel, sonst sind sie kaum lesbar (Seitenleiste, Konten, Menü) */
html[data-dark] .avatar { color: var(--bg); }

/* ---------- Rezepte auswählen: Leiste unten, lange drücken ohne Handy-Vorschau ---------- */
#view .card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.btn.pickdel { color: var(--danger, #b3261e); }
.pickbar {
  position: fixed; left: 50%; bottom: calc(var(--nav-h, 66px) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 61;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 20px); padding: 8px 8px 8px 18px;
  border-radius: 999px; background: var(--card, #fff); border: 1px solid var(--line); box-shadow: 0 12px 30px -10px rgba(40, 30, 20, .45);
}
.pickbar b { margin-right: 4px; white-space: nowrap; font-size: 14px; color: var(--accent-ink); }
.pickbar .btn { min-height: 38px; padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
.pickbar .btn svg { width: 16px; height: 16px; }
@media (min-width: 900px) { .pickbar { bottom: 18px; } }
@media (max-width: 440px) { .pickbar { padding-left: 12px; gap: 4px; } .pickbar .btn { padding: 0 9px; } .pickbar .btn[data-pb="print"] { display: none; } }
body.probe .pickbar { bottom: calc(var(--nav-h, 66px) + 70px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.probe .pickbar { bottom: 76px; } }
@media print { .pickbar { display: none !important; } }

/* ---------- Kurzbefehl-Anleitung ---------- */
.kurz-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; font-size: 14px; }
.kurz-steps code { display: inline-block; margin-top: 2px; padding: 2px 6px; border-radius: 6px; background: var(--tint); font-size: 12.5px; word-break: break-all; }

/* ---------- Blätter mit X (Mehr, Neues Rezept …): etwas breiter, Titel läuft nicht ins X ---------- */
.menu .sheet.more-sheet { max-width: 540px; }
.menu .more-sheet h3 { padding: 0 44px; line-height: 1.15; overflow-wrap: anywhere; }
/* Zwischenüberschriften (TEILEN, REZEPT, HOLEN …) mit mehr Luft nach oben und zur ersten Zeile */
.menu .more-sheet .more-h { margin: 20px 8px 8px; }
.menu .more-sheet h3 + .more-h { margin-top: 16px; }

/* ---------- QR-Code zum Installieren ---------- */
.qr-sheet { position: relative; justify-items: center; text-align: center; }
.qr-sub { margin: -2px 0 6px; color: var(--muted); font-size: 14px; }
.qr-box { display: grid; place-items: center; width: 230px; height: 230px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.qr-box svg { width: 100%; height: 100%; }
.qr-url { margin: 8px 0 0; font-weight: 600; color: var(--accent-ink); word-break: break-all; }
.qr-steps { margin: 4px 0 6px; padding-left: 20px; text-align: left; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
.menu .qr-sheet .btn { width: 100%; justify-content: center; }
@media print {
  body.print-qr > *:not(.menu) { display: none !important; }
  body.print-qr .menu { position: static; background: none; animation: none; }
  body.print-qr .qr-sheet { max-width: none; box-shadow: none; padding-top: 30mm; }
  body.print-qr .qr-sheet h3 { font-size: 44px; }
  body.print-qr .qr-box { width: 90mm; height: 90mm; box-shadow: none; }
  body.print-qr .qr-sheet .btn, body.print-qr .qr-sheet .sheet-x { display: none !important; }
}

/* ---------- Probeansicht: Leiste unten über allem ---------- */
.probe-bar {
  position: fixed; left: 50%; bottom: calc(var(--nav-h, 66px) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 24px); padding: 8px 8px 8px 16px;
  border-radius: 999px; background: #c2410c; color: #fff; font-size: 13.5px; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .5);
}
.probe-bar .btn { min-height: 34px; padding: 0 14px; background: #fff; color: #c2410c; border: 0; font-weight: 600; }
@media (min-width: 900px) { .probe-bar { bottom: 18px; } }
.probe-go { display: grid; justify-items: center; gap: 6px; margin: 22px auto 30px; text-align: center; }
.probe-go small { color: var(--muted); font-size: 12.5px; }
@media print { .probe-bar, .probe-go { display: none !important; } }

/* ---------- Geschenk-Kochbuch: Trennseiten ---------- */
.bk-div { position: relative; margin: 30px 0; border-radius: 18px; overflow: hidden; background: var(--tint); min-height: 180px; display: grid; place-items: center; }
.bk-div img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.bk-div-t { position: relative; display: grid; justify-items: center; gap: 6px; padding: 22px 40px; margin: 30px; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); text-align: center; }
.bk-div-t h2 { margin: 0; font: 700 44px/1 var(--hand); color: var(--accent-ink); }
.bk-div-t p { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media print {
  .bk-div { break-before: page; break-after: page; min-height: 250mm; margin: 0; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bk-page { break-before: page; }
  .bk-page .rz-hero img { width: 100%; max-height: 110mm; object-fit: cover; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .naehr, .var-chips { display: none !important; }
}
