/* Compound composes its font shorthands on :root and again on each theme
   owner. Set the family at both origins, including menus rendered in portals. */
html:root, :root [class*="cpd-theme-"][class*="cpd-theme-"] {
    --cpd-font-family-sans: var(--mz-font);
    --cpd-font-weight-regular: 400;
    --cpd-font-weight-medium: 400;
    --cpd-font-weight-semibold: 700;
}
html:root:lang(en), :root:lang(en) [class*="cpd-theme-"][class*="cpd-theme-"] {
    --cpd-font-weight-medium: 500;
    --cpd-font-weight-semibold: 600;
}
body, body :is(button, input, select, option, optgroup, textarea, [role="combobox"], [role="tooltip"],
    .mx_Dialog, .mx_ContextualMenu, .mx_Toast_toast, .mx_CompleteSecurityBody, [data-radix-menu-content]),
body .mx_ExportDialog .mx_ExportDialog_subheading,
body .mx_FormattingButtons_Tooltip_KeyboardShortcut kbd,
body .maplibregl-map, body .mx_MessageComposer [contenteditable="true"],
:is(.mx_RoomView,.mx_RightPanel,.mx_Dialog) .markdown-body {
    font-family: var(--mz-font);
}
.mx_AuthPage {
    --mozz-paper: #f2f5fa;
    --mozz-ink: #142032;
    --mozz-text: #526077;
    --mozz-blue: #315be8;
    --mozz-blue-on: #fff;
    --mozz-border: #c7d0e0;
    --mozz-hover: #e8edff;
}
html:lang(fa) .mx_AuthPage,
html:lang(fa) .mx_AuthPage .mx_WelcomePage_body[dir],
html:lang(ar) .mx_AuthPage,
html:lang(he) .mx_AuthPage {
    direction: rtl;
}
body .mx_AuthPage {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    width: 100%;
    isolation: isolate;
    overflow: auto;
    color: var(--mozz-ink);
    background: var(--mozz-paper) !important;
    font-family: var(--mz-font);
    text-align: start;
}
body .mx_AuthPage::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset-block: 16px;
    inset-inline-end: 16px;
    width: calc(49% - 16px);
    border-radius: var(--mz-radius-dialog);
    background: #142032 url("./assets/prism-portal.webp") center 55% / cover no-repeat;
}
body .mx_AuthPage .mx_AuthPage_modal {
    box-sizing: border-box;
    position: static !important;
    width: 51%;
    min-width: 0;
    max-width: none;
    max-height: none;
    height: auto;
    overflow: visible;
    margin: auto 0;
    padding: 56px clamp(32px, 6.7vw, 132px) 36px;
    border: 0;
    border-radius: 0;
    color: var(--mozz-ink);
    box-shadow: none;
    background: transparent !important;
}
body .mx_AuthPage_modal .mx_AuthPage_modalBlur { display: none; }
body .mx_AuthPage_modal .mx_AuthPage_modalContent {
    display: block !important;
    width: 100%;
    max-width: 470px;
    min-width: 0;
    margin-inline: auto;
    overflow: visible;
    outline: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}
