/* Marche: original local artwork and system fonts, no external assets. */
:root {
  color-scheme: light dark;
  --bg: #FBF7EE;
  --surface: #FFFFFF;
  --ink: #1E2A22;
  --ink-muted: #56625A;
  --line: #7F897D;
  --accent: #2E7D32;
  --on-accent: #FFFFFF;
  --tomato: #C0392B;
  --on-tomato: #FFFFFF;
  --lemon: #F4C430;
  --on-lemon: #1E2A22;
  --ok-soft: #E3F1DC;
  --ok-ink: #1F5C26;
  --focus: var(--tomato);
  --attention-soft: var(--surface);
  --divider: var(--line);
  --shadow: none;
  --scrim: rgb(0 0 0 / 44%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}
@supports (color: color-mix(in srgb, black, white)) {
  :root {
    --divider: color-mix(in srgb, var(--line) 22%, var(--surface));
    --shadow: 0 8px 24px color-mix(in srgb, var(--ink) 4%, transparent);
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161A16;
    --surface: #1F251F;
    --ink: #F2F0E6;
    --ink-muted: #B4BDB1;
    --line: #6F7C6F;
    --accent: #7BC96F;
    --on-accent: #10200F;
    --tomato: #FF8A75;
    --on-tomato: #2A0E08;
    --lemon: #F4C430;
    --on-lemon: #1E2A22;
    --ok-soft: #25382A;
    --ok-ink: #BFE6B5;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-block: 1rem calc(210px + env(safe-area-inset-bottom, 0px)); }
body { margin: 0; min-width: 280px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { color: inherit; }
button, a { touch-action: manipulation; }
button, .button, input, select { min-height: 48px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: .22em; }
svg { width: 22px; height: 22px; flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  padding: 12px 20px;
  background: var(--surface);
  z-index: 10;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.shell { width: min(100%, 960px); margin-inline: auto; padding-inline: 16px; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar .shell { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-size: 25px; font-weight: 750; letter-spacing: -.06em; min-height: 48px; }
.brand-mark { display: grid; place-items: center; background: var(--lemon); color: var(--on-lemon); width: 35px; height: 35px; border-radius: 50% 50% 42% 42%; }
.top-note { color: var(--ink-muted); font-size: 13px; }
.page { padding-block: 24px 130px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-size: 14px; text-decoration: none; }
.eyebrow { margin: 0 0 8px; color: var(--ink-muted); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 32px; line-height: 38px; letter-spacing: -.025em; font-weight: 600; margin-bottom: 12px; text-wrap: balance; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 16px; }
h3 { font-size: 17px; line-height: 1.4; margin-bottom: 8px; }
.intro { color: var(--ink-muted); max-width: 48ch; margin-bottom: 24px; }
.page-heading { padding-block: 16px 4px; }
.section { margin-top: 24px; padding: 24px; border: 1px solid var(--divider); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.section-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.section-head h2 { margin-bottom: 4px; }
.section-head .count { color: var(--ink-muted); font-size: 13px; white-space: nowrap; }
.hint { font-size: 14px; color: var(--ink-muted); margin-bottom: 18px; }
.field { display: grid; gap: 7px; margin-top: 18px; min-width: 0; }
.field label, .field-label { font-size: 14px; font-weight: 650; }
.field small, .small { font-size: 13px; color: var(--ink-muted); }
input, textarea, select { width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 12px; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: 1; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row .field { margin-top: 16px; }
.unit-input { position: relative; }
.unit-input input { padding-inline-end: 49px; }
.unit-input span { position: absolute; inset-inline-end: 12px; inset-block-start: 13px; font-size: 14px; color: var(--ink-muted); pointer-events: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-weight: 650; line-height: 1.4; text-decoration: none; text-align: center; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.text { background: transparent; color: var(--ink); padding-inline: 0; }
.button.full { width: 100%; }
.button:disabled { background: var(--ok-soft); color: var(--ink-muted); border-color: var(--line); }
.icon-button { display: inline-grid; place-items: center; min-width: 48px; padding: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-md); color: var(--ink-muted); }
.ingredient-entry { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; margin-top: 12px; }
.ingredient-entry input { font-size: 16px; }
.notice { border: 1.5px solid var(--tomato); border-radius: var(--radius-md); padding: 14px; margin-top: 14px; background: var(--attention-soft); color: var(--tomato); font-size: 14px; }
.notice p { margin-bottom: 8px; }
.notice .button { min-height: 48px; color: var(--tomato); background: transparent; border-color: currentColor; padding: 8px 12px; font-size: 14px; }
.steps-editor { counter-reset: edit-step; display: grid; gap: 16px; }
.step-editor { counter-increment: edit-step; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.step-editor::before { content: counter(edit-step, decimal-leading-zero); color: var(--ink-muted); font-size: 14px; font-weight: 750; padding-top: 14px; }
.step-editor .field { margin: 0; }
.step-editor textarea { min-height: 108px; }
.optional { margin-top: 24px; padding-inline: 4px; }
.optional summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; font-weight: 650; }
.optional summary::after { content: "+"; font-size: 24px; font-weight: 400; }
.optional[open] summary::after { content: "-"; }
.optional summary::marker { content: ""; }
.actionbar { position: fixed; inset: auto 0 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 3; }
.actionbar .shell { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 84px; padding-block: 12px; }
.actionbar .button { flex: 1; }
.actionbar .small { max-width: 23ch; font-size: 13px; }
.prototype-note { margin-top: 24px; font-size: 13px; color: var(--ink-muted); text-align: center; }
.prototype-note a { display: inline-flex; align-items: center; min-height: 48px; }
.status-line { min-height: 24px; margin-block: 12px 0; font-size: 14px; color: var(--ink-muted); }
.recipe-heading { border-bottom: 1px solid var(--line); padding-block: 16px 24px; }
.recipe-heading .intro { margin-bottom: 20px; }
.badge { display: inline-block; padding: 5px 10px; border-radius: var(--radius-pill); background: var(--lemon); color: var(--on-lemon); font-size: 13px; font-weight: 650; }
.recipe-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.recipe-meta div { padding-inline-start: 12px; border-inline-start: 2px solid var(--line); }
.recipe-meta dt { font-size: 13px; color: var(--ink-muted); }
.recipe-meta dd { margin: 3px 0 0; font-size: 18px; font-weight: 650; }
.recipe-columns { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.recipe-columns .section { padding: 24px; }
.portion-note { font-size: 14px; color: var(--ink-muted); margin-bottom: 12px; }
.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li + li { border-top: 1px solid var(--line); }
.ingredient-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 64px; cursor: pointer; padding-block: 12px; }
.ingredient-check input { width: 22px; height: 22px; min-height: 22px; margin: 0; accent-color: var(--accent); }
.ingredient-check input:checked + span { text-decoration: line-through; color: var(--ink-muted); }
.ingredient-check strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.cooking-steps { list-style: none; counter-reset: cooking-step; padding: 0; margin: 24px 0 0; display: grid; gap: 24px; }
.cooking-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; counter-increment: cooking-step; }
.cooking-steps li::before { content: counter(cooking-step, decimal-leading-zero); color: var(--on-lemon); background: var(--lemon); border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; width: 28px; height: 28px; display: grid; place-items: center; }
.cooking-steps p { color: var(--ink-muted); margin-bottom: 0; }
.family-note { border-inline-start: 3px solid var(--lemon); padding-inline-start: 16px; margin-top: 24px; }
.family-note p { font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.5; margin-bottom: 8px; }
.family-note footer { font-size: 13px; color: var(--ink-muted); }
dialog { width: min(calc(100% - 32px), 460px); border: 1px solid var(--line); padding: 24px; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: var(--scrim); }
dialog h2 { font-size: 24px; }
dialog .button { margin-top: 12px; }

@media (hover: hover) {
  .button:not(:disabled):hover, .icon-button:hover { filter: brightness(.94); }
  .ingredient-check:hover { background: var(--bg); }
}
@media (max-width: 620px) {
  .shell { padding-inline: 16px; }
  .topbar .shell { min-height: 56px; }
  .brand { font-size: 24px; }
  .page { padding-top: 12px; }
  .section, .recipe-columns .section { padding: 20px 16px; border-radius: var(--radius-lg); }
  .recipe-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .recipe-meta { gap: 8px; }
  .recipe-meta div { padding-inline-start: 8px; }
  .recipe-meta dd { font-size: 16px; }
  .actionbar .shell { padding-inline: 16px; }
  .actionbar .small { max-width: 14ch; }
  .top-note { max-width: 14ch; text-align: right; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .icon-button { transition: filter .15s ease; }
}

/* Neutral secondary actions and explicit attention/success states. */
.topbar { border-color: var(--divider); }
.topbar a:not(.brand) { color: var(--ink-muted); font-size: 13px; }
.brand { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
.brand-mark svg { stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button.secondary { border-color: var(--line); }
.button.danger, #confirm-delete-meal, #discard-week { background: var(--tomato); color: var(--on-tomato); }
.notice a { color: inherit; }
.notice h2 { font-family: inherit; font-size: 19px; line-height: 26px; }
.section-head { flex-wrap: wrap; }
.status-line { color: var(--ink-muted); }
.badge { margin-block: 4px; }
.optional summary { gap: 12px; }
summary { min-height: 48px; cursor: pointer; }
.recipe-meta dd { font-variant-numeric: tabular-nums; }
.shopping-done { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--accent); }
.notice .button { background: transparent; color: inherit; border-color: currentColor; }
.notice .button:disabled { color: var(--ink-muted); }
#unknown-products { border: 1.5px solid var(--tomato); }
#unknown-title, #unknown-products > p { color: var(--tomato); }
#unknown-products .button { background: var(--surface); color: var(--tomato); border-color: var(--tomato); }
@media (forced-colors: active) {
  .button, .badge, .brand-mark { border: 1px solid ButtonText; }
}

@media print {
  :root { color-scheme: light; --bg: white; --surface: white; --ink: black; --ink-muted: #333; --line: #777; --divider: #aaa; --accent: #222; --on-accent: white; --tomato: #222; --on-tomato: white; --lemon: #eee; --on-lemon: black; --ok-soft: white; --ok-ink: black; --shadow: none; }
  .topbar, .back-link, .actionbar, .prototype-note, .skip-link { display: none; }
  .page { padding-bottom: 0; }
  .shell { width: 100%; padding: 0; }
  .recipe-columns { display: block; }
  .section { break-inside: avoid; }
}
