:root{color-scheme:light;--bg:#f5f7f5;--surface:#fff;--soft:#edf3ee;--ink:#21372c;--muted:#596b60;--line:#dce5de;--green:#226445;--accent-ink:#fff;--warm:#f8f1e6;--shadow:0 6px 28px #19392408;--focus:#278656}
:root[data-theme=dark]{color-scheme:dark;--bg:#111714;--surface:#1a231e;--soft:#24342a;--ink:#edf5ef;--muted:#b0c2b5;--line:#384b3e;--green:#9cdeb6;--accent-ink:#123121;--warm:#353025;--shadow:0 6px 28px #0002;--focus:#a1e5bb}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}button,input,select{font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--surface);border-radius:12px;min-height:44px;padding:10px 13px;max-width:100%}button{cursor:pointer;line-height:1.4;white-space:normal;transition:background .15s,border-color .15s}button:hover{background:var(--soft);border-color:var(--green)}button:focus-visible,input:focus-visible,select:focus-visible,[role=button]:focus-visible{outline:3px solid var(--focus);outline-offset:3px}input,select{min-width:0}input::placeholder{color:var(--muted);opacity:1}input[type=number]{font-variant-numeric:tabular-nums}.primary{background:var(--green);color:var(--accent-ink);border-color:var(--green);font-weight:600}.primary:hover{background:var(--green);filter:brightness(1.08)}header{display:flex;align-items:center;flex-wrap:wrap;gap:18px;padding:18px max(24px,4vw);border-bottom:1px solid var(--line);background:var(--surface)}.brand{text-decoration:none;color:var(--ink);font-size:32px;font-weight:750;letter-spacing:-1.5px;white-space:nowrap}.brand>span:first-child{color:var(--green);margin-right:8px}.dot{color:var(--green)}nav{display:flex;gap:5px;flex-wrap:wrap}nav button{border-color:transparent;background:transparent;color:var(--muted);font-weight:600}nav button.active,.shop-tabs button.active{background:var(--soft);color:var(--green);border-color:var(--line)}nav b,.shop-tabs b{display:inline-block;padding:1px 7px;border-radius:7px;background:var(--green);color:var(--accent-ink);font-size:12px;margin-left:4px}.theme-control{display:flex;align-items:center;gap:8px;margin-left:auto;color:var(--muted);font-size:13px}.theme-control select{font-size:14px}.local{font-size:12px;color:var(--muted)}main{max-width:1440px;margin:auto;padding:42px 4vw}.intro{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:30px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.7px;color:var(--muted)}h1{font-size:clamp(30px,3.5vw,44px);line-height:1.15;letter-spacing:-1.5px;margin:12px 0 14px;font-weight:750}h2{font-size:24px;letter-spacing:-.6px;line-height:1.3;margin:10px 0}h3{line-height:1.4}p{color:var(--muted);margin:6px 0;line-height:1.65}.mark{font-size:62px;background:var(--soft);border-radius:32px;padding:12px 25px;transform:rotate(7deg)}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:20px;margin-bottom:24px;box-shadow:var(--shadow)}.toolbar label,.field{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px;font-weight:600}.toolbar label{min-width:155px}.toolbar input[type=date]{width:165px;font-size:16px}.toolbar .duration{min-width:95px}.duration input{width:95px;font-size:18px}.weekday{font-size:12px;font-weight:400;text-transform:capitalize}.push{margin-left:auto}.stats{color:var(--muted);white-space:nowrap}.stats strong{font-size:23px;color:var(--ink)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:20px}.day,.recipe{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);overflow:hidden}.dayhead{padding:18px 20px;display:flex;justify-content:space-between;gap:12px;align-items:center;border-bottom:1px solid var(--line);font-weight:700;font-size:17px}.dayhead span{color:var(--muted);font-size:14px;font-weight:500;white-space:nowrap}.slot{padding:18px}.slot+.slot{border-top:1px solid var(--line)}.slotlabel{font-size:12px;letter-spacing:1px;text-transform:uppercase;color:var(--muted);font-weight:650;margin-bottom:12px}.add{width:100%;min-height:65px;border-style:dashed;background:var(--soft);color:var(--green)}.meal{border-radius:14px;background:var(--soft);padding:12px}.meal.lunch{background:var(--warm)}.mealname{min-height:44px;cursor:pointer;font-weight:600;line-height:1.5;overflow-wrap:anywhere;display:flex;align-items:center}.portion{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:10px;color:var(--muted);font-size:13px}.portion button{min-width:40px;padding:8px}.portion input{width:55px;padding:6px;text-align:center}.portion .remove{margin-left:auto}.snack-slot{margin-top:14px;background:var(--soft);border-top:2px solid var(--line)!important}.snack-slot .slotlabel{color:var(--green)}.endnote{margin-top:26px;background:var(--soft);border:1px solid var(--line);border-radius:20px;padding:24px;display:flex;gap:20px;justify-content:space-between;align-items:center}.endnote strong{font-size:17px}.recipe{padding:24px}.recipe .emoji{font-size:34px;margin-bottom:16px}.recipe h3{font-size:20px;margin-bottom:8px;overflow-wrap:anywhere}.recipe p{font-size:14px;overflow-wrap:anywhere}.recipe button{margin-top:20px}.tag{display:inline-block;background:var(--soft);color:var(--green);border-radius:8px;padding:4px 9px;font-size:12px;font-weight:600}.search{width:100%;font-size:16px}.shop-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:24px}.shop-tabs button{font-weight:600}.list-heading{display:flex;justify-content:space-between;align-items:center;gap:24px;max-width:900px;margin:0 auto 20px}.list-heading h2{font-size:26px}.list-actions{display:flex;gap:8px;flex-wrap:wrap}.shopping{max-width:900px;margin:auto;background:var(--surface);border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:var(--shadow)}.list-progress{padding:20px 24px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:20px;color:var(--muted);font-size:14px}.list-progress progress{width:140px;height:8px;margin-left:auto;accent-color:var(--green)}.item{display:flex;align-items:center;gap:16px;padding:17px 24px;min-height:66px;border-bottom:1px solid var(--line);cursor:pointer}.item:last-child{border:0}.item input{width:22px;height:22px;min-height:22px;flex-shrink:0;accent-color:var(--green)}.item span{overflow-wrap:anywhere;min-width:0}.item strong{margin-left:auto;white-space:nowrap;font-variant-numeric:tabular-nums}.item.done{background:var(--soft);color:var(--muted)}.item.done span{text-decoration:line-through}.shop-note{text-align:center;max-width:750px;margin:18px auto!important}.history-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:18px}.history-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:24px;gap:12px;border-radius:20px;box-shadow:var(--shadow)}.history-card strong{font-size:20px}.history-card>span:not(.tag){color:var(--muted);font-size:14px}.history-card .history-open{color:var(--green)!important;font-weight:600;margin-top:6px}.empty{padding:45px 24px;text-align:center;color:var(--muted)}.empty strong{display:block;color:var(--ink);font-size:22px;line-height:1.4;margin-bottom:12px}.empty p{margin-top:18px}.hint{font-size:14px;color:var(--muted);margin:16px 0}footer{margin-top:45px;padding:24px 0;text-align:center;color:var(--muted);font-size:13px;line-height:1.9}footer small{font-size:12px}.text{border:0;background:none;color:var(--green);font-size:13px;padding:8px}dialog{background:var(--surface);color:var(--ink);width:min(640px,94vw);max-height:90dvh;border:1px solid var(--line);border-radius:24px;padding:28px;box-shadow:0 24px 90px #0004}dialog::backdrop{background:#07150d88;backdrop-filter:blur(6px)}.modalhead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.modalhead h2{margin:0}.close{font-size:22px;min-width:44px;padding:5px}.choices{display:grid;gap:10px;margin:18px 0}.choice{display:flex;align-items:center;gap:12px;text-align:left;flex-wrap:wrap;overflow-wrap:anywhere}.choice span{font-size:25px}.choice small{color:var(--muted);margin-left:auto;white-space:nowrap}.formgrid{display:grid;grid-template-columns:minmax(0,1fr) 170px;gap:16px;margin-bottom:20px}.field input,.field select{width:100%;font-size:16px}.ingredient{display:grid;grid-template-columns:minmax(0,1fr) 95px 90px 44px;gap:8px;margin-bottom:10px}.ingredient input,.ingredient select{width:100%;font-size:16px}.ingredient button{padding:6px}.actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:24px}.danger{color:#b73535}:root[data-theme=dark] .danger{color:#ff9b9b}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:10;background:var(--green);color:var(--accent-ink);padding:16px 22px;border-radius:15px;display:none;width:max-content;max-width:calc(100vw - 32px);box-shadow:0 8px 30px #0003}
@media(max-width:1050px){.local{flex-basis:100%;text-align:right}.toolbar .primary{margin-left:auto}.mark{display:none}}
@media(max-width:650px){header{padding:16px;gap:12px}.brand{font-size:28px}nav{order:3;width:100%;display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:3px}nav button{padding:10px 6px;font-size:13px;min-width:0}.local{order:4;text-align:left;font-size:11px}.theme-control>span{display:none}main{padding:28px 16px}.intro{margin-bottom:24px}h1{letter-spacing:-1px}.eyebrow{letter-spacing:1px}.toolbar{padding:16px;gap:12px}.toolbar label{flex:1;min-width:135px}.toolbar input[type=date]{width:100%}.toolbar .duration{flex:0 1 100px}.toolbar .primary{width:100%;margin:0}.stats{margin-left:auto}.grid{gap:16px}.endnote{align-items:flex-start;flex-direction:column}.list-heading{align-items:flex-start;flex-direction:column;gap:14px}.list-heading h2{font-size:23px}.list-progress{padding:18px;gap:12px;flex-wrap:wrap}.list-progress progress{width:100px}.item{padding:16px;gap:12px}.formgrid{grid-template-columns:1fr}dialog{padding:20px}.ingredient{grid-template-columns:minmax(0,1fr) 85px 44px;gap:8px;background:var(--soft);padding:12px;border-radius:14px;margin-bottom:12px}.ingredient input:first-child{grid-column:1/-1}.ingredient input:nth-child(2){grid-column:1}.ingredient select{grid-column:2}.ingredient button{grid-column:3}.choice small{width:100%;margin-left:0}.shop-tabs button{flex:1}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@media print{:root,:root[data-theme=dark]{color-scheme:light;--bg:#fff;--surface:#fff;--soft:#fff;--ink:#000;--muted:#444;--line:#ddd;--green:#222}header,footer,.intro,.toolbar,.shop-tabs,.list-actions,.shop-note,#toast{display:none!important}main{padding:0}.shopping{border:0;box-shadow:none;max-width:none}.list-heading{max-width:none}.item{break-inside:avoid}.list-progress progress{display:none}}
[hidden]{display:none!important}.account{display:flex;align-items:center;flex-wrap:wrap;gap:8px;width:100%;padding-top:12px;border-top:1px solid var(--line)}#account-email{font-size:13px;color:var(--muted);overflow-wrap:anywhere;margin-right:auto}.account button{font-size:13px}#auth-view{padding:42px 16px}.auth-card{max-width:480px;margin:auto;background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:32px;box-shadow:var(--shadow)}.auth-card h1{font-size:34px}.auth-card form{display:grid;gap:16px;margin-top:24px}.auth-links{display:flex;flex-wrap:wrap;justify-content:center;margin-top:14px}.auth-notice{background:var(--warm);border:1px solid var(--line);padding:14px;border-radius:12px;margin-top:18px}#auth-message,#access-message{color:var(--ink);font-size:14px;overflow-wrap:anywhere}button:disabled{cursor:wait;opacity:.6}#invite-form{display:grid;gap:12px;margin-top:20px}.access-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}.access-row>span{min-width:0;overflow-wrap:anywhere}.access-row small{display:block;color:var(--muted);margin-top:4px}.access-row button{flex-shrink:0}textarea{font:inherit;color:var(--ink);background:var(--soft);border:1px solid var(--line);border-radius:12px;padding:12px;width:100%;overflow-wrap:anywhere}#invite-result{margin-top:16px}@media(max-width:480px){.auth-card{padding:24px}.access-row{align-items:flex-start;flex-direction:column}#account{order:5}.auth-card h1{font-size:30px}}
.access-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.access-actions button{font-size:13px}@media(max-width:480px){.access-actions{justify-content:flex-start}}
#account.account{width:auto;border:0;padding:0;gap:0}.profile-button{display:inline-flex;gap:9px;align-items:center;font-weight:600}.profile-avatar{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--soft);color:var(--green);font-size:12px}.profile-avatar.large{width:58px;height:58px;font-size:24px;font-weight:700;flex-shrink:0}.profile-identity{display:flex;align-items:center;gap:16px;padding:8px 0 24px;border-bottom:1px solid var(--line)}.profile-identity>div{min-width:0}.profile-identity strong{display:block;overflow-wrap:anywhere;margin-bottom:7px}.profile-options{display:grid;gap:10px;margin:22px 0}.profile-options button{display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;padding:14px 16px}#profile-password-fields{display:grid;gap:14px;border-top:1px solid var(--line);padding-top:20px}#profile-password-fields .hint{margin:0}.profile-footer{border-top:1px solid var(--line);padding-top:20px;margin-top:20px;display:flex;justify-content:flex-end}#profile-message{color:var(--ink);font-size:14px}@media(max-width:650px){#account.account{order:0}.theme-control{margin-left:auto}.profile-button{padding:8px 10px}.profile-avatar{display:none}.profile-avatar.large{display:inline-flex}.profile-footer button{width:100%}}
.history-entry{display:flex;flex-direction:column;min-width:0;gap:8px}.history-entry .history-card{width:100%;flex:1}.history-delete{align-self:flex-end;font-size:13px}
.export-options{display:grid;gap:12px;margin:20px 0}.export-options label{display:flex;align-items:flex-start;gap:14px;padding:16px;background:var(--soft);border:1px solid var(--line);border-radius:14px;cursor:pointer}.export-options input{flex-shrink:0;width:22px;height:22px;min-height:22px;accent-color:var(--green)}.export-options strong,.export-options small{display:block}.export-options small{color:var(--muted);margin-top:5px;line-height:1.5}

/* Responsive layout: content may grow without clipping or overlapping. */
body{-webkit-text-size-adjust:100%}
button,input,select,textarea{touch-action:manipulation}
button{overflow-wrap:anywhere}
header>*{min-width:0}
.intro>div,.list-heading>div,.endnote>div{min-width:0}
h1,h2,h3,.hint,.weekday,.history-card,.profile-options{overflow-wrap:anywhere}
nav button{display:flex;align-items:center;justify-content:center;gap:6px}
nav b{margin-left:0;flex-shrink:0}
.local{overflow-wrap:anywhere}
.plan-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px 24px;padding:24px}
.period-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(100px,.65fr);gap:16px;grid-column:1/-1}
.plan-toolbar label{min-width:0}
.plan-toolbar input[type=date],.plan-toolbar .duration input{width:100%;min-width:0;height:48px}
.period-navigation{display:flex;align-items:center;gap:12px;grid-column:1}
.period-navigation button{flex:0 0 44px;padding:8px}
.period-navigation span{font-size:13px;color:var(--muted)}
.plan-toolbar .stats{margin:0;text-align:right;grid-column:2;grid-row:2}
.plan-toolbar>.primary{grid-column:1/-1;width:100%;margin:0;min-height:50px}
.plan-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:stretch}
.day{display:grid;grid-template-rows:auto repeat(4,1fr)}
.dayhead{padding:18px;flex-wrap:wrap;min-height:64px}
.slot{display:flex;flex-direction:column;padding:16px;min-width:0}
.slotlabel{margin-bottom:10px;line-height:1.5}
.slot>.add,.slot>.meal{flex:1;min-height:140px}
.meal{display:flex;flex-direction:column;gap:12px;min-width:0}
.mealname{display:block;min-height:48px;padding:2px 0;line-height:1.5}
.portion{display:grid;grid-template-columns:44px 52px 44px minmax(0,1fr) 44px;gap:4px;margin-top:auto;padding-top:2px}
.portion button{min-width:0;width:44px;height:44px;padding:0}
.portion input{width:100%;height:44px;font-size:16px;appearance:textfield;-moz-appearance:textfield}
.portion input::-webkit-inner-spin-button,.portion input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.portion>span{font-size:12px;text-align:center;overflow-wrap:anywhere}
.portion .remove{margin:0;background:transparent;border-color:transparent;color:var(--muted)}
.snack-slot{margin-top:8px;border-top:1px dashed var(--line)!important}
.recipe{display:flex;flex-direction:column;align-items:flex-start;padding:22px}
.recipe .tag{max-width:100%}
.recipe button{margin-top:auto;width:100%}
.recipe p:last-of-type{margin-bottom:22px}
.choice{display:grid;grid-template-columns:36px minmax(0,1fr) 20px;gap:12px;padding:16px;min-height:84px}
.choice .choice-emoji{font-size:28px;text-align:center}
.choice .choice-details{min-width:0;font-size:15px}
.choice-details strong{display:block;font-weight:600;line-height:1.5}
.choice .choice-details small{display:block;margin:4px 0 0;font-size:13px;white-space:normal}
.choice .choice-arrow{font-size:24px;color:var(--muted);text-align:right}
.list-actions{flex-shrink:0;max-width:100%}
.item{display:grid;grid-template-columns:22px minmax(0,1fr) minmax(60px,auto)}
.item strong{text-align:right;white-space:normal;overflow-wrap:anywhere;max-width:130px}
.history-card{overflow-wrap:anywhere}
.modalhead{align-items:flex-start}
.modalhead .close{flex:0 0 44px}
dialog{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:calc(100dvh - 32px)}
.export-options label>span{min-width:0;overflow-wrap:anywhere}
@supports(grid-template-rows:subgrid){.day{grid-row:span 5;grid-template-rows:subgrid;row-gap:0}}
@media(min-width:1100px){
 .plan-toolbar{grid-template-columns:minmax(0,1fr) auto}
 .period-fields{grid-column:1;grid-row:1}
 .plan-toolbar>.primary{grid-column:2;grid-row:1;width:auto;max-width:240px}
}
@media(max-width:850px){
 header{gap:12px}
 header nav{order:3;display:grid;grid-template-columns:1fr 1fr 1.45fr;width:100%;gap:4px;background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:4px}
 nav button{min-width:0;padding:10px 6px;font-size:13px;line-height:1.35}
 header .local{order:4;flex-basis:100%;text-align:left}
 .list-heading{flex-direction:column;align-items:flex-start;gap:16px}
}
@media(max-width:650px){
 header{padding:14px 16px}
 .brand{font-size:27px}
 .theme-control{gap:0}
 .theme-control select{font-size:16px;max-width:130px;padding:8px}
 #account .profile-button{font-size:14px}
 main{padding:26px 16px}
 .intro{margin-bottom:22px}
 h1{font-size:32px;line-height:1.2}
 .intro p{font-size:14px;line-height:1.65}
 .plan-toolbar{padding:16px;gap:16px 8px}
 .period-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 12px}
 .plan-toolbar .duration{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) 80px;align-items:center;gap:4px 12px}
 .duration input{grid-column:2;grid-row:1/3}
 .duration .weekday{grid-column:1}
 .period-navigation{gap:8px}
 .period-navigation span{display:none}
 .plan-toolbar .stats{font-size:13px;white-space:normal}
 .plan-toolbar .stats strong{font-size:20px}
 .plan-grid{grid-template-columns:minmax(0,1fr)}
 .day{grid-row:auto;grid-template-rows:auto repeat(4,auto)}
 .slot>.add,.slot>.meal{min-height:134px}
 .list-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px}
 .list-actions button:first-child{grid-column:1/-1}
 .shop-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .shop-tabs button{min-width:0;padding:10px 8px}
 .item{gap:10px;padding:16px 14px}
 dialog{width:calc(100% - 24px);padding:20px 16px;border-radius:20px;scrollbar-gutter:auto}
 .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .actions .primary{grid-column:1/-1;grid-row:1}
 .endnote{padding:20px;gap:16px}
 .endnote button{width:100%}
 footer{margin-top:28px;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
 #auth-view{padding:28px 16px}
 .auth-card{padding:24px 20px}
}
@media(max-width:360px){
 header{gap:8px;padding:12px}
 main{padding:24px 12px}
 .theme-control select{max-width:116px;font-size:14px}
 .brand{font-size:24px}
 .slot{padding:12px}
 .meal{padding:10px}
 .portion{grid-template-columns:44px 48px 44px minmax(0,1fr) 44px;gap:2px}
 .plan-toolbar input[type=date]{padding:10px 5px}
}
@media print{.day{display:block}.item{grid-template-columns:22px minmax(0,1fr) auto}}
