/* Deliberately self-contained: native Element chat, composer, E2EE and dialogs
   remain untouched. This only replaces its navigation when the SDK is ready. */
.dm-inbox-shell {
    --dm-bg: #11161f; --dm-panel: #171e29; --dm-line: #ffffff0d;
    --dm-text: #f0f3f8; --dm-muted: #95a1b4; --dm-accent: #88a9ff;
    position: fixed; z-index: 120; inset: 0 auto 0 0; width: 414px;
    display: grid; grid-template-columns: 76px minmax(0, 1fr); color: var(--dm-text);
    background: var(--dm-panel); border-right: 1px solid var(--dm-line);
    font: 14px/1.4 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}
.dm-inbox-shell *, .dm-mobile-back { box-sizing: border-box; }
.dm-inbox-shell [hidden], .dm-inbox-shell[hidden], .dm-mobile-back[hidden] { display: none !important; }
.dm-inbox-shell button, .dm-inbox-shell input, .dm-inbox-shell select { font: inherit; }
.dm-inbox-shell button { cursor: pointer; }
.dm-inbox-shell :focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 3px; }
.dm-bridge-rail { background: var(--dm-bg); display: flex; flex-direction: column; align-items: center; padding: 18px 8px 14px; gap: 14px; min-height: 0; }
.dm-service { position: relative; flex: none; display: grid; place-items: center; text-decoration: none;
    width: 46px; height: 46px; border-radius: 16px; border: 1px solid #ffffff0b;
    background: #263143; color: #e5ebf5; font-weight: 750 !important; font-size: 20px !important;
    transition: border-radius .12s, background .12s; }
