:root{font-family:Inter,"Segoe UI",sans-serif;color:#e7ece8;background:#111512;font-synthesis:none;color-scheme:dark;--bg:#111512;--side:#191e1a;--panel:#202722;--panel2:#252d27;--line:#303a32;--text:#e7ece8;--muted:#9ba89e;--green:#75b58b;--green-strong:#4c8e62;--red:#db8975}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body,button,input,textarea,select{font:inherit}button,a,.attach{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--line);background:var(--panel);border-radius:9px;padding:10px 14px;color:var(--text);transition:background .15s,border-color .15s}button:hover{background:var(--panel2);border-color:#536457}button:disabled{opacity:.48;cursor:wait}button:focus-visible,a:focus-visible,.attach:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--green);outline-offset:2px}.primary{background:var(--green-strong);color:white;border-color:var(--green-strong)}.primary:hover{background:#3d7952}input,textarea,select{width:100%;border:1px solid var(--line);border-radius:9px;padding:11px;background:#151a16;color:var(--text)}textarea{resize:vertical}label{display:block;font-size:14px}label input,label textarea,label select{margin:7px 0 18px}h1,h2,p{margin-top:0}h1{font-size:16px;font-weight:600;line-height:1.35}h2{font-size:23px;font-weight:550}.muted,.hint,small{color:var(--muted)}small{font-size:12px}.brand{font-size:17px;font-weight:800;letter-spacing:1px}.brand span{display:block;font-size:11px;font-weight:500;letter-spacing:.3px;color:var(--muted);margin-top:4px}.shell{display:grid;grid-template-columns:280px minmax(0,1fr);height:100dvh;min-height:0}.shell[hidden],[hidden]{display:none!important}aside{position:relative;z-index:5;padding:22px 16px 14px;background:var(--side);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side-brand{display:flex;align-items:center;gap:11px;padding:0 7px;margin-bottom:25px}.brand-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;color:#bfe3c8;background:#263c2c;font-size:12px;font-weight:800}.side-brand .brand{font-size:15px}.new-session{width:100%;text-align:left;display:flex;gap:10px;align-items:center;padding:11px 13px;font-size:13px;font-weight:600}.new-session span{font-size:18px}.side-heading{padding:24px 8px 8px;color:#78857b;font-size:9px;letter-spacing:1.5px;font-weight:700}.list-tabs{display:flex;margin:0 0 9px;gap:6px}.list-tabs button{flex:1;border:0;background:transparent;color:var(--muted);font-size:12px;padding:8px}.list-tabs button[aria-pressed=true]{background:#29332b;color:#c5e1cc;font-weight:600}nav{overflow:auto;flex:1;min-height:40px}.session{display:block;width:100%;border:1px solid transparent;background:transparent;text-align:left;margin-bottom:4px;padding:11px 10px}.session.selected{background:#222a24;border-color:#374239}.session strong{display:block;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.session small{display:block;margin-top:6px;font-size:10px}footer{border-top:1px solid var(--line);padding:12px 5px 0;font-size:12px}.account{display:flex;align-items:center;gap:8px;margin-top:13px;min-width:0}.account>span:nth-child(2){flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account button{padding:5px 8px}.user-avatar{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;color:#cde5d2;background:#2a3a2d;font-size:11px}footer a{display:block;padding:5px;color:#b8c7bb}a{color:var(--green);text-decoration:none}.tool-item{border-top:1px solid #29312b}.tool-item>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:9px;padding:11px 8px;color:#d1dad3;font-size:12px}.tool-item>summary::-webkit-details-marker{display:none}.tool-item>summary::after{content:'⌄';margin-left:auto;color:#859187}.tool-item[open]>summary::after{content:'⌃'}.tool-icon{width:20px;color:var(--green);text-align:center;font-size:15px}.chat-equipment-body,.quick-action-body{padding:0 7px 12px}.chat-equipment-row{display:flex;gap:6px}.chat-equipment-row input{min-width:0;flex:1;padding:9px;font-size:11px}.chat-equipment-row button{white-space:nowrap;padding:8px;font-size:11px}.camera-row{margin-top:6px}.camera-row button{width:100%;color:#cce3d1}.chat-equipment video{display:block;width:100%;max-height:160px;object-fit:cover;border-radius:8px;margin-top:8px}.chat-equipment-body #chatQrStatus{font-size:11px;line-height:1.45}.chat-equipment-card{margin-top:10px;padding:10px;border:1px solid var(--line);border-radius:9px;background:#202722;font-size:11px;line-height:1.55;overflow-wrap:anywhere}.chat-equipment-card>strong{font-size:13px}.chat-equipment-card button{width:100%;margin-top:7px;font-size:11px}.chat-open-incidents{margin-top:9px;border-top:1px solid var(--line);padding-top:8px}.quick-action-buttons{display:grid;grid-template-columns:1fr 1fr;gap:6px}.quick-action-buttons button{padding:8px 5px;font-size:10px}.quick-recent{max-height:110px;overflow:auto}.quick-recent>small{font-size:10px}.quick-recent-item{padding:7px 0;border-bottom:1px solid var(--line)}.quick-recent-item strong,.quick-recent-item small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quick-recent-item strong{font-size:10px}.quick-recent-item small{margin-top:3px;font-size:9px}main{min-width:0;min-height:0;display:flex;flex-direction:column;height:100dvh;background:var(--bg)}.chat-header{height:62px;flex:none;padding:0 24px;border-bottom:1px solid #252d27;display:flex;align-items:center;gap:13px}.header-title{min-width:0;display:flex;align-items:center;gap:10px;flex:1}.header-title h1{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.online-dot{width:7px;height:7px;border-radius:50%;background:#72b986}.header-actions{display:flex;gap:7px;align-items:center}.header-actions button{font-size:11px;padding:7px 10px}.icon-button{width:36px;height:36px;padding:0;display:grid;place-items:center;font-size:20px}.menu-button,.close-sidebar{display:none}#notice{flex:none;font-size:12px;color:#e1a08d;padding:0 28px}#notice:not(:empty){padding-top:10px}#conversation{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:24px max(24px,calc((100% - 790px)/2));scroll-behavior:smooth}.empty-prompt{height:100%;min-height:120px;display:grid;place-items:center;color:#d2dbd4;font-size:25px;font-weight:550;letter-spacing:-.4px}.message{margin-bottom:22px;max-width:100%;line-height:1.7;font-size:14px;overflow-wrap:anywhere}.message.user{width:fit-content;max-width:80%;margin-left:auto;padding:12px 16px;border-radius:15px 15px 3px 15px;background:#29392d;border:1px solid #3c5440}.message.assistant{padding:0 4px}.message-label{font-size:9px;letter-spacing:.8px;font-weight:650;color:#91c69c;margin-bottom:6px}.message p{white-space:pre-wrap;margin:0 0 10px}.message img{display:block;max-width:100%;max-height:260px;border-radius:9px;border:1px solid var(--line);object-fit:contain;margin:8px 0}.source{padding:11px 13px;background:#1c261f;border-left:3px solid #608c68;margin:10px 0;border-radius:4px;font-size:12px}.source summary{cursor:pointer;font-weight:600}.source p{margin:8px 0 0}.feedback{display:flex;gap:7px}.feedback button{font-size:10px;padding:6px 9px}.feedback button[aria-pressed=true]{color:#b9dcbe;border-color:#52735a;background:#25342a}.metrics{flex:none;margin:0 auto 10px;width:min(790px,calc(100% - 48px));padding:10px 14px;border-radius:8px;background:#1d2720;color:#b9d4bd;font-size:11px;line-height:1.7}.compose-wrap{flex:none;width:min(850px,100%);padding:10px 25px max(15px,env(safe-area-inset-bottom));margin:0 auto}.compose-wrap form{padding:10px 12px 8px;border:1px solid #3a463d;border-radius:16px;background:#1a201b;box-shadow:0 10px 35px #0003}#message{display:block;border:0;outline:0;box-shadow:none;background:transparent;padding:5px 4px;min-height:42px;max-height:180px;resize:none;font-size:14px;line-height:1.55}#message::placeholder{color:#808b82}.compose-actions{display:flex;gap:9px;align-items:center}.attach{color:#a8c8ae;font-size:20px}.compose-actions #sendState{flex:1;color:var(--muted);font-size:11px}.send-button{width:34px;height:34px;border-radius:50%;padding:0;border:0;background:var(--green-strong);color:white;font-size:19px;font-weight:600}.send-button:hover{background:#57976a}#files{font-size:11px;color:#bad8bf}#files button{border:0;padding:3px 6px}.login{min-height:100dvh;display:grid;place-items:center;background:var(--bg);padding:24px}.login-card{width:min(400px,100%);background:var(--side);border:1px solid var(--line);padding:32px;border-radius:16px}.login .brand{margin-bottom:35px}.login h1{font-size:22px}.login p{font-size:13px;color:var(--red)}.login .primary{width:100%;margin-bottom:12px}.drawer-backdrop{display:none}.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}dialog{color:var(--text);background:var(--side);border:1px solid var(--line);border-radius:16px;padding:24px;width:min(460px,92vw);max-height:92dvh;overflow:auto}dialog::backdrop{background:#050805b8}.dialog-actions{display:flex;justify-content:flex-end;gap:10px}.quick-dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.quick-dialog-heading h2{margin:6px 0 12px;font-size:20px}.quick-dialog-heading>button{font-size:22px;padding:2px 9px}.quick-dialog-footnote{padding:10px 12px;margin:4px 0 18px;border-radius:8px;background:#202a22;color:var(--muted);font-size:11px;line-height:1.5}#quickActionHelp{font-size:12px;line-height:1.55;margin-bottom:16px}#quickActionForm>label{margin:0 0 12px}#quickActionForm textarea{margin-bottom:0}#quickActionDialog .dialog-actions{position:sticky;bottom:-24px;background:var(--side);padding:12px 0 0}.eyebrow{font-size:9px;letter-spacing:1.5px;color:var(--muted);font-weight:600}

/* ADMIN-UI-CLEAN-01: one navigation rail and one modal surface. */
.shell{grid-template-columns:208px minmax(0,1fr)}
#sidebar{padding:24px 12px 16px;background:#131e18;border-color:#27382c;z-index:2}
.side-brand{padding:0 4px;margin-bottom:30px;gap:9px}.side-brand .brand{font-size:13px;letter-spacing:.8px}.brand-mark{flex:none;background:#254b33;color:#b0e6bf}
.nav-toggle{font-size:12px;text-align:left;background:transparent;border:0;color:var(--muted);margin-bottom:18px;display:flex;gap:14px;align-items:center}
.primary-nav{display:flex;flex-direction:column;gap:7px;overflow:visible;flex:none;min-height:0}
.primary-nav button,#manageLink{display:flex;align-items:center;gap:13px;text-align:left;border:1px solid transparent;background:transparent;padding:12px 10px;font-size:13px;white-space:nowrap}
.primary-nav button:hover{background:#202f24}.primary-nav button[aria-pressed=true]{background:#253c2c;border-color:#36533d;color:#b5e7c2}.nav-icon{font-size:20px;width:23px;text-align:center;flex:none}
#sidebar footer{margin-top:auto;border:0;padding:12px 0 0}.account{padding:8px 4px}#logout{margin-left:auto}
.nav-collapsed{grid-template-columns:72px minmax(0,1fr)}.nav-collapsed .nav-label{display:none}.nav-collapsed #sidebar{padding-left:10px;padding-right:10px}.nav-collapsed .side-brand{padding:0 8px}.nav-collapsed .account{flex-wrap:wrap;justify-content:center}.nav-collapsed #logout{margin:auto}.nav-collapsed .nav-toggle{justify-content:center}
.chat-header{height:76px;padding:0 30px;gap:24px}.assistant-badge{font-size:14px;color:#a0d8b0;white-space:nowrap}.header-title h1{color:var(--muted);font-weight:400}.online-dot{display:none}.header-actions{gap:8px}#newSession{width:auto;font-size:12px;background:transparent}.header-actions details{position:relative;font-size:12px}.header-actions summary{cursor:pointer;padding:8px}.history-popover{position:absolute;right:0;top:40px;width:290px;max-height:65dvh;overflow:auto;padding:12px;background:var(--side);border:1px solid var(--line);border-radius:12px;z-index:3;box-shadow:0 15px 40px #0008}
.empty-prompt{display:flex;flex-direction:column;justify-content:center;gap:18px;font-size:30px;letter-spacing:-.8px}.empty-prompt:before{content:'✧';display:grid;place-items:center;width:68px;height:68px;border-radius:22px;background:#203b2a;color:#a6dcb5;font-size:40px}.empty-prompt:after{content:'Опишите вопрос — разберёмся вместе';font-size:14px;letter-spacing:0;color:var(--muted)}
#reminders{padding:12px 30px;display:flex;gap:8px}#reminders button{font-size:12px;background:#203126;border-color:#36513e}.compose-wrap{padding-bottom:28px}#conversation{padding-top:35px}
#sectionDialog{padding:0;width:min(520px,calc(100vw - 40px));max-height:86dvh;overflow:hidden;background:#18251c;border-color:#3c5442;box-shadow:0 24px 100px #0009}#sectionDialog.wide{width:min(900px,calc(100vw - 64px))}#sectionDialog[open]{display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:25px 28px 20px;border-bottom:1px solid var(--line);flex:none}.modal-header h2{margin:7px 0 0;font-size:24px}.modal-header p{margin:0}.modal-header button{font-size:24px;padding:2px 10px;background:transparent}.modal-content{overflow:auto;padding:24px 28px;min-height:0;overscroll-behavior:contain}.modal-content h3{font-size:15px;font-weight:600}.modal-content p{font-size:13px;line-height:1.65}.modal-content section+section{margin-top:0}.modal-content #quickActions{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.quick-action-buttons button{font-size:12px;padding:12px}.quick-recent{max-height:180px;margin-top:14px}.quick-recent-item strong{font-size:12px}.quick-recent-item small{font-size:11px;white-space:normal}.chat-equipment-row input{font-size:13px}.chat-equipment-row button{font-size:12px}.chat-equipment-body,.quick-action-body{padding:0}.unavailable{text-align:center;padding:35px 10px}.unavailable>span{display:block;color:var(--green);font-size:36px;margin-bottom:20px}.unavailable p{color:var(--muted);max-width:420px;margin:0 auto}.record{padding:16px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.record small{display:block;margin:5px 0}.record p{white-space:pre-wrap;margin:8px 0}.inbox-row{display:block;width:100%;text-align:left;margin-bottom:10px}.inbox-row small{display:block;margin-top:6px}.inbox-row p{margin:8px 0 0;color:var(--muted)}.thread-controls{display:flex;gap:16px}.thread-controls label{flex:1}#inboxMessages{margin-bottom:18px}#inboxReply button{margin-top:12px}.channel-links{margin-top:28px;border-top:1px solid var(--line);padding-top:20px}.channel-links a{display:inline-block;padding:10px 16px 10px 0;font-size:13px}.modal-content video{width:100%;max-height:220px}.modal-content #quickActionForm .dialog-actions{position:static}.modal-content #quickActionForm{padding:0}#sectionNotice,#inboxNotice{color:#edb598;font-size:13px}
.mobile-nav-label{display:none}
@media(max-width:700px){.shell,.shell.nav-collapsed{grid-template-columns:76px minmax(0,1fr)}#sidebar,.nav-collapsed #sidebar{padding:17px 6px 10px}.nav-label{display:none}.side-brand,.nav-collapsed .side-brand{padding:0 7px;margin-bottom:30px}.brand-mark{width:32px;height:32px}.nav-toggle{display:none}.primary-nav{gap:9px}.primary-nav button,#manageLink{flex-direction:column;justify-content:center;gap:3px;min-height:44px;padding:6px 2px}.mobile-nav-label{display:block;font-size:10px;line-height:1.2;white-space:nowrap}.account{flex-wrap:wrap;justify-content:center}#logout{margin:8px auto 0}.chat-header{height:66px;padding:0 10px;gap:6px;flex-wrap:wrap}.assistant-badge{font-size:12px;flex:1}.header-title{display:none}.header-actions{gap:0}.desktop-label{display:none}.header-actions button{padding:6px;font-size:10px}.header-actions summary{font-size:10px;padding:6px}.header-actions #newSession{font-size:18px}.history-popover{width:min(280px,calc(100vw - 80px))}.empty-prompt{font-size:22px;text-align:center;letter-spacing:-.4px}.empty-prompt:after{font-size:12px;max-width:210px;line-height:1.6}.empty-prompt:before{width:56px;height:56px;font-size:32px}#conversation{padding:20px 12px}.compose-wrap{padding:8px 9px 16px}.compose-wrap form{padding:8px}#message{font-size:14px}.message{font-size:13px}.message.user{max-width:95%}#reminders{padding:9px}#reminders button{font-size:11px}#sectionDialog,#sectionDialog.wide{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;border-radius:0}.modal-header{padding:20px}.modal-content{padding:20px;flex:1}.thread-controls{gap:10px}.modal-header h2{font-size:23px}.modal-content .quick-action-buttons{grid-template-columns:1fr 1fr}dialog:not(#sectionDialog){max-height:100dvh;width:100vw;height:100dvh;max-width:none;margin:0;border-radius:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}

/* STAFF-TASKS-UI-02: checklist inside the accepted single dialog. */
.order-toolbar,.order-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.order-toolbar h3{margin:8px 0}.order-toolbar .eyebrow{margin:0}.order-schedule{color:var(--muted)}#orderNotice{color:#edb598;overflow-wrap:anywhere}#orderNotice:empty{display:none}.order-slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0 24px}.order-slots button{text-align:left;padding:12px}.order-slots button[aria-pressed=true]{border-color:#8fcb9b;background:#294932}.order-slots small{display:block;margin-top:6px;color:var(--muted);font-size:11px}.order-card{border-top:1px solid var(--line);padding-top:14px}.order-heading h3{margin:0}.order-state{font-size:12px;color:#b5e7c2}.order-warning,.order-conflict{background:#3c3221;color:#f1d3a0;padding:12px;border-radius:8px}.order-conflict button{margin:4px 0}.order-items{display:grid;gap:12px;margin:20px 0 26px}.order-items fieldset{min-width:0;border:1px solid #3b5141;border-radius:10px;padding:12px 14px 14px;margin:0}.order-items legend{font-size:14px;padding:0 6px}.order-items fieldset>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.order-items label{display:flex;align-items:center;gap:7px;margin:0;font-size:12px;padding:10px 8px;background:#1d3023;border:1px solid #38533e;border-radius:7px;cursor:pointer}.order-items label:has(:checked){background:#315d3e;border-color:#9ad6a7;color:#e9f7ed}.order-items input{width:16px;height:16px;margin:0;flex:none;accent-color:#9ad6a7}.order-items fieldset:disabled{opacity:.7}.order-photos{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:20px}.order-photos>div{min-width:0;border:1px solid var(--line);padding:14px;border-radius:10px}.order-photos strong,.order-photos small{display:block;font-size:12px}.order-photos label{font-size:12px;margin:12px 0 0}.order-photos input{max-width:100%;font-size:11px;padding:8px}.order-photos img{width:100%;height:150px;object-fit:contain;border-radius:6px;margin:12px 0}.order-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:20px}.order-actions button{min-height:44px}
@media(max-width:700px){.order-slots{grid-template-columns:repeat(2,minmax(0,1fr))}.order-items fieldset{padding:10px 8px}.order-items fieldset>div{gap:5px}.order-items label{font-size:11px;padding:11px 4px;gap:4px;min-height:44px}.order-items input{width:14px;height:14px}.order-photos{grid-template-columns:1fr}.order-heading{align-items:flex-start}.order-actions{display:grid;grid-template-columns:1fr}.order-toolbar button{font-size:12px}.order-state{max-width:140px;text-align:right}}

.order-calendar{margin:14px 0 20px}.order-calendar summary{cursor:pointer;font-size:13px;color:#b5e7c2;padding:10px 0}.order-calendar>label{margin-top:14px}.order-next{color:#b5e7c2}@media(min-width:1000px){.order-items{grid-template-columns:repeat(2,minmax(0,1fr))}.order-items fieldset{padding-left:8px;padding-right:8px}.order-items label{padding-left:5px;padding-right:5px;font-size:11px}}

/* Staff inbox and quick chat share the same conversation and draft. */
#sectionDialog.inbox-open{width:min(1040px,calc(100vw - 48px));height:min(720px,88dvh);max-height:88dvh}
#sectionDialog.inbox-open>.modal-content{display:flex;flex:1;min-height:0;flex-direction:column;padding:0;overflow:hidden}
#sectionDialog.inbox-open>.modal-header{padding:13px 20px;align-items:center}
#sectionDialog.inbox-open>.modal-header .eyebrow{display:none}
#sectionDialog.inbox-open>.modal-header h2{margin:0;font-size:20px}
.inbox-layout{display:grid;flex:1;min-height:0;grid-template-columns:minmax(210px,30%) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;background:var(--bg)}
.inbox-list-pane{display:flex;min-height:0;min-width:0;flex-direction:column;border-right:1px solid var(--line);background:var(--side)}
#inboxSearch{margin:12px;width:calc(100% - 24px);flex:none}
#inboxRows{overflow:auto;min-height:0}
.inbox-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;padding:11px;margin:0;border:0;border-radius:0;background:transparent}
.inbox-row[aria-pressed=true]{background:var(--panel2)}
.inbox-row-text{min-width:0}
.inbox-row-text strong,.inbox-row-text small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inbox-row-text small,.inbox-row time{font-size:12px;color:var(--muted);margin:2px 0 0}
.inbox-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--panel2);color:var(--green);font-weight:600}
.inbox-empty{padding:12px;color:var(--muted)}
.inbox-thread{min-width:0;min-height:0;display:flex;flex-direction:column}
.inbox-thread-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;flex:none;background:var(--side);border-bottom:1px solid var(--line)}
.inbox-thread-head h3{margin:0;overflow-wrap:anywhere}
.inbox-thread-head>div{min-width:0}
.inbox-thread-head button{padding:6px 9px}
#inboxAssignment{flex:none;font-size:12px;color:var(--muted);max-width:130px}
#inboxAssignment select{margin:4px 0 0}
#backInbox{display:none}
.inbox-history{display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;gap:9px;overflow:auto;overscroll-behavior:contain;padding:13px}
#inboxMessages{margin:0}
.inbox-bubble{align-self:flex-start;max-width:87%;padding:7px 9px;border-radius:12px 12px 12px 4px;background:var(--panel);overflow-wrap:anywhere}
.inbox-bubble.outgoing{align-self:flex-end;border-radius:12px 12px 4px 12px;background:#2a3d30}
.inbox-bubble>p{margin:0;white-space:pre-wrap}
.inbox-bubble>small{display:block;text-align:right;margin-top:3px}
.inbox-bubble.inbox-call p{margin:5px 0}
.inbox-bubble button{font-size:12px;margin-top:4px}
.inbox-composer{display:flex;align-items:flex-end;gap:8px;background:var(--side);border-top:1px solid var(--line);padding:9px;flex:none}
.inbox-composer textarea{min-width:0;min-height:42px;max-height:120px;resize:vertical}
#inboxReply button{margin:0}
#inboxNotice{grid-column:1/-1;margin:0}
#inboxNotice:not(:empty),#inboxQuickNotice:not(:empty){padding:5px 10px;margin:0;color:#edb598}
.inbox-dock{--inbox-dock-bottom:max(14px,env(safe-area-inset-bottom));position:fixed;right:max(14px,env(safe-area-inset-right));bottom:var(--inbox-dock-bottom);z-index:25;display:flex;align-items:flex-end;flex-direction:column;gap:8px;width:min(500px,calc(100vw - 28px));max-height:calc(100dvh - var(--inbox-dock-bottom) - 12px);pointer-events:none}
.inbox-dock>*{pointer-events:auto}
body:has(#workspace:not([hidden])):has(#composer:not([hidden])):not(:has(#sectionDialog[open])) .inbox-dock{--inbox-dock-bottom:calc(96px + env(safe-area-inset-bottom))}
.inbox-popover{width:100%;background:var(--side);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 32px #0006;overflow:hidden}
.inbox-toasts{display:grid;gap:6px;width:min(335px,100%)}
.inbox-dock:has(#inboxQuickList:not([hidden])) .inbox-toasts{display:none}
.inbox-toast{display:grid;gap:1px;padding:9px 12px;text-align:left}
.inbox-toast span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#inboxLauncher{flex:none;display:flex;align-items:center;gap:10px;border-radius:12px;padding:11px 14px;background:#21392e;border-color:#3b624d;color:#e7f3ec;font-size:14px;font-weight:700}
#inboxLauncher:hover{background:#294637}
#inboxBadge{display:grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:99px;background:#b5e8cc;color:#173629;font-size:12px}
#inboxQuickThread{width:min(335px,100%)}
#inboxQuickMessages{max-height:min(260px,39dvh)}
#inboxQuickNotice{margin:0;font-size:12px}
#inboxQuickList{display:flex;flex-direction:column;min-height:0;max-height:570px;background:#17251e;border-color:#355244;border-radius:19px;color:#e6eee9}
.inbox-widget-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 20px 14px}
.inbox-widget-head h2{font-size:22px;line-height:1.2;margin:0}
.inbox-counts{margin:6px 0 0;color:#afc3b6;font-size:13px}
#inboxHideList{min-width:38px;height:38px;padding:0;border:0;border-radius:12px;background:#23372c;font-size:20px}
.inbox-widget-head,.inbox-widget-channels,.inbox-widget-groups,.inbox-widget-footer{flex:none}
.inbox-widget-channels,.inbox-widget-groups{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:0 18px}
.inbox-widget-channels button,.inbox-widget-groups button,.inbox-widget-footer button{border:0;background:transparent;color:#b5c7bc;white-space:nowrap;font-size:13px}
.inbox-widget-channels button{padding:10px 8px;border-radius:9px}
.inbox-widget-channels button[aria-pressed=true]{background:#2e493a;color:#d9f6e5;font-weight:700}
.inbox-widget-groups{gap:16px;padding-top:10px;border-bottom:1px solid #30483b}
.inbox-widget-groups button{padding:14px 0 11px;border-bottom:2px solid transparent;border-radius:0}
.inbox-widget-groups button[aria-pressed=true]{border-color:#b1e8ca;color:#e5f7ed;font-weight:700}
.inbox-widget-groups span{margin-left:4px;font-size:12px}
#inboxQuickRows{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.inbox-widget-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:85px;padding:12px 20px;border:0;border-radius:0;background:transparent;text-align:left}
.inbox-widget-row:hover{background:#22352b}
.inbox-widget-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:#304637;color:#d1e8d8;font-size:12px;font-weight:750}
.inbox-widget-icon.vk{background:#243f54;color:#bfddff}
.inbox-widget-icon.telegram{background:#204452;color:#b4e8f2}
.inbox-widget-icon.mango{background:#51402b;color:#ffdea0}
.inbox-widget-icon.langame{background:#3c472a;color:#e2edb2}
.inbox-widget-copy{display:grid;gap:3px;min-width:0}
.inbox-widget-copy>*{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inbox-widget-copy strong{font-size:14px}
.inbox-widget-copy span,.inbox-widget-copy small{color:#afc3b6;font-size:12px}
.inbox-widget-meta{align-self:start;display:grid;justify-items:end;gap:8px;padding-top:3px;color:#b5c7bc;font-size:11px}
.inbox-widget-meta i{width:7px;height:7px;border-radius:50%;background:#b1e8ca}
.inbox-widget-footer{display:flex;justify-content:flex-end;padding:7px 12px;border-top:1px solid #30483b}
.inbox-widget-footer button{color:#c4ead4;font-weight:650}
@media(max-width:700px){
 #sectionDialog.inbox-open{width:100vw;height:100dvh;max-height:none}
 .inbox-layout{grid-template-columns:minmax(0,1fr)}
 .inbox-list-pane{border-right:0}
 #sectionDialog.inbox-detail-open .inbox-list-pane{display:none}
 #backInbox{display:block}
 .inbox-dock{--inbox-dock-bottom:max(10px,env(safe-area-inset-bottom))}
 .inbox-widget-head,.inbox-widget-row{padding-inline:14px}
 .inbox-widget-channels,.inbox-widget-groups{padding-inline:12px}
 .inbox-widget-channels button{padding-inline:6px}
 .inbox-widget-groups{gap:10px}
 .inbox-widget-groups button{font-size:12px}
}

/* Staff equipment search and selected device. */
.device-search{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:.5rem}
.device-search input{min-width:0;margin:0}
.device-layout{display:grid;grid-template-columns:minmax(140px,1fr) minmax(0,2fr);gap:1rem;align-items:start}
.device-layout:has(#chatQrResult:empty){grid-template-columns:1fr}
.device-layout:has(#deviceMatches:empty){grid-template-columns:1fr}
#deviceMatches>p{font-size:.8rem;margin:0 0 .5rem}
.device-match{display:block;width:100%;text-align:left;margin-bottom:.35rem;overflow-wrap:anywhere}
.device-match small{display:block;margin-top:.2rem}
.device-match[aria-pressed=true]{background:#2a4735;border-color:#629174}
#chatQrResult .chat-equipment-card{font-size:.9rem;padding:1rem;margin:0}
#chatQrResult .chat-equipment-card h3{font-size:1.3rem;margin:.1rem 0}
#chatQrResult .chat-equipment-card header p{margin:.2rem 0 .65rem}
.device-incident{background:#352d20;border:1px solid #685336;border-radius:.5rem;padding:.6rem;margin-bottom:.7rem}
.device-incident small,.device-incident strong{display:block}
.device-incident small{color:#f2ce95}
.device-incident strong{font-size:.9rem}
.device-actions{display:flex;flex-wrap:wrap;gap:.4rem;align-items:start}
.device-more summary,#quickActions>summary,.chat-equipment-card>details summary{cursor:pointer;color:#b5dbc3;padding:.45rem}
.device-more button{display:block}
.chat-equipment-card>details{border-top:1px solid var(--line);margin-top:.5rem}
#quickActions{margin-top:1rem}
#deviceBack{display:none}
@media(max-width:700px){
 .device-search{grid-template-columns:minmax(0,1fr) auto}
 #chatQrCamera{grid-column:1/-1}
 .device-layout{display:block}
 .device-selected #deviceMatches{display:none}
 #chatEquipment:not(.device-selected) #chatQrResult{display:none}
 #deviceBack{display:block;margin:0 0 .55rem}
}

.chat-receipt { margin-inline-start: .45em; font-weight: 700; white-space: nowrap; }
.chat-receipt-read { color: #76c8ff; }
.chat-receipt-failed { color: #ff9b8e; }
.chat-receipt-unknown { color: #f1c479; }

.inbox-media-body{display:grid;gap:.75rem;overflow-wrap:anywhere}
.inbox-media-body p{white-space:pre-wrap;margin:0}
.inbox-media-body img,.inbox-media-body video,.inbox-media-body audio{max-width:100%;max-height:60vh;border-radius:8px}
.inbox-media-body blockquote{margin:.3rem 0;padding-inline-start:.75rem;border-inline-start:2px solid #70a68b}
.inbox-media-body a{color:#aee2c8}

.inbox-media:has(.inbox-media-body) > .inbox-media-fallback{display:none}
.inbox-media{min-width:0;min-height:1px}
.inbox-media-fallback{margin:0;white-space:pre-wrap}
.inbox-media-body img,.inbox-media-body video{width:auto;min-width:0;max-height:320px;object-fit:contain;justify-self:start}
.inbox-media-body audio{width:clamp(160px,50vw,300px)}
.agent-instruction p{white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0}.agent-instruction summary{cursor:pointer;color:var(--green)}
#instructionMode{white-space:nowrap;font-size:.8rem}
@media(max-width:700px){#instructionMode{padding:.35rem .45rem;font-size:.72rem}}
#devicePassport{overflow-wrap:anywhere}#passportForm{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.5rem}#passportForm label{display:grid;gap:.2rem}#passportForm input{min-width:0;width:100%}#passportForm button{justify-self:start}

/* Equipment workflow */
#chatEquipment,#chatQrResult,.device-layout,.chat-equipment-card{min-width:0;max-width:100%}
#chatEquipment.device-direct #deviceMatches{display:none}
#chatEquipment.device-direct #deviceBack{display:none}
.device-group{margin-bottom:1rem}
.device-group h3{font-size:.9rem;margin:.5rem 0}
.device-actions>.primary{min-height:44px}
.device-more summary{min-height:44px;display:flex;align-items:center}
.device-more button{min-height:44px;margin:.25rem 0}
.quick-replace-preview{border:1px solid #608c68;border-radius:9px;padding:12px;margin:12px 0;background:#1f3025;overflow-wrap:anywhere}
.quick-replace-preview p{margin:8px 0}
.quick-replace-preview label{display:flex;align-items:center;gap:8px;min-height:44px}
.quick-replace-preview input{width:auto;margin:0}
@media(max-width:700px){.modal-content{min-width:0;padding:16px}.device-search{grid-template-columns:minmax(0,1fr) minmax(72px,auto)}.device-search input,.device-search button{min-height:44px}.device-search button:last-child{grid-column:1/-1}.chat-equipment-card{width:100%}.device-actions,.device-actions>.primary,.device-more{width:100%}.device-match{min-height:48px}}
#mangoPhoneToggle{margin-right:.5rem;border-radius:12px;padding:.65rem .85rem}
#mangoPhoneToggle[data-ringing="true"]{color:#111512;background:#b3efca}
.mango-phone-body{padding:0 1rem 1rem}
#mangoPhoneLogin:not([hidden]){display:grid;gap:.65rem}
#mangoPhoneLogin label{display:grid;gap:.25rem}
#mangoPhoneLogin input{width:100%;min-width:0}
#mangoPhoneActions:not([hidden]){display:flex;flex-wrap:wrap;gap:.5rem}
#mangoPhoneAnswer{background:#b3efca;color:#111512}

/* Quick inbox on the dashboard */
#inboxQuickList .inbox-widget-channels {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-block: 4px;
  scrollbar-width: thin;
}
#inboxQuickList .inbox-widget-channels button { flex: none; }
#inboxQuickList .inbox-widget-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding-block-start: 2px;
}
#inboxQuickList .inbox-widget-groups button { padding-inline: 0; }
#inboxQuickList .inbox-widget-row {
  min-height: 68px;
  padding-block: 9px;
  border-bottom: 1px solid #ffffff0d;
}
.inbox-quick-panels {
  --panel-height: min(440px, 55dvh);
  position: relative;
  width: min(400px, 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.inbox-quick-panels:has(#inboxQuickList[hidden]):has(#inboxQuickThread[hidden]) { display: none; }
#inboxQuickList, #inboxQuickThread {
  height: var(--panel-height);
  max-height: 100%;
}
#inboxQuickThread {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  border-radius: 18px;
}
#inboxQuickThread .inbox-thread-head { flex: none; gap: 10px; }
#inboxQuickThread .inbox-thread-head > div { flex: 1; min-width: 0; }
#inboxQuickMessages { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
#inboxQuickReply { flex: none; }
@media (min-width: 1040px) {
  #inboxQuickThread {
    position: absolute;
    right: calc(100% + 10px);
    top: 0;
    height: 100%;
    width: 100%;
  }
}
@media (max-width: 1039px) {
  .inbox-dock:has(#inboxQuickThread:not([hidden])) #inboxQuickList { display: none; }
}

#inboxQuickThread .inbox-thread-head {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#inboxQuickThread .inbox-thread-head:active { cursor: grabbing; }
