/* Meal sheet only. Main-page design lives in experience.css. */
/* The editor is a dedicated top-layer surface; its child pickers keep their own dialogs. */
#meal-sheet{width:min(1040px,calc(100% - 48px));max-width:1040px;height:min(860px,94dvh);max-height:94dvh;padding:0;border:1px solid #e1e7dc;border-radius:30px;background:#f5f7f1;color:var(--ink);overflow:hidden;margin:auto;box-shadow:0 24px 100px #14291e29}
#meal-sheet[open]{display:flex;flex-direction:column;animation:meal-sheet-rise .3s cubic-bezier(.2,.75,.25,1)}
#meal-sheet::backdrop{background:#1a302a55;backdrop-filter:blur(5px)}
.meal-sheet-open{overflow:hidden}
.meal-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 26px 16px;border-bottom:1px solid #dde6d9;background:#f5f7f1;flex:none}
.meal-sheet-heading h2{font-size:23px;margin:0 0 5px;font-weight:630;letter-spacing:-.03em}.meal-sheet-heading small{font-size:14px;color:#536653}
.meal-sheet-heading .sheet-close{width:44px;height:44px;min-width:44px;padding:0;border-radius:50%;border:0;background:#e6ece1;color:var(--green-dark);display:grid;place-items:center}
.sheet-grabber{display:none}
#meal-sheet.sheet-dragging,#meal-sheet.sheet-dismissing{will-change:transform}
#meal-sheet.sheet-dismissing{pointer-events:none}
.meal-sheet-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:22px 26px max(28px,env(safe-area-inset-bottom));scroll-padding:20px}
#meal-sheet .v3-meal-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:12px}
#meal-sheet .home-meal-heading{margin:0;flex-wrap:wrap}
#meal-sheet .save-state{margin-left:0}
#meal-sheet .photo-panel{background:#fff;border:1px solid #e3e9df;box-shadow:none;border-radius:24px}
#meal-sheet .food-card{background:#fff;border-color:#e3e9df;box-shadow:none;border-radius:22px}
#meal-sheet .food-name{font-size:17px;min-width:0}
#meal-sheet .food-details .field>span,#meal-sheet .missing-hint{font-size:14px}
#meal-sheet .photo-panel>.primary,#meal-sheet .btn.primary{background:var(--green-dark)}
#meal-sheet .supplement-box{margin-top:16px}
#meal-sheet .photo-panel{position:static}
#meal-sheet .toast{z-index:10}
.meal-sheet-open .sidebar{display:flex!important}
@keyframes meal-sheet-rise{from{transform:translateY(36px);opacity:.4}to{transform:translateY(0);opacity:1}}

@media(min-width:761px) and (max-width:980px){#meal-sheet .confirmation{display:flex;flex-direction:column}#meal-sheet .photo-panel,#meal-sheet .food-list{width:100%;min-width:0}}
@media(max-width:760px){
 #meal-sheet{width:100%;max-width:100%;height:94dvh;max-height:94dvh;max-height:calc(100dvh - env(safe-area-inset-top) - 8px);margin:auto 0 0;border-radius:30px 30px 0 0;border-bottom:0}
 .meal-sheet-heading{padding:21px 20px 14px;position:relative;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}.meal-sheet-heading h2{font-size:22px}.sheet-grabber{display:block;position:absolute;width:34px;height:4px;border-radius:99px;background:#c9d3c4;top:9px;left:calc(50% - 17px)}
 .sheet-dragging .meal-sheet-heading{cursor:grabbing}
 .meal-sheet-body{padding:18px 16px max(24px,env(safe-area-inset-bottom))}.meal-sheet-body .confirmation{display:flex;flex-direction:column;gap:22px}
 #meal-sheet .photo-panel{padding:16px;width:100%}#meal-sheet .food-list{width:100%}#meal-sheet .v3-meal-meta{margin-bottom:16px;align-items:start}#meal-sheet .save-state{font-size:14px;flex-basis:100%}
 #meal-sheet .stack-card{background:#f5f8f1;border-color:#d8e1d2}#meal-sheet .stack-cards{padding-right:13px;padding-bottom:16px}
 #meal-sheet .photo-tabs{margin-bottom:14px}#meal-sheet .consumption-choices{gap:8px}#meal-sheet .consumption-choices .btn{padding-inline:12px}
 #meal-sheet .photo-panel .stack-card .photo-view,#meal-sheet .photo-panel .stack-card .photo-empty{aspect-ratio:1.08;max-height:none}
 #meal-sheet .food-card{padding:16px}.nutrition-collapsed{padding:20px;flex-wrap:wrap}
 @keyframes meal-sheet-rise{from{transform:translateY(70px);opacity:.5}to{transform:translateY(0);opacity:1}}
}

@media(prefers-reduced-motion:reduce){#meal-sheet[open]{animation:none}}

/* D105 entry flow: scoped to the existing sheet, original photo deck unchanged. */
#meal-sheet{background:var(--bg);border-color:var(--border)}
#meal-sheet .meal-sheet-heading{background:var(--bg);border:0;padding:26px 24px 12px}
#meal-sheet .meal-sheet-heading h2{font-size:28px;font-weight:700;line-height:1.3;color:var(--ink);margin:0 0 7px}
#meal-sheet .meal-sheet-heading small{font-size:14px;color:var(--muted);line-height:1.5}
#meal-sheet .sheet-close{background:var(--surface-soft);color:var(--green);width:44px;height:44px}
#meal-sheet .sheet-grabber{display:block;position:absolute;top:9px;left:calc(50% - 17px);width:34px;height:4px;border-radius:99px;background:#c8d5ca}
#meal-sheet .meal-sheet-heading{position:relative}
#meal-sheet .meal-sheet-body{padding:12px 24px max(24px,env(safe-area-inset-bottom));scroll-padding-bottom:24px}
#meal-sheet .v3-meal-meta{display:block;margin-bottom:10px}
#meal-sheet .entry-meal-kinds{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:4px;border-radius:18px;background:var(--surface-soft)}
#meal-sheet .entry-meal-kinds button{display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 5px;min-height:46px;border:0;border-radius:14px;background:transparent;box-shadow:none;font:inherit;font-size:15px;font-weight:550;color:var(--muted);white-space:nowrap}
#meal-sheet .entry-meal-kinds button[aria-pressed="true"]{background:var(--green);color:white}
#meal-sheet .entry-meta-line{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:38px;margin-top:3px}
#meal-sheet .entry-meta-line .save-state{font-size:12px;color:var(--muted)}
#meal-sheet .entry-meta-line .meal-time{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin:0 0 0 auto;min-height:44px;font-size:14px;color:var(--muted)}
#meal-sheet .meal-time small{font-size:13px;color:var(--muted)}
#meal-sheet .confirmation{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px;align-items:start}
#meal-sheet .meal-input-flow{display:grid;gap:14px;min-width:0}
#meal-sheet .entry-card{display:block;width:100%;min-width:0;margin:0;padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:var(--card-radius);box-shadow:var(--shadow);backdrop-filter:none}
#meal-sheet .entry-card h3{font-size:19px;font-weight:650;line-height:1.4;margin:0;color:var(--ink);letter-spacing:-.02em}
#meal-sheet .entry-card h3 small{font-size:16px;font-weight:400;color:var(--muted)}
#meal-sheet .entry-description{font-size:13px;color:var(--muted);line-height:1.65;margin:7px 0 13px}
#meal-sheet .photo-panel{position:static}
#meal-sheet .photo-tabs{margin:14px auto;width:fit-content;max-width:100%;background:var(--surface-soft)}
#meal-sheet .photo-tabs .btn{font-size:15px}
#meal-sheet .stack-card{border-color:#d8e1d8;background:var(--bg)}
#meal-sheet .photo-empty{color:var(--ink);font-size:16px}
#meal-sheet .photo-empty svg{box-sizing:content-box;padding:12px;background:var(--surface-soft);border-radius:50%;color:var(--green);width:24px;height:24px}
#meal-sheet .consumption-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
#meal-sheet .consumption-choices .btn{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:46px;padding:10px 4px;border:1px solid transparent;border-radius:14px;background:#f3f6f1;color:var(--muted);font-size:13px;font-weight:550;box-shadow:none}
#meal-sheet .consumption-choices .btn[aria-pressed="true"]{background:#eaf3e9;color:var(--green);border-color:var(--green)}
#meal-sheet .consumption-choices .btn>span{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.4}
#meal-sheet .meal-glyph{flex:none}
#meal-sheet .estimate-meal{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;border-radius:18px;background:var(--green);font-size:19px;font-weight:650;margin:0;box-shadow:none}
#meal-sheet .estimate-sparkles{color:#E8D58A;flex:none}
#meal-sheet .food-list{width:100%;min-width:0}
#meal-sheet .food-list h2{font-size:20px;color:var(--ink)}
.meal-note-field{position:relative;min-width:0}
.meal-note-field textarea{display:block;width:100%;min-height:112px;padding:12px 12px 34px;border:1px solid #dce2dd;border-radius:16px;background:#fcfdfb;color:var(--ink);font:inherit;font-size:16px;line-height:1.65;resize:vertical}
.meal-note-field textarea::placeholder{color:#929b9c;opacity:1}
.meal-note-input{position:relative}
.meal-note-field .note-count{position:absolute;right:12px;bottom:10px;font-size:12px;color:var(--muted);pointer-events:none}
.meal-note-field .note-legacy{display:block;margin-top:7px;font-size:12px;color:var(--muted);line-height:1.5}
.meal-note-field .note-legacy[hidden]{display:none}
@media(max-width:980px){
 #meal-sheet .confirmation{display:flex;flex-direction:column;gap:20px}
 #meal-sheet .meal-input-flow{width:100%}
}
@media(max-width:760px){
 #meal-sheet .meal-sheet-heading{padding:26px 18px 10px}
 #meal-sheet .meal-sheet-body{padding:10px 14px max(24px,env(safe-area-inset-bottom))}
 #meal-sheet .entry-card{padding:16px}
 #meal-sheet .entry-meal-kinds button{font-size:14px}
 #meal-sheet .photo-panel .stack-card .photo-view,#meal-sheet .photo-panel .stack-card .photo-empty{aspect-ratio:1.08;max-height:none}
}
@media(max-width:359px){
 #meal-sheet .entry-meal-kinds{gap:3px}
 #meal-sheet .entry-meal-kinds button{gap:4px;font-size:13px}
 #meal-sheet .entry-meal-kinds svg{width:17px;height:17px}
 #meal-sheet .entry-card{padding:14px}
 #meal-sheet .consumption-choices{gap:5px}
 #meal-sheet .consumption-choices .btn{font-size:12px;gap:2px;padding-inline:2px}
 #meal-sheet .consumption-choices svg{width:14px;height:14px}
}
