/* The look of the four tabs. Loaded last, so it decides.
   Each tab opens with a banner: a photograph of what the tab is about on one colour per tab, with the tab's name and
   its main fact on it (3 to use first, 3 to buy, tonight's dinner, the days of supply).
   Under the banner everything follows the iPhone's own conventions: the system font, white grouped lists with round
   corners on a grey page, filled and grey round-cornered buttons in the app's one green, a segmented control for a
   choice of a few things, and a frosted tab bar. Nothing moves on its own.
   The photographs are in public/ui/photo (scripts/make-photos.mjs).
   A Look chosen in Settings still replaces the colours. */

:root { --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, "Segoe UI", Roboto, sans-serif; --display: var(--sys);
  --radius: 12px; --photo-bg: #ebe9e5; --cink: #17130f; --fill: color-mix(in srgb, var(--ink) 7%, transparent); }
body, button, input, select, textarea { font-family: var(--sys); }
h1, h2, h3, .brand, .big-name { font-family: var(--sys); }
/* the iPhone's grouped colours: a grey page, white groups */
html:root:not([data-look]) { --bg: #f2f2f7; --card: #ffffff; --deep: #e9e9ee; --ink: #111113; --muted: #6c6c70; --faint: #aeaeb2; --line: #e3e3e8; }
@media (prefers-color-scheme: dark) { html:root:not([data-theme="light"]):not([data-look]) { --bg: #000000; --card: #1c1c1e; --deep: #2c2c2e; --ink: #ffffff; --muted: #98989f; --faint: #636366; --line: #2f2f32; --fill: color-mix(in srgb, var(--ink) 14%, transparent); } }
html:root[data-theme="dark"]:not([data-look]) { --bg: #000000; --card: #1c1c1e; --deep: #2c2c2e; --ink: #ffffff; --muted: #98989f; --faint: #636366; --line: #2f2f32; --fill: color-mix(in srgb, var(--ink) 14%, transparent); }

/* ---- 1. the cover at the top of a tab ---- */
/* On a phone the cover is the photograph, 2 wide by 3 tall, with the paper filling its upper half. */
.shead.cover { position: relative; isolation: isolate; container-type: inline-size; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; box-sizing: border-box; aspect-ratio: 2 / 3;
  margin: calc(-1 * (var(--nv-top, 0px) + 14px)) -1rem 1.1rem; padding: calc(var(--nv-top, 0px) + 6px) 1rem 0;
  color: var(--cink); background: var(--paper, #e2532a); overflow: hidden; }
.shead.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--cover) center bottom / cover no-repeat; }
.shead.cover[data-cover="stock"] { --paper: #d84a1e; --cover: var(--cover-pantry, url(photo/cover-pantry.webp)); --mast: 29.6cqw; color: #fff; }
.shead.cover[data-cover="list"] { --paper: #fddb43; --cover: url(photo/cover-shopping.webp); --mast: 21.4cqw; }
.shead.cover[data-cover="meals"] { --paper: #87d8f9; --cover: var(--cover-meal, url(photo/cover-meals.webp)); --mast: 35cqw; }
.shead.cover[data-cover="supply"] { --paper: #94b077; --cover: url(photo/cover-supply.webp); --mast: 30cqw; }
/* the line across the top: the day, one fact, and the way to Settings at its end */
.shead.cover .cissue { order: -1; flex: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; min-height: 34px; margin: 0; padding: 0 2.6rem .3rem 0;
  font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; opacity: .82; }
.shead.cover .cissue span { overflow: hidden; text-overflow: ellipsis; }
.shead.cover .cissue > span:empty, .shead.cover .cissue > span:has(> [hidden]:only-child) { display: none; }
.shead.cover .gearbtn { position: absolute; top: calc(var(--nv-top, 0px) - 1px); right: .35rem; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: inherit; }
.shead.cover .gearbtn .ion-ic { width: 20px; height: 20px; }
/* the masthead: the tab's name, as wide as the cover */
.shead.cover h1 { margin: .1rem 0 0; color: inherit; font: 800 clamp(2.6rem, 13.5cqw, 3.5rem)/1.05 var(--sys); letter-spacing: -.025em; white-space: nowrap; }
/* the cover lines */
.shead.cover .clead { margin: .15rem 0 0; font: 700 clamp(1.3rem, 6.4cqw, 1.6rem)/1.15 var(--sys); letter-spacing: -.015em; text-wrap: balance; }
.shead.cover .clead:empty, .shead.cover .csub:empty, .shead.cover .clines:empty { display: none; }
.shead.cover .csub { margin: .4rem 0 0; color: inherit; font-size: .875rem; font-weight: 600; line-height: 1.3; max-width: 32ch; }
.shead.cover .clines { list-style: none; margin: .7rem 0 0; padding: 0; max-width: 62%; }
.shead.cover .clines li { margin: 0 0 .32rem; font-size: .8125rem; line-height: 1.22; cursor: pointer; }
.shead.cover .clines li span { color: inherit; font-weight: 400; }
.shead.cover .clines b { display: block; font-size: .875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Meals: what tonight's dinner uses up, and the way to its recipe, sit under the cover */
.tn-uses { margin: 0 0 .7rem; color: var(--muted); font-size: .875rem; }
.tn-uses:empty { display: none; }
#tonight:empty { display: none; }
.cacts { display: flex; align-items: center; gap: 1.1rem; margin: 0 0 .4rem; }
#tn-acts.cacts { padding-left: 0; gap: .6rem; margin: 0 0 .9rem; }
.cacts:empty { display: none; }
.cacts .btn { flex: 1 1 0; margin: 0; min-height: 50px; padding: 0 .6rem; white-space: nowrap; border: 0; border-radius: 12px; background: var(--btn); color: var(--btn-ink); font-size: 1.0625rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.cacts button { flex: 1 1 0; min-height: 50px; margin: 0; padding: 0 .6rem; white-space: nowrap; border: 0; border-radius: 12px; background: var(--fill); box-shadow: none; color: var(--brand); font-size: 1.0625rem; font-weight: 600; justify-content: center; }
/* a recipe opens with its dish as a cover; its name is the cover line and the Back button sits on the paper */
.shead.cover.rcover { aspect-ratio: 4 / 5; margin-top: calc(-1 * (var(--nv-top, 0px) + 46px)); padding-top: calc(var(--nv-top, 0px) + 52px); }
.shead.cover.rcover h1 { margin: 0; font: 800 clamp(1.9rem, 9.5cqw, 2.5rem)/1.08 var(--sys); letter-spacing: -.02em; white-space: normal; text-wrap: balance; }
html.nv-pushed:not(.nv-scrolled) body:has(.rcover):not(.bare) #navback { color: var(--cink); }

/* ---- 2. shapes: round corners, grouped lists, the app's green for anything you can press ---- */
.card { border-radius: 12px; border-color: transparent; box-shadow: none; }
button, .btn, input, select, textarea { border-radius: 12px; }
button.sm, .btn.sm { border-radius: 9px; }
h2, .sect h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; text-transform: none; color: var(--ink); }
.sect { margin: 1.5rem 0 .6rem; }
.thumb, .thumb.icon, img.art.photo { border-radius: 8px; }
img.thumb.photo, img.art.photo { object-fit: cover; background: var(--photo-bg); }

/* a list is a white group with round corners; a thin line between rows starts after the picture */
.plist { background: var(--card); border: 0; border-radius: 12px; overflow: hidden; }
.plist li { padding: .5rem .9rem; min-height: 60px; gap: .8rem; border-bottom: .5px solid var(--nv-sep); }
.plist li:last-child { border-bottom: 0; }
.plist .name { font-size: 1.0625rem; font-weight: 500; }
.plist .sub { font-size: .875rem; }
.plist .qty { font-size: 1.0625rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.plist .grp, .plist li.grp:has(.grp-art) { display: flex; justify-content: space-between; align-items: baseline; min-height: 0; padding: .9rem .9rem .35rem; background: var(--bg); border-bottom: 0;
  color: var(--muted); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.plist .grp small { font: inherit; font-weight: 500; text-transform: none; letter-spacing: 0; }
.plist .grp .grp-art { display: none; }
.plist .usebtn, .plist .ghost, #inv .plist li button.usebtn { min-width: 0; min-height: 32px; padding: 0 .9rem; border: 0; border-radius: 99px; background: var(--fill); color: var(--brand); font-size: .9375rem; font-weight: 700; }
.plist .ghost.bad { color: var(--bad); }
.rowart, .rowart img { width: 44px; height: 44px; }
.rowart img.photo { object-fit: cover; border-radius: 8px; }
.pempty { border: 0; border-radius: 12px; background: var(--card); }

/* a choice of a few things is a segmented control: a grey track, the one showing in white */
.ltabs, .pchips { display: flex; gap: 2px; overflow-x: auto; margin: 1.1rem 0 .8rem; padding: 2px; border: 0; border-radius: 9px; background: var(--fill); scrollbar-width: none; }
.ltabs::-webkit-scrollbar, .pchips::-webkit-scrollbar { display: none; }
.ltabs button, .pchips button { flex: 1 0 auto; justify-content: center; min-height: 32px; margin: 0; padding: 0 .75rem; border: 0; border-radius: 7px; background: none; box-shadow: none; color: var(--ink); font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.ltabs button b, .pchips button b { margin-left: .3rem; font-weight: 500; color: var(--muted); }
.ltabs button.on, .pchips button.on { background: var(--card); border: 0; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.ltabs button.on b, .pchips button.on b { color: var(--muted); opacity: 1; }
.pchips .chip-art { display: none; }

/* ---- 3. Pantry ---- */
/* the search field: grey, round, no outline */
.pfind { padding: 0 .65rem; border: 0; border-radius: 10px; background: var(--fill); }
.pfind input { min-height: 40px; }
.pfind:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent); }
.bigacts .btn { min-height: 50px; border: 0; border-radius: 12px; }
.bigacts .btn:not(.primary) { border: 0; background: var(--fill); color: var(--brand); }
/* Use first: photographs in a row that scrolls sideways */
.ufcards { list-style: none; display: flex; gap: .7rem; margin: 0 -1rem; padding: 0 1rem .2rem; overflow-x: auto; scrollbar-width: none; }
.ufcards::-webkit-scrollbar { display: none; }
.ufcards li { flex: 0 0 132px; min-width: 0; cursor: pointer; }
.ufcards .thumb { display: grid; place-items: center; width: 132px !important; height: 132px !important; margin-bottom: .5rem; border-radius: 12px; object-fit: cover; background: var(--photo-bg); }
.ufcards .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ufcards .sub { font-size: .8125rem; color: var(--muted); }
.ufcards .sub .b { color: var(--bad); font-weight: 600; } .ufcards .sub .w { color: var(--warn); font-weight: 600; }
.ufcards .ufbtns { display: flex; gap: .9rem; margin-top: .15rem; }
.ufcards .ufbtns button { min-height: 36px; padding: 0; border: 0; background: none; box-shadow: none; color: var(--brand); font-size: .875rem; font-weight: 600; }
.ufcards .ufbtns button.bad { color: var(--bad); }

/* ---- 4. Shopping, Meals, Supply ---- */
#lbody .card { border: 0; border-radius: 12px; box-shadow: none; }
#lbody .list .thumb { width: 44px !important; height: 44px !important; }
#lbody .list .qtyin { border: 0; border-radius: 8px; background: var(--fill); font-weight: 600; text-align: center; }
#lbody .list .xdel { border: 0; background: none; color: var(--faint); }
#xform input { border: 0; background: none; }
/* a choice as a photograph with its words on it */
.ptile:has(img.photo) { position: relative; isolation: isolate; justify-content: flex-end; align-items: flex-start; gap: 0; height: 108px; padding: 0 .6rem .5rem; border: 0; border-radius: 12px; overflow: hidden;
  background: #20241f; color: #fff; text-align: left; }
.ptile:has(img.photo) img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.ptile:has(img.photo)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, .74)); }
.ptile:has(img.photo) b { color: #fff; font-size: .8125rem; }
.ptile:has(img.photo) small { color: #fff; opacity: .9; font-size: .75rem; }
.ptile.wide:has(img.photo) { width: 9.4rem; }
.ptile.on:has(img.photo) { background: #20241f; box-shadow: none; outline: 3px solid var(--brand); outline-offset: 2px; }
.ptiles { padding-top: 5px; padding-bottom: 7px; }

.tonight.card { border: 0; border-radius: 12px; box-shadow: none; }
.tn-art { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--photo-bg); }
.tn-art img { width: 100%; height: 100%; }

.sbar.big { height: 8px; border-radius: 4px; margin-top: .45rem; } .sbar.big i { border-radius: 4px; }
details.sgrp { border: 0; border-radius: 12px; background: var(--card); overflow: hidden; }
details.sgrp summary .grp-art { width: 44px; height: 44px; border-radius: 8px; }

/* ---- 5. the item sheet ---- */
.isheet-head { gap: 1rem; margin-bottom: 1.1rem; }
.isheet-head h3 { font: 700 1.375rem/1.15 var(--sys); letter-spacing: -.015em; }
.icount, .irows { border: 0; border-radius: 12px; background: var(--bg); }
.irows > * { border-bottom: .5px solid var(--nv-sep); }
.icount button { border-radius: 50%; border: 0; background: var(--fill); color: var(--brand); }

/* ---- 6. the tab bar on a phone: the iPhone's floating frosted bar, the tab showing in green on a grey lozenge.
   Its place and width come from native.css (12px in from the sides; 520px in the middle from 600px). ---- */
@media (max-width: 899px), (hover: none) {
  nav.bottom { border: .5px solid color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 32px; background: var(--nv-glass); -webkit-backdrop-filter: var(--nv-blur); backdrop-filter: var(--nv-blur); box-shadow: 0 8px 28px rgba(0, 0, 0, .13); }
  nav.bottom::before { border-radius: 28px; background: var(--nv-fill); }
  nav.bottom a { border-radius: 28px; color: var(--muted); }
  nav.bottom a.on { color: var(--brand); font-weight: 600; }
}

/* ---- 7. wider than a phone: the cover is a band. The paper runs across, the words sit on the left and the lower
   half of the photograph (where the things are) on the right. ---- */
@media (min-width: 600px) {
  .shead.cover, .shead.cover.rcover { aspect-ratio: auto; min-height: 340px; padding-bottom: 1.4rem; }
  /* the photograph keeps to the right half, so the name and the lines never run over the things in it */
  .shead.cover::after { inset: 0 0 0 auto; width: 50%; background-size: auto 200%; background-position: center bottom;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%); }
  .shead.cover h1 { font-size: 3.4rem; }
  .shead.cover .clead, .shead.cover .csub, .shead.cover .clines, .shead.cover.rcover h1 { max-width: min(47%, 30rem); }
  .shead.cover .cissue { justify-content: flex-start; gap: 2.5rem; padding-right: 2.6rem; }
}
@media (min-width: 900px) and (hover: hover) {
  .shead.cover { margin: -1.6rem -2.2rem 1.6rem; padding: 1.2rem 2.2rem 1.5rem; }
  .shead.cover.rcover { margin-top: -1.6rem; padding-top: 2.6rem; }
  .shead.cover .gearbtn { top: .55rem; right: 1.6rem; }
  main { max-width: none; }
  .ufcards { margin: 0; padding: 0; }
  #usefirst .ufcards { flex-wrap: wrap; }
  #inv .plist li { padding: .35rem 0; }
  #inv .plist .thead { background: none; padding-left: calc(30px + .85rem); }
}

/* ---- 8. dark ---- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --photo-bg: #cfcdc8; }
  :root:not([data-theme="light"]) img.thumb.photo, :root:not([data-theme="light"]) img.art.photo { filter: brightness(.9); } }
:root[data-theme="dark"] { --photo-bg: #cfcdc8; }
:root[data-theme="dark"] img.thumb.photo, :root[data-theme="dark"] img.art.photo { filter: brightness(.9); }

/* ---- 9. motion that answers a touch (cover.js). Nothing moves on its own. ---- */
@media (prefers-reduced-motion: no-preference) {
  /* Another on Meals: the next dish fades in */
  .shead.cover.swap::after { animation: cover-swap .3s ease-out backwards; }
  @keyframes cover-swap { from { opacity: 0; } }
  /* an item's photograph grows into its sheet */
  ::view-transition-group(itemphoto) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
}


/* ---- 10. the recipe and the store names: round corners ---- */
.fact, .fact.rfact { border-radius: 9px; }
.shoptile { border-radius: 10px; box-shadow: none; }
@media print { .shead.cover { aspect-ratio: auto; min-height: 0; margin: 0 0 .6rem; padding: 0; background: none !important; color: #000; } .shead.cover::after, .shead.cover .cissue { display: none; } .shead.cover h1 { font-size: 2rem; } }
/* Shopping with nothing on it: one plain line under the add box (list.js). */
#lbody .listnone { margin: .2rem 0 1rem; font-size: .9375rem; }
#lbody #xform.card { margin-top: .9rem; }

/* ---- 11. the thing to do comes first. On a phone the cover is shorter, so the tab's main button (Scan, the add
   box, the recipe, Add who lives here) is on the first screen without scrolling. The photograph sits lower right and
   fades into the paper at its top, so the masthead and the cover lines stay on plain paper. ---- */
@media (max-width: 599px) {
  .shead.cover:not(.rcover) { aspect-ratio: auto; min-height: min(106vw, 420px); padding-bottom: 1rem; margin-bottom: .9rem; }
  .shead.cover:not(.rcover)::after { inset: auto 0 0 auto; width: 64%; height: 52%; background-size: cover; background-position: center bottom;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%), linear-gradient(to right, transparent, #000 18%); -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, transparent, #000 30%), linear-gradient(to right, transparent, #000 18%); mask-composite: intersect; }
  .shead.cover:not(.rcover) .clines { max-width: 46%; }
  .shead.cover:not(.rcover) .csub { max-width: 46%; }
}
/* Pantry: Scan and Talk first, then the search box */
.ptop .bigacts { margin-top: 0; }
/* Supply before a household is entered: the button first, then one sentence, then the picture */
.pempty.supfirst { display: flex; flex-direction: column; align-items: stretch; gap: .8rem; padding-top: 0; text-align: left; }
.pempty.supfirst p { margin: 0; color: var(--muted); }
.pempty.supfirst .scene, .pempty.supfirst img { align-self: center; }
.pempty.supfirst #hhgo { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 56px; margin: 0; font-size: 1.0625rem; }

/* ---- 12. the tutorial (howto.js): one question a screen, a picture of the answer, Next at the bottom.
   Soft and open like a phone's own setup screens: no outlines, the picture on a pale tinted panel, the words
   centred under it, round page dots, and one full-width button at the bottom. ---- */
.tut { display: flex; flex-direction: column; max-width: 440px; min-height: calc(100dvh - 2rem); margin: 0 auto; padding: .2rem 0 1.2rem; }
.tut-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.tut-top .linklike { justify-self: start; display: inline-flex; align-items: center; gap: .15rem; min-height: 44px; margin: 0; padding: 0; color: var(--brand); font-weight: 500; text-decoration: none; }
.tut-top .linklike:last-child { justify-self: end; }
.tut-top .linklike .ion-ic { width: 18px; height: 18px; }
.tut-count { color: var(--faint); font-size: .8125rem; font-weight: 500; }
.tut-dots { display: flex; justify-content: center; gap: 7px; margin: .2rem 0 1.3rem; }
.tut-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tut-dots i.on { background: var(--ink); }
.tut-dots i.done { background: var(--faint); }
.tut-body { flex: 1; display: flex; flex-direction: column; }
.tut h1 { margin: 1.4rem 0 .55rem; font: 800 clamp(1.7rem, 7.6vw, 2.125rem)/1.1 var(--sys); letter-spacing: -.02em; color: var(--ink); text-align: center; text-wrap: balance; }
.tut-a { margin: 0 auto; max-width: 22rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; text-align: center; text-wrap: pretty; }
.tut > .primary.big { display: flex; align-items: center; justify-content: center; min-height: 54px; margin: 1.2rem 0 0; border: 0; border-radius: 14px; font-size: 1.0625rem; font-weight: 600; }
.tut-link { align-self: center; min-height: 44px; margin: .4rem 0 0; color: var(--muted); font-weight: 500; text-decoration: none; }
/* the picture: a drawing of the app on a pale panel with soft corners, nothing outlined */
.tut-pic { padding: 1.1rem 1rem .4rem; border-radius: 22px; background: var(--deep); }
.tut-pic .ht-screen { min-height: 0; padding: 0; gap: .45rem; }
.tut-pic .ht-row { min-height: 54px; padding: .45rem .7rem; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(15, 26, 20, .06); }
.tut-pic .ht-btn { min-height: 44px; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(15, 26, 20, .06); }
.tut-pic .ht-btn.on { background: var(--btn); color: var(--btn-ink); }
.tut-pic .ht-btn.sm { min-height: 30px; border-radius: 8px; }
.tut-pic .ht-box { border-radius: 6px; }
.tut-pic .ht-plus { border-radius: 8px; }
.tut-pic .ht-tabs { margin: .7rem -1rem 0; padding: .35rem .4rem .1rem; border-top: 1px solid var(--line); background: none; }
.tut-pic .ht-tabs span { border-radius: 0; background: none; }
.tut-pic .ht-tabs span.on { background: none; color: var(--ink); font-weight: 650; }
.tut-tabs { list-style: none; margin: 0 0 .6rem; padding: 0; }
.tut-tabs li { display: grid; grid-template-columns: 40px 5.6rem 1fr; align-items: center; gap: .55rem; min-height: 58px; margin-top: .45rem; padding: .4rem .7rem; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(15, 26, 20, .06); }
.tut-tabs li:first-child { margin-top: 0; }
.tut-tabs .ion-ic { width: 22px; height: 22px; justify-self: center; color: var(--ink); }
.tut-tabs b { font-size: 1rem; }
.tut-tabs span { color: var(--muted); font-size: .9375rem; line-height: 1.3; }
/* where food is kept: a plain list of answers with a round mark for the one picked */
.tut-pick { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.4rem; }
.tut-pick button { display: flex; align-items: center; gap: .85rem; min-height: 58px; margin: 0; padding: .55rem 1rem; border: 0; border-radius: 14px; background: var(--deep); box-shadow: none; color: var(--ink); font-size: 1.0625rem; font-weight: 500; text-align: left; }
.tut-pick button.on { background: var(--card); box-shadow: 0 0 0 2px var(--brand); font-weight: 600; }
.tut-radio { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--faint); border-radius: 50%; display: grid; place-items: center; }
.tut-pick button.on .tut-radio { border-color: var(--brand); }
.tut-pick button.on .tut-radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
#tuthh { margin-top: 1.1rem; }
/* the first item: three ways, the first one solid */
.tut-first { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.6rem; }
.tut-first .big { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 56px; margin: 0; border: 0; border-radius: 14px; font-size: 1.0625rem; font-weight: 600; }
.tut-first .big:not(.primary) { background: var(--fill); color: var(--brand); }
.tut-first .ion-ic { width: 22px; height: 22px; }

/* ---- 13. the tip on a tab, under the one thing to do there (tabTip in howto.js). It stays until Got it. ---- */
.coach { position: relative; display: flex; align-items: center; gap: .8rem; margin: .8rem 0 1.1rem; padding: .8rem .6rem .8rem 1rem; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 6px 24px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); }
.coach::before { content: ""; position: absolute; top: -7px; left: 1.6rem; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--card); }
.coach p { flex: 1; margin: 0; font-size: .9375rem; line-height: 1.4; color: inherit; }
.coach .coach-ok { flex: none; min-height: 38px; margin: 0; padding: 0 .7rem; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--brand); font-weight: 600; }

/* who lives here, in the tutorial: no outlines, and no extra facts */
#tuthh .famphoto { border: 0; border-radius: 22px; box-shadow: none; overflow: hidden; }
#tuthh .pp { border: 0; border-radius: 14px; background: var(--deep); box-shadow: none; }
#tuthh select, #tuthh button { border-radius: 10px; box-shadow: none; }
#tuthh .sfacts { display: none; }

/* Pantry: typing a name lists new things by that name under your own items (simple.js drawNew) */
.newlist .addword { flex: none; color: var(--brand); font-weight: 600; font-size: .9375rem; }
.newlist .addpic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--photo-bg); color: var(--ink); }
.newlist .addpic .ion-ic { width: 22px; height: 22px; }

/* Tick boxes in lists (Shopping, Build a list, Suggested supplies, scanned receipts): the box still looks 26px, but a
   transparent 9px border makes the part a finger can hit 44px, Apple's smallest. The negative margin keeps the row as it was. */
ul.list li > input.check, li.sl > input.check {
  width: 44px !important; height: 44px; margin: -9px; border: 9px solid transparent !important; border-radius: 15px;
  background-clip: padding-box; box-shadow: inset 0 0 0 1.5px var(--muted); }
ul.list li > input.check:checked, li.sl > input.check:checked { box-shadow: none; background-color: var(--btn); }
ul.list li > input.check::after, li.sl > input.check::after { inset: 2px; }
/* Who lives here: "Age in" needs less room than the sex choice, so "Not given" fits on a small phone. */
.pp-grid { grid-template-columns: 3.3rem minmax(0, .85fr) minmax(0, 1.45fr) 44px; }
/* Item sheet: the Place row says Move, the word people look for to bring food up from a long-term supply. */
.irows .vmove { color: var(--brand); font-weight: 600; }
/* Tutorial: Next stays in the same place on every screen, at the bottom of the window. The screen is exactly the
   window's height, and a screen with more on it (Who lives here) scrolls inside itself instead of pushing Next down. */
.tut { height: calc(100dvh - 2rem); min-height: 0; box-sizing: border-box; }
.tut > .tut-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tut > #tutnext { flex: none; }

/* The tab covers: the paper colour is taken from the photograph's own background. Wider than a phone, the
   photograph's box is exactly the lower half of the picture (780 x 585), so the picture fills it, and the box fades
   in on its left, top and bottom edges. Before, a wide window left plain paper on both sides of the picture and its
   hard edges showed as a box. */
@media (min-width: 600px) {
  .shead.cover::after { width: auto; aspect-ratio: 780 / 585; max-width: 62%; background-size: cover; background-position: center bottom;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%), linear-gradient(to bottom, transparent, #000 16%, #000 88%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 35%), linear-gradient(to bottom, transparent, #000 16%, #000 88%, transparent);
    mask-composite: intersect; }
}

/* Wide screens: every tab is one centred column under its full-width cover, the way Shopping reads. No button runs
   the width of the window. */
@media (min-width: 900px) {
  #view > :not(.shead):not(.tut) { max-width: 720px; margin-left: auto !important; margin-right: auto !important; box-sizing: border-box; }
}
@media (min-width: 900px) and (hover: hover) {
  /* the website's bar and page margins sit around it: the tutorial fits the window, at most a phone's height */
  .tut { height: min(calc(100dvh - 9rem), 760px); }
}
/* Pantry on a wide screen: Scan, Talk and search share a row; the first-time tip goes on its own line under them
   instead of taking a place in the row. */
.ptop { flex-wrap: wrap; }
.ptop > .coach { flex: 1 0 100%; order: 9; margin: .2rem 0 .4rem; }
@media (min-width: 900px) {
  /* a single main button on a wide screen is as wide as its words, not the whole column */
  #tn-acts:has(> .btn:only-child) { justify-content: flex-start; }
  #tn-acts > .btn:only-child, .supfirst > .primary.big { flex: 0 0 auto; width: auto; padding: 0 2.2rem; }
}

/* Who lives here, in the tutorial (hhCountForm in howto.js): four rows, each with − and +. */
#tuthh .hhq { padding: 0 .4rem 0 1rem; border-radius: 14px; background: var(--card); }
#tuthh .hh-row { min-height: 62px; padding: .3rem 0; border-bottom: .5px solid var(--nv-sep); }
#tuthh .hh-row:last-child { border-bottom: 0; }
#tuthh .hh-row b { font-size: 1.0625rem; font-weight: 600; }
#tuthh .hh-row small { font-size: .8125rem; }
#tuthh .hh-step { gap: .35rem; }
#tuthh .hh-step button { width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: var(--fill); color: var(--brand); font-size: 1.5rem; font-weight: 500; }
#tuthh .hh-step button:disabled { opacity: .35; }
#tuthh .hh-step output { min-width: 2.2ch; font-size: 1.25rem; }
/* Pantry on a phone: while the search box is in use there is room to move it up under the title (simple.js lift) */
#view.lifted { min-height: calc(100dvh + 24rem); }
@media (max-height: 740px) { #tuthh .famphoto { max-width: 200px; margin-bottom: .6rem; } }
/* a small phone: the four rows and Next come first, without the picture */
@media (max-height: 700px) { #tuthh .famphoto { display: none; } }
/* Talk: "Tap and talk" is the one thing to do there, so it is the filled green button, like Scan */
.tmic { border: 0; border-radius: 12px; }
.tmic:not(.on) { background: var(--btn); color: var(--btn-ink); }

/* Folded away until asked for: the store buttons on Shopping, and Things to check, Go bags and zombie mode on Supply */
details.shopat > summary, details.smore > summary { display: flex; align-items: center; gap: .6rem; min-height: 44px; list-style: none; cursor: pointer; }
details.shopat > summary::-webkit-details-marker, details.smore > summary::-webkit-details-marker { display: none; }
details.shopat > summary > .ion-ic, details.smore > summary > .ion-ic:last-child { flex: none; width: 18px; height: 18px; color: var(--faint); }
details.shopat[open] > summary > .ion-ic, details.smore[open] > summary > .ion-ic:last-child { rotate: 90deg; }
details.shopat:not([open]) { padding-top: .2rem; padding-bottom: .2rem; }
details.smore { margin: 1.4rem 0 .8rem; padding: 0 .9rem; border-radius: 12px; background: var(--card); }
details.smore > summary { min-height: 60px; }
details.smore > summary .grow { display: flex; flex-direction: column; }
details.smore > summary .tag { flex: none; }
details.smore[open] { padding-bottom: .6rem; }
details.smore .sgroup { margin: 0; }
/* Shopping with nothing on it: while the first-time tip is showing, it already says what the empty line says */
.coach ~ .listnone { display: none; }
