/* ---------- Reiter: jetzt 6 Stück ---------- */
@media (max-width: 420px) { .tabs a { font-size: 10px; } .tabs a svg { width: 19px; height: 19px; } }
@media (min-width: 900px) {
  .tabs a:nth-child(3) { background: color-mix(in srgb, var(--accent) 75%, var(--paper)); }
  .tabs a:nth-child(4) { background: color-mix(in srgb, var(--accent) 88%, var(--paper)); }
  .tabs a:nth-child(5) { background: var(--accent); }
  .tabs a:nth-child(6) { background: color-mix(in srgb, var(--accent) 80%, var(--ink) 8%); }
  .tabs a.on { background: var(--paper); }
}

/* ---------- Segment-Umschalter (wie „Meine / Alle“) ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--tint); margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(60, 45, 30, .12); }

/* ---------- Editor in Abschnitten ---------- */
.editor { max-width: 920px; margin: 0 auto; }
.ed-sec { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-bottom: 18px; }
.ed-sec > .label { margin-bottom: 14px; }
.ed-sec .field:last-child { margin-bottom: 0; }
.ed-sec .guess { font: 500 12px/1.4 var(--sans); color: var(--muted); }
.ed-top { display: grid; gap: 18px; }
.ed-top .ed-photo { margin: 0; }
@media (min-width: 760px) { .ed-top { grid-template-columns: 300px 1fr; align-items: start; } .ed-top .ed-photo { aspect-ratio: 4 / 3; } }
.ed-save { justify-content: flex-end; margin: 4px 0 30px; }

/* Schritt-Editor */
.stepedit { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stepedit li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.stepedit .se-no { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; font: 700 19px/1 var(--hand); color: var(--accent-ink); margin-top: 3px; }
.stepedit textarea { min-height: 0; resize: none; overflow: hidden; padding: 9px 12px; font-size: 15px; }
.stepedit .se-sec { grid-template-columns: 1fr auto; background: var(--tint); border-style: dashed; }
.stepedit .se-sec input { font: 700 21px/1.2 var(--hand); color: var(--accent-ink); background: transparent; border-color: transparent; }
.se-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.se-imgs figure { position: relative; margin: 0; }
.se-imgs img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }
.se-imgs figure button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; cursor: pointer; }
.se-imgs figure button svg { width: 13px; height: 13px; }
.se-addimg { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--accent-ink); background: none; color: var(--accent-ink); cursor: pointer; font-size: 13px; }
.se-addimg svg { width: 16px; height: 16px; }
.se-ctrl { display: flex; flex-direction: column; }
.se-ctrl .icon-btn { width: 32px; height: 30px; }
.se-ctrl .icon-btn svg { width: 16px; height: 16px; }
.se-ctrl .icon-btn:disabled { opacity: .25; cursor: default; }
@media (min-width: 600px) { .se-ctrl { flex-direction: row; } }

/* ---------- Einkaufsliste ---------- */
.shop-txt { flex: 1; min-width: 0; }
.shop-txt small { display: block; font-size: 11.5px; color: var(--muted); text-decoration: none; }

/* ---------- Wochenplan ---------- */
.wk-span { margin: 4px 0 16px; color: var(--muted); }
.wk-span .hand { font-size: 28px; font-weight: 700; color: var(--accent-ink); margin-right: 6px; }
.wk-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .wk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .wk-grid { grid-template-columns: repeat(4, 1fr); } }
.wk-day { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.wk-day.today { border-color: var(--accent-ink); box-shadow: 0 0 0 2px var(--tint); }
.wk-day header { display: flex; align-items: baseline; gap: 8px; }
.wk-day header b { font: 700 22px/1 var(--hand); color: var(--accent-ink); }
.wk-day header small { color: var(--muted); font-size: 12px; }
.wk-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wk-item { display: flex; align-items: center; gap: 4px; }
.wk-rec { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px; border-radius: 10px; }
a.wk-rec:hover { background: var(--tint); }
.wk-rec img, .wk-ph { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; background: var(--tint); display: grid; place-items: center; color: var(--accent-ink); }
.wk-ph svg { width: 20px; height: 20px; }
.wk-rec span:last-child { font-size: 14px; line-height: 1.3; }
.wk-item .icon-btn { width: 32px; height: 32px; opacity: .5; }
.wk-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line); background: none; border-radius: 999px; padding: 5px 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.wk-add:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.wk-add svg { width: 15px; height: 15px; }

