@charset "UTF-8";
/* めしどき — reading-only Web app. Private content stays on flat, high-contrast
   paper; glass is reserved for the floating controls (tab bar, filter, account). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-synthesis: none;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --accent: #e3262b;
  --accent-strong: #d42027;
  --ink: #18191b;
  --muted: #65676e;
  --description: #575960;
  --paper: #fff;
  --surface: #fff;
  --soft: #f3f3f5;
  --line: #e6e6e9;
  --red: #bc2428;
  --focus: #24262a;
  --blue: #2165b1;
  --sample: #82623c;
  --error-bg: #fff0f1;
  --error-ink: #ad242d;
  --badge-blue: #e4f0ff; --badge-blue-ink: #176ac8;
  --badge-green: #dfefdd; --badge-green-ink: #2b6227;
  --badge-amber: #fff0d9; --badge-amber-ink: #935109;
  --grocery-allergen: #8d4c12;
  --press-tint: rgba(24, 25, 27, .045);
  /* Controls */
  --nav-ink: #6b6d74;
  --nav-ink-selected: #c8232a;
  --filter-ink: #2a2b2f;
  --filter-ink-selected: #fff;
  /* Glass fallback (no lens: bundle missing, failed or reduced transparency) */
  --glass-fallback: rgba(250, 250, 252, .86);
  /* iOS 27: glass is set off by a darker, defined edge more than by its shadow. */
  --glass-hairline: rgba(20, 20, 30, .17);
  --glass-shadow: 0 8px 24px rgba(28, 22, 26, .09), 0 1px 3px rgba(28, 22, 26, .06);
  --glass-shadow-soft: 0 4px 14px rgba(28, 22, 26, .07), 0 1px 2px rgba(28, 22, 26, .05);
  --solid-surface: #fff;
  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.5, .64, 1);
  --ease-press: cubic-bezier(.3, .7, .4, 1);
  --nav-gap: max(14px, calc(env(safe-area-inset-bottom) - 6px));
  --nav-height: 62px;
  --gutter-left: max(20px, env(safe-area-inset-left));
  --gutter-right: max(20px, env(safe-area-inset-right));
  color: var(--ink);
  background: var(--paper);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --ink: #f4f4f6; --muted: #b4b6bf; --description: #c4c6ce; --paper: #151619; --surface: #222429; --soft: #26282e; --line: #36383f; --red: #ff747a; --focus: #fff; --blue: #8abaff; --sample: #cbb28b; --error-bg: #46232a; --error-ink: #ffb8bf;
    --badge-blue: #21354f; --badge-blue-ink: #9ac4ff; --badge-green: #263b2a; --badge-green-ink: #a7d69f; --badge-amber: #45341f; --badge-amber-ink: #f3c78b; --grocery-allergen: #e8bd89;
    --press-tint: rgba(255, 255, 255, .06);
    --nav-ink: #c2c4cc; --nav-ink-selected: #ff8a8f; --filter-ink: #eceef2; --filter-ink-selected: #fff;
    --glass-fallback: rgba(52, 54, 61, .9); --glass-hairline: rgba(0, 0, 0, .7);
    --glass-shadow: 0 10px 28px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3), inset 0 0 0 .5px rgba(255, 255, 255, .12); --glass-shadow-soft: 0 4px 14px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 .5px rgba(255, 255, 255, .12);
    --solid-surface: #24262b;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --ink: #f4f4f6; --muted: #b4b6bf; --description: #c4c6ce; --paper: #151619; --surface: #222429; --soft: #26282e; --line: #36383f; --red: #ff747a; --focus: #fff; --blue: #8abaff; --sample: #cbb28b; --error-bg: #46232a; --error-ink: #ffb8bf;
  --badge-blue: #21354f; --badge-blue-ink: #9ac4ff; --badge-green: #263b2a; --badge-green-ink: #a7d69f; --badge-amber: #45341f; --badge-amber-ink: #f3c78b; --grocery-allergen: #e8bd89;
  --press-tint: rgba(255, 255, 255, .06);
  --nav-ink: #c2c4cc; --nav-ink-selected: #ff8a8f; --filter-ink: #eceef2; --filter-ink-selected: #fff;
  --glass-fallback: rgba(52, 54, 61, .9); --glass-hairline: rgba(0, 0, 0, .7);
  --glass-shadow: 0 10px 28px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3), inset 0 0 0 .5px rgba(255, 255, 255, .12); --glass-shadow-soft: 0 4px 14px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 .5px rgba(255, 255, 255, .12);
  --solid-surface: #24262b;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 2.05rem; line-height: 1.4; letter-spacing: -.045em; margin-bottom: 3px; font-weight: 760; }
