.editor-drawer { box-sizing:border-box; position:fixed; inset:0 0 0 auto; margin:0; width:min(620px,100vw); height:100dvh; max-height:100dvh; max-width:100vw; padding:0; border:0; border-left:1px solid var(--line); border-radius:24px 0 0 24px; background:var(--surface); color:var(--ink); box-shadow:-20px 0 80px #0002; overflow:hidden; }
.editor-drawer[open] { display:flex; flex-direction:column; animation:drawer-enter .2s ease-out; }
.editor-drawer:not([open]) { display:none; }
.editor-drawer::backdrop { background:#12132966; backdrop-filter:blur(3px); }
.editor-drawer * { box-sizing:border-box; min-width:0; }
.editor-drawer-open { overflow:hidden; }
.editor-drawer-head { flex:none; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:24px; border-bottom:1px solid var(--line); }
.editor-drawer-head h2 { margin:0; font-size:1.35rem; overflow-wrap:anywhere; }
.editor-drawer-close { flex:none; width:40px; height:40px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink); font-size:1.6rem; cursor:pointer; }
.editor-drawer .editor-drawer-form { display:flex!important; flex:1; flex-direction:column; gap:0; min-height:0; margin:0; overflow:hidden; }
.editor-drawer-body { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:24px; display:flex; flex-direction:column; gap:18px; }
.editor-drawer-body > * { flex-shrink:0; }
.editor-drawer-body > .form-validation-message { flex:0 0 auto; margin:0; font-size:14px; line-height:1.5; }
.editor-drawer .field-validation-error { position:relative; padding-inline-start:23px; margin:2px 0 0; font-size:13px; font-weight:500; line-height:1.45; }
.editor-drawer .field-validation-error::before { position:absolute; inset-inline-start:0; top:1px; margin:0; }
.editor-drawer-body :is(.settings-two-cols,.calendar-schedule-row,.meal-ingredient-row) { align-items:start; }
.editor-drawer-body label { align-content:start; }
#meal-planner-root .editor-drawer .meal-ingredient-row { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
#meal-planner-root .editor-drawer .meal-ingredient-row > .meal-field:first-child { grid-column:1 / -1; }
#meal-planner-root .editor-drawer .meal-ingredient-row > button { grid-column:1 / -1; justify-self:end; }
.editor-drawer-body > fieldset { display:flex; flex-direction:column; gap:18px; padding:0; border:0; }
.editor-drawer-body > fieldset > legend { display:none; }
/* Explicit grid tracks isolate the actions from the site's full-width mobile buttons. */
.editor-drawer-footer { flex:none; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); align-items:stretch; gap:12px; padding:18px 24px max(18px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--surface); }
.editor-drawer .editor-drawer-footer button { width:100%; min-width:0; max-width:100%; margin:0; height:auto; min-height:48px; padding:12px; border-radius:14px; font-size:14px; line-height:1.4; white-space:normal; word-break:normal; overflow-wrap:break-word; }
.editor-drawer .editor-drawer-footer button[type="submit"] { grid-column:2; grid-row:1; }
.editor-drawer .editor-drawer-footer button:not([type="submit"]) { grid-column:1; grid-row:1; }
.editor-drawer-footer .meal-actions { display:contents !important; }
.editor-drawer-body .tgv-time:has(> input[aria-invalid="true"]) .tgv-select-trigger { border-color:var(--coral) !important; }
body .editor-drawer :is(input,textarea,select)[aria-invalid="true"] { border-color:var(--coral) !important; }
.editor-drawer-body label:has(> select[aria-invalid="true"]) .multi-select-chip-grid { outline:1px solid var(--coral); outline-offset:3px; border-radius:12px; }
.editor-drawer-notice:empty { display:none; }
.editor-drawer-notice { flex:0 0 auto; max-height:25dvh; overflow-y:auto; margin:0; padding:12px 24px; overflow-wrap:anywhere; }
.editor-drawer-notice.error { color:var(--danger,#c33); }
.drawer-launch { margin:10px 0 18px; }
.overview-pending-row { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:16px; padding:18px 0; border-top:1px solid var(--line); }
.overview-pending-body { flex:1; min-width:0; }
.overview-pending-body p { margin:5px 0 0; font-size:.85rem; color:var(--muted); overflow-wrap:anywhere; }
.overview-pending-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
@keyframes drawer-enter { from {transform:translateX(35px);opacity:0} to {transform:translateX(0);opacity:1} }
@media(max-width:640px) { .editor-drawer { width:100vw; border:0; border-radius:0; } .editor-drawer-head {padding:18px 16px;} .editor-drawer-body {padding:20px 16px;} .editor-drawer-footer {gap:10px;padding:12px 16px max(12px,env(safe-area-inset-bottom));} .overview-pending-row {grid-template-columns:36px minmax(0,1fr);align-items:start;gap:10px;} .overview-pending-row > .overview-helper {width:36px;height:36px;} .overview-pending-actions {grid-column:2;justify-content:flex-start;} .overview-pending-actions:empty {display:none;} }
@media(prefers-reduced-motion:reduce) { .editor-drawer[open] {animation:none;} }
