/* Eat: warm ivory, charcoal ink, one tomato accent, fine rules. */

:root {
  --bg: #faf7f1;
  --surface: #fffdf9;
  --sunk: #f4efe7;
  --stone: #f1e8db;
  --ink: #1d1b18;
  --ink-2: #47423c;
  --muted: #736b62;
  --faint: #a69d91;
  --line: #e8e1d5;
  --line-2: #d7cec0;
  --accent: #cd3a21;
  --accent-press: #ac2e18;
  --accent-ink: #a5301b;
  --accent-tint: #fbe9e3;
  --accent-ring: rgba(205, 58, 33, .2);
  --radius: 12px;
  --radius-sm: 7px;
  --page: 1280px;
  --gutter: 32px;
  --tab-h: 62px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
h1 { font-size: clamp(28px, 2.6vw + 12px, 40px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; font-weight: 700; }
h3 { font-size: 15px; line-height: 1.35; letter-spacing: -.005em; font-weight: 650; margin-bottom: 8px; }
h2 .i, h3 .i { display: inline-block; vertical-align: -3px; margin-right: 8px; color: var(--muted); }
p + p { margin-top: 8px; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.caption { font-size: 13px; line-height: 1.5; }
.hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 8px 0 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.eyebrow--accent { color: var(--accent-ink); }
.lede { font-size: 16px; color: var(--ink-2); max-width: 62ch; margin: 10px 0 20px; }

/* ---------- Focus & skip link ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-weight: 650; font-size: 14px; }
.skip-link:focus { top: 12px; }
.page:focus { outline: none; }

/* ---------- Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(250, 247, 241, .94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.site-header__inner { max-width: var(--page); margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 40px; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.wordmark { font-size: 30px; font-weight: 850; letter-spacing: -.065em; line-height: 1; color: var(--ink); padding-right: 2px; }
.wordmark__dot { display: inline-block; width: 7px; height: 7px; margin-left: 2px; border-radius: 50%; background: var(--accent); }
.site-nav { display: flex; align-self: stretch; gap: 4px; }
.site-nav__link { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 14.5px; font-weight: 550; color: var(--ink-2); transition: color .15s; }
.site-nav__link .i { display: none; }
.site-nav__link:hover { color: var(--ink); }
.site-nav__link.is-active { color: var(--ink); font-weight: 700; }
.site-nav__link.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.site-nav__link:focus-visible { outline-offset: -4px; }
.site-account { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.site-account--guest { color: var(--muted); font-weight: 500; }
.avatar { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.avatar--soft { background: var(--stone); color: var(--ink); }

/* ---------- Page frame ---------- */
.page { max-width: var(--page); margin: 0 auto; padding: 32px max(var(--gutter), env(safe-area-inset-right)) 56px max(var(--gutter), env(safe-area-inset-left)); }
.site-foot { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 32px; font-size: 12px; color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; max-width: 760px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-sub { margin-top: 8px; font-size: 15.5px; color: var(--muted); max-width: 68ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13.5px; font-weight: 550; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.back-link .i { width: 16px; height: 16px; }

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split > * { min-width: 0; }
.split > .panel { margin: 0; }
.split > :not(.panel) { display: flex; flex-direction: column; gap: 20px; }
.split > :not(.panel) > .panel { margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; min-width: 0; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.panel-head > div { min-width: 0; flex: 1 1 260px; }
.panel-head p { margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head > .status, .panel-head > .link-arrow { margin-top: 2px; }
.subsection { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.action-row form { margin: 0; }
.empty-line { font-size: 14px; color: var(--muted); padding: 4px 0; }
.message { max-width: 640px; margin: 6vh auto; padding: 36px; }

/* ---------- Buttons & links ---------- */
button, .button {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 650; line-height: 1.2;
  text-align: center; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { background: var(--accent-press); border-color: var(--accent-press); }
button .i, .button .i { width: 17px; height: 17px; }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.secondary:hover { background: var(--sunk); border-color: var(--faint); }
.danger { background: transparent; color: var(--accent-ink); border-color: #ebc4b9; }
.danger:hover { background: var(--accent-tint); border-color: var(--accent); }
.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; background: var(--sunk); color: var(--muted); border-color: var(--line-2); }
button[aria-busy="true"] { cursor: progress; opacity: .7; }
.text-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text-link:hover { text-decoration-color: var(--accent); }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 650; color: var(--accent-ink); white-space: nowrap; }
.link-arrow .i { width: 16px; height: 16px; }
.link-arrow:hover { color: var(--accent-press); }

/* ---------- Tags & statuses (never stretch as flex/grid children) ---------- */
.tag, .badge { display: inline-flex; align-items: center; flex: none; align-self: flex-start; height: 22px; padding: 0 8px; border-radius: 4px; background: var(--sunk); color: var(--ink-2); font-size: 11.5px; font-weight: 650; letter-spacing: .01em; line-height: 1; text-transform: capitalize; white-space: nowrap; }
.tag--cook { background: #eaeee2; color: #435436; }
.tag--assemble { background: #f2ebdc; color: #6a5530; }
.tag--prepared { background: #e6ecef; color: #3c5260; }
.tag--doordash { background: var(--accent-tint); color: var(--accent-ink); }
.eyebrow .tag { letter-spacing: .01em; }

.status { display: inline-flex; align-items: flex-start; gap: 7px; flex: 0 1 auto; align-self: center; min-width: 0; max-width: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink-2); text-align: left; }
.status::before { content: ""; width: 7px; height: 7px; margin-top: .35em; border-radius: 50%; flex: none; background: var(--faint); }
.status--ok { color: var(--ink); }
.status--ok::before { background: var(--ink); }
.status--attn { color: var(--accent-ink); }
.status--attn::before { background: var(--accent); }
.status--off { color: var(--muted); }
.status--off::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.flag { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-ink); font-weight: 600; }
.flag .i { width: 15px; height: 15px; }

/* ---------- Notices ---------- */
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #efcabd; border-radius: 9px; background: #fdf0eb; color: #6b2a1b; font-size: 14px; line-height: 1.5; }
.notice .i { width: 18px; height: 18px; margin-top: 1px; }
.notice--info { border-color: var(--line); background: var(--sunk); color: var(--ink-2); }
.notice--stack { flex-direction: column; }
.notice--stack > p { display: flex; gap: 10px; }
.notice a { font-weight: 600; }
.notice.success { border-color: var(--line); background: var(--sunk); color: var(--ink); }
.confirm-box { margin: 4px 0 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--sunk); border-radius: 0 8px 8px 0; }
.confirm-box .check { margin: 8px 0 0; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.35; transition: border-color .15s, box-shadow .15s;
}
input[type="hidden"] { display: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--accent-ring); }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2347423c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; text-overflow: ellipsis; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--accent); box-shadow: none; cursor: pointer; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="file"] { padding: 6px; min-height: 44px; font-size: 14px; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--sunk); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field { min-width: 0; margin-bottom: 16px; }
.field > .check { margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; margin-bottom: 16px; }
.form-grid--tight { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.form-grid .field, .form-grid fieldset { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
form > .hint { margin-bottom: 14px; }

/* Checkbox rows: box aligned to first text line; labels never stretch. */
.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); cursor: pointer; }
.check input { margin-top: 1px; }
.check--quiet { color: var(--muted); }
.check--inline { margin: 0; align-items: center; min-height: 36px; }
.check--inline input { margin-top: 0; }
.consent { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.check-list { display: grid; gap: 2px; }
.check-list .check { margin: 0; padding: 7px 0; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font-size: 14px; font-weight: 550; color: var(--ink); cursor: pointer; }
.choices label input { margin: 0; }
.choices label:has(input:checked) { border-color: var(--ink-2); background: var(--sunk); }
.choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Disclosures ---------- */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary .chev { width: 16px; height: 16px; margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] > summary .chev { transform: rotate(180deg); }
.disclosure { margin: 4px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.disclosure > summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.disclosure > summary:hover { color: var(--accent-ink); }
.disclosure__body { padding: 4px 0 18px; }
.disclosure + .form-actions { margin-top: 0; }

/* ---------- Feature band (tonight / onboarding / sign-in) ---------- */
.feature { position: relative; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 300px; margin-bottom: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f3eadd; }
.feature__body { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 36px 8px 36px 40px; }
.feature__title { font-size: clamp(30px, 2.6vw + 12px, 46px); line-height: 1.04; letter-spacing: -.04em; font-weight: 850; margin: 2px 0 12px; overflow-wrap: anywhere; }
.feature__text { font-size: 16px; color: var(--ink-2); max-width: 40ch; margin-bottom: 20px; }
.feature__meta { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 22px; font-size: 14.5px; color: var(--ink-2); }
.feature__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.feature__actions .button, .feature__actions button { min-height: 46px; padding: 11px 20px; font-size: 15px; }
.feature__note { display: flex; align-items: flex-start; gap: 8px; margin-top: 20px; max-width: 46ch; font-size: 13px; color: var(--muted); }
.feature__note .i { width: 16px; height: 16px; margin-top: 1px; }
.feature__art { position: relative; min-height: 100%; }
.feature__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 45%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%); mask-image: linear-gradient(90deg, transparent 0, #000 22%); }
.meta-item { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; }
.meta-item .i { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.meta-item .sep, .day__times .sep { margin: 0 5px; color: var(--faint); }
.meta-line { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }

.feature--auth { min-height: min(620px, calc(100vh - 180px)); margin: 4px 0 0; }
.feature--auth .feature__body { padding: 48px 24px 48px 48px; }
.feature--auth .feature__title { font-size: clamp(38px, 3.6vw + 12px, 60px); }
.feature--auth .notice { max-width: 380px; }
.auth-form { max-width: 380px; }
.auth-form button { width: 100%; min-height: 46px; font-size: 15px; }

/* ---------- Week ---------- */
.week { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.week-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.week-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; }
.week-title h2 { font-size: 21px; letter-spacing: -.025em; font-weight: 750; }
.week-title .eyebrow { margin: 0; }
.week-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.week-actions form { margin: 0; }

.days { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); }
.day:first-child { border-left: 0; }
.day__link, .day__body { display: flex; flex-direction: column; flex: 1; min-height: 188px; padding: 14px 14px 16px; }
.day__link { color: inherit; transition: background-color .15s; }
.day__link:hover { background: #fcf7f0; }
.day__link:hover .day__name { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.day__link:focus-visible { outline-offset: -3px; border-radius: 0; }
.day__date { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.day__num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; font-size: 13px; font-weight: 650; letter-spacing: 0; color: var(--ink-2); }
.day.is-today .day__dow { color: var(--accent-ink); }
.day.is-today .day__num { background: var(--accent); color: #fff; }
.day__name { margin: 10px 0 8px; font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.day__times { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink-2); }
.day__times > span { display: inline-flex; flex-wrap: wrap; }
.day__times .i { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.day__foot { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--muted); }
.day__empty { font-size: 13px; color: var(--muted); }
.day.is-past .day__name, .day.is-past .day__times { color: var(--muted); }
.day.is-past .tag { opacity: .65; }
.day.is-past .day__num { color: var(--muted); }

/* ---------- Settings ---------- */
.people { list-style: none; margin-bottom: 16px; border-top: 1px solid var(--line); }
.people > li { border-bottom: 1px solid var(--line); }
.person > summary { display: flex; align-items: center; gap: 12px; padding: 12px 2px; }
.person > summary:hover .person__name { color: var(--accent-ink); }
.person__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.person__name { font-size: 15px; font-weight: 650; }
.person__meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.person__edit { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.person__edit .chev { margin-left: 0; }
.person__form { padding: 6px 0 18px 42px; }
.add-person > summary { width: fit-content; }
.add-person[open] > summary { margin-bottom: 16px; }
.add-person > form { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }

.conn-list { list-style: none; }
.conn { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.conn:first-child { border-top: 0; padding-top: 0; }
.conn__name { font-size: 14.5px; font-weight: 650; min-width: 0; }
.conn .status { grid-column: 2; grid-row: 1; justify-self: end; }
.conn__desc { grid-column: 1; font-size: 13px; line-height: 1.45; color: var(--muted); }
.conn__link { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.conn__link:hover { text-decoration: underline; text-underline-offset: 3px; }

.rule-list { list-style: none; margin-bottom: 12px; border-top: 1px solid var(--line); }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rule__text { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.rule form { margin: 0; flex: none; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field { flex: 1 1 260px; margin: 0; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.kv > span:first-child { color: var(--muted); }
.list-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list-row:first-of-type { border-top: 0; }
.list-row p { margin-top: 2px; }
.preview { margin-top: 12px; padding: 12px 14px; border-radius: 10px 10px 10px 2px; background: var(--sunk); font-size: 14px; white-space: pre-wrap; }

/* ---------- Dinner detail ---------- */
.dinner-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); grid-template-areas: "edit checkin" "edit timing" "edit nutrition" "edit ."; grid-template-rows: auto auto auto 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.dinner-layout > .panel { margin: 0; }
.d-checkin { grid-area: checkin; }
.d-timing { grid-area: timing; }
.d-edit { grid-area: edit; }
.d-nutrition { grid-area: nutrition; }
.d-checkin { border-color: var(--line-2); box-shadow: inset 0 3px 0 var(--accent); }
.kv-list { list-style: none; margin-bottom: 8px; }
.kv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-list li > :last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.diner-list { list-style: none; border-top: 1px solid var(--line); }
.diner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.diner .check { margin: 0; }
.h-note { font-size: 13px; font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.nutrition-person { padding: 12px 0; border-top: 1px solid var(--line); }
.nutrition-person:first-of-type { border-top: 0; padding-top: 0; }
.nutrition-person h3 { margin-bottom: 8px; }
.nutrition { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.nutrition > div { padding: 10px; border-radius: 8px; background: var(--sunk); min-width: 0; }
.nutrition dt { font-size: 11px; color: var(--muted); line-height: 1.3; }
.nutrition dd { font-size: 17px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- Record rows (shopping, servings) ---------- */
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.panel > h2 + .record, .panel > h2 + form.record { border-top: 0; padding-top: 4px; }
.record__title { align-self: center; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.record__fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.record__fields .field { margin: 0; width: 160px; }

/* ---------- Groceries ---------- */
.brief { max-height: 420px; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.cell-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
td > .cell-form:first-child { margin-top: 0; }
.cell-form select { width: auto; flex: 1 1 130px; }
.input-qty { width: 90px; flex: none; }

/* ---------- Meals ---------- */
.search { max-width: 620px; margin-bottom: 22px; }
.collection-import { margin: -10px 0 24px; }

/* Recipe discovery keeps one clear action at each step. */
.discovery-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.discovery-compose { padding: 30px; }
.discovery-compose h2 { font-size: 28px; letter-spacing: -.03em; margin-bottom: 8px; }
.discovery-compose form { margin-top: 24px; }
.discovery-compose textarea { min-height: 140px; font-size: 16px; line-height: 1.6; }
.discovery-diners { display: flex; flex-wrap: wrap; gap: 8px 20px; border: 0; margin: 18px 0 4px; padding: 0; }
.discovery-diners legend { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.discovery-diners .check { margin: 0; }
.discovery-privacy { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 22px; max-width: 520px; }
.discovery-aside { background: #f0eee5; border-radius: 14px; overflow: hidden; }
.discovery-art { display: block; width: 100%; height: 230px; object-fit: cover; }
.discovery-aside__body { padding: 26px; }
.discovery-aside h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.035em; margin: 8px 0 16px; }
.discovery-aside p { font-size: 14px; line-height: 1.6; }
.discovery-aside p + p { margin-top: 16px; }
.discovery-recent { margin-top: 6px; }
.discovery-history { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 14px; }
.discovery-history:first-of-type { margin-top: 12px; }
.discovery-history > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.discovery-history > span:last-child { display: inline-flex; align-items: center; flex: none; gap: 6px; }
.discovery-query { max-width: 800px; overflow-wrap: anywhere; }
.discovery-results-note { margin: -4px 0 24px; max-width: 740px; }
.discovery-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.discovery-result { padding: 24px; min-width: 0; }
.discovery-result h2 { font-size: 24px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.discovery-summary { font-size: 14px; color: var(--muted); margin-top: 10px; }
.discovery-meta { display: flex; flex-wrap: wrap; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.discovery-fit { padding-top: 18px; }
.discovery-fit h3 { font-size: 13px; margin-bottom: 6px; }
.discovery-fit p { font-size: 14px; }
.discovery-cautions { padding-left: 18px; margin-top: 16px; color: var(--muted); }
.discovery-source { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; overflow-wrap: anywhere; }
.discovery-source .i { flex: none; width: 14px; height: 14px; }
.discovery-review-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.discovery-review-note { margin-bottom: 24px; }
.discovery-time-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.discovery-ingredient-labels, .discovery-ingredient { display: grid; grid-template-columns: minmax(0, 1fr) 75px 90px 36px; gap: 6px 8px; }
.discovery-ingredient-labels { font-size: 12px; color: var(--muted); margin: 18px 0 8px; }
.discovery-ingredient { margin-bottom: 12px; }
.discovery-ingredient .field { margin: 0; }
.discovery-ingredient .hint { grid-column: 1 / -1; margin: 0; overflow-wrap: anywhere; }
.ingredient-remove { padding: 4px; font-size: 22px; min-height: 42px; align-self: start; }
.discovery-confirm { margin: 22px 0; align-items: flex-start; }
.discovery-confirm input { margin-top: 3px; }
.discovery-context h3 { font-size: 14px; }
.discovery-context h2 { margin-bottom: 16px; }
.discovery-context-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 17px; font-weight: 650; margin: 8px 0; cursor: pointer; }
.discovery-context-toggle > span { display: inline-flex; align-items: center; gap: 6px; }
.discovery-context-toggle .i { width: 16px; height: 16px; }
.discovery-context .subsection { margin-top: 14px; padding-top: 14px; }
.recipe-method { padding-left: 24px; margin-top: 16px; }
.recipe-method li { padding-left: 6px; margin-bottom: 12px; font-size: 14px; }
@media (max-width: 850px) {
  .discovery-layout, .discovery-review-layout { grid-template-columns: minmax(0, 1fr); }
  .discovery-aside { display: none; }
  .discovery-results { grid-template-columns: minmax(0, 1fr); }
  .discovery-compose { padding: 22px; }
  .discovery-context { grid-row: 1; }
}
@media (max-width: 480px) {
  .discovery-time-fields { grid-template-columns: minmax(0, 1fr); }
  .discovery-ingredient-labels, .discovery-ingredient { grid-template-columns: minmax(0, 1fr) 54px 62px 32px; gap: 5px; }
  .discovery-ingredient input { padding-left: 8px; padding-right: 8px; }
  .discovery-history { align-items: flex-start; flex-direction: column; gap: 6px; }
}
.panel .search { margin-bottom: 0; max-width: 760px; }
.search__row { display: flex; gap: 8px; }
.search__row input { flex: 1; }
.search__row button { flex: none; }
.food-collection { margin-bottom: 36px; }
.collection-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.collection-heading h2, .collection-title { font-size: 22px; letter-spacing: -.025em; }
.collection-heading p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.collection-heading__aside { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.collection-title { margin-bottom: 18px; }
.food-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 208px; gap: 16px; list-style: none; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scroll-padding-inline: 2px; padding: 2px 2px 12px; }
.food-grid > li { scroll-snap-align: start; }
.food-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.food-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--stone); }
.food-card__body { padding: 14px 16px 16px; }
.food-card__source { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.food-card h3 { margin-top: 5px; font-size: 17px; line-height: 1.25; letter-spacing: -.015em; overflow-wrap: anywhere; }
.food-card p { margin-top: 6px; font-size: 12px; color: var(--muted); }
.meal-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.meal-card { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.meal-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.meal-card__top .i { width: 15px; height: 15px; }
.meal-card__name { font-size: 18px; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 6px; overflow-wrap: anywhere; }
.meal-card__name a:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.meal-card__desc { font-size: 13.5px; color: var(--muted); }
.meal-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: auto; padding-top: 16px; }
.feedback { margin-top: 12px; border-top: 1px solid var(--line); }
.feedback > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.feedback > form { padding-bottom: 14px; }
.feedback__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.feedback__row .field { flex: 1 1 110px; margin: 0; }
.empty { max-width: 560px; }
.empty p { margin: 6px 0 16px; color: var(--muted); }

.ingredient-list { list-style: none; border-top: 1px solid var(--line); }
.ingredient-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ingredient-list--source { margin: 12px 0 0; }
.review-item { padding: 14px 0 0; border-top: 1px solid var(--line); }
.review-item legend { float: left; width: 100%; margin-bottom: 10px; font-size: 14px; font-weight: 650; color: var(--ink); text-transform: capitalize; }
.review-item legend + * { clear: both; }
.candidate-list { list-style: none; margin-bottom: 14px; border-top: 1px solid var(--line); }
.candidate-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.candidate-list .check { margin: 0; min-width: 0; }
.import-item .panel-head { align-items: center; }

/* ---------- DoorDash ---------- */
.steps { list-style: none; counter-reset: step; margin-bottom: 14px; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.plain-list { list-style: none; margin-bottom: 16px; }
.plain-list li { position: relative; padding: 7px 0 7px 18px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.plain-list li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 6px; height: 1.5px; background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 24px; }
  .site-header__inner { gap: 24px; }
  .site-nav__link { padding: 0 9px; }
  .site-nav__link.is-active::after { left: 9px; right: 9px; }
  .split, .split--even { grid-template-columns: 1fr; }
  .dinner-layout { grid-template-columns: 1fr; grid-template-areas: "checkin" "timing" "edit" "nutrition"; grid-template-rows: none; }
}

/* Below 1024px the week becomes a one-column agenda. */
@media (max-width: 1023px) {
  .days { grid-template-columns: 1fr; }
  .day { border-left: 0; border-top: 1px solid var(--line); }
  .day:first-child { border-top: 0; }
  .day__link, .day__body { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-auto-rows: auto; column-gap: 14px; align-items: start; min-height: 0; padding: 12px 20px; }
  .day__date { grid-column: 1; grid-row: 1 / span 3; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; margin: 0; font-size: 10.5px; }
  .day__num { font-size: 16px; min-width: 30px; height: 30px; border-radius: 15px; }
  .day__name { grid-column: 2; grid-row: 1; margin: 2px 0 2px; }
  .day__times { grid-column: 2; grid-row: 2; }
  .day__foot { grid-column: 2; grid-row: 3; margin: 0; padding-top: 4px; }
  .day__link > .tag { grid-column: 3; grid-row: 1; margin-top: 2px; }
  .day__empty { grid-column: 2 / span 2; grid-row: 1; align-self: center; padding-top: 4px; }
  .day--empty .day__body { padding-top: 8px; padding-bottom: 8px; }
  .day--empty .day__num { font-size: 14px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .has-tabbar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header__inner { height: 56px; gap: 12px; }
  .wordmark { font-size: 27px; }
  .site-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-top: 1px solid var(--line); background: rgba(255, 253, 249, .97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .site-nav__link { flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .site-nav__link .i { display: block; width: 22px; height: 22px; }
  .site-nav__link.is-active { color: var(--ink); }
  .site-nav__link.is-active .i { color: var(--accent); }
  .site-nav__link.is-active::after { top: -1px; bottom: auto; left: 28%; right: 28%; }
  .site-account__name { display: none; }
  .page { padding-top: 22px; padding-bottom: 32px; }
  .site-foot { padding-bottom: 24px; }
  .page-head { margin-bottom: 18px; gap: 14px; }
  .page-head__actions { width: 100%; }
  .page-sub { font-size: 14.5px; }
  .panel { padding: 18px 16px; border-radius: 10px; }
  input, select, textarea { font-size: 16px; }
  .feature { grid-template-columns: 1fr; min-height: 0; margin-bottom: 22px; border-radius: 12px; }
  .feature__art { order: -1; height: 132px; min-height: 0; }
  .feature__art img { object-position: 60% 48%; -webkit-mask-image: none; mask-image: none; }
  .feature__body { padding: 20px 18px 22px; }
  .feature__title { font-size: 30px; }
  .feature__meta { margin-bottom: 18px; gap: 8px 14px; font-size: 14px; }
  .feature__actions .button, .feature__actions button { width: 100%; }
  .feature__note { margin-top: 16px; }
  .feature--auth { min-height: 0; }
  .feature--auth .feature__art { height: 180px; }
  .feature--auth .feature__body { padding: 24px 18px 28px; }
  .feature--auth .feature__title { font-size: 40px; }
  .week { border-radius: 10px; }
  .week-head { padding: 12px 16px; }
  .week-title h2 { font-size: 18px; }
  .week-actions { width: 100%; justify-content: space-between; }
  .day__link, .day__body { padding: 11px 16px; column-gap: 12px; }
  .person__form { padding-left: 0; }
  .record { grid-template-columns: 1fr; }
  .record__fields .field { flex: 1 1 140px; width: auto; }
  .food-grid { grid-auto-columns: 168px; gap: 12px; }
  .collection-heading__aside { align-items: flex-start; }
  .food-card__body { padding: 12px; }
  .food-card h3 { font-size: 15px; }
  .nutrition { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li { grid-template-columns: 28px minmax(0, 1fr); }
  .steps li .status { grid-column: 2; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; }
  .stack-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .stack-table tbody tr:last-child { border-bottom: 0; }
  .stack-table td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; }
  .stack-table td::before { content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  .stack-table td > * { grid-column: 2; }
  .table-wrap { margin: 0; overflow: visible; }
  .message { padding: 24px 18px; margin: 2vh auto; }
}

@media (max-width: 380px) {
  .search__row { flex-direction: column; }
  .search__row button { width: 100%; }
  .site-nav__link { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .status::before, .wordmark__dot { forced-color-adjust: none; }
  .site-nav__link.is-active { text-decoration: underline; }
}
