/* Colours come from the cookbook's own palette: #434343, #8aa899, #e1d9cc, #f4f2ef, #ffffff.
   The greens, the firmer rule and the outline of controls are that sage and that sand taken darker or lighter.
   --line and --rule are hairlines between things. --control is the edge of anything that is pressed or typed
   into, and is dark enough against the page to be seen (3 to 1 or better). System fonts only. */
:root {
  --paper: #f4f2ef;
  --surface: #ffffff;
  --line: #e1d9cc;
  --rule: #cdc3b2;
  --control: #8f8672;
  --ink: #434343;
  --ink-soft: #666c68;
  --head: #2f4a3d;
  --accent: #3f6453;
  --accent-fill: #8aa899;
  --tint: #e3eae5;
  --on-accent: #ffffff;
  --warn: #8a4b2a;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5.6 11.4l3.7 3.7 7.1-8.2' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --bar: 54px;
  --gutter: 40px;
  --nav-pad: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #25302b;
    --surface: #2d3933;
    --line: #42514a;
    --rule: #5a6b62;
    --control: #8aa899;
    --ink: #ece6db;
    --ink-soft: #b3bdb6;
    --head: #e1d9cc;
    --accent: #a9c4b6;
    --accent-fill: #8aa899;
    --tint: #364840;
    --on-accent: #25302b;
    --warn: #e2ad8b;
    --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M5.6 11.4l3.7 3.7 7.1-8.2' fill='none' stroke='%2325302b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  overflow-wrap: break-word;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.offscreen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.print-only { display: none; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 20; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 10px; }

/* ---------- the top row; on a phone the five names become a bar at the bottom ---------- */
.top { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; max-width: 78rem; margin: 0 auto; padding: 14px var(--gutter) 12px; }
.brand { font: 700 22px/1.2 var(--serif); color: var(--head); text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--accent); }
.nav { display: flex; gap: 6px; margin-right: calc(0px - var(--nav-pad)); }
/* The line under a name is as wide as the word, so the last one ends on the page's right edge. */
.nav a {
  font: 500 16px/1.2 var(--sans); color: var(--ink); text-decoration: none; padding: 0 var(--nav-pad); min-height: 44px;
  display: inline-flex; align-items: center; border-radius: 6px;
  background: linear-gradient(var(--accent-fill), var(--accent-fill)) no-repeat var(--nav-pad) 100% / 0 2px;
}
.nav a:hover { color: var(--accent); background-image: linear-gradient(var(--rule), var(--rule)); background-size: calc(100% - 2 * var(--nav-pad)) 2px; }
.nav a[aria-current="page"] { color: var(--head); font-weight: 650; background-image: linear-gradient(var(--accent-fill), var(--accent-fill)); background-size: calc(100% - 2 * var(--nav-pad)) 2px; }

/* Every page hangs from the same left edge as the site title. */
main { max-width: 78rem; margin: 0 auto; padding: 44px var(--gutter) 96px; outline: none; }
.narrow { max-width: 46rem; }

/* ---------- type. .t1 to .t3 give a heading the look of another level (the Draft preview sits one level down) ---------- */
h1, .t1 { font: 700 48px/1.08 var(--serif); color: var(--head); margin: 0 0 14px; text-wrap: balance; overflow-wrap: anywhere; }
h2, .t2 { font: 700 26px/1.2 var(--serif); color: var(--head); margin: 40px 0 10px; overflow-wrap: anywhere; }
h3, h4, .t3 { font: 600 20px/1.3 var(--serif); color: var(--head); margin: 24px 0 6px; overflow-wrap: anywhere; }
p { margin: 0 0 12px; }
.quiet { color: var(--ink-soft); }
.small, small { font-size: 15px; max-width: 29rem; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 40rem; margin-bottom: 8px; text-wrap: pretty; }
.empty { font: italic 20px/1.5 var(--serif); color: var(--ink-soft); margin: 14px 0 18px; max-width: 34rem; }
.warn { color: var(--warn); }
.count { margin: 0 0 4px; }
.kicker { margin: 0 0 10px; font-size: 15px; color: var(--ink-soft); }
.kicker a { color: inherit; display: inline-block; padding: 13px 0; margin: -13px 0; }
.kicker a:hover { color: var(--accent); }
.kicker .sep { margin: 0 8px; color: var(--control); }

