/* Local styles for the disposable test build (DEC-080). No external assets. */
:root {
  --ink: #1f2328;
  --muted: #59636e;
  --line: #d0d7de;
  --accent: #1a5fb4;
  --warn-bg: #fff4d6;
  --warn-line: #d4a72c;
  --error: #b42318;
  --ok-bg: #eef6ee;
}

* { box-sizing: border-box; }
/* Anchor targets and keyboard focus land below the sticky app bar (WO-USABILITY-PASS). The
   bar's height is not measured, so the padding covers its usual height: one line below
   48rem, up to two lines while a mid-width bar wraps, one line again at full width. */
html { scroll-padding-top: 3.5rem; }
@media (min-width: 48rem) { html { scroll-padding-top: 6rem; } }
@media (min-width: 75rem) { html { scroll-padding-top: 4rem; } }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #fff;
}
/* The shared app bar (WO-USABILITY-PASS, approval items 1, 5 and 6). From 48rem the whole bar
   is pinned and may wrap to a second pinned line; below it only the bar-line (brand and
   Weeks) is pinned, and the context, store label and Sign out follow in the page flow. */
header.site {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #f6f8fa;
}
.bar-line { display: flex; align-items: center; gap: 0.75rem 1.1rem; }
.bar-context { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; flex: 1 1 auto; font-size: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mp-tile { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 0.35rem; background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; }
.build { color: var(--muted); font-size: 0.8rem; border: 1px solid var(--line); border-radius: 0.6rem; padding: 0 0.45rem; background: #fff; white-space: nowrap; }
.scope { color: var(--muted); }
.scope strong { color: var(--ink); font-weight: 600; }
.scope .switch { margin-left: 0.5rem; }
@media (max-width: 47.99rem) {
  header.site { display: contents; }
  .bar-line { position: sticky; top: 0; z-index: 5; justify-content: space-between; padding: 0.45rem 1rem; border-bottom: 1px solid var(--line); background: #f6f8fa; }
  .bar-context { padding: 0.5rem 1rem 0.6rem; border-bottom: 1px solid var(--line); color: var(--muted); }
  .bar-context .scope { flex-basis: 100%; }
  .signout { margin-left: 0; }
}
/* The shared page title: an optional parent link, the h1, a muted subtitle and actions. */
.page-title { margin: 0.1rem 0 1rem; }
.page-title .back { margin: 0 0 0.2rem; font-size: 0.95rem; }
.page-title h1 { margin: 0 0 0.15rem; line-height: 1.25; }
.page-title .sub { margin: 0.1rem 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin: 0.8rem 0 0; }
.hint { font-size: 0.9rem; color: var(--muted); }
.print-only { display: none; }
/* The static footer (R-009): normal flow, hidden in print, placeholder copy until approved. */
footer.site-foot { max-width: 60rem; margin: 0 auto; padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.assignments { display: block; color: var(--muted); font-size: 0.85rem; margin-left: 1.6rem; }
.mark-text { font-size: 1.35rem; line-height: 1; }
.fav-mark { color: var(--accent); }
.fav-mark .star { font-size: 1.1rem; }
.signout { margin-left: auto; display: flex; gap: 0.6rem; align-items: center; white-space: nowrap; }
.signout button { padding: 0.2rem 0.7rem; }
main { max-width: 60rem; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
h1 { font-size: 1.6rem; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
h4 { font-size: 1rem; margin: 1rem 0 0.3rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.unresolved { color: var(--error); font-style: italic; }
.notice { padding: 0.6rem 0.8rem; background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.error { color: var(--error); }
ul.errors { padding: 0.5rem 0.8rem 0.5rem 2rem; background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
div.warnings { padding: 0.4rem 0.8rem; margin: 0.5rem 0; background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
div.warnings + div.warnings { margin-top: -0.5rem; padding-top: 0; }
div.warnings ul { margin: 0.15rem 0; padding-left: 1.2rem; }
.warnings-heading { margin: 0; font-weight: 600; font-size: 0.9rem; }
details.warnings-compact { margin: 0.25rem 0; }
details.warnings-compact summary { color: #7a5a00; }
ul.errors { color: var(--error); }
.list li, .meals li { margin: 0.35rem 0; }
ul.meals { list-style: none; padding: 0; }
li.meal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.meal-actions, .selection-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
li.meal > div:first-child { flex: 1 1 20rem; min-width: 0; }
/* The actions may shrink and wrap, so a narrow window never scrolls sideways (DEC-132, with
   W3's "Don't suggest" beside the favourite). */
li.meal > .meal-actions { flex: 0 1 auto; min-width: 0; align-self: flex-start; }
form.inline { display: inline-flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0; }
form.stack { display: grid; gap: 0.75rem; max-width: 32rem; }
fieldset { border: 1px solid var(--line); border-radius: 0.4rem; }
fieldset label { display: block; margin: 0.25rem 0; }
article.selection, article.dish {
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.25rem 1rem 1rem;
  margin: 0.75rem 0;
}
article.selection { padding: 0.4rem 1rem 0.6rem; }
article.selection:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.selection-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.selection-head h3 { margin: 0.2rem 0; }
p.dishes { margin: 0 0 0.3rem; }
details.edit-selection { margin-top: 0.3rem; }
details.edit-selection[open] { padding-bottom: 0.25rem; }
details.edit-selection .hint { margin: 0.4rem 0 0; font-size: 0.85rem; }
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
/* Shopping (WO-USABILITY-PASS, DEC-133): a full-width heading per grocery section, then that
   section's compact entries in as many 14em columns as fit, reading down and then across. */
.shop-section { margin: 0 0 1.1rem; }
.shop-section h2 { font-size: 1.05rem; margin: 0 0 0.3rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--line); }
ul.shop-cols { list-style: none; margin: 0; padding: 0; columns: 14em; column-gap: 1.5rem; }
li.entry { break-inside: avoid; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.4rem; align-items: start; padding: 0.3rem 0.25rem 0.3rem 0; border-bottom: 1px solid #e3e8ed; }
li.entry.checked { background: var(--ok-bg); }
.entry-mark { display: flex; justify-content: center; align-items: flex-start; }
.entry-text { padding-top: 0.3rem; min-width: 0; overflow-wrap: anywhere; }
.entry-name { font-weight: 600; }
.qty { white-space: nowrap; }
.qty .unresolved { white-space: normal; }  /* long unknown-amount wording wraps */
.entry-text .sub { font-size: 0.85rem; color: var(--muted); line-height: 1.35; margin-top: 0.1rem; }
.entry-text .change { color: #7a4b00; line-height: 1.35; }
.entry-text details { margin-top: 0.1rem; }
.entry-text details ul { margin: 0.25rem 0 0.2rem; padding-left: 1rem; font-size: 0.85rem; line-height: 1.35; }
/* Returning to the entry just marked (DEC-090 D8): leave a few entries above it in view,
   below the sticky bar, and mark it with a left bar. Print drops the bar (box-shadow). */
li.entry { scroll-margin-top: 30vh; }
li.entry:target { box-shadow: inset 4px 0 0 var(--accent); }
/* Mark buttons keep a 40px target, 44px below the narrow breakpoint (approval item 4). */
button.mark-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
@media (max-width: 47.99rem) {
  li.entry { grid-template-columns: 2.75rem minmax(0, 1fr); }
  button.mark-toggle { width: 2.75rem; height: 2.75rem; }
}
button.mark-toggle:hover { border-color: var(--accent); color: var(--accent); }
button.mark-toggle[aria-pressed="true"] { color: var(--accent); }
button.fav-toggle {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.fav-toggle .star { font-size: 1.1rem; line-height: 1; }
button.fav-toggle:hover { border-color: var(--accent); color: var(--accent); }
button.fav-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: #eef3fb; }
.filter { display: inline-flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; }
.filter button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: #eef3fb; font-weight: 600; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.change { font-size: 0.85rem; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
ol.steps li { white-space: pre-wrap; margin: 0.3rem 0; }
/* Copy for AnyList (DEC-115): the shopping page's link is screen-only; the
   copy view's read-only box keeps each item on its own line. */
textarea.copy-text { display: block; width: 100%; box-sizing: border-box; font: inherit;
  padding: 0.4rem; border: 1px solid var(--line); border-radius: 0.3rem; white-space: pre; }
.copy-notice { font-weight: 600; }
.group { color: var(--muted); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
button {
  font: inherit;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 0.35rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: #fff; color: var(--accent); }
button[disabled] { background: #eaeef2; border-color: var(--line); color: var(--muted); cursor: not-allowed; }
input[type="text"], select { font: inherit; padding: 0.25rem 0.4rem; border: 1px solid var(--line); border-radius: 0.3rem; }
select { max-width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Weekly plans (WO-WEEKLY-SHORTLIST W1 and the W2 redesign, DEC-131): the weeks overview,
   the week page's tabs, strip and cards, and the test-date banner and strip. Placeholder
   colours come from five fixed classes chosen per meal ID; pages carry no inline style. The
   banner and counts are text, so they do not rely on colour. */
.test-date-banner { margin: 0 0 0.75rem; padding: 0.4rem 0.6rem; border: 2px dashed var(--accent); border-radius: 0.35rem; }
.site-nav a { margin-right: 0.75rem; text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--accent); }
.notice.problem { border-left: 3px solid var(--accent); padding-left: 0.6rem; margin: 0.5rem 0; }
button.primary { font-weight: 600; padding: 0.5rem 1rem; }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
button.link:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.wide { width: 100%; }
.panel { background: #f6f8fa; border: 1px solid var(--line); border-radius: 0.6rem; padding: 1rem 1.5rem; margin: 0.5rem 0 1.5rem; }
.panel h1 { margin-top: 0.25rem; }
form.by-hand { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: baseline; }
.weeks-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.weeks-heading { margin-top: 1rem; }
ol.weeks { list-style: none; padding: 0; margin: 0; }
ol.weeks li.week { display: grid; grid-template-columns: 12rem 1fr auto; gap: 0.75rem 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem 1rem; margin: 0.6rem 0; }
ol.weeks li.week.open { border-style: dashed; grid-template-columns: 12rem 1fr; }
.week-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.week-head p { margin: 0.1rem 0; }
.count.below { color: #9a3412; font-weight: 600; }
.this-week { display: inline-block; background: var(--accent); color: #fff; border-radius: 0.8rem; padding: 0 0.6rem; font-size: 0.85rem; }
ul.week-dinners { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; }
ul.week-dinners li { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
ul.week-dinners a { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; min-width: 0; }
/* The favourite star's fixed slot (DEC-135), empty for unmarked dinners so squares align. */
.star-slot { flex: 0 0 1.25rem; width: 1.25rem; text-align: center; color: var(--accent); font-size: 1.1rem; line-height: 1; }
.dont-suggest { margin: 0; color: var(--muted); font-size: 0.85rem; font-style: italic; }
form.mark-form { align-self: flex-start; }
form.mark-form button.link { font-size: 0.85rem; color: var(--muted); }
details.by-dish { margin: 0.2rem 0 0; }
details.by-dish[open] summary { margin-bottom: 0.3rem; }
.square { display: inline-block; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 0.35rem; border: 2px solid; }
.week-links { display: flex; flex-direction: column; gap: 0.4rem; }
a.button-link { display: inline-block; text-align: center; padding: 0.35rem 0.9rem; border: 1px solid var(--line); border-radius: 0.35rem; color: var(--ink); text-decoration: none; }
a.button-link:hover { border-color: var(--accent); }
details.plan-list { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 1rem; margin: 0.6rem 0; }
details.plan-list summary { font-size: 1rem; color: var(--ink); font-weight: 600; }
.test-date-strip { border: 1px dashed var(--line); border-radius: 0.5rem; padding: 0.5rem 1rem; margin: 1rem 0; color: var(--muted); }
.test-date-strip p { margin: 0.2rem 0; }
.swatch-0 { background: #e8effa; border-color: #1a5fb4; color: #1a5fb4; }
.swatch-1 { background: #f0eafa; border-color: #6e3fbf; color: #5b2ca8; }
.swatch-2 { background: #eff3e2; border-color: #5c6b16; color: #4d5a12; }
.swatch-3 { background: #fbede2; border-color: #c2570c; color: #9a3412; }
.swatch-4 { background: #e4f3ef; border-color: #1f7a63; color: #17604d; }
p.back { margin: 0.25rem 0; }
.week-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; }
.week-title h1 { margin-bottom: 0.25rem; }
nav.week-tabs ul { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
nav.week-tabs li > a, nav.week-tabs li > .tab-open { display: block; min-width: 7rem; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 0.4rem; text-decoration: none; color: var(--ink); }
nav.week-tabs li > a .muted, nav.week-tabs li > .tab-open .muted { display: block; font-size: 0.85rem; }
nav.week-tabs a[aria-current="page"] { border: 2px solid var(--accent); background: #eef3fb; }
nav.week-tabs .tab-open { border-style: dashed; color: var(--muted); }
section.strip { background: #f6f8fa; border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.6rem 1rem; }
.strip-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.strip-head h2 { margin: 0; font-size: 1.1rem; }
.strip-count { font-weight: 700; color: var(--accent); }
.strip-links { margin-left: auto; display: flex; gap: 1rem; }
ul.chips { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
ul.chips a { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.6rem 0.25rem 0.25rem; background: #fff; border: 1px solid var(--line); border-radius: 0.4rem; text-decoration: none; }
ul.chips .square { width: 28px; height: 28px; flex-basis: 28px; }
/* The card grid (DEC-132) is the one region wider than main's measure: up to 72rem, never
   within 2rem of the viewport's edges, centred on main and never narrower than its content
   box, so the strip, search and saved-meals list keep their width. Each column is at least
   300px and a third of the row less its gaps, so a row holds at most three cards. */
.cards {
  --cards-width: max(100%, min(100vw - 4rem, 72rem));
  width: var(--cards-width);
  margin: 1rem 0 1rem calc((100% - var(--cards-width)) / 2);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(300px, (100% - 2rem) / 3), 1fr));
  gap: 1rem;
}
.card { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; scroll-margin-top: 1rem; }
.card.picked { border: 2px solid var(--accent); }
.card:target { box-shadow: 0 0 0 3px #b6cdf0; }
.placeholder { aspect-ratio: 4 / 3; border: 2px solid; border-radius: 0.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.85rem; }
.picked-badge { margin: 0.2rem 0 0; display: inline-block; align-self: flex-start; background: var(--accent); color: #fff; border-radius: 0.3rem; padding: 0 0.4rem; font-size: 0.8rem; font-weight: 600; }
.card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.card-title h3 { margin: 0.2rem 0; font-size: 1rem; }
button.star-toggle { background: #fff; color: var(--accent); border: 1px solid transparent; padding: 0 0.3rem; font-size: 1.2rem; line-height: 1.3; }
button.star-toggle:hover { border-color: var(--line); }
.dish-line { margin: 0; font-size: 0.9rem; }
.yield-unknown { margin: 0; padding: 0.25rem 0.5rem; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 0.3rem; font-size: 0.85rem; }
.also-in { align-self: flex-start; margin: 0; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 0.8rem; color: var(--muted); font-size: 0.85rem; }
.portions-heading { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 0.4rem; }
form.portions { display: flex; flex-direction: column; gap: 0.3rem; }
form.portions button { align-self: flex-end; }
.portion { display: grid; grid-template-columns: 1fr auto; gap: 0 0.5rem; align-items: center; }
.portion input { width: 4rem; text-align: right; }
.portion .yield-note { grid-column: 1 / -1; font-size: 0.8rem; }
ul.portions-text { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }
.card-foot { margin-top: auto; padding-top: 0.4rem; }
.card.tile { border-style: dashed; align-items: center; justify-content: center; text-align: center; }
.tile-title { font-weight: 600; margin: 0; }
@media (max-width: 40rem) {
  ol.weeks li.week, ol.weeks li.week.open { grid-template-columns: 1fr; }
  ul.week-dinners { grid-template-columns: 1fr; }
  .week-links { flex-direction: row; flex-wrap: wrap; }
  .cards { grid-template-columns: 1fr; }
  .strip-links { margin-left: 0; }
}

/* Printing and Save as PDF (slice 7b, DEC-086; WO-USABILITY-PASS). The shopping list keeps
   every entry's mark glyph, label, optional/to-taste/unknown wording and quantity, in the
   same sections and order as the screen, at 11pt in as many 14em columns as the chosen paper
   and margins allow. The app bar, actions, parent link, footer, per-dish details and screen
   colour go; the heading adds the tenant and household. The mark buttons stay, drawn as
   plain text, so the glyph is printed. Entries never split, and a section heading reserves
   room for its first entry (the ::after spacer), so it never ends a page alone; a section
   continued on the next page has no repeated heading. */
@media print {
  @page { margin: 1.5cm; }
  * { color: #000 !important; background: transparent !important; box-shadow: none !important; }
  body { font-size: 11pt; }
  header.site, footer.site-foot, details, .screen-only, .page-title .back { display: none !important; }
  .print-only { display: inline; }
  p.print-only { display: block; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 16pt; margin: 0 0 0.2rem; }
  .page-title { margin: 0 0 0.6rem; }
  .shop-section h2 { font-size: 12pt; margin: 0.4rem 0 0.25rem; border-bottom: 1.5px solid #000; break-inside: avoid; page-break-inside: avoid; break-after: avoid; page-break-after: avoid; }
  .shop-section h2::after { content: ""; display: block; height: 4.5em; margin-bottom: -4.5em; }
  ul.shop-cols { columns: 14em; column-gap: 1.2rem; }
  li.entry { grid-template-columns: 1.6em minmax(0, 1fr); gap: 0.4em; padding: 0.15rem 0; border-bottom: 1px dotted #000; break-inside: avoid; page-break-inside: avoid; }
  .entry-text { padding-top: 0; }
  button.mark-toggle { width: auto; height: auto; border: none; padding: 0; font-size: 13pt; line-height: 1.1; }
  .tag { border: 1px solid #000; }
  .unresolved { font-style: italic; }
  div.warnings { border-left: 2px solid #000; }
}
