:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;color:#263958;background:#f8fafc;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid #dfe6ef;background:white;border-radius:9px;padding:10px 14px;color:#334665;font-weight:600}button:hover{background:#f3f6fa}.primary{background:#173b73;border-color:#173b73;color:#fff}.primary:hover{background:#102b55}.ghost{border:0;background:transparent}.square{width:40px;padding:9px}.hidden{display:none!important}.topbar{display:flex;align-items:center;gap:28px;padding:0 25px;background:#fff;border-bottom:1px solid #e5eaf1;min-height:74px}.brand{display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:19px}.brand-mark,.brand-icon{background:linear-gradient(145deg,#3576c9,#173b73);color:white;padding:7px 12px;border-radius:10px;font-size:24px}.topbar nav{display:flex;align-items:center;gap:5px;flex:1;overflow:auto}.topbar nav button{border:0;border-radius:0;background:none;padding:25px 11px 22px;white-space:nowrap;font-size:13px;color:#5a6880;border-bottom:3px solid transparent}.topbar nav button.active{border-color:#173b73;color:#173b73}.user-area{display:flex;gap:9px;align-items:center;white-space:nowrap;font-size:13px}main{padding:24px;max-width:1750px;margin:auto}.heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.heading h1{font-size:27px;margin:0 0 5px;color:#1b2e4c}.heading p,.muted{font-size:14px;color:#728099;margin:0}.toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;background:white;border:1px solid #e5eaf1;border-radius:12px;padding:11px 15px;margin-bottom:16px}.date-controls{display:flex;align-items:center;gap:9px}.date-controls strong{font-size:14px;min-width:180px;text-align:center}.small-label{display:flex;gap:8px;align-items:center;font-size:13px}select,input,textarea{border:1px solid #dce4ee;padding:11px;border-radius:8px;background:white;color:#273957}select{min-width:70px}.planner-grid{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(228px,1fr);gap:12px;overflow-x:auto;align-items:start;padding-bottom:14px}.day-column{border:1px solid #e0e6ee;background:#fff;border-radius:12px;overflow:hidden;min-width:228px;box-shadow:0 1px 3px #1b2e4c08}.day-header{background:linear-gradient(#fbfcfd,#f4f7fa);padding:13px;border-bottom:1px solid #e7edf3;display:flex;justify-content:space-between}.day-header strong{display:block;font-size:17px}.day-header small{font-size:12px;color:#63738f}.day-content{padding:9px}.slot{margin-bottom:9px;min-height:86px;border-radius:8px;padding:5px 5px 6px;border:1px solid transparent}.slot.dragging-over{outline:2px dashed #245bb0}.slot-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;font-size:12px;padding:8px 7px;border-radius:7px;margin-bottom:6px}.slot-head button{padding:0 4px;border:0;background:transparent;font-size:17px;color:inherit}.breakfast .slot-head{background:#ffecf0;color:#b22a4a}.morning-snack .slot-head{background:#fff0f5;color:#bb2856}.lunch .slot-head{background:#e8f8f8;color:#08666d}.dinner .slot-head{background:#fff0e6;color:#9a512d}.evening-snack .slot-head{background:#edf2fa;color:#45648f}.meal-card{position:relative;display:flex;align-items:center;gap:8px;padding:6px;background:white;border:1px solid #e6eaf1;border-radius:8px;margin-bottom:5px;cursor:grab;min-height:60px}.meal-card:hover{box-shadow:0 2px 8px #14284918}.food-thumb{width:65px;height:56px;object-fit:cover;border-radius:6px;background:linear-gradient(135deg,#d6e5fa,#cfdee0);flex-shrink:0}.food-placeholder{display:grid;place-items:center;font-size:27px;color:#245bb0}.meal-detail{min-width:0;flex:1}.meal-name{font-size:12px;font-weight:700;color:#273957;line-height:1.3}.meal-meta{font-size:11px;color:#75849c;margin-top:4px}.dots{border:0;background:transparent;padding:1px 3px;align-self:flex-start}.add-slot{width:100%;border:1px dashed #cbd8e7;color:#63738f;background:#fbfdff;padding:7px;font-size:12px}.day-totals{border-top:1px solid #e2e8ef;padding:12px;background:linear-gradient(#fff,#fbfcfe)}.total-heading{display:flex;justify-content:space-between;gap:5px;align-items:center;margin-bottom:13px}.total-heading strong{font-size:14px}.status{padding:4px 8px;border-radius:20px;font-weight:700;font-size:10px;white-space:nowrap}.status.good{background:#d9f7e5;color:#12804a}.status.below,.status.partial{background:#fff0ca;color:#ad7509}.status.above{background:#ffe0e4;color:#c12842}.nutrient-row{margin-bottom:10px}.nutrient-head{display:flex;justify-content:space-between;gap:3px;font-size:11px}.nutrient-head b{font-weight:600}.nutrient-bar{background:#e6ecf2;height:7px;border-radius:10px;overflow:hidden;margin-top:5px}.nutrient-fill{height:100%;border-radius:10px;background:#148e65}.nutrient-fill.below{background:#edab24}.nutrient-fill.above{background:#d51a54}.nutrient-fill.tracking{background:#468de1}.total-note{font-size:10px;color:#8a6c2d}.footer-hint{font-size:12px;color:#8b97aa}.recipe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:15px}.recipe-card{border:1px solid #e1e7f0;background:white;border-radius:12px;overflow:hidden}.recipe-card img{width:100%;height:155px;object-fit:cover;background:#e8effa}.recipe-card-body{padding:14px}.recipe-card h3{margin:0 0 8px;font-size:16px}.recipe-card p{font-size:12px;color:#718098}.recipe-card .buttons{display:flex;gap:8px}.nutrition-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:15px}.nutrition-card,.panel{background:#fff;border:1px solid #e1e7f0;border-radius:13px;padding:20px;margin-bottom:18px}.panel h2{margin:0 0 15px}.narrower{max-width:530px}.search{min-width:320px}.form-actions{display:flex;justify-content:flex-end;margin-top:20px}.goal-line{display:grid;grid-template-columns:1.7fr 1.1fr 1fr 1fr;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid #ecf0f5}.goal-line input{width:100%}.goal-line select{width:100%}.goal-line label{font-size:13px}.overlay{position:fixed;inset:0;background:#0f1d36aa;display:flex;justify-content:center;align-items:flex-start;overflow:auto;z-index:100;padding:35px 12px}.modal{background:white;width:min(680px,100%);border-radius:15px;padding:24px;box-shadow:0 15px 60px #0003}.modal.narrow{width:400px}.modal h2{margin:0 0 8px}.modal p{color:#67758c;font-size:13px}.modal label,.panel form label,.login-card label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;margin-bottom:12px}.modal textarea{width:100%;min-height:75px;resize:vertical}.modal input,.modal select,.panel form input{width:100%}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.choice-list{display:grid;gap:8px;max-height:360px;overflow-y:auto}.choice{display:flex;align-items:center;gap:11px;width:100%;text-align:left}.choice img{width:62px;height:55px;object-fit:cover;border-radius:6px}.choice span{flex:1}.choice small{display:block;color:#778499}.nutri-edit{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.nutri-edit label{margin:0}.radio-tabs{display:flex;gap:8px;margin:15px 0}.radio-tabs button.selected{background:#173b73;color:white}.login-screen{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#e2edfc,#edf1f8)}.login-card{background:white;border-radius:17px;box-shadow:0 10px 40px #17294320;padding:40px;width:min(420px,92vw)}.login-card h1{margin-bottom:4px}.login-card p{color:#728099}.brand-icon{width:max-content}.full{width:100%}.error{color:#ba2357!important;font-size:12px;min-height:16px}.toast{position:fixed;right:22px;bottom:20px;background:#243653;color:white;padding:13px 20px;border-radius:10px;z-index:300}.check{display:flex!important;flex-direction:row!important;align-items:center}.check input{width:auto!important}.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:10px}.day-mini{text-align:left;padding:10px;background:#f5f7fa;border:1px solid #e0e6ee;border-radius:8px;margin-bottom:12px}.nutrition-card h3{margin:0 0 14px}@media(max-width:900px){.topbar{flex-wrap:wrap;gap:4px;padding:10px}.topbar nav{order:3;width:100%}.topbar nav button{padding:13px 9px}main{padding:13px}.heading h1{font-size:22px}.planner-grid{grid-auto-columns:minmax(255px,75vw)}.user-area{margin-left:auto}.heading{align-items:flex-start}.goal-line{grid-template-columns:1fr 1fr}.nutri-edit{grid-template-columns:repeat(2,1fr)}}

