
/* Companion additions inherit the existing cream, terracotta and sage palette. */
.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}
.companion-fab{position:fixed;right:26px;bottom:24px;z-index:12;display:flex;align-items:center;gap:9px;min-height:48px;padding:12px 19px;background:var(--accent);color:#fffdf9;border:1px solid #8f4023;border-radius:30px;box-shadow:0 6px 25px #60351f26;font-size:14px;font-weight:550}
.companion-fab .icon{width:20px;height:20px}.companion-fab:hover{background:#903f23}.companion-fab.is-working:after{content:"";width:7px;height:7px;border-radius:50%;background:#fff4d7}
.companion-welcome{display:flex;align-items:center;gap:15px;padding:22px;margin-top:26px;background:linear-gradient(110deg,#eee9da,#f7eee1);border:1px solid #ded4c0;border-radius:18px}.companion-welcome>div{flex:1}.companion-welcome strong{font:20px var(--serif)}.companion-welcome p{font-size:13px;color:var(--muted);margin-top:5px}
.companion-mark{width:42px;height:42px;display:grid;place-items:center;flex-shrink:0;background:#e4e9d5;color:#53633d;border:1px solid #d2dac1;border-radius:15px}.companion-mark .icon{width:23px;height:23px}
#companion{position:fixed;inset:auto 22px 22px auto;margin:0;width:min(570px,calc(100vw - 32px));height:min(820px,calc(100dvh - 44px));max-height:none;padding:0;border-radius:24px;overflow:hidden;background:var(--paper);border:1px solid #ded1bb}
#companion[open]{display:flex;flex-direction:column}#companion::backdrop{background:#382e233b;backdrop-filter:blur(2px)}
.companion-head{display:flex;align-items:center;gap:12px;padding:20px 22px 16px;border-bottom:1px solid var(--line);flex-shrink:0}.companion-head>div:nth-child(2){flex:1;min-width:0}.companion-head h2{font:21px var(--serif)}.companion-head p{font-size:12px;color:var(--muted);margin-top:5px}.companion-head .subtle{padding:7px;min-width:44px;min-height:44px}
.companion-history{display:flex;align-items:center;gap:6px;padding:6px 16px;border-bottom:1px solid var(--line);background:#f6f1e7;flex-shrink:0}.companion-history select{min-width:0;flex:1;background:transparent;border:0;padding:9px 4px;font:inherit;font-size:13px;color:var(--muted);min-height:44px}.companion-history .subtle{min-width:44px;min-height:44px;padding:6px}
.companion-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px 22px;scrollbar-width:thin;scrollbar-color:#d1c6b5 transparent}
.companion-empty{padding:25px 5px}.companion-empty>.companion-mark{margin-bottom:22px}.companion-empty h3{font:23px/1.6 var(--serif);text-wrap:balance}.companion-empty>p{font-size:14px;line-height:1.8;color:var(--muted);margin:12px 0 23px}
.mm-suggestions{display:grid;gap:10px}.mm-suggestions button{display:flex;justify-content:space-between;align-items:center;text-align:left;padding:14px 16px;background:#f2ecdf;border:1px solid #e3d9c8;color:var(--ink);border-radius:13px;font-size:14px;min-height:48px}.mm-suggestions button:hover{background:#eae2d3}.mm-suggestions .icon{width:17px;color:var(--accent)}
.mm-message{margin-bottom:24px;min-width:0}.mm-speaker{display:block;color:var(--muted);font-size:12px;margin-bottom:7px}.mm-message-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.8}.from-user{margin-left:36px;background:#ece6d9;border:1px solid #e0d6c4;border-radius:16px 16px 3px 16px;padding:13px 16px}.from-user .mm-speaker{text-align:right;font-size:11px}.from-companion{margin-right:8px}.mm-photo-count{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;margin-bottom:8px}.mm-photo-count .icon{width:16px}
.mm-card{background:#fffcf6;border:1px solid #dfd6c5;border-radius:15px;padding:17px;margin-top:13px;overflow:hidden}.mm-card-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:550;margin-bottom:10px}.mm-card-title .icon{width:19px;color:var(--sage)}.mm-card-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:11px 0;font-size:14px;min-width:0}.mm-card-row strong{white-space:nowrap;font-size:13px;font-weight:500}.mm-card-row small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.mm-card-row>span{min-width:0;overflow-wrap:anywhere}.mm-card-row:last-of-type{border-bottom:0}.mm-recipe-link{width:100%;background:transparent;text-align:left;color:var(--ink);min-height:46px}.mm-recipe-link:hover{color:var(--accent)}.mm-recipe-link>.icon{width:17px;flex-shrink:0}.mm-card>.button{margin-top:12px;margin-right:8px;font-size:13px;min-height:44px}.mm-card-note{font-size:12px;line-height:1.75;color:var(--muted);margin:10px 0}.mm-portions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.mm-portions>span{background:#f1eedf;padding:9px 11px;border-radius:9px;font-size:12px}.mm-portions strong{display:block;color:var(--accent);font-size:13px;margin-top:3px}
.companion-progress{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--muted);padding:0 22px;flex-shrink:0}.companion-progress:not(:empty){padding-top:10px;padding-bottom:10px;background:#f1eddf;border-top:1px solid var(--line)}.companion-progress>span:nth-child(2){flex:1}.companion-progress button{background:none;color:var(--accent);min-height:32px;padding:0 8px}
.mm-working{display:inline-block;width:14px;height:14px;flex-shrink:0;border-radius:50%;border:2px solid #d8c4a9;border-top-color:var(--accent);animation:mm-spin 1s linear infinite}@keyframes mm-spin{to{transform:rotate(360deg)}}
.companion-compose{padding:15px 20px 14px;background:var(--paper);border-top:1px solid var(--line);flex-shrink:0}.companion-compose form{padding:11px 13px 9px;background:#fffdf8;border:1px solid #cdbda5;border-radius:15px}.companion-compose textarea{resize:none;border:0;background:transparent;color:var(--ink);width:100%;font:inherit;font-size:16px;line-height:1.65;min-height:54px;max-height:130px;padding:0;outline:0}.companion-compose form:focus-within{outline:2px solid #9d6949;outline-offset:2px}.companion-compose-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.mm-tools{display:flex;gap:5px}.mm-icon-button{display:grid;place-items:center;width:44px;min-height:44px;cursor:pointer;color:var(--muted);background:transparent;border-radius:10px;border:1px solid transparent}.mm-icon-button:hover{background:#f4edde;color:var(--accent)}.mm-icon-button.recording{background:#f4ddd2;color:#903f2b;border-color:#c59380}.mm-hint{font-size:12px;color:var(--muted);line-height:1.7;margin:10px 0 0}.mm-error{color:#913b2e;font-size:13px;line-height:1.8;overflow-wrap:anywhere}.mm-error:not(:empty){padding:10px 0}.mm-attachments{display:flex;gap:10px;flex-wrap:wrap}.mm-attachments:not(:empty){padding:10px 0 14px}.mm-attachment{position:relative;width:76px;height:76px;border-radius:12px;background:#eae2d5}.mm-attachment img{width:100%;height:100%;object-fit:cover;border-radius:12px}.mm-attachment button{position:absolute;right:-7px;top:-7px;min-height:32px;width:32px;background:#fffcf5;border:1px solid #dac9b3;border-radius:50%;display:grid;place-items:center;color:var(--ink)}.mm-attachment .icon{width:16px;height:16px}
.mm-intake-intro{display:flex;align-items:center;gap:13px;margin-bottom:23px}.mm-intake-intro h3{font:23px var(--serif)}.mm-intake-intro p{font-size:14px;color:var(--muted);margin-top:6px}.mm-intake-camera{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:18px}.mm-intake-camera label{cursor:pointer}.mm-intake-camera>span{font-size:12px;color:var(--muted)}.mm-intake-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 15px}.mm-intake-tools .button{min-height:44px}.mm-pending{margin-top:25px;border-top:1px solid var(--line);padding-top:20px}.mm-pending h3{font:18px var(--serif);margin-bottom:10px}
.mm-draft-intro{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px;font-size:14px}.mm-draft-intro span{font-size:12px;color:var(--muted);max-width:260px}.mm-draft-item{padding:17px 18px;margin-bottom:16px;border:1px solid #e0d3be;border-radius:15px;background:#fffaf1}.mm-draft-item-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.mm-draft-item-head>.button{min-width:44px;min-height:44px;padding:8px}.mm-draft-item .checkbox{font-size:13px}.mm-draft-item input,.mm-draft-item select,.mm-intake-intro~form textarea{font-size:16px}.mm-quantity{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px}.mm-draft-item .field{margin-bottom:13px}.mm-draft-item details{font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:5px}.mm-draft-item summary{cursor:pointer;min-height:44px;display:list-item;align-content:center;list-style-position:inside}.mm-draft-item details[open]>summary{margin-bottom:10px}.mm-draft-item [aria-invalid=true]{border-color:#a04832;outline:1px solid #a04832}.mm-review-note{display:flex;align-items:flex-start;gap:7px;color:#80511d;font-size:12px;margin:0 0 13px}.mm-review-note .icon{width:16px;height:16px;flex-shrink:0}.mm-candidates{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;margin:8px 0 15px}.mm-candidates span{color:var(--muted)}.mm-candidates button{background:#efe5d4;color:#724728;border-radius:8px;padding:7px 10px;min-height:44px}.mm-draft-footer{position:sticky;bottom:-22px;padding:15px 0 8px;background:var(--paper);border-top:1px solid var(--line)}.mm-draft-footer .mm-intake-tools{margin-top:0}.mm-success{text-align:center;padding:12px 0 25px}.mm-success>.icon{width:48px;height:48px;color:var(--sage);margin-bottom:18px}.mm-success h3{font:25px var(--serif);margin-bottom:12px}.mm-success p{font-size:14px;color:var(--muted)}
@media(max-width:850px){.companion-fab{bottom:94px;right:18px}.companion-welcome{padding:18px}.companion-welcome strong{font-size:18px}}
@media(max-width:620px){#companion{inset:0;margin:0;width:100%;max-width:none;height:100dvh;border-radius:0;border:0}.companion-head{padding:16px 17px 13px}.companion-head h2{font-size:20px}.companion-head p{font-size:11px}.companion-head>.companion-mark{width:38px;height:38px;border-radius:13px}.companion-messages{padding:22px 17px}.companion-compose{padding:12px 16px max(14px,env(safe-area-inset-bottom))}.companion-compose textarea{font-size:16px}.companion-empty{padding-top:14px}.companion-welcome{align-items:flex-start;gap:11px;flex-wrap:wrap}.companion-welcome .companion-mark{width:36px;height:36px;border-radius:12px}.companion-welcome>div{min-width:210px}.companion-welcome>button{margin-left:47px}.companion-welcome p{font-size:12px}.mm-draft-item{padding:14px 12px}.mm-quantity{gap:8px}.mm-draft-intro{align-items:flex-start}.mm-draft-intro span{max-width:210px}.mm-card{padding:15px}.mm-card-row{font-size:13px}.mm-icon-button{width:40px}.mm-tools{gap:0}}
@media(prefers-reduced-motion:reduce){.mm-working{animation:none;border-color:var(--accent)}}


.dialog-toast{position:sticky;bottom:12px;align-self:center;margin:10px 16px;flex-shrink:0;background:#3d332b;color:#fffaf1;border-radius:11px;padding:11px 16px;font-size:13px;line-height:1.7;box-shadow:0 4px 18px #3d332b22;z-index:20}
.mm-run-error{margin-top:12px;border-top:1px solid #d0b59e;padding-top:9px;color:#913b2e;font-size:13px}.mm-run-error p{margin-bottom:7px}
.mm-quantity.is-state{grid-template-columns:1fr}.mm-draft-item .field[hidden]{display:none!important}

.mm-voice-options{display:flex;gap:12px;flex-wrap:wrap;align-items:center;padding:8px 0;color:#6b5a4c;font-size:12px}.mm-voice-options label{display:flex;align-items:center;gap:5px;min-height:34px}.mm-voice-options input{accent-color:#a64c2b}.mm-voice-options button{font-size:12px;min-height:36px}.mm-voice-timer{font-size:24px!important;color:#a64c2b;font-variant-numeric:tabular-nums}.voice-entry{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}@media(max-width:650px){.voice-entry span{display:none}.mm-voice-options{gap:6px 12px}.mm-voice-options label{min-height:40px}}

/* Service readiness stays secondary to the user's kitchen task. */
.mm-readiness{flex-shrink:0;margin:8px 16px;border:1px solid var(--line,#ded1bb);border-radius:12px;background:var(--paper);padding:0 12px;font-size:13px}
.mm-readiness summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--ink);gap:8px}
.mm-readiness summary:before{content:"+";font-size:18px;color:var(--accent)}
.mm-readiness[open] summary:before{content:"−"}
.mm-readiness dl{margin:0}.mm-readiness dl>div{display:flex;justify-content:space-between;gap:16px;padding:7px 0;border-top:1px solid var(--line,#ded1bb)}
.mm-readiness dt{flex:1}.mm-readiness dd{margin:0;text-align:right;max-width:65%;overflow-wrap:anywhere}
.mm-readiness .button{margin:0 0 12px;min-height:44px}.mm-readiness .mm-hint{line-height:1.6}
.mm-photo-policy{padding:12px 16px;background:var(--sage-light,#e9edde);border-radius:12px;font-size:14px;line-height:1.7}
@media(max-width:600px){.mm-readiness{margin:6px 12px}.mm-readiness dl>div{gap:8px}}

/* Keep the bulk confirmation fully inside the dialog viewport. */
.mm-draft-footer{bottom:0;padding-bottom:max(12px,env(safe-area-inset-bottom))}

.mm-voice-status{padding:10px 14px;margin:0 0 10px;border-radius:12px;background:var(--sage-soft);color:var(--ink);font-size:14px;overflow-wrap:anywhere}.mm-voice-status[data-phase="listening"]{background:var(--accent-soft);font-weight:600}.mm-voice-status[data-phase="error"]{background:#f5e5dd;color:#8d3728}.mm-voice-status[data-phase="thinking"],.mm-voice-status[data-phase="preparing"],.mm-voice-status[data-phase="transcribing"]{border-left:3px solid var(--sage)}

.mm-receipt-review>summary{padding:10px 0;cursor:pointer;font-weight:600;line-height:1.6}.mm-receipt-excluded{margin:18px 0;padding:14px;background:var(--paper,#faf6ee);border-radius:14px}.mm-receipt-review>.mm-hint{overflow-wrap:anywhere}

form[data-mm-form=intake] [hidden]{display:none!important}
