:root{
  --bg:#f7f7f4;--surface:#ffffff;--surface-subtle:#f1f2ee;--ink:#1e211d;--muted:#687066;
  --line:#dfe2dc;--line-strong:#cbd0c7;--accent:#365d3c;--accent-hover:#294b30;--accent-soft:#e7efe7;
  --danger:#9f342f;--danger-soft:#f8e8e6;--warning:#8a621d;--warning-soft:#fbf0d9;--shadow:0 14px 40px rgba(32,39,31,.10);
  --radius-sm:9px;--radius:13px;--radius-lg:18px;--sidebar:238px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);background:var(--bg)
}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:var(--bg);color:var(--ink);min-height:100vh}
button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.55}.hidden{display:none!important}
a{color:inherit}svg.icon{width:1.1em;height:1.1em;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.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}
:focus-visible{outline:3px solid rgba(54,93,60,.25);outline-offset:2px}

.app-shell{min-height:100dvh;display:grid;grid-template-columns:var(--sidebar) 1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);padding:22px 14px 18px;border-right:1px solid var(--line);background:rgba(255,255,255,.82);backdrop-filter:blur(18px);display:flex;flex-direction:column;z-index:30}
.brand{border:0;background:transparent;color:var(--ink);display:flex;align-items:center;gap:11px;padding:5px 8px;font-size:18px;font-weight:800;letter-spacing:-.3px;text-align:left}.brand.compact{padding:0}.brand-symbol{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:12px;font-weight:900;letter-spacing:-.4px}
.side-nav{display:grid;gap:4px;margin-top:30px}.side-nav button,.settings-link{min-height:44px;border:0;background:transparent;border-radius:10px;color:var(--muted);display:flex;align-items:center;gap:11px;padding:0 12px;text-align:left;font-weight:650}.side-nav button:hover,.settings-link:hover{background:var(--surface-subtle);color:var(--ink)}.side-nav button.active,.settings-link.active{background:var(--accent-soft);color:var(--accent)}.nav-icon{width:20px;height:20px;display:grid;place-items:center;font-size:18px}.sidebar-footer{margin-top:auto;display:grid;gap:8px}.status-pill{padding:8px 10px;border-radius:9px;background:var(--accent-soft);color:var(--accent);font-size:12px;font-weight:700}.status-pill.off{background:var(--surface-subtle);color:var(--muted)}
.content-shell{grid-column:2;min-width:0}.view{max-width:1160px;margin:0 auto;padding:42px 36px 80px}.mobile-header,.mobile-nav{display:none}

.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}.page-header h1{margin:0;font-size:clamp(30px,4vw,42px);line-height:1.08;letter-spacing:-1.4px}.page-header p{margin:7px 0 0;color:var(--muted);font-size:15px}.page-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:30px 0 12px}.section-head h2{margin:0;font-size:18px;letter-spacing:-.2px}.section-head p{margin:3px 0 0;color:var(--muted);font-size:13px}

.btn{min-height:42px;border:1px solid transparent;border-radius:10px;padding:9px 14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:750;line-height:1.1;transition:background .15s,border-color .15s,transform .08s}.btn:active{transform:translateY(1px)}.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{background:var(--accent-hover)}.btn-secondary{background:var(--surface);border-color:var(--line-strong);color:var(--ink)}.btn-secondary:hover{background:var(--surface-subtle)}.btn-subtle{background:transparent;color:var(--accent);border-color:transparent}.btn-subtle:hover{background:var(--accent-soft)}.btn-danger{background:var(--danger-soft);color:var(--danger)}.btn-small{min-height:34px;padding:6px 10px;font-size:13px}.btn-block{width:100%}.icon-button{width:40px;height:40px;border:1px solid var(--line);background:var(--surface);border-radius:10px;color:var(--muted);display:grid;place-items:center;padding:0}.icon-button:hover{color:var(--ink);background:var(--surface-subtle)}.icon-button.danger{color:var(--danger)}

