:root {
  --desk: #070e19;
  --paper: #0f1a2b;
  --page: #101a2b;
  --ink: #f7f4ee;
  --text: #ebe7df;
  --soft: #a3b3c9;
  --rule: rgba(255, 255, 255, 0.28);
  --line: rgba(255, 255, 255, 0.6);
  --display: "Amatic SC", "Frank Ruhl Libre", "Times New Roman", serif;
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --hand: "Gveret Levin", "Segoe Print", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--desk);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; color: var(--ink); overflow-wrap: break-word; }
p { margin: 0; }
img { display: block; max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.soft { color: var(--soft); }

/* ---------- Pages ---------- */
.sheet { background: var(--paper); padding: clamp(24px, 5vw, 56px); position: relative; }
.running { font-size: 14px; color: var(--soft); margin-bottom: 22px; }
.hair { display: block; width: 100%; height: 1px; background: var(--rule); margin: 18px 0; }
.label { font-size: 13px; color: var(--soft); }
.sheet-title { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 7vw, 76px); line-height: 1; }
.block-title { font-size: 22px; color: var(--ink); margin-bottom: 8px; }

.btn {
  background: var(--ink);
  color: #08111e;
  padding: 11px 28px;
  font-size: 15px;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.btn:hover { background: #fff; }
.btn.added { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-line {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.btn-line:hover { border-color: var(--ink); color: var(--ink); }

.plate { overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.plate img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cover ---------- */
.cover { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.cover-sheet { width: min(600px, 100%); text-align: center; padding: 28px clamp(24px, 5vw, 56px) 48px; }
.cover-sheet .running { margin-bottom: 18px; }
.cover-sheet .plate {
  width: auto;
  aspect-ratio: 5 / 4;
  margin: 0 calc(-1 * clamp(24px, 5vw, 56px)) 0;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.cover-sheet .plate img { object-position: 50% 22%; }
.cover-title { font-family: var(--display); font-weight: 700; font-size: clamp(68px, 12vw, 108px); line-height: 0.95; color: #fff; margin-top: -28px; }
.cover-sheet .hair { width: 48px; margin: 18px auto; background: var(--line); }
.cover-sub { font-size: 22px; color: var(--text); }
.dedication { margin: 22px auto 0; max-width: 30em; font-size: 18px; line-height: 1.8; color: var(--text); }
.signed { margin: 30px auto 34px; padding-top: 20px; border-top: 1px solid var(--rule); max-width: 30em; font-size: 16px; line-height: 1.8; }
.signed .label { margin-bottom: 4px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 17, 30, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 54px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1; color: #fff; }
.tabs { display: flex; gap: 26px; height: 100%; }
.tab {
  height: 100%;
  font-size: 15px;
  color: var(--soft);
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--ink);
  color: #08111e;
  font-size: 11px;
  display: inline-grid;
  place-items: center;
}
.count.zero { background: rgba(255, 255, 255, 0.22); color: var(--ink); }

.desk { max-width: 1160px; margin: 0 auto; padding: 28px 24px 70px; }

/* ---------- Contents ---------- */
.toc {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  column-gap: 56px;
  row-gap: 8px;
  align-items: start;
  background: transparent;
  padding: 8px 0 40px;
}
.toc-head { grid-column: 1; }
#sections { grid-column: 1; min-width: 0; }
#featured { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; min-width: 0; }
.toc .hair { width: 40px; height: 1px; background: var(--line); margin: 16px 0 20px; }
.search input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 10px 0;
  margin-top: 6px;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}
.search input::placeholder { color: var(--soft); }
.search input:focus { border-bottom-color: var(--ink); }
.chapters { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 20px; font-size: 16px; }
.chapters button { color: var(--soft); padding: 2px 0; transition: color 0.2s ease; }
.chapters button:hover { color: var(--ink); }
.chapters button.on { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }

.chapter { margin-top: 26px; }
.chapter-toggle {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}
.chapter-toggle .mark { font-size: 22px; line-height: 1; color: var(--soft); }
.chapter-toggle:hover .mark { color: var(--ink); }
.chapter-rule { display: block; width: 32px; height: 1px; background: var(--line); margin: 8px 0 4px; }
.entries { display: block; }
.entry { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; }
.entry-name { color: var(--ink); font-size: 18px; text-align: right; max-width: 80%; line-height: 1.45; }
.entry-name:hover { color: var(--soft); }
.leader { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-4px); min-width: 16px; }
.entry-page { font-size: 15px; color: var(--soft); min-width: 22px; text-align: left; }
.pick-btn {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  align-self: center;
  transition: all 0.2s ease;
}
.pick-btn:hover { border-color: var(--ink); }
.pick-btn.in { background: var(--ink); border-color: var(--ink); color: #08111e; font-size: 13px; }
.empty { padding: 50px 0 10px; color: var(--soft); }
.toc-photos { display: flex; flex-direction: column; gap: 16px; }
.toc-photo { display: block; width: 100%; }
.toc-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ---------- Recipe: one portrait master page (2:3) ---------- */
:root { --title-font: "Amatic SC", "Frank Ruhl Libre", serif; --head-font: "Gveret Levin", "Frank Ruhl Libre", serif; --ivory: #f2ede0; --silver: #a8adb2; --navy: 16, 27, 42; --deep: 8, 14, 22; }
.recipe { min-width: 0; max-width: 720px; margin: 0 auto; }
.book-stage { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 14px; }
.page-turn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(168, 173, 178, 0.6);
  color: var(--ivory);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.page-turn .arrow { font-size: 30px; line-height: 1; }
.page-turn .turn-label { display: none; }
.page-turn:hover:not(:disabled) { background: var(--ivory); color: #101b2a; }
.page-turn:disabled { opacity: 0.3; cursor: default; }
.page-turn:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }

.page-wrap { container-type: inline-size; min-width: 0; }
.spread {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  aspect-ratio: 2 / 3;
  color: var(--ivory);
  background-color: #101b2a;
  background-image:
    radial-gradient(ellipse 75% 34% at 0 0, rgba(var(--deep), 0.9), rgba(var(--deep), 0)),
    radial-gradient(ellipse 75% 34% at 100% 0, rgba(var(--deep), 0.9), rgba(var(--deep), 0)),
    radial-gradient(ellipse 70% 26% at 72% 24%, rgba(52, 68, 86, 0.3), rgba(52, 68, 86, 0)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .7 0 0 0 0 .82 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100% 100%, 100% 100%, 100% 100%, 220px 220px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}
.spread > * { position: relative; z-index: 1; }
/* the recipe's own photo: a dedicated layer anchored to the bottom, upper edge fading into the navy */
.spread > .photo-layer {
  position: absolute;
  z-index: 0;
  inset-inline: 0;
  bottom: 0;
  height: 100cqw;
  background: var(--photo, none) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 10%, rgba(0, 0, 0, 0.22) 26%, #000 40%);
  mask-image: linear-gradient(to bottom, transparent 0, transparent 10%, rgba(0, 0, 0, 0.22) 26%, #000 40%);
}
.photo-layer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(var(--deep), 0) 70%, rgba(var(--deep), 0.5) 100%); }

/* title: 6-13% of the page height */
.recipe-head { position: relative; flex: none; min-height: 30cqw; padding: 9cqw 4cqw 0; text-align: center; }
.from-notebook { position: absolute; top: 3cqw; inset-inline: 0; font-family: var(--hand); font-size: max(13px, 2.6cqw); line-height: 1.2; color: var(--silver); }
.recipe-title {
  margin: 0 auto;
  max-width: 92cqw;
  font-family: var(--title-font);
  font-weight: 700;
  font-size: max(40px, var(--tsize, 8cqw));
  line-height: 0.95;
  color: var(--ivory);
}
.recipe-sub { margin-top: 0.8cqw; font-size: max(14px, 2.8cqw); line-height: 1.4; color: rgba(242, 237, 224, 0.85); }
.recipe-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.2cqw 3cqw; margin-top: 2.2cqw; font-size: max(13px, 2.4cqw); }
.qty-step { display: inline-flex; align-items: center; gap: 1.4cqw; }
.qty-step button {
  width: max(24px, 4cqw);
  height: max(24px, 4cqw);
  border: 1px solid rgba(168, 173, 178, 0.7);
  border-radius: 50%;
  color: var(--ivory);
  font-size: max(15px, 2.8cqw);
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.qty-step button:hover { border-color: var(--ivory); }
.qty-step output { min-width: 3.4em; text-align: center; }
.notebook-link { color: var(--ivory); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(168, 173, 178, 0.6); }
.notebook-link:hover { text-decoration-color: var(--ivory); }
.recipe-tools .btn { font-size: max(12px, 2.3cqw); padding: 0.45em 1.2em; background: var(--ivory); color: #101b2a; }
.recipe-tools .btn.added { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1px var(--ivory); }

/* headings at ~21%, body from ~25%; columns 26 / 5 / 69 of the usable width */
.cols {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 26fr) minmax(0, 5fr) minmax(0, 69fr);
  margin-inline: 4cqw;
  padding-bottom: 4cqw;
}
.page { min-width: 0; }
.page-r { grid-column: 1; }
.page-l { grid-column: 3; }
.page h2 {
  margin: 0 0 3cqw;
  font-family: var(--head-font);
  font-weight: 400;
  font-size: max(17px, 3.8cqw);
  line-height: 1.3;
  text-align: center;
  color: var(--ivory);
}
/* fine silver rule in the gutter, ending ~64% of the page height */
.cols::before {
  content: "";
  position: absolute;
  inset-inline-start: 28.5%;
  top: 7cqw;
  width: 1px;
  height: max(59cqw, calc(100% - 7cqw));
  background: rgba(168, 173, 178, 0.5);
}
.rule-icon {
  position: absolute;
  inset-inline-start: 28.5%;
  top: -0.5cqw;
  width: 7cqw;
  height: 6.4cqw;
  transform: translateX(50%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.ico-leaf { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F2EDE0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 28V10'/%3E%3Cpath d='M16 21c-5 0-8-3-8-8 5 0 8 3 8 8z'/%3E%3Cpath d='M16 15c5 0 8-3 8-8-5 0-8 3-8 8z'/%3E%3C/svg%3E"); }
.ico-cake { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F2EDE0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 25h22v3H5z'/%3E%3Cpath d='M7 25V17h18v8'/%3E%3Cpath d='M7 17c2-3 4-3 6 0 2-3 4-3 6 0 2-3 4-3 6 0'/%3E%3Cpath d='M16 13V8'/%3E%3Cpath d='M16 8c1.5-1 1.5-3 0-4-1.500 1-1.500 3 0 4z'/%3E%3C/svg%3E"); }
.ico-fish { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F2EDE0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 16c4-6 10-8 16-3l8-4v14l-8-4c-6 5-12 3-16-3z'/%3E%3Ccircle cx='9' cy='15' r='0.8'/%3E%3Cpath d='M14 12c1 2 1 6 0 8'/%3E%3C/svg%3E"); }
.ico-meat { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F2EDE0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4c5 0 8 3 8 8s-3 8-8 8c-2 0-4-1-5-2l-7 7-4-4 7-7c-1-1-2-3-2-5 0-5 3-5 11-5z'/%3E%3Cpath d='M5 25l-2 2M8 28l-2 2'/%3E%3C/svg%3E"); }
.ico-bowl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23F2EDE0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15h24c0 7-5 11-12 11S4 22 4 15z'/%3E%3Cpath d='M11 12c0-2 2-2 2-5M17 12c0-2 2-2 2-5M23 12c0-2 2-2 2-5'/%3E%3C/svg%3E"); }

.ing, .ing-group, .steps li {
  margin: 0;
  font-size: max(13.5px, 2.5cqw);
  line-height: 1.5;
  color: var(--ivory);
  text-align: right;
  overflow-wrap: anywhere;
  text-shadow: 0 0 6px rgba(var(--deep), 0.95), 0 1px 14px rgba(var(--deep), 0.9);
}
.ing { padding: 0.5cqw 0; }
.ing-group { padding: 1.6cqw 0 0.4cqw; font-weight: 500; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: block; margin: 0 0 1.2cqw; line-height: 1.55; }
.steps .n { color: var(--silver); margin-inline-end: 0.3em; }
.steps .n::after { content: "."; }
.steps li.group { margin-top: 1.8cqw; font-weight: 500; }
.steps li.group .t { font-weight: 500; }
.steps li.intro { margin-bottom: 1.6cqw; }
.num { unicode-bidi: isolate; direction: ltr; }
mark { background: #f1e2a8; color: #101b2a; padding: 0 3px; }
.note {
  margin-top: 2cqw;
  padding: 1.4cqw 2cqw;
  background: rgba(var(--deep), 0.55);
  border-inline-start: 2px solid rgba(168, 173, 178, 0.6);
  font-size: max(12.5px, 2.3cqw);
  line-height: 1.5;
}

/* dish photo area (bottom of the page) */
.recipe-foot { margin-top: auto; flex: none; min-height: 62cqw; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6cqw 4cqw 3cqw; }
.photo-caption { font-size: max(11.5px, 2cqw); color: rgba(242, 237, 224, 0.75); text-shadow: 0 1px 6px rgba(var(--deep), 0.9); }
.thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px 0; }
.thumbs button { width: 48px; height: 34px; border: 1px solid rgba(168, 173, 178, 0.6); border-radius: 2px; overflow: hidden; opacity: 0.65; }
.thumbs button.on, .thumbs button:hover { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* narrow screens: ingredients first, then preparation */
@media (max-width: 600px) {
  .cols { display: flex; flex-direction: column; }
  .page-r { order: 1; padding-bottom: 5cqw; border-bottom: 1px solid rgba(168, 173, 178, 0.5); }
  .rule-icon { order: 2; position: static; transform: none; width: 9cqw; height: 8cqw; margin: 3cqw auto 1cqw; }
  .page-l { order: 3; }
  .cols::before { display: none; }
}
/* ---------- Shopping list ---------- */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.list-head .hair { width: 48px; background: var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 64px; margin-top: 44px; }
.chosen {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.chosen .dot { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.chosen .dot img { width: 100%; height: 100%; object-fit: cover; }
.chosen strong { font-weight: 500; color: var(--ink); display: block; text-align: right; line-height: 1.4; }
.controls { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 14px; }
.mini { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.mini button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--rule); color: var(--ink); line-height: 1; display: inline-grid; place-items: center; }
.remove { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.remove:hover { color: var(--ink); }
.aisle { margin-bottom: 30px; }
.aisle h4 { margin: 0 0 4px; font-weight: 500; font-size: 20px; color: var(--ink); }
.item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.item input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 5px 0 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.item input:checked { background: var(--ink); }
.item input:checked::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #08111e;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-0.5px, -1px);
}
.item .label { color: var(--ink); font-size: 17px; }
.item small { display: block; font-size: 13px; color: var(--soft); }
.item.done .label { color: var(--soft); text-decoration: line-through; text-decoration-color: var(--rule); }
.none { color: var(--soft); padding: 12px 0; line-height: 1.8; }

/* ---------- Lightbox & toast ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 10, 18, 0.95);
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 64px 16px 32px;
}
.lightbox img { max-width: min(900px, 100%); height: auto; align-self: flex-start; }
.lightbox-close {
  position: fixed;
  top: 16px;
  left: 16px;
  color: #fff;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 6px 16px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #08111e;
  padding: 9px 20px;
  font-size: 14px;
  border-radius: 999px;
  z-index: 60;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .list-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 760px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  #featured { grid-column: 1; grid-row: auto; position: static; }
  .toc-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .toc-photo img { aspect-ratio: 4 / 3; }

  .book-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .book-stage .page-wrap { grid-column: 1 / -1; grid-row: 1; }
  .page-turn { width: auto; height: auto; padding: 8px 14px; border-radius: 999px; }
  .page-turn .arrow { font-size: 20px; }
  .page-turn .turn-label { display: inline; font-size: 14px; }
  .page-turn.prev { grid-column: 1; grid-row: 2; justify-self: start; }
  .page-turn.next { grid-column: 2; grid-row: 2; justify-self: end; }
}
@media (max-width: 700px) {
  .desk { padding: 16px 0 60px; }
  .toc { padding-inline: 16px; }
  .topbar-inner { padding: 0 16px; height: 52px; }
  .wordmark { font-size: 28px; }
  .tabs { gap: 16px; }
  .tab { font-size: 14px; }
  .cover { padding: 0; }
  .cover-sheet { min-height: 100vh; }
}

@media print {
  .topbar, #cover, #view-library, #view-recipe, .actions, .mini, .remove, .lightbox, .toast { display: none !important; }
  #app, #view-list { display: block !important; }
  body { background: #fff; color: #000; }
  .sheet { background: #fff; padding: 0; }
  #view-list * { color: #000 !important; border-color: #999 !important; }
  .list-grid { display: block; }
  .aisle { break-inside: avoid; }
}

/* ---------- Whole site: the dark book-card look ---------- */
:root { --display: var(--serif); --desk: #080e16; --paper: #101b2a; --ink: #f2ede0; --text: #f2ede0; --soft: #a8adb2; }
.sheet, .toc {
  background-color: #101b2a;
  background-image: linear-gradient(180deg, #080e16 0, #101b2a 35%, #101b2a 100%);
  color: #fff;
}
.sheet-title, .cover-title { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
.wordmark { font-family: var(--serif); font-weight: 400; font-size: 26px; }
.cover-title { font-size: clamp(56px, 9vw, 84px); line-height: 1.05; color: #fff; margin-top: 0; }

.cover-sheet {
  position: relative;
  overflow: hidden;
  width: min(540px, 100%);
  min-height: min(860px, 100vh);
  padding: 56px clamp(24px, 6vw, 56px) 48px;
  background: #08111e;
}
.cover-sheet > .plate {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.cover-sheet > .plate img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.cover-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 17, 30, 0.96) 0%, rgba(8, 17, 30, 0.86) 38%, rgba(8, 17, 30, 0.42) 60%, rgba(8, 17, 30, 0.7) 84%, rgba(8, 17, 30, 0.94) 100%);
}
.cover-sheet > *:not(.plate) { position: relative; z-index: 2; }

.toc { padding: 36px clamp(20px, 4vw, 48px) 48px; }

@media (max-width: 700px) {
  .cover-sheet { min-height: 100vh; padding: 40px 24px 40px; }
  .cover-title { font-size: 64px; }
  .toc { padding: 24px 16px 40px; }
}

/* ---------- Handwriting everywhere, wider page, photo as its own picture ---------- */
:root { --title-font: "Amatic SC", "Gveret Levin", cursive; --hand: "Gveret Levin", "Amatic SC", cursive; }
html body, html body button, html body input, html body textarea { font-family: var(--hand); }
.sheet-title, .cover-title, .recipe-title, .wordmark, .from-notebook { font-family: var(--title-font); }
body { font-size: 20px; line-height: 1.45; }
.toc .entry-name, .chapter-toggle, .chapters button, .search input { font-size: 20px; }
.entry-page, .running, .label, .photo-caption { font-size: 17px; }
.running { font-size: 19px; }
.cover-sub { font-size: 26px; }
.dedication { font-size: 22px; line-height: 1.6; }
.signed { font-size: 20px; }
.recipe { max-width: 780px; }
.recipe-title { font-size: max(48px, var(--tsize, 8cqw)); font-weight: 700; }
.recipe-sub { font-size: max(20px, 3.8cqw); }
.from-notebook { font-size: max(22px, 4cqw); }
.recipe-tools { font-size: max(19px, 3.2cqw); }
.page h2 { font-size: max(26px, 5cqw); font-weight: 400; }
.ing, .steps li, .steps .t, .steps .n { font-size: max(19px, 3.5cqw); line-height: 1.4; font-weight: 400; }
.ing-group { font-size: max(21px, 4cqw); font-weight: 400; color: var(--ivory); }
.steps li.group .t { font-size: max(21px, 4cqw); font-weight: 400; }
.note { font-size: max(18px, 3.2cqw); }
.btn, .btn-line { font-size: 19px; }
.spread > .photo-layer { height: 66cqw; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%); mask-image: linear-gradient(to bottom, transparent 0, #000 24%); }
.photo-layer::after { background: #2c4566; mix-blend-mode: color; opacity: 0.4; }
@media (max-width: 600px) {
  .ing, .steps li, .steps .t, .steps .n { font-size: 19px; }
  .recipe-title { font-size: 46px; }
  .page h2 { font-size: 26px; }
}

/* ---------- Desktop: a wider card ---------- */
@media (min-width: 900px) {
  .recipe { max-width: 1080px; }
  .spread { aspect-ratio: 3 / 4; }
}

/* ---------- Smaller recipe text ---------- */
.ing, .steps li, .steps .t, .steps .n { font-size: max(15px, 2.8cqw); line-height: 1.4; }
.ing-group, .steps li.group .t { font-size: max(17px, 3.2cqw); }
.page h2 { font-size: max(21px, 4cqw); }
.note { font-size: max(15px, 2.6cqw); }
.recipe-title { font-size: max(40px, var(--tsize, 7cqw)); }
.recipe-sub { font-size: max(16px, 3cqw); }
.recipe-tools { font-size: max(16px, 2.6cqw); }
.from-notebook { font-size: max(18px, 3.2cqw); }
@media (max-width: 600px) {
  .ing, .steps li, .steps .t, .steps .n { font-size: 16px; }
  .recipe-title { font-size: 40px; }
  .page h2 { font-size: 22px; }
}

/* ---------- Recipe text: smaller, regular weight, tighter spacing ---------- */
.recipe-title { font-weight: 400; font-size: max(40px, var(--tsize, 7cqw)); }
.from-notebook, .recipe-sub, .recipe-tools, .recipe-tools .btn, .notebook-link { font-weight: 400; }
.recipe-sub { font-size: max(14px, 2.6cqw); }
.recipe-tools { font-size: max(14px, 2.3cqw); }
.from-notebook { font-size: max(16px, 2.8cqw); }
.page h2 { font-size: max(17px, 3.2cqw); font-weight: 400; margin-bottom: 1.6cqw; }
.ing, .steps li, .steps .t, .steps .n { font-size: max(13px, 2.2cqw); line-height: 1.35; font-weight: 400; }
.ing { padding: 0.25cqw 0; }
.ing-group, .steps li.group .t { font-size: max(14px, 2.6cqw); font-weight: 400; }
.steps li { margin: 0 0 0.7cqw; }
.steps li.group { margin-top: 1.2cqw; }
.note { font-size: max(13px, 2.2cqw); font-weight: 400; }
@media (max-width: 600px) {
  .ing, .steps li, .steps .t, .steps .n { font-size: 14px; }
  .ing-group, .steps li.group .t { font-size: 15px; }
  .page h2 { font-size: 19px; }
  .recipe-title { font-size: 40px; }
}

/* ---------- Recipe section: one full-width navy surface ---------- */
body.is-recipe { background: #101b2a; }
body.is-recipe .desk { max-width: none; padding: 0; }
#view-recipe {
  position: relative;
  min-height: calc(100vh - 54px);
  padding: 28px 16px 56px;
  overflow: hidden;
  background-color: #101b2a;
  background-image:
    radial-gradient(ellipse 75% 34% at 50% 20%, rgba(52, 68, 86, 0.3), rgba(52, 68, 86, 0) 72%),
    radial-gradient(ellipse 85% 22% at 50% 0, rgba(8, 14, 22, 0.5), rgba(8, 14, 22, 0)),
    radial-gradient(ellipse 110% 26% at 50% 100%, rgba(8, 14, 22, 0.45), rgba(8, 14, 22, 0));
}
/* the card itself is transparent: no rectangular edges */
.spread { background: none; }
/* the photo dissolves into the section: faded on top, bottom and both sides */
.spread > .photo-layer {
  inset-inline: -7%;
  height: 74cqw;
  background-position: center 62%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 88%, transparent 100%), linear-gradient(to right, transparent 0, #000 17%, #000 83%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 88%, transparent 100%), linear-gradient(to right, transparent 0, #000 17%, #000 83%, transparent 100%);
  mask-composite: intersect;
}
@media (max-width: 600px) {
  #view-recipe { padding: 12px 0 40px; }
}

/* ---------- Tighter title, handwriting, blurred photo edges, cover ---------- */
#view-recipe { padding: 6px 20px 48px; }
.recipe-head { min-height: 0; padding: 4.4cqw 3cqw 1.2cqw; }
.from-notebook { top: 0.15cqw; }
.recipe-tools { margin-top: 1.1cqw; }
.recipe-title {
  font-family: var(--hand);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  font-size: max(30px, var(--tsize, 5.4cqw));
}
.page-turn .arrow { width: 22px; height: 22px; display: block; flex: none; }

/* a blurred copy sits behind the photo so the margins dissolve instead of ending in a line */
.spread > .photo-bleed {
  position: absolute;
  z-index: 0;
  inset-inline: -14%;
  bottom: -8%;
  height: 92cqw;
  background: var(--photo, none) center 66% / cover no-repeat;
  filter: blur(26px);
  opacity: 0.72;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 74%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 74%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-composite: intersect;
}
.spread > .photo-layer {
  inset-inline: -4%;
  height: 70cqw;
  background-position: center 64%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.2) 16%, #000 40%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.2) 16%, #000 40%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

/* cover: the whole screen is the page, and the portrait fades out at its edges */
.cover {
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #101b2a;
}
.cover-sheet {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 48px 28px 46vh;
  background:
    radial-gradient(ellipse 70% 32% at 50% 16%, rgba(52, 68, 86, 0.28), rgba(52, 68, 86, 0) 70%),
    #101b2a;
  box-shadow: none;
}
.cover-sheet::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: -2vh;
  width: min(680px, 86vw);
  height: 50vh;
  transform: translateX(-50%);
  background: url("images/lilach.jpg") 40% 10% / 170% auto no-repeat;
  filter: blur(26px) brightness(0.62) saturate(0.5);
  opacity: 0.42;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 58% 52% at 50% 62%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 58% 52% at 50% 62%, #000 10%, transparent 70%);
}
.cover-sheet > .plate {
  position: absolute;
  z-index: 0;
  inset: auto;
  left: 50%;
  bottom: 4vh;
  width: min(480px, 62vw);
  height: 52vh;
  margin: 0;
  aspect-ratio: auto;
  transform: translateX(-50%);
  background: none;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 68% 64% at 50% 46%, #000 28%, rgba(0, 0, 0, 0.45) 52%, transparent 74%);
  mask-image: radial-gradient(ellipse 68% 64% at 50% 46%, #000 28%, rgba(0, 0, 0, 0.45) 52%, transparent 74%);
}
.cover-sheet > .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 14%;
  transform: scale(1.28);
  transform-origin: 42% 20%;
  filter: brightness(0.74) saturate(0.62);
}
.cover-sheet > .plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #24384f;
  mix-blend-mode: color;
  opacity: 0.38;
}
.cover-title {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1.12;
  color: #f2ede0;
  margin-top: 6px;
}
.cover-sheet .running,
.cover-sub,
.dedication,
.signed { position: relative; z-index: 2; }
.cover-sheet .btn { position: relative; z-index: 2; }

@media (max-width: 760px) {
  .page-turn .arrow { width: 18px; height: 18px; }
}
@media (max-width: 700px) {
  .cover-sheet { padding: 36px 20px 42vh; }
  .cover-title { font-size: clamp(34px, 10vw, 46px); }
  .cover-sheet > .plate { width: min(300px, 76vw); height: 40vh; bottom: 1vh; }
}
@media (max-width: 600px) {
  #view-recipe { padding: 10px 0 36px; }
  .recipe-head { padding-top: 22px; }
  .recipe-title { font-size: 34px; }
}

/* ---------- Photo a bit higher, calmer add button, removable list items ---------- */
.recipe-tools { margin-top: 2.6cqw; gap: 1.2cqw 2.6cqw; }
.recipe-tools .btn { font-size: max(11px, 1.75cqw); padding: 0.4em 1em; }
.recipe-tools .qty-step output { min-width: 3em; }
.spread > .photo-layer { bottom: 9cqw; }
.spread > .photo-bleed { bottom: 4cqw; }
@media (min-width: 900px) {
  .spread { aspect-ratio: 3 / 3.7; }
}
@media (max-width: 600px) {
  .recipe-tools .btn { font-size: 13px; }
  .spread > .photo-layer { bottom: 14cqw; }
  .spread > .photo-bleed { bottom: 8cqw; }
}

.item { grid-template-columns: 20px minmax(0, 1fr) 30px; align-items: start; }
.item-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--soft);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.item:hover .item-x, .item-x:focus-visible { opacity: 1; }
.item-x:hover { background: rgba(242, 237, 224, 0.12); color: var(--ink); }
.restore {
  margin-top: 6px;
  color: var(--soft);
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
}
.restore:hover { color: var(--ink); }
@media print { .item-x, .restore { display: none !important; } }

/* ---------- Air around the recipe title ---------- */
#view-recipe { padding-top: 36px; }
.recipe-head { padding: 8cqw 3cqw 2.2cqw; }
.from-notebook { top: 2.6cqw; }
.recipe-tools { margin-top: 4.8cqw; }
@media (max-width: 600px) {
  #view-recipe { padding-top: 18px; }
  .recipe-head { padding-top: 42px; padding-bottom: 14px; }
  .from-notebook { top: 10px; }
  .recipe-tools { margin-top: 22px; }
}

/* ---------- Contents: the same navy page, no photo cards ---------- */
body.is-library {
  background-color: #101b2a;
  background-image: radial-gradient(ellipse 72% 30% at 50% 0, rgba(52, 68, 86, 0.32), rgba(52, 68, 86, 0) 70%);
}
body.is-library .desk { max-width: none; padding: 0; }
body.is-library .toc {
  display: block;
  max-width: 680px;
  margin: 0 auto;
  min-height: calc(100vh - 54px);
  padding: 48px 28px 80px;
  background: none;
  column-gap: 0;
}
body.is-library #featured { display: none; }
body.is-library .toc-head,
body.is-library #sections { max-width: none; }
body.is-library .sheet-title {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.15;
  color: #f2ede0;
}
body.is-library .running { color: #a8adb2; }
body.is-library .chapters { gap: 8px 22px; }
body.is-library .chapter { margin-top: 22px; }
body.is-library .chapter-toggle {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 20px;
  color: #f2ede0;
}
body.is-library .chapter-rule {
  width: 100%;
  margin: 10px 0 2px;
  background: rgba(168, 173, 178, 0.35);
}
body.is-library .entry-name { font-size: 17px; }
@media (max-width: 700px) {
  body.is-library .toc { padding: 28px 18px 56px; }
  body.is-library .chapter-toggle { font-size: 19px; }
}

/* ---------- Cover: a photograph, not a floating oval ---------- */
.cover, .cover-sheet { height: auto; min-height: 100vh; overflow: visible; }
.cover-sheet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px 28px;
}
.cover-sheet::before,
.cover-sheet > .plate { display: none; }
body.is-library .chapter-toggle { justify-content: flex-start; gap: 14px; }
@media (max-width: 700px) {
  .cover-sheet { padding: 40px 20px; }
}

/* ================= One surface for the whole book ================= */
:root { --navy-base: #101b2a; --wash: radial-gradient(ellipse 80% 40% at 50% 0, rgba(52, 68, 86, 0.32), rgba(52, 68, 86, 0) 72%); }
html { background: var(--navy-base); }
body, body.is-recipe, body.is-library {
  background-color: var(--navy-base);
  background-image: var(--wash);
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.cover, #cover { background: none; }
.sheet, .toc, #view-recipe, .cover-sheet { background: none; box-shadow: none; }
.topbar {
  background: rgba(16, 27, 42, 0.9);
  border-bottom: 1px solid rgba(168, 173, 178, 0.2);
}
body.is-recipe .desk, body.is-library .desk { max-width: none; padding: 0; }
.spread > .photo-layer, .spread > .photo-bleed { max-width: none; }

/* ---------- Cover: dedication on the left of the page, Lilach in her kitchen ---------- */
.cover { min-height: 100vh; display: block; padding: 0; }
.cover-sheet {
  position: relative;
  width: 100%;
  max-width: 1240px;
  min-height: 100vh;
  height: auto;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 0;
  text-align: center;
}
.cover-sheet::before { content: none; display: none; }
.cover-sheet > .cover-text { position: relative; z-index: 2; padding: 56px clamp(8px, 3vw, 44px); }
.cover-sheet > .plate {
  display: block;
  position: relative;
  inset: auto;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 1;
  width: 100%;
  height: min(92vh, 900px);
  margin: 0;
  aspect-ratio: auto;
  overflow: hidden;
  background: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.3) 9%, #000 28%, #000 50%, rgba(0, 0, 0, 0.62) 70%, rgba(0, 0, 0, 0.2) 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.3) 9%, #000 28%, #000 50%, rgba(0, 0, 0, 0.62) 70%, rgba(0, 0, 0, 0.2) 88%, transparent 100%);
  mask-composite: intersect;
}
.cover-sheet > .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 38%;
  transform: none;
  filter: saturate(0.85) brightness(0.94);
}
.cover-sheet > .plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #2a4160;
  mix-blend-mode: color;
  opacity: 0.22;
}
.cover-sheet .running { margin-bottom: 14px; }
.cover-sheet .cover-title { font-size: clamp(48px, 6vw, 84px); }
.cover-sheet .btn { margin-top: 4px; }

@media (max-width: 900px) {
  .cover-sheet { display: block; max-width: 620px; padding: 0 20px 20px; }
  .cover-sheet > .cover-text { padding: 40px 0 8px; }
  .cover-sheet > .plate {
    height: auto;
    aspect-ratio: 1 / 1;
    margin-top: -4px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 84%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  }
  .cover-sheet > .plate img { object-position: 56% 30%; }
  .cover-sheet .cover-title { font-size: clamp(38px, 11vw, 56px); }
}

/* one handwriting for every heading, on every page */
h1, h2, h3, h4, .block-title, .sheet-title, .aisle h4 { font-family: var(--hand); font-weight: 400; }
.sheet-title { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.15; color: #f2ede0; }
.block-title { font-size: 19px; }
.aisle h4 { font-size: 18px; }
/* ---------- Side margins of every page: the blurred photo color, fading to navy in the middle ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("images/cover.jpg") 30% 35% / cover no-repeat;
  filter: blur(44px) saturate(0.7) brightness(0.5);
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to right, #000 0, rgba(0, 0, 0, 0.6) 8%, transparent 22%, transparent 78%, rgba(0, 0, 0, 0.6) 92%, #000 100%);
  mask-image: linear-gradient(to right, #000 0, rgba(0, 0, 0, 0.6) 8%, transparent 22%, transparent 78%, rgba(0, 0, 0, 0.6) 92%, #000 100%);
}
.topbar, .cover, .desk { position: relative; z-index: 1; }
.topbar { position: sticky; }
.cover, .cover-sheet, .sheet, .toc, #view-recipe, #view-list, .topbar, body.is-recipe, body.is-library {
  background-image: none;
}
.cover, .cover-sheet, .sheet, .toc, #view-recipe, #view-list { background-color: transparent; }
@media (max-width: 700px) {
  body::before { display: none; }
}
/* ---------- Contents and list: calmer handwriting sizes ---------- */
.sheet-title, body.is-library .sheet-title { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.15; }
body.is-library .running, .running { font-size: 15px; margin-bottom: 14px; }
body.is-library .chapter-toggle { font-size: 17px; }
body.is-library .entry-name { font-size: 16px; }
body.is-library .entry-page { font-size: 13px; }
body.is-library .chapters button { font-size: 14px; }
body.is-library .search input { font-size: 15px; }
body.is-library .chapter { margin-top: 16px; }
body.is-library .chapter-rule { margin: 6px 0 0; }
.block-title { font-size: 17px; }
.aisle h4 { font-size: 16px; }
.item .label { font-size: 15px; }
/* ---------- Contents: tighter spacing so the whole list fits on the screen ---------- */
body.is-library .toc { padding: 20px 24px 40px; }
body.is-library .toc-head .running { margin-bottom: 6px; }
body.is-library .toc .hair { margin: 10px 0 12px; }
body.is-library .search input { padding: 6px 0; margin-top: 2px; }
body.is-library .chapters { margin-top: 12px; gap: 4px 18px; }
body.is-library .chapter { margin-top: 8px; }
body.is-library .chapter-toggle { padding: 2px 0; }
body.is-library .chapter-rule { margin: 4px 0 0; }
body.is-library .entry { padding: 3px 0; }
body.is-library .entries { margin-bottom: 4px; }
@media (max-height: 900px) and (min-width: 701px) {
  body.is-library .toc { padding-top: 14px; }
  body.is-library .sheet-title { font-size: clamp(24px, 2.6vw, 32px); }
}
/* ---------- Recipe name: a fixed, calm size, not scaled up for short names ---------- */
.recipe-title, .recipe-title[style] { font-size: clamp(24px, 3.2cqw, 34px); line-height: 1.1; }
@media (max-width: 600px) {
  .recipe-title, .recipe-title[style] { font-size: 28px; }
}
/* ---------- Less space above the recipe name ---------- */
#view-recipe { padding-top: 12px; }
.recipe-head { padding-top: 6.5cqw; }
.from-notebook { top: 1.2cqw; }
.recipe-tools { margin-top: 2.6cqw; }
@media (max-width: 600px) {
  #view-recipe { padding-top: 6px; }
  .recipe-head { padding-top: 30px; }
  .from-notebook { top: 6px; }
  .recipe-tools { margin-top: 14px; }
}
/* ---------- Phones: keep ingredients and preparation side by side, like on desktop ---------- */
@media (max-width: 600px) {
  .cols {
    display: grid;
    grid-template-columns: minmax(0, 37fr) minmax(0, 4fr) minmax(0, 59fr);
    margin-inline: 3cqw;
  }
  .page-r { order: 0; padding-bottom: 0; border-bottom: 0; }
  .page-l { order: 0; }
  .cols::before { display: block; inset-inline-start: 39%; top: 7cqw; }
  .rule-icon { position: absolute; order: 0; inset-inline-start: 39%; transform: translateX(50%); width: 7cqw; height: 6.4cqw; margin: 0; top: -0.5cqw; }
  .page h2 { font-size: 17px; }
  .ing, .steps li, .steps .t, .steps .n { font-size: 13.5px; line-height: 1.4; }
  .ing-group, .steps li.group .t { font-size: 14.5px; }
}