/* ============================================================
   cookshelf design system — "Mise en place": warm paper + ink,
   one clay accent; the food and book jackets carry the color.
   Light theme only (v1). See docs/DESIGN_SYSTEM.md.
   ============================================================ */

/* ---- self-hosted typefaces (Propshaft /assets, no CDN) ----
   Variable woff2s: one file per family/style covers the weight
   range. Split latin / latin-ext by unicode-range. ----------- */
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/assets/newsreader-roman-latin-691d67ea.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/assets/newsreader-roman-latin-ext-a13c60ee.woff2") format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url("/assets/newsreader-italic-latin-c936a1a6.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url("/assets/newsreader-italic-latin-ext-66c65474.woff2") format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/hanken-grotesk-latin-19e35a88.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/hanken-grotesk-latin-ext-32c8755a.woff2") format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/assets/spline-sans-mono-latin-20c2d3e2.woff2") format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Spline Sans Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/assets/spline-sans-mono-latin-ext-d2ea1d9d.woff2") format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  color-scheme: light;
  /* surfaces & ink */
  --paper: #f7f3ec; --paper-2: #efe9df; --card: #fffdf8;
  --ink: #221d16; --ink-soft: #4c443a; --muted: #8c8173;
  --line: rgba(40,28,12,0.12); --line-2: rgba(40,28,12,0.20);
  /* accent + semantics (clay is swappable — change these 3) */
  --clay: #b0542f; --clay-deep: #8c3f1f; --clay-tint: rgba(176,84,47,0.10);
  --honey: #bd8a2c; --olive: #5f7142; --olive-tint: rgba(95,113,66,0.14);
  --ai: #a6791a; --ai-tint: rgba(166,121,26,0.12);
  /* danger: the palette rations color and defines no red, but
     destructive actions (delete / clear / failed jobs) need a clear,
     distinct-from-clay signal. Warm brick red. */
  --danger: #b3261e; --danger-tint: rgba(179,38,30,0.10);
  /* shape & depth (editorial = restrained: hairlines over shadows) */
  --r-sm: 3px; --r-md: 5px; --r-lg: 9px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(40,28,12,0.06);
  --shadow-md: 0 2px 4px rgba(40,28,12,0.05), 0 8px 24px rgba(40,28,12,0.07);
  /* type families */
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans:  'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:  'Spline Sans Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }
/* [hidden] must beat component rules that set `display` (e.g. .cs-btn);
   used for the progressive-enhancement reveal of JS-only controls. */
[hidden] { display: none !important; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
       color: var(--ink); background: var(--paper); margin: 0;
       -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ---- type scale helpers (serif content, sans UI, mono labels) ---- */
.cs-display { font-family: var(--font-serif); font-weight: 500; font-size: 44px; line-height: 1.03; letter-spacing: -0.01em; }
.cs-title   { font-family: var(--font-serif); font-weight: 500; font-size: 30px; line-height: 1.08; letter-spacing: -0.01em; }
.cs-h2      { font-family: var(--font-serif); font-weight: 500; font-size: 22px; line-height: 1.15; }
.cs-serif   { font-family: var(--font-serif); font-weight: 500; }
.cs-lede    { font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.cs-body    { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.cs-meta    { font-size: 13.5px; color: var(--muted); }
.cs-kicker  { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cs-mono    { font-family: var(--font-mono); }

/* page headings inherit the editorial serif so existing pages get the
   look without per-page markup changes. */
h1 { font-family: var(--font-serif); font-weight: 600; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.35rem; }
h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: inherit; }
a:hover { opacity: 0.8; }
.meta { color: var(--muted); margin-bottom: 0.75rem; }

/* ---- buttons: exactly ONE primary per screen ---- */
.cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 1;
  padding: 11px 16px; border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .14s, border-color .14s, color .14s; }
.cs-btn:hover { opacity: 1; }
.cs-btn--primary   { background: var(--clay); color: #fff8f1; border-color: var(--clay); }
.cs-btn--primary:hover { background: var(--clay-deep); border-color: var(--clay-deep); }
.cs-btn--secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.cs-btn--secondary:hover { border-color: var(--ink); }
.cs-btn--ghost     { background: transparent; color: var(--ink-soft); }
.cs-btn--ghost:hover { background: var(--paper-2); color: var(--ink); }
.cs-btn--sm        { font-size: 13px; padding: 8px 12px; }

/* ---- tags / chips ---- */
.cs-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 11.5px; color: var(--ink-soft); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 4px 10px; }
.cs-tag--accent { color: var(--clay-deep); border-color: rgba(176,84,47,0.35); background: var(--clay-tint); }
.cs-chip { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink-soft);
  background: var(--paper-2); border-radius: var(--r-pill); padding: 5px 11px; }
.cs-chip b { font-weight: 600; color: var(--ink); }

/* ---- inputs & search ---- */
.cs-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cs-input { font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 11px 13px; width: 100%; transition: border-color .14s, box-shadow .14s; }
.cs-input::placeholder { color: var(--muted); }
.cs-input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
.cs-search { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 10px 13px; color: var(--muted); }
.cs-search input { border: none; background: transparent; outline: none; font: inherit; color: var(--ink); width: 100%; }

/* ---- wordmark: "cook" + italic "shelf" + a clay rule = the shelf ---- */
.cs-wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; text-decoration: none; }
.cs-wordmark .wm-word { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.012em; color: var(--ink); font-size: 23px; }
.cs-wordmark .wm-word i { font-style: italic; }
.cs-wordmark .wm-shelf { height: 2px; background: var(--clay); margin-top: 5px; align-self: stretch; }

