:host{all:initial;--accent:var(--mkai-primary,#cd704d);--ink:#332d29;--muted:#84766d;--line:#eaded5;--paper:#fcfaf8;font-family:Arial,Helvetica,sans-serif;font-size:14px;color:var(--ink);line-height:1.5}
:host *,:host *::before,:host *::after{box-sizing:border-box}
:host [hidden]{display:none!important}
:host button,:host input,:host textarea,:host select{font:inherit}
:host button,:host a,:host input,:host textarea,:host select{-webkit-tap-highlight-color:transparent}
:host button{cursor:pointer;border:1px solid var(--line);border-radius:12px;padding:9px 13px;background:#fff;color:var(--ink);line-height:1.4;transition:background .15s,box-shadow .15s}
:host button:hover:not(:disabled){background:#f8eee7}
:host button:disabled{cursor:default;opacity:.55}
:host button:focus-visible,:host a:focus-visible,:host input:focus-visible,:host textarea:focus-visible,:host select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
:host a{color:#995236;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
:host .launcher{position:fixed;z-index:999998;bottom:24px;right:24px;color:#fff;background:var(--accent);border:0;border-radius:28px;padding:14px 22px;box-shadow:0 6px 24px #54362324;font-weight:600}
:host .launcher:hover:not(:disabled){background:#ab5739}
:host .panel{position:fixed;z-index:999999;right:24px;bottom:calc(88px + var(--mkai-bottom,0px));display:flex;flex-direction:column;width:420px;max-width:calc(100vw - 24px);height:min(720px,calc(var(--mkai-viewport,100dvh) - 112px));min-height:260px;background:var(--paper);border:1px solid var(--line);border-radius:24px;box-shadow:0 12px 55px #4c34252b;overflow:hidden;text-align:left}
:host([data-position=left]) .launcher,:host([data-position=left]) .panel{right:auto;left:24px}
:host .panel.expanded{width:min(720px,calc(100vw - 48px));height:calc(var(--mkai-viewport,100dvh) - 112px)}
:host header{display:flex;align-items:center;gap:8px;flex-shrink:0;min-height:80px;padding:18px 16px;background:#fff;border-bottom:1px solid var(--line)}
:host .brand{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;border-radius:14px;background:#f2e4d8;color:#934d32;font-family:Georgia,serif;font-size:23px;font-weight:bold;letter-spacing:-4px;padding-right:4px}
:host .heading{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
:host .heading strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
:host .heading small{font-size:10px;color:var(--muted)}
:host .header-action{border:0;background:transparent;padding:5px;font-size:22px;border-radius:7px;line-height:1;flex-shrink:0}
:host .header-action.reset,:host .header-action.requests-toggle{font-size:10px;padding:7px 3px}
:host .requests-toggle[aria-expanded=true]{color:var(--accent);text-decoration:underline}
:host .order-context{display:flex;align-items:center;gap:12px;flex-shrink:0;margin:8px 16px 0;padding:9px 12px;min-height:54px;text-align:left;background:#fff;border-radius:12px}
:host .order-context-summary{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
:host .order-context-summary strong{font-size:12px}
:host .order-context-summary small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--muted)}
:host .order-context-action{flex-shrink:0;font-size:11px;color:#995236}
:host .order-tracking summary{cursor:pointer;font-size:12px;color:var(--muted)}
:host .order-tracking .rich-text{margin-top:6px;font-size:12px}
:host .scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px 18px 12px;scrollbar-width:thin}
:host .requests{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px;display:flex;flex-direction:column;gap:12px}
:host .requests h2{margin:0;font-size:16px}
:host .requests>p{margin:0;font-size:12px;color:var(--muted)}
:host .requests>button{align-self:flex-start}
:host .history{display:flex;flex-direction:column;gap:16px}
:host .message{max-width:94%;align-self:flex-start;min-width:0}
:host .bubble{padding:13px 15px;border:1px solid var(--line);border-radius:4px 20px 20px 20px;background:#fff;font-size:13px;overflow-wrap:anywhere}
:host .message.user{align-self:flex-end}
:host .message.user .bubble{background:#f4e8df;border-radius:20px 4px 20px 20px}
:host .who{display:block;color:var(--muted);font-size:10px;margin:5px 4px}
:host .message.user .who{text-align:right}
:host .message[data-delivery=failed] .who,:host .message[data-delivery=unknown] .who{color:#a44325}
:host .reply-loading{font-size:12px;color:var(--muted);margin:0}
:host .rich-text{white-space:pre-wrap;overflow-wrap:anywhere}
:host .bubble>a,:host .bubble>button{display:inline-block;margin-top:12px}
:host .jobs,:host .controls{display:flex;flex-direction:column;gap:10px}
:host .controls:not(:empty){margin-top:16px}
:host .card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;overflow-wrap:anywhere}
:host .card>strong{font-size:13px}
:host .card p{margin:0;font-size:12px;white-space:pre-wrap}
:host .card small,:host .card time{font-size:11px;color:var(--muted);white-space:pre-wrap}
:host .operation-meta{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center}
:host .operation-progress{display:flex;list-style:none;padding:0;margin:3px 0;isolation:isolate}
:host .operation-progress li{position:relative;display:flex;flex:1;min-width:0;align-items:center;flex-direction:column;gap:6px;text-align:center}
:host .operation-progress li:not(:first-child)::before{content:"";position:absolute;top:11px;right:50%;width:100%;height:2px;background:var(--line);z-index:-1}
:host .operation-progress li.is-done::before,:host .operation-progress li.is-current::before{background:var(--accent)}
:host .step-marker{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:1px solid var(--line);border-radius:50%;background:#fff;font-size:11px;color:var(--muted)}
:host .step-label{font-size:10px;line-height:1.4;color:var(--muted)}
:host .is-done .step-marker{background:#edf4ee;border-color:#52845d;color:#32613d}
:host .is-current .step-marker{background:#f8eee7;border:2px solid var(--accent);color:#874021}
:host .is-current .step-label,:host .is-done .step-label{color:var(--ink)}
:host .is-paused .step-marker{background:#fff5df;border-color:#b76d28;color:#855018}
:host .is-paused .step-label{color:#855018}
:host .card img{width:64px;height:64px;object-fit:cover;border-radius:10px}
:host .card pre{margin:0;padding:10px;border-radius:10px;background:var(--paper);font:12px/1.6 Arial,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere}
:host .primary{background:var(--accent);color:#fff;border-color:transparent}
:host .primary:hover:not(:disabled){background:#ac583c}
:host .inline-form,:host .change-fields{display:flex;flex-direction:column;gap:12px}
:host .field{display:flex;flex-direction:column;gap:5px;font-size:12px}
:host .field input,:host .field select,:host .field textarea{width:100%;min-width:0;border:1px solid #d6c6ba;border-radius:9px;padding:10px;background:#fff;color:var(--ink);font-size:13px}
:host .field textarea{min-height:85px;resize:vertical;max-height:220px}
:host .form-help{border-top:1px solid var(--line);padding-top:12px}
:host .notice,:host .storage-notice{margin:0 16px;font-size:12px;flex-shrink:0}
:host .notice:not(:empty),:host .storage-notice:not(:empty){padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff6ee;max-height:145px;overflow:auto;margin-top:7px}
:host .notice p{margin:0 0 8px}
:host .notice button{margin:4px 6px 0 0;font-size:11px;padding:7px 9px}
:host .topics-toggle{align-self:flex-start;border:0;border-radius:7px;color:var(--muted);font-size:11px;padding:4px 0;margin:6px 18px 3px;background:transparent}
:host .topics{display:flex;flex-wrap:wrap;gap:6px;padding:0 16px 9px;max-height:160px;overflow:auto;flex-shrink:0}
:host .chip{border-radius:22px;font-size:11px;padding:9px 12px}
:host .composer{display:flex;align-items:flex-end;gap:8px;flex-shrink:0;margin:0 14px;padding:7px;border:1px solid #d2bdaf;border-radius:17px;background:#fff}
:host .composer textarea{display:block;flex:1;min-width:0;min-height:38px;max-height:120px;padding:8px 7px;border:0;background:transparent;color:var(--ink);resize:none;outline-offset:0;font-size:13px;line-height:1.5}
:host .composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 2px #cd704d20}
:host .composer textarea:focus-visible{outline:none}
:host .send{border:0;border-radius:13px;background:var(--accent);color:#fff;font-size:25px;line-height:1;width:40px;height:42px;padding:7px;flex-shrink:0}
:host .send:hover:not(:disabled){background:#ac583c}
:host .send.has-label{width:auto;min-width:40px;font-size:14px}
:host .counter{text-align:right;min-height:4px;font-size:10px;color:var(--muted);margin:0 24px}
:host .counter.over-limit{color:#ad2424}
:host .footer{font-size:9px;color:var(--muted);text-align:center;padding:9px 12px 12px;flex-shrink:0}
:host .new-messages{align-self:center;font-size:11px;padding:6px 13px;box-shadow:0 2px 8px #6b43241a}
:host .loading::after{content:"";display:inline-block;width:4px;height:4px;border-radius:50%;background:var(--accent);margin-left:8px;animation:pulse 1s infinite alternate}
@keyframes pulse{from{opacity:.3}to{opacity:1}}
@media(max-width:767px){
 :host .panel,:host .panel.expanded{right:8px;bottom:calc(8px + var(--mkai-bottom,0px) + var(--mkai-toolbar-offset,0px));width:calc(100vw - 16px);max-width:none;height:calc(var(--mkai-viewport,100dvh) - 16px - var(--mkai-toolbar-offset,0px));min-height:min(220px,calc(var(--mkai-viewport,100dvh) - 16px));border-radius:20px}
 :host([data-position=left]) .panel{left:8px;right:auto}
 :host .launcher{right:16px;bottom:18px}
 :host([data-position=left]) .launcher{left:16px;right:auto}
 :host header{padding:14px;min-height:72px}
 :host .field input,:host .field textarea,:host .field select,:host .composer textarea{font-size:16px}
 :host .topics{max-height:132px}
}
@media(prefers-reduced-motion:reduce){:host *{animation:none!important;transition:none!important}}
