/* Przepiśnik Ewy — Pantry Notebook, editorial */

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ── Root vars (legacy names for admin.css) ── */
:root {
  --maxw: 1240px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --paper:       oklch(0.957 0.012 78);
  --paper-2:     oklch(0.93 0.015 78);
  --ink:         oklch(0.26 0.018 55);
  --ink-2:       oklch(0.46 0.02 55);
  --ink-3:       oklch(0.6 0.018 55);
  --rule:        oklch(0.86 0.018 70);
  --rule-soft:   oklch(0.93 0.015 78);
  --accent:      oklch(0.6 0.13 42);
  --accent-soft: oklch(0.92 0.04 50);
  --sans:        system-ui, sans-serif;
  --serif:       Georgia, serif;
  --mono:        ui-monospace, monospace;
}

/* ── Theme: editorial ── */
[data-theme="editorial"] {
  --bg:            oklch(0.957 0.012 78);
  --surface:       oklch(0.985 0.008 80);
  --surface-2:     oklch(0.93 0.015 78);
  --text:          oklch(0.26 0.018 55);
  --text-dim:      oklch(0.46 0.02 55);
  --text-faint:    oklch(0.6 0.018 55);
  --border:        oklch(0.86 0.018 70);
  --border-strong: oklch(0.78 0.02 65);
  --accent:        oklch(0.6 0.13 42);
  --accent-ink:    oklch(0.46 0.12 40);
  --accent-soft:   oklch(0.92 0.04 50);
  --chip-bg:       oklch(0.97 0.012 78);
  --font-display:  "DM Serif Display", Georgia, serif;
  --font-body:     "Spectral", Georgia, serif;
  --font-ui:       "Spectral", Georgia, serif;
  --font-mono:     "Space Mono", ui-monospace, monospace;
  --card-radius:   3px;
  --radius:        4px;
  --shadow:        0 1px 2px oklch(0.5 0.03 60 / 0.06);
  --shadow-lift:   0 16px 40px -20px oklch(0.4 0.04 60 / 0.35);
  --hero-tint:     0.5;
  --display-weight: 400;
  --title-spacing: 0;
}

/* ── Base ── */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.print-only { display: none !important; }
/* Visually hidden but available to screen readers / crawlers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(32px, 5vw, 64px); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Site header ── */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.site-head__row { display: flex; align-items: center; gap: 24px; height: 76px; }
.site-head__recipe-row {
  height: 0; overflow: hidden; opacity: 0;
  transform: translateY(-10px);
  will-change: height, opacity, transform;
}
.site-head__recipe-inner {
  display: flex; align-items: center;
  padding-bottom: 10px;
}
.site-head__recipe-name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 18px; letter-spacing: var(--title-spacing); line-height: 1;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; }
.brand__mark {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 26px; letter-spacing: var(--title-spacing); line-height: 1;
  color: var(--text);
}
.brand__mark a {
  color: inherit;
  text-decoration: none;
  transition: color .18s var(--ease);
}
.brand__mark a:hover,
.brand__mark a.is-active {
  color: var(--accent);
}
.brand__mark em { color: var(--accent); font-style: normal; }
.omnie-link {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); text-decoration: none;
  transition: color .18s var(--ease);
  flex-shrink: 0;
}
.omnie-link:hover,
.omnie-link.is-active { color: var(--accent-ink); }
.head-spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 16px; height: 42px;
  width: 260px; transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.search input {
  border: 0; background: transparent; outline: none;
  font-family: var(--font-ui); font-size: 15px; color: var(--text); width: 100%;
}
.search input::placeholder { color: var(--text-faint); }


/* ── Filter bar ── */
.filters { padding-top: 32px; padding-bottom: 6px; }
.filters__cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cat-pill {
  font-family: var(--font-ui); font-size: 14.5px;
  color: var(--text-dim); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: 7px 15px; transition: all .18s var(--ease); white-space: nowrap;
}
.cat-pill:hover { color: var(--text); background: var(--surface-2); }
.cat-pill[aria-pressed="true"] { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.cat-pill .count { opacity: .55; font-size: 12px; margin-left: 5px; font-family: var(--font-mono); }
.filters__tags { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.tag-chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.03em;
  color: var(--text-dim); background: var(--chip-bg);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; transition: all .16s var(--ease);
}
.tag-chip:hover { border-color: var(--border-strong); color: var(--text); }
.tag-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.tag-chip::before { content: "#"; opacity: .45; }
.filters__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; gap: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 16px;
}
.filters__count { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; }