/* ---- matted cover card (cookbook jackets / food in a paper mat) ---- */
.cs-cover .mat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s; }
.cs-cover:hover .mat { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--line-2); }
.cs-cover .frame { aspect-ratio: 3 / 4; background: #fff; border-radius: 1px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(40,28,12,0.07); }
.cs-cover .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-cover .mat + div { margin-top: 12px; }
.cs-cover .cap-title  { font-family: var(--font-serif); font-weight: 600; font-size: 16.5px; line-height: 1.18; color: var(--ink); }
.cs-cover .cap-author { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cs-cover .cap-count  { font-family: var(--font-mono); font-size: 11px; color: var(--clay-deep); margin-top: 7px; }

/* ---- small shared patterns ---- */
.cs-segment { display: inline-flex; background: var(--paper-2); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.cs-segment button, .cs-segment > a { font: inherit; font-size: 13px; font-weight: 600; border: none; cursor: pointer; padding: 7px 13px;
  border-radius: var(--r-pill); background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  text-decoration: none; }
.cs-segment > a:hover { color: var(--ink); opacity: 1; }
.cs-segment button.is-active, .cs-segment > a.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.cs-meter { height: 6px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; }
.cs-meter > span { display: block; height: 100%; background: var(--olive); border-radius: var(--r-pill); }
.cs-banner { display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.45; }
.cs-banner--ai { background: var(--ai-tint); color: #6b4e0e; border: 1px solid rgba(166,121,26,0.28); }
.cs-sectionlabel { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.cs-sectionlabel::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cs-rule { height: 1px; background: var(--line); border: 0; }

/* The page canvas. There is no top header and no tab bar — the pin dock
   (a fixed bottom shelf, further down this file) is the whole chrome, so
   the only thing above the content is the content. */
main { max-width: 64rem; margin: 0 auto; padding: 1.75rem 1rem 3rem; }

/* ============================================================
   PAGE-LEVEL STYLES (swept to tokens; structure unchanged)
   ============================================================ */
/* AI-generated variation note — kept amber + honest. */
.variation-banner { margin: 0 0 1.25rem; display: flex; gap: 11px; padding: 13px 15px;
                    border-radius: var(--r-md); font-size: 13.5px; line-height: 1.45;
                    background: var(--ai-tint); color: #6b4e0e; border: 1px solid rgba(166,121,26,0.28); }
.variation-banner strong, .variation-banner a { color: #5a4109; }
/* Sub-recipe note — cookbook-verbatim, NOT AI; calm olive, not amber. */
.subrecipe-banner { margin: 0 0 1.25rem; display: flex; gap: 11px; padding: 13px 15px;
                    border-radius: var(--r-md); font-size: 13.5px; line-height: 1.45;
                    background: var(--olive-tint); color: #3f4a2c; border: 1px solid rgba(95,113,66,0.30); }
.subrecipe-banner strong, .subrecipe-banner a { color: var(--ink); }
.search { margin: 0 0 1rem; }
.search input { width: 100%; padding: 0.6rem 0.85rem; font: inherit; font-family: var(--font-sans);
                color: var(--ink); background: var(--card);
                border: 1px solid var(--line-2); border-radius: var(--r-md); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
.actions { margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.action { display: inline-flex; align-items: center; gap: 6px; padding: 0.5rem 0.85rem; font-size: 0.875rem;
          font-family: var(--font-sans); font-weight: 600; line-height: 1;
          border: 1px solid var(--line-2); border-radius: var(--r-md);
          background: var(--card); text-decoration: none; color: var(--ink); cursor: pointer; }
.action:hover { border-color: var(--ink); opacity: 1; }
.action.danger { color: var(--danger); border-color: rgba(179,38,30,0.45); }
.action.danger:hover { border-color: var(--danger); background: var(--danger-tint); }
form.reprocess { display: flex; flex-wrap: wrap; gap: 0.5rem 0.875rem; align-items: flex-start; margin: 0; }
form.reprocess label { display: inline-flex; gap: 0.3rem; align-items: baseline;
                       font-size: 0.875rem; color: var(--muted); flex-direction: column; max-width: 18rem; }
form.reprocess label .label-line { display: inline-flex; gap: 0.35rem; align-items: center; color: var(--ink); }
form.reprocess label small { color: var(--muted); font-size: 0.78rem; line-height: 1.35; margin-left: 1.35rem; display: block; }
form.danger-form { display: inline-flex; margin: 0; }
form.chapter-delete { margin: 0; }
details.admin { margin: 2rem 0 0; border-top: 1px dashed var(--line-2); padding-top: 0.75rem; }
details.admin > summary { cursor: pointer; user-select: none; color: var(--muted); font-size: 0.78rem;
                          text-transform: uppercase; letter-spacing: 0.06em; list-style: none;
                          display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); }
details.admin > summary::-webkit-details-marker { display: none; }
details.admin > summary::before { content: ""; flex: none; border-left: 0.35rem solid var(--muted);
                                  border-top: 0.25rem solid transparent; border-bottom: 0.25rem solid transparent;
                                  transition: transform 0.15s ease; }
details.admin[open] > summary::before { transform: rotate(90deg); }
details.admin > summary:hover { color: var(--ink); }
details.admin .admin-body { margin: 0.75rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
details.admin .admin-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
details.admin.chapter-admin { margin: 0.25rem 0 0.75rem; border-top: none; padding-top: 0; }
details.admin.chapter-admin .admin-body { margin-top: 0.5rem; }
.admin-section { margin: 0 0 2rem; }
.admin-section h2 { margin-top: 0; }
.admin-section p.help { color: var(--muted); font-size: 0.9rem; max-width: 42rem; margin: 0 0 1rem; }
p.flash { background: var(--olive-tint); border: 1px solid rgba(95,113,66,0.40); color: #33402a;
          padding: 0.6rem 0.85rem; border-radius: var(--r-md); margin: 0 0 1rem; font-size: 0.9rem; }
.breadcrumb { color: var(--muted); margin-bottom: 0.5rem; font-size: 0.9rem; }
.breadcrumb a { color: inherit; }
nav.breadcrumb a { text-decoration: underline; }
/* ============================================================
   Library / cookbook detail / website detail (.lb-*) — tokens and
   components per docs/DESIGN_SYSTEM.md.
   ============================================================ */
.lb-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.lb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 34px 26px; }
@media (max-width: 980px) { .lb-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px)  { .lb-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; } }

/* the matted cover/monogram card links the whole tile */
a.cs-cover { text-decoration: none; color: inherit; display: block; }
.cs-cover .cap-host { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.cs-coverph { font-family: var(--font-serif); font-weight: 500; font-size: 15px; line-height: 1.2;
  color: var(--muted); text-align: center; padding: 16px; }

/* website monogram tile — same footprint as a cover */
.lb-sitemark { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.02em; }

/* recipe row (search results / cookbook chapters / site list) */
.lb-recipe { display: flex; align-items: center; gap: 14px; padding: 13px 10px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; border-radius: var(--r-sm); transition: background .12s; }
.lb-recipe:hover { background: var(--card); opacity: 1; }
.lb-recipe:hover .t { color: var(--clay-deep); }
.lb-recipe .t { flex: 1; font-family: var(--font-serif); font-weight: 500; font-size: 17px; color: var(--ink); line-height: 1.25; }
.lb-recipe .tm { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.lb-recipe .cv { color: var(--muted); flex: 0 0 auto; }
.lb-recipe[hidden] { display: none; }

/* collapsible chapter */
.lb-chapter { border-top: 1px solid var(--line); }
.lb-chapter:last-of-type { border-bottom: 1px solid var(--line); }
.lb-chapter > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 6px; }
.lb-chapter > summary::-webkit-details-marker { display: none; }
.lb-chapter > summary .ch { font-family: var(--font-serif); font-weight: 500; font-size: 21px; color: var(--ink); flex: 1; }
.lb-chapter > summary .n { font-family: var(--font-mono); font-size: 11px; color: var(--clay-deep); }
.lb-chapter > summary .caret { color: var(--muted); transition: transform .18s; }
.lb-chapter[open] > summary .caret { transform: rotate(90deg); }
.lb-chapter .recs { padding: 0 4px 14px; }

/* ---- cookbook-detail recipe browsing (.cb-*): photo-forward tiles.
   A chapter's recipes-with-photos render as matted tiles (the same
   "framed plate" language as the library's .cs-cover jackets); recipes
   without photos get a typographic recipe-card tile or fall back to the
   .lb-recipe rows, per variant. ---- */
.cb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 22px; padding: 6px 0 18px; }
@media (max-width: 980px) { .cb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cb-grid { grid-template-columns: 1fr 1fr; gap: 18px 12px; } }
a.cb-tile { display: block; text-decoration: none; color: inherit; }
.cb-tile .mat { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s; }
.cb-tile:hover .mat { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--line-2); }
.cb-tile .frame { aspect-ratio: 4 / 3; background: #fff; border-radius: 1px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(40,28,12,0.07); }
.cb-tile .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* typographic "recipe card" frame for photo-less recipes: serif title on
   the warm card surface, so a mixed chapter still reads as one wall of
   framed cards rather than gray holes. */
.cb-tile .frame.card { background: var(--card); display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; }
.cb-tile .frame.card span { font-family: var(--font-serif); font-weight: 500; font-size: 16px; line-height: 1.25;
  color: var(--ink-soft); text-align: center; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cb-tile .cap { margin-top: 10px; }
.cb-tile .cap-title { font-family: var(--font-serif); font-weight: 600; font-size: 15.5px; line-height: 1.22; color: var(--ink); }
.cb-tile:hover .cap-title { color: var(--clay-deep); }
.cb-tile .cap-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
/* the photos view's photo-less remainder under the grid, as compact rows */
.cb-rest { margin-top: 4px; }
.cb-restlabel { margin: 10px 2px 4px; }
/* "Chapters" label + the photos/cards/list view toggle on one row */
.cb-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 30px 0 4px; }
.cb-viewbar .rx-sectlabel { flex: 1; min-width: 160px; margin: 0; }
/* variant C: generous-thumb rows */
.cb-row { display: flex; align-items: center; gap: 16px; padding: 10px 6px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: background .12s; }
.cb-row:hover { background: var(--card); opacity: 1; }
.cb-row:hover .t { color: var(--clay-deep); }
.cb-row .ph { width: 116px; aspect-ratio: 4 / 3; flex: 0 0 auto; border-radius: var(--r-sm); overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--line); }
.cb-row .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-row .ph.card { display: flex; align-items: center; justify-content: center; padding: 6px 8px; }
.cb-row .ph.card span { font-family: var(--font-serif); font-weight: 500; font-size: 11.5px; line-height: 1.2;
  color: var(--muted); text-align: center; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cb-row .t { flex: 1; font-family: var(--font-serif); font-weight: 500; font-size: 17px; color: var(--ink); line-height: 1.25; }
.cb-row .tm { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* cookbook / website detail header */
.lb-head { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; margin-bottom: 30px; }
.lb-head .cover { border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow-md); background: var(--paper-2); aspect-ratio: 3/4; }
.lb-head .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-head .cover.monogram { box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; }
.lb-sitelink { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--clay-deep);
  text-decoration: none; font-family: var(--font-mono); font-size: 12px; }
.lb-sitelink:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 820px) { .lb-head { grid-template-columns: 1fr; gap: 18px; } .lb-head .cover { width: 150px; } }
.recipe-photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; }
.recipe-photos figure { margin: 0; flex: 1 1 18rem; max-width: 28rem; }
.recipe-photos img { width: 100%; max-height: 32rem; height: auto; object-fit: cover; border-radius: var(--r-md); display: block; }
.recipe-photos figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 0.25rem; }
/* ============================================================
   Home (.hm-*) — a "this week" band (tonight feature + the week +
   the grocery bridge) over a cookbook-library preview. The day grid
   + secondary actions are desktop affordances; mobile keeps the
   tonight card + the grocery bridge and sends the rest to the Plan
   tab.
   ============================================================ */
.hm-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.hm-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: var(--clay); flex: 0 0 auto; }
.hm-band { display: grid; grid-template-columns: 340px 1fr; gap: 22px; margin-bottom: 44px; align-items: start; }

/* tonight feature — the whole card opens the recipe */
.hm-tonight { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow .18s, transform .18s, border-color .18s; }
a.hm-tonight:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); opacity: 1; }
.hm-tonight .ph { height: 178px; background: var(--paper-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hm-tonight .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-tonight .body { padding: 16px 18px 18px; display: flex; flex-direction: column; }
.hm-tonight-day { color: var(--clay-deep); margin-bottom: 7px; }
.hm-tonight-title { font-family: var(--font-serif); font-weight: 500; font-size: 24px; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); }
.hm-tonight-meta { margin-top: 5px; }
.hm-tonight .hm-open { width: 100%; margin-top: 14px; }
.hm-tonight-gone { margin-top: 12px; font-style: italic; }

/* the week + the actions */
.hm-weekside { display: flex; flex-direction: column; gap: 16px; }
.hm-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; flex: 1; align-content: start; }
.hm-day { display: flex; flex-direction: column; min-height: 104px; padding: 13px 13px 15px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .14s, box-shadow .14s; }
a.hm-day:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); opacity: 1; }
a.hm-day:hover .hm-day-meal { color: var(--clay-deep); }
.hm-day.is-tonight { background: var(--clay-tint); border-color: rgba(176,84,47,0.3); }
.hm-day-date { margin-bottom: 8px; }
.hm-day-date b { color: var(--ink); font-weight: 600; }
.hm-day-meal { font-family: var(--font-serif); font-weight: 600; font-size: 15.5px; line-height: 1.2; color: var(--ink); flex: 1; }
.hm-day-role { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hm-actions form { margin: 0; display: inline-flex; }

/* empty "this week" */
.hm-empty { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 26px 28px; margin-bottom: 44px; }
.hm-empty-title { font-family: var(--font-serif); font-weight: 500; font-size: 24px; color: var(--ink); }
.hm-empty-copy { margin: 8px 0 18px; max-width: 46ch; }
.hm-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* library preview head */
.hm-libhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hm-libkicker { margin-bottom: 9px; }
.hm-libtools { display: flex; align-items: center; gap: 10px; }
.hm-libsearch { width: 240px; max-width: 100%; }
.hm-librule { margin: 18px 0 28px; }
.hm-libmore { margin-top: 26px; }
.hm-libmore a { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--clay-deep); text-decoration: none; }
.hm-libmore a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 820px) {
  .hm-band { grid-template-columns: 1fr; gap: 16px; }
  /* tonight card reflows horizontal; the whole card is the recipe link,
     so the explicit "Open recipe" button + the day grid + secondary
     actions all drop, leaving the grocery bridge front-and-center. */
  .hm-tonight { flex-direction: row; align-items: stretch; }
  .hm-tonight .ph { height: auto; width: 116px; flex: 0 0 auto; }
  .hm-tonight .body { flex: 1; min-width: 0; padding: 14px 15px; }
  .hm-tonight-title { font-size: 20px; }
  .hm-days, .hm-act-more, .hm-tonight .hm-open { display: none; }
  .hm-actions, .hm-actions form, .hm-actions .cs-btn { width: 100%; }
}
/* ============================================================
   Search (.sr-*) — the every-recipe search surface on /library:
   query bar with field scope, the refine rail of tag/time filter
   pills, and photo-thumb result rows. Filters are GET form controls
   inside <details> disclosures, so the whole surface works JS-off;
   the library-search Stimulus controller layers live fetch-and-swap
   on top (see .js-live below). (The facet-sidebar and
   native-select variants explored in the design lab live in git
   history — the rail won on mobile and holds up on desktop.)
   ============================================================ */
