/* Family Recipes — quiet, classic, easy to read. System fonts only, so it loads instantly. */
:root {
  --paper: #FAF8F4;
  --card: #FFFFFF;
  --ink: #1F1D1A;
  --muted: #6E6962;
  --line: #E6E1D8;
  --tint: #F1EDE6;
  --accent: #8C3B2A;      /* deep brick, used sparingly */
  --accent-ink: #FFFFFF;
  --accent-soft: #F4E9E4;
  --sage: #4B5E4D;
  --danger: #9B2C20;
  --radius: 10px;
  --shadow: 0 0 0 1px var(--line);  /* a hairline instead of a drop shadow */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Arial, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --read: 20px;  /* ingredients, steps and story; bigger with the "Text" buttons */
}
html.size-1 { --read: 24px; }
html.size-2 { --read: 29px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 18px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }
main { max-width: 860px; margin: 0 auto; padding: 8px 16px 64px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; font-weight: 600; }
h1 { font-size: clamp(32px, 7.5vw, 48px); letter-spacing: -.01em; margin: 10px 0 8px; }
h2 { font-size: 25px; margin: 36px 0 12px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { max-width: 100%; display: block; }
small { font-weight: 400; color: var(--muted); font-size: .85em; }
/* A long name with no spaces wraps instead of pushing the page sideways */
body { overflow-wrap: break-word; }
h1, h2, h3, p, li, legend, label, summary, .card h3, .cook-text, .member-name, .making-name { overflow-wrap: anywhere; }

/* 中文: no slanted text, a little more room between lines */
body:lang(zh-Hant) { line-height: 1.7; }
h1:lang(zh-Hant), h2:lang(zh-Hant), h3:lang(zh-Hant) { line-height: 1.3; letter-spacing: 0; }
.story p:lang(zh-Hant), .initial:lang(zh-Hant), .steps li:lang(zh-Hant)::before { font-style: normal; }
.cook-count:lang(zh-Hant), .sub-head:lang(zh-Hant), .meta span:lang(zh-Hant), .day h2 em:lang(zh-Hant), .badge:lang(zh-Hant), .making h2:lang(zh-Hant) { letter-spacing: .02em; }
.story p:lang(zh-Hant), .steps li:lang(zh-Hant), .ingredients label:lang(zh-Hant), .cook-text:lang(zh-Hant) { line-height: 1.8; }

/* Header */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 860px; margin: 0 auto; padding: 14px 16px 6px;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.me { color: var(--muted); font-size: 16px; }
.top-right { display: flex; align-items: center; flex-wrap: wrap; gap: 0 14px; min-width: 0; }
.brand { min-width: 0; overflow-wrap: anywhere; }

/* 中文 / English */
.lang { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 15px; }
.lang button { background: none; border: 0; padding: 10px 4px; min-height: 44px; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lang button[aria-pressed=true] { color: var(--ink); font-weight: 700; text-decoration: none; }
.lang-bar { display: flex; justify-content: flex-end; max-width: 860px; margin: 0 auto; padding: 2px 12px 0; }
.center-page .lang-bar { position: absolute; top: 0; right: 0; }
.cook .lang-bar { max-width: 1120px; }

/* Section tabs */
.tabs { display: flex; gap: 6px; max-width: 860px; margin: 0 auto; padding: 6px 16px 0; border-bottom: 1px solid var(--line); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; white-space: nowrap; padding: 12px 16px; font-weight: 600; font-size: 17px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--ink); }
@media (max-width: 520px) { .tabs { gap: 0; padding: 6px 4px 0; } .tabs a { flex: 1; text-align: center; padding: 10px 2px; font-size: 16px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 22px; border-radius: var(--radius);
  border: 1px solid #D9D3C8; background: var(--card); color: var(--ink);
  font: 600 17px/1.2 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .pill input:focus-visible + span {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #3A3631; border-color: #3A3631; }
.btn-big { min-height: 60px; font-size: 19px; padding: 14px 28px; }
.btn-block { display: flex; width: 100%; }
.btn-danger { color: var(--danger); border-color: #E7C8C2; background: transparent; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Home */
.hero { margin: 14px 0 18px; }
.hero .btn { width: 100%; }
.search { display: flex; gap: 10px; margin-bottom: 14px; }
.search input { flex: 1; min-width: 0; }
input[type=search], input[type=text], input[type=url], input[type=password], input[type=date], input:not([type]), textarea {
  width: 100%; font: 18px/1.45 var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid #D9D3C8; border-radius: var(--radius);
  padding: 13px 14px; min-height: 54px; -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
textarea { resize: vertical; }
::placeholder { color: #A8A299; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 15px; border-radius: 999px; background: transparent; border: 1px solid #D9D3C8; color: var(--ink);
  text-decoration: none; font-size: 16px; font-weight: 500; white-space: nowrap;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips-label { flex: none; color: var(--muted); font-size: 16px; }
.result-note { color: var(--muted); font-size: 17px; margin: 4px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 28px 20px; margin-top: 14px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 22px 14px; } }
.card { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 4 / 3; background: var(--tint); display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.initial { font-family: var(--serif); font-style: italic; font-size: 60px; color: #CFC7BA; }
.card-body { padding: 10px 2px 0; }
.card h3 { font-size: 20px; line-height: 1.25; }
.card p { margin: 3px 0 0; color: var(--muted); font-size: 15px; }
.card-body { min-width: 0; }
.card .card-alt { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.title-alt { font-family: var(--serif); font-size: 22px; color: var(--muted); margin: -4px 0 10px; }

.empty { text-align: center; padding: 48px 12px; color: var(--muted); }
.empty-big { font-family: var(--serif); font-size: 28px; color: var(--ink); margin: 0 0 8px; }
.empty a { color: var(--ink); }

/* Finding things: new since your last visit, family shelves, sorting, show more */
.card-img { position: relative; }
.new-badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card-img { color: inherit; text-decoration: none; }
/* "Amy's": whose recipe, above its name */
.kicker { display: inline-block; font: 600 12px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); text-decoration: none; margin: 0 0 3px; overflow-wrap: anywhere; }
a.kicker:hover { color: var(--ink); text-decoration: underline; }
.kicker:lang(zh-Hant) { text-transform: none; letter-spacing: .02em; font-size: 14px; }
.kicker-big { font-size: 14px; margin: 14px 0 -4px; }
.kicker-big:lang(zh-Hant) { font-size: 16px; }
.card .card-made { color: var(--sage); font-weight: 600; font-size: 14px; }
.fresh { background: var(--card); box-shadow: var(--shadow); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 0 12px 14px; margin: 0 0 18px; }
.fresh h2 { font-size: 21px; margin: 0 14px 10px 0; }
.minis { display: flex; gap: 12px; overflow-x: auto; padding: 0 14px 4px 0; scrollbar-width: thin; }
.mini { flex: none; width: 128px; color: var(--ink); text-decoration: none; display: grid; gap: 2px; align-content: start; }
.mini-img { text-decoration: none; aspect-ratio: 4 / 3; background: var(--tint); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.mini-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-img .initial { font-size: 36px; }
.mini .kicker { margin: 4px 0 0; font-size: 11px; }
.mini .kicker:lang(zh-Hant) { font-size: 13px; }
.mini-title { color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.fresh-all { display: inline-block; margin: 8px 0 0; font-weight: 600; font-size: 16px; }
.family h2 { font-size: 21px; margin: 4px 0 8px; }
.members-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.members-row::-webkit-scrollbar { display: none; }
.member-tile { flex: none; min-width: 112px; max-width: 200px; display: grid; gap: 0; align-content: start; padding: 10px 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.member-tile:hover { box-shadow: 0 0 0 1px var(--ink); }
.member-tile strong { font-family: var(--serif); font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.member-tile span { color: var(--muted); font-size: 15px; }
.member-tile em { font-style: normal; color: var(--accent); font-weight: 700; font-size: 14px; }
.results-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin: 6px 0 0; }
.results-bar .result-note { margin: 0; }
.sort { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; font-size: 16px; color: var(--muted); }
.sort a { color: var(--muted); padding: 8px 6px; }
.sort a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: none; }
.shelf-title { font-size: 28px; margin: 18px 0 0; }
.shelf-head { font-size: 22px; margin: 30px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.shelf-group .grid { margin-top: 12px; }
.more { margin: 28px 0 0; }
.more .hint { margin-top: 12px; }
.tool.save-btn { flex-direction: row; gap: 6px; }
.save-btn::before { content: '☆'; font-size: 20px; line-height: 1; }
.save-btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
.save-btn[aria-pressed=true]::before { content: '★'; color: var(--accent); }
.pill.tick input:checked + span::before { content: '✓ '; }

/* Recipe */
.back { display: inline-block; margin: 8px 0 4px; font-weight: 500; font-size: 16px; color: var(--muted); text-decoration: none; padding: 8px 0; }
.back:hover { color: var(--ink); }
.byline { color: var(--muted); margin: 0 0 16px; }
.byline a { color: inherit; }
.hero-photo { margin: 0 0 8px; border-radius: var(--radius); overflow: hidden; background: var(--tint); }
.hero-photo img { width: 100%; max-height: 70vh; object-fit: contain; background: var(--tint); }
/* A dish photo shouldn't push the recipe off the screen; a photo of the card itself stays big */
.hero-photo.is-dish img { max-height: 42vh; object-fit: cover; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.hint { color: var(--muted); font-size: 16px; margin: 4px 0 10px; }
.center { text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.actions .btn-big { flex: 1 1 100%; }
.actions .btn:not(.btn-big) { flex: 1; }
.meta { display: flex; gap: 6px 22px; flex-wrap: wrap; margin: 14px 0 0; }
.meta span { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.story { border-left: 2px solid var(--line); padding: 0 0 0 20px; margin-top: 40px; }
.story h2 { margin-top: 0; font-size: 22px; }
.story p { font-family: var(--serif); font-style: italic; font-size: var(--read); line-height: 1.6; color: #3B3833; }
.source { color: var(--muted); font-size: 15px; margin: 24px 0 0; }
.source a { color: inherit; }
.ingredients ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.ingredients li { border-bottom: 1px solid var(--line); }
.ingredients label { display: flex; gap: 14px; align-items: flex-start; padding: 12px 2px; cursor: pointer; font-family: var(--serif); font-size: var(--read); line-height: 1.4; }
.ingredients input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.steps ol { padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 14px 12px 54px; margin: 0 0 6px -14px; border-left: 2px solid transparent; font-family: var(--serif); font-size: var(--read); line-height: 1.6; transition: color .2s, background-color .2s, border-color .2s; }
.js .steps li { cursor: pointer; }
.steps li.done { color: #A39D94; }
.steps li.done::before { content: '✓'; color: var(--sage); }
.steps li.current { background: var(--card); border-left-color: var(--accent); }
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 9px; width: 28px;
  color: var(--accent); font: italic 600 24px/1.3 var(--serif); text-align: left;
}
.comments { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 4px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 18px; }
.comment-list li { background: var(--card); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.comment-list p { margin: 0 0 4px; white-space: pre-wrap; }
.comment-list span { color: var(--muted); font-size: 15px; }
.comment-form { display: grid; gap: 10px; }

/* Forms */
.label { display: block; font-weight: 600; font-size: 18px; margin-bottom: 6px; }
.field { margin: 0 0 26px; border: 0; padding: 0; }
.field .hint { margin-top: -2px; }
fieldset.field { min-width: 0; }
legend.label { padding: 0; margin-bottom: 10px; }
.notice { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0 18px; }
.notice.error { background: #F8ECE9; border-color: #E9CEC8; color: #5E1D14; }

.more summary { cursor: pointer; font-weight: 600; padding: 16px 0; color: var(--ink); }
.import { margin: 8px 0 0; }
.import .search { margin: 0; }
.or-line { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 15px; margin: 22px 0 18px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.imported-photo { margin-bottom: 12px; }
.imported-photo img { width: 100%; max-width: 360px; height: auto; aspect-ratio: 4 / 3; }
.imported-photo input { accent-color: var(--ink); }
.more { margin: -6px 0 26px; }
.btn-upload { position: relative; overflow: hidden; width: 100%; border-style: dashed; min-height: 64px; }
.btn-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.preview, .existing { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; }
.existing { margin: 0 0 12px; }
.existing-photo { display: grid; gap: 4px; font-size: 16px; cursor: pointer; }
.existing-photo img { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; }
.existing-photo input { width: 20px; height: 20px; vertical-align: -3px; accent-color: var(--danger); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1px solid #D9D3C8; background: var(--card); font-weight: 500; font-size: 16px; cursor: pointer; }
.pill input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.delete-form { margin-top: 40px; text-align: center; }

/* Requests */
.lead { color: var(--muted); margin: 0 0 18px; }
.request-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 18px;
  color: var(--ink); text-decoration: none; margin: -4px 0 18px;
}
.request-banner span { color: var(--accent); font-weight: 600; }
.ask { margin-bottom: 8px; }
.ask > summary { list-style: none; }
.ask > summary::-webkit-details-marker { display: none; }
.ask[open] > summary { display: none; }
.ask-form { background: var(--card); border-radius: var(--radius); padding: 20px 18px 18px; box-shadow: var(--shadow); }
select { width: 100%; font: 18px/1.45 var(--sans); color: var(--ink); background: var(--card); border: 1px solid #D9D3C8; border-radius: var(--radius); padding: 13px 14px; min-height: 54px; }
.requests { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.request { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.request h3 { font-size: 23px; font-weight: 600; }
.request-meta { color: var(--muted); font-size: 16px; margin: 4px 0 8px; }
.request-note { margin: 0 0 12px; }
.request .btn-block { margin-top: 12px; }
.replies { list-style: none; padding: 0 0 0 14px; margin: 8px 0 0; border-left: 3px solid var(--line); }
.replies li { margin-bottom: 8px; }
.replies p { margin: 0; white-space: pre-wrap; }
.replies span { color: var(--muted); font-size: 15px; }
.reply summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 12px 0 4px; }
.reply form { margin-top: 8px; }
.done-list { padding-left: 22px; }
.done-list li { margin-bottom: 8px; }
.done-list span { color: var(--muted); font-size: 16px; }
.inline { display: inline; }
.link-btn.danger { color: var(--danger); }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font: 15px var(--sans); text-decoration: underline; cursor: pointer; }
.comment-list .inline { margin-left: 10px; }

/* Sign in */
.center-page main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.welcome { width: 100%; max-width: 420px; text-align: center; padding: 24px 0; }
.welcome form { display: grid; gap: 12px; margin-top: 16px; text-align: left; }
.welcome-icon { margin: 0 auto 14px; border-radius: 18px; }
.welcome .label { margin: 6px 0 -6px; font-size: 18px; }
.show-pw { display: flex; gap: 10px; align-items: center; font-size: 17px; color: var(--muted); cursor: pointer; margin-bottom: 8px; }
.show-pw input { width: 22px; height: 22px; accent-color: var(--sage); }

/* Recipe page: reading layout */
.wide main, .wide .top, .wide .tabs { max-width: 1120px; }
.recipe .meta { margin: 0 0 14px; }
.cook-btn { margin: 16px 0 10px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.tools > * { flex: 1 1 0; min-width: 70px; }
.tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%;
  min-height: 52px; padding: 8px 4px; border-radius: var(--radius); border: 1px solid #D9D3C8; background: var(--card);
  color: var(--ink); font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; list-style: none;
}
.tool:hover { border-color: var(--ink); }
.tool::-webkit-details-marker { display: none; }
.plan-it[open] { flex-basis: 100%; }
.plan-it[open] > .tool { background: var(--tint); flex-direction: row; gap: 10px; }
.reading-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin: 18px 0 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reading-bar[hidden] { display: none; }
.text-size { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 16px; }
.text-size button { width: 44px; height: 44px; border-radius: var(--radius); border: 1px solid #D9D3C8; background: var(--card); color: var(--ink); font-family: var(--serif); font-weight: 600; cursor: pointer; }
.text-size button:nth-of-type(1) { font-size: 16px; }
.text-size button:nth-of-type(2) { font-size: 21px; }
.text-size button:nth-of-type(3) { font-size: 27px; }
.text-size button[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.awake-toggle { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; cursor: pointer; }
.awake-toggle input { width: 22px; height: 22px; accent-color: var(--ink); }
.portion-bar { display: flex; gap: 8px; margin: 2px 0 6px; }
.portion-bar .chip { min-width: 52px; text-align: center; }
.sub-head { font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin: 22px 0 8px; color: var(--muted); }
.ingredients ul + .sub-head { margin-top: 20px; }
.ingredients ul { margin-bottom: 4px; }
@media (min-width: 900px) {
  .recipe-body { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 40px; align-items: start; }
  .recipe-body .ingredients { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 0 4px 12px; }
  .recipe-body h2 { margin-top: 26px; }
}

/* Recipe: meal plan / shopping buttons */
.actions-more { margin-top: 0; }
.actions-more > * { flex: 1 1 220px; }
.plan-it > summary { list-style: none; width: 100%; }
.plan-it > summary::-webkit-details-marker { display: none; }
.plan-it[open] > summary { background: var(--tint); }
.plan-it-form { display: grid; gap: 10px; background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 10px; box-shadow: var(--shadow); }
.plan-it-form .label { margin: 0; }

/* Meal plan */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.week-nav .btn { min-width: 60px; padding: 10px 16px; font-size: 22px; }
.week-range { font-family: var(--serif); font-weight: 600; font-size: 22px; text-align: center; }
.days { display: grid; gap: 12px; margin-top: 14px; }
.day { background: var(--card); border-radius: var(--radius); padding: 14px 18px 10px; box-shadow: var(--shadow); scroll-margin-top: 12px; }
.day.is-today { box-shadow: 0 0 0 1px var(--line), inset 3px 0 0 var(--accent); }
.day h2 { font-size: 22px; margin: 0 0 6px; }
.day h2 span { color: var(--muted); font: 400 17px var(--sans); }
.day h2 em { font: 700 12px var(--sans); font-style: normal; color: var(--accent); vertical-align: 3px; margin-left: 8px; text-transform: uppercase; letter-spacing: .12em; }
.day .hint { margin: 0; }
.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 20px; }
.plan-list li:last-child { border-bottom: 0; }
.plan-list a { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.plan-list span { min-width: 0; overflow-wrap: anywhere; }
.plan-list small { flex-basis: 100%; order: 1; }
.plan-list .inline { margin-left: auto; }
.plan-add-link { display: inline-block; padding: 10px 0 4px; font-weight: 600; font-size: 16px; color: var(--muted); text-decoration: none; }
.plan-add-link:hover { color: var(--ink); }
.plan-add { scroll-margin-top: 12px; }

/* Shopping list */
.shop { list-style: none; padding: 0; margin: 0 0 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.shop li + li { border-top: 1px solid var(--line); }
.shop-item {
  display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 14px 16px; font: 20px/1.4 var(--sans); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.shop-item .box { flex: none; width: 26px; height: 26px; border: 1.5px solid #B9B2A6; border-radius: 6px; display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.shop-item[aria-pressed=true] .box { background: var(--ink); border-color: var(--ink); }
.shop-item[aria-pressed=true] .box::after { content: '✓'; color: #fff; font-weight: 700; font-size: 18px; line-height: 1; }
.shop-item[aria-pressed=true] .txt { text-decoration: line-through; color: var(--muted); }
.shop-item small { display: block; font-size: 15px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.pick { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.pick > legend { font-family: var(--serif); font-weight: 600; font-size: 22px; margin-bottom: 8px; padding: 0; }
.pick ul { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick li + li { border-top: 1px solid var(--line); }
.pick li label { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; cursor: pointer; font-size: 20px; }
.pick li input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.pick li label > span { min-width: 0; overflow-wrap: anywhere; }
.pick .notice { margin: 0 0 10px; font-size: 17px; }
.portion { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.pick li small { display: block; }
.portion legend { font-size: 17px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 6px; }
.portion .pill span { min-width: 60px; text-align: center; font-size: 19px; }
.sticky-go { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--paper); }
.shop-for { margin: 10px 0 14px; }
.shop-group { font-size: 22px; margin: 26px 0 8px; }
.shop-item .txt { min-width: 0; overflow-wrap: anywhere; }
.making { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 16px 6px; margin: 8px 0 4px; }
.making h2 { font-size: 15px; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 2px; }
.making ul { list-style: none; padding: 0; margin: 0; }
.making li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.making li:last-child { border-bottom: 0; }
.making-name { flex: 1; font-family: var(--serif); font-size: 20px; line-height: 1.3; padding: 10px 0; min-width: 0; overflow-wrap: anywhere; }
.making form { flex: none; }
.making small { font-weight: 700; color: var(--accent); }
.making .link-btn { font-size: 16px; padding: 12px 0 12px 8px; }
.shop-group small { color: var(--accent); font-family: var(--sans); font-weight: 700; }
.got-it { margin: 22px 0 18px; }
.got-it > summary { cursor: pointer; font-weight: 600; padding: 14px 0; color: var(--muted); font-size: 18px; }
.got-it .shop { margin-bottom: 0; }

/* Account & family */
.members { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.members li { background: var(--card); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.members .hint { margin: 0; }
.member-name { font-weight: 700; font-size: 20px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 0 18px; }
.badge { font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; vertical-align: 3px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.link-box { display: flex; gap: 8px; margin: 6px 0 0; }
.link-box input { flex: 1; min-width: 0; font-size: 15px; min-height: 48px; padding: 8px 12px; }
.link-box .btn { min-height: 48px; padding: 8px 18px; }
.invite-ready textarea { font-size: 16px; margin-bottom: 10px; }
.invite-ready p { margin-top: 0; }

/* Cook mode */
.cook main { max-width: 760px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 12px; }
.cook-top { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.cook-title { font-family: var(--serif); font-weight: 600; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cook-ings { background: var(--card); border-radius: var(--radius); padding: 0 18px; box-shadow: var(--shadow); }
.cook-ings summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.cook-ings ul { list-style: none; margin: 0 0 14px; padding: 0; font-size: var(--read); }
.cook-ings label { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.cook-ings input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.cook-ings label { font-family: var(--serif); }
.cook-ings input:checked + span { text-decoration: line-through; color: var(--muted); }
.cook-ings .sub-head { margin-top: 6px; }
.cook-title small { color: var(--accent); font-family: var(--sans); font-weight: 700; }
@media (min-width: 900px) {
  .cook main { max-width: 1120px; }
  .cook-layout { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 32px; align-items: start; flex: 1; }
  .cook-ings { position: sticky; top: 12px; margin-top: 20px; }
}
.timer-btn { margin-top: 20px; font-size: 20px; min-height: 60px; }
.timers { flex-basis: 100%; display: grid; gap: 8px; }
.timers[hidden] { display: none; }
.timer { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid #D9D3C8; border-radius: var(--radius); padding: 8px 8px 8px 14px; font-size: 18px; }
.timer-what { flex: 1; color: var(--muted); }
.timer-left { font-size: 26px; font-variant-numeric: tabular-nums; }
.cook-nav .timer .btn { min-height: 44px; padding: 6px 16px; flex: none; }
.timer.ring { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: ring 1s infinite; }
.timer.ring .timer-what { color: var(--accent-ink); }
@keyframes ring { 50% { transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .timer.ring { animation: none; } }
.cook-steps { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; }
.cook-step { padding: 20px 0; border-bottom: 1px solid var(--line); }
.cook-count { color: var(--accent); font-weight: 700; margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .12em; }
.cook-text { font-size: max(var(--read) * 1.3, clamp(27px, 6.6vw, 40px)); line-height: 1.45; margin: 0; font-family: var(--serif); }
.cook-nav { display: none; flex-wrap: wrap; gap: 12px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--paper); }
.cook-nav .btn { flex: 1; }
.cook-end .btn { margin-top: 24px; }
/* With JavaScript on, show one step at a time */
.js .cook-step { display: none; border: 0; }
.js .cook-step.on { display: block; }
.js .cook-nav { display: flex; }

/* Keeping things safe: "I made this", earlier versions, recently deleted, kept drafts */
.made-note { color: var(--sage); font-weight: 600; font-size: 16px; margin: -10px 0 14px; }
.made-note::before { content: '✓ '; }
.edited { color: var(--muted); font-size: 15px; margin: 24px 0 0; }
.edited a { color: inherit; }
.made-it { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; padding: 4px 0; }
.made-it input { width: 22px; height: 22px; flex: none; accent-color: var(--sage); }
.made-mark { display: inline-block; color: var(--sage); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.made-mark::before { content: '✓ '; }
.comment-list li > .made-mark { display: block; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice form { margin-top: 10px; }
.notice.undo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.notice.undo form, .notice .inline .btn { margin: 0; }
.notice .btn { min-height: 44px; padding: 8px 18px; }
.draft-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border-left: 3px solid var(--accent); }
.draft-actions { display: flex; align-items: center; gap: 16px; }
.versions { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.versions li { display: grid; gap: 2px; padding: 12px 16px; }
.versions li + li { border-top: 1px solid var(--line); }
.versions a { font-weight: 600; }
.versions span { color: var(--muted); font-size: 16px; }
.versions .hint { margin: 0; font-size: 15px; }
.versions .is-now strong { font-family: var(--serif); font-size: 19px; }
.removed-photos, .trash { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.removed-photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.removed-photos li { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: grid; gap: 6px; align-content: start; }
.removed-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.removed-photos .hint { margin: 0; font-size: 14px; }
.removed-photos .btn { width: 100%; min-height: 44px; }
.trash li { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: grid; grid-template-columns: 72px 1fr; gap: 10px 14px; align-items: center; }
.trash-img { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.trash-img img { width: 100%; height: 100%; object-fit: cover; }
.trash-img .initial { font-size: 36px; }
.trash-text { display: grid; gap: 2px; min-width: 0; }
.trash-text a { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.trash-text .hint { margin: 0; font-size: 15px; }
.offsite { margin-top: 16px; }
.trash form { grid-column: 1 / -1; }
.trash .btn { width: 100%; min-height: 48px; }
.gone { color: var(--muted); font-style: italic; }
.gone:lang(zh-Hant) { font-style: normal; }
/* An earlier version: plain text, no tick boxes */
.version .ings ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.version .ings li { border-bottom: 1px solid var(--line); padding: 10px 2px; font-family: var(--serif); font-size: var(--read); line-height: 1.4; }
.version .method ol { padding-left: 28px; margin: 0; }
.version .method li { font-family: var(--serif); font-size: var(--read); line-height: 1.6; margin-bottom: 10px; padding-left: 4px; }
.version .method li::marker { color: var(--accent); font-weight: 600; }
.version .tale { border-left: 2px solid var(--line); padding-left: 20px; margin-top: 36px; }
.version .tale p { font-family: var(--serif); font-style: italic; font-size: var(--read); color: #3B3833; }
.version .tale p:lang(zh-Hant) { font-style: normal; }
@media (min-width: 900px) {
  .version .cols { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 40px; align-items: start; }
}

/* Print: just the recipe */
@media print {
  body { background: #fff; font-size: 13pt; }
  .top, .tabs, .back, .actions, .comments, .hint, .thumbs, .tools, .cook-btn, .reading-bar, .portion-bar, .edited, .notice { display: none !important; }
  .wide main { max-width: none; padding: 0; }
  .hero-photo.is-dish img { max-height: 2.5in; }
  .recipe-body { display: grid; grid-template-columns: 2fr 3fr; gap: 0.4in; align-items: start; }
  .ingredients, .steps li, .story { break-inside: avoid; }
  .steps li, .steps li.done, .steps li.current { color: inherit; box-shadow: none; background: none; border-left-color: transparent; }
  .ingredients input:checked + span { text-decoration: none; color: inherit; }
  .steps li.done::before { content: counter(s); color: var(--accent); }
  html, html.size-1, html.size-2 { --read: 13pt; }
  .hero-photo img { max-height: 3in; width: auto; }
  .story, .ingredients ul { box-shadow: none; border: 1px solid #ddd; }
  .ingredients input { display: none; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .tool, .pill span, a { transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
  .btn:active, .tool:active { transform: scale(.98); }
  /* Smooth fade between pages in browsers that support it */
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) { .card-img img { transition: none; } }

/* Requests addressed to a person */
.ask-them { margin: 6px 0 18px; }
.asked { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px 18px 8px; margin: 0 0 22px; }
.asked h2 { font-size: 20px; margin: 0 0 6px; }
.asked ul { list-style: none; padding: 0; margin: 0; }
.asked li { padding: 8px 0; border-top: 1px solid var(--line); }
.asked li:first-child { border-top: 0; }
.asked a { color: var(--ink); font-family: var(--serif); font-size: 19px; }
.asked span { display: block; color: var(--muted); font-size: 15px; }
.request.to-me { box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }
.for-you-list h2 { margin-top: 8px; }
.request-meta a { color: inherit; }
.for-you-list + .ask { margin-top: 22px; }
