/* Day-Dot Kitchen Labels: recipes surfaces. Tokens and fonts come from scan.css; shared components (ink buttons, tape label,
   day dot, label paper, chips, action sheet, captions, empty states) come from
   kitchen.css (DESIGN.md). */

/* ---------- /recipes: recipe cards on the bench ---------- */
.rec { max-width: 1120px; color: var(--dd-ink); }
.rec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 4px 0 20px; }
.rec-title, .pln-title { margin: 0 0 6px; }
.rec-summary, .pln-lead { margin: 0; font-size: 1.12rem; color: var(--dd-ink-2); max-width: 56ch; text-wrap: pretty; }
.rec-rm-all, .rec .bag-btn, .pln .bag-btn, .cook-sheet .bag-btn { text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rec-rm-all { flex: none; }
.rec-state, .pln-state { max-width: 640px; }

.rec-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 22px; align-items: start; }
.rec-item { min-width: 0; }

/* The card: printed index-card stock (label surface, see scan.css). */
.rec-card { display: grid; gap: 14px; padding: 18px 20px 18px; color: var(--dd-ink); }
.rec-top { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1.5px solid var(--dd-rule); }
.rec-photo {
    position: relative; flex: none; display: grid; place-items: center; width: 92px; height: 92px; overflow: hidden;
    border: 1.5px solid var(--dd-ink); border-radius: 4px; background: var(--dd-hair); color: var(--dd-ink-2);
}
.rec-photo .lst-ico { width: 34px; height: 34px; }
.rec-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rec-who { flex: 1; min-width: 0; }
.rec-name { margin: 0 0 6px; font-family: var(--dd-cond); font-weight: 800; font-size: 1.6rem; line-height: 1.08; overflow-wrap: anywhere; text-wrap: balance; }
.rec-uses { margin: 0; font-size: 1.02rem; color: var(--dd-ink-2); }
.rec-uses b, .rec-need b, .rec-sum-n b, .pln-due-item b { font-family: var(--dd-cond); font-weight: 800; font-size: 1.2rem; color: var(--dd-ink); font-variant-numeric: tabular-nums; }
.rec-sep { margin: 0 2px; }
.rec-meta { margin: 4px 0 0; font-size: 0.95rem; color: var(--dd-ink-2); }

.rec-due .lst-cap { margin: 0 0 6px; }
.rec-due-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rec-due-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.rec-due-row .daydot { width: 30px; height: 30px; font-size: 0.64rem; letter-spacing: 0.02em; }
.rec-due-row .daydot--blank { border-width: 1.5px; }
.rec-due-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.rec-date { font-family: var(--dd-marker); font-size: 1.12rem; line-height: 1.1; white-space: nowrap; display: inline-block; transform: rotate(-1.5deg); }
.rec-late { font-family: var(--dd-cond); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dd-ink-2); }

/* Ingredients checklist: ticked = you have it, open box = you'd need to buy it. */
.rec-details summary {
    display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none;
    font-family: var(--dd-cond); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.rec-details summary::-webkit-details-marker { display: none; }
.rec-details summary:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; border-radius: 4px; }
.rec-sum-n { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; font-family: var(--dd-sans); font-size: 0.95rem; color: var(--dd-ink-2); }
.rec-details summary .lst-ico { transition: transform 0.15s; }
.rec-details[open] summary .lst-ico { transform: rotate(180deg); }
.rec-ings { list-style: none; margin: 0 0 4px; padding: 0; }
.rec-ing { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 2px 0; border-top: 1px solid rgba(29, 29, 29, 0.18); overflow-wrap: anywhere; }
.rec-ing > span:nth-child(2) { flex: 1; min-width: 0; }
.rec-ing--need > span:nth-child(2) { font-weight: 700; }
.rec-ing .lst-cap { flex: none; }
.rec-box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--dd-ink); border-radius: 4px; background: var(--dd-field); color: var(--dd-on-ink); }
.rec-box--on { background: var(--dd-ink); }
.rec-box .lst-ico { width: 18px; height: 18px; stroke-width: 2.5; }
.rec-need { margin: 0; color: var(--dd-ink-2); }