.sr-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sr-bar .cs-search { flex: 1 1 280px; }
.sr-bar .cs-search input { font-size: 15.5px; }
/* radio-as-segment: the field-scope toggle is a real radio group so the
   GET form carries it with no JS. :has() flips the active pane. */
.cs-segment label { position: relative; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 7px 13px; border-radius: var(--r-pill); color: var(--ink-soft); opacity: .75; }
.cs-segment label:hover { color: var(--ink); opacity: 1; }
.cs-segment label:has(input:checked) { background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); opacity: 1; }
.cs-segment label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* result count line */
.sr-count { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 20px 0 4px; }
.sr-count .cs-kicker { margin: 0; }
.sr-count .clear { font-size: 12.5px; color: var(--muted); }

/* result rows: generous thumb + serif title + mono provenance line +
   tag pills. Photo-less rows get the paper card, never a broken image. */
.sr-row { display: flex; align-items: center; gap: 15px; padding: 12px 6px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.sr-row:hover { background: var(--card); opacity: 1; }
.sr-row:hover .t { color: var(--clay-deep); }
.sr-row .ph { width: 96px; aspect-ratio: 4 / 3; flex: 0 0 auto; border-radius: var(--r-sm);
  overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.sr-row .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sr-row .ph.card { background: var(--card); }
.sr-row .body { flex: 1; min-width: 0; }
.sr-row .t { display: block; font-family: var(--font-serif); font-weight: 500; font-size: 17.5px;
  color: var(--ink); line-height: 1.25; }
.sr-row .sub { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  margin-top: 4px; }
.sr-row .sub .ai { color: var(--ai); }
.sr-row .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.sr-row .tags .cs-tag { font-size: 10px; padding: 2px 8px; }
@media (max-width: 640px) {
  .sr-row .ph { width: 76px; }
  .sr-row .t { font-size: 16px; }
}

/* ---- the refine rail: one pill per filter group; each is a
   <details> whose panel is a dropdown card on desktop and a bottom
   sheet on phones. A group with active selections shows clay. ---- */
.sr-rail { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sr-filter { position: relative; }
.sr-filter > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; user-select: none; white-space: nowrap; }
.sr-filter > summary::-webkit-details-marker { display: none; }
.sr-filter > summary:hover { color: var(--ink); }
.sr-filter > summary .caret { color: var(--muted); transform: rotate(90deg); transition: transform .18s; }
.sr-filter[open] > summary { border-color: var(--ink-soft); color: var(--ink); }
.sr-filter[open] > summary .caret { transform: rotate(-90deg); }
.sr-filter.on > summary { background: var(--clay-tint); border-color: rgba(176,84,47,0.35);
  color: var(--clay-deep); }
.sr-filter.on > summary .caret { color: var(--clay-deep); }
.sr-filter > summary .cnt { font-family: var(--font-mono); font-size: 10.5px;
  background: var(--clay); color: var(--card); border-radius: var(--r-pill);
  padding: 1px 6px; margin-left: 2px; }
/* flex column with the scroll on .opts, not the panel — a long option
   list (29 cuisines) must never bury the Apply/Done button below the
   scroll, which is exactly how the v1 panel hid Apply on phones */
.sr-panel { position: absolute; z-index: 30; top: calc(100% + 7px); left: 0; min-width: 240px;
  max-height: 330px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 9px; }
.sr-panel .opts { overflow: auto; min-height: 0; }
/* group name inside the panel — redundant next to the anchored pill on
   desktop, load-bearing in the mobile bottom sheet (which floats away
   from its pill). */
.sr-panel .plabel { margin: 4px 9px 6px; }
.sr-opt { display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.sr-opt:hover { background: var(--paper-2); }
.sr-opt input { accent-color: var(--clay); }
.sr-opt .n { flex: 1; }
.sr-opt .c { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
/* counts are conditioned on the current search; an option the search
   already rules out greys (still clickable — the count is a forecast,
   not a lock) */
.sr-opt.zero { opacity: .45; }
.sr-panel .apply, .sr-panel .done { width: 100%; justify-content: center; margin-top: 7px; }
/* live search (the library-search controller tags its root .js-live):
   changes apply themselves, so the panel's Apply submit yields to a
   Done dismiss, and the results region dims while a fetch is in
   flight (the transition delay keeps fast responses flicker-free).
   JS off: no .js-live, Apply stays, nothing dims. */
.sr-panel .done { display: none; }
.js-live .sr-panel .apply { display: none; }
.js-live .sr-panel .done { display: inline-flex; }
.sr-results.is-loading { opacity: .5; transition: opacity .15s ease .12s; }
@media (max-width: 640px) {
  /* poor-man's bottom sheet: same <details>, pinned to the viewport
     foot — thumb-reach on a phone, still zero JS. The bottom offset
     clears the fixed pin dock (.pt-dock, z-index 49, ~60px + safe
     area) so the Apply/Done button is never under it. */
  .sr-panel { position: fixed; left: 10px; right: 10px; top: auto;
    bottom: calc(74px + env(safe-area-inset-bottom));
    max-height: 55vh; min-width: 0; z-index: 60; }
}

/* ============================================================
   Meal plan / week (.pl-*) — manual-editing-first week grid; tokens
   and components per docs/DESIGN_SYSTEM.md.
   One responsive DOM: the 7-up day grid
   reflows to a single-column day stack on phones. See
   docs/MEAL_PLANNING.md. (Notes, the Breakfast→Snack role
   vocabulary, and leftover-origin links are a follow-up PR — v1
   labels meals by the existing lunch/dinner slot.)
   ============================================================ */
.pl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.pl-weeknav { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pl-weeknav .arrow { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; text-decoration: none; flex: 0 0 auto; }
.pl-weeknav .arrow:hover { border-color: var(--ink); color: var(--ink); opacity: 1; }
.pl-weeknav .arrow.is-disabled { opacity: .4; pointer-events: none; }
.pl-weeknav svg.flip, .pl-prevnext svg.flip { transform: rotate(180deg); }
.pl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-tools form { margin: 0; }
.pl-fellback { margin: 0 0 16px; }

/* editable description card (a <details>: the card is the summary, the
   textarea form reveals on click) */
.pl-descwrap { margin-bottom: 18px; max-width: 720px; }
.pl-descwrap > summary { list-style: none; cursor: pointer; }
.pl-descwrap > summary::-webkit-details-marker { display: none; }
.pl-desc { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 16px; }
.pl-descwrap > summary:hover .pl-desc { border-color: var(--line-2); }
.pl-desc .ic { color: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.pl-desc .txt { font-family: var(--font-serif); font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; flex: 1; min-width: 0; }
.pl-desc .txt.empty { font-style: italic; color: var(--muted); }
.pl-desc .edit { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); flex: 0 0 auto; align-self: center; }
.pl-descwrap > summary:hover .pl-desc .edit { color: var(--clay-deep); }
.pl-descwrap[open] > summary .pl-desc .edit { color: var(--clay-deep); }
.pl-descedit { margin: 10px 0 0; }
.pl-descedit textarea { width: 100%; box-sizing: border-box; font: inherit; font-family: var(--font-serif); font-size: 14.5px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; resize: vertical; }
.pl-descedit .row { display: flex; gap: 8px; margin-top: 8px; }

/* counts line */
.pl-counts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-counts .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.pl-counts .chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft);
  background: var(--olive-tint); border-radius: 999px; padding: 3px 11px; }
.pl-counts .chip svg { color: var(--olive); }

/* 7-day grid */
.pl-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1200px) { .pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pl-day { display: flex; flex-direction: column; gap: 10px; min-height: 150px; border-radius: var(--r-md); padding: 4px; transition: background .12s, box-shadow .12s; }
.pl-day.is-today { background: var(--paper-2); }
.pl-day.drop-on { background: var(--clay-tint); box-shadow: inset 0 0 0 1.5px rgba(176,84,47,.4); }
.pl-dayhead { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 6px 0; }
.pl-dayhead .dow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pl-dayhead .dom { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.pl-day.is-today .pl-dayhead .dow, .pl-day.is-today .pl-dayhead .dom { color: var(--clay-deep); }

/* meal card */
/* no overflow:hidden here — it would clip the ⋯ context menu (.pl-menu),
   which is appended into the card and extends past its bottom edge. The
   thumb rounds its own top corners instead (below). */
.pl-meal { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: box-shadow .14s, transform .14s, border-color .14s; }
.pl-meal.draggable { cursor: grab; }
.pl-meal:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.pl-meal.dragging { opacity: .5; }
.pl-meal .thumb { height: 76px; background: var(--paper-2); overflow: hidden; display: block; text-decoration: none;
  border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.pl-meal .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-meal .thumb.ph { display: flex; align-items: center; justify-content: center; padding: 6px 10px; }
.pl-meal .thumb.ph span { font-family: var(--font-serif); font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-meal .body { padding: 9px 10px 11px; display: block; text-decoration: none; color: inherit; }
a.pl-meal .body:hover .nm, .pl-meal .body[href]:hover .nm { color: var(--clay-deep); }
.pl-meal .role { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pl-meal .nm { font-family: var(--font-serif); font-weight: 600; font-size: 14px; line-height: 1.18; color: var(--ink); transition: color .12s; }
.pl-meal .nm.missing { color: var(--muted); font-style: italic; font-weight: 500; }
.pl-meal .src { font-size: 11px; color: var(--muted); margin-top: 3px; }
.pl-meal .leftover-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--honey); margin-top: 6px; }
.pl-meal .ingrocery { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 999px; background: var(--olive); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
/* the hover actions claim the same corner — yield the grocery badge to them */
.pl-meal:hover .ingrocery { opacity: 0; }
/* a non-recipe note: calendar + text, no thumb */
.pl-meal.note .body { display: flex; align-items: center; gap: 9px; padding: 12px 12px; }
.pl-meal.note .nm { font-family: var(--font-sans); font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.pl-meal.note .noteic { color: var(--muted); flex: 0 0 auto; }

/* hover actions on a meal (JS-revealed; hidden until the controller connects) */
.pl-meal .mealacts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.pl-meal:hover .mealacts { opacity: 1; }
.pl-meal .mealacts button { width: 24px; height: 24px; border-radius: 999px; border: none; background: rgba(247,243,236,0.94);
  color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); padding: 0; }
.pl-meal .mealacts button:hover { color: var(--clay-deep); }
.pl-meal .mealacts button.del:hover { color: #fff; background: var(--clay); }
/* no-JS baseline: a plain remove form, shown only when JS is absent */
.pl-meal .pl-rm-fallback { position: absolute; top: 6px; right: 6px; margin: 0; }
.pl-meal .pl-rm-fallback button { width: 24px; height: 24px; border-radius: 999px; border: none; background: rgba(247,243,236,0.94);
  color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); padding: 0; opacity: 0; transition: opacity .12s; }
.pl-meal:hover .pl-rm-fallback button { opacity: 1; }
.pl-meal .pl-rm-fallback button:hover { color: #fff; background: var(--clay); }

/* add-to-day button (a real link to the add page; JS opens it as a drawer) */
.pl-add { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; box-sizing: border-box; padding: 9px; border: 1px dashed var(--line-2);
  border-radius: var(--r-md); background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none;
  transition: border-color .12s, color .12s, background .12s; }
.pl-add:hover { border-color: var(--clay); color: var(--clay-deep); background: var(--clay-tint); opacity: 1; }

/* meal context menu (JS) */
.pl-menu { position: absolute; z-index: 30; top: 32px; right: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 5px; min-width: 188px; }
.pl-menu button, .pl-menu a { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; text-align: left; background: none; border: none;
  cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; }
.pl-menu button:hover, .pl-menu a:hover { background: var(--paper-2); opacity: 1; }
.pl-menu .danger { color: var(--clay-deep); }
.pl-menu .danger:hover { background: var(--clay-tint); }
.pl-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.pl-menu .lbl { padding: 6px 10px 2px; }
.pl-menu .tick { width: 16px; flex: 0 0 auto; color: var(--clay-deep); }

/* empty states + prev/next */
.pl-weekempty { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; text-align: center; }
.pl-weekempty .t { font-family: var(--font-serif); font-weight: 500; font-size: 22px; color: var(--ink); }
.pl-weekempty p { margin: 8px auto 18px; max-width: 44ch; }
.pl-prevnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }

/* add drawer (JS slide-in; the standalone /plan/:id/add page styles the same body) */
.pl-drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(40,28,12,.28); opacity: 0; transition: opacity .2s; }
.pl-drawer-scrim.open { opacity: 1; }
.pl-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: 420px; max-width: 92vw; background: var(--paper);
  box-shadow: -8px 0 40px rgba(40,28,12,.2); transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.pl-drawer.open { transform: translateX(0); }
.pl-drawer .dh { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); position: relative; }
.pl-drawer .dh .x { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 999px; border: none; background: var(--paper-2);
  color: var(--ink-soft); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pl-drawer .dh .x:hover { color: var(--ink); }
.pl-drawer .db { flex: 1; overflow: auto; padding: 12px 20px 24px; }
.pl-addbody .pl-addhead { margin-bottom: 12px; }
.pl-addbody .cs-search { margin-top: 12px; }
.pl-results { display: flex; flex-direction: column; }
.pl-pick { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: var(--r-sm); border-bottom: 1px solid var(--line);
  width: 100%; box-sizing: border-box; text-align: left; background: none; border-left: none; border-right: none; border-top: none; cursor: pointer; font: inherit; }
.pl-pick:hover { background: var(--card); }
.pl-pick .pthumb { width: 46px; height: 46px; border-radius: var(--r-sm); overflow: hidden; background: var(--paper-2); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.pl-pick .pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-pick .pthumb span { font-family: var(--font-serif); font-weight: 600; color: var(--muted); font-size: 16px; }
.pl-pick .pt { flex: 1; min-width: 0; }
.pl-pick .pt .nm { font-family: var(--font-serif); font-weight: 600; font-size: 15px; color: var(--ink); line-height: 1.2; }
.pl-pick .pt .src { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pl-pick .padd { color: var(--clay); flex: 0 0 auto; }
.pl-pick:hover .pt .nm { color: var(--clay-deep); }
.pl-addempty { padding: 22px 4px; font-style: italic; color: var(--muted); }
.pl-seg { display: flex; margin: 12px 0 4px; }
.pl-notechips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pl-notechips form { margin: 0; }
.pl-notechip { cursor: pointer; font-size: 13px; padding: 7px 13px; border: none; }
.pl-noteform { margin-top: 4px; }

/* phones: the week grid becomes a single-column day stack; each meal
   card reflows from a vertical jacket to a horizontal row */
@media (max-width: 640px) {
  .pl-grid { grid-template-columns: 1fr; gap: 0; }
  .pl-day { min-height: 0; padding: 6px 2px 4px; border-radius: 0; }
  .pl-day + .pl-day { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; }
  .pl-day.is-today { background: transparent; }
  .pl-dayhead { padding: 0 2px 2px; }
  .pl-dayhead .dow { order: 2; }
  .pl-meal { display: flex; align-items: stretch; }
  .pl-meal .thumb { width: 64px; height: auto; flex: 0 0 auto; }
  .pl-meal .body { flex: 1; min-width: 0; padding: 10px 12px; }
  .pl-meal .ingrocery { top: 8px; right: 8px; }
  .pl-drawer { width: 100%; max-width: 100%; }
  /* touch has no :hover — keep the action affordance visible, centered on
     the right edge so it clears the top-right grocery badge. The JS path
     shows the ⋯ (remove lives in its menu); the no-JS path shows the
     remove form. */
  .pl-meal .mealacts, .pl-meal .pl-rm-fallback { top: 50%; bottom: auto; right: 8px; transform: translateY(-50%); opacity: 1; }
  .pl-meal .mealacts button, .pl-meal .pl-rm-fallback button { opacity: 1; }
  .pl-meal .mealacts .del { display: none; }
  .pl-meal:hover .ingrocery { opacity: 1; }
}
/* ============================================================
   Recipe page (.rx-*) + Cook mode (.ck-*) — tokens and components
   per docs/DESIGN_SYSTEM.md.
   (No servings scaler in v1 — deferred to a follow-up PR.)
   ============================================================ */
.rx-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.rx-crumb a { color: var(--muted); text-decoration: none; }
.rx-crumb a:hover { color: var(--clay-deep); }
.rx-crumb .sep { opacity: .5; }

.rx-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-bottom: 34px; }
.rx-head--solo { grid-template-columns: 1fr; }
.rx-titleblock { display: flex; flex-direction: column; }
.rx-title { font-family: var(--font-serif); font-weight: 500; font-size: 46px; line-height: 1.04;
  letter-spacing: -0.015em; margin: 6px 0 0; }
.rx-intro { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); margin: 18px 0 0; }
.rx-hero { aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: var(--paper-2); box-shadow: var(--shadow-sm); }
.rx-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rx-actions form { margin: 0; display: inline-flex; }
.rx-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.rx-time { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; background: var(--paper-2);
  border-radius: var(--r-pill); padding: 6px 13px; font-size: 13px; color: var(--ink-soft); }
.rx-time b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.rx-time .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.rx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.rx-tagmore { font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: var(--clay-deep);
  background: none; border: none; cursor: pointer; padding: 4px 6px; }
.rx-tagmore:hover { text-decoration: underline; }

.rx-grid { display: grid; grid-template-columns: 320px 1fr; gap: 52px; align-items: start; }
.rx-side { position: sticky; top: 22px; }
.rx-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 20px 8px; }
.rx-cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rx-ing-grouphead { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 2px; }
.rx-ing-grouphead:first-of-type { margin-top: 6px; }

.rx-ing { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.rx-ing:last-child { border-bottom: none; }
.rx-ing .box { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line-2);
  background: var(--paper); display: flex; align-items: center; justify-content: center; color: transparent; margin-top: 1px;
  transition: background .12s, border-color .12s, color .12s; }
.rx-ing.on .box { background: var(--olive); border-color: var(--olive); color: #fff; }
.rx-ing.on .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.rx-ing .txt { font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.rx-ing .txt a { color: var(--clay-deep); text-decoration: underline; text-underline-offset: 2px; }

.rx-steps { display: flex; flex-direction: column; gap: 26px; }
.rx-sectlabel { font-family: var(--font-mono); font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.rx-sectlabel::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.rx-step { display: grid; grid-template-columns: 38px 1fr; gap: 16px; align-items: start; }
.rx-step--inline { grid-template-columns: 1fr; }
.rx-step .num { font-family: var(--font-serif); font-size: 26px; font-weight: 500; color: var(--clay); line-height: 1; padding-top: 2px; }
.rx-step h4 { font-family: var(--font-sans); font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.rx-step p { font-size: 15px; line-height: 1.62; color: var(--ink-soft); margin: 0; }
.rx-step a { color: var(--clay-deep); text-decoration: underline; text-underline-offset: 2px; }

.rx-notes { margin-top: 40px; }
.rx-note { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.rx-note b { color: var(--ink); }
.rx-note .mk { font-family: var(--font-mono); font-size: 12px; color: var(--clay-deep); flex: 0 0 auto; }
.rx-footnote { margin-top: 18px; font-size: 13.5px; color: var(--muted); font-style: italic; }

/* blue "imported from the web" provenance banner (sibling of cs-banner--ai) */
.cs-banner--source { background: rgba(60,110,170,0.10); color: #2c5680; border: 1px solid rgba(60,110,170,0.26); }
.cs-banner--source a, .cs-banner--source b { color: #214a72; }

@media (max-width: 820px) {
  .rx-head { grid-template-columns: 1fr; gap: 22px; }
  .rx-titleblock { order: 2; }
  .rx-hero { order: 1; aspect-ratio: 3 / 2; }
  .rx-title { font-size: 34px; }
  .rx-grid { grid-template-columns: 1fr; gap: 8px; }
  .rx-side { position: static; margin-bottom: 30px; }
}

/* ---- Cook mode (full-screen overlay) ---- */
.ck-overlay { position: fixed; inset: 0; z-index: 80; background: var(--paper); display: flex; flex-direction: column; }
.ck-top { display: flex; align-items: center; gap: 16px; padding: 18px 22px 12px; }
.ck-top .ttl { font-family: var(--font-serif); font-size: 18px; font-weight: 500; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-x { width: 38px; height: 38px; border-radius: 999px; border: none; background: var(--paper-2); color: var(--ink-soft);
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ck-dots { display: flex; gap: 6px; padding: 0 22px 10px; }
.ck-dots span { height: 4px; flex: 1; border-radius: 2px; background: var(--paper-2); }
.ck-dots span.done { background: var(--olive); }
.ck-dots span.cur { background: var(--clay); }
.ck-body { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 28px; }
.ck-stepno { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--clay-deep); margin-bottom: 14px; }
.ck-h { font-family: var(--font-serif); font-weight: 500; font-size: 30px; line-height: 1.12; color: var(--ink); margin: 0 0 18px; max-width: 720px; }
.ck-p { font-size: 21px; line-height: 1.5; color: var(--ink-soft); max-width: 680px; margin: 0 auto; }
.ck-ing { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 640px; }
.ck-ing .cs-chip { font-size: 14px; }
.ck-wake { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 6px; justify-content: center; padding-bottom: 6px; }
.ck-wake .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--olive); }
.ck-foot { display: flex; align-items: center; gap: 12px; padding: 16px 22px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ck-foot .step-btn { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ck-foot .step-btn:disabled { opacity: .35; cursor: default; }
.ck-foot .step-btn .ck-flip { transform: rotate(180deg); }
.ck-foot .done-btn { flex: 1; height: 54px; }

.recommendations { margin: 40px 0 1.5rem; padding: 0.75rem 1rem; background: var(--card);
                   border: 1px solid var(--line); border-radius: var(--r-md); }
.recommendations .recommendation-group + .recommendation-group { margin-top: 0.75rem; }
.recommendations h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.recommendations ul { margin: 0; padding-left: 1.25rem; }
.recommendations li { margin-bottom: 0.2rem; }
.recommendations a { text-decoration: underline; }
.empty { color: var(--muted); font-style: italic; padding: 2rem 0; text-align: center; }
.plan-notes { color: var(--muted); margin: 0 0 1.5rem; max-width: 48rem; }
ul.plan-day { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; }
ul.plan-day li { padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
ul.plan-day .slot-role { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); text-transform: uppercase;
                         letter-spacing: 0.05em; background: var(--paper-2); padding: 0.1rem 0.5rem;
                         border-radius: var(--r-pill); white-space: nowrap; }
ul.plan-day a { text-decoration: none; font-weight: 600; }
ul.plan-day a:hover { text-decoration: underline; }
ul.plan-day .missing { color: var(--muted); font-style: italic; }
ul.plan-day .sub { color: var(--muted); font-size: 0.875rem; }
nav.week-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin: 2rem 0 0; }
form.login { max-width: 22rem; margin: 4rem auto; }
form.login .cs-wordmark { margin-bottom: 0.75rem; }
form.login label { display: block; margin: 1.25rem 0 0.4rem; font-family: var(--font-mono);
                   font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
form.login input { width: 100%; padding: 0.65rem 0.75rem; font: inherit; font-family: var(--font-sans);
                   border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--card); color: var(--ink); }
form.login input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
form.login .cs-btn { width: 100%; margin-top: 1.25rem; }
form.upload { max-width: 32rem; margin: 1rem 0 0; }
form.upload label { display: block; margin: 0 0 0.5rem; font-weight: 600; }
form.upload input[type=file],
form.upload input[type=url],
form.upload input[type=date],
form.upload input[type=text] { display: block; margin: 0 0 1rem; width: 100%; font: inherit;
                               padding: 0.6rem 0.75rem; border: 1px solid var(--line-2);
                               border-radius: var(--r-md); background: var(--card); color: var(--ink); }
form.upload textarea { display: block; margin: 0 0 1rem; width: 100%; font: inherit; padding: 0.6rem 0.75rem;
                       border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--card);
                       color: var(--ink); box-sizing: border-box; }
form.upload input:focus, form.upload textarea:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
form.upload button { margin-top: 0.5rem; }
.error { color: var(--danger); margin-bottom: 1rem; }
/* Import bookmarklet: the copy-paste code block (iOS install path). */
.bookmarklet-code { margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--line-2);
                    border-radius: var(--r-md); background: var(--card); overflow-x: auto;
                    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5;
                    color: var(--ink-soft); white-space: pre-wrap; word-break: break-all;
                    -webkit-user-select: all; user-select: all; }
/* Meal-plan inline editing: per-meal edit + add-a-meal disclosures. */
ul.plan-day li { display: block; }
.plan-day .meal-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.plan-day .meal-line .danger-form { margin-left: auto; }
details.meal-edit { margin: 0.35rem 0 0; }
details.meal-edit > summary { cursor: pointer; user-select: none; font-size: 0.8rem; color: var(--muted); list-style: none; width: max-content; }
details.meal-edit > summary:hover { color: var(--ink); }
details.meal-edit > summary::-webkit-details-marker { display: none; }
details.meal-add { margin: 1rem 0 0; }
details.meal-add > summary { cursor: pointer; user-select: none; font-weight: 600; list-style: none; width: max-content; }
details.meal-add > summary::-webkit-details-marker { display: none; }
form.meal-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin: 0.75rem 0 0; }
form.meal-form .field { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; }
form.meal-form .field span { font-size: 0.78rem; color: var(--muted); }
form.meal-form input, form.meal-form select { font: inherit; color: var(--ink); background: var(--card);
                                               border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 0.4rem 0.55rem; }
form.meal-form input[type=number] { width: 6rem; }
form.meal-form input:focus, form.meal-form select:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint); }
p.hint { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
table.jobs { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9rem; }
table.jobs th, table.jobs td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
table.jobs th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-mono); }
table.jobs td.state { white-space: nowrap; }
table.jobs tr:last-child td { border-bottom: none; }
.state-tag { display: inline-block; padding: 0.05rem 0.5rem; border-radius: var(--r-pill); font-size: 0.8rem; font-family: var(--font-mono); }
.state-queued    { background: var(--paper-2); color: var(--ink-soft); }
.state-running   { background: rgba(189,138,44,0.20); color: #6b4e0e; }
.state-succeeded { background: var(--olive-tint); color: #33402a; }
.state-failed    { background: var(--danger-tint); color: var(--danger); }
.state-canceled  { background: var(--paper-2); color: var(--muted); }
.job-progress { font-family: var(--font-mono); background: var(--paper-2); padding: 0.75rem;
                border-radius: var(--r-md); white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; line-height: 1.4; }
.job-error { color: var(--danger); background: var(--danger-tint); padding: 0.75rem; border-radius: var(--r-md);
             font-family: var(--font-mono); white-space: pre-wrap; word-break: break-word; font-size: 0.85rem;
             line-height: 1.4; margin: 0 0 1rem; }
/* Inline add-to-grocery forms sit flush in an .actions row. */
.actions form { margin: 0; display: inline-flex; }

/* ============================================================
   GROCERY LIST — the kitchen daily-driver. "Need" = clay,
   "have it"/"got it" = olive. One responsive DOM: mobile is the
   primary (round tap targets + swipe-to-delete), desktop adds a
   two-column aisle layout. The Stimulus controller keeps the
   offline outbox + server-swap pipeline; this is the skin.
   ============================================================ */
.grocery-page { padding-bottom: 1rem; }
.grocery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.grocery-head .kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
                        text-transform: uppercase; color: var(--muted); }

/* manual add — always-visible field */
.gx-add { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line-2);
          border-radius: var(--r-md); padding: 10px 13px; color: var(--muted); margin: 1rem 0 1.25rem; }
.gx-add svg { flex: 0 0 auto; }
.gx-add input { border: none; background: transparent; outline: none; font: inherit; color: var(--ink); width: 100%; }
.gx-add button { border: none; background: none; color: var(--clay); cursor: pointer; display: inline-flex; padding: 0; }
.gx-add button:hover { color: var(--clay-deep); }
.gx-add.plan-add { justify-content: flex-start; }
.gx-add.plan-add button { color: var(--clay-deep); font-weight: 600; gap: 8px; }

/* toolbar: segmented mode toggle + kebab menu */
.grocery-toolbar { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.5rem; }
.grocery-modes { display: none; margin: 0; }
.grocery-page[data-mode] .grocery-modes { display: inline-flex; background: var(--paper-2); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.grocery-modes .tab { font: inherit; font-size: 13px; font-weight: 600; border: none; cursor: pointer; padding: 7px 14px;
                   border-radius: var(--r-pill); background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.grocery-modes .tab:hover { color: var(--ink); }
.grocery-modes .tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.grocery-modes .tab .count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 500; }
.grocery-modes .tab.active .count { color: var(--clay-deep); }

/* kebab ⋮ menu (native <details>, no JS needed) */
.gx-menu { position: relative; margin-left: auto; }
.gx-menu > summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: var(--r-pill);
                     display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.gx-menu > summary::-webkit-details-marker { display: none; }
.gx-menu > summary:hover { background: var(--paper-2); }
.gx-menu-body { position: absolute; top: 44px; right: 0; z-index: 30; background: var(--card); border: 1px solid var(--line);
                border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 5px; min-width: 210px; }
.gx-menu-body form { margin: 0; }
.gx-menu-body button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none;
                       border: none; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); padding: 10px 11px; border-radius: var(--r-sm); }
.gx-menu-body button:hover { background: var(--paper-2); }
.gx-menu-body button.danger { color: var(--clay-deep); }
.gx-menu-body button.danger:hover { background: var(--clay-tint); }
.gx-menu-body .sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* progress meter */
.gx-progress { display: flex; align-items: center; gap: 12px; margin: 0.25rem 0 1.25rem; }
.gx-progress .cs-meter { flex: 1; max-width: 320px; }
.gx-progress .cs-meter.clay > span { background: var(--clay); }
.gx-prog-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }

/* zones */
.grocery-zone { margin: 0 0 1rem; }
.grocery-zone > h2 { display: none; } /* the segmented control names the mode */
.grocery-zone .zone-help { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.75rem; }

/* aisle grouping — recessed band headers. On mobile the band is
   full-bleed and sticky, so "which aisle am I in?" stays answered
   while a long aisle scrolls (the store-glance fix: headers used to
   be the smallest, faintest text on the screen). */
.gx-aisles { margin-top: 4px; }
.gx-aisle { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
            text-transform: uppercase; color: var(--ink-soft); font-weight: 600;
            margin: 20px 0 2px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--r-sm); }
.gx-aisle .nm { white-space: nowrap; }
.gx-aisle .ct { color: var(--clay-deep); margin-left: auto; }
@media (max-width: 720px) {
  /* full-bleed: the -1rem mirrors main's side padding. z-index sits
     above the rows (1) and below the kebab menu (30) / tabbar (50). */
  .gx-aisle { position: sticky; top: 0; z-index: 5; margin-left: -1rem; margin-right: -1rem;
              padding: 9px 1rem; border-radius: 0; border-bottom: 1px solid var(--line-2); }
}
ul.grocery-items { list-style: none; padding: 0; margin: 0; }

/* a row: [Have] [name + provenance] [Need] — flat, hairline-separated.
   The flex layout lives on .grocery-item itself (and on .swipe-content,
   which the controller wraps the row's children into on touch). */
.grocery-item { margin: 0; }
.grocery-zone .grocery-item, .swipe-content { display: flex; align-items: center; gap: 11px; padding: 9px 4px;
                         background: var(--paper); border-bottom: 1px solid var(--line); }
.grocery-item form { margin: 0; }
.gx-have-form { flex: 0 0 auto; display: flex; }
.gx-act { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.gx-have, .gx-need, .gx-got { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; padding: 0; cursor: pointer;
                              display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-2);
                              background: var(--card); transition: background .14s, border-color .14s, color .14s, transform .08s; }
.gx-have, .gx-got { color: var(--olive); }
.gx-need { color: var(--clay); }
/* Hover tint only on a true hovering pointer (mouse). On touch, a swap
   moves the tapped row to its zone and a *different* row's button slides
   under the finger — a sticky :hover there would leave the following
   item's button highlighted (see CLAUDE.md / grocery swap). */
@media (hover: hover) {
  .gx-have:hover, .gx-got:hover { border-color: var(--olive); background: var(--olive-tint); }
  .gx-need:hover { border-color: var(--clay); background: var(--clay-tint); }
}
.gx-have:active, .gx-need:active, .gx-got:active { transform: scale(.9); }

/* the tap-to-expand main content (native <details>) */
details.row { min-width: 0; flex: 1 1 auto; }
details.row > summary { cursor: pointer; list-style: none; }
details.row > summary::-webkit-details-marker { display: none; }
details.row .line { font-size: 16px; line-height: 1.3; color: var(--ink); }
details.row .line .name { font-weight: 500; }
details.row .line .qty { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--clay-deep); margin-right: 7px; }
.gx-from { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12px; color: var(--muted); max-width: 100%; }
.gx-from .chev { transition: transform .18s; flex: 0 0 auto; }
details.row[open] .gx-from .chev { transform: rotate(90deg); }
/* lowercase: some cookbook recipe titles are stored ALL-CAPS, which
   out-shouted the item names at a glance; folded to a consistent
   quiet caption instead. */
.gx-from .src { font-style: italic; text-transform: lowercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grocery-item.purchased details.row .line .qty, .grocery-item.purchased details.row .line .name { text-decoration: line-through; color: var(--muted); }

/* expanded body — provenance (with recipe links), qty override, remove */
.row-body { margin: 8px 0 10px; display: flex; flex-direction: column; gap: 12px; }
.gx-prov { margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line-2); list-style: none; display: flex; flex-direction: column; gap: 9px; }
.gx-prov li { line-height: 1.35; }
.gx-prov a { color: var(--ink-soft); text-decoration: none; font-style: italic; font-size: 13px; }
.gx-prov a:hover { color: var(--clay-deep); text-decoration: underline; }
.gx-prov a svg { vertical-align: -2px; margin-left: 3px; opacity: .5; }
.gx-prov .raw-text { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }
.gx-prov .via-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); background: var(--paper-2); padding: 0 0.35rem; border-radius: var(--r-pill); margin-left: 4px; }
.gx-prov .missing { color: var(--muted); font-style: italic; font-size: 13px; }
.gx-prov .manual-note { color: var(--muted); font-style: italic; font-size: 13px; }
.row-body .gx-aisle-note { margin: 0.1rem 0 0; font-size: 12px; color: var(--muted); }
.row-body .gx-aisle-note .matched { font-style: italic; }
.row-body .qty-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
.row-body .qty-form input { padding: 0.35rem 0.5rem; font: inherit; color: var(--ink); background: var(--card);
                            border: 1px solid var(--line-2); border-radius: var(--r-md); width: 8rem; }

