/* Copyright 2026 24h; SPDX-License-Identifier: AGPL-3.0-only */
/* One 24h visual layer for native contents, authentication and every portal.
   SDK state, semantic controls, focus traps and verification remain native. */
html.h24-brand{--h24-ink:#0b1733;--h24-muted:#56677b;--h24-paper:#fff;--h24-soft:#eef6fa;--h24-line:#cbd7df;--h24-accent:#147ea6;--h24-gradient:linear-gradient(110deg,#e72f15 0%,#804665 48%,#1684b5 100%);background:var(--h24-gradient);font-family:system-ui,sans-serif}
.h24-brand body{--cpd-color-text-primary:var(--h24-ink)!important;--cpd-color-text-secondary:var(--h24-muted)!important;--cpd-color-bg-canvas-default:var(--h24-paper)!important;--cpd-color-bg-subtle-primary:var(--h24-soft)!important;--cpd-color-bg-subtle-secondary:var(--h24-soft)!important;--cpd-color-bg-action-primary-rest:var(--h24-accent)!important;--cpd-color-bg-action-primary-hovered:#106788!important;--cpd-color-bg-action-primary-pressed:#0c506b!important;--cpd-color-bg-action-primary-disabled:#7aaebf!important;--cpd-color-border-interactive-secondary:var(--h24-line)!important;--cpd-color-border-focused:var(--h24-accent)!important;--cpd-color-icon-accent-primary:var(--h24-accent)!important;--cpd-color-text-link-external:var(--h24-accent)!important;color:var(--h24-ink);font-family:system-ui,sans-serif}
.h24-brand body:is(.cpd-theme-dark,.cpd-theme-dark-hc){--h24-ink:#eef5ff;--h24-muted:#b8c7d8;--h24-paper:#17243b;--h24-soft:#21344f;--h24-line:#445b76;--h24-accent:#55b7de;color-scheme:dark}
.h24-brand :is(.mx_Dialog,.mx_ContextualMenu,.mx_BaseCard,.mx_RoomView,.mx_RoomHeader,.mx_RoomHeader_wrapper,.mx_MessageComposer,.mx_Toast){font-family:system-ui,sans-serif;color:var(--h24-ink);background-color:var(--h24-paper)}
.h24-brand :is(.mx_Dialog_wrapper,.mx_Dialog_wrapperStatic){z-index:2147483647}
.h24-brand .mx_Dialog_background{background:rgba(11,23,51,.48);backdrop-filter:blur(3px)}
.h24-brand .mx_Dialog_border{border:1px solid var(--h24-line)!important;border-radius:20px!important;background:var(--h24-paper)!important;padding:0!important;box-shadow:0 24px 70px #040e2633;overflow:hidden;max-width:calc(100vw - 24px);box-sizing:border-box}
.h24-brand .mx_Dialog{border-radius:19px!important;background:var(--h24-paper)!important;color:var(--h24-ink)!important;box-sizing:border-box;max-width:100%;min-width:0}
.h24-brand :is(.mx_Dialog_title,.mx_Dialog_content,.mx_SettingsTab_heading,.mx_SettingsTab_subheading){color:var(--h24-ink)}
.h24-brand .mx_Dialog_cancelButton{border-radius:50%;background-color:var(--h24-soft);min-width:36px;min-height:36px}
.h24-brand :is(.mx_ContextualMenu,.mx_Toast){border:1px solid var(--h24-line);border-radius:12px;box-shadow:0 12px 32px #040e2629;overflow:hidden}
.h24-brand :is(.mx_AccessibleButton_kind_primary,.mx_AccessibleButton_kind_primary_outline,.mx_AccessibleButton_kind_secondary,.mx_AccessibleButton_kind_danger){border-radius:10px;min-height:40px;box-sizing:border-box}
.h24-brand .mx_AccessibleButton_kind_primary{background:var(--h24-accent);color:#fff}
.h24-brand :is(.mx_Field input,.mx_Field select,.mx_Field textarea){border-radius:9px;background:var(--h24-paper);color:var(--h24-ink);border-color:var(--h24-line)}
.h24-brand :is(.mx_TabbedView_tabLabel:hover,.mx_TabbedView_tabLabel_active){background:var(--h24-soft);color:var(--h24-ink)!important;border-radius:10px}
.h24-brand .mx_AuthPage{background:var(--h24-gradient)!important;background-image:var(--h24-gradient)!important;min-height:100dvh;box-sizing:border-box;overflow:auto}
.h24-brand .mx_AuthPage_modal{background:var(--h24-paper)!important;color:var(--h24-ink)!important;border:1px solid var(--h24-line);border-radius:20px;box-shadow:0 24px 70px #040e2633;overflow:hidden;max-width:calc(100% - 24px);box-sizing:border-box}
.h24-brand :is(.mx_AuthPage_modalContent,.mx_AuthPage_modalContent h1,.mx_DefaultWelcome h1){color:var(--h24-ink)!important}
.h24-brand :is(.mx_AuthFooter,.mx_AuthFooter a){color:#fff}
.h24-brand :is(.mx_AuthPage h1,.mx_DefaultWelcome h1){font-family:system-ui,sans-serif;letter-spacing:-.025em}
.h24-brand .mx_AuthHeaderLogo img{max-width:150px;max-height:110px;object-fit:contain}
.h24-brand :is(.mx_AuthPage_modal .mx_AccessibleButton,.mx_DefaultWelcome_buttons>a){border-radius:10px}
.h24-standalone :is(.mx_SpacePanel,.mx_LeftPanel_outerWrapper,.mx_SpacePanel_resizeHandle,.mx_Separator){display:none!important}
.h24-standalone .mx_RoomView_wrapper{width:100%;flex:1;min-width:0}
.h24-standalone-ready .mx_RoomView_wrapper:not(:has(.h24-matrix-desktop)){visibility:hidden}
.h24-standalone .h24-matrix-desktop{z-index:auto}
.h24-standalone .h24-matrix-toolbar{z-index:10000}
.h24-standalone :is(.h24-matrix-dock,.h24-matrix-error,.h24-matrix-icon-menu,.h24-matrix-buddy-menu){z-index:10001}
.h24-standalone .h24-view-zoom{z-index:10002}
.h24-standalone .h24-matrix-toolbar .h24-matrix-brand:after{content:'Chat';font-size:15px;font-weight:750;margin-left:8px}
.h24-standalone .h24-matrix-window .wb-body{background:var(--h24-paper)}
.h24-brand .mx_UserSettingsDialog{--cpd-color-bg-canvas-default:var(--h24-paper)}
.h24-brand .mx_UserSettingsDialog .mx_SettingsDialog_content{border-top:1px solid var(--h24-line)}
.h24-brand .mx_UserSettingsDialog .mx_TabbedView_tabLabels{background:var(--h24-soft)}
.h24-brand .mx_UserSettingsDialog .mx_TabbedView_tabLabel_active{background:var(--h24-paper)}
.h24-brand .mx_UserSettingsDialog .mx_Dialog_header{background:var(--h24-paper)}
@media(max-width:760px){
 .h24-brand .mx_Dialog_border{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:14px!important}
 .h24-brand .mx_Dialog{max-height:calc(100dvh - 18px);border-radius:13px!important;overflow:auto}
 .h24-brand .mx_UserSettingsDialog.mx_Dialog{overflow:hidden}
 .h24-brand .mx_AuthPage_modal{margin:16px auto;width:calc(100% - 24px)!important}
 .h24-brand .mx_AuthPage_modalContent{width:100%;min-width:0;padding:24px 20px;box-sizing:border-box}
 .h24-brand .mx_AuthBody{width:100%;min-width:0;box-sizing:border-box}
 .h24-standalone .h24-matrix-toolbar .h24-matrix-brand:after{display:none}
}
@media(prefers-reduced-motion:reduce){.h24-brand .mx_Dialog_background{backdrop-filter:none}}
.h24-brand .mx_Toast_toast{background:var(--h24-paper);color:var(--h24-ink);border:1px solid var(--h24-line);border-radius:14px;box-shadow:0 12px 32px #040e2629;padding:18px;box-sizing:border-box}
.h24-brand .mx_Toast_toast:before,.h24-brand .mx_Toast_toast:after{display:none}
.h24-brand .mx_ToastContainer{left:auto;right:16px;top:64px;max-width:calc(100vw - 32px);width:340px}
.h24-brand .mx_Toast_body{color:var(--h24-muted);font-family:system-ui,sans-serif}
.h24-brand .mx_Toast_title{font-family:system-ui,sans-serif;color:var(--h24-ink);font-weight:700}
.h24-brand .h24-matrix-desktop{font-family:system-ui,sans-serif}
.h24-brand .h24-matrix-desktop :is(button,input,select,a,p,h1,h2,h3,span){font-family:inherit}
/* The pinned welcome/login components contain a Compound glass wrapper.
   The 24h card owns the surface; a second fixed-width glass frame must not. */
.h24-brand .mx_AuthPage_modalContent>[class*="_glass_"]{width:100%;max-width:100%;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box;backdrop-filter:none}
.h24-brand .mx_AuthPage_modalContent>[class*="_glass_"]:before,.h24-brand .mx_AuthPage_modalContent>[class*="_glass_"]:after{display:none}
.h24-brand :is(.mx_Welcome,.mx_DefaultWelcome){width:100%!important;max-width:100%;min-width:0;box-sizing:border-box}
.h24-brand .mx_Welcome{padding:28px 24px 20px}
.h24-brand .mx_DefaultWelcome_buttons{width:100%;min-width:0}
.h24-brand .mx_DefaultWelcome_buttons>a{width:100%;max-width:100%;box-sizing:border-box}
.h24-brand .mx_DefaultWelcome h1{overflow-wrap:anywhere;font-size:24px;line-height:1.3}
.h24-brand .mx_DefaultWelcome_logo img{width:120px;height:120px;max-width:50vw;object-fit:contain}
@media(max-width:540px){.h24-brand .mx_Welcome{padding:12px 0}.h24-brand .mx_DefaultWelcome h1{font-size:22px}.h24-brand .mx_AuthFooter{display:flex;justify-content:center;flex-wrap:wrap;gap:16px;padding:12px 20px;box-sizing:border-box}}

.h24-matrix-invitation{display:block;color:#147ea6;font-size:12px;font-weight:600}
.h24-brand .mx_AuthPage_modalContent>[class*="_glass_"]{outline:0!important}
.h24-brand .mx_SpaceCreateMenu_wrapper .mx_ContextualMenu{position:fixed!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%);width:min(480px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto}
.h24-brand .mx_SpaceCreateMenu_wrapper .mx_ContextualMenu>*{min-width:0;max-width:100%;box-sizing:border-box}
.h24-space-close{position:absolute;top:10px;right:10px;min-width:36px;min-height:36px;border:0;border-radius:50%;background:var(--h24-soft);color:var(--h24-ink);cursor:pointer;font:22px/1 system-ui,sans-serif}
.h24-brand .mx_SpaceCreateMenu_wrapper h2{padding-right:32px}
.h24-brand body{background:transparent!important}
.h24-brand .mx_AuthPage{background:transparent!important;background-image:none!important}
.h24-brand .mx_AuthFooter{background:none!important}
/* Authentication includes the newer native server picker as well as login.
   Both share the single 24h card, without nested Element glass surfaces. */
.h24-brand .mx_AuthPage [class*="_glass_"]{background:none!important;box-shadow:none!important;border:0!important;border-radius:0!important;outline:0!important;min-width:0;max-width:100%;box-sizing:border-box}
.h24-brand .mx_AuthPage_modalBlur{display:none!important}
.h24-brand .mx_AuthPage_modalContent{background:var(--h24-paper)!important}
.h24-brand .mx_AuthBody{background:transparent}

/* The native stacked-toast decoration is not a second 24h surface. */
.h24-brand .mx_ToastContainer{display:block;background:transparent;border:0;box-shadow:none}
.h24-brand .mx_ToastContainer::before,.h24-brand .mx_ToastContainer::after{display:none!important;content:none!important}
.h24-brand .mx_Dialog_cancelButton{width:36px;height:36px;min-width:36px;min-height:36px;box-sizing:border-box;padding:0;display:grid;place-items:center}
.h24-brand .mx_Dialog_cancelButton svg{width:20px;height:20px;vertical-align:middle}
/* Standard dialogs keep a readable content width. Account and integration
   workspaces retain their separate larger layout. */
.h24-brand .mx_Dialog_wrapper:not(.mx_IntegrationManager) .mx_Dialog_border:not(:has(.mx_UserSettingsDialog)){width:min(704px,calc(100% - 24px));max-width:calc(100vw - 24px)}

.h24-account-background-frame{position:fixed;left:-10000px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0}
.h24-account-background body{visibility:hidden}
.h24-accounts-dialog{position:fixed;inset:0;display:grid;place-items:center;z-index:2147483647}
.h24-accounts-dialog>.mx_Dialog_background{position:absolute;inset:0}
.h24-accounts-card{position:relative;width:min(40rem,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box;padding:1.25rem;border:1px solid var(--h24-line,#cbd7df);border-radius:18px;background:var(--h24-paper,#fff);color:var(--h24-ink,#101d3a)}
.h24-accounts-card header{display:flex;align-items:center;justify-content:space-between;gap:1rem}.h24-accounts-card h2{margin:.25rem 0;font-size:1.35rem}.h24-accounts-card p{line-height:1.5}
.h24-accounts-card button{font:inherit;color:inherit;cursor:pointer;min-height:44px;border:1px solid var(--h24-line,#cbd7df);border-radius:12px;padding:.6rem .9rem;background:var(--h24-paper,#fff)}
.h24-accounts-card button:focus-visible{outline:3px solid var(--h24-accent,#147ea6);outline-offset:2px}.h24-accounts-list{display:grid;gap:.65rem;margin:1rem 0}
.h24-accounts-card .h24-account-row{display:grid;text-align:left;gap:.25rem;width:100%;overflow-wrap:anywhere}.h24-account-row[aria-current=true]{border-color:var(--h24-accent,#147ea6);background:var(--h24-soft,#eef6fa)}.h24-account-row small,.h24-account-row span{font-size:.85rem}
.h24-accounts-card .h24-account-add{background:var(--h24-accent,#147ea6);color:#fff}.h24-accounts-actions{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--h24-line,#cbd7df)}
.h24-account-call-list{position:fixed;top:4rem;left:50%;transform:translateX(-50%);width:min(32rem,calc(100vw - 24px));z-index:2147483646;display:grid;gap:.5rem}.h24-account-call-list button{font:inherit;padding:1rem;background:#147ea6;color:white;border:1px solid #fff;border-radius:12px;box-shadow:0 4px 24px #101d3a44;cursor:pointer}

.h24-accounts-dialog>.mx_Dialog_background{z-index:0!important}.h24-accounts-dialog>.h24-accounts-card{z-index:1!important;margin:0}

.h24-auth-accounts{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1rem}.h24-auth-accounts button{font:inherit;color:var(--h24-accent,#147ea6);background:transparent;border:1px solid var(--h24-line,#cbd7df);border-radius:12px;padding:.6rem;min-height:44px}

.h24-account-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem}.h24-accounts-card .h24-account-remove{color:var(--h24-danger,#b42318)}

/* Aggregate unread count; names and drafts stay separate from credentials. */
.h24-account-tool,.h24-account-row{position:relative}.h24-account-unread{background:#cf231b;color:#fff;border:2px solid #fff;border-radius:99px;min-width:22px;height:22px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;font:700 12px/1 system-ui;position:absolute;right:-3px;top:-3px;pointer-events:none}.h24-account-unread[hidden]{display:none}.h24-account-row .h24-account-unread{right:10px;top:10px}.h24-account-row{padding-right:48px!important}

/* Account navigation replaces the unrelated app navigation in standalone Chat. */
.h24-matrix-toolbar>.h24-account-bar{flex:1;min-width:0}.h24-account-bar{display:flex;align-items:center;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;padding:7px 4px;scrollbar-width:thin;flex-shrink:0;max-width:100%}.h24-account-tab{position:relative;display:flex;align-items:center;gap:8px;flex:0 0 auto;max-width:190px;min-height:44px;padding:6px 12px;border:1px solid transparent;border-radius:24px;background:transparent;color:var(--h24-ink);font:inherit;cursor:pointer}.h24-account-tab[aria-pressed=true],.h24-account-logo-selected{background:var(--h24-soft)!important;box-shadow:inset 0 0 0 2px #1684b5}.h24-account-tab-name{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600}.h24-account-tab-add{font-size:25px;min-width:42px;justify-content:center}.h24-account-identity{position:relative;width:32px;height:32px;flex:0 0 32px}.h24-account-avatar,.h24-account-initial{width:32px;height:32px;border-radius:50%;object-fit:cover}.h24-account-initial{display:flex;align-items:center;justify-content:center;background:var(--h24-soft);color:var(--h24-ink);font-weight:700}.h24-provider-logo{width:18px;height:18px;object-fit:contain;vertical-align:middle;background:#fff;border-radius:50%;padding:2px;flex:0 0 18px}.h24-account-identity>.h24-provider-logo{position:absolute;right:-5px;bottom:-3px;box-shadow:0 0 0 1px #d3e0e7}.h24-account-all>img{width:34px;height:34px;object-fit:contain}.h24-inbox-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;padding:2px 6px;border-radius:20px;background:#cf231b;color:white;font:700 12px/18px system-ui;flex-shrink:0}.h24-account-inbox{background:var(--h24-paper);padding:16px;min-width:0;height:100%;overflow:auto;box-sizing:border-box;color:var(--h24-ink)}.h24-inbox-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.h24-inbox-actions h2{font-size:22px;margin:8px auto 8px 0}.h24-inbox-actions button,.h24-inbox-filters button{border:1px solid var(--h24-line);border-radius:24px;padding:8px 14px;background:transparent;color:inherit;font:inherit;cursor:pointer}.h24-inbox-filters{display:flex;gap:6px;overflow-x:auto;padding:3px 0 12px}.h24-inbox-filters button{white-space:nowrap}.h24-inbox-filters button[aria-pressed=true]{background:var(--h24-soft);color:var(--h24-accent);border-color:#1684b5}.h24-inbox-row{display:flex;align-items:stretch;border-bottom:1px solid var(--h24-line);min-width:0}.h24-inbox-open{display:flex;align-items:center;gap:12px;min-width:0;flex:1;background:transparent;border:0;color:inherit;text-align:left;padding:14px 8px;cursor:pointer;font:inherit}.h24-inbox-open:hover{background:var(--h24-soft)}.h24-inbox-room-symbol{flex:0 0 36px;width:36px;height:36px;border-radius:50%;background:var(--h24-soft);display:flex;align-items:center;justify-content:center;font-size:23px}.h24-inbox-room-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.h24-inbox-room-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.h24-inbox-room-name small{display:flex;align-items:center;gap:5px;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--h24-muted)}.h24-inbox-open time{font-size:11px;color:var(--h24-muted)}.h24-inbox-new-window{border:0;background:transparent;color:inherit;min-width:40px;cursor:pointer;font-size:22px}.h24-inbox-connecting{font-size:13px;color:var(--h24-muted)}
@media(max-width:760px){.h24-matrix-toolbar{gap:5px!important}.h24-account-tab{padding:5px 8px;max-width:140px}.h24-account-tab-name{max-width:78px}.h24-matrix-toolbar .h24-account-bar{min-width:70px}.h24-matrix-header-tools{gap:3px!important}.h24-account-inbox{padding:10px}.h24-inbox-actions button{font-size:12px;padding:7px 9px}.h24-inbox-open{gap:8px;padding:12px 3px}.h24-inbox-open time{display:none}}

/* Desktop accounts are compact pictorial tabs, not list-filter labels. */
.h24-account-tab:not(.h24-account-all):not(.h24-account-tab-add){width:52px;max-width:52px;padding:7px 10px;justify-content:center}.h24-account-tab>.h24-inbox-count{position:absolute;right:-2px;top:-2px;min-width:18px;padding:0 4px;font-size:10px;line-height:18px}.h24-account-tab-name{display:none}.h24-matrix-symbol{position:relative}.h24-matrix-symbol>.h24-desktop-provider{position:absolute;right:-4px;bottom:-3px;width:20px;height:20px;object-fit:contain;background:white;border-radius:50%;padding:2px;box-shadow:0 0 0 1px #cad8e1}

/* Keep account-owned room pictures stable across desktop projections. */
.h24-desktop-room-picture { display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0; }
.h24-room-picture { display:block;width:100%;height:100%;object-fit:cover;border-radius:50%; }
.h24-inbox-room-symbol { overflow:hidden;flex-shrink:0; }

.h24-desktop-room-picture>svg { width:100%;height:100%; }
.h24-matrix-symbol .h24-room-picture { border-radius:50%; }

.h24-room-initial{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:50%;font:600 22px/1 system-ui;color:#233653;text-shadow:none;box-sizing:border-box;}
.h24-inbox-room-symbol .h24-room-initial{font-size:18px;}

/* BaseDialog's native viewport width must fit inside the themed padded dialog. */
.h24-brand .mx_Dialog > .mx_Dialog_fixedWidth {
 width:100%;max-width:100%;min-width:0;box-sizing:border-box;
}