.rec-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rec-acts .bag-btn-ink { flex: 1 1 140px; }
.rec-acts .bag-btn-line { flex: 1 1 auto; }
.rec-acts .bag-btn:disabled { opacity: 0.55; cursor: default; }
.rec-rm { flex: 1 1 100%; display: inline-flex; align-items: center; justify-content: flex-start; text-decoration-thickness: 1.5px; }
.rec .lst-linkbtn:focus-visible, .rec .bag-btn:focus-visible, .pln .bag-btn:focus-visible, .cook-sheet button:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.rec .lst-linkbtn { display: inline-flex; align-items: center; }


/* ---------- The recipe view (sheet on phones, side panel on desktop) ---------- */
.lst-sheet.rec-view { display: flex; flex-direction: column; gap: 0; padding-bottom: 0; max-height: 94vh; max-height: 94dvh; overflow: hidden; }
.rec-view-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding-bottom: 14px; border-bottom: 1.5px solid var(--dd-rule); }
.rec-view-head .rec-photo { width: 72px; height: 72px; }
.rec-view-head .rec-name { font-size: 1.5rem; }
.rec-view-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 0 6px; display: grid; gap: 18px; align-content: start; }
.rec-view-body .lst-cap { margin: 0 0 4px; }
.rec-view-body .rec-ing:first-child { border-top: 0; }
.rec-ing .daydot { width: 28px; height: 28px; font-size: 0.6rem; letter-spacing: 0.02em; }
.rec-steps { margin: 0; padding: 0; list-style: none; counter-reset: rec-step; }
.rec-steps li { counter-increment: rec-step; position: relative; padding: 10px 0 10px 40px; border-top: 1px solid rgba(29, 29, 29, 0.18); line-height: 1.5; text-wrap: pretty; }
.rec-steps li:first-child { border-top: 0; }
.rec-steps li::before {
    content: counter(rec-step); position: absolute; left: 0; top: 8px; display: grid; place-items: center; width: 28px; height: 28px;
    border: 2px solid var(--dd-ink); border-radius: 50%; font-family: var(--dd-cond); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums;
}
.rec-view-acts {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
    border-top: 1.5px solid var(--dd-rule); background: var(--dd-tape);
}
.rec-view-acts .bag-btn { text-decoration: none; cursor: pointer; }
.rec-view-acts .bag-btn:focus-visible, .rec-view-acts .lst-linkbtn:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.rec-done { flex: 1 1 100%; min-height: 62px; padding: 8px 18px; text-align: left; justify-content: flex-start; }
.rec-done > span { display: grid; line-height: 1.1; }
.rec-done small { font-family: var(--dd-sans); font-weight: 500; font-size: 0.84rem; letter-spacing: 0; opacity: 0.85; }
@media (min-width: 900px) {
    .lst-sheet.rec-view { width: 500px; max-height: none; padding-bottom: 0; }
}

/* ---------- /planner: the form and the printed plan ---------- */
.pln { max-width: 760px; margin: 0; color: var(--dd-ink); }
.pln-head { margin: 4px 0 20px; }
.pln-paper, .pln-sheet { display: grid; gap: 16px; padding: 18px 20px 20px; color: var(--dd-ink); }
.pln-sheet { margin-top: 22px; gap: 4px; }
.pln-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pln-field legend { padding: 0; margin-bottom: 6px; }
.pln-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.pln-toggles .lst-chip { cursor: pointer; min-width: 52px; justify-content: center; }
.pln-toggles .lst-chip:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.pln-toggles .pln-days-btn b { font-size: 1.25rem; }
.pln .pln-input, .pln input.pln-input {
    width: 100%; min-height: 50px; padding: 0 12px; border: 1.5px solid var(--dd-ink); border-radius: 8px;
    background: var(--dd-field); color: var(--dd-ink); box-shadow: none; font-family: var(--dd-sans); font-size: 1rem; font-weight: 500;
}
.pln .pln-input::placeholder { color: var(--dd-placeholder); opacity: 1; }
.pln .pln-input:focus-visible { outline: 3px solid var(--dd-ink); outline-offset: 2px; }
.pln-go { width: 100%; cursor: pointer; }
.pln-go:disabled { opacity: 0.55; cursor: default; }
.pln-due { padding-bottom: 14px; border-bottom: 1.5px solid var(--dd-rule); }
.pln-due[hidden] { display: none; }
.pln-due .lst-cap { margin: 0 0 8px; }
.pln-due-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pln-due-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-height: 36px; }
.pln-due-item .daydot { width: 30px; height: 30px; font-size: 0.64rem; letter-spacing: 0.02em; }
.pln-due-item .daydot--blank { border-width: 1.5px; }