.pick-sheet { max-height: 86vh; }
.pick-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 46vh; display: grid; gap: 4px; }
.pick-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.pick-list button:hover { background: var(--tint); }
.pick-list img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.pick-list button > span:not(.wk-ph) { flex: 1; }
.pick-list button > svg { color: var(--accent-ink); width: 16px; height: 16px; }
.day-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (min-width: 420px) { .day-pick { grid-template-columns: repeat(7, 1fr); } }
.day-pick button { position: relative; display: grid; gap: 2px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.day-pick button:hover { border-color: var(--accent-ink); background: var(--tint); }
.day-pick b { font-weight: 500; font-size: 13px; }
.day-pick small { font-size: 11px; color: var(--muted); }
.day-pick i { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }

/* ---------- Was koche ich heute? ---------- */
.card .hits { position: absolute; left: 8px; top: 8px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--accent-ink); color: #fff; font-size: 12px; line-height: 24px; }
.zufall { display: grid; gap: 12px; max-width: 260px; margin-top: 16px; }
.diet-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.diet-filter button { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line); background: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.diet-filter button.on { border-style: solid; border-color: var(--accent-ink); color: var(--accent-ink); background: var(--tint); }
.diet-filter button svg { width: 14px; height: 14px; }
.heute-btn { margin-left: auto; min-height: 36px; font-size: 13px; }
@media (max-width: 520px) { .heute-btn { margin-left: 0; } }

/* ---------- Hinweis auf Neues ---------- */
.news { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; background: color-mix(in srgb, var(--marker) 55%, var(--paper)); }
.news-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--paper); display: grid; place-items: center; color: var(--accent-ink); }
.news div { flex: 1; min-width: 0; }
.news p { margin: 0; font-size: 14px; }
.news p + p { margin-top: 4px; }
.news a { color: var(--accent-ink); font-weight: 500; }

