:root {
  color-scheme: light;
  --reader-ink: #2c211b;
  --reader-muted: #65564d;
  --reader-accent: #8f3910;
  --reader-header: #4e2610;
  --reader-paper: #fbf5e8;
  --reader-ground: #faf1e2;
  --reader-line: #d8c3a8;
  --reader-shadow: 0 18px 38px rgba(61, 38, 22, 0.14);
  --font-display: "Kalam", cursive;
  --font-body: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 320px; max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: clip;
  margin: 0;
  color: var(--reader-ink);
  background: var(--reader-ground);
  font-family: var(--font-body);
  transition: background-color 220ms ease, color 220ms ease;
}
button, a { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, .page-stage:focus-visible {
  outline: 3px solid var(--reader-accent);
  outline-offset: 3px;
}
.reader-header .header-button:focus-visible, .reader-header .brand:focus-visible { outline-color: var(--reader-paper); }
::selection { color: #fffaf1; background: var(--reader-accent); }

.header-menu-wrap { position: relative; }
.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--reader-line);
  border-radius: 999px;
  color: var(--reader-ink);
  background: #fffcf6;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.header-button:hover, .header-button[aria-expanded="true"] { border-color: var(--reader-accent); }
.header-button svg, .back-link svg, .recipe-facts svg, .page-arrow svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  min-width: 214px;
  padding: 7px;
  border: 1px solid rgba(67, 41, 23, 0.12);
  border-radius: 14px;
  color: var(--reader-ink);
  background: var(--reader-paper);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}
