:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2a2420;
  --muted: #776c62;
  --border: #e8e0d6;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fdeee4;
  --cook1: #c2410c;
  --cook1-soft: #fdeee4;
  --cook2: #a3294f;
  --cook2-soft: #fbe6ec;
  --minimal: #2563a8;
  --minimal-soft: #e3eefb;
  --low: #2f7d4f;
  --low-soft: #e5f4ea;
  --medium: #a66300;
  --medium-soft: #fdf1da;
  --high: #9b1c45;
  --high-soft: #fbe6ec;
  --ok: #2f7d4f;
  --ok-soft: #e5f4ea;
  --danger: #b42318;
  --danger-soft: #fdecea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #221e1b;
    --text: #efe8e1;
    --muted: #a99d92;
    --border: #3a332d;
    --accent: #f08a4b;
    --accent-hover: #f6a676;
    --accent-soft: #3b2418;
    --cook1: #f08a4b;
    --cook1-soft: #3b2418;
    --cook2: #ee7a9e;
    --cook2-soft: #3d1a27;
    --minimal: #7fb2f0;
    --minimal-soft: #16263b;
    --low: #6fcf97;
    --low-soft: #183025;
    --medium: #f2b84b;
    --medium-soft: #3a2c12;
    --high: #f27a9b;
    --high-soft: #3d1a25;
    --ok: #6fcf97;
    --ok-soft: #183025;
    --danger: #ff8a7a;
    --danger-soft: #3d1e19;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg);
       color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; line-height: 1.25; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--surface);
          border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 17px; color: var(--text); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); }