/* v1.1 bulk PDF import */
.library-heading-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center}
.modal.modal-wide{width:min(1120px,calc(100vw - 24px))}
.bulk-review-title h2{margin:0}
.bulk-review-title p{margin:6px 0 14px}
.bulk-review-layout{display:grid;grid-template-columns:minmax(200px,285px) minmax(0,1fr);gap:15px;max-height:65vh;min-height:340px}
.bulk-review-list{overflow:auto;border:1px solid #e0e6ee;border-radius:10px;padding:5px;background:#f9fafc}
.bulk-review-item{display:block;width:100%;text-align:left;border:1px solid transparent;border-radius:8px;background:white;margin:4px 0;padding:10px;white-space:normal}
.bulk-review-item.active{border-color:#245bb0;background:#edf4ff}
.bulk-review-item strong,.bulk-review-item small,.bulk-review-item span{display:block;line-height:1.35}
.bulk-review-item strong{font-size:12px;color:#243653}
.bulk-review-item small{font-size:11px;color:#64748b;margin:4px 0}
.bulk-review-detail{min-width:0;overflow-y:auto;padding:2px 6px}
.bulk-review-detail h3{margin:12px 0 9px}
.bulk-state{font-size:11px;color:#b87717}
.bulk-state.saved{color:#16744f}.bulk-state.skipped{color:#69768c}.bulk-state.failed{color:#b42339}
.bulk-item-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.bulk-main-actions{border-top:1px solid #edf0f4;padding-top:12px}
.bulk-note{font-size:12px!important;color:#6d7890!important;margin-top:10px}
.bulk-warning{padding:10px 12px;border:1px solid #e5b75a;border-radius:9px;background:#fff8e9;color:#8b560c!important}
.bulk-errors{padding:10px;background:#fff8e9;border-radius:8px;margin-bottom:12px;font-size:13px}
.bulk-errors ul{max-height:120px;overflow:auto;margin-bottom:0}
.bulk-saved{background:#ecfff7;border:1px solid #a6dfc3;border-radius:9px;padding:15px;color:#137a51}
.bulk-file-list{background:#f8fafc;border:1px solid #e2e8f0;padding:12px;border-radius:9px;max-height:240px;overflow:auto;font-size:13px}
.bulk-file-list ul{margin-bottom:0}
.bulk-progress{height:12px;background:#e4e9f0;border-radius:20px;overflow:hidden}
.bulk-progress div{height:100%;background:#245bb0;transition:width .2s}
@media (max-width:750px){.bulk-review-layout{grid-template-columns:1fr;max-height:none}.bulk-review-list{display:flex;max-height:130px;gap:5px}.bulk-review-item{min-width:175px}.bulk-review-detail{max-height:55vh}.modal.modal-wide{width:100%}}


/* v1.2: Home nutrition customization — per-user visible/hidden rows */
.nutrient-label{display:inline-flex;align-items:center;gap:3px;min-width:0}
.nutrient-eye{padding:3px;border:0;border-radius:5px;background:transparent;color:#8998af;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:1}
.nutrient-eye:hover,.nutrient-eye:focus-visible{background:#e7ecf5;color:#173c6b;outline-offset:2px}
.nutrient-head{align-items:center;flex-wrap:wrap;row-gap:2px}
.nutrient-reading{text-align:right;margin-left:auto;max-width:100%;font-variant-numeric:tabular-nums}
.nutrient-reading.reading-above{color:#c51c49}
.nutrient-reading.reading-below{color:#a36b0b}
.goal-target{font-weight:400;color:#8792a4}
.hidden-nutrients{margin-top:14px;border-top:1px solid #e3e9f0;padding-top:10px}
.hidden-nutrients-toggle{width:100%;display:flex;align-items:center;gap:7px;padding:8px;border:1px solid #dfe6ee;border-radius:8px;background:#f7f9fc;color:#405477;font-size:11px;text-align:left}
.hidden-nutrients-toggle:hover{background:#eaf0f8}
.hidden-nutrients-toggle span:nth-child(2){flex:1}
.hidden-expand{white-space:nowrap;color:#657892;font-size:10px}
.hidden-nutrients-list{padding-top:8px;display:grid;gap:5px}
.restore-nutrient{display:flex;align-items:center;text-align:left;gap:7px;width:100%;padding:8px 7px;border:1px solid #e5e9f0;background:#fff;border-radius:7px;font-size:11px;color:#445573}
.restore-nutrient:hover{background:#eff7f5;border-color:#b4ddd0}
.restore-nutrient span{flex:1}
.restore-nutrient strong{color:#14805e;font-size:10px}
.show-all-nutrients{width:100%;border-color:#b3d8ca;background:#eef9f3;color:#116b4d;font-size:11px;padding:8px}
.show-all-nutrients:hover{background:#def4e8}
.nutrient-bar{background:#e6ecf2}
.nutrient-fill.above{background:#d51a54}
.nutrient-fill.below{background:#e6a11d}
.nutrient-fill.good{background:#148e65}
.status.above{background:#ffe2e8;color:#bd1542}

/* v1.3: library discovery, matching the planner palette. */
.library-tools{padding:18px}
.library-search-row{display:flex;gap:16px;align-items:end}
.library-tools label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:600}
.library-search{flex:1;min-width:0}
.library-search input{width:100%}
.library-categories,.library-filter-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:16px}
.library-categories button{border-radius:22px;padding:8px 14px;font-size:13px}
.library-categories button[aria-pressed=true]{background:#fff4cf;color:#173b73;border-color:#dfbb4c}
.library-filter-row .check{margin-right:auto;gap:8px;cursor:pointer}
.library-filter-row input{accent-color:#173b73;width:18px;height:18px}
#library-nutrition{border-top:1px solid #e5eaf1;margin-top:18px;padding-top:4px}
.library-bounds{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin-top:16px}
.library-bound{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;background:#f8fafc;border-radius:9px}
.library-bound strong{grid-column:1/-1;font-size:13px}
.library-bound label{font-size:12px;color:#64748b}
.library-bound input{width:100%;min-width:0}
#library-filter-error:empty{display:none}
#library-count{margin-top:16px}
.recipe-photo{position:relative;height:155px}
.recipe-photo-placeholder{height:100%;display:grid;place-items:center;font-size:50px;background:#e8f0ff;color:#245bb0}
.favorite-button{position:absolute;right:10px;top:10px;border-radius:50%;width:42px;height:42px;padding:0;font-size:26px;box-shadow:0 2px 6px #26395822;color:#245bb0}
.favorite-button[aria-pressed=true]{background:#fff4cf;color:#173b73;border-color:#dfbb4c}
.favorite-button:disabled{opacity:.6;cursor:wait}
.recipe-card{display:flex;flex-direction:column}
.recipe-card-body{flex:1;display:flex;flex-direction:column}
.recipe-category{color:#245bb0;font-size:11px;font-weight:700;margin-bottom:8px}
.recipe-numbers{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:0 0 18px}
.recipe-numbers span,.recipe-numbers strong{display:block;font-size:12px}
.recipe-numbers span{color:#728099;margin-bottom:5px}
.recipe-card .nutrition-caption{margin:3px 0 10px}
.recipe-card .buttons{margin-top:auto;flex-wrap:wrap}
.recipe-card .buttons button{padding:9px 10px;font-size:12px}
.library-empty{grid-column:1/-1;padding:32px;text-align:center;background:white;border:1px dashed #cbd8e7;border-radius:12px;color:#63738f}
button:focus-visible{outline:2px solid #173b73;outline-offset:3px}
@media(max-width:600px){.library-search-row{flex-direction:column;align-items:stretch}.library-tools{padding:12px}.library-filter-row .check{width:100%;margin-bottom:4px}.recipe-grid{grid-template-columns:minmax(0,1fr)}#library-page>.heading{flex-direction:column}}

/* v1.4: bounded bulk-review workspace; only list and editor content scroll. */
body.bulk-open{overflow:hidden}
.overlay.bulk-overlay{padding:12px;overflow:hidden;align-items:stretch}
.modal.bulk-workspace{width:100%;max-width:none;height:100%;max-height:100%;padding:0;overflow:hidden;border-radius:12px}
.bulk-workspace .bulk-review{height:100%;min-height:0;display:flex;flex-direction:column}
.bulk-workspace .bulk-review-title{display:flex;justify-content:space-between;align-items:center;gap:20px;flex:none;padding:18px 22px;border-bottom:1px solid #e0e6ee}
.bulk-workspace .bulk-review-title h2{font-size:22px}
.bulk-workspace .bulk-review-title p{margin:6px 0 0}
.bulk-completion{display:grid;gap:6px;min-width:160px;font-size:12px;color:#63738f}
.bulk-completion progress{width:100%;height:10px;accent-color:#173b73}
.bulk-workspace .bulk-review-layout{flex:1;min-height:0;max-height:none;overflow:hidden;grid-template-columns:minmax(240px,300px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:0}
.bulk-sidebar{min-height:0;min-width:0;display:flex;flex-direction:column;border-right:1px solid #e0e6ee;background:#f8fafc}
.bulk-list-tools{padding:14px;display:grid;gap:10px;flex:none;border-bottom:1px solid #e0e6ee}
.bulk-list-tools label{margin:0;font-size:12px}
.bulk-list-tools input,.bulk-list-tools select{padding:8px}
#bulk-list-count{font-size:12px;color:#63738f}
.bulk-workspace .bulk-review-list{min-height:0;max-height:none;flex:1;overflow-y:auto;overscroll-behavior:contain;display:block;border:0;border-radius:0;padding:8px}
.bulk-workspace .bulk-review-item{min-width:0;margin:0 0 6px;padding:12px;overflow-wrap:anywhere}
.bulk-workspace .bulk-review-item strong{font-size:13px}
.bulk-workspace .bulk-state{margin-top:5px}
.bulk-editor{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}
.bulk-editor-heading{display:flex;justify-content:space-between;gap:10px;padding:12px 20px;background:#fbfcfe;border-bottom:1px solid #edf0f4;flex:none;font-size:13px}
.bulk-editor-heading span{color:#63738f}
.bulk-workspace .bulk-review-detail{min-height:0;max-height:none;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px}
.bulk-workspace .day-mini{overflow-wrap:anywhere}
.bulk-workspace .bulk-item-actions{flex:none;margin:0;padding:12px 20px;border-top:1px solid #e0e6ee;background:#fff;gap:8px;align-items:center}
.bulk-action-spacer{flex:1}
.bulk-footer{flex:none;padding:10px 20px 14px;background:#f8fafc;border-top:1px solid #dce4ee}
.bulk-workspace .bulk-main-actions{padding:0;margin:8px 0 0;border:0;flex-wrap:wrap}
.bulk-workspace .bulk-note{margin:0;font-size:11px!important}
.bulk-workspace .bulk-errors{margin:0 0 8px;padding:8px 10px;font-size:12px}
.bulk-workspace .bulk-errors ul{max-height:12vh}
.bulk-empty{padding:12px}
.bulk-workspace button:disabled{opacity:.55;cursor:default}
@media(max-width:750px){
 .overlay.bulk-overlay{padding:0}
 .modal.bulk-workspace{border-radius:0}
 .bulk-workspace .bulk-review-title{padding:10px 12px;gap:8px}
 .bulk-workspace .bulk-review-title h2{font-size:17px}
 .bulk-workspace .bulk-review-title p{font-size:11px}
 .bulk-completion{min-width:85px;font-size:10px}
 .bulk-workspace .bulk-review-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(160px,32%) minmax(0,1fr)}
 .bulk-sidebar{border-right:0;border-bottom:1px solid #dce4ee}
 .bulk-list-tools{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 10px;padding:8px 12px}
 #bulk-list-count{grid-column:1/-1;font-size:10px}
 .bulk-workspace .bulk-review-list{padding:4px 12px}
 .bulk-workspace .bulk-review-item{padding:8px}
 .bulk-editor-heading{padding:7px 12px;font-size:11px}
 .bulk-workspace .bulk-review-detail{padding:10px 12px}
 .bulk-workspace .bulk-item-actions{padding:8px;gap:5px}
 .bulk-workspace .bulk-item-actions button{padding:8px;font-size:11px}
 .bulk-action-spacer{display:none}
 .bulk-footer{padding:8px 12px}
 .bulk-workspace .bulk-main-actions{gap:5px}
 .bulk-workspace .bulk-main-actions button{padding:8px;font-size:11px}
 .bulk-workspace .bulk-note{font-size:10px!important}
}
@media(max-height:500px){.bulk-workspace .bulk-review-title{padding:6px 12px}.bulk-workspace .bulk-note{display:none}.bulk-footer{padding:6px 12px}.bulk-workspace .bulk-main-actions{margin:0}}

/* v1.5 personal meal adjustments */
.customized-badge{display:block;width:max-content;font-size:10px;color:#173b73;background:#fff4cf;padding:3px 5px;border-radius:4px;margin-top:4px}
.adjust-layout{display:grid;grid-template-columns:minmax(260px,1fr) minmax(400px,1.5fr);gap:22px;align-items:start}
.portion-buttons{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 12px}
.portion-buttons button{font-size:12px;padding:8px 10px}
.adjust-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:16px}
.adjust-heading h3{font-size:15px}
.adjust-heading button{font-size:12px}
.adjust-change{display:flex;gap:7px;align-items:center;padding:10px;border:1px solid #dfe6ef;border-radius:9px;margin-bottom:8px;background:#fbfcfe}
.adjust-change>div{flex:1;min-width:0;overflow-wrap:anywhere}
.adjust-change strong{font-size:13px}.adjust-change small{display:block;color:#63738f;font-size:11px;margin-top:5px}
.adjust-change button{padding:7px;font-size:11px}
.adjust-note{background:#fff8e9;border-radius:7px;padding:10px;line-height:1.5;font-size:12px!important}
.ingredient-original{white-space:pre-wrap;max-height:180px;overflow:auto}
.adjust-preview-panel{padding:14px;background:#f8fafc;border:1px solid #e0e6ee;border-radius:10px}
.adjust-preview-panel h3{margin:0}
.adjust-table-scroll{overflow-x:auto}
.adjust-table{width:100%;border-collapse:collapse;font-size:11px;text-align:left}
.adjust-table th,.adjust-table td{border-bottom:1px solid #dfe6ef;padding:9px 5px;vertical-align:top}
.adjust-table td{font-variant-numeric:tabular-nums}
.adjust-table small{display:block;color:#728099;font-weight:400;margin-top:4px}
.adjust-table .status{display:inline-block;white-space:normal}
.food-find{background:#f8fafc;border:1px solid #e0e6ee;border-radius:9px;padding:14px;margin:16px 0}
.food-find summary,#more-adjust-nutrients summary{cursor:pointer;font-weight:600;font-size:13px;padding:10px 0}
.food-search{display:flex;gap:8px}.food-search input{min-width:0;flex:1}
.food-results{max-height:230px;overflow:auto;margin-top:10px}
.food-results button{display:block;width:100%;text-align:left;margin-bottom:6px;font-size:12px}
.food-results small{display:block;color:#63738f;margin-top:4px}
#ingredient-adjust-form .check{margin-top:14px}
.modal-wide .adjust-layout input{max-width:100%}
.modal.adjust-modal{display:flex;flex-direction:column;max-height:calc(100dvh - 70px);overflow:hidden}
.adjust-modal>.adjust-layout{flex:1;min-height:0;overflow-y:auto;padding-right:5px}
.adjust-modal>h2,.adjust-modal>p,.adjust-modal>.modal-actions{flex:none}
.adjust-modal>.modal-actions{border-top:1px solid #e0e6ee;padding-top:12px;margin-top:10px}
.adjust-modal>#adjust-error:empty{display:none}
@media(max-width:850px){.adjust-layout{grid-template-columns:minmax(0,1fr)}.adjust-preview-panel{padding:8px}.adjust-table{font-size:10px}.food-search{flex-wrap:wrap}}
.ingredient-columns{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(85px,1fr);gap:10px;align-items:center;padding:12px;font-size:12px}
.ingredient-row{border:1px solid #dae2ed;border-radius:10px;margin-bottom:9px;overflow:hidden}.ingredient-row.changed{background:#edf4ff;border-color:#afc9ed}
.ingredient-name{padding:0;border:0;background:transparent;text-align:left;font-weight:700;overflow-wrap:anywhere;color:#243858}
.ingredient-columns label{margin:0}.ingredient-columns input{width:100%;min-width:0}.ingredient-detail{padding:14px;border-top:1px solid #dbe6f5}.ingredient-detail summary{cursor:pointer;padding:10px 0;font-weight:600}.ingredient-detail [data-delta]{color:#245bb0;font-weight:700}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:851px){.adjust-layout{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}}
.meal-portion{margin-bottom:12px}.meal-portion summary{cursor:pointer;font-weight:600;padding:6px 0}
.ingredient-detail p{font-size:12px;margin:8px 0}.ingredient-detail summary{padding:6px 0;font-size:12px}.ingredient-detail .check{font-size:12px}.ingredient-detail{padding:10px}.ingredient-detail .portion-buttons button{font-size:11px;padding:7px}
@media(min-width:851px){.adjust-modal>.adjust-layout{overflow:hidden}.adjust-layout>section{min-height:0;overflow-y:auto;padding-right:10px}.adjust-preview-panel{align-self:stretch}}
@media(min-width:851px){.adjust-modal>.adjust-layout{grid-template-rows:minmax(0,1fr);align-items:stretch}.adjust-layout>section{align-self:stretch}}
#ingredient-list>h3{margin:12px 0 8px}#ingredient-list>p{font-size:12px;margin:8px 0}.ingredient-columns{padding:9px}.ingredient-detail .two-cols{gap:10px}
.grocery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}.grocery-group{margin:0}.grocery-group h2{font-size:19px;margin:0 0 12px}.grocery-group h2 small{color:#748097;font-size:13px;margin-left:8px}.grocery-toolbar{display:flex;gap:24px;justify-content:space-between;align-items:center}.grocery-toolbar p{margin:8px 0;font-size:13px}.grocery-toolbar label{min-width:220px}.grocery-item{display:flex;gap:10px;position:relative;border-top:1px solid #edf0f5;padding:13px 0;align-items:flex-start}.grocery-check{margin:3px 0 0}.grocery-check input{width:18px;height:18px}.grocery-detail{flex:1;min-width:0}.grocery-detail summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 14px;cursor:pointer;list-style:none;font-size:14px}.grocery-detail summary::-webkit-details-marker{display:none}.grocery-detail summary small{grid-column:1/-1;color:#697892}.grocery-name{font-weight:600;overflow-wrap:anywhere}.grocery-detail summary strong{color:#245bb0}.grocery-sources{display:none;position:absolute;z-index:20;left:25px;right:0;top:calc(100% - 4px);padding:16px;background:white;border:1px solid #d9e1ed;border-radius:10px;box-shadow:0 10px 25px #24385822;max-height:320px;overflow:auto;font-size:13px}.grocery-detail[open]>.grocery-sources,.grocery-detail:focus-within>.grocery-sources{display:block}.grocery-sources ul{padding-left:18px;margin:10px 0 0}.grocery-sources li{margin-bottom:12px}.grocery-sources span{display:block;margin:5px 0;color:#61718b}.grocery-sources a{color:#245bb0;font-weight:600}.grocery-sources p{font-size:12px}.grocery-item.is-checked .grocery-name{text-decoration:line-through;color:#748097}.recipe-page-grid{display:grid;grid-template-columns:1fr 1.5fr;gap:20px}.recipe-text{white-space:pre-wrap;line-height:1.7}.recipe-back{color:#245bb0}.grocery-detail summary:focus-visible{outline:2px solid #245bb0;outline-offset:3px}
@media(hover:hover){.grocery-detail:hover>.grocery-sources{display:block}}
@media(max-width:800px){.grocery-grid,.recipe-page-grid{grid-template-columns:1fr}.grocery-toolbar{display:block}.grocery-sources{position:static;margin-top:10px;box-shadow:none}.grocery-detail summary{grid-template-columns:minmax(0,1fr) auto}}
.grocery-item:hover,.grocery-item:focus-within{z-index:25}
body.picker-open{overflow:hidden}.overlay.picker-overlay{padding:12px;align-items:stretch;overflow:hidden}.modal.recipe-picker{width:100%;max-width:none;height:calc(100dvh - 24px);max-height:none;margin:0;padding:22px;display:flex;flex-direction:column;border-radius:14px;overflow:hidden}.picker-heading{display:flex;justify-content:space-between;gap:20px;align-items:center;flex:none}.picker-heading h2{margin:0}.picker-heading p{margin:8px 0 16px}.picker-scroll{flex:1;min-height:0;overflow:auto;padding:4px 8px 20px}.picker-footer{display:flex;gap:10px;justify-content:flex-end;align-items:center;padding-top:14px;border-top:1px solid #dce3ed;flex:none}.picker-footer .error{margin:0 auto 0 0}.picker-view{color:#233c61;text-decoration:none;border:1px solid #d8e1ee;padding:10px 12px;border-radius:8px;font-size:13px}.recipe-picker .recipe-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.recipe-picker .library-tools{margin-bottom:20px}
@media(max-width:600px){.modal.recipe-picker{padding:12px}.picker-heading h2{font-size:19px}.picker-footer{flex-wrap:wrap}.picker-footer .error{width:100%}.recipe-picker .recipe-grid{grid-template-columns:1fr}}

/* v1.9: portion-first daily comparison */
.modal.adjust-modal{width:min(900px,95vw)}
.portion-workspace{overflow-y:auto;min-height:0;padding-right:8px}
.portion-workspace .portion-buttons{display:flex;flex-wrap:wrap;gap:8px}
.portion-workspace [aria-pressed="true"]{background:#173b73;color:white;border-color:#173b73}
.portion-summary{padding:16px;border-radius:10px;background:#f1f5fa;font-weight:600}
.portion-summary.tradeoff{background:#fff5df;border:1px solid #e8be68}
.portion-table{width:100%;font-size:14px}
.portion-table small{display:block;font-weight:400;margin-top:5px}
.ingredient-advanced{margin-top:22px;border-top:1px solid #dae1ec;padding-top:16px}
#custom-portion-field{max-width:240px}
@media(max-width:600px){.modal.adjust-modal{padding:18px;max-height:calc(100dvh - 24px)}.portion-table{font-size:12px}.portion-table th,.portion-table td{padding:8px 5px}}

#custom-portion-field[hidden]{display:none!important}

.planner-pdf-link{display:block;flex-shrink:0;border-radius:6px;line-height:0}.planner-pdf-link:focus-visible{outline:3px solid #173b73;outline-offset:3px}.planner-pdf-link:hover{opacity:.85}
/* Ingredient review: original page and editable rows, with a touch-friendly region selector. */
.pdf-review-overlay{position:fixed;inset:0;background:#263958a0;z-index:250;padding:12px;display:flex}
.pdf-review-dialog{background:white;border-radius:14px;padding:20px;width:100%;display:flex;flex-direction:column;min-height:0}
.pdf-review-dialog h2{margin:0}.pdf-review-dialog header,.pdf-review-dialog footer{flex:none}
.pdf-review-dialog header label{display:flex;align-items:center;gap:10px}.pdf-review-dialog #pdf-yield{width:90px}
.pdf-review-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px;overflow:auto;min-height:0;flex:1}
.pdf-review-columns>section{min-width:0}.pdf-area{position:relative;touch-action:none;user-select:none;cursor:crosshair}
.pdf-area img{display:block;width:100%}.pdf-selection{position:absolute;border:2px solid #173b73;background:#173b7325;pointer-events:none}
.pdf-ingredient-row{display:grid;grid-template-columns:80px minmax(120px,1fr) 80px 90px 38px;gap:6px;margin:8px 0}.pdf-ingredient-row input,.pdf-ingredient-row select{min-width:0;width:100%;padding:8px;border:1px solid #dfe6ef;border-radius:6px}.pdf-ingredient-row button{padding:5px}
@media(max-width:850px){.pdf-review-columns{grid-template-columns:1fr}.pdf-ingredient-row{grid-template-columns:70px minmax(80px,1fr) 65px 65px 32px}.pdf-review-dialog{padding:12px}}
#date-range{border:0;background:transparent;font-weight:700}#date-range:hover{text-decoration:underline;background:#f3f6fa}

.picker-hide-filters{margin-top:16px}
.picker-active-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:14px}
.picker-active-filters:empty,.picker-message:empty{display:none}
.picker-filter-caption{font-size:12px;font-weight:700;color:#536179}
.picker-filter-chip{background:#eaf2ff;color:#173b73;border:1px solid #c8d9f1;border-radius:18px;padding:6px 11px;font-size:13px}
.picker-message{flex:none;margin:8px 0}

/* Navy and gold theme; accessible Option A controls. */
:root{--navy:#173b73;--blue:#245bb0;--gold:#ffcf40;background:#f4f7fc;color:#203759}
a{color:var(--blue)}button:focus-visible,summary:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #3779d6;outline-offset:3px}
.primary{background:var(--gold);border-color:#e9b92b;color:#142e54}.primary:hover{background:#f1bf28}.primary:disabled{opacity:.55}
.topbar nav button.active{color:var(--navy);border-color:#e8b72c;background:#f1f6ff}.brand-mark,.brand-icon{background:var(--navy);color:var(--gold)}
.breakfast .slot-head{background:#F3EBDD;color:#173B73}.morning-snack .slot-head{background:#F3E1E7;color:#173B73}.lunch .slot-head{background:#DDEBE3;color:#173B73}.dinner .slot-head{background:#F2DDD4;color:#173B73}.evening-snack .slot-head{background:#E6E0F0;color:#173B73}
.library-category.active,.library-category.selected{background:#e8f0ff;color:var(--navy);border-color:var(--blue)}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.ingredient-option{margin-top:22px;padding:18px;border-radius:12px;background:#eef5ff}.ingredient-option h3{margin:0 0 6px}.ingredient-option>p{margin:0 0 14px}
.action-disclosure>summary{list-style:none;display:flex;align-items:center;justify-content:center;gap:12px;min-height:48px;padding:12px 16px;border:1.5px solid var(--blue);border-radius:9px;background:#fff;color:var(--blue);font-weight:700;cursor:pointer}
.action-disclosure>summary::-webkit-details-marker{display:none}.action-disclosure>summary:hover{background:#e4efff}.action-disclosure>summary .disclosure-chevron{margin-left:auto;font-size:22px}.action-disclosure[open]>summary .disclosure-chevron{transform:rotate(180deg)}
.action-disclosure>summary .when-open{display:none}.action-disclosure[open]>summary .when-open{display:inline}.action-disclosure[open]>summary .when-closed{display:none}.advanced-badge{font-size:11px;padding:4px 9px;border-radius:20px;background:#dceaff;color:#173b73;margin-left:auto}.ingredient-advanced{border:0;padding:0}.ingredient-advanced[open]>summary{margin-bottom:16px}.totals-disclosure{margin:14px 0}.totals-disclosure[open]>summary{margin-bottom:12px}
.planner-date-label{width:max-content;max-width:100%;margin-top:18px}.planner-date-input{display:flex;align-items:center;border:1px solid #b8cbe7;border-radius:9px;background:white;overflow:hidden;width:222px;max-width:100%}.modal .planner-date-input input{width:174px;min-width:0;border:0;background:transparent}.planner-date-input input::-webkit-calendar-picker-indicator{display:none}.planner-date-input button{display:grid;place-items:center;border:0;border-left:1px solid #d8e4f4;border-radius:0;background:#eaf2ff;padding:10px;color:var(--blue)}
.grocery-fix{font-size:12px;padding:7px 10px;color:var(--blue);white-space:nowrap;align-self:center}.grocery-item{gap:10px}.repair-source{background:#eef4fc;border-radius:9px;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere}.repair-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.repair-fields .repair-name{grid-column:1/-1}.repair-actions{display:flex;gap:10px;flex-wrap:wrap}.repair-preview{padding:12px;background:#fff6db;border-radius:8px}
@media(max-width:600px){.action-disclosure>summary{gap:8px;font-size:13px;padding:12px 10px}.ingredient-option{padding:12px}.grocery-item{flex-wrap:wrap}.grocery-fix{margin-left:32px}.repair-fields{grid-template-columns:1fr}.repair-fields .repair-name{grid-column:auto}}

.header-logo{width:48px;height:48px;object-fit:contain;flex-shrink:0}.login-logo{display:block;width:96px;height:96px;object-fit:contain;margin-bottom:12px}

.totals-legend{margin-top:18px}.totals-legend h2{font-size:18px}.totals-legend-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:22px}.legend-line{display:block;width:72px;height:7px;border-radius:8px;margin-bottom:10px}.legend-good{background:#148e65}.legend-below{background:#edab24}.legend-above{background:#d51a54}.legend-partial{background:#468de1}.legend-empty{background:#e6ecf2}.totals-legend-items strong{font-size:13px}.totals-legend-items p,.legend-footnote{font-size:12px;line-height:1.5;color:#596c85}.totals-legend-items p{margin:6px 0 0}.legend-footnote{border-top:1px solid #e1e7f0;padding-top:12px;margin:16px 0 0}

.category-checkboxes{border:1px solid #dce4ee;border-radius:9px;padding:12px;margin:0 0 12px;min-width:0}.category-checkboxes legend{font-weight:700;font-size:13px;padding:0 5px}.category-checkboxes>div{display:flex;flex-wrap:wrap;gap:10px 18px}.category-checkboxes label{display:flex;align-items:center;gap:7px;margin:0;font-weight:500}.category-checkboxes input{width:17px;height:17px;margin:0;accent-color:#173b73}.category-checkboxes small{display:block;color:#728099;margin-top:10px}

.modal.date-modal{width:370px;max-width:calc(100vw - 28px);padding:22px;border-radius:16px}
.date-modal h2{font-size:21px;line-height:1.25;margin:0 0 14px}
.date-modal .schedule-recipe-name{font-size:14px;line-height:1.4;margin:0 0 16px;overflow-wrap:anywhere}
.date-modal .planner-date-label{margin-top:0}
.date-modal #quick-slot{width:222px;max-width:100%}
.date-modal .modal-actions{gap:8px;margin-top:18px;padding-top:12px;flex-wrap:wrap}
.date-modal .modal-actions button{padding:10px 12px;font-size:14px}
.date-modal .planner-date-input{width:222px}
.date-modal .planner-date-input input{flex:1;width:0}

.meal-undo{position:fixed;bottom:70px;right:22px;z-index:301;background:#173b73;color:white;padding:14px 18px;border-radius:12px;max-width:calc(100vw - 44px);box-shadow:0 4px 20px #0003}.meal-undo button{margin-left:12px;background:#ffcf40;color:#173b73}

/* Approved MealBalance IQ assets retain the existing navigation height. */
.brand .mb-header-logo{width:190px;height:48px;object-fit:contain}.login-card .mb-login-logo{width:230px;height:auto;max-width:100%;margin:0 auto 24px;display:block}

.meal-recipe-open{cursor:pointer;border-radius:5px}.meal-recipe-open:hover .meal-name{text-decoration:underline}.meal-recipe-open:focus-visible{outline:2px solid #245bb0;outline-offset:3px}

.recipe-card .recipe-yield{color:#173b73;font-weight:600;margin:0 0 6px;font-size:12px}

/* Hidden checkbox labels must override the shared flex checkbox layout. */
.check.hidden{display:none!important}

.grocery-category-label{font-size:11px;display:flex;flex-direction:column;gap:4px;max-width:180px}.grocery-category-label select{width:100%;font-size:12px}.grocery-water-note{font-size:12px;margin:16px 0}

/* Keep the planner scrollable inside the viewport, including zoomed displays. */
#planner-page{min-width:0;max-width:100%}
#planner-grid{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:auto;scrollbar-color:#718bb0 #e7edf5;scroll-padding-inline:2px}
#planner-grid::-webkit-scrollbar{height:14px}
#planner-grid::-webkit-scrollbar-thumb{background:#718bb0;border-radius:7px;border:3px solid #e7edf5}
#planner-grid::-webkit-scrollbar-track{background:#e7edf5}
.planner-scroll-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px;padding:8px;background:#fff;border:1px solid #dce4ee;border-radius:9px}
.planner-scroll-controls span{font-size:12px;color:#63738f}
.planner-scroll-controls button:disabled{opacity:.4;cursor:default}
@media(max-width:600px){.planner-scroll-controls span{display:none}.date-controls{flex-wrap:wrap}}

.settings-tabs{display:flex;gap:8px;border-bottom:1px solid #dce4ee;margin-bottom:24px}.settings-tabs button{border-radius:9px 9px 0 0;border-bottom:3px solid transparent}.settings-tabs button[aria-selected=true]{background:#fff6d7;border-bottom-color:#f5bf26;color:#173b73}
.goal-guide h2,.password-card h2{margin-top:0}.goal-guide-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0}.goal-guide-grid article{padding:16px;border:1px solid #dce4ee;border-radius:10px;background:#fbfcff}.goal-guide-grid h3{margin:0 0 12px}.goal-guide p{font-size:13px;line-height:1.6}.goal-incomplete{background:#eef4fd;border-radius:8px;padding:14px}.goal-gold{color:#946000}.goal-green{color:#0b7756}.goal-red{color:#bd1747}.goal-mode-help{grid-column:1/-1;font-size:12px;color:#63738f;margin:0 0 8px}.goal-line input:disabled{background:#f1f3f6;color:#8b97a8;opacity:.6}.password-card{max-width:540px;margin:32px auto;padding:28px}.security-heading{display:flex;gap:14px;margin-bottom:24px}.security-heading>span{font-size:28px;color:#173b73}.security-heading h2{margin-bottom:6px}.password-card label{margin-top:18px;margin-bottom:7px;display:block}.password-input{display:flex;border:1px solid #ccd8e8;border-radius:9px;overflow:hidden}.password-input input{border:0;min-width:0;flex:1;width:100%}.password-input button{border:0;border-radius:0;font-size:12px}.password-input:focus-within{outline:2px solid #407bbd;outline-offset:2px}.password-card #password-help{font-size:12px;margin-top:8px}.password-card .form-actions{display:flex;justify-content:space-between;gap:12px}.password-card #password-status{font-size:13px;min-height:20px}
@media(max-width:1100px){.goal-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.goal-guide-grid{grid-template-columns:1fr}.password-card{padding:18px;margin:16px auto}}

/* Shared goal grouping for planner totals and nutrition overview. */
.nutrition-goal-group{margin-top:18px;padding-top:12px;border-top:1px solid #dce4ee}
.nutrition-goal-group .nutrition-group-title{font-size:13px;font-weight:700;color:#173b73;margin:0 0 12px;line-height:1.4}
.nutrition-goal-group .nutrient-row:last-child{margin-bottom:0}
/* Prominent brand with navigation wrapping before it becomes crowded. */
.topbar .brand{flex-shrink:0;padding:8px 0}
.topbar .brand .mb-header-logo{width:380px;height:96px;max-width:100%;object-fit:contain}
.topbar{min-height:112px;gap:22px;flex-wrap:wrap}
.topbar nav{min-width:0}
@media(max-width:1350px){.topbar nav{order:3;flex-basis:100%;width:100%}.topbar .user-area{margin-left:auto}.topbar nav button{padding-top:14px;padding-bottom:14px}}
@media(max-width:600px){.topbar .brand{max-width:100%;width:min(380px,100%)}.topbar .brand .mb-header-logo{width:100%;height:96px}.topbar{gap:8px}.topbar .user-area{margin-left:0}.topbar nav{flex-shrink:0}}

#planner-print{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}#planner-print svg{flex-shrink:0}