.pln-bar { height: 5px; overflow: hidden; border-radius: 3px; background: var(--dd-hair); margin-top: 10px; max-width: 320px; }
.pln-bar i { display: block; height: 100%; width: 40%; background: var(--dd-ink); border-radius: 3px; }
@media (prefers-reduced-motion: no-preference) {
    .pln-bar i { animation: pln-slide 1.3s var(--dd-ease) infinite; }
    @keyframes pln-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
}

.pln-sheet-title { margin: 0 0 6px; font-family: var(--dd-cond); font-weight: 800; font-size: 1.9rem; line-height: 1.05; text-transform: uppercase; }
.pln-sheet-title:focus { outline: none; }
.pln-days { list-style: none; margin: 0; padding: 0; }
.pln-day { padding: 14px 0 12px; border-top: 1.5px solid var(--dd-rule); }
.pln-day-head { display: flex; align-items: center; gap: 14px; }
.pln-day-head .daydot { width: 52px; height: 52px; font-size: 0.95rem; }
.pln-day-head .lst-cap { margin: 0 0 2px; }
.pln-meal { margin: 0; font-family: var(--dd-cond); font-weight: 800; font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; text-wrap: balance; }
.pln-uses { list-style: none; margin: 8px 0 0 66px; padding: 0; }
.pln-use { display: flex; align-items: center; gap: 12px; min-height: 38px; border-top: 1px solid rgba(29, 29, 29, 0.18); }
.pln-use-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pln-use--need .pln-use-name { font-weight: 500; color: var(--dd-ink-2); }
.pln-use .lst-cap { flex: none; }
.pln-use .rec-box { width: 22px; height: 22px; }
.pln-ideas { list-style: none; margin: 4px 0 8px; padding: 0; }
.pln-ideas li { padding: 10px 0 10px 22px; position: relative; border-top: 1px solid rgba(29, 29, 29, 0.18); line-height: 1.45; }
.pln-ideas li::before { content: ''; position: absolute; left: 0; top: 1.15em; width: 12px; height: 3px; border-radius: 2px; background: var(--dd-ink); transform: rotate(-3deg); }
.pln-idea-p { margin: 0 0 8px; line-height: 1.5; text-wrap: pretty; }
.pln-foot { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; border-top: 1.5px solid var(--dd-rule); margin-top: 4px; }
.pln-foot .bag-btn-ink { flex: 1 1 220px; }

/* ---------- The cook result (opened from Recipes and Use soon) ---------- */
.cook-sheet { max-width: 440px; padding: 20px 22px 20px; background: var(--dd-tape); color: var(--dd-ink); border: 1px solid rgba(29, 29, 29, 0.3); border-radius: 4px; font-family: var(--dd-sans); }
.cook-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cook-title { margin: 0; font-family: var(--dd-cond); font-weight: 800; font-size: 1.7rem; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere; }
.cook-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -8px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--dd-ink); cursor: pointer; }
.cook-x:hover { background: var(--dd-hover); }
.cook-x .lst-ico { width: 22px; height: 22px; }
.cook-sec { margin: 0 0 14px; }
.cook-sec .lst-cap { margin: 0 0 4px; }
.cook-list { list-style: none; margin: 0; padding: 0; }
.cook-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 7px 0; border-top: 1px solid rgba(29, 29, 29, 0.18); font-weight: 600; }
.cook-qty { font-weight: 500; color: var(--dd-ink-2); font-size: 0.95rem; }
.cook-qty b { font-family: var(--dd-cond); font-weight: 800; font-size: 1.1rem; color: var(--dd-ink); font-variant-numeric: tabular-nums; }
.cook-more { color: var(--dd-ink-2); font-weight: 500; }
.cook-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.cook-acts .bag-btn-ink { flex: 1 1 120px; }

@media (max-width: 760px) {
    .rec-title, .pln-title { font-size: 2.15rem; }
    .rec-head { align-items: flex-start; flex-direction: column; }
    .rec-card, .pln-paper, .pln-sheet { padding: 16px 14px 16px; margin: 0 -2px; }
    .rec-photo { width: 76px; height: 76px; }
    .rec-name { font-size: 1.4rem; }
    .pln-uses { margin-left: 0; }
    .pln-day-head .daydot { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .rec-details summary .lst-ico { transition: none; }
}
