/* The shopping page, in the video apps' list layout (theme.css; guide:
   shopping/web/STYLE.md). Measurements are the video apps' own. */

* { box-sizing: border-box; }
body { padding: 12px 16px 40px; }
header, main, .kids-extension { max-width: 900px; margin: 0 auto; }

/* The kids site (shopping/kids/site): what is there beside the page, and the child's phone's forms. */
.kids-extension { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); }
.kids-extension .muted { color: var(--muted); font-size: 14px; }
form.kids-entry { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
form.kids-entry input[type="text"], form.kids-entry input[type="url"], form.kids-entry input[type="search"] { flex: 1 1 180px; min-width: 0; }
form.kids-entry input[type="number"] { width: 8em; }
/* A note or a name, however long and unbroken, wraps within the screen (Codex, #72 review: a 100-character note
   made a 320 px page 885 px wide). */
.kids table { width: 100%; table-layout: fixed; }
.kids table td:nth-child(1) { width: 9.5em; }
.kids table td:nth-child(2) { width: 6em; white-space: nowrap; }
.kids td, .kids li { overflow-wrap: anywhere; }
/* the allowance's presets: large, two to a row, for a thumb on a phone */
.kids-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 16px; }
button.kids-preset { min-height: 64px; font-size: 1.15rem; font-weight: bold; border-radius: 14px; padding: 10px 12px;
  background: var(--accent, #e8cfa3); color: var(--accent-ink, #1b1710); border: none; }
button.kids-preset.kids-preset-out { background: var(--danger, #ff6b6b); color: var(--accent-ink, #1b1710); }
button.kids-preset.armed { outline: 3px solid var(--accent-ink, #1b1710); outline-offset: -6px; }
/* the podcast search's results: cover, name and about, Add */
ul.kids-shows { list-style: none; padding: 0; margin: 0 0 16px; }
li.kids-show { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line, #ddd); }
li.kids-show img, li.kids-show .kids-cover { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--line, #ddd); display: block; }
li.kids-show p { margin: 4px 0 0; font-size: 0.9em; }
.kids-explicit { font-size: 0.8em; font-weight: bold; color: var(--danger, #b00020); }

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 { font: 600 15px var(--font); margin: 0; }
/* The nav (K, 2026-11-04: "its own page controlled by nav"): the household's pages the signed-in person may use, at
   the header's end -- quiet links, the page shown in --text over a parchment rule; a row of its own on a phone. */
nav.pages { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-left: auto; }
nav.pages a { padding: 2px 0; font-size: 13px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
nav.pages a:hover { color: var(--text); }
nav.pages a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
@media (max-width: 600px) { nav.pages { flex-basis: 100%; margin-left: 0; } }
@media (pointer: coarse), (max-width: 600px) { nav.pages a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; } }
h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 6px;
}
p { color: var(--muted); }
a { color: var(--accent); }
.error { color: var(--danger); }

.count {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* -- controls ------------------------------------------------------------------------ */

button {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
}
button:hover:not(:disabled) { color: var(--text); background: var(--raised); }
button[aria-pressed="true"] { color: var(--text); background: var(--raised); border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.06); background: var(--accent); color: var(--accent-ink); }
button.quiet { border-color: transparent; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }

/* -- what the household buys ------------------------------------------------------------- */

ul.items {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
li.item {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-areas: "pic what" "pic marks";
  gap: 6px 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
li.item:first-child { border-top: 0; }
li.item > img, li.item > .no-image {
  grid-area: pic;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--text); /* product photos are cut out on white */
}
li.item > .no-image { background: var(--raised); }
li.item .what { grid-area: what; min-width: 0; }
li.item .name { font-weight: 600; overflow-wrap: anywhere; }
li.item .size { color: var(--muted); font-weight: 400; }
li.item .meta { color: var(--muted); font-size: 13px; }
li.item .marks { grid-area: marks; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
li.item .saving { font-size: 12px; color: var(--muted); }

/* A product with its own rhythm, under its kind's card; and the kind's
   products, listed when opened. */
li.item.nested { margin-left: 28px; border-left: 2px solid var(--line); border-top-style: dashed; }
li.kind-heading { padding: 10px 12px 6px; border-top: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }
li.kind-heading:first-child { border-top: 0; }
li.kind-heading .size { color: var(--muted); font-weight: 400; font-size: 13px; }
li.kind-heading + li.item.nested { border-top-style: none; }
li.item .members { margin-top: 4px; font-size: 13px; }
li.item .members > summary { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
li.item .members ul { margin: 4px 0 0; padding-left: 16px; color: var(--muted); }
li.item .members li { overflow-wrap: anywhere; }
li.item .marks .error { font-size: 12px; }

/* A stock state's colour supplements its words (STYLE.md). */
button[data-state="in"][aria-pressed="true"] { border-color: var(--in-stock); }
button[data-state="low"][aria-pressed="true"] { border-color: var(--running-low); }
button[data-state="out"][aria-pressed="true"] { border-color: var(--out); }
button[data-state="skip"][aria-pressed="true"] { border-color: var(--muted); }

/* -- uploads and settings ---------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
th, td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); }
/* Only who uploaded may break anywhere -- an address is one long word that
   would push the table wider than a phone; headings and buttons never break. */
td:nth-child(4) { overflow-wrap: anywhere; }
@media (max-width: 420px) { th, td { padding: 8px 6px; } }  /* five columns in a phone's width */
th { color: var(--muted); font-size: 12px; font-weight: 600; border-top: 0; }
td:nth-child(2) { text-align: right; font-family: var(--mono); font-size: 13px; }

/* A voided upload: muted, "voided" and Restore under its shop. */
tr.voided > td { color: var(--muted); }
div.shop { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
div.shop .voided { font-size: 12px; }
label.show-voided { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--muted); }
label.show-voided input { width: 20px; height: 20px; margin: 0; }

/* An upload's orders, under its row: each a <details>, its lines a list. */
tr.orders > td, tr.restore-failed > td { padding: 4px 12px 12px; }
details.order { margin-top: 8px; }
details.order > summary { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
ul.lines { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; }
ul.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
ul.lines .line-name { overflow-wrap: anywhere; min-width: 0; }
ul.lines .line-paid { font-family: var(--mono); white-space: nowrap; color: var(--muted); }
ul.lines li.not-bought { color: var(--muted); }
td button { padding: 3px 8px; white-space: nowrap; }

/* -- spending ------------------------------------------------------------------------------ */

div.month { display: flex; align-items: center; gap: 8px; }
div.month button { min-width: 44px; min-height: 44px; font-size: 18px; }
.spending input[type="text"], .spending input[type="number"], .spending select {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  min-height: 36px;
  min-width: 0;
}
.spending input:focus-visible, .spending select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spending ::placeholder { color: var(--faint); }
/* A category's target and how far through it the month is: the bar is
   amber past its target, beside words that say so. */
table.budget-table td:nth-child(3) input { width: 96px; }
td.budget { font-size: 12px; color: var(--muted); overflow-wrap: normal; }  /* breaks between words, not in a sum */
span.meter { display: block; height: 6px; margin-bottom: 4px; background: var(--raised); border-radius: 3px; overflow: hidden; }
span.meter .bar { display: block; height: 100%; background: var(--done); }
span.meter .bar.over { background: var(--working); }
@media (max-width: 420px) { table.budget-table td:nth-child(3) input { width: 72px; } }
/* An order's tags, then each line's: its name and price, its tags under them. */
div.order-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); }
.spending ul.lines li { flex-direction: column; gap: 4px; }
.spending ul.lines div.line { display: flex; justify-content: space-between; gap: 12px; }
div.tag { display: flex; flex-wrap: wrap; gap: 6px; }
div.tag input[type="text"] { flex: 1 1 64px; max-width: 240px; }
div.tag select { flex: 0 1 auto; }
div.tag p.error { flex-basis: 100%; margin: 0; }
/* A blank that takes what it inherits (K, 2026-11-04: "parens around values are not really obvious"): "auto: family" in
   italic --muted, so what is set by hand -- plain --text -- stands out. */
.spending div.tag select.auto { font-style: italic; color: var(--muted); }
.spending div.tag input.auto::placeholder { font-style: italic; color: var(--muted); }
span.tag-words { font-size: 12px; color: var(--muted); }
.spending p.statement { margin: 4px 0 6px; font-size: 12px; overflow-wrap: anywhere; }
.spending div.pairing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; font-size: 13px; }
.spending div.pairing select { max-width: 100%; }
.spending div.split { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 0; font-size: 13px; }
.spending div.split input[type="text"] { flex: 1 1 120px; min-width: 0; }
.spending div.split input[type="number"] { width: 7em; }
.spending div.part { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 6px; }
.spending h3 { font-size: 13px; color: var(--muted); margin: 16px 0 4px; }
.spending h3 .count { font-weight: 400; }
/* The transactions as a list (K, 2026-11-03, of the phone: "bigger buttons / collapsible transaction
   sections"): a row each -- its shop over its day and category, what it cost on the right -- that opens
   to its tags; each line of it a row too, its tags in words until it is opened. */
.spending div.orders { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.spending div.orders > details.order { margin: 0; padding: 0 12px; }
.spending div.orders > details.order + details.order { border-top: 1px solid var(--line); }
/* A plan of instalments (K, 2026-11-03: "group together "pay in 4" transactions"): the month's instalments are
   rows within its row, set in under a rule rather than a panel of their own. */
/* And so are an income group's payments (K, 2026-11-04: "Let's group income dividends together as well as rent from
   properties"). */
.spending details.plan div.instalments, .spending details.group div.entries { margin: 8px 0 0; background: none; border: 0;
  border-left: 2px solid var(--line); border-radius: 0; }
.spending details.plan div.instalments > details.order, .spending details.group div.entries > details.order { padding: 0 0 0 10px; }
.spending details.order > summary, .spending details.line-tag > summary {
  display: flex; align-items: center; gap: 12px; list-style: none;
  font-size: inherit; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text);
}
.spending details.order > summary { min-height: 52px; padding: 8px 0; }
.spending details.order > summary::-webkit-details-marker, .spending details.line-tag > summary::-webkit-details-marker { display: none; }
.spending details.order > summary::after, .spending details.line-tag > summary::after, .spending details.section > summary::after {
  content: "›"; flex: none; width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 18px; color: var(--muted);
  transition: transform .15s;  /* square, and as tall as its glyph: turned, it stays in its own box */
}
.spending details[open].order > summary::after, .spending details[open].line-tag > summary::after,
.spending details[open].section > summary::after { transform: rotate(90deg); }
.spending details[open].order > summary { margin-bottom: 4px; }
.spending details.order[open] { padding-bottom: 12px; }
/* An open row's header is a band of its own, the width of the list, and the row ends with a gap and a heavier rule
   (K, 2026-11-04: "some visual distinction between the transaction / order header and details, as multiple expanded
   transactions look pretty hard to see when one ends and another begins"); a row within a plan's or a group's, the
   same band from its rule in. */
.spending > div.orders { overflow: hidden; }  /* the band keeps to the list's rounded corners */
.spending > div.orders > details.order[open] > summary {
  margin: 0 -12px 8px; padding: 8px 12px; background: var(--raised); border-bottom: 1px solid var(--line);
}
.spending > div.orders > details.order[open] { padding-bottom: 16px; }
.spending > div.orders > details.order[open] + details.order { border-top: 2px solid var(--line); }
.spending div.orders div.orders > details.order[open] > summary {
  margin: 0 0 8px -10px; padding: 6px 8px 6px 10px; background: var(--raised);
}
.spending summary .what { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.spending summary .shop { font-weight: 600; overflow-wrap: anywhere; }
.spending summary .when { font-size: 12px; color: var(--muted); }
/* A category, a name or an account is a word of up to 40 letters: it breaks anywhere rather than push the
   page wider than a phone (Codex, #50 review) -- in a row's note and a line's tag words, the lines over the
   transactions, and the targets' categories. */
.spending summary .when, .spending .tag-words, .spending > p, table.budget-table td:first-child { overflow-wrap: anywhere; }
.spending summary .cost { font-family: var(--mono); text-align: right; }
.spending details.line-tag { margin: 0; }
.spending details.line-tag > summary { padding: 2px 0; }
.spending details.line-tag[open] > summary .tag-words { display: none; }
.spending details.line-tag[open] > summary { margin-bottom: 6px; }
/* The breakdown and the targets fold away, as the viewer leaves them. */
.spending details.section { margin: 12px 0 0; }
.spending details.section > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; letter-spacing: .06em;
  list-style: none; }
.spending details.section > summary::-webkit-details-marker { display: none; }
.spending details[open].section > summary { margin-bottom: 0; }
div.chart-tabs, div.chips { display: none; }
/* The breakdown (K, 2026-11-02): a chart a tag, its ring of slices beside
   its legend. The legend names each slice, so a colour only tells it from
   its neighbours; the slice chosen keeps its colour, the others fade. */
div.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 12px 0; }
section.chart { min-width: 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.spending section.chart h3 { margin: 0 0 8px; }
div.pie { display: flex; align-items: flex-start; gap: 12px; }
div.donut { position: relative; flex: 0 0 104px; height: 104px; }
div.donut svg { display: block; width: 100%; height: 100%; }
div.donut .whole {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 12px var(--mono);
  color: var(--text);
  pointer-events: none;
}
circle.ring, circle.slice { fill: none; stroke-width: 6; }
circle.ring { stroke: var(--raised); }
circle.slice { stroke: var(--slice); cursor: pointer; }
section.chosen circle.slice:not(.on), section.chosen ul.legend button[aria-pressed="false"] .swatch { opacity: .3; }
ul.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
ul.legend button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; text-align: left; border-color: transparent; }
ul.legend button[aria-pressed="true"] { border-color: var(--accent); }
ul.legend .name { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
ul.legend .amount { font-family: var(--mono); white-space: nowrap; }
ul.legend .share { min-width: 3.5em; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
section.chart p.basis { margin: 8px 0 0; font-size: 12px; }
span.swatch { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--slice); }
.slice-0 { --slice: var(--chart-1); }
.slice-1 { --slice: var(--chart-2); }
.slice-2 { --slice: var(--chart-3); }
.slice-3 { --slice: var(--chart-4); }
.slice-4 { --slice: var(--chart-5); }
.slice-5 { --slice: var(--chart-6); }
.slice-6 { --slice: var(--chart-7); }
.slice-7 { --slice: var(--chart-8); }
.slice-none { --slice: var(--faint); }
.slice-itemless { --slice: var(--muted); }  /* groceries a charge of its own paid for: none says what was in them */
p.chosen-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text); }
.spending ul.lines li.others { color: var(--muted); }
@media (max-width: 360px) { div.pie { flex-direction: column; align-items: center; } ul.legend { width: 100%; } }
/* A phone (the Pixel 8a is 412px across): one chart at a time, by its tab -- a dot in the corner of one with a
   slice chosen, and under the tabs each slice chosen, whichever chart is shown (K, 2026-11-03), a pill that lets
   it go; a tag's controls two to a row. */
@media (max-width: 600px) {
  div.chart-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 4px 0 0; }
  /* all in a row -- the spending's five, the income's three: 13px names, each on one line at 412px */
  div.chart-tabs button { position: relative; padding: 4px 1px; overflow-wrap: anywhere; font-size: 13px; }
  div.chart-tabs button.chosen::after {  /* on the corner, clear of a name that fills its tab */
    content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 2px var(--bg);
  }
  .spending div.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
  .spending div.chips button { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 14px;
    color: var(--text); border-color: var(--accent); border-radius: 22px; text-align: left; }  /* a pill, and a name that wraps clear of its ends */
  .spending div.chips .words { min-width: 0; overflow-wrap: anywhere; }
  .spending div.chips .x { flex: none; font-size: 13px; color: var(--muted); }
  .spending div.charts { margin-top: 8px; }
  .spending div.charts section.chart:not(.current) { display: none; }
  .spending div.donut { flex-basis: 88px; height: 88px; }
  .spending ul.legend button { gap: 6px; padding: 4px 6px; font-size: 15px; }
  .spending ul.legend .share { min-width: 2.8em; }
  .spending div.tag { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .spending div.tag input[type="text"] { grid-column: 1 / -1; max-width: none; }
  .spending div.tag > span { grid-column: 1 / -1; }
  .spending div.tag select { width: 100%; }
  .spending div.order-tag { display: block; }
  .spending div.order-tag > span { display: block; margin-bottom: 4px; }
  .spending div.pairing select { width: 100%; }
  .spending div.split input[type="text"] { flex: 1 1 100%; }
  .spending div.split input[type="number"] { flex: 1 1 6em; }
}
/* A finger's controls (or a phone's): 44px at the least, and 16px words. */
@media (pointer: coarse), (max-width: 600px) {
  .spending button, .spending select, .spending input[type="text"], .spending input[type="number"] { min-height: 44px; font-size: 16px; }
  .spending ul.legend button { min-height: 44px; }
  .spending details.line-tag > summary { min-height: 44px; }
  .spending details.order > summary { min-height: 56px; }
  .spending summary .shop { font-size: 16px; }
  .spending summary .when, .spending summary .cost, .spending ul.lines { font-size: 14px; }
  .spending div.order-tag, .spending div.pairing, .spending div.split { font-size: 14px; }
}

details { margin-top: 16px; }
details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
details[open] > summary { margin-bottom: 6px; }
.signed-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }

/* -- on a phone: a deck of cards ----------------------------------------------------------- */

/* The sections as tabs, across the top. */
/* Each tab's count sits under its label, and a column may shrink below its
   content (minmax(0, 1fr)), so a hundred-odd count still fits at 320px
   (Codex, #20 review). */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 16px 0 10px; }
button.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
button.tab .count { margin-left: 0; padding: 0 5px; }
/* Six tabs on the narrowest phones: each label on one line, whole. */
@media (max-width: 380px) {
  button.tab { font-size: 11px; letter-spacing: 0; padding: 6px 0; }
}
button.tab[aria-selected="true"] { color: var(--text); background: var(--raised); border-color: var(--accent); }

/* One card a screen, swiped across: the browser's scrolling, snapped. */
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.deck-nav .position { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.deck-nav button { font-size: 20px; line-height: 1; min-width: 44px; min-height: 44px; }
ul.deck {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
ul.deck::-webkit-scrollbar { display: none; }
li.item.card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100svh - 210px);
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
li.item.card > img, li.item.card > .no-image {
  align-self: center;
  width: min(240px, 60vw);
  height: min(240px, 60vw);
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--text);
}
li.item.card > .no-image { background: var(--raised); }
li.item.card .what { flex: 1; min-width: 0; }
li.item.card .name { font-size: 20px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
li.item.card .size { color: var(--muted); font-weight: 400; }
li.item.card .meta { color: var(--muted); font-size: 15px; margin-top: 6px; }
li.item.card .members { font-size: 14px; }
li.item.card .marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
li.item.card .marks button { font-size: 17px; min-height: 64px; color: var(--text); }
/* "skip a week" is the odd one out: its own row, under the three. */
li.item.card .marks button[data-state="skip"] { grid-column: 1 / -1; min-height: 48px; font-size: 15px; color: var(--muted); }
li.item.card .marks .saving, li.item.card .marks .error { grid-column: 1 / -1; text-align: center; font-size: 13px; min-height: 1.45em; }

/* -- meals ----------------------------------------------------------------------------- */

/* The weekend as a calendar: two days side by side, each a breakfast, a
   lunch and a dinner; each meal a button listing its dishes, each with a
   3px rule on its left in its ingredients' colour -- the words say it too. */
.meals .plan { color: var(--text); margin: 0 0 10px; overflow-wrap: anywhere; }
/* A day's heading and meals share the calendar's rows (subgrid), so lunch
   sits beside lunch however long either day's dishes or heading. */
.calendar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto);
  column-gap: 10px; max-width: 900px; }
.calendar .day { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 6px; min-width: 0; }
.calendar h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin: 0 0 2px;
  align-self: end; }
.calendar .day.past h3 { color: var(--muted); }
.calendar .today { color: var(--accent); }
button.slot { display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; min-height: 64px;
  padding: 10px 12px; background: var(--panel); color: var(--text); font-size: 14px; }
.calendar .day.past button.slot { color: var(--muted); }
button.slot .label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
button.slot .empty { color: var(--muted); }
button.slot .dishes { display: flex; flex-direction: column; gap: 6px; }
.dish { display: flex; flex-direction: column; padding-left: 8px; border-left: 3px solid var(--line); overflow-wrap: anywhere; }
.dish .name { font-weight: 600; }
.dish .needs, .option .needs { font-size: 12px; color: var(--muted); }
.dish.have, .option.have { border-left-color: var(--in-stock); }
.dish.check, .option.check { border-left-color: var(--running-low); }
.dish.need, .option.need { border-left-color: var(--out); }

/* A meal's choice: a modal list of the recipes, a checkbox each, 48px
   rows; the whole screen on a phone. */
dialog.pick { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
dialog.pick::backdrop { background: rgb(0 0 0 / .6); }
dialog.pick form { padding: 14px 16px 16px; }
dialog.pick h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
dialog.pick .options { display: flex; flex-direction: column; }
dialog.pick .options + .options { margin-top: 12px; }
dialog.pick h4 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 2px; }
dialog.pick details { margin-top: 10px; }
dialog.pick details > summary { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 13px 0; cursor: pointer; }
.option { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 6px 0 6px 10px; border-left: 3px solid var(--line);
  border-bottom: 1px solid var(--line); cursor: pointer; }
.option input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0; }
.option .what { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
dialog.pick .saving, dialog.pick .error { min-height: 1.45em; margin: 10px 0 0; font-size: 13px; }
dialog.pick .saving { color: var(--muted); }
dialog.pick .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
dialog.pick .actions button { min-height: 44px; min-width: 88px; font-size: 15px; }
@media (max-width: 600px) {
  .calendar { column-gap: 8px; }
  button.slot { padding: 8px 10px; }
  dialog.pick { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  dialog.pick form { padding: 16px; }
}