/* ── Placeholder imagery ── */
.ph {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg,
    oklch(0.72 0.09 var(--h1) / var(--hero-tint)),
    oklch(0.6 0.1 var(--h2) / var(--hero-tint)));
  isolation: isolate;
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(-45deg, transparent 0 7px, oklch(1 0 0 / 0.05) 7px 8px);
  z-index: 0;
}
.ph::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, oklch(0 0 0 / 0.22));
  z-index: 0;
}
.ph__label {
  position: absolute; z-index: 2; left: 12px; bottom: 11px; right: 12px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: oklch(1 0 0 / 0.9); text-shadow: 0 1px 4px oklch(0 0 0 / 0.5);
}

/* ── About section (on homepage) ── */
.about-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.about-section__header {
  width: 100%;
  max-width: 480px;
  margin-bottom: 24px;
}
.about-section__img {
  width: 100%;
  height: auto;
  display: block;
}
.about-me {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
  width: 100%;
}
.about-me p { margin: 0 0 12px; }
.about-me p:last-child { margin-bottom: 0; }
.about-me strong { color: var(--text); font-weight: 600; }
.about-me em { font-style: italic; }
.about-me a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── Recipe grid + cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px 26px; padding: 32px 0 80px;
  container-type: inline-size;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.card__media { aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media .ph { width: 100%; height: 100%; }
@container (max-width: 626px) {
  .card__media { aspect-ratio: 16/9; }
}
.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__cat {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-ink);
}
.card__title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 23px; line-height: 1.12; letter-spacing: var(--title-spacing);
  color: var(--text); margin: 0;
}
.card__blurb {
  font-size: 14.5px; line-height: 1.5; color: var(--text-dim);
  margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint);
  border-top: 1px solid var(--border);
}
.card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.card__meta svg { width: 13px; height: 13px; }
.card__meta .servings-unit { margin-left: 3px; }
.card__meta .card__tag { margin-left: auto; color: var(--text-dim); }
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px; border-radius: 999px;
  background: oklch(1 0 0 / 0.82); backdrop-filter: blur(6px);
  border: none; display: grid; place-items: center;
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.18);
  transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.fav-btn:hover { transform: scale(1.12); }
.fav-btn:active { transform: scale(0.9); }
.fav-btn svg {
  width: 21px; height: 21px;
  color: oklch(0.5 0.03 60);
  font-family: var(--font-body);
  transition: color .2s var(--ease);
}
.fav-btn svg text {
  fill: none; stroke: currentColor; stroke-width: 1.6;
  font-family: var(--font-body);
  transition: fill .2s var(--ease), stroke .2s var(--ease);
}
.fav-btn[aria-pressed="true"] svg { color: oklch(0.58 0.16 25); }
.fav-btn[aria-pressed="true"] svg text { fill: currentColor; stroke: currentColor; }
.empty {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--text-faint);
}
.empty h3 {
  font-family: var(--font-display); font-size: 26px; color: var(--text-dim);
  margin: 0 0 8px; font-weight: var(--display-weight);
}
.empty p { font-family: var(--font-mono); font-size: 13px; }
.empty-show-all {
  background: none; border: none; padding: 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent-ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.empty-show-all:hover { color: var(--accent); }
.omnie-foot { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.omnie-foot:hover { color: var(--accent-ink); }

/* ── Detail view ── */
.list-page, .detail {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 77px);
}
.list-page > *, .detail > * {
  width: 100%;
}
.detail { animation: rise .4s var(--ease) both; }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
.back-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 4px;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--text-dim); background: none; border: none;
}
.back-btn:hover { color: var(--accent-ink); }
.back-btn svg { width: 14px; height: 14px; }

.wake-lock-btn { display: none; }
@media (max-width: 1024px) {
  .wake-lock-btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 5px 12px;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
  }
  .wake-lock-btn:hover { border-color: var(--border-strong); color: var(--text-dim); }
  .wake-lock-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }
}
.detail-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden;
  background: var(--surface); margin-top: 14px; box-shadow: var(--shadow);
}
.detail-hero__media { position: relative; min-height: 440px; overflow: hidden; }
.detail-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero__media .ph { position: absolute; inset: 0; }
.detail-hero__info { padding: 46px 48px; display: flex; flex-direction: column; }
.detail-hero__cat {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 18px;
}
.detail-hero__title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(34px, 4vw, 50px); line-height: 1.04; letter-spacing: var(--title-spacing);
  margin: 0; color: var(--text);
}
.detail-hero__blurb {
  font-size: 18px; line-height: 1.6; color: var(--text-dim); margin: 20px 0 0; max-width: 42ch;
}
.detail-hero__tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 22px; }
.detail-hero__tags .tag-chip { position: static; }
.detail-stats {
  display: flex; gap: 0; margin-top: auto; padding-top: 30px;
  border-top: 1px solid var(--border);
}
.detail-stat { flex: 1; padding-right: 16px; }
.detail-stat + .detail-stat { border-left: 1px solid var(--border); padding-left: 20px; }
.detail-stat__k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint);
}
.detail-stat__v {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 24px; color: var(--text); margin-top: 4px; line-height: 1;
}
.detail-stat__v small { font-family: var(--font-body); font-size: 13px; color: var(--text-faint); }

