/* Tom's Recipes
   Layout: a narrow reading column for the index; on recipe pages, ingredients beside the method on wide screens and tabs on phones. */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --ink: #1d1c19;
  --muted: #69655d;
  --line: #e2dfd7;
  --accent: #a3321c;
  --accent-ink: #ffffff;
  --accent-soft: #f5e3dc;
  --chip: #efece5;
  --tick: #3d6b4a;
  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --art-bg: #ebe0c7;
  --art-line: #cdbf9f;
  --radius: 12px;
  --gutter: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412; --surface: #1e1d1a; --ink: #eeebe3; --muted: #a9a499; --line: #312f2a;
    --accent: #ef8a6b; --accent-ink: #1a0f0b; --accent-soft: #3b231b; --chip: #282622; --tick: #86c29a;
    --art-bg: #2a2723; --art-line: #46413a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151412; --surface: #1e1d1a; --ink: #eeebe3; --muted: #a9a499; --line: #312f2a;
  --accent: #ef8a6b; --accent-ink: #1a0f0b; --accent-soft: #3b231b; --chip: #282622; --tick: #86c29a;
  --art-bg: #2a2723; --art-line: #46413a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }

/* Site header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { font: 400 1.35rem/1 var(--display); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--accent); }
.header-link { font-size: .95rem; font-weight: 600; text-decoration: none; color: var(--muted); padding: 6px 2px; }
.header-link:hover { color: var(--ink); }

/* Index */
.intro { padding-block: 40px 8px; }
.intro h1 { font: 400 clamp(2.4rem, 7vw, 3.6rem)/1.05 var(--display); margin: 0 0 10px; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); max-width: 60ch; }
.search { margin-top: 24px; position: relative; max-width: 640px; }
.search input { width: 100%; font: 400 1.05rem var(--body); padding: 14px 16px 14px 46px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); -webkit-appearance: none; appearance: none; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 600 .75rem var(--body); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
@media (hover: none) { .search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.search kbd { display: none; } }
.filters { display: grid; gap: 10px; margin-top: 18px; }
.filter-row { display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-row::-webkit-scrollbar { display: none; }
@media (max-width: 820px) { .filter-row { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); padding-right: 24px; } }
.filter-row .row-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; flex: none; width: 82px; white-space: nowrap; }
.pill { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill:hover { border-color: var(--ink); }
.results-bar { display: flex; align-items: baseline; gap: 14px; margin-top: 22px; color: var(--muted); font-size: .92rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.course-section { margin-top: 36px; scroll-margin-top: 16px; }
.course-section > h2 { font: 400 1.7rem/1.2 var(--display); margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; }
.course-section > h2 small { font: 500 .9rem var(--body); color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 16px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--ink); }
.card:active { transform: scale(.99); }
.card .eyebrow { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.card h3 { font: 400 1.35rem/1.2 var(--display); margin: 0; text-wrap: balance; }
.card p.desc { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.card .meta { margin: auto 0 0; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.jump { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; text-decoration: none; font-size: .9rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.jump a:hover { border-color: var(--ink); }
@media (max-width: 699px) {
  .jump { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .grid:not(.plan-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 0 12px 12px; gap: 6px; }
  .card h3 { font-size: 1.1rem; line-height: 1.2; }
  .card .meta { font-size: .8rem; }
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); text-decoration: none; }
a.tag:hover { background: var(--accent-soft); }
.tag.ted { background: var(--accent-soft); color: var(--accent); }
.empty { margin-top: 36px; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.others { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.others > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 8px; font: 400 1.2rem/1.3 var(--display); color: var(--muted); padding: 4px 0; }
.others > summary::-webkit-details-marker { display: none; }
.others > summary::before { content: "+"; font: 600 1rem var(--body); width: 1em; }
.others[open] > summary::before { content: "−"; }
.others > summary:hover { color: var(--ink); }
.others > summary small { font: 500 .85rem var(--body); }
.others > .grid { margin-top: 14px; }
.az { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 24px; }
.az h2 { font: 400 1.4rem var(--display); margin: 0 0 12px; }
.az ol { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 32px; }
.az li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.az a { text-decoration: none; font-weight: 500; }
.az a:hover { text-decoration: underline; text-underline-offset: 3px; }
.az span { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Recipe page */
.recipe-head { padding-block: 28px 18px; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.recipe-head h1 { font: 400 clamp(2.1rem, 6vw, 3.4rem)/1.08 var(--display); margin: 0 0 12px; text-wrap: balance; max-width: 22ch; }
.recipe-head .desc { margin: 0 0 18px; font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; padding: 0; border-block: 1px solid var(--line); }
.facts div { padding: 10px 22px 10px 0; margin-right: 22px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; margin-right: 0; }
.facts dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.head-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn { white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* Back link, at the left of the sticky bar */
.back { display: inline-flex; align-items: center; gap: 4px; flex: none; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--ink);
  padding: 8px 12px 8px 6px; margin-left: -6px; border-radius: 999px; }
.back:hover { background: var(--chip); }
.back svg { width: 20px; height: 20px; }
/* Full screen from the home screen. A strip the colour of the page sits behind the phone's clock. */
:root { --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); --bar: 0px; }
body.has-bar { --bar: 53px; }
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top); background: var(--bg); z-index: 100; }
.site-header { padding-top: var(--safe-top); }
.appbar { position: sticky; top: var(--safe-top); z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.appbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; }
.appbar .plan-tabs { margin: 0; }
.tabbar { display: none; }

.toolbar { position: sticky; top: calc(var(--safe-top) + var(--bar)); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 10px; }
.servings { display: flex; align-items: center; gap: 10px; }
.servings .label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 999px; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button:not(:disabled):hover { background: var(--chip); }
.stepper output { min-width: 2.2ch; text-align: center; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.yield { font-weight: 600; }
.batch { display: flex; align-items: center; gap: 10px; }
.batch .label { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 7px 10px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; color: inherit; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.serve-group { margin-top: 6px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.serve-ctl { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 600; font-size: .95rem; }
.stepper.small button { width: 32px; height: 32px; font-size: 1.1rem; }
.stepper.small output { font-size: 1rem; }
.tabs { display: none; background: var(--chip); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pan-note { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--chip); font-size: .95rem; }

.columns { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 4vw, 48px); padding-block: 28px 16px; align-items: start; }
.columns h2 { font: 400 1.6rem/1.2 var(--display); margin: 0 0 4px; }
.for { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.ingredients { position: sticky; top: calc(var(--safe-top) + var(--bar) + 76px); max-height: calc(100vh - var(--bar) - 96px); overflow: auto; padding-right: 6px; }
.ing-group + .ing-group { margin-top: 20px; }
.ing-group h3 { font: 700 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.group-note { margin: 0 0 8px; font-size: .88rem; color: var(--muted); }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { border-bottom: 1px solid var(--line); }
.ing-list label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.tick { position: absolute; opacity: 0; pointer-events: none; }
.box { flex: none; width: 20px; height: 20px; margin-top: 3px; border: 1.5px solid var(--muted); border-radius: 6px; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.tick:checked + label .box { background: var(--tick); border-color: var(--tick); }
.tick:checked + label .box::after { content: ""; width: 10px; height: 5px; border: solid var(--surface); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.tick:checked + label .ing-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.tick:focus-visible + label .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.equipment { margin-top: 22px; font-size: .92rem; color: var(--muted); }
.equipment h3 { font: 700 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.equipment ul { margin: 0; padding-left: 1.1em; }

.steps { list-style: none; margin: 8px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--safe-top) + var(--bar) + 80px); }
.step:first-child { padding-top: 6px; }
.step-num { font: 400 1.6rem/1.1 var(--display); color: var(--muted); }
.step-body p { margin: 0; max-width: 64ch; }
.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .85rem; font-weight: 500; padding: 4px 11px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); }
.timer-link { background: var(--chip); color: var(--ink); border: 0; border-radius: 6px; padding: 0 3px; font-weight: 600; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.timer-link:hover { text-decoration-style: solid; }
.timer-link::before { content: "⏱ "; font-size: .85em; text-decoration: none; }

.notes { margin-block: 24px 8px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.note h3 { font: 700 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.note p { margin: 0; font-size: .95rem; }
.source { margin: 20px 0 0; color: var(--muted); font-size: .92rem; }
.source a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer .wrap { padding-block: 22px 40px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Timers */
.timers { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: grid; gap: 8px; width: min(calc(100% - 24px), 460px); }
.timer { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.timer-label { flex: 1; min-width: 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.timer-time { font: 700 1.25rem var(--body); font-variant-numeric: tabular-nums; }
.timer button { border: 1px solid rgba(255,255,255,.3); background: none; color: inherit; border-radius: 999px; padding: 5px 11px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.timer.is-done { background: var(--accent); color: var(--accent-ink); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.02); } }

/* Cooking mode */
.cook { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.cook > .wrap { width: 100%; max-width: 800px; }
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cook-title { font: 400 1.1rem/1.25 var(--display); margin: 0; flex: 1; min-width: 0; text-wrap: balance; }
.cook-count { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cook-bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.cook-bar span { display: block; height: 100%; background: var(--ink); transition: width .25s; }
.cook-main { flex: 1; overflow: auto; display: flex; align-items: center; }
.cook-step { width: 100%; max-width: 800px; margin: 0 auto; padding-block: 24px; font-size: clamp(1.35rem, 4.6vw, 2rem); line-height: 1.45; }
.cook-step p { margin: 0; }
.cook-step .chips { margin-top: 22px; gap: 8px; }
.cook-step .chip { font-size: 1rem; padding: 6px 14px; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.cook-nav button { padding: 16px; border-radius: 14px; font-weight: 700; font-size: 1.05rem; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.cook-nav button[data-cook="next"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cook-nav button:disabled { opacity: .35; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.is-cooking body { overflow: hidden; }
.is-cooking .timers { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* Phones. Tablets and computers show the ingredients beside the method. */
@media (max-width: 699px) {
  :root { --gutter: 16px; }
  body { font-size: 16.5px; }
  .tabs { display: inline-flex; }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 18px; }
  .columns[data-view="ingredients"] .method, .columns[data-view="method"] .ingredients { display: none; }
  .ingredients { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .columns h2 { display: none; }
  .ing-list label { padding: 13px 0; }
  .facts div { padding-right: 14px; margin-right: 14px; }
  .actions { width: 100%; flex-wrap: nowrap; }
  .actions .btn { flex: 1; justify-content: center; }
  .actions .btn.icon-only { flex: none; width: 46px; padding: 0; height: 46px; }
  .btn.icon-only span { display: none; }
  .recipe-head { padding-block: 16px 14px; }
  .recipe-head h1 { font-size: 2rem; margin-bottom: 8px; }
  .recipe-head .desc { font-size: 1rem; margin-bottom: 12px; }
  .facts { display: flex; flex-wrap: wrap; column-gap: 22px; margin-bottom: 14px; }
  .facts div { border-right: 0; margin-right: 0; padding: 8px 0; }
  .facts dt, .facts dd { white-space: nowrap; }
  .facts dd { font-size: .95rem; }
  .step { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .az ol { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Print: A4, ingredients beside method, black with one accent colour */
.print-only { display: none; }
@page { size: A4; margin: 14mm 15mm 16mm; }
@media print {
  :root { --ink: #111; --muted: #555; --line: #d8d4cb; --accent: #a3321c; --surface: #fff; --bg: #fff; --chip: #f1eee8; color-scheme: light; }
  body { background: #fff; color: #111; font-size: 10pt; line-height: 1.45; }
  .site-header, .theme-btn, .toolbar, .actions, .crumbs, .site-footer, .timers, .cook, .chips, .tags, .pan-note, .screen-only, .serve-ctl .stepper button { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .recipe-head { padding: 0 0 8pt; }
  .print-brand { font: 600 8pt var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 6pt; }
  .recipe-head h1 { font-size: 26pt; max-width: none; margin: 0 0 4pt; }
  .recipe-head .desc { font-size: 10.5pt; font-style: italic; margin: 0 0 10pt; color: #333; }
  .facts { margin: 0; border-color: #111; }
  .facts div { padding: 5pt 14pt 5pt 0; margin-right: 14pt; }
  .facts dt { font-size: 7pt; color: #555; }
  .facts dd { font-size: 10pt; }
  .columns, .columns[data-view] { display: grid !important; grid-template-columns: 34% 1fr; gap: 9mm; padding: 10pt 0 0; }
  .columns[data-view] .ingredients, .columns[data-view] .method { display: block !important; }
  .columns h2 { display: block; font-size: 13pt; margin: 0 0 6pt; padding-bottom: 3pt; border-bottom: 1.5pt solid var(--accent); }
  .for { display: none; }
  .ingredients { position: static; max-height: none; overflow: visible; padding: 0; }
  .ing-group + .ing-group { margin-top: 9pt; }
  .ing-group h3 { font-size: 7.5pt; margin-bottom: 2pt; }
  .ing-list li { border: 0; break-inside: avoid; }
  .ing-list label { padding: 2.5pt 0; gap: 7pt; }
  .box { width: 8pt; height: 8pt; margin-top: 3pt; border: 0.8pt solid #111; border-radius: 1.5pt; }
  .tick:checked + label .ing-text { text-decoration: none; color: #111; }
  .tick:checked + label .box { background: none; border-color: #111; }
  .tick:checked + label .box::after { display: none; }
  .equipment { margin-top: 10pt; font-size: 9pt; }
  .steps { margin: 0; }
  .step { grid-template-columns: 16pt 1fr; gap: 6pt; padding: 0 0 7pt; border: 0; break-inside: avoid; }
  .step-num { font-size: 13pt; }
  .timer-link { background: none; color: inherit; padding: 0; font-weight: inherit; text-decoration: none; }
  .timer-link::before { content: none; }
  .notes { display: block; margin: 12pt 0 0; padding: 8pt 10pt; background: #f3f0ea; border-radius: 4pt; break-inside: avoid; }
  .note { border: 0; background: none; padding: 0; margin: 0 0 4pt; display: flex; gap: 6pt; }
  .note h3 { font-size: 7.5pt; margin: 1pt 0 0; flex: none; width: 70pt; }
  .note p { font-size: 9pt; }
  .source { font-size: 8.5pt; margin-top: 8pt; }
  .source a { color: #111; font-weight: 600; text-decoration: none; }
  .source a::after { content: " (" attr(href) ")"; font-weight: 400; color: #555; }
  .print-foot { margin-top: 12pt; padding-top: 5pt; border-top: 0.6pt solid #bbb; font-size: 7.5pt; color: #555; display: flex; justify-content: space-between; }
}

/* Navigation */
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--muted); padding: 7px 12px; border-radius: 999px; }
.site-nav a:hover { color: var(--ink); background: var(--chip); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; cursor: pointer; padding: 0; flex-shrink: 0; }
.theme-btn:hover { color: var(--ink); background: var(--chip); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--chip); }
.this-week { margin: 18px 0 4px; }
.this-week a { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--accent); text-decoration: none; background: var(--accent-soft); padding: 9px 16px; border-radius: 999px; }
.this-week a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Meal plans */
.plan-list { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-card h3 { font-size: 1.5rem; }
.week-badge { display: inline-block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); margin-right: 8px; vertical-align: middle; }
.week-badge.is-now { background: var(--accent); color: var(--accent-ink); }
.plan-page .desc .week-badge { margin: 0 0 0 10px; }
.plan-tabs { display: inline-flex; margin-top: 4px; }
.plan-intro { margin: 8px 0 18px; max-width: 64ch; color: var(--muted); }
.plan-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.plan-table th, .plan-table td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.plan-table thead th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
.plan-table tbody th { color: var(--ink); font-weight: 700; white-space: nowrap; width: 1%; }
.plan-table tbody tr:last-child > * { border-bottom: 0; }
.plan-table a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.plan-table a:hover { text-decoration-color: var(--ink); }
.plan-table .plain { color: var(--ink); font-weight: 600; }
.cell-note { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.cell-kcal { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.jobs { margin: 0; padding: 0 0 0 1.1em; font-size: .88rem; color: var(--muted); }
.jobs li + li { margin-top: 4px; }
.cell-portion { display: block; font-size: .8rem; color: var(--muted); }
.day-kcal { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.plan-table tr.is-today { background: var(--accent-soft); }
.plan-table tbody tr { scroll-margin-top: calc(var(--safe-top) + var(--bar) + 12px); }
.today-tag { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 2px; }
.plan-box { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.plan-box h3 { font: 400 1.3rem var(--display); margin: 0 0 8px; }
.plan-box p { margin: 0; max-width: 70ch; }
.plan-box ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.week-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.week-nav a { font-weight: 600; color: var(--ink); text-decoration: none; }
.week-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide .note ul { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: .95rem; }
@media (max-width: 820px) {
  .site-nav a { padding: 6px 9px; font-size: .9rem; }
  .plan-table-wrap { background: none; border: 0; overflow: visible; }
  .plan-table, .plan-table tbody, .plan-table tr, .plan-table th, .plan-table td { display: block; width: auto; }
  .plan-table thead { display: none; }
  .plan-table tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; display: grid; gap: 8px; }
  .plan-table tbody th, .plan-table td { padding: 0; border: 0; }
  .plan-table tbody th { font: 400 1.25rem var(--display); color: var(--ink); }
  .plan-table td::before { content: attr(data-label); display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
  .today-tag { display: inline-block; margin: 0 0 0 8px; vertical-align: middle; }
}
@media print { .site-nav, .plan-tabs, .week-nav { display: none !important; } .plan-panel[hidden] { display: block !important; } }

@media (max-width: 440px) {
  .servings .label { display: none; }
  .toolbar-batch .wrap { flex-wrap: wrap; row-gap: 8px; }
  .toolbar-batch .batch { flex: 1; justify-content: space-between; margin-right: 0; }
  .toolbar-batch .tabs { width: 100%; }
  .toolbar-batch .tabs button { flex: 1; }
  .seg button { padding: 7px 8px; }
  .stepper button { width: 36px; height: 38px; }
  .tabs button { padding: 7px 12px; font-size: .9rem; }
  .toolbar .wrap { gap: 8px; }
}

.brand, .site-nav a { white-space: nowrap; }
@media (max-width: 360px) {
  .brand { font-size: 1.15rem; }
  .site-nav a { padding: 7px 9px; font-size: .9rem; }
  .site-header .wrap { gap: 8px; }
  .site-nav a { padding: 6px 7px; font-size: .85rem; }
}

/* Sainsbury's shop button page */
.shop-page .lede { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.shop-page .shop-step { margin: 20px 0; }
.shop-page .shop-step h2 { font-size: 1.15rem; margin: 0 0 8px; }
.shop-page .shop-step ol { padding-left: 1.3em; }
.shop-page .shop-step li { margin: 8px 0; }
.shop-bookmarklet { display: inline-block; margin: 12px 0 4px; padding: 12px 20px; background: #f06c00; color: #fff !important; font-weight: 700; border-radius: 999px; text-decoration: none !important; cursor: grab; box-shadow: 0 3px 10px rgba(240,108,0,.35); }
.shop-page > h2 { margin-top: 32px; }

/* Illustrations. Every card has a cream band at 4:3, with the dish centred in it,
   or a plain plate outline until the recipe has its illustration. */
.card-art { position: relative; margin: -18px -20px 6px; aspect-ratio: 4 / 3; background: var(--art-bg); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  display: grid; place-items: center; overflow: hidden; }
/* The picture is placed on all four sides, so Safari sizes it to the band. A percentage height alone left Safari showing it at full size, cut off. */
.card-art img { position: absolute; inset: 0; margin: auto; width: 82%; height: 82%; object-fit: contain; transition: transform .25s; }
@media (max-width: 699px) { .card-art { aspect-ratio: 1; margin: 0 -12px 4px; } }
.card:hover .card-art img { transform: scale(1.04) rotate(-1deg); }
.card-art .art-plate { width: 42%; color: var(--art-line); }
.recipe-head.has-art .head-art { margin: 0 auto 16px; width: 180px; aspect-ratio: 1; border-radius: 50%; background: var(--art-bg); display: grid; place-items: center; }
.recipe-head.has-art .head-art img { width: 92%; height: 92%; object-fit: contain; }
@media (min-width: 900px) {
  .recipe-head.has-art { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px; align-items: start; }
  .recipe-head.has-art > * { grid-column: 1; }
  .recipe-head.has-art .head-art { grid-column: 2; grid-row: 1 / span 6; width: 320px; margin: 4px 0 0; }
}
@media (min-width: 700px) and (max-width: 899px) {
  .recipe-head.has-art { --art: 150px; }
}
@media (max-width: 899px) {
  .recipe-head.has-art { display: grid; grid-template-columns: minmax(0, 1fr) var(--art, 92px); column-gap: 14px; }
  .recipe-head.has-art > * { grid-column: 1 / -1; }
  .recipe-head.has-art h1 { grid-column: 1; grid-row: 1; align-self: center; }
  .recipe-head.has-art .head-art { grid-column: 2; grid-row: 1; width: var(--art, 92px); margin: 0 0 8px; align-self: center; }
}
@media (prefers-reduced-motion: reduce) { .card:hover .card-art img { transform: none; } }
@media print { .head-art, .card-art { display: none !important; } .recipe-head.has-art { display: block; } }

/* Phones: Recipes and Meal Plans buttons along the bottom, and the back arrow at the top left. */
@media (max-width: 699px) {
  .has-bar .site-header { display: none; }
  .site-nav a { display: none; }
  .tabbar { display: grid; grid-template-columns: 1fr 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--bg); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; text-decoration: none; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar svg { width: 24px; height: 24px; }
  body { padding-bottom: calc(58px + var(--safe-bottom)); }
  .timers { bottom: calc(70px + var(--safe-bottom)); }
  .site-footer .wrap { padding-bottom: 20px; }
}
@media print { .tabbar, .appbar { display: none !important; } }

/* Food diary */
.diary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diary-lock-btn { font: 600 .85rem var(--body); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.diary-form { display: grid; gap: 10px; max-width: 320px; margin: 8px 0 40px; }
.diary-form label { font-weight: 600; }
.diary-form input { font: 1rem var(--body); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.diary-form button { font: 600 1rem var(--body); padding: 12px 14px; border: 0; border-radius: 10px; background: var(--ink); color: var(--bg); cursor: pointer; }
.diary-msg { margin: 0; color: var(--muted); min-height: 1.4em; }
.diary-day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 16px; }
.diary-day h2 { font-size: 1.15rem; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.diary-day.is-today .week-badge { display: inline-block; }
.diary-list { list-style: none; margin: 0; padding: 0; }
.diary-list li { display: grid; grid-template-columns: 90px 1fr auto; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.diary-list li:first-child { border-top: 0; }
.diary-meal { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.diary-item .cell-note { display: block; }
.diary-total { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; text-align: right; }