.header-popover[hidden] { display: none; }
.theme-menu button, .site-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.theme-menu button:hover, .theme-menu button[aria-pressed="true"], .site-menu a:hover, .site-menu a.is-current { background: var(--reader-ground); }
.site-menu { max-height: 70vh; overflow-y: auto; }
.site-menu-divider { margin: 6px 10px 4px; padding-top: 6px; border-top: 1px solid var(--reader-line); color: var(--reader-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.site-menu a.is-current { font-weight: 600; color: var(--reader-accent); }
.theme-menu button[aria-pressed="true"]::after { content: "Seçili"; margin-left: auto; color: var(--reader-muted); font-size: 12px; }
.theme-swatch { width: 22px; height: 22px; border: 1px solid rgba(36, 25, 17, 0.18); border-radius: 7px; }
.swatch-warm { background: linear-gradient(135deg, #a94312 0 42%, #fffaf1 42%); }
.swatch-sketch { background: #fff; box-shadow: inset 0 0 0 1px #222; }
.swatch-editorial { background: linear-gradient(135deg, #445649 0 42%, #f4f0e7 42%); }

.recipe-reader {
  position: relative;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 12px 0 16px;
  background-color: var(--reader-ground);
}
.reader-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.decor-ingredient--reader-1 { left: 0; top: 6%; transform: translateX(-30%) rotate(-24deg); }
.decor-ingredient--reader-2 { right: 0; top: 10%; transform: translateX(30%) rotate(22deg); }
.decor-ingredient--reader-3 { left: 0; top: 40%; transform: translateX(-30%) rotate(18deg); }
.decor-ingredient--reader-4 { right: 0; top: 44%; transform: translateX(30%) rotate(-25deg); }
.decor-ingredient--reader-5 { left: 0; top: 74%; transform: translateX(-30%) rotate(-18deg); }
.decor-ingredient--reader-6 { right: 0; top: 76%; transform: translateX(30%) rotate(20deg); }
.reader-topline, .notebook, .page-navigation, .reader-hint, .recipe-error { position: relative; z-index: 1; }
.reader-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 100%; margin: 0 auto 8px; padding: 0 24px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border: 1px solid var(--reader-line); border-radius: 999px; color: var(--reader-ink); background: #fffcf6; font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { border-color: var(--reader-accent); }
.back-link svg { width: 18px; height: 18px; }
.topline-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reviews-jump { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid var(--reader-line); border-radius: 999px; color: var(--reader-accent); background: #fffcf6; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.reviews-jump:hover { border-color: var(--reader-accent); }
.book-name { margin: 0; color: var(--reader-header); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-align: right; text-transform: uppercase; }
.reader-heading { margin: 0; }
.reader-hint { margin: 6px auto 0; padding: 0 16px; color: var(--reader-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.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; }

.notebook {
  position: relative;
  width: min(100%, max(320px, calc((100dvh - 224px) * 1371 / 937)));
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 1371 / 937;
  margin: auto;
}
.notebook-frame {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.notebook-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(45, 23, 11, 0.2));
}
.page-stage {
  position: absolute;
  top: 6%;
  right: 10%;
  bottom: 6.5%;
  left: 10%;
  touch-action: pan-x;
}
.notebook-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10%;
  height: 100%;
}
.notebook-spread.is-changing { animation: page-arrive 240ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes page-arrive { from { opacity: .72; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
.notebook-page {
  position: relative;
  height: 100%;
  padding: 0;
  overflow: hidden;
  overflow-x: hidden;
  color: var(--reader-ink);
  background: transparent;
}
.notebook-page[hidden] { display: none; }
.notebook-page h2 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 34px); font-weight: 700; line-height: 1.08; }
.cover-page { display: flex; flex-direction: column; justify-content: center; gap: 12px; height: 100%; min-height: 0; }
.cover-page.has-nutrition { gap: 10px; }
.cover-copy { position: relative; z-index: 1; }
.cover-page h2 { font-size: clamp(26px, 3vw, 38px); }
.cover-description { max-width: 34ch; margin: 10px 0 0; color: var(--reader-muted); font-size: 16px; line-height: 1.5; }
.recipe-facts { display: flex; flex-wrap: nowrap; gap: clamp(6px, 1.4vw, 10px); margin-top: 12px; }
.recipe-facts > span { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 1 1 0; min-width: 0; min-height: 32px; padding: 5px clamp(6px, 1.6vw, 10px); border: 1px solid var(--reader-line); border-radius: 8px; color: var(--reader-muted); background: rgba(255, 250, 241, 0.6); font-size: clamp(11.5px, 2.8vw, 13px); font-weight: 600; white-space: nowrap; }
.recipe-facts svg { width: 15px; height: 15px; flex: none; color: var(--reader-accent); }
.extras-page { gap: 12px; }
.extras-block h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 19px; color: var(--reader-ink); }
.extras-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45; color: var(--reader-ink); }
.pairing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pairing-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--reader-line);
  border-radius: 10px;
  background: rgba(255, 250, 241, 0.55);
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms ease, transform 150ms ease;
}
.pairing-card:hover { border-color: var(--reader-accent); transform: translateY(-1px); }
.pairing-card strong { font-size: 13px; color: var(--reader-ink); }
.pairing-card span { font-size: 11.5px; color: var(--reader-muted); line-height: 1.3; }
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; overflow-y: auto; }
.faq-item { padding: 8px 10px; border: 1px solid var(--reader-line); border-radius: 10px; background: rgba(255, 250, 241, 0.5); }
.faq-item h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--reader-accent); }
.faq-item p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--reader-ink); }
.start-reading { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; margin-top: 16px; padding: 0 14px; border: 0; border-radius: 9px; color: #fffaf1; background: var(--reader-accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.start-reading:hover { filter: brightness(1.08); }
.start-reading span { font-size: 17px; line-height: 1; }
.cover-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-top: 10px;
  padding: 4px 11px;
  border: 1px solid var(--reader-line);
  border-radius: 999px;
  color: var(--reader-accent);
  background: rgba(255, 250, 241, 0.72);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.cover-rating-pill:hover { border-color: var(--reader-accent); }
.cover-art { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; margin: 0; overflow: hidden; border-radius: 12px; background: transparent; }
.cover-art img { width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.cover-page.has-no-image .cover-copy { max-width: 56ch; }
.cover-note { margin: 0; color: var(--reader-muted); font-size: 15px; font-style: italic; text-align: right; }

.content-page { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.ingredients-page { height: 100%; }
.closing-page { justify-content: center; align-items: center; }
.closing-note { margin: 0; color: var(--reader-muted); font-family: var(--font-display); font-size: 26px; }
.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--reader-line); }
.page-title-row h2 { font-size: clamp(24px, 2.6vw, 32px); }
.page-title-row p { margin: 4px 0 0; color: var(--reader-muted); font-size: 12.5px; }
.page-stamp { flex: none; margin-top: 4px; padding: 5px 8px; border: 1px solid var(--reader-line); border-radius: 7px; color: var(--reader-accent); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ingredients-layout { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 10px; padding-top: 8px; }
.ingredient-section { display: flex; flex: 1 1 auto; min-height: 0; }
.ingredient-list { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1 1 auto; width: 100%; min-height: 0; margin: 0; padding: 0; list-style: none; }
.ingredient-list li { display: flex; align-items: stretch; justify-content: space-between; gap: 10px; flex: 1 1 0; min-height: 0; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--reader-line) 68%, transparent); }
.ingredient-row { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; min-height: 0; }
.ingredient-thumb { display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: stretch; height: 100%; width: auto; aspect-ratio: 1 / 1; }
.ingredient-thumb img { width: 100%; height: 100%; max-width: none; max-height: 100%; object-fit: contain; }
.ingredient-name { font-size: 13.5px; line-height: 1.35; }
.ingredient-index { display: inline-flex; align-items: center; flex: none; color: var(--reader-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.supporting-gallery { display: grid; flex: none; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.supporting-image { margin: 0; }
.supporting-image img { width: 100%; max-height: clamp(72px, 11dvh, 120px); object-fit: cover; border-radius: 10px; }
.supporting-image figcaption { margin-top: 4px; color: var(--reader-muted); font-size: 12px; font-style: italic; }
.nutrition-block { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--reader-line); }
.nutrition-block h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.nutrition-block h2 span { color: var(--reader-muted); font-family: var(--font-body); font-size: 11.5px; font-weight: 500; }
.nutrition-block dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin: 10px 0 0; }
.nutrition-block dl div { padding: 7px; border: 1px solid var(--reader-line); border-radius: 8px; }
.nutrition-block dt { color: var(--reader-muted); font-size: 11.5px; }
.nutrition-block dd { margin: 3px 0 0; font-size: 18px; font-variant-numeric: tabular-nums; }
.nutrition-block dd small { margin-left: 2px; color: var(--reader-muted); font-family: var(--font-body); font-size: 11px; }
.empty-note { color: var(--reader-muted); font-size: 13px; line-height: 1.65; }

.step-content { flex: 0 0 auto; display: grid; grid-template-columns: 1fr; align-items: start; gap: 14px; padding: 16px 0; }
.step-label { margin: 0 0 8px; color: var(--reader-accent); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.step-instruction { margin: 0; font-size: clamp(17.1px, 1.98vw, 21.6px); line-height: 1.45; }
.step-note { margin: 12px 0 0; color: var(--reader-muted); font-size: 13px; line-height: 1.55; }
.step-visual-gallery {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: center;
  align-items: center;
  justify-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 8px 0;
}
.step-visual-gallery.is-single {
  grid-template-columns: 1fr;
}
.step-visual-gallery.is-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.step-visual {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step-visual-gallery .step-visual {
  height: 100%;
  min-height: 0;
  justify-content: center;
}
.step-visual-gallery.is-single .step-visual {
  max-width: 100%;
}
.step-visual img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  filter: sepia(0.08) contrast(0.97);
}
.step-visual-gallery.is-single .step-visual img {
  max-height: 100%;
}
.step-visual figcaption { margin-top: 6px; color: var(--reader-muted); font-size: 12px; font-style: italic; text-align: center; }

/* Sketchbook wrap + asymmetric 2-image composition */
.step-flow {
  flex: 0 0 auto;
  display: flow-root;
  padding: 14px 0 4px;
}
.step-flow::after {
  content: "";
  display: block;
  clear: both;
}
.step-float-visual {
  float: right;
  width: clamp(118px, 44%, 210px);
  margin: 0 0 6px 12px;
  shape-outside: circle(46% at 50% 50%);
  shape-margin: 10px;
  transform: rotate(4deg);
}
.step-float-visual img {
  max-height: clamp(120px, 21dvh, 210px);
}
.step-sketch-lower {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0;
  padding-top: 6px;
}
.step-sketch-connector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  padding-right: 12%;
  margin-bottom: 2px;
}
.step-doodle-arrow {
  width: clamp(68px, 12vw, 110px);
  height: auto;
  fill: none;
  stroke: color-mix(in srgb, var(--reader-accent) 70%, var(--reader-muted));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 4;
}
.step-pencil-note {
  color: var(--reader-muted);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.5vw, 17px);
  transform: rotate(-4deg);
  opacity: 0.85;
}
.step-main-sketch {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 84%;
  margin: 0 auto;
  overflow: hidden;
  justify-content: center;
  transform: rotate(-3deg);
}
.step-main-sketch img {
  flex: 0 1 auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}