/* gallery strip */
.gallery-strip { display: flex; gap: 12px; margin-top: 16px; }
.gallery-strip .gallery-thumb {
  flex: 1; aspect-ratio: 3/2; border-radius: var(--card-radius);
  border: 1px solid var(--border); overflow: hidden; cursor: zoom-in; background: none; padding: 0;
}
.gallery-strip .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.gallery-strip .gallery-thumb:hover img { transform: scale(1.04); }
.gallery-strip .ph { flex: 1; aspect-ratio: 3/2; border-radius: var(--card-radius); border: 1px solid var(--border); }

/* ── "Zobacz też" related recipes (reuses .grid / .card from home) ── */
.see-also { margin-top: 56px; }
.see-also__title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 27px; letter-spacing: var(--title-spacing); margin: 0; color: var(--text);
}
.see-also__grid { padding: 24px 0 80px; }

/* ── Recipe head (flat layout: title → image → calc → body) ── */
.recipe-head {
  display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "title meta" "blurb meta" "tags meta";
  column-gap: 40px; align-items: start;
  margin-top: 28px; padding-bottom: 32px;
}
.recipe-head h1 { grid-area: title; }
.recipe-head p  { grid-area: blurb; }
.recipe-head__tags { grid-area: tags; display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.recipe-head__meta {
  grid-area: meta; text-align: right; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint);
}
.recipe-head__time {
  display: block;
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 28px; color: var(--text); margin-top: 4px; letter-spacing: var(--title-spacing);
  text-transform: none;
}
.recipe-head__title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(48px, 7vw, 88px); line-height: 1.02; letter-spacing: var(--title-spacing);
  margin: 0; color: var(--text);
}
.recipe-head__blurb {
  font-size: 18px; line-height: 1.6; color: var(--text-dim); margin: 18px 0 0; max-width: 60ch;
}

/* Recipe hero image */
.recipe-image-wrap {
  position: relative; margin-top: 0;
}
.recipe-image-wrap img {
  width: 100%; display: block; max-height: 620px; object-fit: cover;
}
.recipe-image-wrap .ph {
  width: 100%; aspect-ratio: 16/9;
}
.recipe-image-wrap .fav-btn {
  right: calc(clamp(32px, 5vw, 64px) + 16px);
  top: 16px;
}

/* ── Serving calculator (old-style drag slider) ── */
.calc {
  margin-top: 0; padding: 28px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 160px 1fr; gap: 36px; align-items: center;
}
.calc-left .k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); display: block;
}
.calc-left .v {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 80px; line-height: 0.85; color: var(--text);
  display: flex; flex-direction: column; align-items: flex-start;
}
.calc-left .v small {
  font-family: var(--font-ui); font-weight: 400; font-size: 15px;
  color: var(--text-dim); margin: 4px 0 0 0; display: block;
  line-height: 1.25;
}
.calc--yield {
  display: block;
}
.calc--yield .calc-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc--yield .calc-left .v {
  font-size: 24px;
  line-height: 1.25;
}
.calc-right { padding-bottom: 6px; }
.slider-wrap { position: relative; }
.slider-input {
  position: relative; width: 100%; height: 22px;
  cursor: grab; user-select: none; touch-action: none;
}
.slider-track {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-50%); height: 2px;
  background: var(--border-strong); border-radius: 2px; pointer-events: none;
}
.slider-default-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; background: var(--text-faint);
  border-radius: 50%; pointer-events: none; z-index: 1;
}
.slider-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px; background: var(--accent); border-radius: 50%;
  border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--accent);
  cursor: grab; z-index: 2; touch-action: none;
}
.slider-thumb.active, .slider-thumb:active { transform: translate(-50%, -50%) scale(1.15); cursor: grabbing; }
.slider-thumb:focus { outline: none; }
.slider-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.slider-ticks {
  position: absolute; left: 0; right: 0; top: 11px;
  display: flex; justify-content: space-between; pointer-events: none; z-index: 1;
}
.slider-ticks span { width: 1px; height: 6px; background: var(--text-faint); transform: translateY(-2px); }
.slider-labels {
  position: relative; height: 16px; margin-top: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--text-faint);
}
.slider-labels span { position: absolute; transform: translateX(-50%); font-weight: 500; }
.slider-labels span.active { color: var(--accent); }

