:root {
  --ink: #18263b;
  --muted: #718097;
  --line: #e3e9f2;
  --canvas: #e7f3fa;
  --panel: #ffffff;
  --panel-soft: #edf7fc;
  --accent: #087aaf;
  --accent-strong: #076692;
  --accent-soft: #dbf1fc;
  --coral: #648fd7;
  --shadow: 0 18px 52px rgba(28, 60, 105, .14);
  --bottom-nav-height: 61px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
.password-screen { max-width: 680px; margin-inline: auto; }
.password-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.password-card fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.password-card .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.password-field { display: grid; gap: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 650; }
.password-field input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--ink); }
.password-field small, .password-logout small { display: block; font-weight: 400; font-size: 12px; line-height: 1.55; color: var(--muted); }
.password-logout { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 22px; cursor: pointer; }
.password-logout input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.password-logout strong { display: block; margin-bottom: 5px; font-size: 14px; }
.password-separation { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--panel-soft); color: var(--muted); }
.password-separation svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
.password-separation p { margin: 0; font-size: 12px; line-height: 1.6; }
.password-status { min-height: 20px; font-size: 13px; line-height: 1.6; color: var(--accent-strong); overflow-wrap: anywhere; }
.password-status.error { color: #bb384d; }
.password-save { width: 100%; justify-content: center; }
.password-save:disabled, .password-card fieldset:disabled { opacity: .6; cursor: default; }
.password-save[hidden] { display: none; }
@media (max-width: 480px) { .password-card { padding: 17px; border-radius: 14px; } }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, .message-pane:focus-visible { outline: 3px solid rgba(52, 120, 212, .3); outline-offset: 2px; }

.app-shell { position: relative; display: grid; grid-template-columns: 292px minmax(420px, 1fr) 286px; grid-template-rows: minmax(0, 1fr); height: 100vh; max-width: 1600px; margin: 0 auto; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.sidebar { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-bottom: var(--bottom-nav-height); background: #fbfcff; }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 18px 17px 14px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; font-size: 20px; border-radius: 12px; background: var(--accent); box-shadow: 0 6px 16px rgba(52,120,212,.24); }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-caption { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; margin-top: 2px; }
.brand-row .icon-button { margin-left: auto; }

.search-box { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0 12px 9px; padding: 0 11px; color: var(--muted); background: var(--panel-soft); border-radius: 9px; }
.sidebar-toolbar { display: flex; align-items: center; gap: 5px; margin: 14px 12px 9px; }
.sidebar-toolbar .search-box { flex: 1; margin: 0; }
.sidebar-title { flex: 1; padding-left: 4px; font-size: 20px; }
.sidebar-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-heading .connection-label { padding-left: 4px; }
.connection-label { color: var(--muted); font-size: 11px; line-height: 1.4; }
.connection-label[hidden] { display: none; }
.connection-label[data-connection-status="server"] { color: var(--blue, #286fb1); }
.corner-search-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.corner-search-button { flex: none; width: 44px; height: 44px; margin-left: auto; }
.corner-search-button svg { width: 22px; height: 22px; }
.corner-search-panel { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; min-width: 0; }
.corner-search-panel[hidden], [data-search-hidden="true"] { display: none !important; }
.corner-search-panel > input { flex: 1; width: 0; min-width: 0; height: 42px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--ink); }
.corner-search-panel > .icon-button { flex: none; width: 44px; height: 44px; }
.sidebar > .corner-search-panel { padding: 0 12px; }
.settings-search-status { margin: 4px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.compose-fab { width: 48px; height: 48px; display: grid; place-items: center; align-self: flex-end; margin: 0 16px 10px 0; border-radius: 50%; color: #fff; background: var(--accent); box-shadow: 0 8px 18px rgba(52,120,212,.28); font-size: 25px; line-height: 1; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.compose-fab:hover { background: var(--accent-strong); box-shadow: 0 10px 22px rgba(52,120,212,.36); transform: translateY(-2px); }
.compose-fab:active { transform: translateY(0) scale(.96); }
.compose-fab { position: absolute; right: 16px; bottom: 78px; margin: 0; z-index: 5; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box kbd { padding: 2px 5px; border: 1px solid #d6dfeb; border-radius: 5px; color: #8998ac; font-size: 10px; background: #fff; }
.filter-tabs { display: flex; gap: 2px; padding: 0 12px 8px; overflow-x: auto; }
.filter-tab { padding: 6px 9px; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.filter-tab.active { color: var(--accent-strong); background: var(--accent-soft); font-weight: 750; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 5px 66px; }
.chat-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 9px; border-radius: 9px; text-align: left; background: transparent; transition: background .16s ease, transform .16s ease; }
.chat-row:hover { background: #eef3fb; }
.chat-row.active { background: var(--accent-soft); }
.chat-row:active { transform: scale(.99); }
.chat-copy { min-width: 0; flex: 1; }
.chat-topline, .chat-bottomline { display: flex; justify-content: space-between; gap: 8px; }
.chat-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { flex: none; color: var(--muted); font-size: 10px; }
.chat-preview { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.active .chat-preview, .chat-row.active .chat-time { color: #5578ac; }
.chat-row-saved { background: #faf3e6; }
.chat-row-saved:hover { background: #f5e9d1; }
.chat-row-saved.active { background: #eedbb5; }
.chat-row-saved .chat-name { color: #715322; }
.chat-row-saved .chat-preview, .chat-row-saved .chat-time,
.chat-row-saved.active .chat-preview, .chat-row-saved.active .chat-time { color: #846d46; }
.unread-count { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 800; }
.sidebar-footer { border-top: 1px solid var(--line); }
.sidebar .bottom-tabs { display: none; }
.bottom-tabs { display: grid; grid-template-columns: repeat(4, 1fr); justify-content: stretch; gap: 2px; padding: 8px 7px 9px; background: #fff !important; }
.bottom-tabs-global { position: absolute; right: 0; bottom: 0; left: 0; z-index: 4; display: grid; width: 100%; height: var(--bottom-nav-height); border-top: 1px solid #c8d9ed; background: #fff !important; }
.bottom-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 5px 2px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.bottom-tab:hover { background: var(--panel-soft); color: var(--ink); }
.bottom-tab.active { color: var(--accent-strong); background: var(--accent-soft); }
.bottom-tab-icon { height: 17px; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.bottom-tab-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-tab-svg.settings-svg { fill: currentColor; stroke: none; }
.bottom-tab .avatar-tiny { width: 17px; height: 17px; border-radius: 50%; font-size: 6px; }
.bottom-tab .avatar[data-presence]::after { right: -2px; bottom: -2px; width: 7px; height: 7px; border-width: 1.5px; }

.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.avatar, .blocked-user-avatar, .lumen-incoming-avatar, .invite-avatar-preview { outline: 1px solid color-mix(in srgb, var(--ink, #152d4a) 17%, transparent); outline-offset: -1px; }
.header-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.header-title-row h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.header-title-row > span:empty { display: none; }
.header-main > div:last-child { min-width: 0; }
.room-kind-icon { display: inline-block; width: 17px; height: 17px; flex: none; vertical-align: -3px; color: var(--muted, #748497); }
.chat-name .room-kind-icon, .matrix-profile-room-copy .room-kind-icon, #detailsTitle .room-kind-icon { margin-right: 5px; }
.official-account { display: inline-flex; align-items: center; gap: 6px; flex: none; color: #148ad4; font-size: 12px; line-height: 1.4; vertical-align: -3px; }
.official-account svg { width: 18px; height: 18px; flex: none; }
.official-account[hidden] { display: none !important; }
.chat-name .official-account { margin-left: 5px; }
.official-account.expanded { padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: var(--accent-soft, #e4efff); cursor: pointer; }
.official-account.expanded:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reply-jump-notice { position: absolute; z-index: 6; left: 50%; top: 90px; transform: translateX(-50%); max-width: calc(100% - 24px); display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel, #fff); box-shadow: 0 3px 14px #163a6020; color: var(--ink); font-size: 13px; }
.reply-jump-notice button { min-height: 40px; padding: 4px 8px; color: var(--accent-strong); background: transparent; }
.lumen-avatar-photo { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; border-radius: inherit; }
.avatar-room { border-radius: 12px; font-size: 17px; }
.avatar-large.avatar-room { border-radius: 18px; font-size: 28px; }
.avatar.avatar-saved { background: #c9a458; font-size: 21px; }
.avatar-large.avatar-saved { font-size: 32px; }
.avatar-small { width: 28px; height: 28px; border-radius: 50%; font-size: 9px; }
.avatar-tiny { width: 30px; height: 30px; border-radius: 50%; font-size: 9px; }
.avatar-large { width: 70px; height: 70px; border-radius: 50%; font-size: 22px; }
.avatar-me { background: #e6b78c; color: #57371f; }
.avatar-blue { background: #6399e4; }
.avatar-lilac { background: #9276d3; }
.avatar-mint { background: #5fae97; }
.avatar-coral { background: #e78a78; }
.avatar-yellow { background: #c9a458; }
.avatar-channel { background: #294b80; }
.avatar[data-presence] { position: relative; }
.avatar[data-presence]::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #9ba7b7; }
.avatar[data-presence="online"]::after { background: #35ad76; }
.avatar[data-presence="away"]::after { background: #e2ad45; }
.avatar[data-presence="unavailable"]::after { background: #df6b69; }
.avatar[data-presence="offline"]::after { background: #9ba7b7; }
.avatar[data-presence="hidden"]::after { display: none; }
.avatar-wrap { position: relative; width: 40px; height: 40px; display: block; flex: none; }
.avatar-wrap-large { width: 70px; height: 70px; }
.avatar-wrap .avatar { width: 100%; height: 100%; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #9ba7b7; }
.presence-dot.online { background: #35ad76; }
.presence-dot.away { background: #e2ad45; }
.presence-dot.unavailable { background: #df6b69; }
.presence-dot.offline { background: #9ba7b7; }

.conversation { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
.utility-back { display: none !important; }
.chat-back { display: grid; }
.app-shell.utility-mode { grid-template-columns: minmax(0, 1fr); }
.app-shell.utility-mode .sidebar { display: none; }
.app-shell.utility-mode .chat-back { display: grid; }
.app-shell.utility-mode .message-pane { padding-bottom: 70px; }
.app-shell:not(.utility-mode) .conversation { padding-bottom: var(--bottom-nav-height); }
.conversation-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 19px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.header-main { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.header-main > div:last-child { min-width: 0; }
.header-main > .icon-button, .header-actions { flex: none; }
.header-main h1 { overflow: hidden; margin: 1px 0 3px; font-size: 16px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
#headerEyebrow { display: none; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.presence { color: var(--muted); font-size: 11px; }
.header-actions { display: flex; gap: 5px; }
.conversation-info-link { cursor: pointer; }
.conversation-info-link:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; border-radius: 8px; }
.conversation-header { flex-wrap: wrap; }
#conversationSearchButton svg { width: 22px; height: 22px; }
#conversationSearchButton[hidden] { display: none; }
.conversation-search { flex: 0 0 100%; display: flex; align-items: center; gap: 4px; min-width: 0; }
.conversation-search[hidden] { display: none; }
.conversation-search input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--ink); }
.conversation-search .icon-button { width: 36px; min-width: 36px; height: 40px; }
#conversationSearchCount { max-width: 145px; color: var(--muted); font-size: 11px; }
.message-search-match .message-bubble { outline: 2px solid #d6b34a; outline-offset: 2px; }
.message-search-current .message-bubble { outline: 3px solid var(--accent); }
.floating-message-date { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 6px 13px; border-radius: 18px; color: var(--ink); background: var(--panel); box-shadow: 0 2px 10px #23476b20; font-size: 12px; font-weight: 600; pointer-events: none; }
.floating-message-date[hidden] { display: none; }
.settings-support { margin-top: 14px; }
@media (max-width: 520px) { .conversation-search { flex-wrap: wrap; } .conversation-search input { flex-basis: calc(100% - 132px); } #conversationSearchCount { order: 1; flex-basis: 100%; max-width: none; padding: 0 10px; } }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--ink); background: transparent; font-size: 18px; }
.icon-button:hover { background: var(--panel-soft); }
.icon-button.subtle { color: var(--muted); }
.mobile-menu { display: none; }
.forum-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 24px; border-bottom: 1px solid #d6e3f5; background: #f1f6fd; }
.forum-strip-copy { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 11px; }
.forum-strip-copy strong { color: var(--ink); font-size: 12px; }
.forum-chip { padding: 4px 6px; border-radius: 6px; color: var(--accent-strong); background: #dceaff; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.breadcrumb-button { overflow: hidden; max-width: 180px; padding: 4px 0; color: var(--accent-strong); background: transparent; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-button:hover { text-decoration: underline; }
.breadcrumb-separator { color: #9aaba4; font-size: 14px; }
.ghost-button { padding: 7px 9px; border-radius: 8px; color: var(--accent-strong); background: transparent; font-size: 11px; font-weight: 750; }
.ghost-button:hover { background: #deebfc; }
.branch-up { flex: none; }
.hidden { display: none !important; }

.message-pane { flex: 1; overflow-y: auto; overflow-anchor: none; padding: 24px clamp(16px, 5vw, 68px) 20px; background-color: #e8f0f9; background-image: radial-gradient(rgba(77, 117, 171, .13) .7px, transparent .7px); background-size: 16px 16px; }
.day-divider { display: flex; align-items: center; gap: 10px; margin: 0 auto 22px; color: #9aa6a2; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message-row { display: flex; gap: 8px; margin-bottom: 14px; max-width: 680px; }
.message-row.mine { flex-direction: row-reverse; margin-left: auto; }
.message-bubble { max-width: min(80%, 490px); padding: 9px 12px; border-radius: 5px 13px 13px 13px; background: #fff; box-shadow: 0 2px 5px rgba(28, 60, 105, .06); }
.message-row.mine .message-bubble { border-radius: 13px 5px 13px 13px; background: #dceaff; color: var(--ink); }
.message-author { margin-bottom: 3px; color: var(--accent-strong); font-size: 11px; font-weight: 800; }
.message-row.mine .message-author { color: var(--accent-strong); }
.message-quote { display: grid; gap: 2px; margin: 0 0 7px; padding: 5px 7px; border-left: 2px solid var(--accent); border-radius: 5px; background: rgba(52,120,212,.08); }
.message-quote strong { overflow: hidden; color: var(--accent-strong); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-quote span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-text { white-space: pre-wrap; font-size: 13px; line-height: 1.48; }
.message-meta { margin-top: 5px; color: #94a09b; font-size: 9px; text-align: right; }
.message-row.mine .message-meta { color: #6b8dbe; }
.message-unavailable { align-items: flex-start; gap: 12px; padding: 8px 0; }
.message-unavailable-content { min-width: 0; width: 490px; max-width: calc(100% - 36px); color: #5c7087; }
.message-unavailable-heading { display: flex; align-items: baseline; gap: 12px; }
.message-unavailable-heading .message-meta { margin: 0 0 0 auto; color: #63778d; flex: none; }
.message-unavailable-label { min-width: 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.message-unavailable-label strong { font-weight: 650; }
.message-unavailable-icon { width: 24px; height: 24px; flex: none; color: #bd5260; }
.message-unavailable-details { margin: 0; font-size: 12px; line-height: 1.6; }
.message-unavailable-details summary { width: fit-content; padding: 4px 0; color: var(--accent-strong); cursor: pointer; text-underline-offset: 3px; }
.message-unavailable-details summary:hover { text-decoration: underline; }
.message-unavailable-details summary:focus-visible { outline: 3px solid rgba(52, 120, 212, .3); outline-offset: 3px; border-radius: 3px; }
.message-unavailable-help p { margin: 7px 0 10px; overflow-wrap: anywhere; }
.message-unavailable-action { min-height: 36px; padding: 7px 10px; border: 1px solid #c7d6e8; border-radius: 8px; background: #f7faff; color: var(--accent-strong); font-size: 12px; text-align: left; }
.message-unavailable-action:hover { background: #fff; }
.topics-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.topics-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.topics-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topics-heading .ghost-button { margin-bottom: 2px; }
.topic-grid { display: flex; flex-direction: column; gap: 2px; overflow: hidden; border: 1px solid rgba(211,223,239,.9); border-radius: 14px; background: rgba(255,255,255,.78); }
.topic-card { display: flex; gap: 11px; min-height: 76px; padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; background: rgba(255,255,255,.75); transition: background .16s ease; }
.topic-card:last-child { border-bottom: 0; }
.topic-card:hover { background: #f3f7fd; }
.topic-card.pinned { background: #f4f8ff; }
.topic-icon { width: 37px; height: 37px; display: grid; place-items: center; flex: none; border-radius: 11px; color: #fff; font-size: 17px; background: var(--accent); }
.topic-card:nth-child(2) .topic-icon { background: #6d81bb; }
.topic-card:nth-child(3) .topic-icon { background: #dd8c6c; }
.topic-card:nth-child(4) .topic-icon { background: #8f73b4; }
.topic-card-copy { min-width: 0; flex: 1; }
.topic-card-topline { display: flex; justify-content: space-between; gap: 8px; }
.topic-card h3 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.topic-card-time { color: var(--muted); font-size: 10px; }
.topic-card p { overflow: hidden; margin: 7px 0 9px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topic-stats { display: flex; gap: 10px; color: #96a09c; font-size: 10px; }
.topic-stats .new { color: var(--accent-strong); font-weight: 800; }
.channel-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe6f4; border-radius: 19px; background: linear-gradient(135deg, #f8fbff, #eef5fd); }
.channel-hero-copy { min-width: 0; flex: 1; }
.channel-hero h2 { margin: 3px 0 4px; font-size: 20px; letter-spacing: -.03em; }
.channel-hero p { margin: 0; color: var(--muted); font-size: 11px; }
.channel-hero-actions { display: flex; gap: 7px; flex: none; }
.subscribe-button { padding: 9px 12px; border-radius: 10px; color: #fff; background: var(--accent); font-size: 11px; font-weight: 800; }
.subscribe-button.subscribed { color: var(--accent-strong); background: #dceaff; }
.channel-post { max-width: 690px; margin: 0 auto 15px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 5px 18px rgba(28,60,105,.04); }
.channel-post.pinned { border-color: #cbdcf4; background: #f7faff; }
.channel-post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.channel-post-author { display: flex; align-items: center; gap: 9px; }
.channel-post-author strong, .channel-post-author small { display: block; }
.channel-post-author strong { font-size: 12px; }
.channel-post-author small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.pinned-label { padding: 4px 6px; border-radius: 6px; color: #3567a7; background: #dceaff; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.channel-post-text { color: var(--ink); font-size: 14px; line-height: 1.55; }
.channel-post-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.channel-post-reactions { display: flex; gap: 7px; }
.channel-reaction { padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 10px; }
.channel-reaction:hover { border-color: #a9c9eb; color: var(--accent-strong); }
.channel-composer { justify-content: center; min-height: 45px; color: var(--muted); background: #f5f8fc; }
.channel-composer input, .channel-composer .composer-action, .channel-composer .send-button { display: none; }
.channel-composer-copy { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.channel-composer-copy strong { color: var(--ink); }
.channel-composer-copy span { color: var(--muted); }
.discussion-button { padding: 6px 9px; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); font-size: 10px; font-weight: 800; }
.empty-state { padding: 30px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.reply-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 19px 7px; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 8px; background: #eef5ff; }
.reply-preview-copy { min-width: 0; display: grid; gap: 2px; }
.reply-preview-copy strong { overflow: hidden; color: var(--accent-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview-copy > span:last-child { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview .icon-button { flex: none; width: 26px; height: 26px; }
.composer { display: flex; align-items: center; gap: 5px; margin: 0 19px 15px; padding: 5px 6px 5px 8px; border: 1px solid #d2ddea; border-radius: 13px; background: #fff; box-shadow: 0 2px 8px rgba(28,60,105,.05); }
.composer:focus-within { border-color: #9ebee9; box-shadow: 0 0 0 3px rgba(52,120,212,.1); }
.composer input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.composer-action { width: 30px; height: 30px; color: var(--muted); }
.settings-category { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.settings-category > summary { padding: 14px 16px; min-height: 48px; color: var(--ink); background: var(--panel); cursor: pointer; font-weight: 650; }
.settings-category[open] > summary { border-bottom: 1px solid var(--line); }
.settings-category > .settings-list { margin: 0; border: 0; border-radius: 0; }
.storage-cache-categories { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.storage-cache-categories label { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.storage-cache-categories small { margin-left: auto; white-space: nowrap; color: var(--muted); }
.storage-cache-dates { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.storage-cache-dates label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.storage-cache-dates input { max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.send-button { width: 31px; height: 31px; border-radius: 10px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 800; }
.send-button:hover { background: var(--accent-strong); }

.details-panel { overflow-y: auto; padding: 19px 16px; border-left: 1px solid var(--line); background: #fbfcff; }
.details-topline { display: flex; align-items: center; justify-content: space-between; }
.details-hero { padding: 23px 0 20px; text-align: center; }
.details-hero .avatar, .details-hero .avatar-wrap { margin: 0 auto 12px; }
.details-hero h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.details-hero p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.security-note { display: flex; gap: 9px; padding: 11px; border: 1px solid #d7e6f8; border-radius: 13px; color: var(--accent-strong); background: #f0f6ff; }
.security-note > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-size: 11px; font-weight: 900; }
.security-note strong, .security-note small { display: block; }
.security-note strong { font-size: 11px; }
.security-note small { margin-top: 2px; color: #6a87b3; font-size: 10px; }
.details-section { margin-top: 23px; }
.section-label { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; color: var(--ink); background: transparent; font-size: 12px; text-align: left; }
.detail-action span { width: 22px; color: var(--muted); text-align: center; font-size: 15px; }
.detail-action em { margin-left: auto; color: var(--muted); font-size: 10px; font-style: normal; }
.detail-action.accent { color: var(--accent-strong); font-weight: 750; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.member-row strong, .member-row small { display: block; }
.member-row strong { font-size: 11px; }
.member-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.utility-screen { max-width: 760px; width: 100%; margin: 0 auto; padding: 12px 0 22px; }
.utility-heading { margin-bottom: 18px; }
.utility-heading h2 { margin: 3px 0 5px; font-size: 24px; letter-spacing: -.03em; }
.utility-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.contact-list, .settings-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.84); }
.contact-card, .settings-row { display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 10px 13px; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.contact-card:last-child, .settings-row:last-child { border-bottom: 0; }
.contact-card:hover, .settings-row:hover { background: #f3f7fd; }
.contact-copy, .settings-copy { min-width: 0; flex: 1; }
.contact-copy strong, .contact-copy small, .settings-copy strong, .settings-copy small { display: block; }
.contact-copy strong, .settings-copy strong { color: var(--ink); font-size: 12px; }
.contact-copy small, .settings-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.contact-action, .settings-value { color: var(--accent-strong); font-size: 11px; font-weight: 750; }
.settings-section-label { margin: 19px 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-row .row-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--accent-strong); background: var(--accent-soft); font-size: 15px; }
.settings-screen .row-icon { flex: none; }
.settings-screen .row-icon svg { width: 19px; height: 19px; }
.settings-screen .settings-copy small { line-height: 1.5; }
.settings-screen .settings-value { flex: none; max-width: 110px; text-align: right; }
.settings-screen .settings-row:disabled { opacity: 1; cursor: default; }
.settings-screen .settings-row:disabled:not(.settings-account-row) { color: var(--muted); background: #f8faff; }
.settings-screen .settings-row:disabled:not(.settings-account-row) .settings-copy strong,
.settings-screen .settings-row:disabled:not(.settings-account-row) .settings-value { color: var(--muted); }
.settings-screen .settings-row:disabled:hover { background: #f8faff; }
.settings-screen .settings-account-row:disabled:hover { background: transparent; }
.matrix-security-warning.settings-security-neutral { border-color: #d2e0f2; background: #f1f6fd; }
.matrix-security-warning.settings-security-neutral p { color: var(--muted); }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #cbdcf4; border-radius: 17px; background: linear-gradient(135deg, #f7faff, #eef5fd); }
.profile-card h3 { margin: 0; font-size: 16px; }
.profile-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.matrix-profile-screen { max-width: 560px; }
.matrix-profile-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px 28px; text-align: center; }
.matrix-profile-avatar { width: 88px; height: 88px; border-radius: 50%; font-size: 28px; }
.matrix-profile-hero h2 { margin: 0; max-width: 100%; font-size: 24px; overflow-wrap: anywhere; }
.matrix-profile-hero p, .matrix-profile-address p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.matrix-profile-address { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.matrix-profile-address label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.matrix-profile-editable { max-width: 620px; }
.matrix-profile-editable .matrix-profile-hero { gap: 8px; padding: 22px 16px 25px; }
.matrix-profile-editable .matrix-profile-avatar { display: grid; place-items: center; width: 104px; height: 104px; font-size: 34px; }
.matrix-profile-avatar[data-presence]::after { width: 17px; height: 17px; right: 4px; bottom: 4px; border-width: 3px; }
.matrix-profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-avatar-link { cursor: pointer; }
.matrix-profile-photo-button { position: relative; padding: 0; margin-bottom: 10px; border-radius: 50%; background: transparent; }
.matrix-profile-photo-button:focus-visible { outline: 3px solid #a6c4ed; outline-offset: 5px; }
.matrix-profile-camera { position: absolute; right: -2px; bottom: -1px; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--accent); }
.matrix-profile-camera svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.matrix-profile-hero #matrixProfileHeroUsername { color: var(--accent-strong); font-size: 14px; }
.matrix-profile-hero #matrixProfileHeroUsername:empty { display: none; }
.matrix-profile-hero .matrix-profile-photo-hint { margin-top: 4px; font-size: 11px; }
.matrix-profile-fields { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.matrix-profile-field { display: flex; align-items: center; gap: 18px; width: 100%; min-height: 73px; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: #fff; text-align: left; }
.matrix-profile-field:last-child { border-bottom: 0; }
button.matrix-profile-field:not(:disabled):hover { background: #f5f9ff; }
.matrix-profile-field-copy { display: grid; min-width: 0; flex: 1; gap: 6px; }
.matrix-profile-field-label { color: var(--accent-strong); font-size: 11px; }
.matrix-profile-field-value { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.matrix-profile-edit-icon { flex: none; color: #8294ae; }
.matrix-profile-edit-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.matrix-profile-visibility { margin: 11px 16px 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.matrix-profile-editable > .security-status { padding: 0 16px; }
.matrix-profile-editor { display: grid; gap: 10px; margin: 14px 0; padding: 18px; border: 1px solid #cbdcf1; border-radius: 15px; background: #f5f9ff; }
.matrix-profile-editor label, .matrix-profile-editor strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.matrix-profile-editor input, .matrix-profile-editor textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #c5d6eb; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.5; }
.matrix-profile-editor textarea { resize: vertical; }
.matrix-profile-editor input:focus, .matrix-profile-editor textarea:focus { outline: 2px solid #9bbfed; outline-offset: 2px; }
.matrix-profile-editor p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.matrix-profile-editor .security-actions { margin-top: 2px; }
.matrix-profile-photo-editor { grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 16px; }
.matrix-profile-photo-editor img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }
.matrix-profile-photo-editor p { margin: 5px 0 10px; }
.matrix-profile-permanent { margin: 18px 0 24px; color: var(--muted); }
.matrix-profile-permanent summary { padding: 10px 4px; cursor: pointer; font-size: 12px; }
.matrix-profile-permanent .matrix-profile-address { margin-top: 6px; }
.matrix-profile-rooms { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.matrix-profile-rooms h3 { margin: 0; padding: 19px 18px 13px; font-size: 14px; font-weight: 650; }
.matrix-profile-room-tabs { display: flex; border-bottom: 1px solid var(--line); }
.matrix-profile-room-tabs button { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 13px 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.matrix-profile-room-tabs button[aria-selected="true"] { color: var(--accent-strong); }
.matrix-profile-room-tabs button[aria-selected="true"]::after { position: absolute; right: 14px; bottom: 0; left: 14px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); content: ''; }
.matrix-profile-room-tabs button span { min-width: 19px; padding: 2px 5px; border-radius: 7px; color: var(--muted); background: #edf2f9; font-size: 10px; }
.matrix-profile-room-tabs button[aria-selected="true"] span { color: var(--accent-strong); background: var(--accent-soft); }
.matrix-profile-room { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; color: var(--ink); background: #fff; text-align: left; }
.matrix-profile-room + .matrix-profile-room { border-top: 1px solid var(--line); }
.matrix-profile-room:hover { background: #f5f9ff; }
.matrix-profile-room-avatar { flex: none; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.matrix-profile-room-copy { display: grid; flex: 1; min-width: 0; gap: 5px; }
.matrix-profile-room-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.matrix-profile-room-copy small { color: var(--muted); font-size: 11px; }
.matrix-profile-room-arrow { color: var(--muted); font-size: 22px; }
.matrix-profile-empty { padding: 20px 18px; margin: 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.matrix-profile-rooms > .security-status { margin: 0; padding: 12px 16px; }
.matrix-profile-rooms > .security-status:empty { display: none; }
.matrix-profile-rooms > .security-button { margin: 0 16px 16px; }
.matrix-profile-field:focus-visible, .matrix-profile-room:focus-visible, .matrix-profile-room-tabs button:focus-visible, .matrix-profile-permanent summary:focus-visible { outline: 2px solid #9bbfed; outline-offset: -3px; }
@media (max-width: 420px) {
  .matrix-profile-photo-editor { grid-template-columns: minmax(0, 1fr); }
  .matrix-profile-photo-editor img { justify-self: center; }
  .matrix-profile-field { padding: 14px; }
  .matrix-profile-room-tabs button { gap: 4px; padding: 13px 5px; font-size: 11px; }
}
.matrix-profile-id-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.matrix-profile-id-row input { flex: 1 1 180px; min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); color: var(--ink); font-size: 12px; }
.matrix-device-details { margin: 0; padding: 4px 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.matrix-device-details > div { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 0; }
.matrix-device-details > div + div { border-top: 1px solid var(--line); }
.matrix-device-details dt { min-width: 105px; color: var(--muted); font-size: 12px; }
.matrix-device-details dd { flex: 1; margin: 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.profile-badge { padding: 5px 7px; border-radius: 7px; color: var(--accent-strong); background: var(--accent-soft); font-size: 10px; font-weight: 750; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(18, 35, 61, .25); backdrop-filter: blur(4px); }
.modal-backdrop.hidden { display: none !important; }
#appShell[hidden], body.auth-gated #newChatModal, body.auth-gated #toast, body.auth-gated #securityRequestNotice { display: none !important; }
body.auth-gated #matrixConnectModal { background: #e8f0f9; backdrop-filter: none; }
body.auth-gated #closeMatrixConnect { display: none; }
body.auth-loading .matrix-connect-form, body.auth-loading #matrixLoginIntro { display: none; }
body.auth-gated .matrix-connect-card { padding: 25px; border: 1px solid #d7e3f3; box-shadow: 0 18px 55px rgba(37, 77, 128, .1); }
body.auth-gated .matrix-connect-card #matrixAuthRetry { margin-top: 14px; }
.modal-card { width: min(430px, 100%); padding: 18px; border: 1px solid rgba(255,255,255,.8); border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(19,43,80,.2); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.modal-header h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.03em; }
.matrix-connect-form { display: grid; gap: 11px; }
.matrix-connect-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.matrix-connect-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d2ddea; border-radius: 10px; outline: 0; color: var(--ink); background: #f9fbff; font-size: 12px; }
.matrix-connect-form input:focus { border-color: #9ebee9; box-shadow: 0 0 0 3px rgba(52,120,212,.1); }
.matrix-connect-status { margin: 1px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.matrix-connect-status.error { color: #a14d55; }
.matrix-connect-status.success { color: #2e7a66; }
.matrix-connect-submit { width: 100%; height: 38px; margin-top: 3px; font-size: 12px; }
.matrix-connect-card > .matrix-connect-status { margin-top: 12px; }
.matrix-login-intro { color: var(--muted); font-size: 11px; line-height: 1.5; }
.matrix-destructive .settings-copy strong { color: #a14d55; }
.matrix-message-unencrypted { color: #8c5c24; }
.matrix-session-bar { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f1f6fd; color: var(--accent-strong); font-size: 12px; overflow-wrap: anywhere; }
.matrix-session-bar small { display: block; margin-top: 3px; color: var(--muted); }
.matrix-session-bar.has-error { background: #fff3e4; color: #795a32; }
.matrix-mode .details-section:not(#membersSection):not(#mediaSection):not(#roomAdminSection):not(#roomBackgroundSection):not(#roomAutoDeleteSection) { display: none; }
.matrix-composer { flex-wrap: wrap; }
.matrix-send-status { flex: 0 0 100%; padding: 2px 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.matrix-send-status.error { color: #a14d55; }
.matrix-security-warning { margin: 18px 0; padding: 15px; border: 1px solid #edd9b2; border-radius: 12px; background: #fff8eb; font-size: 12px; line-height: 1.6; }
.matrix-security-warning p { margin: 6px 0 0; color: #75603e; }
.matrix-empty { max-width: 560px; margin: 30px auto; line-height: 1.7; }
.security-screen { max-width: 860px; }
.security-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.security-heading > div { flex: 1; min-width: 0; }
.security-heading h2 { margin: 0 0 6px; font-size: 23px; letter-spacing: -.03em; }
.security-heading p, .security-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.security-back { flex: none; width: 30px; height: 30px; border-radius: 9px; color: var(--accent-strong); background: #fff; font-size: 21px; }
.security-section { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.security-section h3 { margin: 0 0 10px; color: var(--ink); font-size: 15px; }
.security-status { min-height: 18px; margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.security-status.error { color: #a14d55; }
.security-summary p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.security-state { display: inline-block; width: fit-content; padding: 4px 7px; border-radius: 6px; font-size: 11px; }
.security-state.verified { color: #236b56; background: #e7f5ee; }
.security-state.pending { color: #876326; background: #fff5df; }
.security-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.security-button { min-height: 36px; padding: 8px 12px; border: 1px solid transparent; border-radius: 9px; color: #fff; background: var(--accent); font-size: 12px; line-height: 1.45; font-weight: 650; }
.security-button:hover { background: var(--accent-strong); }
.security-button.secondary { color: var(--accent-strong); background: #f3f7fd; border-color: #d7e4f4; }
.security-button.secondary:hover { background: #e8f0fc; }
.security-button.danger { color: #fff; background: #a94953; }
.security-button.danger.secondary { color: #a14d55; background: #fff7f7; border-color: #eed7da; }
.security-button:focus-visible, .security-back:focus-visible { outline: 3px solid #a6c4ed; outline-offset: 2px; }
.security-device { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.security-device:last-child { padding-bottom: 0; border-bottom: 0; }
.security-device-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--accent-strong); border-radius: 11px; background: var(--accent-soft); }
.security-device-icon svg { width: 25px; height: 25px; }
.security-device-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.security-device-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.security-device-copy code, .security-device-copy small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.security-current { display: inline-block; margin: 3px 0 0 5px; font-size: 10px; color: var(--accent-strong); font-weight: 500; }
.security-device-actions { display: flex; flex: none; flex-direction: column; gap: 6px; align-items: flex-end; max-width: 175px; }
.security-device-actions .security-help { max-width: 150px; text-align: right; font-size: 10px; }
.security-verification { padding: 14px 0; border-bottom: 1px solid var(--line); }
.security-verification:last-child { padding-bottom: 0; border-bottom: 0; }
.security-verification > strong { font-size: 13px; overflow-wrap: anywhere; }
.security-verification p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.security-verification .security-compare-instruction { color: var(--ink); }
.security-sas-emoji { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; padding: 13px 8px; margin: 10px 0; border-radius: 12px; background: #f3f7fd; list-style: none; }
.security-sas-emoji li { min-width: 0; text-align: center; }
.security-sas-emoji li > span { font-family: 'Segoe UI Emoji', sans-serif; font-size: 29px; }
.security-sas-emoji small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.security-sas-decimals { display: flex; justify-content: center; gap: 28px; padding: 10px; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 20px; letter-spacing: .08em; }
.security-form { display: grid; gap: 12px; margin-top: 15px; padding: 15px; border: 1px solid #cfdff1; border-radius: 12px; background: #f7faff; }
.security-form h4 { margin: 0; font-size: 14px; }
.security-form p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.security-form label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.security-form textarea, .security-form input[type="password"] { width: 100%; padding: 10px; border: 1px solid #cddbee; border-radius: 9px; background: #fff; color: var(--ink); font-size: 13px; }
.security-form textarea { resize: vertical; min-height: 80px; font-family: ui-monospace, Consolas, monospace; line-height: 1.7; overflow-wrap: anywhere; }
.security-form textarea:focus, .security-form input:focus { outline: 2px solid #adc9ef; outline-offset: 1px; }
.security-form .security-checkbox { display: flex; align-items: flex-start; gap: 9px; }
.security-checkbox input { margin-top: 3px; accent-color: var(--accent); }
.security-confirm { border-color: #ead7da; background: #fffafa; }
.security-request-notice { position: fixed; right: 20px; bottom: 84px; z-index: 7; max-width: calc(100vw - 40px); padding: 13px 16px; border: 1px solid #a8c8ef; border-radius: 12px; background: #fff; color: var(--accent-strong); box-shadow: 0 5px 22px #153a6726; font-size: 12px; font-weight: 650; }
@media (max-width: 600px) {
  .security-heading { flex-wrap: wrap; gap: 8px; }
  .security-heading h2 { font-size: 20px; }
  .security-section { padding: 13px; }
  .security-device { flex-wrap: wrap; gap: 10px; }
  .security-device-actions { width: 100%; max-width: none; flex-direction: row; justify-content: flex-end; }
  .security-device-actions .security-help { max-width: none; }
  .security-sas-emoji { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 15px; }
  .security-sas-decimals { gap: 18px; font-size: 18px; }
  .security-form { padding: 11px; }
}
.matrix-mode .message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.matrix-mode .profile-card h3, .matrix-mode .profile-card p, .matrix-mode .member-row strong, .matrix-mode .member-row small { overflow-wrap: anywhere; }
.matrix-mode .forum-chip { display: none; }
#realRoomFields { margin: 14px 0 8px; }
.modal-card { max-height: calc(100vh - 40px); overflow-y: auto; }
button:disabled { cursor: not-allowed; opacity: .55; }
.emoji-picker { margin-bottom: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #f7faff; }
.emoji-picker-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; }
.emoji-options { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-option { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: #fff; font-size: 18px; }
.emoji-option:hover { border-color: #a9c9eb; background: var(--accent-soft); }
.emoji-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(52,120,212,.12); }
.create-options { display: flex; flex-direction: column; gap: 4px; }
.create-option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px; border-radius: 12px; background: transparent; text-align: left; }
.create-option:hover { background: #f1f6fd; }
.create-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-size: 18px; }
.create-icon .room-kind-icon { width: 22px; height: 22px; color: inherit; }
.create-option[data-create="group"] .create-icon, .create-option[data-create="channel"] .create-icon, .create-option[data-create="forum"] .create-icon { border-radius: 11px; }
.create-icon.blue { background: #5e8fd4; }
.create-icon.lilac { background: #9276d3; }
.create-icon.navy { background: #294b80; }
.create-icon.coral { background: #e78a78; }
.create-option > span:nth-child(2) { min-width: 0; flex: 1; }
.create-option strong, .create-option small { display: block; }
.create-option strong { font-size: 12px; }
.create-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.create-arrow { color: var(--muted); font-size: 20px; }
.toast { position: fixed; right: 24px; bottom: 76px; z-index: 5; max-width: 280px; padding: 11px 14px; border-radius: 12px; color: #fff; background: #263c63; box-shadow: 0 10px 30px rgba(24,52,95,.24); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 290px minmax(420px, 1fr); }
  .details-panel { display: none; }
  .details-panel.visible:not(.hidden) { display: block; position: absolute; z-index: 8; top: 0; right: 0; bottom: var(--bottom-nav-height); width: min(360px, 100%); max-width: 100%; box-shadow: -12px 0 35px #18345f26; }
}
@media (min-width: 761px) {
  .app-shell.dialog-list-mode { grid-template-columns: minmax(0, 1fr); }
  .app-shell.dialog-list-mode .conversation { display: none; }
  .app-shell.dialog-list-mode .details-panel { display: none; }
  .app-shell.dialog-list-mode .sidebar { grid-column: 1 / -1; width: 100%; border-right: 0; }
}
@media (max-width: 760px) {
  .app-shell { display: block; position: relative; }
  .sidebar { position: absolute; inset: 0 auto 0 0; z-index: 4; width: min(86vw, 330px); height: 100vh; box-shadow: 18px 0 40px rgba(0,0,0,.12); transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .app-shell.mobile-list-mode .conversation { display: none; }
  .app-shell.mobile-list-mode .sidebar { width: 100%; box-shadow: none; transform: translateX(0); }
  .conversation { height: 100vh; }
  .bottom-tabs-global { right: 0; bottom: 0; left: 0; width: 100%; }
  .chat-back { display: grid; }
  .mobile-menu { display: none; }
  .conversation-header { padding: 13px 15px; }
  .composer { margin: 0 12px 12px; }
  .message-pane { padding: 18px 10px 15px; }
  .topic-grid { grid-template-columns: 1fr; }
  .forum-strip { padding: 10px 15px; }
  .forum-strip-copy > span:last-child { display: none; }
  .breadcrumb-button { max-width: 110px; }
  .branch-up span { display: none; }
  .channel-hero { align-items: flex-start; flex-wrap: wrap; }
  .channel-hero-actions { width: 100%; }
  .subscribe-button { flex: 1; }
}
/* The same person uses the same placeholder colour in every context. */
.chat-row + .chat-row { border-top: 1px solid rgba(112, 134, 160, .15); }
.chat-row { border-radius: 12px; }
.message-forwarded { color: var(--accent, #2878d4); font-size: 12px; margin-bottom: 7px; }
.message-quote { cursor: pointer; }
.message-quote:hover { filter: brightness(.97); }
.message-row.quote-target .message-bubble { outline: 2px solid #6295df; outline-offset: 3px; }
.forward-rooms {display:grid;gap:6px;max-height:40vh;overflow:auto}
.forward-room {text-align:left;padding:12px;border:0;border-radius:12px;background:var(--surface,#f1f6ff);color:inherit;cursor:pointer}
.forward-preview {white-space:pre-wrap;overflow-wrap:anywhere;max-height:100px;overflow:auto;color:var(--muted,#6f819a)}
.message-quote {border-top:0;border-right:0;border-bottom:0;text-align:left;width:100%;font:inherit;color:inherit}
.voice-player {display:flex;align-items:center;gap:12px;min-width:220px;max-width:340px;padding:10px 4px}
.voice-play {width:44px;height:44px;flex:0 0 44px;border:0;border-radius:50%;background:#3979d9;color:white;font-size:19px;cursor:pointer}
.voice-body {flex:1;min-width:0}.voice-title {font-size:12px;color:#617a99}.voice-body input {display:block;width:100%;accent-color:#3979d9;margin:8px 0}
.voice-footer {display:flex;align-items:center;gap:8px;font-size:12px;color:#617a99}.voice-status {flex:1}.voice-speed {border:0;border-radius:9px;padding:4px 7px;color:#3979d9;background:#e2edfd;cursor:pointer}

/* Talveni identity is restricted to the entry screen; conversation headers stay compact. */
.talveni-auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; }
.talveni-auth-brand img { display: block; flex: none; width: 48px; height: 48px; }
.talveni-auth-brand div { min-width: 0; display: grid; gap: 3px; }
.talveni-auth-brand strong { color: var(--ink); font-size: 27px; font-weight: 750; letter-spacing: -.7px; line-height: 1.1; }
.talveni-auth-brand span { color: var(--muted); font-size: 11px; line-height: 1.4; }

/* Compact status and avatar controls. */
.sidebar-heading{flex-direction:row;align-items:center;gap:8px}.connection-label{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0!important;flex-shrink:0}.connection-label svg{width:16px;height:16px}.connection-label[data-connection-status=connecting]{opacity:.55}.create-avatar-picker{margin:12px 0 18px}.create-avatar-picker>summary{display:flex;align-items:center;gap:12px;cursor:pointer;color:var(--ink);list-style:none}.create-avatar-picker>summary .avatar{font-size:27px}.create-avatar-picker .emoji-picker{margin:8px 0;padding:12px;border-radius:16px;background:var(--panel-soft,#f3f7fc)}.settings-copy small{color:var(--muted,#78889b)}

/* Entry footer follows the visual viewport without covering forms or keyboards. */
.matrix-auth-footer { display: none; }
body.auth-gated #matrixConnectModal { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px 20px max(18px, env(safe-area-inset-bottom)); overflow-y: auto; }
body.auth-gated .matrix-connect-card { flex: none; margin-block: auto; max-height: none; }
body.auth-gated .matrix-auth-footer { display: block; flex: none; width: 100%; text-align: center; }
.matrix-auth-footer p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* Settings use a category menu with separate panels; search can span every panel. */
.settings-menu .settings-category-link { min-height: 70px; }
.settings-menu .row-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; color: var(--accent-strong); background: var(--accent-soft); }
.settings-menu .row-icon svg { width: 22px; height: 22px; }
.settings-menu-chevron { flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted); }
#matrixSettingsScreen .settings-category { margin: 0; padding: 0; border: 0; border-radius: 0; overflow: visible; }
#matrixSettingsScreen .settings-category-title { margin: 18px 2px 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
#matrixSettingsScreen:not([data-settings-searching="true"]) .settings-category-title { display: none; }
#matrixSettingsScreen .settings-category > .settings-list { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#matrixSettingsScreen [hidden] { display: none !important; }
.settings-category-link:focus-visible { outline: 3px solid #a6c4ed; outline-offset: -3px; }

.chat-list-meta { display: inline-flex; align-items: center; gap: 4px; flex: none; }