/* "Move to a different aisle" — the per-row override of a wrong auto-match.
   Mirrors .qty-form; the select carries the matched candidates + every
   store aisle. The Move button is the JS-off fallback (Stimulus auto-submits
   on change), hidden once the controller connects ([data-mode] is set). */
.row-body .gx-aisle-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0; }
.row-body .gx-aisle-pick .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.row-body .gx-aisle-pick select { padding: 0.35rem 0.5rem; font: inherit; color: var(--ink); background: var(--card);
                                  border: 1px solid var(--line-2); border-radius: var(--r-md); max-width: 100%; }
.grocery-page[data-mode] .gx-aisle-pick .gx-aisle-go { display: none; }

/* Store picker — which Wegmans store the whole list is shopped at. Mirrors
   .gx-aisle-pick; the "Switch" button is the JS-off fallback (Stimulus
   auto-submits on change), hidden once the controller connects. */
.gx-store { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.1rem 0 0.7rem; }
.gx-store .gx-store-lbl { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono);
                          font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.gx-store select { padding: 0.35rem 0.5rem; font: inherit; color: var(--ink); background: var(--card);
                   border: 1px solid var(--line-2); border-radius: var(--r-md); max-width: 100%; }
.grocery-page[data-mode] .gx-store .gx-store-go { display: none; }