.step-single-sketch {
  transform: rotate(-2.5deg);
}
.step-ingredient-visuals {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 20px);
  margin-top: 0;
  padding: 8px 0 4px;
}
.step-ingredient-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  width: clamp(68px, 8.5vw, 112px);
}
.step-ingredient-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.step-ingredient-item figcaption {
  margin-top: 4px;
  color: var(--reader-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.reviews-page {
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--reader-line) transparent;
}
.reviews-page::-webkit-scrollbar { width: 6px; }
.reviews-page::-webkit-scrollbar-track { background: transparent; }
.reviews-page::-webkit-scrollbar-thumb { background: var(--reader-line); border-radius: 999px; }
.review-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--reader-line);
  border-radius: 10px;
  background: rgba(255, 250, 241, 0.52);
}
.review-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.review-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.review-field > span { color: var(--reader-muted); font-size: 11.5px; font-weight: 600; }
.review-field input, .review-field textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--reader-line);
  border-radius: 8px;
  color: var(--reader-ink);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 13px;
}
.review-field textarea { resize: vertical; min-height: 54px; }
.review-field input:focus-visible, .review-field textarea:focus-visible { outline: 2px solid var(--reader-accent); outline-offset: 1px; }
.star-picker { display: inline-flex; align-items: center; gap: 2px; min-height: 34px; }
.star-btn {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--reader-muted) 40%, transparent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.star-btn.is-selected { color: #c77416; }
.review-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.review-submit {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #fffaf1;
  background: var(--reader-accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.review-submit:hover:not(:disabled) { filter: brightness(1.08); }
.review-submit:disabled { opacity: 0.65; cursor: wait; }
.review-form-status { margin: 0; font-size: 12px; font-weight: 600; }
.review-form-status.is-success { color: #2b6b38; }
.review-form-status.is-error { color: #a1261b; }
.review-list-section { flex: 1 1 auto; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.review-item {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--reader-line) 80%, transparent);
  border-radius: 9px;
  background: rgba(255, 250, 241, 0.44);
}
.review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.review-item-stars { color: #c77416; font-size: 13px; letter-spacing: 0.06em; }
.review-item-comment { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--reader-ink); }
.review-item-date { display: block; margin-top: 4px; color: var(--reader-muted); font-size: 11px; }

.page-navigation { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 14px; width: min(100%, 340px); margin: 10px auto 0; }
.page-arrow { display: grid; width: 46px; height: 46px; place-items: center; border: 1.5px solid var(--reader-line); border-radius: 50%; color: var(--reader-accent); background: #fffcf6; cursor: pointer; }
.page-arrow:hover:not(:disabled) { border-color: var(--reader-accent); background: #fff; }
.page-arrow:disabled { color: color-mix(in srgb, var(--reader-muted) 38%, var(--reader-paper)); cursor: not-allowed; }
.page-position { min-width: 0; }
.page-position p { margin: 0 0 6px; color: var(--reader-header); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.progress-track { height: 3px; overflow: hidden; border-radius: 9px; background: var(--reader-line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--reader-accent); transition: width 220ms ease; }
.recipe-error { width: min(calc(100% - 48px), 720px); margin: 0 auto; padding: 38px 22px; border-radius: 16px; background: var(--reader-paper); box-shadow: var(--reader-shadow); text-align: center; }
.recipe-error h2 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.recipe-error p { color: var(--reader-muted); font-size: 14px; line-height: 1.6; }
.error-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px; border-radius: 9px; color: #fffaf1; background: var(--reader-accent); font-size: 13px; font-weight: 700; text-decoration: none; }

.theme-sketch {
  --reader-ink: #171717;
  --reader-muted: #444;
  --reader-accent: #171717;
  --reader-header: #171717;
  --reader-paper: #fff;
  --reader-ground: #f3f3f1;
  --reader-line: #b7b7b4;
  --reader-shadow: 0 16px 30px rgba(0, 0, 0, 0.1);
}
.theme-sketch .reader-header { color: #171717; background: #fff; border-bottom: 2px solid #171717; box-shadow: none; }
.theme-sketch .header-button { border-color: #171717; color: #171717; background: #fff; }
.theme-sketch .notebook-frame img { filter: grayscale(1) contrast(1.08) drop-shadow(0 16px 28px rgba(0, 0, 0, 0.14)); }
.theme-sketch .brand img, .theme-sketch .cover-art img, .theme-sketch .supporting-image img, .theme-sketch .step-visual img { filter: grayscale(1); }
.theme-sketch .reader-decor .decor-ingredient { filter: grayscale(1); opacity: 0.35; }
.theme-sketch .cover-art, .theme-sketch .supporting-image img, .theme-sketch .step-visual img { border: 2px solid #171717; border-radius: 12px; }
.theme-sketch .reader-header .header-button:focus-visible, .theme-sketch .reader-header .brand:focus-visible { outline-color: #171717; }
.theme-sketch .header-popover { border: 2px solid #171717; }
.theme-sketch .back-link, .theme-sketch .reviews-jump, .theme-sketch .cover-rating-pill, .theme-sketch .page-arrow, .theme-sketch .start-reading, .theme-sketch .error-link, .theme-sketch .review-submit { border: 1.5px solid #171717; border-radius: 10px; color: #171717; background: #fff; }
.theme-sketch .star-btn.is-selected, .theme-sketch .review-item-stars { color: #171717; }
.theme-sketch .page-arrow { border-radius: 50%; }
.theme-sketch .page-arrow:disabled { color: #aaa; }
.theme-sketch .start-reading { font-family: var(--font-body); }
.theme-sketch .progress-track span { background: #171717; }

.theme-editorial {
  --reader-ink: #202822;
  --reader-muted: #59645a;
  --reader-accent: #405b49;
  --reader-header: #263a2e;
  --reader-paper: #fbf9f3;
  --reader-ground: #ece9df;
  --reader-line: #c9ccbf;
  --reader-shadow: 0 20px 44px rgba(26, 39, 29, 0.12);
}
.theme-editorial .notebook-frame img { filter: sepia(0.18) saturate(0.72) hue-rotate(48deg) drop-shadow(0 18px 34px rgba(26, 39, 29, 0.18)); }

@media (max-width: 768px) {
  .header-button { gap: 6px; min-height: 32px; padding: 0 9px; font-size: 11.5px; }
  .theme-trigger span { display: none; }
  .recipe-reader { display: block; width: 100%; max-width: 100%; padding: 12px 0 28px; }
  .reader-topline { margin-bottom: 10px; padding: 0 14px; }
  .topline-meta { gap: 6px; min-width: 0; }
  .reviews-jump { min-height: 32px; padding: 0 9px; font-size: 11.5px; }
  .book-name { max-width: 110px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .review-form-row { grid-template-columns: 1fr; }
  .notebook {
    width: min(calc(100% - 12px), 45dvh);
    aspect-ratio: 615 / 926;
    margin: 0 auto;
  }
  .page-stage {
    top: 5.5%;
    right: 7%;
    bottom: 5.5%;
    left: 21.5%;
  }
  .notebook-spread {
    grid-template-columns: 1fr;
    gap: 0;
  }
  body:not(.notebook-ready) #notebook-page-right { display: none; }
  .notebook-page h2 { font-size: clamp(26px, 7.2vw, 34px); }
  .cover-page { justify-content: safe center; gap: clamp(4px, 0.9dvh, 10px); }
  .cover-page.has-nutrition { gap: clamp(3px, 0.7dvh, 7px); }
  .cover-page h2 { font-size: clamp(20px, min(7.8vw, 3.3dvh), 30px); line-height: 1.02; }
  .cover-description { margin-top: clamp(4px, 0.8dvh, 8px); font-size: clamp(12px, min(4vw, 1.9dvh), 16px); line-height: 1.35; }
  .cover-rating-pill { min-height: clamp(24px, 3.8dvh, 32px); margin-top: clamp(4px, 0.8dvh, 8px); padding: 3px 9px; font-size: clamp(10px, 1.5dvh, 12px); }
  .nutrition-block { margin-top: clamp(2px, 0.5dvh, 6px); padding-top: clamp(4px, 0.8dvh, 8px); }
  .nutrition-block h2 { font-size: clamp(14px, 2.2dvh, 18px); }
  .nutrition-block h2 span { font-size: clamp(9px, 1.4dvh, 11.5px); }
  .nutrition-block dl { gap: clamp(3px, 0.6dvh, 6px); margin-top: clamp(4px, 0.8dvh, 10px); }
  .nutrition-block dl div { padding: clamp(4px, 0.7dvh, 7px); }
  .nutrition-block dt { font-size: clamp(9px, 1.4dvh, 11.5px); }
  .nutrition-block dd { font-size: clamp(14px, 2.1dvh, 18px); }
  .nutrition-block dd small { font-size: clamp(9px, 1.3dvh, 11px); }
  .cover-note { font-size: clamp(11px, 1.8dvh, 14px); }
  .ingredient-name { font-size: 15px; }
  .step-instruction { font-size: clamp(18px, 4.86vw, 21.6px); }
  .step-note { font-size: 14.5px; }
  .step-ingredient-item { width: clamp(62px, 18vw, 88px); }
  .page-navigation { grid-template-columns: 46px 1fr 46px; gap: 10px; width: min(100%, 280px); margin-top: 12px; }
  .page-arrow { width: 44px; height: 44px; }
  .reader-hint { margin-top: 10px; }
}

@media (max-height: 620px) and (max-width: 1024px) {
  .cover-page { justify-content: safe center; gap: 4px; }
  .cover-page.has-nutrition { gap: 3px; }
  .cover-page h2 { font-size: clamp(18px, min(6vw, 4.6dvh), 24px); }
  .cover-description { margin-top: 3px; font-size: clamp(11px, min(3.5vw, 1.8dvh), 14px); line-height: 1.25; }
  .recipe-facts { gap: 4px; margin-top: 4px; }
  .recipe-facts > span { min-height: 22px; padding: 2px 4px; font-size: clamp(9px, 2.2dvh, 11px); }
  .recipe-facts svg { width: 12px; height: 12px; }
  .cover-rating-pill { min-height: 22px; margin-top: 3px; padding: 2px 7px; font-size: 10px; }
  .nutrition-block { margin-top: 2px; padding-top: 3px; }
  .nutrition-block h2 { font-size: clamp(13px, 3.4dvh, 16px); }
  .nutrition-block h2 span { font-size: 9px; }
  .nutrition-block dl { gap: 3px; margin-top: 4px; }
  .nutrition-block dl div { padding: 3px; }
  .nutrition-block dt { font-size: 9px; }
  .nutrition-block dd { font-size: clamp(13px, 3.8dvh, 16px); }
  .nutrition-block dd small { font-size: 9px; }
  .cover-note { font-size: 10px; }
}

@media (max-width: 360px) {
  .reader-topline { padding-right: 10px; padding-left: 10px; }
  .recipe-facts { gap: 4px; }
  .recipe-facts > span { padding-inline: 5px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