/* recipe body two-col */
.detail-body {
  display: grid; grid-template-columns: 360px 1fr; gap: 56px;
  margin-top: 56px; align-items: start;
}
.panel-title {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 27px; letter-spacing: var(--title-spacing); margin: 0 0 4px; color: var(--text);
}

/* ── Ingredients sidebar ── */
.ingredients { position: sticky; top: 134px; }
.ing-group + .ing-group { margin-top: 26px; }
.ing-group__name {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 8px;
  margin: 0 -8px;
  border-bottom: 1px dotted var(--border);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  border-radius: 6px;
}
.ing-item:hover {
  background: var(--surface-2);
}
.ing-item:hover .ing-check {
  border-color: var(--accent);
}
.ing-item:last-child { border-bottom: none; }
.ing-check {
  flex-shrink: 0; width: 18px; height: 18px; border: 1.5px solid var(--border-strong);
  border-radius: 4px; margin-top: 3px; display: grid; place-items: center;
  transition: all .15s var(--ease);
}
.ing-item[data-done="true"] .ing-check { background: var(--accent); border-color: var(--accent); }
.ing-item[data-done="true"] .ing-check svg { opacity: 1; }
.ing-check svg { width: 12px; height: 12px; color: var(--surface); opacity: 0; }
.ing-qty {
  font-family: var(--font-mono); font-size: 14px; color: var(--accent-ink);
  flex-shrink: 0; min-width: var(--qty-width, 100px); font-weight: 700;
}
.ing-name-text { font-size: 16px; color: var(--text); flex: 1; }
.ing-note { color: var(--text-faint); font-size: 13.5px; font-style: italic; }
.ing-item[data-done="true"] .ing-name-text { color: var(--text-faint); text-decoration: line-through; }

/* ── Directions ── */
.dir-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 16px;
}
.dir-group + .dir-group { margin-top: 36px; }
.dir-group__name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 18px; color: var(--text-dim); margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.dir-group__name::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 46px 1fr; gap: 20px;
  padding: 4px 8px 26px; margin: 0 -8px; position: relative; cursor: pointer;
  transition: background .18s var(--ease);
  border-radius: 6px;
}
.step:hover {
  background: var(--surface-2);
}
.step:hover .step__num {
  border-color: var(--accent);
  transform: scale(1.03);
}
.step__num {
  counter-increment: step;
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 22px; color: var(--accent);
  width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 999px;
  display: grid; place-items: center; flex-shrink: 0; background: var(--surface);
  transition: all .18s var(--ease);
}
.step__num::before { content: counter(step); }
.step[data-done="true"] .step__num { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.step[data-done="true"] .step__num::before { content: "✓"; }
.step__text { font-size: 17.5px; line-height: 1.62; color: var(--text); padding-top: 9px; transition: color .15s; }
.step[data-done="true"] .step__text { color: var(--text-faint); }
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 30.5px; top: 50px; bottom: 6px;
  width: 1px; background: var(--border);
}

/* Tips */
.recipe-tips { margin-top: 28px; }
.tips-list { list-style: none; margin: 0; padding: 0; }
.tip-item {
  position: relative; padding: 14px 6px 14px 28px;
  border-bottom: 1px dotted var(--border);
  font-size: 16px; line-height: 1.55; color: var(--text-dim);
}
.tip-item::before { content: '※'; position: absolute; left: 4px; top: 14px; color: var(--accent); font-size: 14px; }
.tip-item:last-child { border-bottom: none; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0;
  background: oklch(0.12 0.005 60 / 0.92); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fade 200ms ease both;
}
.lightbox-inner {
  position: relative; max-width: 96vw; max-height: 96vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: var(--card-radius); user-select: none; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: oklch(0 0 0 / 0.5); color: white;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; transition: background 180ms ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: var(--accent); }
.lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-counter {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: white; background: oklch(0 0 0 / 0.5); padding: 6px 12px; border-radius: 12px;
}

/* ── Recipe actions ── */
.recipe-actions {
  display: flex;
  gap: 24px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 12px 0;
  transition: color 180ms ease;
  cursor: pointer;
}
.action-btn:hover {
  color: var(--accent-ink);
}
.action-btn svg {
  width: 14px;
  height: 14px;
}

/* ── Footer ── */
.site-foot { border-top: 1px solid var(--border); padding: 40px 0; }
.site-foot__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot p { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); margin: 0; letter-spacing: 0.03em; }
.site-foot a { text-decoration: underline; }

