/* Quiet, practical surfaces. Keep every portal's existing layout, safe-area
   sizing and responsive behavior; this file only changes presentation. */
:where(body.enterprise-admin,body.enterprise-agent,body.ui-visitor,body.enterprise-login) {
 --ec-ink:#18232d;--ec-muted:#647184;--ec-accent:#2584c3;--ec-accent-hover:#1a6fa8;
 --ec-line:#e2e7ec;--ec-canvas:#f3f5f7;--ec-tint:#edf5fc;--ec-navy:#243849;
 --ev-ink:#18232d;--ev-muted:#647184;--ev-accent:#2584c3;--ev-accent-hover:#1a6fa8;
 --ev-line:#e2e7ec;--ev-canvas:#f3f5f7;--ev-tint:#edf5fc;
}
body.ui-admin,body.ui-visitor,body.enterprise-agent,body.enterprise-login { background:#f2f4f6; }
body.ui-admin > .main,body.ui-admin > .main:has(> #view-chats.active) {background:#fff;border-color:#dfe5ea;box-shadow:none;border-radius:9px;backdrop-filter:none;}
body.ui-admin .panel :is(.card,.stat) {background:#fff;border-color:#e1e6eb;box-shadow:none;backdrop-filter:none;border-radius:8px;}
body.ui-admin .btn,body.ui-admin .sbtn,body.ui-visitor .send {background:#2785c0;color:#fff;border-color:transparent;box-shadow:none;border-radius:6px;}
body.ui-admin .btn:not(.ghost):not(.danger):hover,body.ui-admin .sbtn:hover,body.ui-visitor .send:hover {background:#1f74aa;}
body.ui-admin .btn.ghost {background:#fff;color:#435365;border:1px solid #dbe2e9;box-shadow:none;border-radius:6px;}
body.ui-admin .btn.danger {background:#fff4f4;color:#b3393e;border:1px solid #f0d9da;box-shadow:none;border-radius:6px;}
body.ui-admin :is(.ibtn,.hbtn) {background:#fff;color:#526375;box-shadow:none;}
body.ui-admin .full-dock,body.ui-admin > .main > .glass-dock.full-dock,body.enterprise-agent .dock {background:#fff;box-shadow:none!important;border-color:#e0e5e9;border-radius:10px;backdrop-filter:none;}
body.ui-admin .dock-liquid,body.enterprise-agent .liquid-pill {background:#e3f0fa;border:0;box-shadow:none;}
body.ui-admin #view-chats {--chat-accent:#2584c3;--chat-accent-bg:#e9f3fb;--chat-copy:#18232d;--chat-muted:#647184;--chat-line:#e2e7ec;--chat-soft:#f1f4f7;}
body.enterprise-admin #view-chats #msgs {background:#f5f7f9;}
body.enterprise-admin #view-chats #msgs .msg.in {background:#fff;border:1px solid #e0e5ea;box-shadow:none;}
body.enterprise-admin #view-chats #msgs .msg.out {background:#e8f3fb;border:1px solid #d9e9f6;box-shadow:none;}
body.enterprise-admin #view-chats #items .item {background:#fff;box-shadow:none;border-color:transparent;border-radius:7px;}
body.enterprise-admin #view-chats #items .item.active {background:#e7f2fa;border-color:transparent;box-shadow:inset 2px 0 #2683be;}
body.enterprise-admin #view-chats #items .item:hover:not(.active) {background:#f1f5f8;}
body.enterprise-agent .app-header {background:#263c4d;border-color:#263c4d;box-shadow:none;}
body.enterprise-agent .app-header .brand-mark {background:transparent;border:0;}
body.enterprise-agent #workspace .messages {background:#f4f6f8;}
body.enterprise-agent #workspace .message.out:not(.is-recalled) .bubble {background:#e8f3fb;border-color:#dbeaf4;}
body.enterprise-agent :is(.stat-card,.settings-section,.quick-card,.workspace-shell) {box-shadow:none;}
body.ui-visitor .wrap {background:#fff;box-shadow:none;border-color:#e1e6eb;}
body.ui-visitor .mail-gate {background:#f2f4f6;}
body.ui-visitor .mail-card {border-color:#e1e6eb;border-radius:10px;box-shadow:none;--ev-card-radius:10px;}
body.ui-visitor .ev-intro {background:#263c4d;border-radius:9px 9px 0 0;}
body.ui-visitor .ev-brand-mark {background:transparent;border:0;}
body.ui-visitor .row.user .bubble,body.ui-visitor .row.out .bubble {background:#e8f3fb;border-color:#dbeaf4;box-shadow:none;}
body.ui-visitor .row .bubble {box-shadow:none;}
body.enterprise-login .console-signin {box-shadow:none;border-color:#e0e5e9;border-radius:12px;}
body.enterprise-login .console-signin-brand {background:#263c4d;border-radius:11px 0 0 11px;}
@media(max-width:600px){ body.enterprise-login .console-signin-brand {border-radius:11px 11px 0 0;} }
/* Keep the more affordance separate from the row's own button. */
#items .kf-context-list-row,.conversation-list .kf-context-list-row {position:relative;min-width:0;}
#view-chats #items .kf-context-list-row .item {width:100%; padding-right:32px;}
.kf-list-more {position:absolute;right:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:29px;height:35px;border:0;border-radius:5px;background:transparent;font:600 17px/1 system-ui,sans-serif;color:#738195;cursor:pointer;touch-action:manipulation;}
.kf-list-more:hover,.kf-list-more:focus-visible {background:#dceaf5;color:#236da0;}
@media(pointer:coarse) {
 .kf-list-more{width:36px;height:44px;right:2px;}#view-chats #items .kf-context-list-row .item{padding-right:40px;}
 /* On direct touch, actions own the message bubble and conversation row. Text
    is still copied through the menu; editors and native link/media controls are unaffected. */
 #view-chats #msgs .message-line[data-context-message] .msg,
 #view-chats #items .item[data-id],#messages .message[data-id] .bubble,
 #conversation-list .conversation-item[data-id],#visitorChat #msgs .row[data-message-id] .bubble {
   -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
 }
 :is(#view-chats,#workspace,#visitorChat) :is(input,textarea,[contenteditable="true"],a[href],video,audio) {
   -webkit-user-select:auto;user-select:auto;-webkit-touch-callout:default;
 }
}
.kf-list-action-status:not(:empty) {padding:5px 11px;color:#2a7861;font-size:12px;line-height:1.35;}
.kf-list-action-status[data-kind="error"] {color:#b4353d;}
.kf-list-action-status:empty {display:none;}
.kf-chat-edited {font-size:10.5px;color:#788695;font-weight:400;white-space:nowrap;}
.kf-chat-edit {box-sizing:border-box;width:min(440px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100% - 24px);margin:auto;padding:0;border:1px solid #dfe5ea;border-radius:11px;background:#fff;color:#18232d;box-shadow:0 6px 24px #25344122;font:14px/1.5 system-ui,-apple-system,"Microsoft YaHei",sans-serif;}
.kf-chat-edit::backdrop {background:#22304445;}
.kf-chat-edit-form {display:flex;flex-direction:column;gap:12px;padding:18px;}
.kf-chat-edit .kf-chat-edit-title {font-size:17px;font-weight:600;line-height:1.4;margin:0;color:#18232d;}
.kf-chat-edit-note {color:#647184;font-size:13px;margin:0;}
.kf-chat-edit .kf-chat-edit-field {box-sizing:border-box;min-width:0;width:100%;min-height:42px;padding:9px 10px;border:1px solid #cdd7e1;border-radius:6px;background:#fff;color:#18232d;font:inherit;outline:none;box-shadow:none;}
.kf-chat-edit textarea.kf-chat-edit-field {resize:vertical;min-height:100px;max-height:35dvh;overflow:auto;white-space:pre-wrap;}
.kf-chat-edit .kf-chat-edit-field:focus {border-color:#2584c3;outline:2px solid #2584c328;}
.kf-chat-edit-status:not(:empty) {color:#b4353d;font-size:12px;}
.kf-chat-edit-status:empty {display:none;}
.kf-chat-edit-actions {display:flex;justify-content:flex-end;gap:9px;}
.kf-chat-edit-actions button {min-width:76px;min-height:40px;padding:7px 15px;border-radius:6px;font:600 14px/1.3 system-ui,-apple-system,"Microsoft YaHei",sans-serif;box-shadow:none;cursor:pointer;}
.kf-chat-edit-cancel {background:#fff;color:#536375;border:1px solid #dce3e9;}
.kf-chat-edit-save {background:#2584c3;color:#fff;border:1px solid #2584c3;}
.kf-chat-edit-save.kf-chat-edit-danger {background:#b83e41;border-color:#b83e41;}
.kf-chat-edit-actions button:disabled {opacity:.55;cursor:wait;}
@media(max-width:820px),(pointer:coarse){.kf-chat-edit{max-height:min(85dvh,calc(100% - 16px));}.kf-chat-edit .kf-chat-edit-field{font-size:16px;}.kf-chat-edit-actions button{min-height:44px;}}
