/* ============================================================
   helloPapa UI: the "The week in dishes" planner (docs/10 §4, Phase 2).
   A short quiz in segmented steps, then the week as cards, with swaps in a sheet.
   Link ui/tokens.css and ui/ui.css first (the sheet and its scrim live there).
   Tokens only, never a raw colour; every control is 48 px or more.
   ============================================================ */

/* ---------- the canvas: the week as a menu, the options beside it, the cook list under it ---------- */
.cv{max-width:1440px;margin:0 auto;padding:32px 32px 64px}
.cv-head h1{font-size:clamp(30px,4.4vw,48px);line-height:1.04;letter-spacing:-.04em;font-weight:800;margin:14px 0 10px}
.cv-head .sub{font-size:17px;color:var(--ink-2);max-width:40em;margin-bottom:20px}
.snap-k{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:6px}
.cv-acts{display:flex;flex-wrap:wrap;gap:8px}
.cv-grid{display:grid;grid-template-columns:300px minmax(0,1fr);gap:24px;align-items:start;margin-top:8px}
.cv-opts{position:sticky;top:80px;max-height:calc(100vh - 100px);overflow:auto;border-radius:var(--r-lg)}
.cv-box{background:var(--surface);border-radius:var(--r-lg);box-shadow:var(--shadow);padding:6px 18px 18px}
.cv-box>summary{display:flex;align-items:center;gap:10px;min-height:48px;font-weight:800;font-size:17px;cursor:pointer;list-style:none}
.cv-box>summary::-webkit-details-marker{display:none}
.cv-box>summary .icon{width:18px;height:18px}
.cv-sec{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.cv-sec h3{font-size:15px;font-weight:800;margin-bottom:10px}
.cv-sec h4,.cv-field h4{font-size:13px;font-weight:700;color:var(--ink-2);margin:12px 0 8px}
.cv-sec .chips{gap:6px}
.cv-sec .chip{padding:0 14px;font-size:14px}
.cv-step{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-weight:600}
.cv-goals{display:grid;grid-template-columns:1fr;gap:6px}
.cv-goal{display:flex;align-items:center;gap:8px;min-height:48px;padding:6px 10px;border-radius:var(--r-btn);background:var(--bg);font-weight:600;font-size:14px;text-align:left;line-height:1.2;border:2px solid transparent}
.cv-goal .icon{width:18px;height:18px;flex:none}
.cv-goal[aria-checked="true"]{border-color:var(--accent)}
.cv-field .seg{flex-wrap:wrap;gap:2px}
.cv-field .seg>*{min-height:48px;flex:1 1 0;min-width:min-content;padding:6px 8px;text-align:center;line-height:1.2;font-family:var(--sans);font-size:14px;letter-spacing:0;text-transform:none}
.cv-field .seg>[aria-checked="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 10%,transparent)}
/* the menu card: seven days like a restaurant menu */
.cv-days{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:14px}
.cv-day{background:var(--surface);border-radius:var(--r-lg);box-shadow:var(--shadow);padding:14px 12px 10px;display:flex;flex-direction:column}
.cv-day.off{background:transparent;box-shadow:none;border:2px dashed var(--line-2)}
.cv-day-h{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px 8px;border-bottom:1px solid var(--line)}
.cv-day-h h2{font-size:20px;letter-spacing:-.02em;font-weight:800}
.cv-offp{padding:12px 4px;color:var(--ink-2);font-size:14px}
.cv-offp b{display:block;color:var(--ink);font-size:16px}
.cv-meals{list-style:none;margin:0;padding:0}
.cv-meals li+li{border-top:1px dotted var(--line-2)}
.cv-meal{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:56px;padding:8px 6px;text-align:left;border-radius:12px}
.cv-meal:hover,.cv-meal:focus-visible{background:var(--surface-2)}
.cv-ml{grid-column:1/-1;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.cv-dish{font-weight:700;font-size:15px;line-height:1.25;display:flex;align-items:center;gap:4px;min-width:0;overflow-wrap:anywhere}
.cv-meal.empty .cv-dish{color:var(--ink-3);font-weight:600}
.cv-meal.empty .cv-dish .icon{width:14px;height:14px}
.cv-meal.linked .cv-dish{color:var(--ink-2);font-style:italic}
.cv-meal.nobody{opacity:.55}
.cv-meta{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:12px;color:var(--ink-3)}
.cv-who{display:flex;gap:3px}
.cv-who i{font-style:normal;font-family:var(--mono);font-size:10.5px;font-weight:700;padding:2px 5px;border-radius:999px;background:var(--bg);color:var(--ink-2)}
.cv-who i.child{background:var(--herb-soft);color:var(--herb-text)}
.cv-por{font-family:var(--mono);font-weight:700;color:var(--ink-2)}
.cv-link{font-family:var(--mono)}
/* what you cook */
.cv-cook{margin-top:40px}
.cv-cook>h2{font-size:clamp(24px,3vw,32px);letter-spacing:-.03em;font-weight:800;margin-bottom:14px}
.cv-cooks{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:16px}
.cv-cookc h3{margin-top:4px}
.cv-ing summary{cursor:pointer;font-size:13.5px;color:var(--ink-2);min-height:48px;display:flex;align-items:center}
.cv-ing ul{margin:4px 0 0 18px;font-size:14px;line-height:1.55}
.sheet-k{font-size:13px;font-weight:700;color:var(--ink-2);margin:16px 0 8px;text-transform:uppercase;letter-spacing:.05em}
.alt.on{box-shadow:inset 0 0 0 2px var(--accent)}
.sheet-clear{margin-top:14px;width:100%}
@media (max-width:980px){.cv-grid{grid-template-columns:1fr}.cv-opts{position:static;max-height:none}.cv{padding:24px 20px 56px}}
@media (max-width:600px){.cv{padding:18px 12px 48px}.cv-days{grid-template-columns:1fr}.cv-acts{width:100%}.cv-acts .btn{flex:1 1 auto}}

/* ---------- options (one choice) ---------- */
.opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.opt{position:relative;display:grid;grid-template-columns:auto 1fr;gap:2px 16px;align-items:center;text-align:left;background:var(--surface);border:2px solid transparent;border-radius:var(--r-md);box-shadow:var(--shadow);padding:18px 52px 18px 20px;min-height:96px;transition:border-color var(--dur-fast) var(--ease)}
.opt:hover{border-color:var(--line-2)}
.opt[aria-checked="true"]{border-color:var(--accent)}
.opt .ic{grid-row:span 2;flex:none;width:52px;height:52px;border-radius:16px}
.opt .ic .icon{width:26px;height:26px}
.opt h3{font-size:18px;letter-spacing:-.02em;line-height:1.2;font-weight:800}
.opt p{grid-column:2;font-size:14px;line-height:1.4;color:var(--ink-2)}
.opt .tick{position:absolute;top:14px;right:14px;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;opacity:0;transform:scale(.6);transition:opacity var(--dur-fast) var(--ease),transform var(--dur-fast) var(--ease)}
.opt .tick .icon{width:14px;height:14px;stroke-width:3}
.opt[aria-checked="true"] .tick{opacity:1;transform:none}
.lvl{display:flex;gap:4px}
.lvl i{width:8px;height:8px;border-radius:50%;background:var(--line-2)}
.lvl i.on{background:var(--herb-text)}

/* ---------- chips (any number) and segmented choices ---------- */
.chip-h{font-size:16px;font-weight:700;margin:30px 0 12px}
.chip-h:first-of-type{margin-top:0}
.chips{display:flex;flex-wrap:wrap;gap:10px}
.chip{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 20px;border-radius:var(--r-pill);background:var(--surface);box-shadow:inset 0 0 0 1px var(--line-2);font-weight:600;font-size:15px}
.chip .icon{width:16px;height:16px;stroke-width:3;display:none}
.chip[aria-pressed="true"]{background:var(--inverse);color:var(--on-inverse);box-shadow:none}
.chip[aria-pressed="true"] .icon{display:block}
/* options share the row but never crop a word: long labels wrap between words, and if a word still cannot fit the row wraps */
.q .seg{max-width:560px;flex-wrap:wrap;gap:2px}
.q .seg>*{min-height:48px;flex:1 1 0;min-width:min-content;padding:6px 10px;text-align:center;line-height:1.2;font-family:var(--sans);font-size:15px;letter-spacing:0;text-transform:none}
@media (max-width:420px){.q .seg>*{font-size:14px;padding:6px 6px}}
.q .seg>[aria-checked="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 10%,transparent)}

/* ---------- the household stepper ---------- */
.stepper{display:flex;align-items:center;gap:22px;margin:6px 0 10px}
.stepper button{width:64px;height:64px;border-radius:50%;background:var(--surface);box-shadow:var(--shadow);display:grid;place-items:center;color:var(--ink)}
.stepper button .icon{width:26px;height:26px}
.stepper button[disabled]{opacity:.4}
.stepper .val{font-size:64px;font-weight:800;letter-spacing:-.04em;min-width:96px;text-align:center;font-variant-numeric:tabular-nums;line-height:1}
.stepper-sub{color:var(--ink-3);font-size:15px;margin-bottom:26px}

/* ---------- the week ---------- */
.tags{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 22px}
.tag{font-size:13.5px;font-weight:600;background:var(--herb-soft);color:var(--herb-text);border-radius:var(--r-pill);padding:7px 14px}
.sumrow{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 18px;background:var(--surface);border-radius:var(--r-md);box-shadow:var(--shadow);padding:12px 12px 12px 22px;margin-bottom:14px}
.sumrow b{font-size:22px;letter-spacing:-.02em;font-weight:800;font-variant-numeric:tabular-nums}
.sumrow .sums{font-size:16px;color:var(--ink-2)}
.ready-line{font-size:15px;color:var(--ink-2);margin-bottom:22px;max-width:46em}
.days{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:16px}
.day{display:flex;flex-direction:column;gap:14px;background:var(--surface);border-radius:var(--r-lg);box-shadow:var(--shadow);padding:20px}
.day.locked{box-shadow:inset 0 0 0 2px var(--accent),var(--shadow)}
.day .top{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:28px}
.day .top .mono{display:inline-flex;align-items:center;gap:8px}
.day .top .icon{width:16px;height:16px}
.day .main{display:flex;gap:16px;align-items:center}
.day .dish{width:76px;height:76px}
.day h3{font-size:19px;letter-spacing:-.02em;line-height:1.2;font-weight:800}
.day .why{font-size:13.5px;color:var(--ink-2);margin-top:6px;line-height:1.45}
.day .meta{display:flex;align-items:center;gap:6px;font-family:var(--mono);font-size:12px;color:var(--ink-3)}
.day .meta .icon{width:16px;height:16px}
.day .ctrl{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-top:auto}
.day .tools{display:flex;gap:6px}
.portion{display:flex;align-items:center;background:var(--bg);border-radius:var(--r-pill)}
.portion button{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;color:var(--ink-2)}
.portion button:hover{background:var(--surface-2)}
.portion button[disabled]{opacity:.4}
.portion span{min-width:50px;display:flex;align-items:center;justify-content:center;gap:5px;font-weight:800;font-variant-numeric:tabular-nums}
.portion span .icon{width:16px;height:16px;color:var(--ink-3)}
.pib{width:48px;height:48px;border-radius:var(--r-btn);display:grid;place-items:center;color:var(--ink-2);background:var(--bg)}
.pib:hover{background:var(--surface-2);color:var(--ink)}
.pib[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}
.day .btn{width:100%}
.day.off{background:transparent;box-shadow:none;border:2px dashed var(--line-2);align-items:flex-start;justify-content:center}
.day.off p{font-size:15px;color:var(--ink-2)}
.day.off p b{display:block;font-size:19px;letter-spacing:-.02em;color:var(--ink);margin-bottom:2px}
.day.off .btn{width:auto}
.notes{max-width:46em;margin-top:26px;font-size:13.5px;line-height:1.6;color:var(--ink-3)}
.notes p+p{margin-top:8px}

/* ---------- the swap sheet ---------- */
.sheet-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}
.sheet-h h3{margin:0}
.sheet-x{width:48px;height:48px;border-radius:var(--r-btn);display:grid;place-items:center;color:var(--ink-2);flex:none}
.sheet-x:hover{background:var(--surface-2);color:var(--ink)}
.alt{display:flex;gap:14px;align-items:center;width:100%;text-align:left;min-height:72px;padding:8px 10px;border-radius:16px}
.alt:hover,.alt:focus-visible{background:var(--surface-2)}
.alt .dish{width:56px;height:56px}
.alt h4{font-size:16px;font-weight:700;letter-spacing:-.01em;line-height:1.25}
.alt .why{font-size:13px;color:var(--ink-2)}
.alt .pr{margin-left:auto;font-family:var(--mono);font-size:12px;font-weight:600;color:var(--ink-2);white-space:nowrap}
.sheet-empty{padding:20px 6px;color:var(--ink-2);font-size:15px}

@media (max-width:600px){
  .opts{grid-template-columns:1fr}
  .stepper .val{font-size:56px}
  .q .sub{font-size:16px}
  .sumrow{padding:12px}
  .day{padding:16px}
}

/* ---------- canvas v2: covers, avatars, the people button, away meals ---------- */
.cv-day{overflow:hidden}
.cv-cover{margin:-14px -12px 10px;height:120px;background:var(--surface-2);display:grid;place-items:center;overflow:hidden}
.cv-cover img{width:100%;height:100%;object-fit:cover;display:block}
.cv-cover.art svg,.cv-cover.art .icon{width:84px;height:84px}
.cv-day.away{background:color-mix(in srgb,var(--surface) 70%,var(--bg))}
.cv-row{display:flex;align-items:stretch;gap:4px}
.cv-row .cv-meal{flex:1 1 auto;min-width:0}
.cv-row.empty .cv-dish .icon{width:20px;height:20px;color:var(--ink-3)}
.cv-row.is-away .cv-dish{color:var(--ink-2);font-weight:600}
.cv-row.is-away .cv-dish .icon,.cv-lk{width:14px;height:14px;flex:none}
.cv-row.linked .cv-dish{color:var(--ink-2);font-style:italic}
.cv-row.nobody{opacity:.55}
.cv-meta{font-size:12px;color:var(--ink-3)}
.cv-ppl{flex:none;min-width:48px;min-height:48px;align-self:center;display:grid;place-items:center;padding:0 4px;border-radius:999px}
.cv-ppl:hover,.cv-ppl:focus-visible{background:var(--surface-2)}
.cv-who{display:flex}
.cv-who .av+.av{margin-left:-8px}
.av{width:26px;height:26px;border-radius:50%;display:inline-grid;place-items:center;font-family:var(--mono);font-size:10px;font-weight:700;background:var(--bg);color:var(--ink-2);box-shadow:0 0 0 2px var(--surface);overflow:hidden;flex:none}
.av img{width:100%;height:100%;object-fit:cover}
.av.child{background:var(--herb-soft);color:var(--herb-text)}
.av.none .icon{width:14px;height:14px}
.chip .av{width:24px;height:24px;box-shadow:none}
.alt-row{display:flex;flex-wrap:wrap;gap:8px}
.alt-row .alt{width:auto;flex:1 1 140px}
.alt-col{display:flex;flex-direction:column;gap:4px}
.alt-s{min-height:56px}
.alt-s .ic{width:40px;height:40px;border-radius:12px;background:var(--bg);display:grid;place-items:center;flex:none}
.alt-s .ic .icon{width:20px;height:20px}
@media (max-width:360px){.cv-acts .btn{font-size:14px;padding-left:12px;padding-right:12px}}

/* quick entries, people names, the reuse prompt (week canvas polish) */
.cv-dish.cv-quick{font-style:italic;color:var(--ink-2)}
.cv-qform{display:flex;gap:8px;margin:4px 0 10px;min-width:0}
.cv-qform .cv-qin,.cv-fld input{flex:1;min-width:0;min-height:48px;padding:0 12px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit}
.cv-qform .btn{flex:none}
.cv-people{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.cv-person{display:flex;align-items:center;gap:10px;min-height:48px;padding:6px 10px;border-radius:12px;border:1px solid var(--line);background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer;min-width:0}
.cv-person span:not(.av){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cv-person .cv-pen{width:16px;height:16px;opacity:.6;flex:none}
.cv-mform{display:flex;flex-direction:column;gap:12px}
.cv-fld{display:flex;flex-direction:column;gap:4px;font-size:14px}
.cv-fld input{flex:none}
.av.emo{font-family:inherit;font-size:15px}
#swapSheet .sub{margin:0 0 12px}