/* make-or-buy — from-scratch components (sub-recipes the add expands)
   surfaced on the add-time review page (.gx-review): the add POST
   renders it instead of the straight 302 when components exist, so the
   "would you rather just buy this?" decision happens before anything
   lands on the list. */
ul.gx-comps { list-style: none; margin: 0; padding: 0; }
.gx-comp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.gx-comp-main { flex: 1 1 230px; min-width: 0; }
.gx-comp-name { font-family: var(--font-serif); font-size: 17px; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.25; }
.gx-comp-name:hover { color: var(--clay-deep); }
.gx-comp-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.gx-comp-sub .n { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; }
.gx-comp-sub .ai { color: var(--ai); }
.gx-comp-sub .for { font-style: italic; text-transform: lowercase; }
.gx-comp-seg { flex: 0 0 auto; }

.gx-review { max-width: 560px; margin: 0 auto; padding: 8px 0 24px; }
.gx-review .cs-title { margin: 6px 0 10px; }
.gx-review-lede { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.5; }
.gx-review-lede strong { color: var(--ink); }
.gx-review .gx-comps { border-top: 1px solid var(--line); }
/* sticky: a stacked week can run to a dozen-plus components, and the
   one primary action shouldn't scroll away with them. Opaque paper so
   rows slide under, not through. */