/* ---------- controls: everything pressed or typed into is 44px tall with the same edge ---------- */
button {
  font: 600 16px/1.2 var(--sans); color: var(--head); background: transparent; border: 1px solid var(--control); border-radius: 8px;
  padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none;
}
button:hover { border-color: var(--accent); background: var(--tint); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { background: var(--head); border-color: var(--head); }
button[aria-expanded="true"], button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
button:disabled, button[aria-disabled="true"] { opacity: 0.5; cursor: default; }
/* aria-disabled is a button that can still be reached and pressed, and says why it does nothing (Copy list
   with everything ticked). Its words are still there to be read, so it is not faded: the fill goes and it
   rests as a quiet outline, which does not light up under the mouse. The fill is back as soon as there is
   something to copy. */
button.primary[aria-disabled="true"], button.primary[aria-disabled="true"]:hover { opacity: 1; background: transparent; border-color: var(--control); color: var(--ink-soft); font-weight: 500; }
button.danger { color: var(--warn); border-color: var(--warn); }
button.linklike { border: 0; background: none; padding: 0; font-weight: 500; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
button.linklike:hover { background: none; color: var(--head); }
button.quiet-btn { border-color: transparent; color: var(--ink-soft); font-weight: 500; }
button.quiet-btn:hover { border-color: var(--control); }
button.icon-btn { width: 44px; padding: 0; border-color: transparent; color: var(--ink-soft); flex: none; }
button.icon-btn:hover { color: var(--warn); background: none; border-color: transparent; }
.cross-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
button.chip { font-weight: 500; font-size: 15px; padding: 0 14px; color: var(--ink); }
button.chip[aria-pressed="true"] { color: var(--head); font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.row.end { margin-top: 28px; }
.row .push { margin-left: auto; }
.row .push.quiet-btn { margin-right: -16px; } /* its words end on the column's edge */
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 24rem; }
.stack .split { display: flex; gap: 10px; }
.stack .split > * { flex: 1 1 0; padding: 0 10px; } /* the two halves are the same width, whatever their words */
/* A status line is on the page from the start, empty, so a screen reader hears it when words arrive. */
.status { margin: 12px 0 0; color: var(--warn); }
.status:empty { margin: 0; }
.ask { border-left: 3px solid var(--warn); padding: 2px 0 4px 14px; margin: 14px 0 6px; }
.ask-q { font-weight: 600; margin: 0; }
.ask .row { margin-top: 8px; }

.field { display: block; margin: 0 0 18px; }
.field > span { display: block; font-weight: 600; color: var(--head); margin-bottom: 6px; }
.field small { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.45; margin-top: 6px; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--control); border-radius: 8px;
  width: 100%; max-width: 100%;
}
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], select { height: 44px; padding: 0 12px; line-height: normal; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="date"], input[type="time"], select { width: auto; }
textarea { display: block; padding: 10px 12px; min-height: 44px; line-height: 1.5; resize: vertical; field-sizing: content; }
::placeholder { color: var(--ink-soft); opacity: 1; }
/* The tick box is drawn here, so it is the palette's in both light and dark. .box is the same box as a picture
   (the Draft preview shows the boxes without making them something Tab stops on). */
