/* blasta – app-spezifische Styles. Baut auf glaze.css auf und ändert dessen Tokens nicht. */

.grow { flex: 1; min-width: 0; }
.grow b, .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow small.wrap { white-space: normal; overflow: visible; }
pre.code { font: var(--fs-sm)/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow: auto; margin: var(--sp-5) 0 0; padding: var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 5%, transparent); }
button.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent-t); cursor: pointer; }
.sub-title { font-size: var(--fs-sm); font-weight: 620; color: var(--muted); margin: var(--sp-7) 0 var(--sp-3); }
.dlg.wide { width: min(720px, 94vw); }
.menu-title { font-size: var(--fs-2xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: var(--sp-2) var(--sp-4) 2px; }
.card-foot { margin-top: var(--sp-6); }
.count { font-size: var(--fs-sm); }
main:focus, main:focus-visible, #main:focus-visible { outline: none; }
main .icon-btn:hover, main .icon-btn:hover:active { transform: none; }

/* ---------- Einrichtung und Verwaltung (Assistent kommt aus glaze-wizard.js) ---------- */
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--muted); }
.reqs li { display: flex; align-items: flex-start; gap: var(--sp-4); }
.reqs .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-t); }
.sum { display: grid; gap: var(--sp-3); }
.sum .kv { grid-template-columns: 150px minmax(0, 1fr); }
.sum .kv .v code { user-select: all; overflow-wrap: anywhere; }
.dns { display: grid; gap: var(--sp-3); }
ol.steps { margin: 0; padding-left: var(--sp-8); display: grid; gap: var(--sp-6); }
ol.steps li { padding-left: var(--sp-1); }
ol.steps li > .copy { margin-top: var(--sp-3); }
ol.steps li::marker { color: var(--accent-t); font-weight: 700; }
.shell:has(.auth-body) { padding: 0; max-width: none; } /* glaze-ok: .auth-body steckt in #page */

/* ---------- Zwei-Faktor ---------- */
.tf-scan { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-9); align-items: start; }
@media (max-width: 620px) { .tf-scan { grid-template-columns: 1fr; justify-items: center; } .tf-steps { width: 100%; } }

/* ---------- Übersicht: Rezeptkarten ---------- */
.tag-row { margin-bottom: var(--gap); }
.recipes-sort { width: auto; flex: none; }
.tag-row .chip small { color: var(--muted); font-variant-numeric: tabular-nums; }
.recipe-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.rc { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--text); }
.rc-img { aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--accent) 10%, var(--card)); display: grid; place-items: center; overflow: hidden; }
.rc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow, .4s) ease; }
.rc:hover .rc-img img { transform: scale(1.03); }
.rc-ph .ic { width: 42px; height: 42px; color: color-mix(in srgb, var(--accent-t) 55%, transparent); stroke-width: 1.4; }
.rc-body { display: grid; gap: var(--sp-3); padding: var(--sp-6); align-content: start; flex: 1; }
.rc-title { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.01em; }
.rc-desc { color: var(--muted); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-meta, .rc-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rc-meta .fact { display: inline-flex; align-items: center; gap: 4px; }
.rc-meta .fact .ic { width: 12px; height: 12px; }
.rc-meta .fav { color: var(--accent-t); } .rc-meta .fav .ic { fill: currentColor; }
.rc-tags .tag, .rv-head .tag { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-t); }
:root[data-density="compact"] .rc-body { padding: var(--sp-4); }

/* ---------- Rezeptansicht ---------- */
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); }
.rv-head > .back, .cook-head > .back { flex-basis: 100%; }
.rv-head > .page-title { flex: 1 1 280px; min-width: 0; }
.rv-actions { flex-wrap: wrap; }
.rv-fav.on .ic { fill: currentColor; }
.rv-img { margin: 0 0 var(--gap); border-radius: var(--r-lg); overflow: hidden; max-height: 440px; background: var(--card); }
.rv-img img { width: 100%; height: 100%; max-height: 440px; object-fit: cover; display: block; }
.rv-desc { font-size: var(--fs-lg); line-height: 1.5; color: var(--muted); margin-bottom: var(--sp-6); }
.rv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3); margin-bottom: var(--gap); }
.rv-fact { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-3); align-items: center; padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); }
.rv-fact .ic { grid-row: span 2; width: 20px; height: 20px; color: var(--accent-t); }
.rv-fact small { color: var(--muted); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.rv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-7); }
.rv-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.rv-steps p { line-height: 1.65; padding-top: 4px; }
.rv-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-t); }
.rv-notes { white-space: pre-wrap; line-height: 1.6; }
.rv-source { margin-top: var(--sp-5); overflow-wrap: anywhere; }