.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.summary-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px}.summary-card.primary{background:var(--accent-soft);border-color:#d5e3d6}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.metric{font-size:31px;font-weight:850;letter-spacing:-1px;margin-top:5px}.metric-label{margin-top:3px;color:var(--muted);font-size:13px}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.panel-pad{padding:18px}.stack{display:grid;gap:12px}.row{display:flex;align-items:center;gap:10px}.row.wrap{flex-wrap:wrap}.between{justify-content:space-between}.muted{color:var(--muted)}.tiny{font-size:12px}.empty{padding:40px 20px;text-align:center;border:1px dashed var(--line-strong);border-radius:var(--radius);color:var(--muted)}.empty .empty-icon{width:42px;height:42px;border-radius:12px;background:var(--surface-subtle);display:grid;place-items:center;margin:0 auto 12px;color:var(--muted);font-size:22px}.empty strong{display:block;color:var(--ink);margin-bottom:4px}
.notice{display:flex;gap:10px;align-items:flex-start;border-radius:var(--radius);padding:12px 14px;background:var(--accent-soft);color:#315338;font-size:13px}.notice.warn{background:var(--warning-soft);color:#765315}.notice .notice-icon{margin-top:1px}

input,select,textarea{width:100%;border:1px solid var(--line-strong);background:var(--surface);border-radius:10px;padding:10px 11px;color:var(--ink);outline:none;min-height:42px}input:hover,select:hover,textarea:hover{border-color:#b8bfb5}input:focus,select:focus,textarea:focus{border-color:#79937d;box-shadow:0 0 0 3px rgba(54,93,60,.11)}textarea{min-height:104px;resize:vertical}label{display:grid;gap:6px;font-size:13px;font-weight:700;color:#343934}.field-help{font-size:12px;color:var(--muted);font-weight:500}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.field-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.form-actions{display:flex;gap:9px;align-items:center;justify-content:flex-end;padding-top:4px}.search-field{position:relative;max-width:520px}.search-field .search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}.search-field input{padding-left:39px}

.recipe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.recipe-card{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:box-shadow .16s,border-color .16s,transform .16s}.recipe-card:hover{border-color:#cbd2c8;box-shadow:0 9px 26px rgba(34,41,32,.08);transform:translateY(-1px)}.recipe-open{width:100%;border:0;background:transparent;padding:0;text-align:left;color:inherit}.recipe-img{height:150px;background:var(--surface-subtle);display:grid;place-items:center;color:#8c968a;background-size:cover;background-position:center}.recipe-img .icon{width:34px;height:34px}.recipe-info{padding:14px 14px 15px}.recipe-info h3{margin:0 0 7px;font-size:16px;line-height:1.3;letter-spacing:-.2px}.recipe-meta{color:var(--muted);font-size:12px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:9px}.tag{background:var(--surface-subtle);border-radius:999px;padding:4px 8px;font-size:11px;color:#596158}.recipe-card-actions{position:absolute;right:8px;top:8px;display:flex;gap:6px}.recipe-card-actions .icon-button{background:rgba(255,255,255,.94);box-shadow:0 1px 4px rgba(30,33,29,.08);border-color:rgba(210,214,207,.9)}.favorite-badge{position:absolute;left:9px;top:9px;width:30px;height:30px;border-radius:9px;background:rgba(255,255,255,.94);display:grid;place-items:center;color:#8a621d}

.list-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:13px 14px;border-bottom:1px solid var(--line)}.list-row:last-child{border-bottom:0}.list-icon{width:36px;height:36px;border-radius:10px;background:var(--surface-subtle);display:grid;place-items:center;color:#596258}.list-title{font-weight:760}.list-meta{font-size:12px;color:var(--muted);margin-top:3px}.expiry{font-size:12px;padding:5px 8px;border-radius:999px;background:var(--surface-subtle);color:var(--muted);white-space:nowrap}.expiry.soon{background:var(--warning-soft);color:var(--warning)}.expiry.late{background:var(--danger-soft);color:var(--danger)}

.day-list{display:grid;gap:9px}.day-row{display:grid;grid-template-columns:140px minmax(220px,1fr) 170px auto;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px}.day-date strong{display:block;font-size:14px}.day-date span{font-size:12px;color:var(--muted)}.people-chip{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}.meal-select{min-width:0}

.grocery-entry{display:grid;grid-template-columns:minmax(0,1fr) 90px 100px auto;gap:8px}.grocery-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line)}.grocery-row:last-child{border-bottom:0}.grocery-row.done .grocery-title{text-decoration:line-through;color:var(--muted)}.grocery-check{width:20px;height:20px;accent-color:var(--accent)}.row-actions{display:flex;align-items:center;gap:5px}.grocery-title{font-weight:720}.grocery-meta{font-size:12px;color:var(--muted);margin-top:2px}

.schedule-row{display:grid;grid-template-columns:minmax(130px,1fr) 110px 110px;gap:10px;align-items:end;padding:7px 0;border-bottom:1px solid var(--line)}.schedule-row:last-child{border-bottom:0}.schedule-row>strong{align-self:center}.receipt-item{border:1px solid var(--line);border-radius:var(--radius);padding:14px;display:grid;gap:11px}

.recipe-detail-image{height:280px;border-radius:var(--radius);background:var(--surface-subtle) center/cover;display:grid;place-items:center;color:#8c968a}.recipe-detail-image .icon{width:42px;height:42px}.detail-toolbar{display:flex;justify-content:space-between;gap:8px;align-items:center;flex-wrap:wrap}.detail-stats{display:flex;gap:8px;flex-wrap:wrap}.detail-stat{display:flex;align-items:center;gap:6px;background:var(--surface-subtle);border-radius:999px;padding:6px 9px;color:var(--muted);font-size:12px}.portion-box{padding:14px;border-radius:var(--radius);background:var(--accent-soft)}.portion-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.portion-controls label{width:100px}.ingredient-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}.ingredient-list li{padding:8px 0;border-bottom:1px solid var(--line)}.ingredient-list li:last-child{border-bottom:0}.steps{counter-reset:step}.step{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;align-items:start}.step:before{counter-increment:step;content:counter(step);width:27px;height:27px;border-radius:9px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-size:12px;font-weight:900}.source-link{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-weight:700;font-size:13px;text-decoration:none}.source-link:hover{text-decoration:underline}

.ingredient-row{display:grid;grid-template-columns:84px 92px minmax(170px,1.2fr) minmax(150px,1fr) 40px;gap:7px;margin-bottom:7px}.ingredient-row .icon-button{align-self:end}.big-choice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.choice{min-height:132px;border:1px solid var(--line);border-radius:var(--radius);padding:18px;background:var(--surface);text-align:left;display:flex;flex-direction:column;gap:12px;color:var(--ink)}.choice:hover{background:var(--surface-subtle);border-color:var(--line-strong)}.choice-icon{width:38px;height:38px;border-radius:11px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:20px}.choice strong{font-size:15px}.choice span:last-child{font-size:12px;color:var(--muted);line-height:1.4}

.auth{min-height:100dvh;display:grid;place-items:center;padding:20px}.auth-card{width:min(390px,100%);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:28px;box-shadow:var(--shadow);display:grid;gap:18px}.auth-brand{display:flex;align-items:center;gap:10px;font-weight:850}.auth-card h1{margin:0;font-size:29px;letter-spacing:-.8px}.auth-card p{margin:5px 0 0;color:var(--muted)}.error{color:var(--danger);font-size:13px;margin:0!important}

dialog{width:min(820px,calc(100vw - 28px));max-height:calc(100dvh - 36px);border:1px solid var(--line);border-radius:var(--radius-lg);padding:0;box-shadow:0 28px 80px rgba(22,27,21,.25);background:var(--surface)}dialog.wide{width:min(980px,calc(100vw - 28px))}dialog::backdrop{background:rgba(24,28,23,.46);backdrop-filter:blur(2px)}#modalBody{padding:22px;overflow:auto;max-height:calc(100dvh - 36px)}.modal-head{position:sticky;top:-22px;z-index:3;background:var(--surface);display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:2px 0 16px;margin-bottom:5px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0;font-size:22px;letter-spacing:-.4px}.modal-sub{margin-top:4px;color:var(--muted);font-size:12px}.modal-head-actions{display:flex;gap:6px;align-items:center}.import-status{min-height:20px;color:var(--muted);font-size:13px}.loading{opacity:.55;pointer-events:none}
.toast{position:fixed;z-index:200;left:50%;bottom:28px;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#232720;color:#fff;padding:11px 15px;border-radius:10px;font-size:13px;box-shadow:0 10px 30px rgba(0,0,0,.18);transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-width:920px){.app-shell{display:block}.sidebar{display:none}.content-shell{display:block}.mobile-header{height:62px;position:sticky;top:0;z-index:25;background:rgba(247,247,244,.92);backdrop-filter:blur(16px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:8px 16px}.view{padding:26px 18px 100px}.mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(5,1fr);padding:6px 5px calc(6px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);backdrop-filter:blur(16px);border-top:1px solid var(--line)}.mobile-nav button{min-height:52px;border:0;background:transparent;color:var(--muted);font-size:10px;display:grid;gap:3px;place-items:center;border-radius:8px;padding:4px}.mobile-nav button.active{color:var(--accent);font-weight:800}.mobile-nav .nav-icon{height:19px}.toast{bottom:85px}}
@media(max-width:680px){.view{padding:22px 13px 96px}.page-header{display:grid;gap:15px;margin-bottom:22px}.page-actions{justify-content:flex-start}.summary-grid{grid-template-columns:1fr 1fr}.summary-card:first-child{grid-column:1/-1}.field-grid,.field-grid.three{grid-template-columns:1fr}.recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.recipe-img{height:112px}.recipe-info{padding:11px}.recipe-info h3{font-size:14px}.big-choice{grid-template-columns:1fr}.choice{min-height:96px;display:grid;grid-template-columns:44px 1fr;align-items:center}.choice span:last-child{grid-column:2}.ingredient-row{grid-template-columns:72px 80px 1fr 40px}.ingredient-row .prep{grid-column:1/4}.day-row{grid-template-columns:92px minmax(0,1fr) auto;gap:8px}.day-row .people-chip{grid-column:2}.day-row .meal-select{grid-column:2}.day-row .day-actions{grid-column:3;grid-row:1/4}.grocery-entry{grid-template-columns:minmax(0,1fr) 80px}.grocery-entry .unit{grid-column:1}.grocery-entry button{grid-column:2}.schedule-row{grid-template-columns:1fr 78px 78px}.recipe-detail-image{height:210px}.form-actions{position:sticky;bottom:-22px;background:var(--surface);border-top:1px solid var(--line);padding:12px 0 2px;margin-top:2px}.list-row{grid-template-columns:auto minmax(0,1fr) auto}.list-row .expiry{grid-column:2}.list-row .row-actions{grid-column:3;grid-row:1/3}.summary-card{padding:15px}.metric{font-size:27px}dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:16px}#modalBody{padding:17px;max-height:calc(100dvh - 16px)}.modal-head{top:-17px}.page-header h1{font-size:31px}}
.icon-button.fav{color:var(--warning);background:var(--warning-soft);border-color:#edd7a9}.icon-button.fav svg,.favorite-badge svg{fill:currentColor}