input[type="checkbox"]:not([role="switch"]), .box {
  -webkit-appearance: none; appearance: none; display: inline-block; width: 22px; height: 22px; margin: 0; flex: none;
  border: 1.5px solid var(--control); border-radius: 5px; background: var(--surface) center / 100% no-repeat;
}
input[type="checkbox"]:not([role="switch"]) { cursor: pointer; }
input[type="checkbox"]:not([role="switch"]):checked { background-color: var(--accent); border-color: var(--accent); background-image: var(--tick); }
.field.inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.field.inline > span { margin: 0; font-weight: 500; color: var(--ink); }
.field.inline input { width: 6.5rem; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
/* A box of text to copy by hand keeps the height its rows ask for (12 lines at most) and scrolls inside,
   however long the text is. Other text boxes grow with what is typed into them. */
.copybox { font-size: 15px; margin-top: 10px; field-sizing: fixed; }
/* a box or a choice that holds something no recipe file can be made from */
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
details.help { margin-top: 28px; border-top: 1px solid var(--line); }
details.help summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-weight: 600; color: var(--accent); display: flex; align-items: baseline; gap: 10px; list-style: none; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::before { content: ""; flex: none; width: 0; height: 0; border: 5px solid transparent; border-left: 7px solid currentColor; border-right: 0; transform-origin: 3px 5px; }
details.help[open] summary::before { transform: rotate(90deg); }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
/* Off is a hollow track with a knob in the outline colour; on is a filled track. The knob is part of the background. */
.switch input {
  -webkit-appearance: none; appearance: none; flex: none; width: 42px; height: 24px; margin: 0; border: 1.5px solid var(--control); border-radius: 999px; cursor: pointer;
  background: var(--surface) radial-gradient(circle at 10.5px 10.5px, var(--control) 0 7px, transparent 7.6px) no-repeat 0 0 / 39px 21px;
  transition: background-position 0.15s;
}
.switch input:checked { border-color: var(--accent); background-color: var(--accent); background-image: radial-gradient(circle at 10.5px 10.5px, var(--on-accent) 0 7px, transparent 7.6px); background-position: 18px 0; }
@media (prefers-reduced-motion: reduce) { .switch input { transition: none; } }

/* ---------- home: the five doors, set like a contents page, with the chapters and their recipes beside them ---------- */
main.home { padding-top: 72px; }
.hello { font-size: clamp(48px, 5.2vw, 64px); line-height: 1.02; margin: 0 0 22px; text-wrap: balance; }
.home-title .lede { margin: 0 0 8px; }
ol.doors, ul.chapters, ul.titles { list-style: none; margin: 0; padding: 0; }
ol.doors { border-top: 2px solid var(--head); }
ol.doors a, ul.chapters a.chapter {
  display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: baseline; column-gap: 12px;
  text-decoration: none; color: inherit;
}
ol.doors a { padding: 22px 0 20px; border-bottom: 1px solid var(--line); }
.door-name { font: 700 38px/1.1 var(--serif); color: var(--head); }
.leader { border-bottom: 2px dotted var(--rule); }
.door-count { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.door-what { grid-column: 1 / -1; color: var(--ink-soft); margin-top: 6px; }
ol.doors a:hover .door-name, ul.chapters a:hover .chapter-name { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.chapters-title { font: 600 15px/1.3 var(--sans); color: var(--ink-soft); margin: 40px 0 8px; }
ul.chapters { border-top: 1px solid var(--line); }
ul.chapters > li { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
ul.chapters a.chapter { padding: 12px 0 6px; min-height: 44px; }
.chapter-name { font: 600 21px/1.3 var(--serif); color: var(--head); }
ul.titles { margin: 0 0 6px; }
ul.titles a { display: flex; align-items: center; column-gap: 10px; min-height: 34px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
ul.titles a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- lists of recipes: a chapter is a heavy rule and a large name, a recipe is a row under it ---------- */
.filter { margin: 0 0 18px; }
.filter-name { display: block; font-weight: 600; color: var(--head); margin-bottom: 8px; }
.results h2 { font-size: 30px; line-height: 1.15; border-top: 2px solid var(--head); padding-top: 14px; margin: 48px 0 4px; }
.results h2:first-child { margin-top: 0; }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
/* A row is its title, then what goes with it (the time and, when there is one, the tag) on the right. The
   title always keeps half the row: what is on the right has its full width until that would take more, and
   then the tag goes under the time before a long title is squeezed into a sliver. */
a.row-link { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(50%, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 13px 0; text-decoration: none; color: inherit; }
.row-link .t { font: 600 20px/1.3 var(--serif); color: var(--head); min-width: 0; overflow-wrap: anywhere; }
.row-link:hover .t { color: var(--accent); text-decoration: underline; }
.row-link .m { min-width: 0; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 10px; color: var(--ink-soft); font-size: 15px; text-align: right; }
/* Where the times stand in a column on the right, every time ends on the same edge: the tag sits to the left
   of its time, and goes under it, still on that edge, when the two do not fit on one line. In the page the
   time still comes first, so that is the order it is read out in. */
@media (min-width: 700px) {
  .row-link .m { flex-direction: row-reverse; justify-content: flex-start; }
}
/* The tag on a recipe that needs more than one day ("2-day recipe"), beside the time wherever a recipe's time
   is shown: the page's own type inside a thin outline. It is not something to press, so it has the hairline
   of a rule, not the edge of a control, and no fill. It is no taller than the line of text it sits in, so a
   row with a tag is the same height as a row without one. */
.days, .yours { display: inline-block; font: 500 14px/1.35 var(--sans); color: var(--ink); border: 1px solid var(--rule); border-radius: 5px; padding: 0 8px; white-space: nowrap; }
/* The mark on one of his own recipes ("Yours"): the same outline as the days tag, in the colour of the site's
   own words, so the two can sit side by side and still be told apart. */
.yours { color: var(--accent); flex: none; }
button.star { width: 44px; padding: 0; border-color: transparent; color: var(--accent); flex: none; margin-right: -10px; }
button.star[aria-pressed="true"] { background: transparent; border-color: transparent; }
button.star.with-text { width: auto; margin: 0; padding: 0 16px 0 12px; border-color: var(--control); color: var(--head); }
button.star.with-text[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.star-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; flex: none; }
button.star[aria-pressed="true"] .star-icon { fill: var(--accent-fill); stroke: var(--accent); }
.drafts { margin: 0 0 40px; }
.drafts h2 { margin: 0 0 2px; }
.draft-row .remove, .cook-line .remove { min-height: 44px; padding: 0 8px; margin-right: -8px; font-size: 15px; color: var(--ink-soft); }
.ask-host { flex-basis: 100%; }
.ask-host:empty { display: none; }

/* ---------- a recipe ---------- */
.recipe-head { max-width: 48rem; }
.headnote { font: italic 21px/1.5 var(--serif); margin: 0 0 16px; max-width: 36rem; overflow-wrap: anywhere; }
.meta { color: var(--ink-soft); margin: 0 0 6px; max-width: 40rem; text-wrap: pretty; overflow-wrap: anywhere; }
.meta .tag-gap { word-spacing: 6px; } /* the space on each side of the tag: wider than a word space, and gone at the start or end of a line */
.guess { margin: 0 0 6px; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; margin: 18px 0 0; }
.actions .row { margin-top: 0; }
.row.minor { gap: 2px 24px; }
.row.minor a, .row.minor button.linklike { font: 500 16px/1.2 var(--sans); min-height: 44px; display: inline-flex; align-items: center; }
.panel { border-top: 2px solid var(--accent-fill); padding: 16px 0 0; margin-bottom: 40px; }
.panel h2 { margin-top: 0; }
/* his own recipes: where one is kept, and how it stands beside the cookbook, in quiet lines under the time */
.own-line { color: var(--ink-soft); margin: 6px 0 0; max-width: 40rem; text-wrap: pretty; overflow-wrap: anywhere; }
.own-line.with-action { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
.own-line.with-action button.linklike { min-height: 44px; }
.own-said { max-width: 40rem; }
/* a page drawn by an older copy of the site than the one that last saved his recipes */
.newer { color: var(--warn); font-weight: 600; max-width: 40rem; margin: 0 0 18px; }

.cols { margin-top: 28px; }
.cols > div { min-width: 0; }
.ingredients > :first-child, .method > :first-child, .cols > div > h2:first-child { margin-top: 0; }
.steps-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin: 0 0 10px; }
.steps-head > :first-child { margin: 0; }
.keep-on { display: flex; flex-direction: column; align-items: flex-end; }
ul.ing { list-style: none; margin: 0; padding: 0; }
ul.ing li { border-bottom: 1px solid var(--line); }
ul.ing .ing-line { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; min-height: 44px; }
ul.ing label.ing-line { cursor: pointer; }
ul.ing .ing-line > span:last-child { min-width: 0; overflow-wrap: anywhere; }
ul.ing input, ul.ing .box { margin-top: 2px; }
ul.ing .q { font-weight: 700; }
ul.ing .n { color: var(--ink-soft); }
/* On the recipe a tick means "done with this one". In the picker a tick means "add this", so nothing is crossed out there. */
.ingredients ul.ing input:checked + span { text-decoration: line-through; color: var(--ink-soft); }
ul.ing li.aside { padding: 11px 0 11px 34px; font-style: italic; color: var(--ink-soft); overflow-wrap: anywhere; }
.ingredients { margin-bottom: 40px; }
ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
ol.steps li { counter-increment: step; position: relative; padding-left: 46px; margin: 0 0 18px; font-size: 18px; line-height: 1.62; max-width: 38rem; overflow-wrap: anywhere; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: -3px; font: 700 26px/1.4 var(--serif); color: var(--accent); }
ul.tips { margin: 0; padding-left: 1.2em; max-width: 33rem; overflow-wrap: anywhere; }
ul.tips li { margin-bottom: 10px; }

/* ---------- shopping: the thing on the left, how much on the right, a dotted line between them ---------- */
.shop-group h2 { font-size: 22px; margin: 30px 0 2px; }
.shop-group:first-child h2 { margin-top: 0; }
.shop-group h2 a { color: inherit; text-decoration-color: var(--control); }
.shop-group h2 a:hover { color: var(--accent); }
ul.shop { list-style: none; margin: 0; padding: 0; }
ul.shop li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
ul.shop label { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 10px 0; min-height: 44px; cursor: pointer; }
ul.shop .thing { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, auto) minmax(12px, 1fr) minmax(0, auto); align-items: baseline; column-gap: 10px; }
ul.shop .nm { font-weight: 600; overflow-wrap: anywhere; }
ul.shop .amt { color: var(--ink-soft); text-align: right; overflow-wrap: anywhere; }
ul.shop li.got .thing { text-decoration: line-through; color: var(--ink-soft); }
ul.shop li.got .nm { font-weight: 400; }
ul.shop li.got .leader { visibility: hidden; }
ul.shop .remove { margin-right: -10px; }
.add-own { display: flex; align-items: flex-end; gap: 10px; margin: 28px 0 0; max-width: 24rem; }
.add-own .field { flex: 1; margin: 0; }

/* ---------- prep ---------- */
ul.cooking { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
ul.cooking li { border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
ul.cooking p { margin: 0; }
.cook-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* The tag sits beside the name, or under it where there is no room. Under it, it has air above and below:
   the gap between the two lines, and the padding, which a name on one line never fills (the line is 44px tall). */
.cook-name { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 4px 0; }
.cook-line .t { font: 600 20px/1.3 var(--serif); color: var(--head); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.cook-line .t:hover { color: var(--accent); text-decoration: underline; }
.guess-line .time-boxes { margin: 10px 0 0; }
.guess-line .warn { margin-top: 8px; }
.guess-line .warn:empty { margin: 0; }
.pick-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.pick-row .field { margin: 0; flex: 1; min-width: 12rem; }
.pick-row select { width: 100%; }
.when-boxes { display: flex; flex-wrap: wrap; gap: 0 20px; }
.plan-day { font: 600 21px/1.3 var(--serif); color: var(--head); margin: 0 0 18px; text-wrap: balance; }
/* Each stop on the timeline: when, in the plain face, then what, in the title face. */
ol.timeline { list-style: none; margin: 0 0 4px; padding: 0 0 0 7px; }
ol.timeline li { position: relative; padding: 0 0 24px 28px; border-left: 2px solid var(--line); }
ol.timeline li::before { content: ""; position: absolute; left: -8px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent-fill); }
ol.timeline li.eat { border-left-color: transparent; padding-bottom: 6px; }
ol.timeline li.eat::before { background: var(--accent); border-color: var(--accent); }
ol.timeline .when { display: block; font: 600 16px/1.45 var(--sans); color: var(--ink); }
ol.timeline .what { display: block; font: 400 21px/1.35 var(--serif); color: var(--head); overflow-wrap: anywhere; }
ol.timeline .what strong { font-weight: 600; }
ol.timeline .eat .what { font-weight: 700; }
ol.timeline .sub { display: block; }
.plan-out + .row { margin-top: 26px; }
.plan-note { margin-top: 22px; }
.plan-note p:last-child { margin-bottom: 0; }

/* ---------- draft ---------- */
.note { border-left: 3px solid var(--accent-fill); padding: 2px 0 2px 14px; margin: 0 0 22px; }
.note p { margin: 0 0 4px; }
.pair { display: flex; flex-wrap: wrap; gap: 0 20px; }
.pair .field:last-child { flex: 1; min-width: 12rem; }
fieldset.time { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
fieldset.time legend { font-weight: 600; color: var(--head); padding: 0; margin-bottom: 6px; }
.time-boxes { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.say { margin: 12px 0 0; color: var(--head); font-weight: 500; max-width: 34rem; }
.say.warn { color: var(--warn); } /* the line refuses something: the colour of the list of what is missing */
.days-field { margin: 0 0 20px; }
.days-field .field { margin: 0; }
.days-field .say:empty { margin: 0; } /* in the page while empty, so its words are heard when they arrive; no room taken until then */
.needed { color: var(--warn); margin: 0 0 4px; }
.needed.ok { color: var(--accent); }
.finish { border-top: 1px solid var(--line); margin-top: 30px; }
.finish h2 { margin-top: 26px; }
.finish .lasts { margin-top: 14px; } /* the line under the buttons has the same air above it as they have */
.mine-list { border-top: 1px solid var(--line); margin-top: 30px; }
.mine-list h2 { margin-top: 26px; }
.mine-list > .rows { margin-top: 6px; }
.load-lines { list-style: none; margin: 12px 0 0; padding: 0; max-width: 40rem; }
.load-lines:empty { display: none; }
.load-lines li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.preview-label { margin: 0 0 10px; }
.preview { border-top: 2px solid var(--accent-fill); padding-top: 24px; }
.preview .t1 { font-size: 36px; }
.preview .cols { display: block; margin-top: 28px; }
.preview .cols > .right { margin-top: 0; }
.preview .ingredients { margin-bottom: 36px; }

/* ---------- a computer window: two columns ---------- */
@media (min-width: 900px) {
  .cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
  .cols.rail { grid-template-columns: 17rem minmax(0, 1fr); gap: 72px; margin-top: 24px; }
  /* Shopping: the list on the left, what to do with it on the right. In the page the right column comes
     first, so it is first for the keyboard and on top on a phone. */
  .cols.side { grid-template-columns: minmax(0, 46rem) minmax(15rem, 24rem); gap: 72px; margin-top: 24px; justify-content: space-between; }
  .cols.side > .left { grid-column: 1; grid-row: 1; }
  .cols.side > .right { grid-column: 2; grid-row: 1; }
  /* A side column never scrolls inside itself. js/dom.js marks it "fits" (it sticks to the top) or "tall"
     (it rides up with the page until its end shows, then stays). */
  .sticky.fits { position: sticky; top: 16px; }
  .sticky.tall { position: sticky; bottom: 16px; align-self: end; }
  .preview .sticky { position: static; }
  .ingredients, .panel { margin-bottom: 0; }
  .steps-head .switch { margin: -7px 0; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; column-gap: 72px; align-items: start; }
  .home-title { grid-column: 1; grid-row: 1; }
  .home-chapters { grid-column: 1; grid-row: 2; }
  ol.doors { grid-column: 2; grid-row: 1 / span 2; margin-top: 10px; }
  /* Browse: in the rail the filters are a plain list of names, the picked one underlined. */
  .cols.rail .chips { flex-direction: column; gap: 0; align-items: flex-start; }
  .cols.rail button.chip { border: 0; background: none; padding: 0; min-height: 36px; border-radius: 4px; font-size: 16px; justify-content: flex-start; }
  .cols.rail button.chip:hover { color: var(--accent); }
  .cols.rail button.chip[aria-pressed="true"] { text-decoration: underline; text-decoration-color: var(--accent-fill); text-decoration-thickness: 2px; text-underline-offset: 6px; }
}

/* A wide window: the things to do with a recipe sit beside its title, so the ingredients start high on the page. */
@media (min-width: 1200px) {
  .recipe-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 56px; align-items: end; }
  .recipe-head { max-width: none; }
  .actions { flex-direction: column; align-items: flex-end; gap: 0; margin: 0; }
  /* what Download, Copy and Delete say, and Delete's question, open in that same column, under the links that
     were pressed. Its width is the column's: the zero width keeps its words from widening the column. */
  .recipe-top > .own-said { grid-column: 2; width: 0; min-width: 100%; }
}

/* On the home page the five doors are the way in, so a computer window does not repeat them in a top row. */
@media (min-width: 700px) {
  body[data-page="home"] .top { display: none; }
}

/* ---------- a narrow window or a tablet: one column ---------- */
@media (max-width: 899px) {
  :root { --gutter: 32px; --nav-pad: 10px; }
  .brand { font-size: 20px; }
  .home-title { margin-bottom: 24px; }
  .cols > .right { margin-top: 32px; }
  .recipe > .cols > .right { margin-top: 0; }
  .cols.rail > .right { margin-top: 26px; }
  .cols.side > .right { margin-top: 0; margin-bottom: 26px; }
  .cols.side > .right:has(> .stack[hidden]) { margin-bottom: 0; }
  .cols.side > .left { margin-top: 0; }
}

/* ---------- phone ---------- */
@media (max-width: 699px) {
  :root { --gutter: 16px; }
  .top-in { padding-top: 12px; padding-bottom: 10px; }
  body[data-page="home"] .top { border-bottom: 0; }
  body[data-page="home"] .brand { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; gap: 0; margin: 0; background: var(--surface); border-top: 1px solid var(--rule);
    padding: 0 max(2px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(2px, env(safe-area-inset-left));
  }
  .nav a { flex: 1; min-width: 0; min-height: var(--bar); padding: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; border-radius: 0; border-top: 2px solid transparent; }
  .nav a, .nav a:hover, .nav a[aria-current="page"] { background-image: none; }
  .nav a[aria-current="page"] { border-top-color: var(--accent); }
  .nav a:focus-visible { outline-offset: -3px; }
  main, main.home { padding: 22px var(--gutter) calc(var(--bar) + env(safe-area-inset-bottom) + 48px); }
  h1, .t1 { font-size: 34px; }
  h2, .t2 { font-size: 23px; margin-top: 32px; }
  .hello { font-size: 44px; margin-bottom: 12px; }
  ol.doors a { padding: 16px 0 15px; }
  .door-name { font-size: 29px; }
  .door-count { font-size: 15px; }
  ul.titles a { min-height: 44px; }
  .results h2 { font-size: 26px; margin-top: 36px; }
  .headnote { font-size: 19px; }
  a.row-link { grid-template-columns: minmax(0, 1fr); padding: 11px 0; }
  .row-link .m { justify-self: start; justify-content: flex-start; text-align: left; } /* under the title, from the left; a long time and the tag go onto two lines before anything is cut off */
  ol.steps li { padding-left: 38px; font-size: 17px; }
  .stack, .add-own { max-width: none; }
  /* a recipe's three buttons in one row */
  .actions { gap: 0; margin-top: 14px; }
  .actions .row.main { flex-wrap: nowrap; gap: 8px; width: 100%; }
  .actions .row.main button { padding: 0 10px; font-size: 15px; white-space: nowrap; }
  .actions .row.main button:not(.star) { flex: 1 1 auto; }
  /* the star is a star alone here, as it is in the lists; its word stays for a screen reader */
  .actions button.star.with-text { width: 44px; padding: 0; flex: none; }
  .actions button.star.with-text > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .row.minor { gap: 0 20px; }
  .row .push, .row .push.quiet-btn { margin-left: 0; margin-right: 0; }
  .row .push.quiet-btn { padding-left: 0; } /* on a row of its own, its words start on the page's left edge */
}
@media (max-width: 359px) {
  .actions .row.main { flex-wrap: wrap; }
}

/* ---------- paper: one sheet where it fits, nothing that is only for the screen ---------- */
@page { margin: 0.6in; }
@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --ink-soft: #222; --head: #000; --line: #999; --rule: #999; --control: #444; --accent: #000; --accent-fill: #666; --warn: #000; }
  body { font-size: 11pt; padding: 0; }
  .top, .skip, .actions, .panel, .kicker, .star, .status, .filter, .field, .row, .stack, details.help, .add-own, .remove, .pick-row, .when-boxes,
  .finish, .form, .drafts, .new-title, .preview-label, .keep-on, .guess, .guess-line, .count, .lede, .plan-note, .warn, .no-print,
  .own-line, .own-said, .own-ask, .mine-list, .newer,
  main[data-page="draft"] > h1 { display: none !important; }
  .print-only { display: block; }
  .recipe .ingredients[hidden] { display: block !important; } /* the shopping picker was open: the paper still gets the ingredients */
  .book-line { font: 600 10pt/1.3 var(--sans); margin: 0 0 5pt; }
  main, main.home { max-width: none; padding: 0; }
  .cols, .cols.even, .cols.rail, .cols.side { display: block; margin-top: 12pt; }
  .cols > .right { margin-top: 0; }
  .sticky { position: static !important; }
  .recipe-head, .headnote, .meta, ol.steps li, ul.tips { max-width: none; }
  h1, .t1, .preview .t1 { font-size: 26pt; margin-bottom: 5pt; }
  h2, .t2 { font-size: 15pt; margin: 12pt 0 4pt; }
  h3, h4, .t3 { font-size: 12pt; margin: 8pt 0 2pt; }
  h1, h2, h3, h4, .t1, .t2, .t3, .plan-day { break-after: avoid; }
  .headnote { font-size: 12pt; margin-bottom: 5pt; }
  .days, .yours { font-size: 9.5pt; border-width: 0.75pt; border-color: #444; padding: 0 4pt; } /* beside the time on paper too */
  .ingredients, .preview .ingredients { margin-bottom: 10pt; }
  ul.ing, ul.shop { columns: 2; column-gap: 24pt; }
  ul.ing li, ul.shop li { break-inside: avoid; border-bottom: 0; }
  ul.ing .ing-line, ul.shop label { padding: 2pt 0; min-height: 0; gap: 6pt; }
  ul.ing li.aside { padding: 2pt 0 2pt 16pt; }
  input[type="checkbox"]:not([role="switch"]), .box { width: 9pt; height: 9pt; border-width: 0.75pt; border-radius: 1.5pt; background: none !important; }
  ul.ing input, ul.ing .box { margin-top: 2.5pt; }
  .ingredients ul.ing input:checked + span { text-decoration: none; color: inherit; } /* the paper is a clean copy */
  ol.steps li { font-size: 11pt; line-height: 1.4; margin-bottom: 6pt; padding-left: 22pt; break-inside: avoid; }
  ol.steps li::before { font-size: 13pt; top: -1.5pt; }
  ul.tips li { margin-bottom: 4pt; break-inside: avoid; }
  .shop-group h2 { font-size: 13pt; margin: 10pt 0 2pt; }
  ul.shop .thing { display: block; }
  ul.shop .leader { display: none; }
  ol.timeline li { padding-bottom: 10pt; break-inside: avoid; }
  ol.timeline .what { font-size: 13pt; }
  .preview { border-top: 0; padding-top: 0; }
}