/* ---------- Sterne & Notiz, Ernährung ---------- */
.card-stars { position: absolute; top: 8px; right: 44px; height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #d49a1a; font-size: 12px; line-height: 24px; letter-spacing: 1px; }
.card:not(:has(.fav)) .card-stars { right: 8px; }
.rz-mynote { margin: 26px 0 0; padding: 16px 20px; border-radius: 18px; border: 1px dashed var(--accent); }
.rz-mynote .label { margin-bottom: 6px; }
.stars { display: flex; gap: 2px; margin-bottom: 10px; }
.stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; padding: 0 2px; }
.stars button.on { color: #e3a82a; }
.rz-mynote textarea { min-height: 0; font: 500 21px/1.4 var(--hand); background: transparent; }
.diet { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, #b5cba5 40%, var(--paper)); color: #3f5f2e; font-size: 12px; }
.diet svg { width: 13px; height: 13px; }

/* ---------- Kochmodus ---------- */
.cookmode { position: fixed; inset: 0; z-index: 45; background: var(--paper); display: flex; flex-direction: column; touch-action: pan-y; }
.cookmode header { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.cookmode header b { flex: 1; font: 700 24px/1.1 var(--hand); color: var(--accent-ink); }
.cm-slide { flex: 1; overflow-y: auto; padding: 28px 22px; max-width: 900px; width: 100%; margin: 0 auto; }
.cm-h { font: 700 34px/1 var(--hand); color: var(--accent-ink); margin: 0 0 14px; }
.cm-ing { list-style: none; margin: 0; padding: 0; font-size: 21px; line-height: 1.5; }
@media (min-width: 760px) { .cm-ing { columns: 2; column-gap: 40px; } }
.cm-ing li { padding: 6px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.cm-ing li.sec { border: 0; font: 700 26px/1 var(--hand); color: var(--accent-ink); padding-top: 14px; column-span: all; }
.cm-sec { font: 700 26px/1 var(--hand); color: var(--accent-ink); margin: 0 0 6px; }
.cm-no { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.cm-text { font-size: 26px; line-height: 1.5; margin: 0; }
@media (min-width: 760px) { .cm-text { font-size: 32px; } }
.cm-img { margin-top: 20px; border-radius: 14px; max-height: 40vh; width: auto; }
.cm-end { display: grid; place-items: center; gap: 20px; padding-top: 10vh; }
.cm-end .hand { font-size: 56px; color: var(--accent-ink); }
.cookmode footer { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cookmode footer .btn { min-height: 54px; padding: 0 26px; font-size: 16px; }
.cookmode footer [data-next] { margin-left: auto; }
.cm-dots { color: var(--muted); font-size: 13px; }
.cookmode .timer-link { font-size: inherit; }
/* Hinweis „Neue Version da“ unten in der Mitte (am Handy über der Leiste) */
.update-bar {
  position: fixed; left: 50%; bottom: calc(var(--nav-h, 66px) + 16px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 999px; white-space: nowrap;
  background: var(--card, #fff); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; color: var(--accent-ink);
}
.update-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.update-bar svg { width: 18px; height: 18px; }
.update-bar .btn { min-height: 40px; }
@media (min-width: 900px) { .update-bar { bottom: 24px; } }

/* Kochmodus im Stil der Rezeptseite: Fortschrittsbalken, Foto, Zutaten zum Abhaken, Schritt-Karten */
.cm-bar { height: 4px; background: var(--tint); }
.cm-bar i { display: block; height: 100%; width: 0; background: var(--accent-ink); border-radius: 0 4px 4px 0; transition: width .25s; }
.cm-cover { height: 26vh; max-height: 260px; margin: -6px 0 22px; border-radius: 20px; background: var(--tint) center / cover no-repeat; box-shadow: var(--shadow); }
.cm-sub { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.cm-ing li[data-tick] { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.cm-tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--line); color: transparent; }
.cm-tick svg { width: 15px; height: 15px; stroke-width: 3; }
.cm-ing li.done .cm-tick { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
.cm-ing li.done > span:last-child { color: var(--muted); text-decoration: line-through; }
.cm-step { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; }
.cm-num {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent);
  font: 700 36px/1 var(--hand); color: var(--accent-ink); background: var(--paper);
}
.cm-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--card, #fff); }
.cm-zut { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cm-zut span { padding: 4px 13px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); font-size: 15px; }
.cm-timers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button.cm-timer {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--accent-ink); color: var(--paper); font: inherit; font-size: 17px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
button.cm-timer svg { width: 20px; height: 20px; margin: 0; }
@media (max-width: 599px) {
  .cm-step { grid-template-columns: 1fr; gap: 10px; }
  .cm-num { width: 52px; height: 52px; font-size: 30px; }
  .cm-card { padding: 16px; }
  .cm-text { font-size: 23px; }
}

/* ---------- Zettel abfotografieren ---------- */
.scanbar { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.scanbar i { display: block; height: 100%; width: 0; background: var(--accent-ink); transition: width .3s; }
.scanlist { list-style: none; margin: 16px 0 10px; padding: 0; display: grid; gap: 12px; }
.scan-it { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; transition: opacity .2s; }
.scan-it.off { opacity: .55; }
.scan-on { width: 22px; height: 22px; margin-top: 18px; flex: none; accent-color: var(--accent-ink); }
.scan-ph { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: var(--tint); }
.scan-ph img { width: 100%; height: 100%; object-fit: cover; }
.scan-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.scan-title { width: 100%; font-weight: 600; }
.scan-sum { font-size: 12.5px; color: var(--muted); }
.scan-body details summary { cursor: pointer; font-size: 13px; color: var(--accent-ink); margin-top: 2px; }
.scan-body details textarea { margin-top: 8px; width: 100%; }

/* ---------- Kochbuch als Geschenk (Druck) ---------- */
.bk-cover {
  margin: 20px 0; padding: 60px 20px; display: grid; place-items: center; border-radius: 18px;
  background-color: var(--paper);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent) 50%, transparent 50%), linear-gradient(color-mix(in srgb, var(--accent) 45%, transparent) 50%, transparent 50%);
  background-size: 34px 34px;
}
.bk-card { background: var(--paper); padding: 40px 50px; border-radius: 18px; text-align: center; box-shadow: var(--shadow); max-width: 520px; }
.bk-card .dots { display: flex; justify-content: center; gap: 4px; margin-bottom: 10px; }
.bk-card .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--accent-ink); }
.bk-card .dots i:nth-child(2) { transform: translateY(-6px); }
.bk-card h1 { margin: 0; font: 700 56px/1 var(--hand); color: var(--ink); }
.bk-card p { margin: 12px 0 0; font: 500 24px/1.3 var(--hand); color: var(--accent-ink); }
.bk-card p:empty { display: none; }
.bk-card small { display: block; margin-top: 18px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
.bk-toc { padding: 20px 0 30px; }
.bk-toc h2 { font: 700 40px/1 var(--hand); color: var(--accent-ink); margin: 0 0 16px; }
.bk-toc h3 { display: flex; align-items: center; gap: 8px; font: 500 15px/1 var(--sans); margin: 18px 0 6px; }
.bk-toc ol { margin: 0; padding-left: 34px; }
.bk-toc li { padding: 3px 0; border-bottom: 1px dotted var(--line); }
.bk-no { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
@media print {
  .bk-cover { min-height: 250mm; margin: 0; break-after: page; border-radius: 0; }
  .bk-toc { break-after: page; }
  .rz-mynote, .diet-filter, .news { display: none !important; }
}

/* ---------- Dunkler Modus (nur am Bildschirm) ---------- */
@media screen {
  html[data-dark] {
    --bg: #171412; --paper: #221e1b; --card: #2b2623; --ink: #ede6de; --muted: #a59b91; --line: #3d3631;
    --tint: color-mix(in srgb, var(--accent) 14%, #221e1b);
    --marker: #5b4d1c;
    --accent-ink: color-mix(in srgb, var(--accent) 75%, #fff);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
  html[data-dark] input[type=text], html[data-dark] input[type=url], html[data-dark] input[type=number], html[data-dark] input[type=password],
  html[data-dark] input[type=search], html[data-dark] input[type=date], html[data-dark] textarea, html[data-dark] select,
  html[data-dark] .searchbar, html[data-dark] .card, html[data-dark] .panel, html[data-dark] .sp, html[data-dark] .tick,
  html[data-dark] .rz-facts, html[data-dark] .rz-ing, html[data-dark] .rz-sec-head .servings .icon-btn,
  html[data-dark] .mc-row, html[data-dark] .mc-mini, html[data-dark] .cooked-grid figure, html[data-dark] .cover-edit,
  html[data-dark] .rz-hero .photo-btn, html[data-dark] .cooked-add { background: var(--card); }
  html[data-dark] .card .fav, html[data-dark] .card .owner, html[data-dark] .card-stars, html[data-dark] .card .pick { background: rgba(34, 30, 27, .9); }
  html[data-dark] .btn.primary, html[data-dark] .fab, html[data-dark] .badge, html[data-dark] .tabs a.on .avatar,
  html[data-dark] .rz-step.done .no, html[data-dark] .card .hits { color: var(--bg); }
  html[data-dark] .tick svg { stroke: var(--bg); }
  html[data-dark] .cover, html[data-dark] .auth-art, html[data-dark] .bk-cover {
    background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, transparent) 50%, transparent 50%), linear-gradient(color-mix(in srgb, var(--accent) 18%, transparent) 50%, transparent 50%);
  }
  html[data-dark] .rz-hint, html[data-dark] .rz-stepbody .tip { background: color-mix(in srgb, var(--marker) 70%, var(--paper)); }
  html[data-dark] .diet { background: #2f3a29; color: #b9d2a6; }
  html[data-dark] .timer, html[data-dark] .toast { background: #3a332e; }
  html[data-dark] .menu { background: rgba(0, 0, 0, .55); }
  html[data-dark] img { filter: brightness(.92); }
  html[data-dark] .sticker-ic { filter: saturate(.85) brightness(.9); }
  /* runde Knöpfe auf Fotos (Pfeil zurück, Foto ändern, Woche blättern …) dunkel statt weiß */
  html[data-dark] .pagehead.has-photo .topbar .icon-btn, html[data-dark] .pagehead.has-photo .topbar .backbtn,
  html[data-dark] .cover.rz-cover .photo-btn, html[data-dark] .cover .icon-btn { background: rgba(34, 30, 27, .88); color: var(--ink); }
  html[data-dark] .card .fav-btn { background: rgba(34, 30, 27, .9); }
  html[data-dark] .rz-timer { background: var(--card); }
  @media (min-width: 900px) {
    html[data-dark] .tabs a { color: var(--bg); }
    html[data-dark] .tabs a.on { color: var(--accent-ink); }
  }
}