h2 { font-size: 1.13rem; line-height: 1.5; margin: 0 0 12px; font-weight: 730; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.5; margin: 0; font-weight: 700; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .76rem; }
button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 9px 17px; color: var(--ink); font-weight: 650; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button.primary { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
button.text-button { border: 0; background: none; padding: 7px 9px; font-size: .86rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input[type=email], select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 11px 13px; color: var(--ink); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; margin-top: 4px; }
.skip-link { position: absolute; left: 14px; top: -100px; background: var(--paper); padding: 10px; z-index: 40; }
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header { max-width: 824px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: max(24px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) 18px max(32px, env(safe-area-inset-left)); position: relative; z-index: 30; }
.brand { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex-shrink: 0; overflow: hidden; text-decoration: none; border-radius: 14px; }
.brand img { display: block; flex: 0 0 58px; width: 58px; height: 58px; max-width: none; object-fit: contain; }
.account { position: relative; width: 44px; height: 44px; }

/* ---------- Glass islands (shared) ---------- */
/* The fallback surface is what every browser gets first; the liquid-glass
   bundle adds its layers in .lg-host underneath the controls and marks the
   island [data-glass-active] once they have painted. */
.glass-island { position: relative; isolation: isolate; background: var(--glass-fallback); box-shadow: var(--glass-shadow), 0 0 0 .5px var(--glass-hairline); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); }
.glass-island[data-glass-active] { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.lg-host { display: block; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; }
.glass-island > :not(.lg-host) { position: relative; z-index: 1; }
/* Static glass layers get their own compositor layer so that repainting a
   label (its colour follows the moving drop) never re-runs their filters. */
.lg-surface, .lg-rim { will-change: transform; }
/* Mirrors of the page under a glass control (inside their closed shadow roots):
   text is painted from data-t, and nothing in a copy animates or blurs. */
.lg-mirror-page { position: absolute; pointer-events: none; }
.lg-mirror-page .lg-t::before { content: attr(data-t); }
.lg-mirror-page *, .lg-mirror-page *::before, .lg-mirror-page *::after { animation: none !important; transition: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ---------- Account button and menu ---------- */
.account-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--ink); box-shadow: var(--glass-shadow-soft), 0 0 0 .5px var(--glass-hairline); position: relative; z-index: 3; }
.account-icon { display: grid; place-items: center; transition: transform .36s var(--ease-spring); }
.account-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-toggle:active .account-icon { transform: scale(.86); transition: transform .12s var(--ease-press); }
.account-menu { position: absolute; right: 0; top: 54px; z-index: 2; width: min(300px, calc(100vw - 40px)); border-radius: 24px; color: var(--ink); background: var(--solid-surface); box-shadow: var(--glass-shadow), 0 0 0 .5px var(--glass-hairline); transform-origin: calc(100% - 22px) -32px; }
.account-menu-rows { padding: 16px 16px 12px; max-height: calc(100dvh - 140px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; border-radius: inherit; }
.account-name { font-size: .78rem; color: var(--muted); margin: 0 4px 12px; overflow-wrap: anywhere; }
.theme-label { display: block; font-size: .74rem; font-weight: 650; margin: 4px 4px 6px; color: var(--muted); }
.select-wrap select { min-height: 44px; border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.account-menu .menu-row { display: flex; align-items: center; width: 100%; min-height: 46px; text-align: left; color: var(--red); padding: 10px 6px; font-size: .84rem; border-radius: 12px; transition: background-color .2s, transform .34s var(--ease-spring); }
.account-menu .menu-row:active { background: var(--press-tint); transform: scale(.98); transition-duration: .1s; }
.revoke-trigger { border-top: 1px solid var(--line) !important; border-radius: 0 !important; margin-top: 4px; }
.revoke-confirmation { border-top: 1px solid var(--line); padding: 13px 4px 4px; }
.revoke-confirmation h2 { font-size: .9rem; margin-bottom: 7px; }
.revoke-confirmation p { font-size: .75rem; color: var(--muted); line-height: 1.85; }
.revoke-actions { display: grid; gap: 8px; }
.revoke-actions button { font-size: .75rem; }
/* Menu motion. Without the lens the panel itself scales out of the button. */
.account-menu[data-state=opening] { animation: menu-panel-in .3s var(--ease-spring) both; }
.account-menu[data-state=closing] { animation: menu-panel-out .2s cubic-bezier(.4, 0, .8, .4) both; }
@keyframes menu-panel-in { from { opacity: 0; transform: scale(.4); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes menu-panel-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.5); } }
/* With the lens, the drop morphs from the button; the rows follow it in. */
html[data-glass=ready] .account-menu:not([data-glass-failed]) { background: transparent; box-shadow: none; animation: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-glass=ready] .account-menu:not([data-glass-failed])[data-state=opening] .account-menu-rows { animation: menu-rows-in .26s .07s var(--ease-out) both; }
html[data-glass=ready] .account-menu:not([data-glass-failed])[data-state=closing] .account-menu-rows { animation: menu-rows-out .13s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes menu-rows-in { from { opacity: 0; transform: translate(6px, -8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes menu-rows-out { from { opacity: 1; } to { opacity: 0; transform: translate(4px, -6px) scale(.97); } }

/* ---------- Tab bar ---------- */
.primary-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: var(--nav-gap); margin: 0 auto; width: min(360px, calc(100% - 32px)); display: flex; gap: 4px; padding: 5px; border-radius: 34px; }
.primary-nav a { flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 27px; text-decoration: none; color: var(--nav-ink); }
.primary-nav a[aria-current=page] { color: var(--nav-ink-selected); }
.glass-island:not([data-glass-active]).primary-nav a[aria-current=page] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.primary-nav[data-glass-active] a { color: color-mix(in srgb, var(--nav-ink-selected) calc(var(--lens-mix, 0) * 100%), var(--nav-ink)); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px 8px; min-width: 0; transition: transform .38s var(--ease-spring); }
.nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { font-size: .7rem; font-weight: 700; letter-spacing: .02em; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.primary-nav a:active .nav-item { transform: scale(.9); transition: transform .12s var(--ease-press); }

/* Touched glass grows (the lens lifts out of the bar), so the labels and the
   account icon no longer shrink under it; a sideways drag moves the lens. */
.primary-nav[data-glass-active], .history-filters[data-glass-active] { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.primary-nav[data-glass-active] a:active .nav-item, .history-filters[data-glass-active] button:active .segment-label { transform: none; }
.account-toggle[data-glass-active]:active .account-icon { transform: scale(1.12); }

/* ---------- Main and screens ---------- */
main { position: relative; box-sizing: content-box; max-width: 760px; min-height: 65vh; margin: 0 auto; padding: 22px 32px calc(var(--nav-height) + var(--nav-gap) + 44px); outline: none; overflow-x: clip; }
body[data-view=login] main { padding-bottom: 40px; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 1rem; }
.refresh-button { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: transform .36s var(--ease-spring), background-color .2s; }
.refresh-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button:active { transform: scale(.88); background: var(--press-tint); transition-duration: .12s; }
.refresh-button.is-refreshing svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 480px; padding: 70px 15px; margin: auto; color: var(--muted); font-size: .9rem; animation: fade-in .3s .12s both; }
.loading-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.history-results[aria-busy=true] { opacity: .45; transition: opacity .18s; }
.empty-state { max-width: 480px; text-align: center; padding: 60px 15px; margin: auto; }
.empty-state h2 { font-size: 1.2rem; }
.empty-state p { font-size: .86rem; color: var(--muted); }

/* ---------- History filter ---------- */
.history-filters { display: flex; gap: 4px; padding: 4px; margin: 0 0 24px; border-radius: 999px; max-width: 440px; }
.history-filters button { flex: 1 1 0; min-width: 0; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--filter-ink); font-size: .9rem; font-weight: 700; padding: 6px 12px; }
.history-filters button[aria-pressed=true] { background: var(--accent-strong); color: var(--filter-ink-selected); box-shadow: 0 2px 8px rgba(180, 22, 25, .2); }
.history-filters[data-glass-active] button,
.history-filters[data-glass-active] button[aria-pressed=true] { background: transparent; box-shadow: none; color: color-mix(in srgb, var(--filter-ink-selected) calc(var(--lens-mix, 0) * 100%), var(--filter-ink)); }
.segment-label { display: inline-block; transition: transform .36s var(--ease-spring); }
.history-filters button:active .segment-label { transform: scale(.92); transition: transform .12s var(--ease-press); }

/* ---------- History list ---------- */
.history-day { margin-bottom: 22px; }
.date-heading { font-size: .91rem; color: var(--muted); font-weight: 650; margin: 0 0 6px; }
.meal-grid { display: flex; flex-direction: column; }
.meal-card { position: relative; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 15px 30px 15px 0; border-bottom: 1px solid var(--line); text-decoration: none; border-radius: 0; transition: transform .4s var(--ease-spring), background-color .25s; }
.meal-card::before { content: ""; position: absolute; inset: 3px -10px; border-radius: 16px; background: var(--press-tint); opacity: 0; transition: opacity .25s; pointer-events: none; }
.meal-card:active { transform: scale(.985); transition: transform .12s var(--ease-press); }
.meal-card:active::before { opacity: 1; transition-duration: .08s; }
@media (hover: hover) { .meal-card:hover h3 { color: var(--red); } }
.meal-card-body { min-width: 0; flex: 1; }
.meal-card h3 { font-size: 1.01rem; line-height: 1.5; letter-spacing: -.025em; margin: 0 0 3px; overflow-wrap: anywhere; }
.meal-description { font-size: .85rem; line-height: 1.7; color: var(--description); margin: 2px 0 7px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.meta { font-size: .87rem; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.meal-summary { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; padding: 2px 9px; font-size: .68rem; font-weight: 650; line-height: 1.6; border-radius: 20px; white-space: nowrap; color: var(--badge-blue-ink); background: var(--badge-blue); }
.status.completed { color: var(--badge-green-ink); background: var(--badge-green); }
.status.cooking { color: var(--badge-amber-ink); background: var(--badge-amber); }
.status-dot { display: none; }
.change-note { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sample-label { color: var(--sample); font-size: .66rem; line-height: 1.5; margin: 7px 0 0; }
.row-chevron { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.row-chevron svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meal-card:not(.feature-card) .meal-photo { width: 108px; height: 82px; flex-shrink: 0; object-fit: cover; border-radius: 12px; background: var(--soft); }
.feature-card { display: block; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin: 0 0 6px; }
.feature-card::before { inset: 0; border-radius: inherit; }
.feature-card .meal-photo { width: 100%; aspect-ratio: 2.3; object-fit: cover; display: block; background: var(--soft); }
.feature-card .meal-card-body { padding: 12px 40px 13px 14px; }
.feature-card h3 { font-size: 1.14rem; }
.feature-card .row-chevron { top: auto; bottom: 44px; right: 14px; transform: none; }
.photo-note { padding: 16px; color: var(--muted); font-size: .8rem; }
.load-more { display: flex; justify-content: center; margin-top: 24px; }
.load-more button { font-size: .83rem; border-radius: 999px; }
.load-more-button, .retry-button { transition: transform .38s var(--ease-spring), background-color .2s; }
.load-more-button:active, .retry-button:active { transform: scale(.96); background: var(--soft); transition-duration: .12s; }

/* ---------- Detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: .92rem; font-weight: 600; text-decoration: none; min-height: 44px; margin: 0 0 10px -8px; padding: 0 12px 0 4px; border-radius: 22px; transition: transform .36s var(--ease-spring), background-color .2s; }
.back-chevron { display: grid; }
.back-chevron svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.back-link:active { transform: scale(.95); background: var(--press-tint); transition-duration: .12s; }
@media (hover: hover) { .back-link:hover { background: var(--press-tint); } }
.detail-photo { margin: 0 0 17px; }
.detail-photo img { width: 100%; aspect-ratio: 2.1; object-fit: cover; display: block; border-radius: 18px; transform-origin: 0 0; }
.detail-header h1 { font-size: 1.7rem; margin: 10px 0 2px; line-height: 1.5; letter-spacing: -.035em; overflow-wrap: anywhere; }
.recipe-description { font-size: .94rem; line-height: 1.9; color: var(--description); margin: 8px 0 13px; white-space: pre-line; overflow-wrap: anywhere; }
.detail-header .meta { font-size: .87rem; margin: 0 0 9px; }
.detail-date { font-size: .71rem; color: var(--muted); margin: 0; }
.save-note { font-size: .76rem; color: var(--muted); margin: 8px 0 20px; line-height: 1.75; }
.recipe-section { padding-top: 20px; border-top: 1px solid var(--line); margin-bottom: 21px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-heading h2 { flex-shrink: 0; }
.section-note { font-size: .68rem; color: var(--muted); }
.ingredient-list { padding: 0; margin: 0; list-style: none; color: var(--ink); }
.ingredient-list li { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 8px 0; font-size: .88rem; line-height: 1.5; }
.ingredient-list li:last-child { border-bottom: 0; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.confirmed-note { font-size: .73rem; color: var(--muted); margin: 7px 0 0; line-height: 1.8; }
.confirmed-section h2 { font-size: .97rem; }
.equipment-section h2 { font-size: .97rem; margin-bottom: 5px; }
.equipment { font-size: .81rem; color: var(--muted); margin: 0; }
.steps { padding: 0; margin: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; padding: 0 0 21px 36px; counter-increment: steps; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 50%; font-size: .79rem; font-weight: 650; line-height: 1; }
.step-instruction { font-size: .88rem; line-height: 1.8; margin: 0 0 6px; overflow-wrap: anywhere; }
.step-hints { font-size: .74rem; line-height: 1.8; color: var(--muted); margin: 0; }
.step-hints span { display: block; }
.safety { border-top: 1px solid var(--line); padding: 20px 0; margin: 0; font-size: .76rem; color: var(--muted); line-height: 1.8; }
.safety h3 { font-size: .94rem; color: var(--ink); margin-bottom: 8px; }
.safety ul { margin: 0; padding-left: 18px; }
.provenance { padding-top: 20px; }
.source-list, .adaptation-list { padding: 0; margin: 0; list-style: none; font-size: .81rem; color: var(--muted); }
.source-list li { margin-bottom: 12px; }
.source-list a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; overflow-wrap: anywhere; font-size: .88rem; }
.source-list a::after { content: ' ↗'; }
.source-list a:hover { text-decoration: underline; }
.source-list small { display: block; color: var(--muted); font-size: .67rem; margin-top: 2px; }
.provenance h3 { font-size: .83rem; margin: 14px 0 5px; }
.adaptation-list li { margin-bottom: 5px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1.5; object-fit: cover; border-radius: 12px; display: block; }

/* ---------- Weekly ---------- */
.weekly-card { display: block; position: relative; border-bottom: 1px solid var(--line); padding: 22px 32px 22px 0; text-decoration: none; transition: transform .4s var(--ease-spring); }
.weekly-card::before { content: ""; position: absolute; inset: 4px -10px; border-radius: 16px; background: var(--press-tint); opacity: 0; transition: opacity .25s; pointer-events: none; }
.weekly-card:active { transform: scale(.985); transition: transform .12s var(--ease-press); }
.weekly-card:active::before { opacity: 1; transition-duration: .08s; }
.weekly-card h2 { font-size: 1.13rem; margin: 3px 0 6px; color: var(--ink); overflow-wrap: anywhere; }
@media (hover: hover) { .weekly-card:hover h2, .weekly-day-recipe:hover h3 { color: var(--red); } }
.weekly-period { color: var(--muted); font-size: .78rem; margin: 0; line-height: 1.8; }
.weekly-card .meta { margin-bottom: 0; }
.weekly-header h1 { font-size: 1.7rem; margin: 5px 0 8px; overflow-wrap: anywhere; }
.weekly-header .meta { margin-bottom: 10px; }
.read-only-note { font-size: .75rem; line-height: 1.9; color: var(--muted); margin: 24px 0 0; }
.weekly-menu { margin: 26px 0 30px; }
.weekly-days { list-style: none; margin: 0; padding: 0; }
.weekly-days > li { display: grid; grid-template-columns: 82px minmax(0, 1fr); border-bottom: 1px solid var(--line); gap: 15px; padding: 14px 0; }
.weekly-day-date { padding-top: 4px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.weekly-day-recipe { position: relative; min-width: 0; display: block; text-decoration: none; padding: 2px 26px 2px 0; border-radius: 12px; transition: transform .38s var(--ease-spring); }
.weekly-day-recipe:active { transform: scale(.975); transition: transform .12s var(--ease-press); }
.weekly-day-recipe h3 { font-size: .96rem; overflow-wrap: anywhere; }
.weekly-day-recipe .meta { margin-bottom: 0; }
.grocery-list { padding: 0; margin: 15px 0; list-style: none; }
.grocery-list > li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.grocery-list > li:last-child { border-bottom: 0; }
.grocery-line { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; font-size: .91rem; }
.grocery-name { overflow-wrap: anywhere; color: var(--ink); }
.grocery-note, .grocery-days, .grocery-allergens { font-size: .74rem; line-height: 1.85; color: var(--muted); margin: 5px 0 0; }
.grocery-days { font-variant-numeric: tabular-nums; }
.grocery-allergens { color: var(--grocery-allergen); }

/* ---------- Login and notices ---------- */
.login-card { max-width: 430px; padding: 24px 0; margin: 16px auto; }
.login-card h1 { font-size: 1.9rem; line-height: 1.5; margin-bottom: 15px; }
.login-card > p { font-size: .9rem; color: var(--muted); line-height: 1.9; }
.email-label { font-size: .84rem; font-weight: 650; display: block; margin: 25px 0 8px; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: .76rem; line-height: 1.8; margin: 18px 0 23px; }
.login-card .primary { width: 100%; }
.dev-login { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 28px; }
.dev-login p { color: var(--muted); font-size: .74rem; margin-bottom: 12px; }
.dev-buttons { display: flex; gap: 10px; }
.dev-buttons button { flex: 1; font-size: .79rem; }
.notice, .error-message { max-width: 650px; padding: 13px 15px; border-radius: 12px; background: var(--error-bg); color: var(--error-ink); font-size: .83rem; line-height: 1.8; }
.error-message { margin-top: 18px; }
.revoke-confirmation .error-message { margin-top: 10px; }

/* ---------- Layout ---------- */
@media (min-width: 840px) {
  body[data-view=detail] main { max-width: 720px; }
  .recipe-materials { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 34px; }
  .equipment-section { grid-column: 1 / -1; }
  .detail-photo img { max-height: 370px; }
  .feature-card .meal-photo { aspect-ratio: 2.65; }
}
@media (max-width: 824px) {
  main { padding-left: max(25px, env(safe-area-inset-left)); padding-right: max(25px, env(safe-area-inset-right)); }
  .site-header { padding-left: max(25px, env(safe-area-inset-left)); padding-right: max(25px, env(safe-area-inset-right)); }
}
@media (max-width: 550px) {
  .site-header { padding: max(18px, env(safe-area-inset-top)) var(--gutter-right) 10px var(--gutter-left); }
  main { padding-left: var(--gutter-left); padding-right: var(--gutter-right); padding-top: 14px; }
  h1 { font-size: 1.85rem; }
  .page-intro { margin-bottom: 18px; }
  .page-intro p { font-size: .92rem; margin-top: 1px; }
  .history-filters { margin-bottom: 22px; }
  .history-filters button { font-size: .86rem; }
  .date-heading { font-size: .88rem; }
  .history-day { margin-bottom: 18px; }
  .meal-card { gap: 13px; padding-top: 14px; padding-bottom: 14px; padding-right: 26px; }
  .meal-card:not(.feature-card) .meal-photo { width: 96px; height: 76px; border-radius: 11px; }
  .meal-card h3 { font-size: .95rem; }
  .meal-card .meta { font-size: .8rem; }
  .meal-description { font-size: .79rem; margin: 3px 0 6px; line-height: 1.75; }
  .meal-summary { gap: 7px; row-gap: 5px; }
  .status { font-size: .64rem; padding: 2px 8px; }
  .change-note { font-size: .7rem; }
  .sample-label { font-size: .62rem; margin-top: 6px; }
  .meal-card.feature-card { padding: 0; }
  .feature-card .meal-photo { aspect-ratio: 2.1; }
  .feature-card .meal-card-body { padding: 10px 36px 12px 12px; }
  .feature-card h3 { font-size: 1.06rem; }
  .feature-card .row-chevron { bottom: 39px; right: 12px; }
  .detail-photo { margin: 0 calc(-1 * var(--gutter-right)) 12px calc(-1 * var(--gutter-left)); }
  .detail-photo img { border-radius: 0; aspect-ratio: 2; }
  .detail-header h1 { font-size: 1.42rem; margin-top: 10px; }
  .recipe-description { font-size: .87rem; margin: 8px 0 12px; }
  .detail-header .meta { font-size: .81rem; margin-bottom: 6px; }
  .detail-date { font-size: .66rem; }
  .save-note { font-size: .72rem; margin: 7px 0 18px; }
  .recipe-section { padding-top: 17px; margin-bottom: 18px; }
  h2 { font-size: 1.07rem; margin-bottom: 10px; }
  .ingredient-list li { padding: 7px 0; font-size: .84rem; }
  .section-note { font-size: .65rem; }
  .confirmed-section h2, .equipment-section h2 { font-size: .93rem; }
  .confirmed-note { font-size: .7rem; }
  .steps li { padding-left: 33px; padding-bottom: 18px; }
  .steps li::before { width: 22px; height: 22px; font-size: .75rem; }
  .step-instruction { font-size: .83rem; line-height: 1.9; }
  .step-hints { font-size: .7rem; }
  .safety { padding-top: 17px; padding-bottom: 17px; font-size: .72rem; }
  .source-list a { font-size: .82rem; }
  .login-card { margin: 6px 0; padding-top: 22px; }
  .login-card h1 { font-size: 1.7rem; }
  .login-card > p { font-size: .85rem; }
  .gallery { gap: 9px; }
  .weekly-header h1 { font-size: 1.42rem; }
  .weekly-period { font-size: .74rem; }
  .weekly-card { padding: 18px 28px 18px 0; }
  .weekly-card h2 { font-size: 1.04rem; }
  .weekly-days > li { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 13px 0; }
  .weekly-day-date { font-size: .73rem; }
  .weekly-day-recipe h3 { font-size: .89rem; }
  .weekly-day-recipe .meta { font-size: .78rem; }
  .weekly-menu { margin: 23px 0 24px; }
  .grocery-line { font-size: .85rem; }
  .grocery-note, .grocery-days, .grocery-allergens { font-size: .7rem; }
  .read-only-note { font-size: .71rem; }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .nav-item, .segment-label, .account-icon, .meal-card, .weekly-card, .weekly-day-recipe, .back-link, .refresh-button, .load-more-button, .retry-button, .account-menu .menu-row { transition: background-color .15s, opacity .15s !important; transform: none !important; }
  .account-menu[data-state=opening], html[data-glass=ready] .account-menu:not([data-glass-failed])[data-state=opening] .account-menu-rows { animation: fade-in .14s ease-out both; }
  .account-menu[data-state=closing], html[data-glass=ready] .account-menu:not([data-glass-failed])[data-state=closing] .account-menu-rows { animation: fade-in .12s ease-in reverse both; }
  .loading-dot, .refresh-button.is-refreshing svg { animation: none; }
}
/* Reduce Transparency / Increase Contrast: readable opaque controls, no lens. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass-island, .glass-island[data-glass-active] { background: var(--solid-surface); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px var(--line), var(--glass-shadow-soft); }
  .lg-host { display: none; }
  html[data-glass=ready] .account-menu:not([data-glass-failed]) { background: var(--solid-surface); box-shadow: 0 0 0 1px var(--line), var(--glass-shadow); }
  .primary-nav[data-glass-active] a { color: var(--nav-ink); }
  .primary-nav a[aria-current=page], .primary-nav[data-glass-active] a[aria-current=page] { background: color-mix(in srgb, var(--accent) 14%, var(--solid-surface)); color: var(--nav-ink-selected); }
  .history-filters[data-glass-active] button { color: var(--filter-ink); }
  .history-filters button[aria-pressed=true], .history-filters[data-glass-active] button[aria-pressed=true] { background: var(--accent-strong); color: #fff; }
}