.topbar nav a.active, .topbar nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.writer-status { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.writer-status.error { color: var(--danger); }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.banner { padding: 10px 24px; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.error-text { color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
                          border-radius: 6px; padding: 7px 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.num { width: 70px; }
label { display: inline-flex; align-items: center; gap: 6px; }
details > summary { cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; padding: 7px 14px; border-radius: 6px;
       border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.big { padding: 11px 20px; font-size: 16px; font-weight: 600; }
.btn:disabled { opacity: 0.5; cursor: default; }

.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent;
           border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
.spinner.big { width: 22px; height: 22px; border-width: 3px; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Effort colours, used everywhere a meal shows up */
.effort-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; }
.effort-minimal { --tone: var(--minimal); --tone-soft: var(--minimal-soft); }
.effort-low { --tone: var(--low); --tone-soft: var(--low-soft); }
.effort-medium { --tone: var(--medium); --tone-soft: var(--medium-soft); }
.effort-high { --tone: var(--high); --tone-soft: var(--high-soft); }
.effort-chip { background: var(--tone-soft); color: var(--tone); }
.legend { display: flex; gap: 6px; align-items: center; }

/* Calendar */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav h1 { min-width: 220px; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 24px; }
.cal-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 6px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-height: 118px; padding: 6px;
           display: flex; flex-direction: column; gap: 3px; position: relative; }
.cal-day.other-month { opacity: 0.45; }
.cal-day.past { background: transparent; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-date { font-weight: 700; color: var(--text); font-size: 13px; width: fit-content; }
.cal-meal { display: flex; gap: 5px; align-items: baseline; font-size: 12px; padding: 2px 6px; border-radius: 5px;
            background: var(--tone-soft); color: var(--text); border-left: 3px solid var(--tone); line-height: 1.3; }
.cal-meal:hover { text-decoration: none; filter: brightness(0.97); }
.slot-letter { font-weight: 800; color: var(--tone); }
.cal-meal-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A meal you've cooked: a green tick at the end of its chip (and the tick alone is what a phone's small chip shows). */
.cooked-mark { flex: none; align-self: center; margin-left: auto; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
               background: var(--ok); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.cooked-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cooked-key .cooked-mark { margin-left: 0; }
.cooked-tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.cal-add { position: absolute; top: 4px; right: 6px; color: var(--muted); font-weight: 700; opacity: 0; }
.cal-day:hover .cal-add { opacity: 1; }
@media (max-width: 760px) {
  .calendar { gap: 3px; }
  .cal-day { min-height: 80px; padding: 3px; }
  .cal-meal-title { display: none; }
  .month-nav h1 { min-width: 0; font-size: 19px; }
}


/* Day page */
.slot-card h2 { margin-bottom: 12px; }
.effort-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pick { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.pick input { margin: 0; }
.pick:has(input:checked) { border-color: var(--tone, var(--text)); background: var(--tone-soft, var(--bg)); color: var(--tone, var(--text)); font-weight: 600; }
.slot-recipe { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }

/* Recipe */
.recipe-head h1 { font-size: 30px; margin: 6px 0; }
.lead { font-size: 17px; margin: 0 0 12px; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); }
.facts strong { color: var(--text); }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.lesson { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.lesson h2 { font-size: 21px; margin: 4px 0 8px; }
.prose p { margin: 0 0 10px; }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .recipe-body { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.checklist label { align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 4px; }
.checklist label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.plain-list { padding-left: 18px; margin: 0; }
.plain-list.rows { list-style: none; padding: 0; }
.plain-list.rows li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin-bottom: 16px; }
.steps li::marker { font-weight: 800; color: var(--accent); }
.step-title { font-weight: 700; }
.steps p { margin: 4px 0; }
.tip { background: var(--medium-soft); border-radius: 6px; padding: 6px 10px; font-size: 14px; }

.waiting h1 { margin: 10px 0; display: flex; align-items: center; gap: 10px; }

/* Cook mode */
.cook-head { margin-bottom: 14px; }
.cook-head h1 { margin: 4px 0 10px; }
.cook-progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.cook-progress div { height: 100%; background: var(--accent); transition: width 0.3s; }
.cook-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .cook-layout { grid-template-columns: 1fr; } .cook-ingredients { order: 2; } }
.cook-step { min-height: 280px; }
.cook-step h2 { font-size: 24px; margin: 6px 0 12px; }
.cook-text { font-size: 20px; line-height: 1.6; }
.timer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--bg); }
.timer-display { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 110px; }
.timer.timer-done .timer-display { color: var(--danger); }

/* Skills */
.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Shopping */
.cart-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
            position: sticky; top: 8px; z-index: 2; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }
.cart-bar h1 { font-size: 21px; }
.cart-bar p { margin: 4px 0 0; }
.how ol { margin: 10px 0; padding-left: 20px; }
.grocery-list { list-style: none; padding: 0; margin: 0; }
.grocery { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.grocery.excluded { opacity: 0.5; }
.grocery .include input { width: 18px; height: 18px; margin-top: 3px; }
.product { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.paste { display: flex; gap: 6px; flex: 1; min-width: 260px; }
.paste input { flex: 1; min-width: 0; padding: 4px 8px; font-size: 13px; }
.buy { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.buy input { width: 60px; }
@media (max-width: 640px) { .grocery { flex-wrap: wrap; } .buy { margin-left: 30px; } }

/* Use soon */
.use-list { list-style: none; padding: 0; margin: 0; }
.use-list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.use-list li.claimed { opacity: 0.7; }
.use-by { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--medium-soft); color: var(--medium); margin-left: 6px; }
.use-by.urgent { background: var(--danger-soft); color: var(--danger); }
.uses-up { background: var(--low-soft); color: var(--low); border-radius: 6px; padding: 6px 10px; margin: 0 0 12px; }
.use-soon-cta { background: var(--low-soft); border-color: var(--low); }
.row.spread { justify-content: space-between; }

/* In-store list: tickable on a phone, printable on paper */
.store-list { border-color: var(--low); }
.store-list h2 { margin: 0; }
.store-items { list-style: none; padding: 0; margin: 8px 0 0; columns: 2 260px; }
.store-items li { break-inside: avoid; padding: 6px 0; }
.store-items label { align-items: flex-start; cursor: pointer; }
.store-items input { width: 18px; height: 18px; margin-top: 2px; }
.store-items label:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.print-only { display: none; }
@media print {
  .topbar, .banner, .no-print, .writer-status { display: none !important; }
  .print-only { display: block; font-size: 18px; margin-bottom: 8px; }
  body, .card { background: #fff; color: #000; }
  main { padding: 0; }
  .store-list { border: none; padding: 0; }
  .store-items { columns: 2; }
}
.on-hand { border-color: var(--low); background: var(--low-soft); }

/* Agenda: the calendar as a list of days, for phones */
.agenda { display: none; list-style: none; padding: 0; margin: 0 0 20px; }
.agenda-day { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 12px; }
.agenda-day.past { opacity: 0.55; }
.agenda-date { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; color: var(--text);
               padding: 4px 0; border-radius: 8px; }
.agenda-day.today .agenda-date { background: var(--accent); color: #fff; }
.agenda-wd { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.agenda-num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.agenda-meals { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.agenda-meals .cal-meal { font-size: 14px; padding: 8px 10px; }
.agenda-meals .cooked-mark { width: 18px; height: 18px; font-size: 12px; }
.agenda-plan { align-self: flex-start; font-size: 14px; font-weight: 600; padding: 6px 0; }

/* --- Phones ------------------------------------------------------------------
   The nav becomes a bottom tab bar, tap targets grow to at least 44px, inputs use 16px text so iPhones
   don't zoom in on them, and the things you reach for mid-task (Next step, Add to cart) stay at the bottom. */
@media (max-width: 760px) {
  main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { height: 50px; padding: 0 16px; flex-wrap: nowrap; gap: 12px; }
  .topbar nav {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; gap: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  }
  .topbar nav a { display: grid; place-items: center; min-height: 46px; padding: 4px 2px; font-size: 13px; font-weight: 600; }
  .writer-status { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .banner { padding: 10px 16px; }

  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; padding: 10px 16px; white-space: normal; justify-content: center; text-align: center; }
  .btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }
  .btn.big { width: 100%; }
  h1 { font-size: 22px; }
  .card { padding: 14px; }
  .row > label { flex: 1 1 140px; }
  .row > label input { flex: 1; min-width: 0; }

  /* Calendar: the agenda replaces the grid. */
  .calendar { display: none; }
  .agenda { display: block; }
  .legend { display: none; }
  .month-nav h1 { min-width: 0; flex: 1; text-align: center; font-size: 20px; }
  .month-nav { width: 100%; }

  /* Day page and recipe */
  .pick { padding: 10px 14px; }
  .recipe-head h1 { font-size: 24px; }
  .checklist li { padding: 10px 0; }
  .checklist input { width: 20px; height: 20px; }

  /* Cook mode: no tab bar; Back / Next stay under your thumb. */
  body.cooking .topbar nav { display: none; }
  body.cooking main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cook-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; margin: 0; flex-wrap: nowrap;
              padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface);
              border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06); }
  .cook-nav .btn { flex: 1; min-height: 52px; font-size: 17px; }
  .cook-nav .muted { display: none; }
  .cook-step { min-height: 0; }
  .cook-step h2 { font-size: 21px; }
  .cook-text { font-size: 19px; }
  .timer { flex-wrap: wrap; }

  /* Shopping: the cart button stays at the bottom, above the tab bar. */
  .cart-bar { position: static; box-shadow: none; }
  .cart-bar [data-cart-link] { position: fixed; z-index: 15; left: 12px; right: 12px; width: auto;
                               bottom: calc(70px + env(safe-area-inset-bottom)); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
  body:has([data-cart-link]:not([hidden])) main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .grocery .include input { width: 22px; height: 22px; }
  .store-items { columns: 1; }
  .store-items li { padding: 10px 0; }
  .store-items input { width: 22px; height: 22px; }
  .paste { min-width: 0; flex-basis: 100%; }
  .paste input { font-size: 16px; padding: 8px 10px; }
  input[type=checkbox] { flex: none; }  /* next to long text, flex would squeeze them narrow */
}


/* "I have this" on grocery items, and the Already have list */
.have-btn { color: var(--muted); }
.store-items li { display: flex; align-items: flex-start; gap: 8px; }
.store-items li label { flex: 1; min-width: 0; }
.have-list { list-style: none; padding: 0; margin: 0; }
.have-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 640px) { .buy { flex-wrap: wrap; } }
.calendar-hint { margin: -6px 0 12px; }

/* Adjust a recipe */
.adjust label { display: block; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
        background: var(--bg); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.adjusted-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .chip { padding: 8px 14px; font-size: 14px; } .adjust .row .btn { width: 100%; } }

/* Calendar: days are clickable, meals draggable */
.cal-day[data-day] { cursor: pointer; }
.cal-day[data-day]:hover { border-color: var(--accent); }
.cal-meal[draggable="true"] { cursor: grab; }
.cal-meal.dragging { opacity: 0.4; }
.cal-day.drop-here { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* Recipe page: the rewrite and move options sit under Adjust */
.adjust .rewrite { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.adjust .rewrite summary { cursor: pointer; }
.adjust .rewrite form { margin-top: 10px; }
.plan-it .row { gap: 10px; }
.plan-it p { margin: 10px 0 0; }

/* Recipe library */
.search { padding: 12px; }
.plan-banner { background: var(--accent-soft); border-color: var(--accent); }
.recipe-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.recipe-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.recipe-card-main { color: var(--text); flex: 1; }
.recipe-card-main:hover { text-decoration: none; }
.recipe-card-main:hover h2 { color: var(--accent); }
.recipe-card h2 { font-size: 17px; margin: 6px 0 4px; }
.recipe-card p { margin: 0; }
.add-recipe { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.add-recipe > label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-weight: 600; }
.add-recipe textarea { width: 100%; resize: vertical; }
@media (max-width: 760px) { .recipe-cards { grid-template-columns: 1fr; } .search .btn { flex: 1; } .plan-it .btn { width: 100%; } }

/* Day page: retry a meal's recipe */
.retry-toggle { align-self: flex-start; margin-top: 6px; }
.retry-form { border-color: var(--accent); }
.retry-form p { margin: 4px 0 10px; }
.retry-form label.check { margin-top: 10px; color: var(--muted); }
/* Shopping: staples are on the list, just tagged */
.staple { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--medium-soft); color: var(--medium); }
.on-hand summary { cursor: pointer; }
.on-hand .have-list { margin-top: 8px; }
.danger-text { color: var(--danger); }
.list-top { margin-bottom: 12px; }
.plain-list.rows li { align-items: center; }

/* Rating out of 10 */
.rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.rating-prompt { font-weight: 600; }
.rating-scale { display: flex; gap: 4px; flex-wrap: wrap; }
.rate { font: inherit; font-weight: 700; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
        background: var(--bg); color: var(--muted); cursor: pointer; }
.rate:hover, .rating-scale:hover .rate:hover { border-color: var(--accent); color: var(--accent); }
.rate.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rate.picked { background: var(--accent); color: #fff; }
.rating-value { font-weight: 800; color: var(--accent); }
.rating-badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px;
                background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.done-step .rating { border-top: none; padding-top: 0; }
.skip-rating { margin-top: 10px; }
@media (max-width: 760px) {
  .rating-scale { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; gap: 6px; }
  .rate { width: 100%; height: 44px; font-size: 16px; }
}

/* Editing in cook mode */
.step-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.step-editor textarea, .step-note textarea, .cook-notes textarea { width: 100%; resize: vertical; margin-bottom: 8px; }
.step-editor textarea { font-size: 18px; line-height: 1.5; }
.step-note { margin-top: 12px; }
.step-note label, .cook-notes label { display: block; margin-bottom: 4px; }
.cook-notes { margin: 16px 0 12px; }
.ingredient-editor { display: flex; flex-direction: column; gap: 8px; }
.ingredient-editor p { margin: 0; }
.ing-head, .ing-row { display: grid; grid-template-columns: 58px 58px minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 4px; align-items: center; }
.ing-row input { min-width: 0; padding: 6px 6px; font-size: 14px; }
.your-note { background: var(--accent-soft); border-radius: 6px; padding: 6px 10px; font-size: 14px; }
.your-notes { border-left: 4px solid var(--accent); }
.your-notes p { white-space: pre-wrap; margin: 0 0 8px; }
@media (max-width: 760px) {
  .ing-head { display: none; }
  .ing-row { grid-template-columns: 64px 64px minmax(0, 1fr) 44px; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .ing-row input[name=prep] { grid-column: 1 / 4; }
  .ing-row input { font-size: 16px; }
  .step-tools .btn { flex: 1; }
}

/* Day page: people and keywords only matter for meals you're cooking */
.slot-card:has(input[name^="effort_"][value=""]:checked) .meal-options { display: none; }
.meal-options { display: flex; flex-direction: column; gap: 10px; }
.keywords { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-weight: 600; font-size: 14px; }
.keywords input { font-weight: normal; }
.choose-saved { display: inline-block; margin-top: 10px; }

/* Use soon: pseudo used = in a planned meal that isn't cooked yet */
.pseudo { border-color: var(--medium); }
.pseudo h2 { color: var(--medium); }
.use-list li.past-meal { background: var(--medium-soft); border-radius: 6px; padding-left: 8px; padding-right: 8px; }
.past-note { color: var(--medium); }
@media (max-width: 760px) { .pseudo .use-list li { flex-wrap: wrap; } .pseudo .use-list form { width: 100%; } .pseudo .use-list form .btn { flex: 1; } }

/* Day page: a meal switched off remembers its recipe */
.restore { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 10px;
           border-radius: 8px; background: var(--bg); border: 1px dashed var(--border); }

/* Day page: the "try a different recipe" box opens inside the meal's card */
.retry-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.retry-panel p { margin: 0 0 8px; }
.retry-panel label.check { margin-top: 8px; color: var(--muted); }
.slot-recipe { gap: 4px; }

/* --- Cook mode: all steps | the step you're on | ingredients. Without room for three columns (a half-width
   window, a tablet, a phone) the step list and ingredients become drawers that pop open from the buttons up top. */
.cook-head .row.spread { align-items: center; }
.cook-layout { grid-template-columns: 250px minmax(0, 1fr) 300px; }
.cook-outline, .cook-ingredients { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
.drawer-btn, .drawer-close { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.35); }
.drawer.open { transform: none !important; }
/* The Ask panel is always a drawer. */
.ask-panel, .drawer-right.ask-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100vw);
  max-height: none; margin: 0; border-radius: 0; display: flex; flex-direction: column; transform: translateX(105%);
  transition: transform 0.2s ease; box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15); }
.ask-panel .drawer-close { display: inline-flex; }
@media (max-width: 1179px) {
  .cook-layout { grid-template-columns: minmax(0, 1fr); }
  .drawer-btn, .drawer-close { display: inline-flex; }
  .cook-outline, .cook-ingredients { position: fixed; top: 0; bottom: 0; z-index: 40; width: min(380px, 90vw); max-height: none;
    margin: 0; border-radius: 0; transition: transform 0.2s ease; box-shadow: 0 0 24px rgba(0, 0, 0, 0.15); }
  .drawer-left { left: 0; transform: translateX(-105%); }
  .drawer-right { right: 0; transform: translateX(105%); }
}

/* Every step at a glance */
.outline { list-style: none; padding: 0; margin: 0; }
.outline li { padding: 6px 8px; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.outline li.current { border-color: var(--accent); background: var(--accent-soft); }
.outline-title { all: unset; box-sizing: border-box; display: flex; gap: 8px; align-items: baseline; width: 100%; cursor: pointer;
                 font-weight: 600; font-size: 14px; }
.outline-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.outline-title:hover .grow { color: var(--accent); }
.outline-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px;
               background: var(--bg); border: 1px solid var(--border); }
.outline li.current .outline-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.outline li.past .outline-num { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.outline-text { margin: 4px 0 0 30px; font-size: 13px; color: var(--muted); }

/* --- Cook controls, shared by solo and two cooks ------------------------------------------------ */
/* One size of pill button, with an icon and a word. */
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px;
        border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
        font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill[aria-expanded=true], .pill[aria-pressed=true]:not([data-alerts-toggle]) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill.off { color: var(--muted); border-style: dashed; }
.pill.has-note .pill-label::after { content: " •"; color: var(--accent); }
.pill-icon { font-size: 15px; line-height: 1; }
.pill.drawer-btn { display: none; }
.pill.more { padding: 6px 12px; position: relative; font-size: 16px; }
.pill .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cook-tools { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1179px) { .pill.drawer-btn { display: inline-flex; } }

/* Alert sounds: browsers keep a page silent until it's been tapped, and this says so. */
.sound-banner { background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; text-align: center;
                padding: 6px 12px; border-bottom: 1px solid var(--border); }

/* Timers: the Timers button opens a popover with presets; every running timer stays in a strip. */
.timer-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
.timer-strip:not(:has(.timer-chip)) { display: none; }
.cook-layout ~ .timer-strip { position: static; }
.timer-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.timer-chip { display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 999px; font-size: 14px;
              background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }
.timer-chip .chip-time { font-size: 17px; font-variant-numeric: tabular-nums; min-width: 3.2em; }
.timer-chip.paused { border-color: var(--border); }
.timer-chip.ringing { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1s infinite; }
.timer-chip.ringing .btn { color: #fff; }
.timer-chip .btn.small { padding: 2px 8px; min-height: 0; }
.timer-chip { max-width: 100%; }
.timer-chip .chip-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-chip .chip-add { padding: 5px 10px; min-height: 30px; font-weight: 700; white-space: nowrap; flex: none; }
.timer-chip.ringing .chip-add { background: #fff; border-color: #fff; color: var(--danger); }
.task-timer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cook-head { position: relative; }
.timer-pop { position: absolute; z-index: 50; right: 0; top: calc(100% + 6px); width: min(340px, calc(100vw - 24px)); padding: 12px;
             border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
             display: flex; flex-direction: column; gap: 10px; }
.timer-pop-title { font-weight: 800; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .chip { min-height: 38px; padding: 6px 14px; font-size: 14px; font-weight: 600; background: var(--surface); cursor: pointer; }
.new-timer { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.new-timer .num { width: 4.5em; }
.new-timer input[name=label] { flex: 1; min-width: 8em; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* Ask the chef: one per panel (solo's drawer, or a side's pop-out). */
.chef-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chef-panel > p { margin: 0 0 6px; }
.ask-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.ask-msg { padding: 8px 12px; border-radius: 14px; max-width: 90%; white-space: pre-wrap; line-height: 1.45; }
.ask-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.chef { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ask-msg.thinking { color: var(--muted); font-style: italic; }
.ask-form textarea { width: 100%; resize: none; margin-bottom: 8px; }
.ask-form p { margin: 6px 0 0; }
.mic-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1s infinite; }
label.check { display: inline-flex; gap: 6px; align-items: center; }

/* What a step or task uses, at the bottom of its card. */
.step-uses { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.uses-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.uses-amount { display: inline-block; min-width: 5.5em; font-variant-numeric: tabular-nums; }
.uses-prep { font-size: 13px; }

/* --- Two cooks ----------------------------------------------------------------------------------- */
.duo-badge { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft);
             color: var(--accent); vertical-align: middle; }
/* The two cooks are paprika and raspberry, both warm; one cook (solo) is paprika. */
.lane-1 { --lane: var(--cook1); --lane-soft: var(--cook1-soft); }
.lane-2 { --lane: var(--cook2); --lane-soft: var(--cook2-soft); }
.duo-intro p { max-width: 70ch; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg a { display: block; padding: 5px 12px; font-size: 13px; }
.seg a { color: var(--text); text-decoration: none; }
.seg a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.seg label + label span, .seg > * + * { border-left: 1px solid var(--border); }
.seg input:checked + span, .seg .on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Solo or two cooks, beside Start cooking on the recipe page, and in the ▾ panel of both cook screens. */
.cook-start { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cook-start .seg span { padding: 8px 14px; font-size: 14px; }
.who-switch span, .who-switch a { padding: 6px 14px; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-task-timer] { font-variant-numeric: tabular-nums; }
[data-task-timer].running { border-color: var(--accent); color: var(--accent); }

/* With a plan the screen is an app of its own: the site's header goes, and the cook screen takes the full height. */
body.duo-screen .topbar { display: none; }
body.duo-screen main { max-width: none; padding: 0; }
.duo-app .timer-strip { padding: 6px 12px 0; }
.duo-app { position: relative; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }

/* The thin bar: the shared clock, the schedule in thin form, and the shared tools. The ▾ opens the plan's description. */
.duo-bar { position: relative; flex: none; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); padding: 2px 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.bar-back { font-size: 22px; line-height: 1; padding: 4px 6px; }
.bar-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 20vw; }
.bar-clock { display: flex; align-items: center; gap: 8px; flex: none; }
.clock-time { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-time .muted { font-weight: 600; font-size: 15px; }
.bar-lanes { flex: 1; min-width: 140px; }
.bar-tools { display: flex; gap: 6px; flex: none; }
.bar-switch { display: none; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 3px; }
.lane-line { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: center; }
.lane-name { font-size: 11px; font-weight: 700; color: var(--lane); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-track { position: relative; height: 10px; background: var(--bg); border-radius: 3px; }
.bar { position: absolute; top: 1px; bottom: 1px; background: var(--lane); border-radius: 3px; box-shadow: 0 0 0 1px var(--surface); }
.bar.hands-free { background: repeating-linear-gradient(135deg, var(--lane) 0 4px, var(--lane-soft) 4px 8px); }
.bar[data-state=done] { opacity: 0.3; }
.bar[data-state=now] { box-shadow: 0 0 0 2px var(--text); }
.bar[data-state=late] { box-shadow: 0 0 0 2px var(--danger); }
.timeline-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); border-radius: 1px; left: calc(var(--p, 0) * 1%); }
.bar-panel { position: absolute; z-index: 25; top: 100%; left: 0; right: 0; max-height: 70vh; overflow: auto; padding: 14px 16px 16px;
             background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18); }
.bar-panel > * { max-width: 900px; }
.duo-summary { margin: 0 0 12px; font-size: 16px; }
.panel-timeline .lane-track { height: 22px; }
.panel-timeline .lane-line { grid-template-columns: 84px minmax(0, 1fr); }
.panel-timeline .lane-name { font-size: 13px; }
.panel-timeline .timeline { gap: 6px; margin: 8px 0 14px; }
.panel-timeline .bar { top: 3px; bottom: 3px; border-radius: 4px; }
.duo-plan-time, .panel-view, .panel-actions, .panel-who { margin-top: 10px; gap: 10px; align-items: center; }
.panel-tools { display: none; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.panel-actions form { margin: 0; }

/* Who's who, before you start. */
/* It sits under the bar, so the schedule stays in view while you pick; the sides themselves wait until you have. */
.chooser { flex: 1; min-height: 0; overflow: auto; padding: 24px; background: var(--bg); }
.chooser:not([hidden]) ~ .duo-lanes { display: none; }
.chooser-inner { max-width: 1100px; margin: 0 auto; }
.chooser-inner h1 { margin-bottom: 4px; }
.chooser-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.choose-card { display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--lane, var(--border)); }
.choose-card h2 { margin: 0; font-size: 20px; }
.choose-card p { margin: 0; }
.choose-card .btn.big { margin-top: auto; }
.choose-card .btn.primary { background: var(--lane); border-color: var(--lane); }
.choose-card .btn.primary:hover { background: var(--lane); filter: brightness(0.9); }
/* Both on one screen is the other way to answer, not a third cook: it sits by the heading, where it can't be missed. */
.chooser-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.chooser-top .btn { flex: none; }
.name-field { display: flex; align-items: center; gap: 8px; }
.level { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; }
.level-easy { background: var(--low-soft); color: var(--low); }
.level-medium { background: var(--medium-soft); color: var(--medium); }
.level-hard { background: var(--high-soft); color: var(--high); }

/* The two sides. Each is a full-height card for the task you're on, with its own pop-outs. */
.duo-lanes { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.duo-app[data-view="1"] .duo-lanes, .duo-app[data-view="2"] .duo-lanes { grid-template-columns: minmax(0, 1fr); }
.lane { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface);
        border: 1px solid var(--border); border-top: 5px solid var(--lane); border-radius: 12px; }
.lane.flash { animation: pulse 0.7s 5; }
.lane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px 0; }
.lane-who { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.name-select, .name-input { font: inherit; font-size: 18px; font-weight: 800; color: var(--lane, var(--text)); background: transparent;
                            border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; max-width: 12em; cursor: pointer; }
.name-select:hover, .name-select:focus, .name-input { border-color: var(--border); background: var(--bg); }
.lane-role { color: var(--muted); font-weight: 600; font-size: 14px; }
.lane-count { white-space: nowrap; }
.lane-tools { display: flex; gap: 6px; padding: 8px 14px; flex-wrap: wrap; }
/* The part of a side that holds the step, with the pop-outs laid over just it (not over the timers or the buttons below). */
.lane-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lane-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 14px 10px; }
/* This cook's timers: big, and right above Back / Done / Next so they're always in sight. */
.lane-timers { flex: none; container-type: inline-size; display: flex; flex-direction: column; gap: 8px; padding: 8px 14px 10px;
               max-height: 46%; overflow-y: auto; border-top: 1px solid var(--border); }
.lane-timers:empty { display: none; }
.timer-chip.big { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 6px 8px 6px 18px; border-radius: 16px;
                  border: 3px solid var(--lane, var(--accent)); box-shadow: none; }
.timer-chip.big .bt-text { display: flex; flex-direction: column; flex: 1 1 auto; }
.timer-chip.big .chip-label { font-size: 15px; font-weight: 600; color: var(--muted); max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-chip.big .chip-time { font-size: clamp(44px, 13cqw, 92px); line-height: 1.02; font-weight: 800; white-space: nowrap; color: var(--lane, var(--accent)); }
/* The four buttons are a two-by-two block beside the digits (so a half-width side keeps room for big numbers), or one row where
   there's room. */
.timer-chip.big .bt-actions { display: grid; grid-template-columns: auto auto; gap: 6px; flex: none; }
.timer-chip.big [data-chip-toggle] { grid-column: 1; grid-row: 1; }
.timer-chip.big .bt-remove { grid-column: 2; grid-row: 1; }
.timer-chip.big [data-chip-add="60"] { grid-column: 1; grid-row: 2; }
.timer-chip.big [data-chip-add="300"] { grid-column: 2; grid-row: 2; }
.timer-chip.big .bt-btn { min-height: 44px; padding: 6px 16px; font-size: 17px; font-weight: 700; white-space: nowrap; }
@container (min-width: 760px) {
  .timer-chip.big .bt-actions { display: flex; gap: 8px; }
  .timer-chip.big .bt-btn { min-height: 48px; padding: 8px 20px; }
}
/* A phone's side is too narrow for digits and buttons side by side: the buttons become one row under the digits. */
@container (max-width: 480px) {
  .timer-chip.big { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 10px 8px 14px; }
  .timer-chip.big .bt-actions { display: flex; gap: 6px; }
  .timer-chip.big .bt-btn { flex: 1 1 auto; padding: 6px 8px; font-size: 16px; }
  .timer-chip.big .bt-remove { flex: 0 0 auto; }
}
.timer-chip.big.paused { border-color: var(--border); }
.timer-chip.big.paused .chip-time { color: var(--muted); }
.timer-chip.big.ringing { background: var(--danger); border-color: var(--danger); animation: ringglow 1s infinite; }
.timer-chip.big.ringing .chip-label, .timer-chip.big.ringing .chip-time { color: #fff; }
.timer-chip.big.ringing .bt-btn { background: #fff; border-color: #fff; color: var(--danger); }
/* More than one on a side: each a little smaller, and three or more smaller still; the box scrolls rather than eating the step. */
.lane-timers:not([data-count="1"]) .timer-chip.big .chip-time { font-size: clamp(34px, 9cqw, 60px); }
.lane-timers:not([data-count="1"]) .timer-chip.big .bt-btn { min-height: 40px; padding: 4px 14px; }
.lane-timers:not([data-count="1"]):not([data-count="2"]) .timer-chip.big .chip-time { font-size: clamp(28px, 6cqw, 40px); }
.lane-timers:not([data-count="1"]):not([data-count="2"]) .timer-chip.big { padding-top: 2px; padding-bottom: 2px; }
@keyframes ringglow { 50% { box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.35); } }
.lane .card { border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0; box-shadow: none; }
.task-card, .countdown, .lane-empty { flex: 1; display: flex; flex-direction: column; }
.task-card h2 { font-size: clamp(21px, 1.8vw, 28px); margin: 4px 0 10px; }
.task-card .cook-text { font-size: clamp(17px, 1.4vw, 23px); line-height: 1.55; margin: 0 0 8px; }
.task-card .eyebrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.task-status { font-weight: 800; color: var(--muted); text-transform: none; letter-spacing: 0; }
.task-card[data-state=now] .task-status { color: var(--lane); }
.task-card[data-state=soon] .task-status { color: var(--medium); }
.task-card[data-state=late] .task-status { color: var(--danger); }
.task-card[data-state=done] .task-status { color: var(--ok); }
.task-card .tip { margin: 8px 0; }
.task-timer { margin: 8px 0; }
/* What the step uses stays pinned to the bottom of the card while a long instruction scrolls above it. */
.task-card .step-uses { position: sticky; bottom: 0; margin-top: auto; padding-bottom: 8px; max-height: 38vh; overflow-y: auto; background: var(--surface); }
.browse-pill { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; align-self: flex-start;
               background: var(--medium-soft); color: var(--medium); font-size: 13px; font-weight: 600; }
.countdown { align-items: center; justify-content: center; text-align: center; gap: 4px; }
.cd-time { font-size: clamp(64px, 10vw, 150px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--lane); }
.countdown h2 { font-size: clamp(20px, 2vw, 28px); margin: 8px 0 0; }
.countdown .btn { margin-top: 12px; }
.lane-empty { align-items: center; justify-content: center; text-align: center; }
.lane-nav { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.lane-nav .btn { flex: 1; min-height: 54px; font-size: 17px; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.lane-nav [data-lane-done] { flex: 2; }
.lane[data-state=late] .lane-nav [data-lane-done] { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Pop-outs open inside the side that opened them, so the other cook carries on. */
.lane-pop { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); }
.pop-head { display: flex; justify-content: space-between; align-items: center; }
.pop-head h3 { margin: 0; font-size: 16px; }
/* The whole list is shown, never cut short, and scrolls in this box (the step you're on is scrolled to when it opens). */
.lane-pop .outline-scroll, .solo-steps .outline-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.outline-group + .outline-group { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.outline-group-head { margin: 0 0 6px 12px; font-size: 14px; font-weight: 800; color: var(--lane); }
.outline-group-head .muted { font-weight: 600; }
.outline-title.static { cursor: default; }
.outline-title.static:hover .grow { color: inherit; }
.lane-pop textarea[data-lane-note] { flex: 1; min-height: 120px; width: 100%; resize: none; font-size: 17px; }
.lane-outline li { margin-bottom: 2px; }
.lane-outline li.current { border-color: var(--lane); background: var(--lane-soft); }
.lane-outline li.current .outline-num { background: var(--lane); border-color: var(--lane); color: #fff; }
.lane-outline li.done .outline-num { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.lane-outline li.done .outline-title .grow { text-decoration: line-through; color: var(--muted); }
.lane-pop .outline-title, .solo-steps .outline-title { font-size: 18px; gap: 12px; align-items: center; }
.lane-pop .outline-num, .solo-steps .outline-num { width: 30px; height: 30px; font-size: 14px; }
.lane-pop .outline li, .solo-steps .outline li { padding: 10px 12px; }
.lane-pop .outline-text, .solo-steps .outline-text { margin-left: 42px; font-size: 16px; line-height: 1.5; }
.lane-pop .outline-title .small, .solo-steps .outline-title .small { font-size: 14px; }
/* A timer step you can leave running: a striped tag, as its stripes in the bar. */
.wait-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px;
            color: var(--lane); border: 1px solid var(--lane); background: repeating-linear-gradient(135deg, var(--lane-soft) 0 4px, transparent 4px 8px); }
.lane-outline li.focus { box-shadow: inset 0 0 0 2px var(--lane); }

.duo-finish { position: fixed; z-index: 45; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px));
              box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.duo-app .cook-ingredients { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(380px, 92vw); max-height: none; margin: 0;
                             border-radius: 0; overflow-y: auto; transform: translateX(105%); transition: transform 0.2s ease;
                             box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15); }
.duo-app .drawer-close { display: inline-flex; }

/* One cook: the same screen with a single side, across the whole width. */
.solo-app .cook-step { min-height: 0; }
.solo-app .bar { min-width: 4px; }
/* The left half: every step, always up. On a phone it goes, and the Steps button's pop-out stands in for it. */
.solo-steps .lane-head { padding-bottom: 6px; }
.solo-steps .outline-scroll { padding: 4px 10px 12px 14px; }
@media (max-width: 860px) { .solo-steps { display: none; } }
@media (min-width: 861px) { .solo-app [data-pop-open="steps"], .solo-app .lane-pop[data-pop="steps"] { display: none !important; } }
.solo-app .task-card h2 { margin-top: 4px; }
.solo-app .timer { background: var(--bg); }
.solo-app .step-tools { margin-top: 14px; }
.solo-app .panel-tools { margin-top: 0; margin-bottom: 10px; }

/* A phone: one side at a time (or both stacked), and a compact bar. */
@media (max-width: 860px) {
  .bar-title, .bar-tools .pill:not(.more), .clock-time .muted, .wide, .panel-view > span { display: none; }
  .bar-row { gap: 4px 8px; flex-wrap: wrap; padding-top: 4px; }
  .bar-lanes { order: 9; flex: 1 1 100%; min-width: 0; padding: 0 2px 6px; }
  .chooser-top .btn { width: 100%; }
  .bar-switch { display: inline-flex; flex: 1; min-width: 0; }
  .bar-switch label { flex: 1; min-width: 0; text-align: center; }
  .bar-switch span { padding: 6px 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar-tools { margin-left: 0; }
  .pill.more { padding: 6px 10px; }
  .panel-tools { display: flex; }
  .panel-view .seg { display: none; }
  .duo-lanes { grid-template-columns: minmax(0, 1fr); overflow-y: auto; padding: 8px; gap: 8px; }
  .duo-app[data-view="both"] .duo-lanes { grid-auto-rows: minmax(80dvh, auto); }
  .chooser { padding: 16px; }
  .chooser-cards { grid-template-columns: minmax(0, 1fr); }
  .lane-nav .btn { min-height: 50px; }
}

/* Day page: time limit */
.time-limit { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.time-limit select { font-weight: normal; }
.time-limit .check { font-weight: normal; }
.limit-fact strong { color: var(--accent); }

/* Recipe: drinks */
.drinks h2 { margin: 0; }
.drink-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.drink { padding: 12px; border-radius: 8px; background: var(--bg); }
.drink p { margin: 6px 0 0; }

/* Shopping: missing ingredients, where to spend more, and checking what you bought */
.missing { border-color: var(--danger); }
.missing h2 { color: var(--danger); }
.missing-list { list-style: none; padding: 0; margin: 0; }
.missing-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.missing-list li .row { gap: 6px; }
.upgrades { border-color: var(--medium); }
.upgrades h2 { color: var(--medium); }
.upgrade-list { list-style: none; padding: 0; margin: 0; }
.upgrade-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.upgrade-list strong { display: block; }
.upgrade-tip { display: block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: var(--medium-soft); color: var(--text); }
.upgrade-tip strong { color: var(--medium); }
.haul p { max-width: 80ch; }
.haul form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.paste-receipt { width: 100%; }
.paste-receipt textarea { width: 100%; margin-top: 8px; resize: vertical; font-family: ui-monospace, monospace; font-size: 13px; }
.notice { border-color: var(--medium); background: var(--medium-soft); }
.all-there { border-color: var(--ok); background: var(--ok-soft); }
.all-there h2 { color: var(--ok); margin: 0; }
.ok-text { color: var(--ok); }
.leftovers { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.leftover-head, .leftover { display: grid; grid-template-columns: 28px minmax(0, 2fr) minmax(0, 1.4fr) 150px; gap: 8px; align-items: center; }
.leftover { padding: 6px 0; border-bottom: 1px solid var(--border); }
.leftover input[type=checkbox] { width: 18px; height: 18px; }
.leftover input { min-width: 0; }
.leftover.shelf-stable:not(:has(input:checked)) { opacity: 0.6; }
.leftover-tip { grid-column: 2 / -1; margin: 0; }
@media (max-width: 640px) {
  .leftover-head { display: none; }
  .leftover { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); }
  .leftover input[type=date] { grid-column: 2 / -1; }
}

/* Recipe library: whole meals, or their parts to build a new meal from */
.library-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.switch a { padding: 7px 18px; font-weight: 700; font-size: 14px; color: var(--muted); }
.switch a:hover { text-decoration: none; color: var(--accent); }
.switch a.on { background: var(--accent-soft); color: var(--accent); }
.part-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.part-card { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.part-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.part-pick { display: grid; place-items: center; width: 28px; height: 28px; flex: none; cursor: pointer; }
.part-pick input { width: 20px; height: 20px; cursor: pointer; }
.part-main { min-width: 0; }
.part-main h2 { margin: 0 0 2px; font-size: 17px; }
.part-main p { margin: 0; }
.part-from { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A part's own steps: a dialog over the page, so long instructions get a readable width, its own scroll, and the grid under it never moves
   (opened inside a card, a real part's steps are 2,500 px tall and push the cards below out of sight). Looks like a recipe's Method. */
.part-steps-open { margin-top: 8px; min-height: 36px; padding: 5px 14px; font-size: 14px; }
.part-steps { width: min(640px, calc(100vw - 24px)); max-height: min(86vh, 900px); max-height: min(86dvh, 900px); padding: 0; overscroll-behavior: contain;
              scrollbar-color: var(--muted) var(--surface);  /* else the native scrollbar is a bright white strip down the dialog on a dark page (color-scheme doesn't change that) */
              border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.part-steps::backdrop { background: rgba(0, 0, 0, 0.5); }
.part-steps-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
                   padding: 14px 12px 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.part-steps-head .btn { flex: none; justify-content: center; min-width: 40px; min-height: 40px; font-size: 16px; }
.part-steps-head h3 { margin: 0 0 2px; font-size: 18px; }
.part-steps-head p { margin: 0; }
.part-steps .steps { margin: 0; padding: 16px 20px 20px 42px; }
.part-steps .steps p { margin: 4px 0; }
.parts-form { padding-bottom: 90px; }
.parts-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px;
             padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2); }
.parts-count { font-weight: 800; }
.parts-bar .num { width: 4.5em; }
.parts-bar input[name=request] { min-width: 14em; }
.built-from { margin: 4px 0 8px; }

/* How it went: the finish form, and a recipe's photos */
.finish-form { display: flex; flex-direction: column; gap: 12px; }
.finish-form .rating { margin-top: 0; padding-top: 0; border-top: none; }
.finish-note { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }  /* the base `label` rule centres; stretch keeps the caption on the left edge */
.finish-note textarea { width: 100%; resize: vertical; }
.finish-photos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.photo-previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.how-it-went h2 { margin-bottom: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dish-photo { position: relative; margin: 0; }
.dish-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.dish-photo form { position: absolute; top: 6px; right: 6px; margin: 0; }
.photo-remove { min-height: 0; padding: 2px 8px; background: rgba(0, 0, 0, 0.55); color: #fff; border-color: transparent; }
.recipe-thumb { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; display: block; }
.duo-finish { max-height: calc(100vh - 24px); overflow-y: auto; }

/* Plan several days: a grid of days by meals, one effort per meal */
.plan-intro { max-width: 760px; margin: -6px 0 16px; }
.plan-range .row { gap: 12px; }
.plan-quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 10px; }
.plan-cut { margin: 8px 0 0; }
.plan-fill .row { gap: 12px; align-items: flex-end; }
.plan-days { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
             margin-bottom: 18px; overflow: hidden; }
.plan-row { display: grid; grid-template-columns: 96px repeat(3, minmax(0, 1fr)) 108px; gap: 12px; align-items: start; padding: 10px 14px;
            border-bottom: 1px solid var(--border); }
.plan-row:last-child { border-bottom: none; }
.plan-header { background: var(--bg); padding-top: 8px; padding-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--muted);
               text-transform: uppercase; letter-spacing: 0.05em; }
.plan-row.today { background: var(--accent-soft); }
.plan-row.past { opacity: 0.6; }
.plan-date { padding-top: 6px; }
.plan-wd { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.plan-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan-slot { display: none; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.plan-cell select, .plan-cell input { width: 100%; min-width: 0; }
.plan-cell.chosen select { border-color: var(--tone); background: var(--tone-soft); color: var(--tone); font-weight: 600; }
.plan-cell .cal-meal { font-size: 13px; padding: 5px 8px; }
.plan-people { justify-self: end; font-size: 13px; color: var(--muted); }
.plan-people .num { width: 60px; }
.plan-people-text { display: none; }  /* the column heading says it; a phone has no heading row, so there it's shown */
.plan-options { display: flex; flex-direction: column; gap: 14px; }
.plan-note { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-weight: 600; font-size: 14px; }
.plan-note input { font-weight: normal; }
.plan-share { align-items: flex-start; gap: 10px; cursor: pointer; }
.plan-share input { margin-top: 4px; }
.plan-share span span { display: block; }
.plan-limits-note { margin-top: 10px; }
.plan-recent { margin-top: 28px; }
@media (max-width: 760px) {
  .plan-header { display: none; }
  .plan-row { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .plan-date { padding-top: 0; font-size: 16px; }
  .plan-cell { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 4px; }
  .plan-slot { display: block; }
  .plan-cell .plan-limit { grid-column: 2; }
  .plan-cell [data-keywords] { grid-column: 1 / -1; }
  .plan-cell select, .plan-cell input, .plan-people .num { min-height: 44px; }
  .plan-people { justify-self: start; }
  .plan-people-text { display: inline; }
}

/* A plan: its days, and the ingredients its recipes share */
.plan-sub { margin: 2px 0 0; }
.plan-note-card { margin-bottom: 14px; }
.plan-progress { margin: 0 0 12px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 20px; }
.shared-list { list-style: none; padding: 0; margin: 8px 0 0; }
.shared-list li { padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.shared-list li:last-child { border-bottom: none; }
.shared-once { margin-top: 12px; }
.plan-link { margin: -6px 0 14px; }

/* Saved, not written yet: a meal with no recipe asked for is an outline; marks show a bigger batch and a drink to go with it */
.cal-meal.draft { background: transparent; border: 1px dashed var(--tone); border-left: 3px solid var(--tone); }
.cal-meal.draft .cal-meal-title, .cal-meal.draft > span:not(.slot-letter):not(.chip-marks) { font-style: italic; }
.chip-marks { flex: none; align-self: center; display: inline-flex; gap: 3px; font-size: 11px; line-height: 1; color: var(--muted); }
.agenda-meals .chip-marks { font-size: 13px; }
@media (max-width: 760px) { .calendar .chip-marks { display: none; } }
.draft-strip { margin-bottom: 14px; }
.draft-plans { list-style: none; padding: 0; margin: 10px 0 0; }
.draft-plans li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.draft-plans form { margin-left: auto; }
.draft-facts { margin: 12px 0; padding-left: 20px; }
.draft-facts li { margin: 3px 0; }
.plan-write { margin-bottom: 14px; }

/* Day page: a bigger batch, and a drink with dinner */
.batch-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }   /* not .leftovers: the haul page has one */
.batch-pick select { font-weight: normal; }
.drink-pick { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.drink-pick select { font-weight: normal; }
.drink-pick input { font-weight: normal; min-width: 220px; }
.day-save-note { margin: 8px 0 0; max-width: 760px; }

/* Recipe page: leftovers in the facts line, and the drinks box's choices */
.leftover-fact { color: var(--muted); }
.drink-form .row { gap: 8px; margin-top: 8px; }
.drink-form p { margin: 0; }

/* Plan several days: a bigger batch and a drink inside a meal's cell, and the plans a long stretch is cut into */
.plan-extras { display: flex; gap: 6px; }
.plan-mini { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 11px; font-weight: 700; color: var(--muted);
             text-transform: uppercase; letter-spacing: 0.04em; }
.plan-mini select { font-size: 12px; padding: 4px 6px; text-transform: none; letter-spacing: 0; font-weight: normal; color: var(--text); }
.plan-cell[data-slot] .plan-extras[hidden], .plan-cell [data-drink-note][hidden] { display: none; }
.plan-stretch { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.plan-stretch > label { font-weight: 600; }
.plan-stretch select { font-weight: normal; }
.plan-row.stretch-start { box-shadow: inset 0 3px 0 var(--accent); }
.plan-row.stretch-start.plan-header { box-shadow: none; }
.plan-actions { gap: 12px; }
@media (max-width: 760px) {
  .plan-cell .plan-extras, .plan-cell [data-drink-note] { grid-column: 1 / -1; }
  .plan-mini select { min-height: 44px; font-size: 14px; }
  .plan-actions .btn.big { flex: 1 1 100%; }
}