/* ── View animation ── */
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.app-content { animation: fade 280ms ease both; }

/* ── Responsive ── */
@media (max-width: 920px) {
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero__media { min-height: 300px; }
  .detail-body { grid-template-columns: 1fr; gap: 40px; }
  .ingredients { position: static; }
  .recipe-head { grid-template-columns: 1fr; grid-template-areas: "title" "meta" "blurb" "tags"; padding-bottom: 20px; }
  .recipe-head__meta { text-align: left; display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
  .recipe-head__time { font-size: 22px; margin-top: 0; }
  .recipe-image-wrap { margin-top: 16px; }
  .calc { grid-template-columns: 120px 1fr; gap: 24px; }
  .calc-left .v { font-size: 60px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .site-head__row { height: 64px; gap: 12px; }
  .brand__sub { display: none; }
  .head-spacer { display: none; }
  .search { flex: 1; max-width: 260px; min-width: 0; }

  .grid { grid-template-columns: 1fr; gap: 22px; }
  .filters { padding-top: 12px; }
  .back-bar { padding-top: 12px; padding-bottom: 8px; }
  .recipe-head__title { font-size: clamp(36px, 9vw, 60px); }
  .calc { grid-template-columns: 1fr; gap: 12px; }
  .calc--yield .calc-left .v { font-size: 14px; }
  .list-page, .detail {
    min-height: calc(100vh - 65px);
  }
  .about-section {
    padding-bottom: 32px;
  }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
  }
}

/* ── Print ── */
@media print {
  @page { size: A4 portrait; margin: 7.5mm 3.75mm; }
  html, body { background: white; font-size: 9.5pt; min-height: 0 !important; height: auto !important; }
  .site-head, .back-bar, .fav-btn, .calc,
  .gallery-strip, .site-foot, .lightbox, .recipe-actions, .see-also,
  .recipe-image-wrap, .recipe-head__tags, .ing-check { display: none !important; }
  .app-content { animation: none !important; transform: none !important; }
  .detail { padding-bottom: 40px !important; animation: none; min-height: 0 !important; height: auto !important; }
  .recipe-head {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas: "title meta" "blurb meta" !important;
    column-gap: 20px !important;
    align-items: start !important;
    margin-top: 0;
    padding-bottom: 12px;
  }
  .recipe-head__title { font-size: 20pt; line-height: 1.1; margin: 0; grid-area: title !important; }
  .recipe-head__blurb { font-size: 9pt; line-height: 1.4; margin-top: 6px; grid-area: blurb !important; }
  .recipe-head__meta {
    grid-area: meta !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-self: end !important;
    gap: 4px !important;
  }
  .recipe-head__time-row, .print-meta-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    margin-top: 0 !important;
  }
  .recipe-head__time-row .k, .print-meta-row .k {
    font-family: var(--font-mono) !important;
    font-size: 9pt !important;
    text-transform: uppercase !important;
    color: var(--text-faint) !important;
  }
  .recipe-head__time-row .k::after, .print-meta-row .k::after {
    content: ":" !important;
  }
  .recipe-head__time, .print-meta-row span, .print-meta-row small {
    display: inline !important;
    font-family: var(--font-display) !important;
    font-size: 11pt !important;
    margin-top: 0 !important;
    text-transform: none !important;
  }
  .print-only {
    display: flex !important;
  }
  .detail-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    margin-top: 16px;
  }
  .ingredients { position: static; }
  .panel-title { font-size: 11pt; margin-bottom: 8px; }
  .ing-item { padding: 3px 0; margin: 0; border-bottom: none; gap: 6px; }
  .ing-qty { font-size: 8pt; min-width: 60px; }
  .ing-name-text { font-size: 8.5pt; }
  .step { grid-template-columns: 24px 1fr; gap: 10px; padding: 0 0 12px 0; margin: 0; }
  .step__num { width: 24px; height: 24px; font-size: 9.5pt; }
  .step__text { font-size: 9pt; line-height: 1.4; padding-top: 2px; }
  .step:not(:last-child)::after { left: 12px; top: 28px; bottom: 2px; }
  .print-foot {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: var(--maxw);
    margin: 0 auto;
    box-sizing: border-box;
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    border-top: 1px solid var(--border);
    padding: 12px clamp(32px, 5vw, 64px) 8px;
    font-family: var(--font-body);
    font-size: 9.5pt;
    color: var(--text-faint);
  }
  .print-foot a {
    color: var(--text-faint) !important;
    text-decoration: none !important;
  }
  .print-foot__link {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
}