body .mx_AuthPage_modalContent > :has(> .mx_Welcome),
body .mx_AuthPage_modalContent .mx_Welcome,
body .mx_AuthPage_modalContent .mx_WelcomePage,
body .mx_AuthPage_modalContent .mx_WelcomePage_body {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
    margin: 0;
    align-items: stretch;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: start;
    backdrop-filter: none;
    outline: none;
}
body .mx_WelcomePage_body > div > img {
    display: block;
    width: 122px;
    height: auto;
    margin: 0 0 clamp(37px, 6vh, 70px);
}
body .mx_WelcomePage_body h1 {
    margin: 0;
    font: 700 clamp(48px, 5.1vw, 82px)/1.06 var(--mz-font);
    letter-spacing: -.057em;
    color: var(--mozz-ink);
    text-align: start;
    text-wrap: balance;
}
body .mx_WelcomePage_body h1 strong {
    display: block;
    font-weight: inherit;
    color: var(--mozz-blue);
}
body .mx_WelcomePage_body p {
    max-width: 37ch;
    margin: 22px 0 0;
    color: var(--mozz-text);
    font: 400 clamp(16px, 1.16vw, 18px)/1.65 var(--mz-font);
    text-align: start;
}
body .mx_WelcomePage_body :is(h1, p, p > a) > span:nth-child(2) { display: none; }
html:lang(fa) .mx_WelcomePage_body :is(h1, p, p > a) > span:first-child { display: none; }
html:lang(fa) .mx_WelcomePage_body :is(h1, p, p > a) > span:nth-child(2) { display: inline; }
html:lang(fa) .mx_WelcomePage_body h1 {
    font-weight: 700;
    line-height: 1.34;
    letter-spacing: normal;
}
html:lang(fa) .mx_WelcomePage_body p { line-height: 1.95; }
body .mx_WelcomePage_body > div > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    margin-block: 32px 0;
}
body .mx_WelcomePage_body > div > div a {
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    min-height: 51px;
    padding: 10px 15px;
    border: 1px solid var(--mozz-border);
    border-radius: var(--mz-radius-control);
    background: transparent;
    color: var(--mozz-ink);
    text-align: center;
    text-decoration: none;
    font: 700 16px/1.45 var(--mz-font);
}
body .mx_WelcomePage_body > div > div a:first-child,
body .mx_AuthBody button.mx_Login_fullWidthButton {
    color: var(--mozz-blue-on);
    border-color: var(--mozz-blue);
    background: var(--mozz-blue);
    box-shadow: 0 4px 11px rgb(36 58 150 / 17%);
}
body .mx_WelcomePage_body > div > div a:first-child::after {
    content: "";
    width: 7px;
    height: 7px;
    border-block-start: 2px solid;
    border-inline-end: 2px solid;
    transform: rotate(45deg);
}
html:lang(fa) .mx_WelcomePage_body > div > div a:first-child::after,
html:lang(ar) .mx_WelcomePage_body > div > div a:first-child::after,
html:lang(he) .mx_WelcomePage_body > div > div a:first-child::after { transform: rotate(-45deg); }
body .mx_WelcomePage_body > div > div a:hover { background: var(--mozz-hover); }
body .mx_WelcomePage_body > div > div a:first-child:hover,
body .mx_AuthBody button.mx_Login_fullWidthButton:hover { background: #284ccc; }
body .mx_WelcomePage_body > div > p:last-child {
    margin-block-start: 22px;
    font-size: 14px;
}
body .mx_WelcomePage_body p a {
    color: var(--mozz-text);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--mozz-border);
}
body .mx_WelcomePage_body p a:hover { color: var(--mozz-blue); }
body .mx_AuthPage .mx_AuthFooter {
    box-sizing: border-box;
    position: static;
    width: 51%;
    margin: 0;
    padding: 8px 24px 22px;
    min-height: 42px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    flex-wrap: wrap;
    color: var(--mozz-text);
    background: none;
    font: 400 12px/1.7 var(--mz-font);
}
body .mx_AuthFooter a { margin: 0; color: inherit; }
body .mx_AuthPage :is(a,button,[role=button]):focus-visible {
    outline: 3px solid var(--mozz-blue);
    outline-offset: 3px;
}
body .mx_AuthPage_modalContent .mx_AuthHeader {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin-block-end: 32px;
}
body .mx_AuthPage .mx_AuthHeaderLogo { display: block; padding: 0; margin: 0; }
body .mx_AuthPage .mx_AuthHeaderLogo img { display: block; width: 110px; height: auto; max-height: none; }
body .mx_AuthPage_modalContent .mx_AuthBody {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
    color: var(--mozz-ink);
    background: transparent;
    font-family: var(--mz-font);
    text-align: start;
}
body .mx_AuthPage .mx_AuthBody h1 {
    color: var(--mozz-ink);
    margin-block: 0 23px;
    font: 700 clamp(30px, 3.3vw, 52px)/1.28 var(--mz-font);
    letter-spacing: -.035em;
}
html:lang(fa) .mx_AuthPage .mx_AuthBody h1 { letter-spacing: normal; }
body .mx_AuthBody .mx_ServerPicker {
    border: 1px solid var(--mozz-border);
    border-radius: var(--mz-radius-card);
    padding: 16px 18px;
    margin-block-end: 18px;
    color: var(--mozz-ink);
}
body .mx_AuthBody .mx_ServerPicker h2 { font-family: inherit; color: var(--mozz-ink); }
body .mx_AuthBody .mx_ServerPicker_server { color: var(--mozz-ink); }
body .mx_AuthBody .mx_ServerPicker_change { color: var(--mozz-blue); }
body .mx_AuthBody button.mx_Login_fullWidthButton {
    min-height: 48px;
    border-radius: var(--mz-radius-control);
    font-family: var(--mz-font);
    font-weight: 700;
}
body .mx_AuthPage .mx_AuthBody_language { margin: 0; align-self: auto; }
body .mx_AuthPage .mx_Welcome > .mx_LanguageDropdown {
    align-self: flex-start;
    margin: 20px 0 0;
    width: max-content;
    min-width: 104px;
    max-width: 100%;
}
body .mx_AuthPage .mx_LanguageDropdown .mx_Dropdown_input {
    border-color: var(--mozz-border);
    color: var(--mozz-text);
    background-color: var(--mozz-paper);
    border-radius: var(--mz-radius-control);
    font-family: var(--mz-font);
}
body:is(.cpd-theme-dark, .cpd-theme-dark-hc) .mx_AuthPage {
    --mozz-paper: #111927;
    --mozz-ink: #f1f4ff;
    --mozz-text: #c4cedf;
    --mozz-blue: #aebfff;
    --mozz-blue-on: #152044;
    --mozz-border: #45536b;
    --mozz-hover: #29344d;
}
body:is(.cpd-theme-dark, .cpd-theme-dark-hc) .mx_AuthPage :is(.mx_AuthHeaderLogo img,.mx_WelcomePage_body > div > img) {
    background-color: #f8f8fc;
    border-radius: var(--mz-radius-small);
    padding: 3px 6px;
}
body:is(.cpd-theme-dark, .cpd-theme-dark-hc) .mx_AuthPage :is(.mx_WelcomePage_body > div > div a:first-child:hover, button.mx_Login_fullWidthButton:hover) { background: #c8d4ff; }

@media (max-width: 760px) {
    body .mx_AuthPage { display: flex; justify-content: start; }
    body .mx_AuthPage::before {
        position: relative;
        flex: 0 0 auto;
        inset: auto;
        width: calc(100% - 24px);
        height: clamp(125px, 21vh, 190px);
        margin: 12px auto 0;
        border-radius: var(--mz-radius-card);
        background-position: center 67%;
    }
    body .mx_AuthPage .mx_AuthPage_modal {
        width: 100%;
        padding: 27px max(24px, 7vw) 17px;
        margin: auto 0;
    }
    body .mx_WelcomePage_body > div > img { width: 96px; margin-bottom: 24px; }
    body .mx_WelcomePage_body h1 { font-size: clamp(37px, 8.7vw, 51px); }
    body .mx_WelcomePage_body h1 strong { display: inline; }
    body .mx_WelcomePage_body p { margin-top: 14px; }
    body .mx_WelcomePage_body > div > div { margin-top: 23px; }
    body .mx_AuthPage .mx_AuthFooter { width: 100%; padding: 5px 16px 13px; }
    body .mx_AuthPage_modalContent .mx_AuthHeader { margin-bottom: 22px; }
    body .mx_AuthPage .mx_Welcome > .mx_LanguageDropdown { margin-top: 13px; }
}
@media (max-width: 380px) {
    body .mx_AuthPage .mx_AuthPage_modal { padding-inline: 19px; }
    body .mx_WelcomePage_body > div > div a { padding-inline: 8px; }
}
@media (forced-colors: active) {
    body .mx_WelcomePage_body a { border: 1px solid ButtonText; }
    body .mx_WelcomePage_body h1 strong { color: CanvasText; }
}

/* Home keeps the conversation list first in the visual reading order. */
.mx_MatrixChat main.mozz-home {
    --home-paper: var(--mz-paper);
    --home-canvas: var(--mz-canvas);
    --home-ink: var(--mz-ink);
    --home-dim: var(--mz-muted);
    --home-line: var(--mz-line);
    --home-blue: var(--mz-accent);
    --home-tint: var(--mz-tint);
    container: mozz-home / inline-size;
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
    margin: 0;
    font-family: var(--mz-font);
    color: var(--home-ink);
    background: var(--home-canvas);
    text-align: start;
}
:is(.cpd-theme-dark,.cpd-theme-dark-hc) .mx_MatrixChat main.mozz-home {
    --home-canvas: #111927;
    --home-paper: #1a2435;
    --home-ink: #f2f5ff;
    --home-dim: #c0cce0;
    --home-line: #38475e;
    --home-blue: #b0c2ff;
    --home-tint: #293650;
}
html:is(:lang(fa),:lang(ar),:lang(he),:lang(ur)) .mozz-home__inner { direction: rtl; }
.mozz-home__inner {
    box-sizing: border-box;
    display: grid;
    width: min(100%,1280px);
    margin-inline: auto;
    padding: clamp(20px,4.4cqi,60px);
    grid-template-columns: minmax(0,1.5fr) minmax(190px,.86fr);
    grid-template-areas: "hero hero" "recent actions";
    gap: clamp(18px,3.8cqi,48px) clamp(16px,2.6cqi,34px);
    align-items: start;
}
.mozz-home__hero {
    grid-area: hero;
    display: grid;
    grid-template-columns: minmax(0,1.18fr) minmax(0,1fr);
    min-height: clamp(200px,28cqi,315px);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: var(--mz-radius-dialog);
    background: var(--home-paper);
}
.mozz-home__intro { align-self: center; padding: clamp(23px,3.7cqi,53px); min-width: 0; }
.mozz-home__profile { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--home-dim); font-size: 14px; }
.mozz-home__profile .mx_MiniAvatarUploader { flex: none; }
.mozz-home__profile bdi { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mozz-home__title {
    margin: clamp(16px,2cqi,24px) 0 6px;
    font: 700 clamp(32px,5.2cqi,62px)/1.08 var(--mz-font);
    letter-spacing: -.055em; text-wrap: balance; color: var(--home-ink);
}
:is(.mozz-home__inner:dir(rtl), html:is(:lang(fa),:lang(ar),:lang(he),:lang(ur)) .mozz-home__inner) .mozz-home__title { letter-spacing: normal; line-height: 1.34; }
.mozz-home__subtitle { margin: 0; color: var(--home-dim); font-size: clamp(14px,1.65cqi,17px); line-height: 1.75; max-inline-size: 36ch; }
.mozz-home__art { width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: 330px; object-fit: cover; align-self: stretch; object-position: 57% 50%; }
.mozz-home__recent { grid-area: recent; min-width: 0; }
.mozz-home__section-title { color: var(--home-ink); font: 700 clamp(19px,2.5cqi,29px)/1.45 var(--mz-font); margin: 0 0 14px; }
.mozz-home__list { list-style: none; margin: 0; padding: 4px clamp(10px,1.4cqi,18px); background: var(--home-paper); border: 1px solid var(--home-line); border-radius: var(--mz-radius-card); }
.mozz-home__list > li + li { border-block-start: 1px solid var(--home-line); }
.mozz-home__row {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: start;
    padding: 10px 6px; min-height: 62px; cursor: pointer;
    border: 0; border-radius: var(--mz-radius-small); background: transparent; color: var(--home-ink);
    font: 700 15px/1.5 var(--mz-font);
}
.mozz-home__name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.mozz-home__time { margin-inline-start: auto; white-space: nowrap; flex: none; color: var(--home-dim); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.mozz-home__row::after { content: ""; width: 7px; height: 7px; flex: none; border-block-start: 1.5px solid; border-inline-end: 1.5px solid; transform: rotate(45deg); color: var(--home-dim); margin-inline: 3px; }
:is(.mozz-home__inner:dir(rtl), html:is(:lang(fa),:lang(ar),:lang(he),:lang(ur)) .mozz-home__inner) .mozz-home__row::after { transform: rotate(-45deg); }
.mozz-home__empty {
    border: 1px dashed var(--home-line); border-radius: var(--mz-radius-card); background: var(--home-paper);
    display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
    margin: 0; padding: clamp(20px,3cqi,36px); color: var(--home-dim); font: 400 15px/1.7 var(--mz-font);
}
.mozz-home__empty::before { content: ""; display: block; width: 64px; height: 43px; background: url("./assets/message-fold.svg") center/contain no-repeat; }
.mozz-home__actions { grid-area: actions; display: grid; gap: 9px; min-width: 0; padding-block-start: clamp(42px,4.9cqi,55px); }
.mx_MatrixChat .mozz-home__action {
    display: flex; align-items: center; gap: 12px; min-height: 54px;
    text-align: start; border: 1px solid var(--home-line); border-radius: var(--mz-radius-control);
    padding: 10px 15px; background: var(--home-paper); color: var(--home-ink);
    cursor: pointer; font: 700 15px/1.55 var(--mz-font);
}
.mx_MatrixChat .mozz-home__action > svg { flex: none; color: var(--home-blue); width: 21px; height: 21px; }
.mx_MatrixChat .mozz-home__action--primary { background: #3155d4; color: white; border-color: #3155d4; }
.mx_MatrixChat .mozz-home__action--primary svg { color: inherit; }
@media (hover: hover) {
    .mozz-home__row:hover,.mx_MatrixChat .mozz-home__action:hover { background: var(--home-tint); }
    .mx_MatrixChat .mozz-home__action--primary:hover { background: #2545be; }
}
.mozz-home :is(button,[role=button]):focus-visible { outline: 3px solid var(--home-blue); outline-offset: 2px; }
.mozz-room-nav-toggle,.mozz-room-nav-dismiss { display: none; }
@container mozz-home (max-width:720px) {
    .mozz-home__inner { grid-template-columns: 1fr; grid-template-areas: "hero" "actions" "recent"; gap: 18px; padding: clamp(15px,3.1cqi,25px); }
    .mozz-home__actions { grid-template-columns: repeat(3,minmax(0,1fr)); padding: 0; gap: 7px; }
    .mx_MatrixChat .mozz-home__action { justify-content: center; gap: 8px; padding: 8px; font-size: 13px; }
}
@container mozz-home (max-width:510px) {
    .mozz-home__hero { grid-template-columns: minmax(0,1.85fr) minmax(0,1fr); min-height: 152px; border-radius: var(--mz-radius-card); }
    .mozz-home__intro { padding: 17px; }
    .mozz-home__title { font-size: clamp(23px,6.3cqi,32px); margin: 11px 0 5px; }
    .mozz-home__subtitle { font-size: 13px; line-height: 1.65; }
    .mozz-home__art { max-height: 225px; object-position: 61% 50%; }
    .mozz-home__actions { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .mx_MatrixChat .mozz-home__action { min-height: 44px; }
    .mx_MatrixChat .mozz-home__action--primary { grid-column: 1/-1; }
    .mozz-home__row { min-height: 59px; padding-inline: 3px; gap: 9px; }

}
@media (max-width:700px) {
    .mozz-home__inner > .mozz-room-nav-toggle { grid-area: back; justify-self: start; }
    .mozz-home__inner:has(> .mozz-room-nav-toggle) { grid-template-areas: "back" "hero" "actions" "recent"; }
}
@media (forced-colors: active) {
    .mozz-home__action,.mozz-home__hero,.mozz-home__row { border: 1px solid ButtonText; }
}
@media (prefers-reduced-motion: no-preference) {
    .mozz-home__action,.mozz-home__row { transition: background-color 150ms var(--mz-ease); }
}
/* Cover the initial download, first sync and the native compatibility screen. */
#matrixchat:empty {
    background: #f2f5fa url("./assets/brand-ink.svg") center/116px auto no-repeat;
}
.mx_MatrixChat_splash, body .mx_ErrorView {
    color: #142032; background-color: #f2f5fa;
    --cpd-font-family-sans: var(--mz-font);
    font-family: var(--cpd-font-family-sans);
}
body .mx_ErrorView .mx_ErrorView_container { padding: clamp(20px,4vw,42px); max-width: min(100%,40rem); box-sizing: border-box; background:#fff; border:1px solid #d6deeb; border-radius:var(--mz-radius-card); }
body .mx_ErrorView .mx_ErrorView_logo { width: 64px; height: 64px; object-fit: contain; }
body .mx_LoginSplashView_syncError { max-width: 42ch; padding: 12px 16px; overflow-wrap: anywhere; border-radius: var(--mz-radius-small); }
@media(prefers-color-scheme:dark) { #matrixchat:empty { background-color: #111927; background-image:url("./assets/brand-signature.svg"); } }
:is(.cpd-theme-dark,.cpd-theme-dark-hc) .mx_MatrixChat_splash { background-color:#111927; color:#f2f4ff; }
/* The default Persian layout uses the document direction. English content in a
   Persian conversation and identifiers retain their own native text direction. */
@media (forced-colors: none) {
    .mozz-home__row:active { background:var(--mz-tint); }
    .mx_MatrixChat .mozz-home__action:active { box-shadow:inset 0 0 0 1px var(--mz-accent); }
    .mx_MatrixChat .mozz-home__action--primary:active { background:var(--mz-accent-pressed); }
}
