:root {
    color-scheme: light;
    --paper: #f7f8f3;
    --surface: #fffefb;
    --ink: #35283b;
    --body: #414b44;
    --muted: #555f57;
    --sage: #3d5b49;
    --pale-sage: #ebf0e8;
    --plum: #713457;
    --blush: #f5eaf2;
    --line: #d9e1d6;
    --field: #86978b;
    --serif: Georgia, 'Times New Roman', serif;
    --radius: 1.25rem;
    font: 100%/1.5 Inter, system-ui, sans-serif;
    color: var(--body);
    background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); }
h1, .idea h3, .day-plan h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.15rem, 4.4vw, 3.65rem); line-height: 1.07; letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: 1.22rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1.06rem; }
a { color: var(--plum); text-underline-offset: .18em; }
button, select, input, textarea { font: inherit; color: inherit; }
button, .primary, .tools a, .mast .profile-link {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 44px; padding: .6rem 1rem; border: 1px solid var(--field); border-radius: .75rem;
    background: var(--surface); color: var(--sage);
    font-size: .92rem; font-weight: 650; line-height: 1.3; text-align: center; text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .53; cursor: default; }
.primary, #confirm-prep, #install-app, #preferences > button, #push-save, #fill-week, #create-family-list {
    border-color: var(--plum); background: var(--plum); color: white;
}
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
.icon { width: 1.18em; height: 1.18em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.mast { background: var(--surface); border-bottom: 1px solid var(--line); }
.mast-inner, main { width: min(100% - 2.25rem, 72rem); margin-inline: auto; }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5rem; }
.identity { position: relative; display: grid; align-content: center; padding-left: 3.5rem; }
.app-brand { color: var(--ink); font: bold 1.85rem/.96 var(--serif); letter-spacing: -.06em; text-decoration: none; }
.app-brand img { position: absolute; top: 50%; left: 0; width: 2.9rem; height: 2.9rem; transform: translateY(-50%); border-radius: .85rem; }
.brand { color: var(--muted); font-size: .73rem; font-weight: 550; margin-top: .22rem; text-decoration: none; }
nav { display: flex; gap: .25rem; }
nav a { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .45rem .8rem; border-radius: .85rem; color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; }
:is(nav a, .mast .profile-link)[aria-current="page"] { color: var(--plum); background: var(--blush); }
.mast .profile-link { border-radius: 2rem; background: transparent; padding-inline: .95rem; }
main { padding-block: clamp(1.4rem, 3.1vw, 2.6rem) 4rem; }
.opening { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: clamp(.85rem, 2vw, 1.5rem); }
.opening h1 { font-size: clamp(2rem, 4vw, 3rem); }
#idea-label { color: var(--sage); font-size: .74rem; font-weight: 750; letter-spacing: .085em; text-transform: uppercase; }
#date { color: var(--muted); font-size: .92rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); align-items: start; gap: clamp(1rem, 2.3vw, 1.75rem); }
.idea, .day-plan { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.idea { overflow: clip; box-shadow: 0 .45rem 1.8rem rgb(44 50 38 / 5%); }
.picture { background: var(--pale-sage); }
.picture img { width: 100%; height: auto; aspect-ratio: 2.65; display: block; object-fit: cover; }
.inner, .day-plan { padding: clamp(1.15rem, 2.35vw, 1.85rem); }
.inner { padding-top: 1rem; }
.idea-heading, #idea-label, .plan-heading { display: flex; align-items: center; gap: .55rem; }
.idea-heading, .plan-heading { justify-content: space-between; }
#idea-label .icon { width: 1rem; height: 1rem; }
#save-idea { border: 1px solid var(--line); border-radius: 50%; width: 44px; padding: 0; color: var(--plum); }
#save-idea .icon { width: 1.25rem; height: 1.25rem; }
#save-idea[aria-pressed=true] { background: var(--blush); border-color: var(--plum); }
#save-idea[aria-pressed=true] .icon { fill: currentColor; }
.idea h3 { margin: .15rem 0 .65rem; font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.1; letter-spacing: -.035em; text-wrap: pretty; }
#ingredients, #season-note, .slots small { color: var(--muted); }
#ingredients { font-size: .96rem; }
#season-note { margin-top: .65rem; }
.idea-actions, .actions, .tools { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; }
#surprise { border-color: transparent; background: var(--pale-sage); }
.idea-options { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 1.25rem; margin-top: .55rem; }
.idea-options details { margin: 0; border: 0; padding: 0; background: transparent; }
.idea-options summary { font-size: .88rem; }
.idea-options ul { margin: 0 0 .5rem; padding-left: 1.25rem; }
.assign { display: flex; flex-wrap: wrap; gap: .4rem; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.55rem, 1.5vw, 1rem); }
.tone-photos { --tile: #fae7e9; --edge: #e7cbd0; --accent: #773a55; }
.tone-preparer { --tile: #f9edcf; --edge: #e6d6ad; --accent: #674915; }
.tone-stocks { --tile: #e2eee2; --edge: #c7d9c9; --accent: #345b47; }
.tone-courses { --tile: #f3e7d9; --edge: #dfcdb9; --accent: #654931; }
.task-card, .view-heading { background: var(--tile); color: var(--accent); border: 1px solid var(--edge); border-radius: var(--radius); }
.task-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .45rem .3rem; padding: clamp(.75rem, 2vw, 1.35rem); text-decoration: none; }
.task-card .task-art { grid-column: 1 / -1; width: min(100%, 10rem); justify-self: center; }
.task-art { display: block; height: auto; aspect-ratio: 8 / 5; }
.task-card span { font-size: clamp(.96rem, 1.5vw, 1.2rem); font-weight: 700; line-height: 1.2; }
.task-card > .icon { width: .95rem; }
.view-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; padding: .8rem 1.1rem; margin-bottom: 1.2rem; }
.view-heading .task-art { width: clamp(4.5rem, 12vw, 8rem); }
.view-heading h1 { flex: 1; min-width: min(100%, 9rem); font-size: clamp(1.7rem, 4vw, 2.8rem); }
.view-heading a { display: inline-flex; align-items: center; min-height: 44px; }
.day-plan { grid-column: 1 / -1; }
.home-ad {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--line);
}
.home-ad .scv-ad-label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .75rem; }
.home-ad:has(> ins[data-ad-status="unfilled"]) { display: none; }
@media print { .home-ad { display: none !important; } }
.day-plan h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.plan-heading a { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; text-decoration: none; font-size: .85rem; font-weight: 650; }
.slots article { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem 0; }
.slots article + article { border-top: 1px solid var(--line); }
.slot-icon { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: .8rem; background: var(--pale-sage); color: var(--sage); }
.slots article:nth-child(2) .slot-icon { background: var(--blush); color: var(--plum); }
.slots article p { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.slots button { margin: .3rem .15rem 0 0; font-size: .8rem; padding-inline: .55rem; }
#status:not(:empty) { margin: 1rem 0; border-left: 3px solid var(--sage); background: var(--pale-sage); padding: .65rem 1rem; }
main > section[data-view] { max-width: 53rem; margin-inline: auto; }
main > section[data-view] > h1 { margin-bottom: 1.3rem; }
main > section[data-view] > h2 { margin: 1.8rem 0 .75rem; }
main > section[data-view] > p { margin-block: .9rem; }
main > section[data-view] > a { display: inline-flex; align-items: center; min-height: 44px; }
main > section[data-view] > .tools { margin-bottom: 1rem; }
.app-footer {
    width: min(100% - 2.25rem, 72rem);
    margin-inline: auto;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    color: var(--muted);
    font-size: .88rem;
}
.app-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.tools a { border-color: var(--line); }
details { margin-block: .9rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
summary { padding: .75rem 0; min-height: 44px; color: var(--sage); font-weight: 650; cursor: pointer; }
details[open] { padding-bottom: .75rem; }
details p { margin-block: .55rem; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem; margin: 1.25rem 0; border-radius: .95rem; background: var(--pale-sage); color: var(--sage); text-align: center; }
.week-nav strong { font-size: .96rem; }
.week-nav button { flex: none; width: 44px; padding: 0; border-color: transparent; font-size: 1.25rem; }
.week-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .55rem; }
.week-days button { display: block; text-align: left; border-color: var(--line); }
.week-days small { display: block; margin-top: .25rem; font-size: .8rem; font-weight: 450; overflow-wrap: anywhere; }
button[aria-pressed=true] { border-color: var(--sage); background: var(--pale-sage); }
#week-days button[aria-pressed=true] { box-shadow: inset 0 0 0 1px var(--sage); }
form, fieldset, #prep-meals article, #favorite-meals article, #history-weeks article {
    min-width: 0; margin: 1rem 0; padding: clamp(1rem, 2.8vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
legend { color: var(--sage); font-weight: 700; padding-inline: .35rem; }
label { line-height: 1.5; }
form label, fieldset label, #backup-repas label { display: block; margin-bottom: .85rem; }
form p, fieldset p { margin-block: .75rem; }
select, input:not([type=checkbox]), textarea { display: block; min-height: 44px; max-width: 100%; margin-top: .35rem; border: 1px solid var(--field); border-radius: .65rem; padding: .5rem .65rem; background: #fff; }
input:not([type=checkbox]), select { width: min(100%, 30rem); }
input[type=checkbox] { accent-color: var(--sage); width: 1.1rem; height: 1.1rem; flex: none; vertical-align: middle; }
#preferences fieldset { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 0; padding: .8rem; border-radius: .85rem; }
#preferences fieldset label { margin: 0; }
#preferences fieldset input { width: 6rem; }
#backup-repas label { margin: .8rem 0 .3rem; }
#prep-meals { display: grid; gap: .8rem; }
#prep-meals article { margin: 0; display: flow-root; }
#prep-meals img { float: right; width: clamp(4.5rem, 11vw, 7rem); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: .85rem; margin: 0 0 .65rem .85rem; }
#prep-meals p { margin: .35rem 0; color: var(--muted); }
#prep-meals a, #favorite-recipes a { display: inline-flex; align-items: center; min-height: 44px; }
#prep-meals label { display: block; clear: both; padding-top: .55rem; color: var(--muted); font-size: .9rem; }
#prep-meals select { width: 100%; font-size: 1rem; }
#shopping h2, #inventory h2, #family-items h2 { margin: 1.5rem 0 .5rem; color: var(--sage); }
.list-links { display: flex; align-items: center; flex-wrap: wrap; column-gap: 1rem; }
.list-links a, .empty-shopping a { display: inline-flex; align-items: center; min-height: 44px; font-size: .92rem; }
#courses .week-nav { margin-bottom: .2rem; }
#shopping-progress { margin: .55rem 0 1.1rem; color: var(--sage); font-weight: 650; }
#shopping-meter { display: block; width: 100%; height: .4rem; margin-top: .5rem; overflow: hidden; border: 0; border-radius: 1rem; background: var(--line); color: var(--sage); }
#shopping-meter::-webkit-progress-bar { background-color: var(--line); }
#shopping-meter::-webkit-progress-value { background-color: var(--sage); }
#shopping-meter::-moz-progress-bar { background-color: var(--sage); }
.empty-shopping { background: var(--pale-sage); border-radius: var(--radius); padding: 1rem 1.25rem; margin-block: .8rem; }
.list-note { font-size: .88rem; color: var(--muted); }
#inventory ul, #shopping ul, #family-items ul, #plant-list { list-style: none; margin: .45rem 0 1rem; padding: .15rem 1rem; border: 1px solid var(--line); border-radius: .95rem; background: var(--surface); }
#inventory li, #shopping li, #plant-list li, #received-meals label { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-height: 48px; padding-block: .25rem; overflow-wrap: anywhere; }
:is(#inventory, #shopping, #family-items, #plant-list) li + li, #received-meals label + label { border-top: 1px solid var(--line); }
#shopping label, #family-items label { flex: 1; display: flex; align-items: center; gap: .7rem; min-height: 44px; overflow-wrap: anywhere; }
#shopping input:checked + span, #family-items input:checked + span { text-decoration: line-through; color: var(--muted); }
#received-meals label { justify-content: flex-start; }
#received-meals small { display: block; }
#ciqual-values { display: grid; grid-template-columns: 1fr auto; max-width: 27rem; margin: .75rem 0; }
#ciqual-values dt, #ciqual-values dd { margin: 0; padding: .4rem; border-bottom: 1px solid var(--line); }
#ciqual-values dd { text-align: right; font-variant-numeric: tabular-nums; }
#share-sheet { width: min(32rem, calc(100% - 2rem)); max-height: 85vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; color: var(--body); background: var(--surface); }
#share-sheet::backdrop { background: rgb(39 41 35 / 53%); }
#share-content { width: 100%; resize: vertical; }
#quick-recipe {
    width: min(58rem, calc(100% - 2rem)); max-width: none; max-height: min(52rem, 92dvh);
    overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--body);
}
#quick-recipe[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#quick-recipe::backdrop { background: rgb(39 41 35 / 53%); }
body:has(#quick-recipe[open]) { overflow: hidden; }
.quick-recipe-bar { padding: .55rem clamp(1rem, 4vw, 2rem); background: var(--surface); }
.quick-recipe-bar form { margin: 0; padding: 0; border: 0; background: transparent; }
.quick-recipe-bar button { padding-inline: .5rem; border-color: transparent; background: transparent; }
.quick-recipe-scroll { overflow: auto; overscroll-behavior: contain; padding: .6rem clamp(1rem, 4vw, 2rem) 1.75rem; }
.quick-recipe-scroll h1 { font-size: clamp(1.9rem, 4.5vw, 2.85rem); }
#quick-recipe-meta, #quick-recipe-status { margin-top: .75rem; color: var(--muted); }
.quick-recipe-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 1.6rem; margin-top: 1.35rem; }
.quick-recipe-grid h2 { margin-bottom: .65rem; }
.quick-recipe-grid ul, .quick-recipe-grid ol { margin: 0; padding-left: 1.35rem; }
.quick-recipe-grid li { padding-left: .2rem; margin-bottom: .6rem; overflow-wrap: anywhere; }
.quick-recipe-grid li:last-child { margin-bottom: 0; }
.quick-recipe-grid li::marker { color: var(--sage); font-weight: 700; }
.quick-recipe-footer { display: flex; flex-wrap: wrap; align-items: center; column-gap: .85rem; border-top: 1px solid var(--line); }
.quick-recipe-footer .primary { padding-inline: .75rem; background: var(--plum); color: white; border-color: var(--plum); }
.quick-recipe-footer a { display: inline-flex; gap: .45rem; align-items: center; min-height: 44px; font-weight: 650; }
p:empty { margin: 0 !important; }
@media (hover: hover) {
    button:enabled:hover, .tools a:hover, nav a:hover, .mast .profile-link:hover { box-shadow: inset 0 0 0 1px currentColor; }
    .primary:hover { background: #592440; }
    .task-card:hover span, .plan-heading a:hover, .brand:hover { text-decoration: underline; }
}
@media (max-width: 61rem) {
    main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
    .mast-inner { min-height: 4.25rem; }
    nav { position: fixed; z-index: 5; inset: auto 0 0; justify-content: center; padding: .25rem max(.25rem, env(safe-area-inset-left)) calc(.25rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
    nav a { flex: 1; min-width: 0; max-width: 7rem; flex-direction: column; gap: .13rem; min-height: 51px; padding: .25rem .1rem; border-radius: .7rem; font-size: .74rem; }
    nav .icon { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 46rem) {
    .dashboard { grid-template-columns: minmax(0, 1fr); }
    .idea { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5rem, 27%); align-items: start; gap: .15rem .65rem; padding: 1rem; }
    .idea:has(.picture[hidden]) { grid-template-columns: 1fr; }
    .idea .inner { display: contents; }
    .idea :where(.inner > *) { grid-column: 1 / -1; }
    .idea h3, .idea #ingredients { grid-column: 1; }
    .idea-heading { grid-row: 1; }
    .idea h3 { grid-row: 2; margin-block: .35rem .15rem; font-size: clamp(1.35rem, 5.2vw, 1.8rem); }
    .idea #ingredients { grid-row: 3; }
    .picture { grid-column: 2; grid-row: 2 / 4; position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; margin-top: .35rem; border-radius: .85rem; }
    .picture img { position: absolute; width: 100%; height: 100%; }
    .idea-actions { margin-top: .6rem; }
    .idea-options { margin-top: 0; }
    .task-card .task-art { width: min(100%, 7.5rem); }
    #quick-recipe { box-sizing: border-box; width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
    .quick-recipe-grid { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
    .quick-recipe-bar { padding-top: max(.55rem, env(safe-area-inset-top)); }
    .quick-recipe-footer { padding-top: .45rem; padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 26rem) {
    .mast-inner, main { width: calc(100% - 1.75rem); }
    .mast-inner { gap: .45rem; }
    .identity { padding-left: 2.85rem; }
    .app-brand img { width: 2.45rem; height: 2.45rem; }
    .app-brand { font-size: 1.65rem; }
    .mast .profile-link { padding-inline: .7rem; }
    .idea-actions { gap: .4rem; }
    .idea-actions > * { font-size: .86rem; padding-inline: .65rem; }
    .week-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 22rem) {
    .mast .profile-link { font-size: .84rem; }
    .idea-actions .primary .icon { display: none; }
}

.photo-week-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem; text-align: center; }
.photo-week-nav button { padding-inline: .85rem; }
.photo-week, .photo-slots { display: grid; gap: .28rem; margin-block: .6rem 1rem; }
.photo-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.photo-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.photo-week button, .photo-slots button { display: block; min-width: 0; padding: .5rem .1rem; font-size: clamp(.72rem, 2.45vw, .93rem); }
.photo-week button { position: relative; min-height: 51px; }
.photo-week .has-photo::after { content: ''; width: .3rem; height: .3rem; position: absolute; bottom: .28rem; left: calc(50% - .15rem); background: currentColor; border-radius: 50%; }
.photo-week [aria-pressed=true], .photo-slots [aria-pressed=true] { border-color: var(--plum); color: var(--plum); background: var(--blush); }
.photo-capture { padding: clamp(.85rem, 3vw, 1.4rem); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.photo-capture .actions { margin-top: 0; }
.photo-capture details { margin-top: .9rem; }
.photo-details-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .7rem; margin-top: .65rem; }
.photo-details-fields select, .photo-details-fields input { width: 100%; }
.photo-note { margin-top: .65rem; color: var(--muted); font-size: .85rem; }
.photo-results { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-top: .9rem; scroll-margin-bottom: 4.5rem; }
.photo-results > article { overflow: clip; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.photo-results img { display: block; width: 100%; max-height: 24rem; aspect-ratio: 4 / 3; object-fit: cover; background: var(--pale-sage); }
.photo-caption { padding: .75rem; display: grid; gap: .35rem; }
.photo-caption a { display: flex; align-items: center; min-height: 44px; }
.photo-remove { justify-self: start; border-color: transparent; padding-left: 0; }
.photo-reminder-form { max-width: 31rem; }
.photo-reminder-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .55rem; margin-block: .55rem; }
.photo-reminder-row label { display: flex; gap: .45rem; align-items: center; min-height: 44px; }
.photo-reminder-row input[type=time] { width: auto; min-width: 6rem; }