.dm-service:hover { border-radius: 12px; background: #34445e; }
.dm-service[aria-current="page"] { background: #3761a6; border-color: #779df4; box-shadow: 0 0 0 3px #739efa18; }
.dm-service[aria-current="page"]::before { content: ''; position: absolute; left: -13px; top: 10px; height: 26px; width: 4px; border-radius: 0 4px 4px 0; background: #a8c0ff; }
.dm-service-whatsapp { background: #123b31; color: #89ddbc; }
.dm-service-mail { background: #263251; color: #b5c6ff; }
.dm-service-slack { background: #442844; color: #e7b7e7; }
.dm-service-all { background: #426bb6; color: white; border-radius: 15px; }
.dm-service-badge { position: absolute; right: -6px; top: -5px; min-width: 18px; height: 18px;
    padding: 0 4px; border-radius: 9px; background: #9db8ff; color: #12213e; border: 2px solid var(--dm-bg);
    font: 750 10px/14px Inter, sans-serif; text-align: center; }
.dm-service-list { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; padding: 4px 6px; width: 74px; scrollbar-width: none; }
.dm-service-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 18px; gap: 7px; }
.dm-service-name { width: 65px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: 10px; font-weight: 550; color: #aab5c5; }
.dm-rail-rule { width: 28px; height: 1px; background: #ffffff17; }
.dm-rail-bottom { display: flex; flex-direction: column; gap: 8px; }
.dm-service-utility { background: transparent; color: #9aa9bf; border-color: transparent; height: 37px; font-size: 21px !important; }
.dm-chat-column { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.dm-inbox-header { padding: 21px 18px 0; }
.dm-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.dm-heading-row h1 { font: 740 24px/1.25 Inter, -apple-system, sans-serif; letter-spacing: -.6px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-compose { color: #b4c3dc; background: #263145; border: 1px solid #ffffff0c; height: 34px; width: 34px; border-radius: 11px; font-size: 23px !important; flex: none; }
.dm-compose:hover { background: #34445e; }
.dm-inbox-subheading { color: var(--dm-muted); margin: 7px 0 17px; font-size: 11px; }
.dm-picker-line { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.dm-inbox-picker { color: #dbe5f6; background: #222d3e; border: 1px solid #ffffff0d; border-radius: 9px;
    width: 100%; min-width: 0; height: 38px; padding: 0 10px; font-size: 12px !important; font-weight: 650 !important; }
.dm-picker-reset { width: 30px; height: 30px; color: #b9c8df; background: transparent; border: 0; font-size: 24px !important; }
.dm-search-wrap { display: flex; align-items: center; gap: 8px; background: #101720; border: 1px solid #ffffff08; border-radius: 9px; padding: 0 10px; }
.dm-search-icon { color: #8191a7; font-size: 24px; line-height: 1; }
.dm-search { width: 100%; min-width: 0; background: transparent; color: var(--dm-text); height: 37px; border: 0; outline: none !important; font-size: 12px !important; }
.dm-search::placeholder { color: #8592a7; }
.dm-inbox-tabs { display: flex; gap: 7px; margin: 15px 0 14px; }
.dm-tab { border: 1px solid #ffffff12; border-radius: 7px; background: transparent; padding: 5px 9px; font-size: 11px !important; color: #96a4b9; }
.dm-tab[aria-pressed="true"] { background: #314770; border-color: #45618c; color: #dfe9ff; }
.dm-list-info { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px;
    border-top: 1px solid var(--dm-line); border-bottom: 1px solid var(--dm-line); font-size: 10px; color: #9ba8bb; gap: 7px; }
.dm-order-label { font-size: 9px; opacity: .7; }
.dm-conversations { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 5px 8px; scrollbar-width: thin; scrollbar-color: #354459 transparent; }
.dm-chat-item { margin: 2px 0; }
.dm-chat-row { display: flex; gap: 11px; align-items: center; width: 100%; min-height: 85px; padding: 13px 10px;
    color: inherit; background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; }
.dm-chat-row:hover { background: #ffffff06; }
.dm-chat-row[aria-current="page"] { background: #283a57; border-color: #41597a99; }
.dm-chat-avatar { width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center;
    color: #eef4ff; font-size: 15px; font-weight: 700; }
.dm-chat-text { min-width: 0; flex: 1; }
.dm-chat-topline, .dm-chat-bottom { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.dm-chat-title { color: #d4dce9; font-size: 13px; font-weight: 560; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dm-chat-time { color: #77879d; font-size: 9px; white-space: nowrap; flex: none; }
.dm-chat-preview { display: block; color: #8797ae; font-size: 11px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-chat-network { display: block; margin-top: 5px; color: #6f8098; text-transform: uppercase; letter-spacing: .65px; font-size: 8px; font-weight: 650; }
.dm-is-unread .dm-chat-title { color: #f4f7fd; font-weight: 750; }
.dm-is-unread .dm-chat-preview { color: #bccbe1; }
.dm-is-unread .dm-chat-time { color: #a9c0ff; }
.dm-unread-badge { background: #94b0f6; color: #0e2247; border-radius: 9px; min-width: 17px; height: 17px;
    padding: 1px 5px; margin-top: 5px; font-size: 10px; font-weight: 800; text-align: center; }
.dm-inbox-empty { padding: 30px 22px; margin: auto 0; text-align: center; color: var(--dm-muted); }
.dm-empty-icon { color: #57739d; font-size: 35px; }
.dm-inbox-empty h2 { color: #d9e4f7; font-size: 16px; margin: 10px 0 7px; }
.dm-inbox-empty p { font-size: 12px; }
.dm-inbox-empty a { color: #a9c0ff; font-size: 12px; }
.dm-sync-info { border-top: 1px solid var(--dm-line); color: #71839d; padding: 10px 18px; font-size: 9px; }
.dm-sync-info::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 100%; background: #73bca2; margin-right: 6px; }
.dm-sync-info.dm-offline::before { background: #dfa862; }
body.dm-inbox-active .mx_SpacePanel,
body.dm-inbox-active .mx_LeftPanel_outerWrapper,
body.dm-inbox-active .mx_Separator,
body.dm-inbox-active .mx_LeftPanel_panel:has(.mx_LeftPanel_outerWrapper) { display: none !important; }
body.dm-inbox-active .mx_MatrixChat { padding-left: 414px !important; box-sizing: border-box; }
.dm-mobile-back { display: none; }
.dm-restore-inbox { position: fixed; bottom: 14px; right: 18px; z-index: 1300; color: #fff; background: #315fa8;
    border: 1px solid #7498d5; border-radius: 10px; padding: 10px 15px; cursor: pointer; font: 600 13px system-ui; }
@media (max-width: 1000px) and (min-width: 761px) {
    .dm-inbox-shell { width: 354px; grid-template-columns: 65px minmax(0, 1fr); }
    body.dm-inbox-active .mx_MatrixChat { padding-left: 354px !important; }
    .dm-inbox-header { padding-left: 13px; padding-right: 13px; }
    .dm-service-list { width: 64px; }
}
@media (max-width: 760px) {
    .dm-inbox-shell { width: 100%; grid-template-columns: 67px minmax(0, 1fr); z-index: 125; }
    body.dm-inbox-active .mx_MatrixChat { padding-left: 0 !important; padding-top: 45px !important; }
    body.dm-inbox-active:not(.dm-inbox-chat-open) .mx_MatrixChat { visibility: hidden; }
    body.dm-inbox-active.dm-inbox-chat-open .dm-inbox-shell { display: none; }
    body.dm-inbox-active.dm-inbox-chat-open .dm-mobile-back { position: fixed; inset: 0 0 auto; z-index: 130;
        display: block; height: 45px; color: #cddcfa; background: #171e29; text-align: left;
        border: 0; border-bottom: 1px solid #ffffff10; padding: 0 16px; font: 650 14px system-ui; }
    .dm-service-list { width: 66px; }
    .dm-chat-row { min-height: 88px; }
    .dm-chat-title { font-size: 14px; }
    .dm-chat-preview { font-size: 12px; }
    .dm-chat-avatar { width: 45px; height: 45px; }
}
@media (prefers-reduced-motion: reduce) { .dm-service { transition: none; } }