.gx-review-foot { display: flex; align-items: center; gap: 12px; position: sticky; bottom: 0;
                  background: var(--paper); border-top: 1px solid var(--line); padding: 13px 0; }

/* swipe-to-delete (touch only): a short left-swipe reveals Delete (tap
   to confirm); a long one past the commit line deletes on release (iOS
   Mail). .commit darkens the track to signal "release to delete". */
.swipe-only { display: none; }
.grocery-page[data-swipe="on"] .swipe-only { display: block; }
/* Touch reveals Delete on swipe, so the expanded "Remove from list"
   button would be redundant — hide it. The form stays in the DOM (it's
   what the swipe-revealed Delete submits); only the button is hidden. */
.grocery-page[data-swipe="on"] .row-body .remove-form { display: none; }
.grocery-page[data-swipe="on"] .grocery-item[data-swipeable] { position: relative; overflow: hidden; padding: 0; border-bottom: 0; touch-action: pan-y; }
/* swipe-content is the flex row once the controller wraps the children;
   it must fill the .grocery-item so .row-actions' margin-left:auto has
   free space to absorb — otherwise it shrinks to content width and the
   right-hand buttons sit ragged wherever each row's text ends. */
.swipe-content { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
.swipe-content.snap { transition: transform 0.2s cubic-bezier(.3,.7,.3,1); }
.swipe-track { position: absolute; inset: 0; z-index: 0; display: flex; align-items: stretch; justify-content: flex-end;
               background: var(--clay); opacity: 0; transition: opacity .12s; }
.grocery-item.swiping .swipe-track, .grocery-item[data-swipe-open] .swipe-track { opacity: 1; }
.grocery-item.commit .swipe-track { filter: brightness(0.85); }
.swipe-track button { border: none; background: none; color: #fff8f1; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
                      letter-spacing: .03em; padding: 0 22px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }

/* drawers: In the cart / Already have it */
details.grocery-bought, details.grocery-have { margin: 14px 0 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
details.grocery-bought > summary, details.grocery-have > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
                      justify-content: space-between; padding: 12px 15px; background: var(--paper-2); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
details.grocery-bought > summary::-webkit-details-marker, details.grocery-have > summary::-webkit-details-marker { display: none; }
details.grocery-bought > summary::after, details.grocery-have > summary::after { content: ""; border-left: 0.35rem solid var(--muted);
                      border-top: 0.25rem solid transparent; border-bottom: 0.25rem solid transparent; transition: transform .18s; }
details.grocery-bought[open] > summary::after, details.grocery-have[open] > summary::after { transform: rotate(90deg); }
details.grocery-bought .admin-body, details.grocery-have .admin-body { padding: 2px 15px 6px; }
details.grocery-bought .grocery-item, details.grocery-have .grocery-item { display: flex; align-items: center; gap: 11px;
                      padding: 8px 0; border-bottom: 1px solid var(--line); }
details.grocery-bought .grocery-item:last-child, details.grocery-have .grocery-item:last-child { border-bottom: none; }
details.grocery-bought .grocery-item details.row, details.grocery-have .grocery-item details.row { flex: 1; }
details.grocery-bought .line, details.grocery-have .line { font-size: 14px; color: var(--muted); }
.grocery-item.purchased .line .qty { color: var(--muted); }
.row-static { display: block; min-width: 0; flex: 1; }
.btn-state, .btn-check { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 5px 11px;
                         border: 1px solid transparent; border-radius: var(--r-pill); background: transparent; color: var(--clay-deep); white-space: nowrap; }
.btn-state:hover, .btn-check:hover { background: var(--clay-tint); }
/* Pin the right-hand action (Need / Got it / drawer recovery) to the
   right edge. margin-left:auto rather than relying on the <details>
   middle column growing — iOS Safari doesn't honor flex-grow on a
   <details> flex item, so the buttons would otherwise sit ragged
   wherever each row's text ends. */
.grocery-item .row-actions { margin-left: auto; }
.row-actions { display: flex; gap: 0.3rem; align-items: center; }

/* undo snackbar (lives on <body>, survives the controller's swap) */
.gx-undo { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 60; background: var(--ink); color: #fff;
           border-radius: var(--r-pill); padding: 9px 10px 9px 16px; display: flex; align-items: center; gap: 14px;
           box-shadow: 0 8px 30px rgba(40,28,12,.28); font-size: 13.5px; white-space: nowrap; animation: gxpop .22s ease; }
.gx-undo .tag { width: 8px; height: 8px; border-radius: 50%; }
.gx-undo button { font: inherit; font-size: 13px; font-weight: 700; color: #f3c4a8; background: rgba(255,255,255,.1);
                  border: none; border-radius: var(--r-pill); padding: 6px 13px; cursor: pointer; }
@keyframes gxpop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* finish / empty states */
.gx-finish { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; }
.gx-finish .ring { width: 64px; height: 64px; border-radius: 50%; background: var(--olive-tint); color: var(--olive);
                   display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.gx-finish .gx-fin-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; margin-bottom: 7px; }
.gx-finish p { font-size: 14.5px; color: var(--ink-soft); max-width: 260px; margin: 0 auto 22px; }
.gx-finish form { margin: 0; }

/* PWA offline/sync banner + provisional (queued-offline) rows */
.sync-status { margin: 0 0 1rem; padding: 0.5rem 0.75rem; border-radius: var(--r-md); font-size: 0.9rem; color: #6b4e0e;
               background: var(--ai-tint); border: 1px solid rgba(166,121,26,0.40); }
.grocery-item.provisional { opacity: 0.8; }
.grocery-item.provisional .swipe-content { border-bottom-style: dashed; }
.grocery-item.pending-sync { opacity: 0.5; transition: opacity 0.1s ease; }
.sync-badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); background: var(--paper-2);
              padding: 0 0.4rem; border-radius: var(--r-pill); margin-left: 0.35rem; }

