:root{--ink:#182738;--muted:#718093;--primary:#2574ad;--primary-dark:#1f6394;--surface:#fff;--line:#e4eaf0;--background:#f5f7fa;--danger:#235f88;--radius:18px;font-family:Inter,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--background);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-width:320px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;min-height:44px;font-weight:600;transition:background .15s,border-color .15s,box-shadow .15s}button:disabled{cursor:default;opacity:.55}a{color:inherit;text-decoration:none}[hidden]{display:none!important}h1,h2,p{margin-top:0}h1{font-size:30px;font-weight:650;letter-spacing:-.8px;margin-bottom:0}h2{font-size:18px;font-weight:650;letter-spacing:-.3px;margin:0}p{line-height:1.6}label{display:flex;flex-direction:column;gap:9px;font-size:13px;font-weight:600;margin-bottom:20px}input,select{width:100%;min-height:46px;border:1px solid #dce3eb;border-radius:10px;background:#fff;padding:11px 13px;color:var(--ink);outline:none;transition:border-color .15s,box-shadow .15s}input:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px #084d7f14}input[readonly]{background:#f7f9fb}input:disabled{background:#f7f9fb;color:#718093}input::placeholder{color:#9aa6b4;font-weight:400}button:focus-visible,a:focus-visible{outline:3px solid #8eb9d7;outline-offset:3px}small{font-weight:400;color:var(--muted);font-size:12px;line-height:1.5}.primary,.secondary,.danger,.danger-outline{border:1px solid transparent;border-radius:10px;padding:11px 19px;white-space:nowrap;font-size:13px;line-height:20px}.primary{background:var(--primary);color:white;box-shadow:0 3px 7px #084d7f19}.primary:hover:not(:disabled){background:var(--primary-dark)}.secondary{background:white;border-color:var(--line);color:var(--ink)}.secondary:hover:not(:disabled){background:#f0f3f6;border-color:#cdd8df}.danger{background:var(--danger);color:white}.danger-outline{background:white;border-color:#cde1ef;color:var(--danger)}.danger-outline:hover:not(:disabled){background:#f5fbff}.full{width:100%}.compact{min-height:38px;padding:8px 14px}.text-button,.icon-button{border:0;background:transparent;color:var(--primary);padding:8px;font-size:12px}.text-button:hover{background:#eef3f7;border-radius:8px}.icon-button{font-size:26px;line-height:24px;color:var(--muted);width:40px}.muted{color:var(--muted);font-size:14px}.small{font-size:12px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:var(--primary);display:block;margin-bottom:12px}.wordmark{font-size:20px;letter-spacing:-.8px;font-weight:750;display:inline-block;white-space:nowrap}.wordmark span{font-weight:450;color:var(--primary)}.loading{display:flex;min-height:100vh;align-items:center;justify-content:center;gap:14px;color:var(--muted);font-size:14px}.spinner{display:inline-block;width:22px;height:22px;border:2px solid #d8e1e7;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.notice{border-radius:10px;padding:12px 14px;font-size:13px;line-height:1.6;margin-bottom:20px}.error{background:#f0f9ff;color:#3777a5;border:1px solid #d6e8f4}.success{background:#eaf2f8;color:#1e5073;border:1px solid #d4e3ee}.form-note{font-size:12px;line-height:1.7;color:var(--muted);margin:16px 0 0}
.auth-layout{min-height:100vh;display:grid;grid-template-columns:minmax(380px,1fr) minmax(470px,1fr);background:#fff}.welcome{position:relative;overflow:hidden;padding:52px 12%;background:#eaf0f4;display:flex;flex-direction:column;justify-content:space-between;min-height:100vh}.welcome-copy{position:relative;z-index:1;margin-top:68px}.welcome h1{font-size:52px;line-height:1.13;letter-spacing:-2.2px;font-weight:650;margin-bottom:24px}.welcome-copy p{font-size:16px;color:#64737e;line-height:1.8}.welcome .eyebrow{color:#566d7e;margin-bottom:20px}.welcome-foot{font-size:11px;color:#6c7f8c;margin-top:32px;margin-bottom:0}.welcome-art{height:240px;position:relative;max-width:350px;margin-top:14px}.orbit{position:absolute;border:1px solid #ccd9e2;border-radius:50%;width:275px;height:275px;left:40px;top:-15px;transform:rotate(-25deg)}.orbit-b{width:220px;height:220px;left:-10px;top:25px;border-color:#d3dfe8}.art-card{position:absolute;display:flex;align-items:center;gap:12px;border:1px solid #ffffffb0;border-radius:14px;background:#ffffffde;box-shadow:0 14px 36px #45667e12;padding:19px 25px;font-size:13px;color:#3b4f5e}.welcome-art .card-a{top:12px;left:8px;transform:rotate(-7deg)}.welcome-art .card-b{top:91px;left:132px;transform:rotate(5deg)}.welcome-art .card-c{top:173px;left:26px;transform:rotate(-3deg)}.art-dot{width:11px;height:11px;border-radius:50%;background:#729ab7;box-shadow:0 0 0 5px #729ab715}.art-dot.blue{background:#86b7d4;box-shadow:0 0 0 5px #86b7d415}.art-dot.amber{background:#d9b773;box-shadow:0 0 0 5px #d9b77315}.auth-panel{display:flex;align-items:center;justify-content:center;padding:48px 50px}.auth-card{width:100%;max-width:385px}.auth-card h2{font-size:29px;letter-spacing:-.8px;margin-bottom:12px}.auth-card>.muted{margin-bottom:31px;line-height:1.7}.auth-foot{margin:36px 0 0;color:#a0a9b5;font-size:10px;line-height:1.8}.password-field{position:relative;display:block}.password-field input{padding-right:88px}.reveal{position:absolute;right:6px;top:4px;height:38px;min-height:38px;border:0;background:none;color:var(--muted);font-size:11px;padding:0 10px;font-weight:500}.reveal:hover{color:var(--primary)}
.app-shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}.sidebar{background:white;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:31px 20px 22px;position:sticky;top:0;height:100vh}.sidebar>.wordmark{font-size:18px;padding:0 7px;margin-bottom:43px}.workspace-control{padding:0 7px;margin-bottom:30px}.workspace-control label{color:#8b97a5;font-size:10px;letter-spacing:1px;text-transform:uppercase;margin-bottom:9px}.workspace-control select{font-size:13px;font-weight:600;background:#f7f9fb;border-color:#edf0f4;min-height:43px;padding:8px 9px}.sidebar nav{display:flex;flex-direction:column;gap:7px}.nav-item{display:flex;align-items:center;gap:12px;text-align:left;width:100%;border:0;border-radius:10px;background:transparent;color:#748194;font-size:13px;padding:12px 14px;font-weight:500}.nav-item>span{font-size:20px;width:21px;text-align:center;font-weight:400}.nav-item:hover{background:#f5f8fa;color:var(--ink)}.nav-item.active{background:#e8f2fa;color:var(--primary);font-weight:650}.sidebar-foot{margin-top:auto;font-size:10px;color:#9ba8b5;display:flex;align-items:center;gap:8px;padding:16px 9px 0}.connection-dot{width:6px;height:6px;border-radius:100%;background:#6f94af}.main-column{min-width:0;display:flex;flex-direction:column}.topbar{height:92px;min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:22px;padding:0 44px;border-bottom:1px solid var(--line);background:#fff}.topbar-label{font-size:12px;color:#8290a1}.user-menu{display:flex;align-items:center;gap:12px;min-width:0}.avatar{display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-width:36px;border-radius:50%;background:#e5ecf1;color:var(--primary);font-size:12px;font-weight:650}.user-text{display:flex;flex-direction:column;gap:4px;max-width:225px}.user-text strong{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-text span{font-size:10px;color:#96a2b0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu>.secondary{margin-left:14px;font-size:11px}.content{padding:40px 44px;max-width:1480px;width:100%;margin:0 auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:27px}.page-heading .eyebrow{color:#95a1af;font-size:9px;letter-spacing:1.4px;margin-bottom:10px}.role-badge,.small-tag{display:inline-flex;align-items:center;justify-content:center;font-size:10px;border-radius:7px;padding:7px 10px;background:#e8f2fa;color:#235f88;white-space:nowrap}.small-tag{background:#f4f6f9;color:#8c99a9;font-weight:400}.settings-card{border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:27px 30px;box-shadow:0 5px 18px #233b5103}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:27px;min-height:30px}.card-heading h2{font-size:16px}.inline-form{display:flex;align-items:flex-end;gap:20px}.inline-form label{flex:1;margin-bottom:0;max-width:660px}.inline-form>.primary{height:46px;margin-bottom:0}.security-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(280px,1fr);gap:24px;align-items:start}.security-grid .settings-card{min-width:0}.security-grid label{font-size:12px}.table-card{padding:9px 24px}.member-row{display:grid;grid-template-columns:280px minmax(230px,1fr) auto;align-items:center;gap:20px;padding:22px 4px;border-bottom:1px solid #edf1f5}.member-row:last-child{border-bottom:0}.member-info{display:flex;align-items:center;gap:13px;min-width:0}.member-info .avatar{width:37px;height:37px;min-width:37px}.member-info strong,.member-info small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.member-info strong{font-size:13px;font-weight:550;margin-bottom:5px}.member-info small{font-size:11px;color:#95a1af}.member-row .role-badge{justify-self:start}.remove-member{color:#a4afba;font-size:21px;line-height:22px}.remove-member:hover{color:var(--danger);background:#f2faff;border-radius:8px}.session-row{padding:17px 0;border-bottom:1px solid #edf1f5;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.session-row:first-child{padding-top:0}.session-row strong{font-size:12px;line-height:1.6;word-break:break-word;font-weight:550;display:block}.session-row small{display:block;font-size:10px;margin-top:6px;color:#98a3b0}.session-row .small-tag{padding:5px 8px;font-size:9px;background:#e8f2fa;color:#235f88;margin-top:3px}.session-row button{font-size:10px;min-height:34px;padding:5px 8px}.settings-card>#logout-all{margin-top:25px;font-size:11px}.empty{padding:45px 25px;text-align:center;color:var(--muted);font-size:14px;line-height:1.8}.empty h2{margin-bottom:12px;color:var(--ink)}.app-footer{margin-top:auto;padding:20px 44px 26px;color:#a1aab6;display:flex;gap:18px;font-size:10px}.app-footer span{color:#b3bbc5}
dialog{border:1px solid var(--line);border-radius:20px;box-shadow:0 25px 90px #1a35452b;padding:28px;width:min(460px,calc(100% - 32px));max-height:calc(100vh - 40px);overflow:auto;color:var(--ink);outline:none}dialog::backdrop{background:#142b4566;backdrop-filter:blur(3px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}.dialog-heading h2{font-size:20px}.dialog-heading .icon-button{margin:-8px -9px -8px 0}dialog>.muted{font-size:12px;margin-bottom:23px}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:27px}#invite-url{font-size:11px}
@media(min-width:1500px){.welcome{padding-left:17%;padding-right:12%}.auth-panel{padding-right:13%}.content{padding-top:50px}}
@media(max-width:1100px){.welcome{padding:42px 10%}.welcome h1{font-size:44px}.welcome-art{transform:scale(.85);transform-origin:left center}.app-shell{grid-template-columns:210px 1fr}.sidebar{padding-left:14px;padding-right:14px}.topbar{padding:0 26px}.content{padding:32px 26px}.settings-card{padding:24px}.security-grid{grid-template-columns:1fr}.app-footer{padding-left:26px}.topbar-label{display:none}.topbar{justify-content:flex-end}}
@media(max-width:760px){.auth-layout{display:block;background:var(--background)}.welcome{min-height:auto;padding:28px 24px;background:var(--background);display:block}.welcome-copy,.welcome-art,.welcome-foot{display:none}.welcome>.wordmark{font-size:20px}.auth-panel{display:block;padding:5px 24px 32px}.auth-card{max-width:440px;margin:auto;background:#fff;padding:28px 24px;border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 26px #233b5105}.auth-card h2{font-size:25px}.auth-card>.muted{font-size:13px}.auth-foot{margin-top:25px}.app-shell{display:block}.sidebar{position:static;height:auto;padding:21px 20px 12px;border-right:0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:minmax(150px,1fr) minmax(120px,1fr);gap:17px}.sidebar>.wordmark{font-size:16px;margin:0;align-self:center;padding:0}.workspace-control{padding:0;margin:0}.workspace-control label{display:none}.workspace-control select{font-size:11px}.sidebar nav{grid-column:1 / -1;flex-direction:row;gap:6px}.nav-item{justify-content:center;font-size:10px;padding:10px 7px;gap:6px;min-height:40px}.nav-item>span{font-size:16px;width:16px}.sidebar-foot{display:none}.topbar{height:74px;min-height:74px;padding:0 20px;justify-content:space-between}.user-menu{width:100%;gap:10px}.user-text{flex:1;max-width:none;min-width:0}.user-menu>.secondary{margin-left:auto}.content{padding:27px 20px}.page-heading{gap:12px;margin-bottom:22px;align-items:flex-start}h1{font-size:26px}.page-heading .primary{font-size:10px;padding:10px 12px;min-height:40px;margin-top:10px}.settings-card{padding:22px 20px;border-radius:15px}.inline-form{display:block}.inline-form>.primary{margin-top:17px;width:100%}.card-heading{margin-bottom:21px;gap:9px}.card-heading h2{font-size:15px}.small-tag{font-size:9px;padding:6px}.security-grid{gap:20px;grid-template-columns:1fr}.table-card{padding:4px 15px}.member-row{grid-template-columns:minmax(0,1fr) 34px;gap:12px;padding:20px 0}.member-row>.role-badge{grid-column:1;grid-row:2;margin-left:50px;margin-top:-7px;font-size:9px}.member-row>.remove-member{grid-column:2;grid-row:1 / 3;align-self:center}.member-info strong{font-size:12px}.member-info small{font-size:10px}.app-footer{padding:20px;font-size:9px}.auth-card label{font-size:12px}.dialog-actions{flex-direction:row}dialog{padding:23px}.user-menu .avatar{width:33px;min-width:33px;height:33px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.heading-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}@media(max-width:760px){#pane-team>.page-heading{flex-wrap:wrap}.heading-actions{width:100%;justify-content:flex-start}.heading-actions .primary{margin-top:0}.heading-actions .secondary{font-size:10px;padding:10px 12px;min-height:40px}}

.integration-grid{display:grid;grid-template-columns:minmax(300px,1fr) minmax(260px,1fr);gap:24px;align-items:start}.integration-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:18px}.integration-error{background:#f0f9ff;color:#3777a5}.advanced{margin:0 0 24px;color:var(--muted);font-size:12px}.advanced summary{cursor:pointer;padding:8px 0}.advanced label{margin:15px 0 0}.branch-row{display:flex;gap:12px;align-items:center;padding:15px 0;border-bottom:1px solid var(--line);font-size:13px}.branch-row:last-child{border:0}.branch-dot{width:8px;min-width:8px;height:8px;border-radius:50%;background:#658eac}.branch-name{overflow-wrap:anywhere}#alfa-cache-time{line-height:1.7}@media(max-width:1100px){.integration-grid{grid-template-columns:1fr}}@media(max-width:760px){.sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.integration-grid{gap:20px}}

/* CRM directory */
.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}.directory-heading h1{display:flex;align-items:center;gap:12px}.directory-heading .small-tag{font-size:12px;letter-spacing:0;color:#546e81;background:#e7edf1}.sync-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;padding:18px 22px;margin-bottom:20px;border:1px solid #dce4ea;border-radius:14px;background:linear-gradient(110deg,#eff4f7,#f8fafb)}.sync-summary{display:flex;align-items:center;gap:14px;min-width:0}.sync-summary>.connection-dot{height:8px;width:8px;min-width:8px;background:#467fa8}.sync-summary>.spinner{min-width:19px;width:19px;height:19px}.sync-summary .sync-failed{background:#c78155}.sync-summary strong{font-size:12px;font-weight:650;line-height:1.6}.sync-summary p{font-size:11px;color:#748490;margin:4px 0 0;line-height:1.7}.sync-options{min-width:170px;max-width:230px;font-size:11px;color:#667986;flex-shrink:0}.sync-options summary{cursor:pointer;padding:3px 0 6px;text-align:right}.sync-options label{font-size:11px;margin:10px 0;gap:8px}.sync-options small{font-size:10px}.check-label{display:flex;flex-direction:row;align-items:center}.check-label input{width:16px;min-height:16px;height:16px;accent-color:var(--primary)}.sync-options .interval-label{display:flex;flex-direction:row;align-items:center}.interval-label select{font-size:11px;min-height:36px;padding:6px 10px}.directory-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:16px}.directory-toolbar label{margin:0;min-width:0}.directory-search{flex:1}.directory-toolbar input,.directory-toolbar select{font-size:12px;border-radius:12px;height:44px;min-height:44px;background:#fff}.directory-toolbar select{min-width:140px;max-width:280px;text-overflow:ellipsis}.directory-layout{--directory-width:450px;display:grid;grid-template-columns:minmax(300px,min(var(--directory-width),calc(100% - 309px))) 9px minmax(0,1fr);height:clamp(480px,calc(100vh - 338px),840px);min-width:0;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 30px #203a4b04;overflow:hidden}.directory-list-panel{overflow:auto;min-width:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d2d9de transparent}.directory-list-heading{display:flex;justify-content:space-between;gap:12px;padding:17px 22px;color:#95a3af;font-size:10px;border-bottom:1px solid #edf1f4;position:sticky;top:0;background:#fff;z-index:1}.directory-list-heading>span:first-child{text-transform:uppercase;letter-spacing:1px;font-size:9px}.directory-resizer{background:#f8fafb;position:relative;cursor:col-resize;touch-action:none;border-left:1px solid #edf1f4;border-right:1px solid #edf1f4;outline:none}.directory-resizer:after{content:"";position:absolute;left:3px;top:calc(50% - 20px);width:2px;height:40px;border-radius:4px;background:#c7d1d8;transition:background .15s}.directory-resizer:hover,.directory-resizer:focus-visible,.resizing .directory-resizer{background:#e4edf3}.directory-resizer:hover:after,.directory-resizer:focus-visible:after,.resizing .directory-resizer:after{background:#3b7299}.resizing{user-select:none;cursor:col-resize}.contact-row{display:flex;align-items:center;gap:20px;padding:16px 19px 16px 22px;border-bottom:1px solid #f0f3f6;position:relative;transition:background .15s}.contact-row:hover{background:#f8fafb}.contact-row.selected{background:#edf3f7}.contact-row.selected:before{content:"";position:absolute;left:0;top:15px;bottom:15px;width:3px;background:#447ba3;border-radius:0 3px 3px 0}.contact-avatar{border:1px solid transparent;position:relative;display:flex;align-items:center;justify-content:center;min-width:44px;width:44px;height:44px;min-height:44px;border-radius:50%;font-size:16px;font-weight:650;padding:0;flex-shrink:0}.status-client{--status-ink:#235f88;--status-bg:#e8f2fa;--status-bold:#245d86}.status-lead{--status-ink:#3a91b9;--status-bg:#e3f3fb;--status-bold:#358fb7}.status-archive{--status-ink:#426d97;--status-bg:#edf2fa;--status-bold:#426d97}.contact-avatar{background:var(--status-bg);color:var(--status-ink);box-shadow:inset 0 0 0 2px #fff8}.contact-avatar:hover,.contact-avatar:focus-visible{color:#fff;background:var(--status-bold);box-shadow:0 0 0 4px var(--status-bg)}.avatar-open{display:none;font-size:24px;font-weight:400}.contact-avatar:hover .avatar-letter,.contact-avatar:focus-visible .avatar-letter{display:none}.contact-avatar:hover .avatar-open,.contact-avatar:focus-visible .avatar-open{display:block}.contact-select{display:flex;flex-direction:column;text-align:left;min-width:0;flex:1;padding:0;background:none;border:0;font-weight:400;gap:6px;color:var(--ink)}.contact-select strong{font-size:13px;font-weight:650;line-height:1.5;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%}.contact-students{font-size:11px;color:#8996a4;line-height:1.6;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.contact-meta{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.status-label{background:var(--status-bg);color:var(--status-ink);font-size:9px;font-weight:550;padding:4px 7px;border-radius:5px;white-space:nowrap}.review-label{color:#ad8548;font-size:9px}.directory-detail{padding:29px;overflow:auto;min-width:0;background:radial-gradient(ellipse at 100% 0,#f2f5f8,transparent 65%),#fcfdfd;scrollbar-width:thin}.detail-placeholder{height:100%;min-height:330px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;margin:auto;max-width:285px}.detail-placeholder-icon{display:flex;justify-content:center;align-items:center;width:72px;height:72px;border:1px solid #dce4ea;border-radius:24px;color:#91a8b8;background:#f0f4f7;font-size:30px;box-shadow:0 8px 25px #67879e09;margin-bottom:24px;transform:rotate(-6deg)}.detail-placeholder h2{font-size:19px;margin-bottom:14px}.detail-placeholder p{font-size:12px;color:#8a949c;line-height:1.9;margin-bottom:24px}.detail-placeholder small{font-size:10px;line-height:1.8;color:#a0a8ad}.contact-heading{padding-bottom:23px;border-bottom:1px solid #e6ebee;margin-bottom:24px}.contact-heading .eyebrow{color:#919da6;letter-spacing:1px;font-size:9px;margin-bottom:10px}.contact-heading h2{font-size:22px;line-height:1.4;overflow-wrap:anywhere}.contact-channels{display:flex;flex-wrap:wrap;gap:8px 20px;color:#7f8b94;font-size:12px;margin-top:13px}.student-list>h3{font-size:10px;font-weight:600;color:#8a969f;text-transform:uppercase;letter-spacing:1px;margin-bottom:15px}.student-card{background:#fff;border:1px solid #e5eaee;border-radius:14px;margin-bottom:13px;padding:19px 20px;box-shadow:0 4px 15px #39576c03}.student-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.student-heading h3{font-size:13px;font-weight:600;line-height:1.6;overflow-wrap:anywhere;margin:0}.student-groups{display:flex;gap:7px;flex-wrap:wrap}.group-tag{font-size:10px;background:#f0f3f5;color:#6e808c;border-radius:7px;padding:7px 10px;line-height:1.5;overflow-wrap:anywhere;max-width:100%}.student-status{font-size:10px;color:#9aa4ab;margin:12px 0 0}.contact-review{background:#fff7e9;color:#a08043;font-size:11px;border:1px solid #f1e8d6;padding:12px 15px}.detail-back{display:none}.directory-footnote{font-size:10px;color:#9aa8b2;margin:15px 0 0;line-height:1.8}.crm-card-link{display:grid;grid-template-columns:minmax(0,1fr) 25px;gap:5px 12px;align-items:center;border:1px solid #e3e8eb;border-radius:11px;padding:16px 18px;margin-bottom:10px;transition:background .15s}.crm-card-link:hover{background:#f2f6f9;border-color:#bbcbd7}.crm-card-link strong{font-size:13px;line-height:1.6}.crm-card-link small{grid-column:1;font-size:11px;color:#8b979f}.crm-link-arrow{grid-row:1 / 3;grid-column:2;color:#5c809a;font-size:22px}
@media(min-width:1700px){#pane-clients .directory-layout{height:clamp(520px,calc(100vh - 365px),900px)}}
@media(max-width:1200px){.directory-layout{grid-template-columns:minmax(300px,min(var(--directory-width),calc(100% - 309px))) 9px minmax(0,1fr)}.directory-detail{padding:22px}.contact-row{gap:17px;padding:15px 16px}.sync-options{min-width:150px}.directory-toolbar select{max-width:210px;min-width:130px}}
@media(max-width:950px) and (min-width:761px){.directory-toolbar{flex-wrap:wrap}.directory-search{flex-basis:100%}.directory-toolbar label:not(.directory-search){flex:1}.directory-toolbar select{max-width:none}.directory-layout{display:block;height:570px}.directory-resizer{display:none}.directory-list-panel{height:100%}.directory-detail{display:none;height:100%}.directory-layout.has-selection .directory-list-panel{display:none}.directory-layout.has-selection .directory-detail{display:block}.detail-back{display:block;margin:-4px 0 20px -8px}}
@media(max-width:760px){.directory-heading{flex-wrap:wrap}.directory-heading h1{font-size:25px}.directory-heading .heading-actions .primary{font-size:11px;min-height:42px}.directory-heading .heading-actions .secondary{font-size:10px;min-height:42px}.sync-bar{padding:16px;gap:14px;flex-direction:column}.sync-options{width:100%;max-width:none}.sync-options summary{text-align:left}.sync-summary strong{font-size:11px}.sync-summary p{font-size:10px}.directory-toolbar{gap:9px;flex-wrap:wrap}.directory-search{flex-basis:100%}.directory-toolbar label:not(.directory-search){flex:1}.directory-toolbar select{min-width:0;max-width:none;width:100%;font-size:11px}.directory-layout{display:block;height:570px;border-radius:14px}.directory-list-panel{height:100%}.directory-resizer{display:none}.directory-detail{display:none;height:100%;padding:22px 18px}.directory-layout.has-selection .directory-list-panel{display:none}.directory-layout.has-selection .directory-detail{display:block}.detail-back{display:block;margin:-4px 0 20px -8px}.contact-heading h2{font-size:20px}.contact-row{gap:19px;padding:16px}.contact-select strong{font-size:12px}.contact-students{font-size:10px}.directory-list-heading{padding:15px 17px}.student-card{padding:18px 16px}.student-heading{align-items:flex-start}.student-heading h3{font-size:12px}.directory-footnote{font-size:9px}.sidebar nav{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* MAX connections and unified chat */
.max-setup{margin-top:24px}.max-setup>.muted{line-height:1.8;margin-bottom:22px}.max-channels{display:grid;gap:14px}.max-channel{border:1px solid #e1e7eb;border-radius:14px;padding:20px;background:#fbfcfd}.max-channel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.max-channel-heading strong{display:block;font-size:14px}.max-channel-heading small{display:block;font-size:11px;color:#848f97;margin-top:6px}.max-channel-heading .small-tag{white-space:normal;text-align:center;line-height:1.6;background:#e7eff5;color:#335e7d}.max-channel-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:17px}.max-channel-actions button{font-size:11px}.max-channel .notice{margin-top:15px;font-size:11px}.max-channel>.muted{margin-top:12px;line-height:1.7}#max-add{margin-top:20px;border-top:1px solid var(--line);padding-top:18px}#max-add>summary{font-size:13px;font-weight:600;cursor:pointer;color:#446d8a;padding:6px 0}#max-form{margin-top:20px;display:grid;grid-template-columns:1fr 1.5fr auto;gap:16px;align-items:end}#max-form label{margin:0}#max-form .primary{margin-bottom:1px}#max-form label small{min-height:28px}#max-form>label:first-child{align-self:start}#max-form>label:first-child:after{content:"";height:28px}.chat-mode .content{max-width:none;padding:24px}.chat-mode .app-footer{display:none}.chat-mode .topbar{height:72px;min-height:72px}.chat-page-heading{margin-bottom:18px;align-items:center}.chat-page-heading h1{font-size:25px;display:flex;align-items:center;gap:12px}.chat-page-heading .eyebrow{font-size:9px;letter-spacing:1.5px}.chat-total{display:inline-flex;align-items:center;justify-content:center;min-width:25px;height:25px;padding:0 8px;border-radius:8px;background:#e89341;color:#fff;font-size:12px;font-weight:650}.chat-heading-actions{display:flex;gap:8px;align-items:center}.chat-heading-actions .chat-new-marker{max-width:min(190px,26vw)}.chat-heading-actions>label{margin:0;min-width:0}.chat-heading-actions select{width:240px;max-width:36vw;font-size:12px;min-height:40px;border-radius:12px;background:#fff}.chat-heading-actions .icon-button{width:39px;min-width:39px;height:39px;min-height:39px;font-size:21px;background:#fff;border:1px solid var(--line);border-radius:12px;color:#6b7e8c}.chat-layout{--chat-width:450px;display:grid;grid-template-columns:minmax(300px,min(var(--chat-width),calc(100% - 329px))) 8px minmax(0,1fr);height:calc(100dvh - 225px);min-height:490px;max-height:1200px;border:0;border-radius:18px;overflow:hidden;padding:10px;gap:0;background-color:#6eb8f0;background-image:url(/assets/chat-wallpaper.png);background-repeat:no-repeat;background-position:center;background-size:cover}.chat-list-panel{min-width:0;display:flex;flex-direction:column;overflow:hidden;background:#fff;border-radius:16px;box-shadow:0 4px 24px rgba(25,37,45,.10)}.chat-search{padding:17px 17px 0;border-bottom:1px solid #edeff1}.chat-search>label{margin:0 0 11px}.chat-search input{border-radius:12px;min-height:42px;font-size:12px;background:#f5f7f8;border-color:#edf0f2}.chat-filters{display:flex;gap:9px}.chat-filters select{min-width:0;flex:1;height:35px;min-height:35px;font-size:10px;padding:5px 8px;background:#fff;border-radius:9px}.chat-views{display:flex;gap:4px;padding:12px 0 10px}.chat-views button{background:none;border:none;padding:7px 9px;min-height:31px;border-radius:8px;color:#8a949b;font-size:10px;font-weight:500}.chat-views button.active{background:#eaf0f4;color:#305c7b;font-weight:650}.chat-list-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ced6dc transparent}.chat-list-foot{font-size:9px;color:#929ca4;padding:12px 16px;display:flex;justify-content:space-between;gap:10px;border-top:1px solid #edeff1}.chat-row{display:flex;align-items:center;gap:22px;padding:18px 17px 18px 21px;border-bottom:1px solid #eef1f3;position:relative;transition:background .15s}.chat-row:hover{background:#f7f9fa}.chat-row.selected{background:#edf2f6}.chat-row.selected:before{content:"";position:absolute;left:0;top:15px;bottom:15px;width:3px;border-radius:3px;background:#3d8dc4}.chat-select{display:flex;flex-direction:column;gap:6px;align-items:stretch;text-align:left;min-width:0;flex:1;min-height:44px;padding:0;border:none;background:none;color:var(--ink);font-weight:400}.chat-row-heading{display:flex;gap:12px;align-items:baseline;min-width:0}.chat-row-heading strong{font-size:13px;font-weight:650;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-row-heading time{font-size:9px;color:#a1a9ae;flex-shrink:0}.chat-preview{font-size:12px;color:#879198;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.chat-row .contact-students{font-size:10px}.chat-row .contact-meta small{font-size:9px}.chat-row.unread .contact-avatar{animation:reply-pulse 2.5s ease-in-out infinite}.chat-row.unread:before{content:"";position:absolute;left:0;top:50%;transform:translateY(-50%);height:70%;width:3px;background:#e9a445}.unread-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:6px;font-size:9px;font-weight:650;background:#f3a944;color:#fff;line-height:1.4;white-space:nowrap}.unread-badge:before{content:"";width:4px;height:4px;border-radius:50%;background:#fff}.status-unlinked{--status-ink:#8a96a0;--status-bg:#edf1f5;--status-bold:#8196a5}.chat-conversation{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:transparent;position:relative}.chat-header{min-height:54px;padding:8px 14px;display:flex;align-items:center;gap:13px;background:#fff;border:0;border-radius:16px;box-shadow:0 4px 24px rgba(25,37,45,.10);flex-shrink:0;position:absolute;top:8px;left:8px;right:8px;z-index:2}.chat-header>.icon-button{font-size:21px;color:#6d8494;min-width:31px;padding:0}.chat-person{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px}.chat-person>strong{font-size:14px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-person>small{font-size:10px;color:#8b949b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-person .unread-badge{align-self:flex-start}.chat-header>.text-button{font-size:10px;padding:6px;min-height:36px;white-space:nowrap}.chat-stream{flex:1;min-height:0;padding:76px 16px 80px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bac6cf transparent}.chat-older{display:block;margin:0 auto 17px;background:#fff9;border:1px solid #dce2e7;border-radius:12px;padding:9px 15px;min-height:34px;font-size:10px;color:#6f8392;font-weight:500}.chat-day{align-self:center;clear:both;text-align:center;color:#7a8a95;font-size:9px;margin:6px auto 17px;padding:5px 10px;border-radius:9px;background:#f5f9fcb3;width:fit-content}#chat-history{display:flex;flex-direction:column;gap:5px}.chat-bubble{max-width:min(84%,560px);min-width:85px;padding:8px 12px 5px;border-radius:16px;position:relative;overflow-wrap:anywhere;animation:message-in .13s ease-out}.chat-bubble p{margin:0;font-size:13px;line-height:1.45;white-space:pre-wrap}.chat-bubble.incoming{align-self:flex-start;background:#fff;border:0;filter:drop-shadow(0 1px 1px rgba(16,27,35,.13))}.chat-bubble.outgoing{align-self:flex-end;background:#dceefa;border:0;filter:drop-shadow(0 1px 1px rgba(16,27,35,.13))}.chat-bubble-meta{display:flex;align-items:center;justify-content:flex-end;gap:7px;font-size:8px;color:#8b99a3;margin-top:5px;flex-wrap:wrap}.send-state{font-size:8px}.state-unknown,.state-failed,.state-cancelled{color:#4886b3;font-weight:650}.state-accepted{color:#4d7693}.chat-message-error{display:block;font-size:10px;line-height:1.7;color:#a16444;margin-top:7px}.chat-forwarded{display:block;color:#5d7e96;font-size:10px;margin-bottom:5px}.chat-attachment{display:block;font-size:11px;border:1px dashed #c7d1d8;border-radius:8px;padding:9px 12px;color:#768692;margin-bottom:4px}.chat-history-note{font-size:9px;line-height:1.7;color:#8f9ba3;text-align:center;padding:15px 0 0}.chat-compose{background:transparent;border:0;padding:0;flex-shrink:0;position:absolute;left:8px;right:8px;bottom:8px;z-index:2}.chat-compose-hint{margin:0 8px 8px;font-size:11px;line-height:1.45;color:#6f7c85}.chat-compose-hint[hidden]{display:none}.chat-compose-row{display:flex;align-items:flex-end;gap:8px}.chat-compose-field{margin:0;flex:1;min-width:0;position:relative}.chat-compose textarea{display:block;resize:none;overflow-y:auto;min-height:48px;max-height:160px;line-height:1.45;padding:13px 18px;border:0;border-radius:16px;font-family:inherit;font-size:15px;font-weight:400;color:var(--ink);width:100%;background:#fff;box-shadow:0 4px 24px rgba(25,37,45,.10)}.chat-compose textarea:focus{outline:none;box-shadow:0 4px 24px rgba(25,37,45,.14)}.chat-compose textarea:disabled{background:#f7f9fa;color:#8a97a0}.chat-send{flex:none;width:48px;height:48px;min-width:48px;min-height:48px;padding:0;border:0;border-radius:50%;background:#3d8dc4;color:#fff;box-shadow:0 4px 16px rgba(47,95,130,0.28);display:grid;place-items:center;transition:background .15s,transform .15s,box-shadow .15s}.chat-send:hover:not(:disabled){background:#3f749a}.chat-send:active:not(:disabled){transform:scale(.96)}.chat-send:disabled{opacity:.45;box-shadow:none}.chat-send-plane{width:20px;height:20px;display:block;fill:#fff;stroke:#fff;stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round;margin:1px 0 0 1px}.chat-send-retry{display:none;font-size:20px;line-height:1;font-weight:500}.chat-send.is-retry .chat-send-plane{display:none}.chat-send.is-retry .chat-send-retry{display:block}.chat-conversation>.detail-placeholder{flex:1;min-height:0;padding:25px 0}.chat-conversation>.detail-placeholder .secondary{font-size:11px}.chat-layout.list-collapsed{grid-template-columns:0 0 minmax(0,1fr)}.chat-layout.list-collapsed .chat-list-panel,.chat-layout.list-collapsed #chat-resizer{visibility:hidden}.chat-linked-family{background:#f3f6f8;border:1px solid #e1e6ea;border-radius:12px;padding:17px;margin:17px 0}.chat-linked-family>strong{font-size:14px}.chat-linked-child{margin-top:16px;border-top:1px solid #e1e6ea;padding-top:12px;display:flex;flex-direction:column;gap:5px}.chat-linked-child strong{font-size:12px}.chat-linked-child small{font-size:11px;color:#7e8c96;line-height:1.6}.chat-link-option{background:#fff;border:1px solid #e0e6ea;border-radius:11px;padding:15px;text-align:left;width:100%;display:flex;align-items:flex-start;flex-direction:column;gap:6px;margin-bottom:9px}.chat-link-option:hover{background:#f1f5f8}.chat-link-option strong{font-size:13px}.chat-link-option small{font-size:11px;color:#929ca3}#chat-link-results{margin-top:17px;max-height:48dvh;overflow:auto}#chat-settings-dialog input[type=range]{padding:0;min-height:30px;accent-color:var(--primary)}
@keyframes reply-pulse{0%,100%{box-shadow:0 0 0 0 #e2ab4d33,inset 0 0 0 2px #fff9}50%{box-shadow:0 0 0 6px #e2ab4d19,inset 0 0 0 2px #fff9}}@keyframes message-in{from{opacity:.6;transform:translateY(2px)}to{opacity:1;transform:none}}
@media(min-width:1700px){.chat-mode .sidebar{width:245px}.chat-layout{height:calc(100dvh - 230px)}}
@media(max-width:1300px){.chat-row{gap:18px;padding:16px}.chat-header{padding:8px 12px}.chat-header>.text-button{font-size:9px}.chat-stream{padding:76px 14px 80px}.chat-layout{grid-template-columns:minmax(300px,min(var(--chat-width),calc(100% - 329px))) 8px minmax(0,1fr)}#max-form{grid-template-columns:1fr}#max-form>label:first-child:after{display:none}#max-form label small{min-height:0}#max-form>.primary{justify-self:start}}
@media(max-width:1100px){.chat-layout{display:block;height:calc(100dvh - 225px);min-height:520px}.chat-list-panel{height:100%}.chat-layout #chat-resizer,.chat-conversation{display:none}.chat-layout.has-selection .chat-list-panel{display:none}.chat-layout.has-selection .chat-conversation{display:flex;height:100%}.chat-heading-actions select{width:240px}.chat-page-heading .eyebrow{display:none}.chat-person>strong{font-size:13px}}
@media(max-width:760px){.chat-mode .content{padding:18px 12px}.chat-mode .topbar{height:65px;min-height:65px}.chat-page-heading{gap:10px;margin:0 3px 15px}.chat-page-heading h1{font-size:21px}.chat-heading-actions{gap:5px}.chat-heading-actions select{width:160px;max-width:32vw;min-height:36px;height:36px;font-size:10px;padding:7px}.chat-heading-actions .icon-button{height:35px;min-height:35px;width:33px;min-width:33px;font-size:18px;border-radius:10px}.chat-layout{height:calc(100dvh - 300px);min-height:470px;border-radius:14px}.chat-row{gap:22px;padding:17px}.chat-row-heading strong{font-size:13px}.chat-search{padding:15px 15px 0}.chat-header{min-height:52px;gap:8px;padding:8px 12px}.chat-person{min-width:100px}.chat-header>.text-button{font-size:9px;padding:5px;min-height:30px}.chat-stream{padding:72px 10px 76px}.chat-bubble{max-width:89%;padding:10px 12px 7px}.chat-bubble p{font-size:13px}.chat-compose{padding:0}.chat-compose textarea{min-height:44px;font-size:16px;padding:11px 14px}.chat-send{width:44px;height:44px;min-width:44px;min-height:44px}.max-setup{padding:20px}.max-channel{padding:15px}.max-channel-heading{flex-direction:column;gap:10px}.max-channel-actions{gap:9px}.max-channel-actions .primary{font-size:10px}.chat-conversation>.detail-placeholder{max-width:260px}.chat-layout.list-collapsed .chat-list-panel{visibility:visible}.sidebar nav{grid-template-columns:repeat(3,minmax(0,1fr))}}
.chat-new-marker{max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#fff1d7;border:1px solid #f0d3a3;color:#8b641f;border-radius:10px;padding:8px 12px;font-size:11px;min-height:36px;box-shadow:0 0 0 4px #edb14e10}.chat-new-marker:hover{background:#ffe3b5}@media(max-width:760px){.chat-heading-actions .chat-new-marker{max-width:96px;padding:6px 7px;font-size:9px}.chat-mode .sidebar{padding-bottom:10px}}
@media(max-width:760px){.chat-mode .sidebar{padding:12px 14px 8px;gap:10px}.chat-mode .sidebar nav{display:flex;overflow-x:auto;min-width:0;max-width:100%;scrollbar-width:none;gap:5px}.chat-mode .sidebar .nav-item{flex:none;padding:9px 11px}.chat-mode .chat-layout{min-height:420px}}

@media(max-width:760px){.chat-mode .sidebar .nav-item{width:auto}}
#alfa-max-connect-form,#alfa-max-otp-form{max-width:560px;margin-top:16px}.alfa-max-settings .form-note{display:block}.alfa-max-settings #alfa-max-info{margin:10px 0}.sync-progress{margin:16px 0;padding:14px 16px;border:1px solid #dce4ea;border-radius:12px;background:#f6f9fb}.sync-progress-row{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:600;color:var(--ink);margin-bottom:11px}.sync-spinner{display:inline-block;width:18px;min-width:18px;height:18px;border:2px solid #d8e1e7;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}.sync-progress-track{height:6px;border-radius:999px;background:#e3ebf0;overflow:hidden}.sync-progress-fill{height:100%;width:45%;border-radius:999px;background:linear-gradient(90deg,#467fa8,#7ca7c5);animation:sync-slide 1.3s ease-in-out infinite}.sync-progress-detail{margin:10px 0 0!important}@keyframes sync-slide{0%{transform:translateX(-110%)}100%{transform:translateX(240%)}}

/* Shared white page header: the selected section's title and controls live here. */
.topbar{height:auto;min-height:82px;padding:12px clamp(22px,3vw,44px);justify-content:space-between;gap:22px}
.topbar-context{flex:1;min-width:0}
.topbar-context>.page-heading{min-height:54px;margin:0;align-items:center;gap:18px}
.topbar-context>.page-heading>div:first-child{min-width:0}
.topbar-context>.page-heading .eyebrow{font-size:9px;line-height:1.2;letter-spacing:1.2px;margin:0 0 5px}
.topbar-context>.page-heading h1{font-size:24px;line-height:1.2;letter-spacing:-.55px}
.topbar-context>.page-heading .role-badge{flex-shrink:0}
.topbar-context .heading-actions,.topbar-context .chat-heading-actions{align-items:center;gap:9px}
.topbar-context .page-heading .primary,.topbar-context .page-heading .secondary{margin-top:0}
.topbar-context .chat-page-heading{margin:0}
.topbar-context .chat-page-heading h1{font-size:24px}
.topbar-context .chat-heading-actions select{max-width:260px}
.topbar .user-menu{flex-shrink:0}
.content{padding-top:30px}

/* Messages: compact search/filter row, automatic paging, explicit handled state. */
.chat-search-controls{display:grid;grid-template-columns:minmax(110px,1fr) max-content max-content;align-items:center;gap:7px;padding:0 0 11px}
.chat-search-controls>label{min-width:0;margin:0}
.chat-search-controls input,.chat-search-controls select{height:36px;min-height:36px;border:1px solid #e5e9ec;border-radius:9px;background:#fff;font-size:10px;color:#525f68}
.chat-search-controls input{width:100%;padding:7px 10px;background:#f6f8f9}
.chat-search-controls select{width:max-content;max-width:150px;padding:5px 23px 5px 8px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.chat-search-controls select:focus,.chat-search-controls input:focus{outline:2px solid #9fb6c744;border-color:#a6b9c7}
.chat-list-loader{min-height:10px;padding:8px 12px;text-align:center;color:#8b949a;font-size:10px}
.chat-list-loader[hidden]{display:none}
.chat-list-loader button{margin-left:8px;font-size:10px}
.chat-handled{flex:none;min-height:34px;padding:7px 12px;border:1px solid #a8c9e0;border-radius:9px;background:#e0edf7;color:#16517b;font-family:inherit;font-size:10px;font-weight:600;line-height:1.2;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.chat-details{flex:none;min-height:34px;padding:7px 12px;border:1px solid #a8c9e0;border-radius:9px;background:#e0edf7;color:#16517b;font-family:inherit;font-size:10px;font-weight:600;line-height:1.2;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}.chat-details:hover{background:#c9e0f0;border-color:#7baccf;transform:translateY(-1px)}.chat-details:focus-visible{outline:2px solid #4889b7;outline-offset:2px}
body:has(dialog[open]){overflow:hidden}
.chat-handled:hover{background:#c9e0f0;border-color:#7baccf;transform:translateY(-1px)}
.chat-handled:focus-visible{outline:2px solid #4889b7;outline-offset:2px}
.chat-handled:disabled{opacity:.6;cursor:wait;transform:none}
@media(max-width:760px){.chat-search-controls{grid-template-columns:minmax(100px,1fr) max-content max-content;gap:5px}.chat-search-controls select{max-width:125px;padding-left:6px;padding-right:19px;font-size:9px}.chat-search-controls input{font-size:10px;padding-left:8px}.chat-handled{min-height:30px;padding:6px 9px;font-size:9px}}
.chat-mode .topbar{height:auto;min-height:82px}
.chat-mode .chat-layout{height:calc(100dvh - 160px)}
@media(max-width:1100px){
  .topbar{padding:11px 22px;gap:15px}
  .topbar .user-menu{gap:9px}
  .topbar .user-text{max-width:165px}
  .topbar-context>.page-heading{gap:12px}
  .topbar-context .chat-heading-actions select{max-width:220px}
  .chat-mode .chat-layout{height:calc(100dvh - 160px)}
}
@media(max-width:760px){
  .topbar,.chat-mode .topbar{height:auto;min-height:0;padding:12px 15px;display:flex;flex-wrap:wrap;align-items:center;gap:9px}
  .topbar-context{flex:1 1 100%;order:0}
  .topbar-context>.page-heading{min-height:0;align-items:flex-start;flex-wrap:wrap;gap:9px 12px}
  .topbar-context>.page-heading .eyebrow{display:none}
  .topbar-context>.page-heading h1,.topbar-context .chat-page-heading h1{font-size:22px}
  .topbar-context .heading-actions,.topbar-context .chat-heading-actions{width:100%;justify-content:flex-start;flex-wrap:wrap;gap:6px}
  .topbar-context .page-heading .primary,.topbar-context .page-heading .secondary{font-size:10px;padding:8px 11px;min-height:37px}
  .topbar-context .chat-heading-actions select{width:min(190px,46vw);max-width:46vw;min-height:36px;height:36px;font-size:10px;padding:7px}
  .topbar-context .chat-heading-actions .chat-new-marker{max-width:104px}
  .topbar-context .chat-heading-actions .icon-button{width:34px;min-width:34px;height:35px;min-height:35px;font-size:18px}
  .topbar .user-menu{order:1;width:auto;gap:9px;margin-left:auto}
  .topbar .user-menu .avatar{width:30px;min-width:30px;height:30px;font-size:10px}
  .topbar .user-text{max-width:150px}
  .topbar .user-menu>.secondary{margin-left:3px;min-height:34px;padding:6px 10px}
  .content{padding-top:22px}
  .chat-mode .content{padding-top:14px}
  .chat-mode .chat-layout{height:calc(100dvh - 300px)}
}
.chat-row .contact-avatar{min-width:22px;width:22px;height:22px;min-height:22px;font-size:10px}
.chat-row .avatar-open{font-size:12px}
.chat-row .status-client{--status-ink:#fff;--status-bg:#226ba0;--status-bold:#1b5c8a}
.chat-row .status-lead{--status-ink:#fff;--status-bg:#3b82f6;--status-bold:#2f6fdd}
.chat-row .status-archive{--status-ink:#fff;--status-bg:#55a6e0;--status-bold:#4591c8}
.chat-row .status-unlinked{--status-ink:#fff;--status-bg:#9aa7b0;--status-bold:#85939d}
.chat-row .contact-avatar:hover,.chat-row .contact-avatar:focus-visible{box-shadow:none}
.chat-date{color:#5f7483;font-weight:600}
.chat-bubble.system{max-width:min(88%,560px);background:rgba(255,255,255,0.45);border:1px solid rgba(255,255,255,0.55);box-shadow:0 3px 12px rgba(25,37,45,0.12);border-radius:12px;align-self:flex-end;padding:6px 12px;cursor:pointer}
.system-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.system-label{font-size:11px;font-weight:600;color:#6f7c85;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.system-right{display:flex;align-items:center;gap:6px;flex:none}
.system-time{font-size:11px;font-weight:600;color:#6f7c85;white-space:nowrap}
.system-toggle{flex:none;width:17px;height:17px;min-width:17px;min-height:17px;border-radius:50%;border:1px solid #c3c9cd;background:transparent;color:#6f7c85;font-size:14px;line-height:1;cursor:pointer;padding:0;display:grid;place-items:center}
.system-toggle-glyph{transform:translateY(-1px)}
.system-toggle:hover,.chat-bubble.system:hover .system-toggle{background:#e4e9ec}
.system-body{margin:6px 0 0;font-size:11px;font-weight:600;line-height:1.35;color:#6f7c85;white-space:pre-wrap}
.system-body[hidden]{display:none}
.chat-history-loader{display:flex;flex-direction:column;align-items:center;gap:4px;color:#525f68;font-size:12px}.chat-history-loader button{font-size:12px;min-height:36px;padding:7px 12px}.chat-history-loader:has(button[hidden]):has(span[hidden]){display:none}
.chat-stream{overflow-anchor:none}.chat-stream .chat-bubble{animation:none}
.sync-progress.is-complete .sync-spinner{display:none}.sync-progress.is-complete .sync-progress-fill{width:100%;animation:none}
.chat-bubble.has-tail.incoming{border-bottom-left-radius:4px;margin-left:9px}
.chat-bubble.has-tail.outgoing{border-bottom-right-radius:4px;margin-right:9px}
.chat-bubble.has-tail.incoming::before,.chat-bubble.has-tail.outgoing::before{content:"";position:absolute;bottom:0;width:11px;height:20px;background:inherit;pointer-events:none}
.chat-bubble.has-tail.incoming::before{left:-9px;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 20'%3E%3Cpath fill='%23fff' d='M11 0v20H0c3.2-5 8-12 11-20z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 20'%3E%3Cpath fill='%23fff' d='M11 0v20H0c3.2-5 8-12 11-20z'/%3E%3C/svg%3E") no-repeat center / 100% 100%}
.chat-bubble.has-tail.outgoing::before{right:-9px;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 20'%3E%3Cpath fill='%23fff' d='M0 0v20h11C7.8 15 3 8 0 0z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 20'%3E%3Cpath fill='%23fff' d='M0 0v20h11C7.8 15 3 8 0 0z'/%3E%3C/svg%3E") no-repeat center / 100% 100%}
.chat-bubble.incoming p,.chat-bubble.outgoing p{font-size:15px;line-height:1.35}
.chat-layout #chat-resizer{background:transparent;border:0}
.chat-layout #chat-resizer:after{background:#c7d1d888}
.chat-conversation>.detail-placeholder{padding-top:88px}


.messages-only .sidebar,.messages-only .topbar{display:none}
.messages-only{grid-template-columns:minmax(0,1fr)}
.messages-only .main-column{min-height:100dvh}
.messages-only .content{padding:0}
.messages-only.chat-mode .chat-layout{height:100dvh;min-height:100dvh;max-height:none;border-radius:0;padding:8px}
.chat-list-header{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border-bottom:1px solid #edeff1;background:#fff}
.chat-list-header[hidden]{display:none}
.chat-list-header .chat-page-heading{margin:0;align-items:center;gap:10px}
.chat-list-header .chat-page-heading h1{font-size:19px}
.chat-list-header .chat-heading-actions{gap:6px;flex-wrap:wrap}
.chat-user-card{display:flex;align-items:center;gap:12px;padding:10px 12px;background:#f6f8f9;border:1px solid #e6eaed;border-radius:12px}
.chat-user-card .avatar{width:36px;height:36px;min-width:36px}
.chat-user-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.chat-user-text strong{font-size:12px;font-weight:600}
.chat-user-text small{font-size:10px;color:#96a2b0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.member-sections{grid-column:1 / -1;display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 0 0;border-top:1px dashed #e6eaec}
.member-sections .check-label{gap:7px;font-size:11px;color:#5c6b78;margin:0}
.member-sections .check-label input{width:15px;height:15px;min-height:15px}
.member-sections>.secondary{margin-left:auto}

.member-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center}
.member-roles{display:flex;flex-direction:column;align-items:flex-start;gap:5px;justify-self:start}
.role-chip{font-size:10px;font-weight:600;padding:5px 9px;border-radius:7px;background:#f1f4f6;color:#98a4b0;white-space:nowrap;min-height:0;line-height:1.4;border:0;cursor:pointer;transition:background .15s,color .15s}
.role-chip:not(:disabled):hover{background:#e2e8ed;color:#57616c}
.role-chip:disabled{opacity:1;cursor:default}
.role-chip.active{background:#38424d;color:#fff}
.member-actions .secondary{padding:7px 12px;min-height:34px}
.member-head{gap:12px}
.member-head .avatar{width:44px;height:44px;min-width:44px;font-size:14px}
.member-head-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.member-head-text h2{font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.member-head-text small{font-size:11px;color:#96a2b0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.member-sections-dialog{display:grid;gap:8px;padding:0;border-top:0;margin:4px 0 0}
.section-option{display:flex;align-items:center;gap:13px;width:380px;max-width:100%;padding:13px 15px;border:1px solid #e6eaec;border-radius:14px;background:#f8fafb;transition:border-color .15s,background .15s}
.section-option:hover{border-color:#cfd9e0;background:#f1f5f8}
.section-option-icon{display:grid;place-items:center;width:38px;height:38px;min-width:38px;border-radius:12px;background:#eaeff3;color:#2f5c7d;font-size:17px}
.section-option-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.section-option-text strong{font-size:13px;font-weight:600}
.section-option-text small{font-size:11px;color:#8b949a;line-height:1.35}
.switch{position:relative;display:inline-block;width:42px;height:24px;flex:none}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch-slider{position:absolute;inset:0;background:#cdd3d8;border-radius:99px;transition:background .18s;cursor:pointer}
.switch-slider:before{content:"";position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .18s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch input:checked+.switch-slider{background:#3d8dc4}
.switch input:checked+.switch-slider:before{transform:translateX(18px)}
.switch input:focus-visible+.switch-slider{outline:3px solid #8eb9d7;outline-offset:2px}
#member-sections-dialog{width:max-content;max-width:calc(100% - 32px);padding-left:10px;padding-right:10px}
#member-sections-dialog .member-head,#member-sections-dialog .muted,#member-sections-dialog .form-note,#member-sections-dialog .dialog-actions{width:380px;max-width:100%}

.sync-progress.is-paused .sync-spinner,.sync-progress.is-offline .sync-spinner{animation:none;border-color:#b8c0c6}.sync-progress.is-paused .sync-progress-fill,.sync-progress.is-offline .sync-progress-fill{animation:none;transform:none;background:#b8c0c6}.sync-progress-streams{padding-left:19px;margin:10px 0 0;line-height:1.65}