/* Zutaten mit Portionen */
.serv { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.serv .serv-in { width: 72px; flex: none; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.serv-note { display: block; min-height: 1.2em; margin-bottom: var(--sp-4); }
.ing { display: grid; gap: var(--sp-6); }
.ing-head { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--sp-2); }
.ing-group ul { list-style: none; margin: 0; padding: 0; display: grid; }
.ing-group li label { display: grid; grid-template-columns: auto 78px minmax(0, 1fr); gap: var(--sp-4); align-items: baseline; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ing-group li:last-child label { border-bottom: 0; }
.ing-group li input { margin: 0; align-self: center; }
.ing-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ing-name small { color: var(--muted); }
.ing-group li.done .ing-amt, .ing-group li.done .ing-name { color: var(--muted); text-decoration: line-through; }

/* Zeitangaben in Schritten werden zu Timer-Knöpfen */
.timer-link { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-t); font: inherit; font-weight: 600; cursor: pointer; vertical-align: baseline; }
.timer-link .ic { width: 13px; height: 13px; }
.timer-link:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.timer-dock { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast, 60); display: grid; gap: var(--sp-3); width: min(300px, calc(100vw - 32px)); }
.timer { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg, 0 10px 30px rgb(0 0 0 / .25)); }
.timer > .ic { width: 20px; height: 20px; color: var(--accent-t); }
.timer-t { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.timer.paused .timer-t { color: var(--muted); }
.timer.done { border-color: var(--accent); animation: timer-ring 1s ease-in-out infinite alternate; }
@keyframes timer-ring { to { background: color-mix(in srgb, var(--accent) 18%, var(--card)); } }
@media (prefers-reduced-motion: reduce) { .timer.done { animation: none; background: color-mix(in srgb, var(--accent) 18%, var(--card)); } }

/* ---------- Kochmodus: groß, ein Schritt nach dem anderen ---------- */
.cook-head .page-title { font-size: var(--fs-xl); }
.cook-bar { margin-bottom: var(--gap); }
.cook-card { display: grid; gap: var(--sp-8); min-height: min(52vh, 460px); align-content: space-between; }
.cook-step { display: grid; gap: var(--sp-5); align-content: start; }
.cook-text { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); line-height: 1.5; letter-spacing: -.01em; }
.cook-done { justify-items: center; text-align: center; align-content: center; }
.cook-nav { display: flex; gap: var(--sp-4); }
.cook-nav .btn { flex: 1; justify-content: center; min-height: 52px; font-size: var(--fs-lg); }
.cook .ing-group li label { padding: var(--sp-2) 0; }

/* ---------- Editor ---------- */
.ing-text, .import-text { width: 100%; font: var(--fs-md)/1.6 var(--font-mono); resize: vertical; }
.import-text { min-height: 240px; }
.ing-preview { margin-top: var(--sp-4); }
.ing-preview:empty { display: none; }
.ing-table td { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.ing-table .ing-amt { width: 90px; }
.ing-grp th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: var(--sp-5); }
.img-pick { display: flex; gap: var(--sp-6); align-items: center; flex-wrap: wrap; }
.img-pick > img, .img-pick > .rc-ph { width: 160px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.editor-foot { position: sticky; bottom: 0; z-index: var(--z-sticky, 5); padding: var(--sp-5) 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- Einkaufsliste ---------- */
.shop-add-row { display: flex; gap: var(--sp-4); align-items: flex-start; }
.shop-add-row textarea { flex: 1; min-width: 0; resize: none; }
.shop-list { display: grid; gap: var(--gap); }
.shop-group .sec-title small { margin-left: auto; font-weight: 500; }
.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; gap: var(--sp-4); border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-item > label { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; cursor: pointer; }
.shop-item input { margin: 0; flex: none; }
.shop-qty { font-variant-numeric: tabular-nums; }
.shop-item.done .shop-text { color: var(--muted); text-decoration: line-through; }
.shop-item .tag { max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .shop-item .tag { display: none; } }

/* ---------- Sauerteig-Rechner ---------- */
.sd-segs { margin-bottom: var(--sp-6); }
.sd-mix { display: grid; gap: var(--sp-3); }
.sd-mix-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: var(--sp-3); align-items: center; }
.sd-pct { display: flex; align-items: center; gap: var(--sp-2); color: var(--muted); }
.sd-pct input { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sd-mix-add { margin: var(--sp-4) 0; }
.sd-sum { margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.sd-notes { margin: var(--sp-3) 0 0; padding-left: var(--sp-7); display: grid; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.sd-notes b { color: var(--text); }
.sd-group + .sd-group { margin-top: var(--sp-4); }
.sd-list { list-style: none; margin: 0; padding: 0; }
.sd-list li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: var(--sp-4); align-items: baseline; padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.sd-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sd-total { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: var(--sp-4); padding-top: var(--sp-2); font-size: var(--fs-sm); color: var(--muted); }
.sd-total b { grid-column: 1; grid-row: 1; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.sd-total span { grid-column: 2; }
.sd-kv { margin-top: var(--sp-5); font-size: var(--fs-sm); }
.sd-big { display: grid; gap: var(--sp-1); margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6); border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sd-big small { color: var(--muted); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.sd-big b { font-size: var(--fs-2xl); color: var(--accent-t); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sd-switch { margin-top: var(--sp-5); }
.sd-dur { display: inline; font-weight: 500; }
.sd-tips { margin: 0; padding-left: var(--sp-7); display: grid; gap: var(--sp-4); line-height: 1.55; }
.sd-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sd-table td { vertical-align: top; }
.sd-table td:first-child { min-width: 150px; }
.sd-starter > .stack { align-content: start; }
@media (max-width: 480px) { .sd-mix-row { grid-template-columns: minmax(0, 1fr) 88px auto; } }

@media print {
  .rv-actions, .timer-dock, .serv button, .ing-card .card-foot, .rv-source { display: none !important; }
  .rv { grid-template-columns: minmax(0, 1fr); } /* glaze-ok: Druck einspaltig */
  .rv > .side-col { order: -1; position: static; } /* glaze-ok: Zutaten beim Druck vorn */
}
@media (max-width: 900px) { .rv > .side-col { order: -1; } } /* glaze-ok: auf schmalen Bildschirmen zuerst die Zutaten */