.grocery-page[data-mode="triage"] [data-zone="shopping"] { display: none; }
.grocery-page[data-mode="shopping"] [data-zone="triage"] { display: none; }

/* desktop: two-column aisles + a touch more room; snackbar drops to the corner */
@media (min-width: 721px) {
  .gx-aisles { column-count: 2; column-gap: 44px; }
  /* Keep a whole aisle — its mono header plus every item — in one
     column. A single break-inside guard on the header+list wrapper is
     honored far more reliably than break-after on the header paired
     with break-inside on the list, which let the header strand at the
     foot of a column with its items flowing into the next. */
  .gx-aisle-group { break-inside: avoid; margin-bottom: 6px; }
  .gx-undo { bottom: 26px; }
}

/* ============================================================
   PIN DOCK (.pt-*): recipes "on the counter" while cooking
   several dishes at once. Hop between pinned recipes without
   losing checked-ingredient state; each chip shows checked/total
   so the kept state is visible before you jump. A fixed shelf
   along the viewport foot — always in thumb reach, follows every
   page (a top-of-recipe tab strip and a collapsed floating pill
   lost in the design lab on reachability / taps-per-hop). It is
   also the app's whole chrome: its launcher sheet carries all
   navigation + account actions, so there is no top header or tab
   bar. Feature doc + deferred ideas: docs/PINNED_RECIPES.md
   ============================================================ */

