:root { --bg:#f5f6f8; --panel:#fff; --text:#15171a; --muted:#7a808a; --line:#e7e9ed; --soft:#f0f2f5; --accent:#111315; --danger:#bd3c45; --shadow:0 24px 70px rgba(21,23,26,.10); }
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font-family:"DM Sans",system-ui,sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}
.topbar{height:72px;padding:0 30px;display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;backdrop-filter:blur(16px)}
.brand-wrap,.top-actions{display:flex;align-items:center;gap:11px}.brand-mark{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:#111315;color:#fff;font-weight:700}.brand{font-family:Manrope,sans-serif;font-weight:800}.subtitle{color:var(--muted);font-size:12px;margin-top:2px}.ghost-btn{border:1px solid var(--line);background:#fff;color:#1b1d20;padding:9px 13px;border-radius:10px;font-weight:600}.ghost-btn:hover{background:#f7f7f8}.sync-status{min-width:95px;text-align:right;color:var(--muted);font-size:12px}
.content{max-width:1180px;margin:0 auto;padding:34px 24px 70px}.summary{display:flex;gap:10px;margin-bottom:24px}.stat-card{min-width:132px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px}.stat-card span{display:block;font:800 23px Manrope,sans-serif}.stat-card small{color:var(--muted);display:block;margin-top:4px}
.toolbar{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:12px}.tabs{display:flex;gap:4px;background:#e9ecf0;padding:4px;border-radius:11px}.tab{border:0;background:transparent;padding:9px 13px;border-radius:8px;color:#68707b;font-weight:700}.tab.active{color:#111315;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.06)}.tab span{color:inherit;opacity:.55;margin-left:4px}
.search-wrap{width:min(340px,100%);position:relative}.search-wrap svg{position:absolute;left:13px;top:11px;width:18px;height:18px;fill:none;stroke:#9aa0a8;stroke-width:1.7}.search-wrap input{width:100%;height:40px;border:1px solid var(--line);border-radius:11px;background:#fff;padding:0 13px 0 39px;outline:none}.search-wrap input:focus{border-color:#babec4;box-shadow:0 0 0 4px rgba(17,19,21,.04)}
.panel{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden}.mail-list{display:flex;flex-direction:column}.mail-row{border:0;border-bottom:1px solid var(--line);background:#fcfcfd;padding:16px 19px;display:grid;grid-template-columns:10px minmax(180px,.8fr) minmax(260px,1.8fr) auto;align-items:center;gap:16px;text-align:left;width:100%;transition:opacity .15s,background .15s}.mail-row:last-child{border-bottom:0}.mail-row:hover{background:#fafbfc}.mail-row.unread{background:#fff}.mail-row.opening{opacity:.58;pointer-events:none}.mail-row.opening .dot{border:2px solid #d4d9df;border-top-color:#4788ca;background:transparent;animation:user-status-spin .7s linear infinite}.dot{width:8px;height:8px;border-radius:50%;background:#c1c5cc}.unread .dot{background:#4788ca}.sender,.subject{min-width:0}.sender strong,.subject strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.sender small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.preview{display:inline-block;color:#8a9098;margin-top:4px;font-size:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row-right{display:flex;align-items:center;gap:9px}.count{color:var(--muted);font-size:12px}.date{color:var(--muted);font-size:12px}.tag{display:inline-flex;align-items:center;height:25px;padding:0 8px;border-radius:999px;font-size:11px;font-weight:800;background:#f1f2f4;color:#666d77}.tag.archive{background:#f4f1eb;color:#786b56}.tag.spam{background:#fff0f1;color:var(--danger)}
.empty{padding:75px 20px;text-align:center;color:var(--muted)}.empty p{margin:0}.empty h3{margin:0;font:600 16px Manrope,sans-serif;color:#666d77}
.pagination{min-height:58px;padding:10px 15px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:18px;background:#fcfcfd}.pagination[hidden]{display:none}.pagination-summary{color:var(--muted);font-size:12px;white-space:nowrap}.pagination-controls{display:flex;align-items:center;gap:5px}.page-btn{min-width:34px;height:34px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#535a63;font-weight:700;font-size:12px}.page-btn:hover:not(:disabled){background:#f2f4f6;color:#111315}.page-btn.active{border-color:#111315;background:#111315;color:#fff}.page-btn:disabled{opacity:.4;cursor:default}.page-step{font-size:16px}.page-gap{min-width:22px;text-align:center;color:var(--muted)}
.drawer{position:fixed;inset:0;display:none;z-index:40}.drawer.open{display:block}.drawer-backdrop{position:absolute;inset:0;background:rgba(20,22,25,.32);backdrop-filter:blur(3px)}.drawer-panel{position:absolute;right:0;top:0;bottom:0;width:min(820px,100%);background:#fff;box-shadow:var(--shadow);display:flex;flex-direction:column}.drawer-top{padding:20px 24px 16px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.close-btn{border:0;background:#f2f3f5;width:34px;height:34px;border-radius:10px;font-size:24px;color:#626873}.drawer-content{padding:28px 30px 50px;overflow:auto}.detail-head h2{margin:0;font:800 28px/1.18 Manrope,sans-serif;letter-spacing:-.03em}.thread-actions{display:flex;align-items:center;gap:12px;margin-top:14px;padding-bottom:18px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12px}.thread-state-actions{display:flex;gap:6px;margin-left:auto}.state-btn{border:1px solid var(--line);background:#fff;padding:8px 10px;border-radius:9px;font-weight:700;color:#3d434b}.state-btn:hover:not(:disabled){background:#f5f6f7}.state-btn.danger{color:var(--danger)}.state-btn:disabled{background:#eef0f2;color:#92979e;cursor:default}.secondary-btn{border:1px solid var(--line);background:#fff;padding:8px 11px;border-radius:9px;font-weight:600;color:#333}.thread{display:flex;flex-direction:column;gap:12px;padding-top:18px}.message{border:1px solid var(--line);border-radius:14px;padding:18px 18px 20px;background:#fff}.message.outgoing{background:#eef6ff;border-color:#d7e7f7}.message-head{display:flex;justify-content:space-between;gap:20px}.message-head strong{font-size:14px}.message-email,.message-head time,.message-meta{color:var(--muted);font-size:12px}.message-meta{margin-top:7px}.message-subject{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}.message-subject span{display:block;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.message-subject strong{display:block;margin-top:4px;font-size:13px;line-height:1.4}.message-body{padding-top:17px;line-height:1.7;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}.message-spam{margin-top:14px;color:var(--danger);font-size:12px;font-weight:700}.message-html-frame{display:block;width:100%;min-height:140px;height:220px;border:0;background:transparent;padding-top:0;overflow:hidden}.message-plain{padding-top:17px;white-space:pre-wrap;line-height:1.7;font-size:14px;overflow-wrap:anywhere}.message-quoted-history{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);color:#5f6b78;font-size:12px;white-space:normal}.message-quoted-history summary{cursor:pointer;color:#557b9e;font-weight:700}.message-quoted-history>div{margin-top:10px;white-space:pre-wrap;line-height:1.55}
.drawer-loading,.drawer-load-error{min-height:260px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:var(--muted)}.drawer-loading>div strong,.drawer-loading>div span,.drawer-load-error strong,.drawer-load-error span{display:block}.drawer-loading>div span,.drawer-load-error span{margin-top:5px;font-size:12px}.drawer-spinner{width:30px;height:30px;margin-bottom:14px;border:3px solid #e0e4e8;border-top-color:#4788ca;border-radius:50%;animation:user-status-spin .75s linear infinite}.drawer-load-error strong{color:var(--text)}.drawer-load-error .secondary-btn{margin-top:16px}

@media (max-width:800px){.topbar{padding:0 15px}.content{padding:24px 13px 45px}.toolbar{align-items:stretch;flex-direction:column}.search-wrap{width:100%}.mail-row{grid-template-columns:8px minmax(0,1fr) auto;gap:10px;padding:14px}.subject{grid-column:2}.row-right{grid-column:3;grid-row:1}.date{display:none}.pagination{align-items:stretch;flex-direction:column}.pagination-summary{text-align:center}.pagination-controls{justify-content:center;flex-wrap:wrap}.drawer-content{padding:23px 17px 35px}.thread-actions{flex-wrap:wrap}.secondary-btn{margin-left:0}.summary{margin-bottom:18px}}

.detail-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.detail-meta{margin-top:7px;color:var(--muted);font-size:12px}.reply-btn{border:0;background:#111315;color:#fff;padding:10px 15px;border-radius:10px;font-weight:700;white-space:nowrap}.reply-btn:hover{background:#24272a}.reply-btn:disabled{opacity:.45;cursor:not-allowed}.message-head-right{text-align:right}.reply-editor{margin-top:16px;border:1px solid var(--line);border-radius:16px;background:#fbfcfd;box-shadow:0 10px 30px rgba(21,23,26,.06);overflow:hidden}.reply-editor-head{display:flex;align-items:center;justify-content:space-between;padding:15px 16px;border-bottom:1px solid var(--line)}.reply-editor-head strong{display:block;font-size:14px}.reply-editor-head span{display:block;margin-top:3px;color:var(--muted);font-size:12px}.editor-close{border:0;background:#eef0f2;width:30px;height:30px;border-radius:9px;color:#60656d;font-size:20px;line-height:1}.reply-editor textarea{display:block;width:100%;border:0;resize:vertical;min-height:150px;padding:16px;background:#fff;outline:none;color:var(--text);line-height:1.6}.reply-editor textarea:focus{box-shadow:inset 0 0 0 2px rgba(17,19,21,.05)}.reply-status{min-width:0;margin-left:auto;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reply-editor-actions{display:flex;flex:0 0 auto;gap:8px}.reply-editor .secondary-btn{margin-left:0}.reply-send-btn{border:0;background:#111315;color:#fff;padding:8px 14px;border-radius:9px;font-weight:700}.reply-send-btn:hover{background:#24272a}.reply-send-btn:disabled{opacity:.55;cursor:not-allowed}
@media (max-width:800px){.detail-title-row{align-items:stretch;flex-direction:column}.reply-btn{width:100%}.message-head-right{text-align:left}.reply-editor-actions{justify-content:flex-end}}
.current-user{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.message-sender{margin-top:3px;color:#5d7fa7;font-size:11px;font-weight:700}.auth-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg)}.auth-card{width:min(410px,100%);background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:30px;box-shadow:var(--shadow)}.auth-mark{margin-bottom:22px}.auth-card h1{margin:0;font:800 28px/1.2 Manrope,sans-serif}.auth-card p{margin:8px 0 24px;color:var(--muted);font-size:13px;line-height:1.5}.auth-form{display:flex;flex-direction:column;gap:14px}.auth-form label span{display:block;margin-bottom:6px;color:#5e646c;font-size:12px;font-weight:700}.auth-form input{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 12px;outline:none}.auth-form input:focus{border-color:#babec4;box-shadow:0 0 0 4px rgba(17,19,21,.04)}.auth-form .reply-send-btn{width:100%;height:42px;margin-top:4px}.login-status{min-height:18px;color:var(--danger);font-size:12px}.auth-screen[hidden]{display:none!important}@media(max-width:800px){.current-user{display:none}}

.attachments{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.attachments-title{font-size:12px;font-weight:800;color:#666d77;margin-bottom:9px}
.attachment-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:9px;margin-bottom:10px}.attachment-image{display:grid;place-items:center;min-height:110px;max-height:260px;overflow:hidden;border:1px solid var(--line);border-radius:11px;background:#f5f6f8}.attachment-image img{display:block;max-width:100%;max-height:260px;object-fit:contain}.attachment-image:hover{border-color:#cbd0d6;background:#f0f2f4}
.attachments-list{display:flex;flex-wrap:wrap;gap:8px}
.attachment{display:flex;align-items:center;gap:9px;min-width:210px;max-width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:#fafbfc;color:var(--text);text-decoration:none}
.attachment:hover{background:#f5f6f8}
.attachment-icon{width:26px;height:26px;border-radius:8px;background:#eef0f2;display:grid;place-items:center;color:#6a7079;font-weight:800}
.attachment-info{min-width:0}.attachment-info strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}.attachment-info small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.reply-attachments{padding:10px 14px;background:#fafbfc;border-top:1px solid var(--line)}.reply-attachments-row{display:flex;align-items:center;gap:12px}.reply-attachment-controls{display:flex;align-items:center;flex:0 1 auto;min-width:0}
.attachment-add-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid var(--line);background:#fff;border-radius:9px;font-size:11px;font-weight:700;color:#3d4249;cursor:pointer}.attachment-add-btn:hover{background:#f6f7f8}.attachment-add-btn svg{width:12px;height:12px}.attachment-drop-hint{margin-left:8px;color:var(--muted);font-size:10px}
.reply-files-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.reply-file-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 6px 5px 8px;border-radius:8px;background:#eef0f2;color:#5b616a;font-size:10px;white-space:nowrap}.reply-file-chip>span{min-width:0;overflow:hidden;text-overflow:ellipsis}.reply-file-chip button{width:20px;height:20px;display:grid;place-items:center;flex:0 0 auto;padding:0;border:0;border-radius:6px;background:transparent;color:#737b84}.reply-file-chip button:hover{background:#dfe3e7;color:#252a30}.reply-file-chip button svg{width:10px;height:10px}
@media(max-width:700px){.reply-attachments-row{flex-wrap:wrap}.reply-attachment-controls{flex:1 1 auto}.reply-status{order:3;flex:1 0 100%;margin-left:0}.attachment-drop-hint{display:none}}

.message.outgoing .message-meta,.message.outgoing .message-email,.message.outgoing .message-head time{color:#6f8da8}
.message.outgoing .message-sender{color:#5d7fa7}

#spamBadge {color: #da7171; }

.user-status-panel{margin-top:16px;border:1px solid #dfe6ec;border-radius:14px;background:#f8fafc;padding:16px;color:#252a30}.user-status-panel.loading{display:flex;align-items:center;gap:11px}.user-status-panel.loading>div,.user-status-panel.error{font-size:12px}.user-status-panel.loading strong,.user-status-panel.loading span,.user-status-panel.error strong,.user-status-panel.error span{display:block}.user-status-panel.loading span,.user-status-panel.error span{margin-top:3px;color:var(--muted)}.user-status-panel.error{border-color:#f0d5d7;background:#fff8f8;color:var(--danger)}
.user-status-spinner{width:18px;height:18px;border:2px solid #d9e2e9;border-top-color:#46799f;border-radius:50%;animation:user-status-spin .8s linear infinite;flex:0 0 auto}@keyframes user-status-spin{to{transform:rotate(360deg)}}
.user-status-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.user-status-heading strong,.user-status-heading span{display:block}.user-status-heading strong{font-size:14px}.user-status-heading>div>span{margin-top:4px;color:var(--muted);font-size:11px}.user-status-badge{display:inline-flex!important;align-items:center;min-height:26px;padding:0 9px;border-radius:999px;background:#f1f2f4;color:#666d77;font-size:10px;font-weight:800;white-space:nowrap}.user-status-badge.success{background:#e8f6ed;color:#34734a}.user-status-badge.warning{background:#fff4dc;color:#8a661a}
.user-status-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:14px}.user-status-metrics>div{min-width:0;padding:10px;border:1px solid #e7ebef;border-radius:10px;background:#fff}.user-status-metrics strong{display:block;font:800 18px Manrope,sans-serif}.user-status-metrics span{display:block;margin-top:3px;color:var(--muted);font-size:9px;line-height:1.25}
.user-status-clinics{margin-top:15px}.user-status-section-title{margin-bottom:7px;color:#69717a;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.user-status-clinic{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid #e8edf1;font-size:11px}.user-status-clinic strong{font-size:12px}.user-status-clinic span{color:var(--muted);text-align:right}.user-status-empty{padding:8px 0;color:var(--muted);font-size:11px}
.user-status-groups{display:grid;gap:7px;margin-top:11px}.user-status-details{border-top:1px solid #e6ebef;padding-top:8px}.user-status-details summary{cursor:pointer;color:#3e464e;font-size:11px;font-weight:800;list-style:none}.user-status-details summary::-webkit-details-marker{display:none}.user-status-details summary:before{content:'›';display:inline-block;margin-right:6px;transition:transform .15s}.user-status-details[open] summary:before{transform:rotate(90deg)}.user-status-details summary span{color:var(--muted);font-weight:600}.user-status-details ul{display:grid;gap:7px;margin:8px 0 0;padding:0;list-style:none}.user-status-details li{padding:8px 9px;border-radius:9px;background:#fff;border:1px solid #e8ecef}.user-status-details li div{font-size:11px}.user-status-details li>span{display:block;margin-top:3px;color:var(--muted);font-size:10px;line-height:1.35}.user-status-role{display:inline-flex;margin-left:4px;padding:2px 5px;border-radius:5px;background:#edf1f4;color:#606872;font-size:9px;font-weight:700}
@media(max-width:800px){.user-status-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.user-status-heading,.user-status-clinic{align-items:flex-start;flex-direction:column}.user-status-clinic span{text-align:left}}

/* Compact, inspectable message presentation. */
.message{padding:16px 18px 17px}
.message-head{align-items:flex-start;gap:16px}
.message-head-right{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;line-height:1.25}
.message-language{white-space:nowrap;font-size:12px}
.message-subject{margin-top:10px;padding-top:10px}
.message-body{padding-top:12px}
.message-plain{padding-top:0}
.message-html-frame{min-height:36px;height:36px}
.thread-actions{position:sticky;top:0;z-index:8;margin-left:-8px;margin-right:-8px;padding:12px 8px 14px;background:rgba(255,255,255,.96);backdrop-filter:blur(10px)}
.secondary-btn:disabled{opacity:.45;cursor:default}
.message-head-right{min-width:0}
.message-collapse-btn{margin-top:0;padding:0;border:0;background:transparent;color:#6a7886;font-size:11px;font-weight:700}
.message-collapse-btn:hover{color:#26333f}
.message.is-collapsed{padding-bottom:18px}
.message.is-collapsed .message-details{display:none}
.message-headers{margin-top:10px;color:var(--muted);font-size:12px}
.message-headers summary{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;list-style:none;color:var(--muted)}
.message-headers summary::-webkit-details-marker{display:none}
.message-headers summary:after{content:' · Подробнее';color:#557b9e;font-weight:700}
.message-headers[open] summary:after{content:' · Скрыть'}
.message-headers dl{display:grid;gap:6px;margin:11px 0 0;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.58)}
.message-headers dl>div{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px}
.message-headers dt{color:#7d8791;font-weight:700}.message-headers dd{min-width:0;margin:0;color:#3d4650;overflow-wrap:anywhere}
.technical-value{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px}
.message-content{position:relative}
.message-content.is-clamped{max-height:620px;overflow:hidden}
.message-content.is-clamped:after{content:'';position:absolute;left:0;right:0;bottom:0;height:90px;pointer-events:none;background:linear-gradient(transparent,#fff)}
.message.outgoing .message-content.is-clamped:after{background:linear-gradient(transparent,#eef6ff)}
.message-presentation-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.message-presentation-actions button{padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.72);color:#4f7190;font-size:11px;font-weight:700}
.message-presentation-actions button:hover{background:#fff}
.message-signature{margin-top:14px;padding-top:10px;border-top:1px solid var(--line);color:#5f6b78;font-size:12px;white-space:normal}
.message-signature summary{cursor:pointer;color:#557b9e;font-weight:700}.message-signature>div{margin-top:10px;white-space:pre-wrap;line-height:1.55}
.message-security{display:grid;gap:5px;margin-top:12px;padding:9px 11px;border:1px solid #efd8a9;border-radius:9px;background:#fff8e8;color:#7b5a18;font-size:11px;font-weight:700}
.message-security[hidden]{display:none}
.link-warning-backdrop{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;padding:20px;background:rgba(16,20,24,.56);backdrop-filter:blur(4px)}
.link-warning-dialog{width:min(520px,100%);padding:22px;border:1px solid #e5e8eb;border-radius:16px;background:#fff;box-shadow:0 24px 80px rgba(10,16,22,.28)}
.link-warning-mark{width:38px;height:38px;display:grid;place-items:center;margin-bottom:14px;border-radius:11px;background:#fff2d8;color:#8b6418;font:800 22px Manrope,sans-serif}
.link-warning-copy strong{display:block;font:800 19px Manrope,sans-serif}.link-warning-copy p{margin:8px 0 14px;color:#66717c;font-size:13px;line-height:1.5}.link-warning-destination{font-weight:800;overflow-wrap:anywhere}.link-warning-copy code{display:block;max-height:92px;margin-top:6px;padding:10px;border-radius:9px;background:#f3f5f7;color:#53606b;font-size:11px;line-height:1.45;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap}.link-warning-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.attachment-image{font:inherit;padding:0;cursor:zoom-in}
.attachment-image.is-broken{color:var(--muted);font-size:11px}
body.thread-open{overflow:hidden}
.drawer-backdrop{display:none}
.drawer-panel{inset:0;width:100%;background:var(--bg);box-shadow:none}
.drawer-top{min-height:64px;height:auto;padding:0 max(24px,calc((100vw - 1440px)/2));background:#fff;flex:0 0 auto;position:relative;z-index:20}
.drawer-top.is-ready{display:flex;padding-top:9px;padding-bottom:9px}
.drawer-top-primary{display:flex;align-items:center;gap:14px;width:100%;min-width:0}
.drawer-thread-title{display:flex;align-items:center;gap:11px;min-width:180px;flex:1 1 320px}
.drawer-thread-title>div{min-width:0}.drawer-thread-title strong,.drawer-thread-title small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer-thread-title strong{font:800 18px Manrope,sans-serif}.drawer-thread-title small{margin-top:3px;color:var(--muted);font-size:11px}
.drawer-primary-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.thread-state-select{height:40px;min-width:124px;position:relative;display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;color:#59616a}.thread-state-select svg{position:absolute;left:9px;width:16px;height:16px;pointer-events:none}.thread-state-select select{width:100%;height:100%;padding:0 28px 0 32px;border:0;border-radius:inherit;background:transparent;color:#343a42;outline:none;font:700 12px "DM Sans",sans-serif;cursor:pointer}.thread-state-select.spam{color:var(--danger)}
.header-icon-btn{width:40px;height:40px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:10px;background:#fff;color:#5d6670}.header-icon-btn:hover:not(:disabled){background:#f4f6f8;color:#20252a}.header-icon-btn.danger{color:var(--danger)}.header-icon-btn.danger:hover:not(:disabled){background:#fff0f1;color:var(--danger)}.header-icon-btn:disabled{opacity:.4;cursor:default}.header-icon-btn svg{width:17px;height:17px}.close-btn,.editor-close{display:grid;place-items:center;padding:0}.close-btn svg{width:16px;height:16px}.editor-close svg{width:13px;height:13px}
.drawer-primary-actions .close-btn{width:40px;height:40px}
.user-status-compact-wrap{width:clamp(270px,31vw,430px);min-width:0;position:relative;flex:0 1 430px}
.user-status-compact{min-width:0;border:1px solid #dfe6ec;border-radius:11px;background:#f8fafc;color:#252a30}
.user-status-compact.is-loading,.user-status-compact.is-error{display:flex;align-items:center;gap:9px;padding:8px 10px}.user-status-compact.is-error{border-color:#f0d5d7;background:#fff8f8;color:var(--danger)}
.user-status-compact>summary{display:flex;align-items:center;gap:9px;min-height:46px;padding:7px 10px;cursor:pointer;list-style:none}.user-status-compact>summary::-webkit-details-marker{display:none}.user-status-compact[open]>summary{background:#f1f5f8;border-radius:10px}
.user-status-mark{width:28px;height:28px;display:grid;place-items:center;flex:0 0 auto;border-radius:8px;background:#e4edf5;color:#3d6f96;font-weight:800}
.user-status-compact-copy,.user-status-compact.is-loading>span:last-child,.user-status-compact.is-error>span:last-child{min-width:0;flex:1}.user-status-compact-copy strong,.user-status-compact-copy small,.user-status-compact.is-loading strong,.user-status-compact.is-loading small,.user-status-compact.is-error strong,.user-status-compact.is-error small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-status-compact-copy strong,.user-status-compact.is-loading strong,.user-status-compact.is-error strong{font-size:12px}.user-status-compact-copy small,.user-status-compact.is-loading small,.user-status-compact.is-error small{margin-top:2px;color:var(--muted);font-size:9px}
.user-status-more{flex:0 0 auto;color:#557b9e;font-size:10px;font-weight:800}.user-status-compact[open] .user-status-more{color:transparent;font-size:0}.user-status-compact[open] .user-status-more:after{content:'Скрыть';color:#557b9e;font-size:10px}
.user-status-popover{position:absolute;top:calc(100% + 8px);left:50%;z-index:30;width:min(540px,calc(100vw - 28px));max-height:calc(100vh - 150px);padding:16px;overflow-y:auto;border:1px solid #dfe6ec;border-radius:14px;background:#f8fafc;box-shadow:0 18px 50px rgba(21,23,26,.18);transform:translateX(-50%)}
.drawer-content{flex:1;min-height:0;padding:0;overflow:hidden}
.conversation-shell{width:min(1120px,100%);height:100%;margin:0 auto;display:flex;flex-direction:column;background:#fff;border-left:1px solid var(--line);border-right:1px solid var(--line)}
.conversation-scroll{flex:1;min-height:0;padding:0 28px 24px;overflow-y:auto;overscroll-behavior:contain;scroll-behavior:smooth}
.conversation-scroll .thread{gap:14px;padding-top:18px}
.conversation-scroll .message{width:min(90%,900px);align-self:flex-start;box-shadow:0 5px 18px rgba(21,23,26,.035)}
.conversation-scroll .message.outgoing{align-self:flex-end}
.conversation-composer{flex:0 0 auto;padding:0 28px 18px;background:linear-gradient(transparent,#fff 22px)}
.conversation-composer:empty{display:none}
.conversation-composer>.reply-btn{display:block;margin-left:auto}
.reply-editor{position:relative;bottom:auto;z-index:9;margin-top:0}
.reply-tinymce{background:#fff}.reply-tinymce .tox-tinymce{border:0;border-radius:0}.reply-tinymce .tox .tox-editor-header{box-shadow:none;border-bottom:1px solid var(--line)}.reply-tinymce .tox .tox-toolbar__primary{background:#fff}.reply-tinymce .tox .tox-tbtn{border-radius:7px}.reply-tinymce .tox .tox-edit-area:before{border:0}.reply-tinymce .tox .tox-toolbar-overlord{background:#fff}
.image-lightbox{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:40px;background:rgba(10,13,16,.88);cursor:zoom-out}
.image-lightbox img{display:block;max-width:min(94vw,1600px);max-height:90vh;object-fit:contain;box-shadow:0 18px 70px rgba(0,0,0,.45);cursor:default}
.image-lightbox-close{position:fixed;top:18px;right:22px;width:42px;height:42px;border:0;border-radius:12px;background:rgba(255,255,255,.15);color:#fff;font-size:28px;line-height:1}
@media(max-width:1200px){.drawer-top{padding-left:14px;padding-right:14px}.drawer-top-primary{gap:8px}.user-status-compact-wrap{width:250px;flex-basis:250px}.user-status-more{display:none}.thread-state-select{min-width:108px}.drawer-thread-title{flex-basis:240px}}
@media(max-width:1000px){.drawer-thread-title small,.user-status-compact-copy small{display:none}.user-status-compact-wrap{width:210px;flex-basis:210px}}
@media(max-width:800px){.drawer-top{min-height:52px;padding:6px}.drawer-top.is-ready{padding-top:6px;padding-bottom:6px}.drawer-top-primary{gap:3px}.drawer-thread-title{min-width:50px;flex-basis:auto;gap:0}.drawer-thread-title .tag,.drawer-thread-title small{display:none}.drawer-thread-title strong{font-size:13px}.user-status-compact-wrap{width:36px;flex:0 0 36px}.user-status-compact>summary{width:36px;min-height:36px;padding:3px}.user-status-compact-copy,.user-status-more{display:none}.user-status-popover{position:fixed;top:56px;left:8px;right:8px;width:auto;max-height:calc(100vh - 68px);transform:none}.drawer-primary-actions{gap:3px}.thread-state-select{min-width:34px;width:34px;height:34px}.thread-state-select svg{left:8px}.thread-state-select select{position:absolute;inset:0;padding:0;opacity:0}.header-icon-btn,.drawer-primary-actions .close-btn{width:34px;height:34px}.conversation-shell{border:0}.conversation-scroll{padding:0 12px 16px}.conversation-scroll .message{width:100%}.conversation-composer{padding:0 10px 10px}.reply-toolbar{padding-left:6px;padding-right:6px}.reply-rich-content{min-height:92px;max-height:180px}.reply-editor-footer{align-items:center;flex-direction:row}.thread-actions{top:0}.message-headers dl>div{grid-template-columns:1fr;gap:2px}.message-head{align-items:flex-start}.message-head-right{min-width:115px;gap:6px}.message-language{font-size:11px}.image-lightbox{padding:15px}}