/* ---- shared chip: a navigable area (serif title + mono progress) and a
   trailing × that unpins straight from the dock ---- */
.pt-chip { display: inline-flex; align-items: stretch; min-width: 0; max-width: 270px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--card); flex: 0 0 auto; overflow: hidden; }
.pt-chip:hover { border-color: var(--ink); }
.pt-chip-nav { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0;
  padding: 6px 5px 6px 13px; text-decoration: none; }
.pt-chip .ttl { font-family: var(--font-serif); font-size: 14.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-chip .ct { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.pt-chip .ct.done { color: var(--olive); }
.pt-chip-x-form { display: flex; margin: 0; }
.pt-chip-x { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border: none; background: none; cursor: pointer; color: var(--muted); padding: 0 9px 0 5px; }
.pt-chip-x:hover { color: var(--clay-deep); }

/* ---- the leading pin toggle for the current recipe (the dock is the sole
   pin control — the recipe page has no Pin button) ---- */
.pt-pin { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--card); color: var(--ink-soft); cursor: pointer; }
.pt-pin:hover { border-color: var(--ink); color: var(--ink); }
.pt-pin.is-pinned { background: var(--clay-tint); border-color: rgba(176,84,47,0.35); color: var(--clay-deep); }
.pt-pin-form { display: flex; margin: 0; flex: 0 0 auto; }

/* the empty-counter invitation, shown in the chip lane on a recipe page
   with nothing pinned yet */
.pt-empty { align-self: center; font-size: 13.5px; color: var(--muted); padding-left: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- the universal nav launcher + its sheet ----
   The leading control on every page at every size: a grid button (labelled
   "Menu" where there's room) opening the app's only navigation surface — a
   bottom sheet on mobile, a popover above the launcher on desktop. Native
   <details>, so it works with JS off. */
.pt-menu { display: flex; flex: 0 0 auto; position: relative; }
.pt-launch { list-style: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-2);
  border-radius: var(--r-pill); background: var(--card); color: var(--ink-soft); cursor: pointer; }
.pt-launch .lbl { font-family: var(--font-sans); font-size: 14px; font-weight: 500; }
.pt-launch:hover { border-color: var(--ink); color: var(--ink); }
.pt-launch::-webkit-details-marker, .pt-launch::marker { display: none; content: ""; }
/* position: relative so the z-index actually takes effect — a static element
   ignores z-index, which let the full-screen scrim paint over the launcher and
   swallow the re-tap that natively closes the <details>. Lifted above the
   scrim, the launcher stays the bright, tappable "close me" control. */
.pt-menu[open] .pt-launch { position: relative; z-index: 60; background: var(--clay-tint);
  border-color: rgba(176,84,47,0.35); color: var(--clay-deep); }
/* cursor: pointer is load-bearing on iOS Safari: tapping a plain <div> only
   synthesizes a click event when it (or an ancestor) is cursor:pointer, so
   without this the scrim's tap-to-dismiss silently never fires on a phone. */
.pt-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(34,29,22,0.28);
  cursor: pointer; }
.pt-sheet { position: fixed; left: 0; right: 0; z-index: 60;
  bottom: calc(60px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-md); padding: 6px 10px 14px; }
/* The grip is a real close button, not decoration: it reads as draggable, so
   the obvious tap on it dismisses the sheet. A full-width 26px hit strip
   carries a centered 36×4 bar (drawn by ::before) so the target is thumb-sized
   while the visual stays a thin handle. */
.pt-sheet .grip { display: block; width: 100%; height: 26px; padding: 0; border: none;
  background: none; cursor: pointer; position: relative; }
.pt-sheet .grip::before { content: ""; position: absolute; left: 50%; top: 50%;
  width: 36px; height: 4px; margin: -2px 0 0 -18px; border-radius: 999px;
  background: var(--line-2); }
.pt-sheet .pt-sheet-h { display: block; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 6px; }
.pt-sheet .pt-sheet-item, .pt-sheet-clear button { display: flex; align-items: center; gap: 15px;
  width: 100%; padding: 13px 12px; color: var(--ink); text-decoration: none; border: none;
  background: none; font: inherit; font-size: 16px; border-radius: var(--r-md); cursor: pointer;
  text-align: left; }
.pt-sheet .pt-sheet-item:active, .pt-sheet-clear button:active { background: var(--paper-2); }
.pt-sheet .pt-sheet-item.is-active { color: var(--clay-deep); }
.pt-sheet .cs-ic { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.pt-sheet .pt-sheet-item.is-active .cs-ic { color: var(--clay); }
.pt-sheet-clear { margin: 0; }
.pt-sheet-clear button { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }

/* The account section (Admin / Log out) — always present: the dock's sheet
   is the only home for these now that there is no top header. */
.sheet-account { margin-top: 4px; border-top: 1px solid var(--line); }

/* Desktop: the sheet becomes a popover anchored above the launcher (a
   full-width bottom sheet is too heavy on a wide screen); drop the
   bottom-sheet grip and add hover feedback. */
@media (min-width: 641px) {
  .pt-sheet { left: 16px; right: auto; width: 290px; max-width: calc(100vw - 32px);
    bottom: 62px; border: 1px solid var(--line); border-radius: 14px; }
  .pt-sheet .grip { display: none; }
  .pt-sheet .pt-sheet-h { padding-top: 8px; }
  .pt-sheet .pt-sheet-item, .pt-sheet-clear button { font-size: 15px; padding: 11px 12px; }
  .pt-sheet .pt-sheet-item:hover, .pt-sheet-clear button:hover { background: var(--paper-2); }
}

/* room for the fixed dock above the page foot (the dock is on every page
   for a logged-in user) */
body.has-pin-dock main { padding-bottom: 6rem; }

/* ---- the dock: a slim translucent-paper shelf along the viewport foot,
   on every page at every size.

   The translucent blur lives on a .pt-dock::before layer, NOT on .pt-dock
   itself: backdrop-filter would make .pt-dock the containing block for its
   position:fixed descendants (the nav scrim + sheet), pinning them to the
   dock's ~60px strip instead of the viewport — so the scrim couldn't cover
   the screen and tap-outside-to-dismiss broke (see docs/PINNED_RECIPES.md).

   env(safe-area-inset-*) keeps the bar clear of the iOS home indicator +
   bottom-corner arc (0 on non-notched screens, so the max() falls back to
   the plain padding; viewport-fit=cover in the layout makes the insets
   live). ---- */
.pt-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 49;
  display: flex; align-items: center; gap: 12px;
  padding: 9px max(16px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); }
.pt-dock::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(247,243,236,0.94); backdrop-filter: blur(8px); }
.pt-dock .pt-chips { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; padding: 1px 26px 1px 1px;
  /* right-edge fade = "more chips this way"; it only bites when a chip
     actually reaches the edge, so short rows render untouched */
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent); }
.pt-dock .pt-chips::-webkit-scrollbar { display: none; }

@media (max-width: 640px) {
  .pt-dock { gap: 8px;
    padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  /* the launcher collapses to an icon-only 46px tap target (label hidden) */
  .pt-launch { width: 46px; height: 46px; padding: 0; }
  .pt-launch .lbl { display: none; }
  .pt-pin { width: 46px; height: 46px; }
  /* kitchen thumbs: hold the 44px tap-target floor */
  .pt-chip { max-width: 230px; }
  .pt-chip-nav { padding: 12px 6px 12px 15px; }
  .pt-chip-x { padding: 0 14px 0 8px; }
  body.has-pin-dock main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}
