@font-face {
    font-family: "Vazirmatn";
    src: url("/assets/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("/assets/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Font Awesome 6 Free";
    src: url("/assets/fa-solid-900.woff2") format("woff2");
    font-style: normal;
    font-weight: 900;
    font-display: block;
}
@font-face {
    font-family: "Font Awesome 6 Free Solid";
    src: url("/assets/fa-solid-900.woff2") format("woff2"),
         url("/assets/fontawesome.woff2") format("woff2");
    font-style: normal;
    font-weight: 900;
    font-display: block;
}

.fa-icon {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Free Solid", sans-serif;
    font-style: normal;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

:root {
    --app-height: 100dvh;
    --vv-offset-top: 0px;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    direction: rtl;
    background: #ffffff;
    color: #1c1c21;
}

#root,
.app-root {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.messenger {
    display: flex;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.nav-rail {
    width: 84px;
    background: #f6f7f8;
    border-left: 1px solid #e0e2e8;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 6px;
    flex-shrink: 0;
    min-height: 0;
}

.nav-rail-user {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.nav-rail-bar {
    display: flex;
    flex-direction: column;
    gap: 17px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.nav-rail-bar .nav-rail-item:last-child {
    margin-top: auto;
}

.nav-rail-top {
    display: none;
}

.nav-rail-items {
    display: none;
}

.nav-rail-spacer {
    display: none;
}

.nav-rail-item {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    padding: 7px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.nav-rail-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.nav-rail-item.active {
    background: rgba(99, 102, 241, 0.14);
    color: #6366f1;
}

.nav-rail-icon,
.nav-rail-item .fa-icon {
    font-size: 20px;
    line-height: 1;
}

.nav-rail-label {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.list-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #8c8c94;
}

.list-placeholder-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    color: #c4c4cc;
}

.list-placeholder p {
    margin: 0;
    font-size: 14px;
}

.list-empty-cta {
    margin-top: 16px;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    background: #0b8f7a;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.list-empty-cta:hover {
    background: #097a69;
}

.list-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.list-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e2e8;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: list-spinner-spin 0.75s linear infinite;
}

@keyframes list-spinner-spin {
    to {
        transform: rotate(360deg);
    }
}

.settings-panel {
    --settings-bg: #f2f2f7;
    --settings-group-bg: #fff;
    --settings-divider: #e5e5ea;
    --settings-icon: #8e8e93;
    --settings-chevron: #c7c7cc;
    --settings-label: #1c1c1e;
    --settings-value: #8e8e93;
    --settings-subpanel-bg: #fff;
    background: var(--settings-bg);
    overflow: hidden;
}

.settings-panel .chat-header,
.settings-panel .settings-header {
    background: var(--settings-bg);
    border-bottom: none;
    box-shadow: none;
}

.settings-panel .chat-header .title p {
    display: none;
}

.settings-panel .settings-header .title h2 {
    font-size: 17px;
    font-weight: 600;
}

.settings-panel .settings-header {
    gap: 14px;
    justify-content: flex-start;
}

.settings-back-btn,
.chat-header-back {
    background: transparent;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 6px 10px 6px 6px;
    margin-inline-end: 4px;
    border-radius: 0;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-back-btn:hover,
.chat-header-back:hover {
    background: transparent;
    color: #4338ca;
}

.settings-back-btn .fa-icon,
.chat-header-back .fa-icon {
    font-size: 22px;
    line-height: 1;
    color: inherit;
    -webkit-text-stroke: 0.35px currentColor;
}

.settings-panel .settings-body {
    flex: 1;
    min-height: 0;
    padding: 8px 16px 32px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: var(--settings-bg);
}

.settings-panel .settings-body > .settings-group,
.settings-panel .settings-body > .settings-status,
.settings-panel .settings-body > .settings-logout-wrap {
    flex-shrink: 0;
}

.settings-status {
    background: #d9fdd3;
    color: #111b21;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.45;
}

.settings-group {
    background: var(--settings-group-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.04);
}

.settings-group + .settings-group {
    margin-top: 0;
}

.settings-profile-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
}

.settings-profile-row {
    gap: 14px;
    min-height: 72px;
    padding: 10px 16px;
}

.settings-profile-row .settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.settings-profile-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.settings-profile-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--settings-label);
    line-height: 1.25;
}

.settings-profile-sub {
    font-size: 14px;
    color: var(--settings-value);
    direction: ltr;
    text-align: right;
    word-break: break-all;
}

.settings-avatar-btn {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

.settings-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
}

.settings-avatar--large {
    width: 96px;
    height: 96px;
}

.settings-avatar-edit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent, #6366F1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.settings-avatar-edit .fa-icon {
    font-size: 12px;
    line-height: 1;
}

.settings-file-input {
    display: none;
}

.settings-label {
    font-size: 13px;
    color: var(--settings-value);
}

.settings-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--settings-divider);
    border-radius: 0;
    padding: 8px 0;
    font: inherit;
    font-size: 16px;
    background: transparent;
    color: var(--settings-label);
}

.settings-input:focus {
    outline: none;
    border-bottom-color: #00a884;
}

.settings-mxid {
    margin: 0;
    font-size: 14px;
    color: var(--settings-value);
    direction: ltr;
    text-align: right;
    word-break: break-all;
}

.settings-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.45;
    font-family: inherit;
}

.settings-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.settings-btn {
    border: 0;
    border-radius: 20px;
    padding: 8px 16px;
    background: #00a884;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.settings-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-btn-ghost {
    background: var(--settings-divider);
    color: var(--settings-label);
}

.settings-btn-danger {
    background: #ea0038;
    color: #fff;
}

.settings-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 50px;
    border: none;
    background: var(--settings-group-bg);
    padding: 11px 16px;
    font: inherit;
    font-size: 17px;
    color: var(--settings-label);
    text-decoration: none;
    cursor: pointer;
    text-align: right;
}

.settings-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 56px;
    left: 16px;
    height: 0.5px;
    background: var(--settings-divider);
    pointer-events: none;
}

.settings-group > :last-child.settings-item::after,
.settings-group > :last-child:not(.settings-subpanel) .settings-item:last-child::after {
    display: none;
}

.settings-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-item--static {
    cursor: default;
}

.settings-item--choice {
    cursor: default;
}

.settings-item--choice .settings-item-select {
    margin-inline-start: auto;
}

.settings-item-icon {
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    font-size: 18px;
    font-weight: 400;
    color: var(--settings-icon);
    line-height: 1;
}

.settings-item-label {
    flex: 1;
    min-width: 0;
    font-weight: 400;
}

.settings-item-value {
    flex-shrink: 0;
    color: var(--settings-value);
    font-size: 15px;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-item-badge {
    flex-shrink: 0;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #8e8e93;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
}

.settings-item-chevron {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--settings-chevron);
    line-height: 1;
    opacity: 0.9;
}

.settings-item-select {
    flex-shrink: 0;
    max-width: 46%;
    border: none;
    background: transparent;
    color: var(--settings-value);
    font: inherit;
    font-size: 15px;
    text-align: left;
    direction: ltr;
    cursor: pointer;
    appearance: none;
    padding: 0 4px 0 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='12' viewBox='0 0 8 12'%3E%3Cpath fill='%23c7c7cc' d='M6.5 1L1.5 6l5 5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left center;
    padding-left: 14px;
}

.settings-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.settings-switch-slider {
    position: absolute;
    inset: 0;
    background: #e9e9ea;
    border-radius: 31px;
    transition: background 0.2s ease;
}

.settings-switch-slider::before {
    content: "";
    position: absolute;
    height: 27px;
    width: 27px;
    right: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.settings-switch input:checked + .settings-switch-slider {
    background: #34c759;
}

.settings-switch input:checked + .settings-switch-slider::before {
    transform: translateX(-20px);
}

.settings-subpanel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 18px 14px;
    background: var(--settings-subpanel-bg);
}

.settings-subpanel--flat {
    padding: 16px 18px 18px;
}

.settings-device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f2f2f7;
}

.settings-device-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--settings-label);
}

.settings-device-meta {
    font-size: 13px;
    color: var(--settings-value);
    margin-top: 2px;
    direction: ltr;
    text-align: right;
}

.settings-badge {
    font-size: 11px;
    font-weight: 500;
    background: #d9fdd3;
    color: #008069;
    border-radius: 999px;
    padding: 2px 8px;
}

.settings-logout-wrap {
    display: flex;
    justify-content: center;
    padding: 4px 0 8px;
}

.settings-logout-btn {
    border: none;
    border-radius: 0;
    background: transparent;
    color: #ff3b30;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-logout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-user-btn {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
}

.nav-user-btn:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.logout-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #f1ede7;
}

.new-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(28, 28, 33, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.call-overlay--idle {
    pointer-events: none;
}

.call-overlay--video {
    padding: 0;
    background: #000;
    align-items: stretch;
    justify-content: stretch;
}

.call-card {
    width: min(360px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.call-card--video {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    padding: 0;
    background: #0a0b10;
    color: #f4f5f8;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.call-video-host {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #0b0d14;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.call-card--video .call-video-host {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    z-index: 0;
}

#call-video-host video.call-video-remote,
video.call-video-remote {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0b0d14;
}

#call-video-host video.call-video-local,
video.call-video-local {
    position: absolute;
    right: 12px;
    top: auto;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: min(28vw, 140px);
    max-width: 160px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    z-index: 3;
    background: #1a1d28;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.call-chrome {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    pointer-events: none;
}

.call-chrome > * {
    pointer-events: auto;
}

.call-card--video .call-chrome {
    justify-content: flex-end;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px
        calc(18px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0) 28%,
        rgba(0, 0, 0, 0) 55%,
        rgba(0, 0, 0, 0.72) 100%
    );
}

.call-card--video:not(.call-card--video-live) .call-chrome {
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: radial-gradient(ellipse at center, #1a1d28 0%, #0a0b10 70%);
}

.call-meta {
    margin-bottom: 14px;
}

.call-card--video .call-meta {
    text-align: center;
}

.call-card--video-live .call-meta {
    position: absolute;
    top: max(14px, env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    margin: 0;
    text-align: start;
    padding-inline-end: 0;
}

.call-avatar-ring {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: call-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.call-peer-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 36px;
}

.call-peer-avatar .avatar-photo,
.call-peer-avatar.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.call-avatar-icon {
    font-size: 32px;
    color: #fff;
}

@keyframes call-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.call-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #1c1c21;
}

.call-card--video .call-title {
    color: #f4f5f8;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.call-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #8c8c94;
}

.call-card--video .call-subtitle {
    color: rgba(244, 245, 248, 0.85);
    margin-bottom: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.call-card--video-live .call-subtitle {
    margin-top: 2px;
}

.call-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.call-card--video .call-actions {
    width: 100%;
    gap: 22px;
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.bubble-row.call-log-row {
    align-items: center;
    width: 100%;
}

.bubble.call-log {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(92%, 420px);
    padding: 7px 14px;
    border-radius: 14px;
    background: rgba(28, 28, 33, 0.08);
    color: #5c5c66;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
    overflow: visible;
}

.bubble.call-log::before,
.bubble.call-log::after {
    display: none !important;
    content: none !important;
}

.call-log-icon {
    font-size: 12px;
    opacity: 0.85;
}

.call-log-text {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.call-log-time {
    font-size: 11px;
    opacity: 0.65;
    flex-shrink: 0;
}

html[data-theme="dark"] .bubble.call-log {
    background: rgba(255, 255, 255, 0.08);
    color: #c8cad3;
}

.call-btn {
    border: none;
    border-radius: 50%;
    width: 58px;
    height: 58px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.12s ease;
}

.call-btn:active {
    transform: scale(0.94);
}

.call-btn-glyph {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35em;
    height: 1.35em;
    font-size: 22px;
    line-height: 1;
}

.call-btn-glyph .fa-icon {
    font-size: inherit;
    line-height: 1;
}

.call-btn-glyph--hangup {
    transform: rotate(135deg);
}

.call-btn-slash {
    display: none;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.call-btn.is-off .call-btn-slash {
    display: block;
}

.call-btn-slash::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 128%;
    height: 2.5px;
    border-radius: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(-42deg);
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18);
}

.call-card--video .call-btn-slash::before {
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.45);
}

.call-btn-accept {
    background: #22c55e;
    color: #fff;
}

.call-btn-reject,
.call-btn-hangup {
    background: #ef4444;
    color: #fff;
}

.call-btn-mute,
.call-btn-camera {
    background: #e8eaef;
    color: #1c1c21;
}

.call-btn-mute.is-off,
.call-btn-camera.is-off {
    background: #ffffff;
    color: #1c1c21;
    box-shadow: inset 0 0 0 1.5px rgba(28, 28, 33, 0.12);
}

.call-card--video .call-btn-mute,
.call-card--video .call-btn-camera {
    background: rgba(55, 58, 72, 0.72);
    color: #f4f5f8;
    backdrop-filter: blur(10px);
}

.call-card--video .call-btn-mute.is-off,
.call-card--video .call-btn-camera.is-off {
    background: rgba(255, 255, 255, 0.92);
    color: #1c1c21;
    box-shadow: none;
}

.call-card--video .call-btn-hangup,
.call-card--video .call-btn-accept,
.call-card--video .call-btn-reject {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.chat-header-icon.active {
    color: #6366f1;
}

.chat-header-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.new-chat-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.new-chat-card h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
}
.new-chat-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: #8c8c94;
}
.new-chat-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.new-chat-actions .btn {
    flex: 1;
}
.new-chat-user-section {
    margin: 12px 0 0;
}
.new-chat-user-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1c1c21;
}
.new-chat-user-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e0e2e8;
    border-radius: 12px;
    background: #fafafa;
}
.new-chat-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    min-height: 52px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    color: #1c1c21;
    -webkit-tap-highlight-color: transparent;
}
.new-chat-user-row:hover {
    background: #f0f0fc;
}
.new-chat-user-row.selected {
    background: #e8e8fc;
}
.new-chat-user-row .avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.new-chat-user-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.new-chat-user-meta .name {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c21;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.new-chat-user-meta .mxid {
    font-size: 12px;
    color: #8c8c94;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: right;
}
.new-chat-user-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    font-size: 13px;
    color: #8c8c94;
    text-align: center;
}
.new-chat-user-state .list-spinner {
    width: 24px;
    height: 24px;
}

.header-icon-btn {
    border: none;
    background: #f6f7f8;
    color: #8c8c94;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
}

.header-fa-icon {
    font-size: 16px;
    color: #8c8c94;
}

.chat-list-panel {
    width: 320px;
    background: #fff;
    border-left: 1px solid #e0e2e8;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.list-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e2e8;
    background: #fff;
}
.list-header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.list-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.list-new-chat-btn {
    border: none;
    background: #f6f7f8;
    color: #6366f1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.list-new-chat-btn:hover {
    background: #ececf0;
    color: #4338ca;
}
.list-new-chat-btn .fa-icon {
    font-size: 15px;
}
.search {
    margin-top: 10px;
    width: 100%;
    border: none;
    background: #f6f7f8;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
}

.room-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.room-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    min-height: 78px;
    cursor: pointer;
    border: none;
    width: 100%;
    background: transparent;
    text-align: right;
    font-family: inherit;
    color: #1c1c21;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    position: relative;
}
/* خط جداکننده: از چپ با پدینگ، تا قبل از آواتار در راست (RTL) */
.room-row:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: 0;
    /* از بعد از آواتار (پدینگ راست ۱۴ + عرض ۵۸ + فاصله ۱۰) */
    right: 82px;
    /* پدینگ سمت چپ ردیف */
    left: 14px;
    height: 1px;
    background: #f0f0f4;
    pointer-events: none;
}
.room-row:hover {
    background: #f8f8fa;
}
.room-row.active {
    background: #f0f0fc;
}
.room-row.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #6366f1;
    z-index: 1;
}
.avatar,
.nav-user-avatar,
.chat-header-avatar {
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.room-row .avatar,
.contacts-row .avatar {
    width: 58px;
    height: 58px;
    font-size: 18px;
}
.nav-user-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    font-size: 18px;
}
.chat-header-avatar {
    width: 48px;
    height: 48px;
}
.avatar img,
.nav-user-avatar img,
.chat-header-avatar img,
.avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-photo.hidden {
    display: none;
}
.avatar .initial,
.nav-user-avatar .initial,
.chat-header-avatar .initial {
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.room-meta {
    flex: 1;
    min-width: 0;
}
.room-meta .top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.room-meta .name {
    font-weight: 600;
    font-size: 15px;
    color: #1c1c21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.room-meta .time {
    font-size: 12px;
    color: #8c8c94;
    flex-shrink: 0;
}
.room-meta .preview {
    font-size: 13px;
    color: #8c8c94;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: transparent;
}

.chat-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f1ede7;
}

.chat-header {
    height: 66px;
    background: #fff;
    color: #1c1c21;
    border-bottom: 1px solid #e0e2e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.chat-header-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: default;
}

.chat-header-identity--clickable {
    cursor: pointer;
    border-radius: 10px;
}

.chat-header-identity--clickable:hover {
    background: rgba(99, 102, 241, 0.06);
}

.chat-header-identity .title {
    text-align: start;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-header-icon {
    border: none;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.chat-header-icon:hover {
    background: rgba(99, 102, 241, 0.08);
}

.chat-header-icon .fa-icon {
    font-size: 16px;
    line-height: 1;
}

.chat-header .title {
    flex: 1;
    min-width: 0;
}
.chat-header .title h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1c1c21;
}
.chat-header .title p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #8c8c94;
}

.timeline {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 23px 8px;
    display: flex;
    flex-direction: column;
    background: transparent;
    gap: 4px;
    min-height: 0;
}

.timeline-hint {
    text-align: center;
    font-size: 12px;
    color: #8c8c94;
    padding: 8px 0;
    flex-shrink: 0;
}

.bot-start-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px 48px;
    gap: 12px;
    min-height: 240px;
}

.bot-start-avatar {
    width: 88px;
    height: 88px;
    font-size: 32px;
    margin-bottom: 4px;
}

.bot-start-name {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1e;
}

.bot-start-desc {
    margin: 0;
    max-width: 320px;
    font-size: 14px;
    line-height: 1.55;
    color: #6b6b73;
}

.bot-start-btn {
    margin-top: 8px;
    min-width: 140px;
    padding: 11px 28px;
    border: none;
    border-radius: 22px;
    background: #2aabee;
    color: #fff;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bot-start-btn .bot-btn-icon {
    color: #fff;
    font-size: 14px;
}

.bot-start-btn:hover {
    background: #229bd9;
}

.bot-start-btn:active {
    background: #1f8fc9;
}

.timeline-date {
    align-self: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #6b6b73;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
    margin: 4px 0 8px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.bubble-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.bubble-row.mine {
    align-items: flex-start;
}
.bubble-row.theirs {
    align-items: flex-end;
}

.room-row .name .bot-badge,
.new-chat-user-meta .name .bot-badge {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    color: #3d5afe;
    background: #e8edff;
    border-radius: 4px;
    vertical-align: middle;
}

.bot-keyboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    max-width: min(92%, 360px);
}

.bubble-row.mine .bot-keyboard {
    align-self: flex-start;
}

.bubble-row.theirs .bot-keyboard {
    align-self: flex-end;
}

.bot-keyboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bot-keyboard-btn {
    flex: 1 1 auto;
    min-width: 72px;
    padding: 8px 12px;
    font-size: 13px;
    color: #3d5afe;
    background: #fff;
    border: 1px solid #c5cff9;
    border-radius: 8px;
    cursor: pointer;
}

.bot-keyboard-btn:hover {
    background: #f0f3ff;
}

.bubble {
    max-width: min(72%, 520px);
    padding: 8px 14px;
    /* Full iMessage pill — all corners round; tail is external */
    border-radius: 18px;
    box-shadow: none;
    position: relative;
    overflow: visible;
    /* رنگ پایه حباب — fill را فقط روی .text بگذار تا تیک/فایل رنگ خودشان را نگه دارند */
    color: #111b21;
    forced-color-adjust: none;
}
.bubble.mine {
    background: #d0f1d5;
}
.bubble.theirs {
    background: #fff;
}

/*
 * Exact iMessage tail (Samuel Kraft technique):
 * ::before = colored curved spur; ::after = chat-bg cutout that carves the notch.
 * Mine sits on the physical right (RTL outgoing); theirs on the physical left.
 */
.bubble.mine:not(.deleted):not(.sticker-bubble)::before,
.bubble.mine:not(.deleted):not(.sticker-bubble)::after,
.bubble.theirs:not(.deleted):not(.sticker-bubble)::before,
.bubble.theirs:not(.deleted):not(.sticker-bubble)::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 20px;
    pointer-events: none;
}

/* Mine — outgoing tail on the right */
.bubble.mine:not(.deleted):not(.sticker-bubble)::before {
    right: -7px;
    width: 20px;
    background-color: #d0f1d5;
    border-bottom-left-radius: 16px 14px;
}
.bubble.mine:not(.deleted):not(.sticker-bubble)::after {
    right: -26px;
    width: 26px;
    background-color: #f1ede7;
    border-bottom-left-radius: 10px;
}

/* Theirs — incoming tail on the left */
.bubble.theirs:not(.deleted):not(.sticker-bubble)::before {
    left: -7px;
    width: 20px;
    background-color: #fff;
    border-bottom-right-radius: 16px 14px;
}
.bubble.theirs:not(.deleted):not(.sticker-bubble)::after {
    left: -26px;
    width: 26px;
    background-color: #f1ede7;
    border-bottom-right-radius: 10px;
}

/* Dark theme: cutout must match chat wallpaper */
html[data-theme="dark"] .bubble.mine:not(.deleted):not(.sticker-bubble)::after,
html[data-theme="dark"] .bubble.theirs:not(.deleted):not(.sticker-bubble)::after {
    background-color: #0b141a;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .bubble.mine:not(.deleted):not(.sticker-bubble)::after,
    html[data-theme="system"] .bubble.theirs:not(.deleted):not(.sticker-bubble)::after {
        background-color: #0b141a;
    }
}

.typing-row {
    margin-top: 2px;
}

.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    color: #8c8c94;
    font-size: 14px;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-inline-start: 2px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8c8c94;
    animation: typing-dot-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-dot-bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.bubble .text {
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
    z-index: 1;
    /* فقط بدنهٔ پیام — نه کل حباب (تیک آبی / بج فایل) */
    color: #111b21;
    -webkit-text-fill-color: #111b21;
}

.bubble.deleted {
    background: transparent !important;
    border: 1px dashed rgba(107, 114, 128, 0.45);
    box-shadow: none;
    opacity: 0.88;
    border-radius: 18px;
}
.bubble.mine.deleted {
    border-end-start-radius: 18px;
}
.bubble.theirs.deleted {
    border-end-end-radius: 18px;
}

.bubble.mine.deleted,
.bubble.theirs.deleted {
    color: #6b7280;
}

.bubble .text.deleted-text {
    font-style: italic;
    opacity: 0.95;
    font-size: 0.92em;
    color: #6b7280;
    -webkit-text-fill-color: #6b7280;
}

.bubble .meta {
    display: flex;
    flex-direction: row;
    direction: ltr;
    justify-content: flex-start;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    font-size: 11px;
    color: #8c8c94;
    -webkit-text-fill-color: currentColor;
    position: relative;
    z-index: 1;
}

.bubble .meta .time {
    line-height: 1;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

.bubble .meta .edited-label {
    font-size: 10px;
    color: #9a9aa3;
    -webkit-text-fill-color: currentColor;
    margin-inline-end: 2px;
    line-height: 1;
}

.bubble .meta .tick {
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    -webkit-text-fill-color: currentColor;
}

.bubble .meta .tick.sent {
    color: #8c8c94;
    -webkit-text-fill-color: #8c8c94;
}

.bubble .meta .tick.read {
    color: #6366f1;
    -webkit-text-fill-color: #6366f1;
}
.bubble img {
    max-width: 280px;
    border-radius: 14px;
    display: block;
}

.bubble-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 280px;
    min-width: 120px;
    min-height: 90px;
}

.bubble-image-wrap--clickable {
    cursor: zoom-in;
}

.bubble-image-wrap--clickable:focus-visible {
    outline: 2px solid #5b5ef0;
    outline-offset: 2px;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 18, 0.88);
    padding: 24px;
    outline: none;
}

.image-lightbox-stage {
    position: relative;
    max-width: min(96vw, 1400px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.image-lightbox-img {
    display: block;
    max-width: 96vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
}

.image-lightbox-caption,
.image-lightbox-counter {
    color: #f4f5f8;
    font-size: 13px;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.image-lightbox-close,
.image-lightbox-nav {
    position: absolute;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.image-lightbox-close:hover,
.image-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.image-lightbox-close {
    top: 18px;
    inset-inline-end: 18px;
}

.image-lightbox-prev {
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.image-lightbox-next {
    inset-inline-end: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.image-lightbox-close .fa-icon,
.image-lightbox-nav .fa-icon {
    font-size: 18px;
    line-height: 1;
}

.bubble-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 22, 30, 0.55);
    border-radius: 10px;
    z-index: 2;
}

.bubble-upload-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.bubble-upload-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-upload-pct {
    font-size: 13px;
    font-weight: 800;
    color: #1c1c21;
    line-height: 1;
    letter-spacing: -0.02em;
}

.bubble-upload-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: list-spinner-spin 0.75s linear infinite;
}

.bubble-file-wrap {
    position: relative;
    min-width: 200px;
    max-width: 280px;
}

.bubble-file-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    color: inherit;
    text-decoration: none;
}

.bubble.mine .bubble-file-link {
    background: rgba(61, 155, 82, 0.12);
}

.bubble-file-link--pending {
    cursor: default;
}

.bubble-file-badge {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.14);
    color: #4f46e5;
    -webkit-text-fill-color: currentColor;
}

.bubble-file-badge-icon {
    font-size: 24px;
    line-height: 1;
}

.bubble-file-badge-label {
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

.bubble-file-badge--pdf {
    background: rgba(220, 53, 69, 0.12);
    color: #c62828;
}

.bubble-file-badge--word {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.bubble-file-badge--sheet {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.bubble-file-badge--slides {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
}

.bubble-file-badge--archive {
    background: rgba(161, 98, 7, 0.12);
    color: #a16207;
}

.bubble-file-badge--video {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
}

.bubble-file-badge--audio {
    background: rgba(8, 145, 178, 0.12);
    color: #0e7490;
}

.bubble-file-badge--text {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.bubble-file-badge--image {
    background: rgba(236, 72, 153, 0.12);
    color: #be185d;
}

.bubble-file-badge--generic {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.composer-attach {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 6px;
    direction: rtl;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.composer-attach-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.composer-attach-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.composer-attach-name {
    font-size: 13px;
    font-weight: 600;
    color: #1c1c21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composer-attach-hint {
    font-size: 12px;
    color: #8c8c94;
}

.composer-attach-close {
    border: none;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    font-family: inherit;
}

.composer-attach-close:hover {
    color: #1c1c21;
}

.bubble-file-icon {
    font-size: 22px;
    color: #6366f1;
    -webkit-text-fill-color: currentColor;
    flex-shrink: 0;
}

.bubble.mine .bubble-file-icon {
    color: #3d9b52;
    -webkit-text-fill-color: #3d9b52;
}

.bubble-file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bubble-file-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

.bubble-file-size {
    font-size: 12px;
    color: #8c8c94;
    -webkit-text-fill-color: #8c8c94;
}

.composer-float {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    background: transparent;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

.composer-float::after {
    display: none;
}

.composer-area {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e2e8;
    border-radius: 28px;
    margin: 0 20px 16px;
    min-height: 51px;
    pointer-events: auto;
    overflow: visible;
}

.composer-status {
    padding: 6px 16px 0;
    font-size: 12px;
    line-height: 1.35;
    color: #c92a2a;
    direction: rtl;
    flex-shrink: 0;
}

.composer-reply {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px 6px;
    direction: rtl;
    flex-shrink: 0;
}

.composer-reply-bar {
    width: 3px;
    border-radius: 2px;
    background: #6366f1;
    flex-shrink: 0;
    min-height: 32px;
}

.composer-edit .composer-reply-bar {
    background: #0ca678;
}

.composer-reply-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.composer-reply-sender {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    line-height: 1.2;
}

.composer-reply-text {
    font-size: 13px;
    color: #8c8c94;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composer-reply-close {
    border: none;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    align-self: flex-start;
    font-family: inherit;
}

.composer-reply-close:hover {
    color: #1c1c21;
}

.composer-attach .bubble-file-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.composer-attach .bubble-file-badge-icon {
    font-size: 20px;
}

.composer-attach .bubble-file-badge-label {
    font-size: 9px;
}

.composer-attach-voice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.voice-record-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 8px 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8ebf0;
    direction: rtl;
}

.voice-record-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    flex-shrink: 0;
    animation: voice-record-pulse 1s ease-in-out infinite;
}

@keyframes voice-record-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.85);
    }
}

.voice-record-mic {
    color: #e53935;
    font-size: 16px;
}

.voice-record-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #1c1c21;
    min-width: 3.2em;
}

.voice-record-label {
    flex: 1;
    color: #8c8c94;
    font-size: 13px;
}

.voice-record-cancel,
.voice-record-stop {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.voice-record-cancel {
    background: #f2f3f5;
    color: #5c5c66;
}

.voice-record-stop {
    background: #6366f1;
    color: #fff;
}

.bubble.bubble--voice {
    max-width: min(94%, 380px);
    /* Don't force 280px — overflows narrow / mobile chat columns */
    min-width: min(240px, 100%);
    padding: 8px 12px;
}

.bubble-voice-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    position: relative;
    direction: rtl;
}

.bubble-voice-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.14);
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bubble.mine .bubble-voice-icon {
    background: rgba(47, 158, 68, 0.16);
    color: #2f9e44;
}

.bubble-voice-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}

.bubble-voice-player {
    width: 100%;
    min-width: 0;
    position: relative;
}

.bubble-voice-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    direction: ltr;
}

.bubble-voice-audio-hidden {
    /* Firefox won't play media with display:none — keep in layout but invisible */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.bubble-voice-play {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.14);
    color: #6366f1;
    -webkit-text-fill-color: currentColor;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.bubble.mine .bubble-voice-play {
    background: rgba(47, 158, 68, 0.16);
    color: #2f9e44;
    -webkit-text-fill-color: #2f9e44;
}

.bubble-voice-play--pause {
    background: rgba(99, 102, 241, 0.28);
}

.bubble.mine .bubble-voice-play--pause {
    background: rgba(47, 158, 68, 0.28);
}

.bubble-voice-play .fa-icon {
    font-size: 14px;
    line-height: 1;
}

.bubble-voice-mute {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.bubble-voice-mute--on {
    color: #e03131;
    background: rgba(224, 49, 49, 0.1);
}

.bubble-voice-mute .fa-icon {
    font-size: 13px;
    line-height: 1;
}

.bubble-voice-track {
    position: relative;
    flex: 1;
    min-width: 100px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    padding: 12px 0;
    cursor: pointer;
    font-family: inherit;
    display: block;
    overflow: visible;
}

.bubble-voice-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 6px;
    margin-top: -3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
}

.bubble-voice-progress {
    position: absolute;
    left: 0;
    top: 50%;
    height: 6px;
    margin-top: -3px;
    border-radius: 999px;
    background: #6366f1;
    min-width: 0;
    max-width: 100%;
    transition: width 0.08s linear;
    pointer-events: none;
}

.bubble.mine .bubble-voice-progress {
    background: #2f9e44;
}

.bubble-voice-knob {
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #6366f1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bubble.mine .bubble-voice-knob {
    border-color: #2f9e44;
}

.bubble-voice-time {
    flex-shrink: 0;
    min-width: 2.8em;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #8c8c94;
    text-align: center;
}

.bubble-voice-pending {
    font-size: 13px;
    color: #8c8c94;
}

.bubble-voice-fallback {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #8c8c94;
    direction: rtl;
}

.bubble-voice-download {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.bubble.mine .bubble-voice-download {
    color: #2f9e44;
}

.bubble-reply {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 6px;
    direction: rtl;
}

.bubble-reply-bar {
    width: 3px;
    border-radius: 2px;
    background: #6366f1;
    flex-shrink: 0;
}

.bubble.mine .bubble-reply-bar {
    background: #3d9b52;
}

.bubble-reply-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bubble-reply-sender {
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    line-height: 1.2;
}

.bubble.mine .bubble-reply-sender {
    color: #3d9b52;
}

.bubble-reply-text {
    font-size: 12px;
    color: #8c8c94;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.composer {
    min-height: 51px;
    padding: 4px 12px;
    display: flex;
    flex-direction: row;
    direction: ltr;
    gap: 6px;
    align-items: center;
    box-sizing: border-box;
}

.composer-icon {
    border: none;
    background: transparent;
    color: #8c8c94;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-family: inherit;
}

.composer-icon:hover {
    background: rgba(99, 102, 241, 0.08);
}

.composer-icon .fa-icon {
    font-size: 18px;
    line-height: 1;
}

.composer-plus.active,
.composer-icon.active {
    color: #6366f1;
}

.emoji-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
}

.emoji-picker-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 8px;
    right: 8px;
    z-index: 10000;
    pointer-events: auto;
    max-height: min(320px, 42vh);
    background: #fff;
    border: 1px solid #e0e2e8;
    border-radius: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
}

.emoji-picker-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px 4px;
    border-bottom: 1px solid #eef0f6;
    flex-shrink: 0;
}

.emoji-picker-tab {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #8c8c94;
    cursor: pointer;
}

.emoji-picker-tab.active {
    background: #f0f0fc;
    color: #6366f1;
}

.emoji-picker-cats {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    overflow-x: auto;
    flex-shrink: 0;
    border-bottom: 1px solid #f3f4f6;
}

.emoji-picker-cat {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    color: #8c8c94;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.emoji-picker-cat.active {
    background: #eef0f6;
    color: #1c1c21;
    font-weight: 600;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 8px 10px 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.emoji-picker-grid--stickers {
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    padding: 6px 8px 8px;
}

.emoji-picker-cell {
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    padding: 6px 2px;
    cursor: pointer;
}

.emoji-picker-cell:hover {
    background: #f3f4f6;
}

.emoji-picker-sticker {
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 3px;
    cursor: pointer;
    aspect-ratio: 1;
    max-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.emoji-picker-sticker:hover {
    transform: scale(1.04);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.emoji-picker-sticker-img {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.emoji-picker-sticker-emoji {
    font-size: 30px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.sticker-row .sticker-bubble {
    background: transparent;
    box-shadow: none;
    padding: 4px 8px;
    border-radius: 0;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
}

.bubble-sticker-wrap img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    display: block;
}

.composer-send {
    color: #6366f1;
}

.composer-send .fa-icon {
    font-size: 16px;
}

.composer-input {
    flex: 1;
    height: 38px;
    min-height: 38px;
    max-height: 192px;
    resize: none;
    overflow-y: hidden;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    direction: rtl;
    text-align: right;
    color: #1c1c21;
    box-sizing: border-box;
}

.composer-input:focus {
    outline: none;
}

.attach-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
}

.attach-menu-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 34px;
    z-index: 10000;
    pointer-events: auto;
    width: 220px;
    max-height: min(60dvh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e2e8;
    border-radius: 14px;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1ede7;
    padding: 20px;
}
.login-stack {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
.login-card h1 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
}
.login-card p {
    margin: 0 0 20px;
    text-align: center;
    color: #8c8c94;
    font-size: 14px;
}
.field {
    margin-bottom: 12px;
}
.field label {
    display: block;
    font-size: 13px;
    color: #8c8c94;
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    border: 1px solid #e0e2e8;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 15px;
}
.login-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.login-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 0 4px;
}
.login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #0b8f7a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}
.login-link .fa-icon {
    font-size: 16px;
    width: 1.25em;
    text-align: center;
    flex-shrink: 0;
}
.login-link:hover {
    background: #fff;
    text-decoration: none;
}

.auth-loading-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #f1ede7;
    padding: 20px;
}

.auth-loading-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1c1c21;
}

.auth-loading-text {
    margin: 0;
    font-size: 15px;
    color: #8c8c94;
}

.auth-progress {
    width: min(280px, 72vw);
    height: 7px;
    background: #e0e2e8;
    border-radius: 999px;
    overflow: hidden;
    direction: ltr;
}

.auth-progress-bar {
    width: 100%;
    height: 100%;
    background: #6366f1;
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left center;
    animation: auth-progress-fill 2.8s ease-out forwards;
}

.logout-overlay .auth-progress-bar {
    animation-duration: 4s;
}

@keyframes auth-progress-fill {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.btn {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary {
    background: #6366f1;
    color: #fff;
}
.btn-secondary {
    background: #f0f0fc;
    color: #6366f1;
}
.btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.error {
    color: #c0392b;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

.empty-chat {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8c94;
    font-size: 15px;
}

.bubble-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.bubble-menu-panel {
    position: fixed;
    z-index: 10000;
    width: 175px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e2e8;
    border-radius: 14px;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bubble-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #1c1c21;
    cursor: pointer;
}

.bubble-menu-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.bubble-menu-item.destructive {
    color: #d94040;
}

.bubble-menu-item.destructive:hover {
    background: rgba(217, 64, 64, 0.1);
}

.bubble-menu-item.destructive .bubble-menu-icon {
    color: #d94040;
}

.bubble-menu-label {
    flex: 1;
    text-align: start;
}

.bubble-menu-icon {
    font-size: 16px;
    color: #6366f1;
    line-height: 1;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.bubble-menu-sep {
    height: 1px;
    margin: 6px 10px;
    background: #e8ebf0;
}

.hidden-input {
    display: none;
}

/* ── Mobile layout (viewport ≤ 768px) ── */
@media (max-width: 768px) {
    html {
        height: 100%;
        height: -webkit-fill-available;
    }

    html,
    body,
    #root {
        height: var(--app-height, 100%);
        min-height: var(--app-height, 100%);
        max-height: var(--app-height, 100%);
        max-width: 100%;
        overflow: hidden;
        overflow-x: hidden;
    }

    .app-root {
        position: fixed;
        top: var(--vv-offset-top, 0px);
        left: 0;
        right: 0;
        width: 100%;
        height: var(--app-height, 100%);
        min-height: var(--app-height, 100%);
        max-height: var(--app-height, 100%);
        max-width: 100%;
        overflow: hidden;
        overflow-x: hidden;
    }

    .messenger,
    .chat-panel,
    .chat-list-panel,
    .settings-panel {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Safari tab: svh matches visible area with chrome. Installed PWA: use dvh/lvh + --app-height. */
    @media all and (display-mode: browser) {
        @supports (height: 100svh) {
            html,
            body,
            #root {
                height: 100svh;
                max-height: 100svh;
                min-height: 100svh;
            }
        }
    }

    @media all and (display-mode: standalone),
        all and (display-mode: fullscreen),
        all and (display-mode: minimal-ui) {
        html,
        body,
        #root {
            height: var(--app-height, 100dvh);
            min-height: var(--app-height, 100dvh);
            max-height: var(--app-height, 100dvh);
        }

        @supports (height: 100lvh) {
            html,
            body,
            #root {
                height: var(--app-height, 100lvh);
                min-height: var(--app-height, 100lvh);
                max-height: var(--app-height, 100lvh);
            }
        }
    }

    .messenger {
        flex-direction: column;
        height: 100%;
        min-height: 0;
        max-height: 100%;
    }

    .list-header {
        padding-top: max(12px, env(safe-area-inset-top, 0px));
    }

    .chat-list-panel {
        width: 100%;
        flex: 1;
        min-height: 0;
        border-left: none;
    }

    .messenger.messenger--detail-open .chat-list-panel,
    .messenger.messenger--settings-open .chat-list-panel {
        display: none;
    }

    .messenger:not(.messenger--detail-open):not(.messenger--settings-open) .chat-panel {
        display: none !important;
    }

    .messenger.messenger--detail-open .chat-panel,
    .messenger.messenger--settings-open .chat-panel {
        display: flex;
        flex: 1;
        min-height: 0;
    }

    /* در گفتگو نوار پایین مخفی — فضای کامل برای composer */
    .messenger.messenger--detail-open .nav-rail {
        display: none;
    }

    .nav-rail {
        order: 10;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: stretch;
        border-left: none;
        border-top: 1px solid #e0e2e8;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        flex-shrink: 0;
    }

    .nav-rail-user {
        display: none;
    }

    .nav-rail-bar {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
        gap: 0;
        min-height: 0;
    }

    .nav-rail-bar .nav-rail-item:last-child {
        margin-top: 0;
    }

    .nav-rail-item {
        flex: 1;
        max-width: 80px;
        padding: 5px 2px;
        gap: 5px;
    }

    .nav-rail-icon,
    .nav-rail-item .fa-icon {
        font-size: 19px;
    }

    .nav-rail-label {
        font-size: 10px;
        font-weight: 600;
    }

    .chat-header {
        position: sticky;
        top: 0;
        z-index: 12;
        padding-top: env(safe-area-inset-top, 0px);
        height: auto;
        min-height: 66px;
        flex-shrink: 0;
    }

    .settings-panel .settings-header {
        padding-top: env(safe-area-inset-top, 0px);
        height: auto;
        min-height: 66px;
    }

    .settings-panel .settings-body {
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    }

    .chat-header-back {
        flex-shrink: 0;
        margin-inline-end: 6px;
        padding-inline-end: 12px;
    }

    .settings-back-btn {
        margin-inline-end: 6px;
        padding-inline-end: 12px;
    }

    .chat-header-actions {
        display: flex;
        gap: 2px;
    }

    /* روی موبایل فقط دکمهٔ تماس صوتی */
    .chat-header-actions .chat-header-icon:not(.chat-header-call) {
        display: none;
    }

    .call-overlay {
        padding: max(24px, env(safe-area-inset-top, 0px)) 16px
            max(24px, env(safe-area-inset-bottom, 0px));
    }

    .call-overlay--video {
        padding: 0;
    }

    .composer-float {
        background: #f1ede7;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .composer-float::after {
        display: none;
    }

    .composer-area {
        margin: 0 10px 10px;
        border-radius: 22px;
        padding-bottom: 0;
    }

    .attach-menu-panel {
        left: 24px;
    }

    .timeline {
        /* ≥26px so iMessage tail (::after at -26px) stays inside the scrollport */
        padding: 10px 28px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
    }

    .bot-keyboard {
        position: relative;
        z-index: 1;
        margin-bottom: 4px;
        max-width: 100%;
    }

    .bot-keyboard-btn {
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    }

    .bubble {
        max-width: min(88%, 100%);
    }

    .bubble.bubble--voice {
        max-width: min(92%, 100%);
        min-width: 0;
        width: min(100%, 360px);
    }

    .new-chat-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .new-chat-card {
        max-height: 90dvh;
        overflow-y: auto;
    }

    .login-screen {
        min-height: 100dvh;
        height: auto;
        padding: max(16px, env(safe-area-inset-top, 0px)) 16px
            max(16px, env(safe-area-inset-bottom, 0px));
        align-items: flex-start;
        padding-top: max(24px, env(safe-area-inset-top, 0px));
    }

    .login-card {
        margin: 0;
        max-width: none;
    }
}

/* --- Room list context menu & badges --- */
.room-context-menu {
    min-width: 210px;
    z-index: 10001;
}

.room-row-pin,
.room-row-mute {
    font-size: 11px;
    margin-inline-end: 4px;
    opacity: 0.75;
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.preview-row .preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-unread-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #2f6bff;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(47, 107, 255, 0.35);
}

/* --- Encryption recovery key --- */
.settings-hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--settings-value);
}

.settings-hint--error {
    color: #e53935;
    margin: 4px 0 0;
}

.settings-field-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    color: var(--settings-label);
}

.settings-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--settings-divider);
    border-radius: 10px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    resize: vertical;
    box-sizing: border-box;
    background: var(--settings-group-bg);
    color: var(--settings-label);
}

.settings-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.settings-btn--file {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
}

.settings-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.recovery-key-box {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef3ff;
    color: #1c1c1e;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-all;
    user-select: all;
}

.recovery-key-import {
    margin-top: 4px;
}

.recovery-key-logout-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.recovery-key-logout-panel {
    width: min(420px, 100%);
    max-height: min(90vh, 560px);
    overflow-y: auto;
    padding: 20px 18px 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.recovery-key-logout-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1c1c1e;
}

.recovery-key-logout-lead,
.recovery-key-logout-hint,
.recovery-key-logout-warn {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.55;
    color: #3a3a3c;
}

.recovery-key-logout-warn {
    color: #b45309;
}

.recovery-key-logout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.recovery-key-logout-cancel {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #8e8e93;
    font-size: 14px;
    cursor: pointer;
}

.recovery-key-logout-cancel:hover {
    color: #1c1c1e;
}

/* --- Modal (room info) --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-panel {
    width: min(420px, 100%);
    max-height: 85dvh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    color: #666;
}

.room-info-subtitle {
    margin: 0 0 8px;
    color: #666;
    font-size: 13px;
    word-break: break-all;
}

.room-info-encrypted {
    margin: 0 0 12px;
    font-size: 12px;
    color: #5b5ef0;
}

.room-info-members h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.room-info-member-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.room-info-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f4;
}

.room-info-member-meta {
    flex: 1;
    min-width: 0;
}

.room-info-member-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.room-info-member-id {
    display: block;
    font-size: 11px;
    color: #888;
    word-break: break-all;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

/* --- In-chat search --- */
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e8e8ee;
    background: #fafafc;
}

.chat-search-icon {
    color: #888;
    font-size: 14px;
}

.chat-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    outline: none;
}

.chat-search-close {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: #666;
}

.composer-bot-keyboard {
    padding: 8px 10px 4px;
    border-bottom: 1px solid #e8e8ee;
    background: #fafafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
    flex-shrink: 0;
}

.composer-bot-keyboard .bot-keyboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.composer-bot-keyboard .bot-keyboard-btn {
    flex: 1 1 45%;
    min-width: 0;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #d8d8e0;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1e;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.composer-bot-keyboard .bot-keyboard-btn:hover {
    background: #f3f6fb;
    border-color: #b8c8e8;
}

.composer-bot-keyboard .bot-keyboard-btn:active {
    background: #e8eef8;
}

.bot-btn-icon {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Free Solid", sans-serif;
    font-size: 13px;
    font-weight: 900;
    flex-shrink: 0;
    color: #3b6fd9;
}

.bot-btn-label {
    font-family: "Vazirmatn", Tahoma, sans-serif;
    line-height: 1.35;
}

.org-bot-row .preview {
    color: #8c8c94;
    font-size: 12px;
}

/* تم و اندازه فونت از تنظیمات */
html[data-font="small"] {
    font-size: 14px;
}
html[data-font="medium"] {
    font-size: 16px;
}
html[data-font="large"] {
    font-size: 18px;
}

html[data-theme="light"] {
    color-scheme: only light;
}
html[data-theme="dark"] {
    color-scheme: only dark;
}
html[data-theme="system"] {
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: only dark;
    }
}
@media (prefers-color-scheme: light) {
    html[data-theme="system"] {
        color-scheme: only light;
    }
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body,
    html[data-theme="system"] .app-root {
        background: #12141a;
        color: #f3f4f6;
    }
    html[data-theme="system"] .nav-rail,
    html[data-theme="system"] .list-panel,
    html[data-theme="system"] .chat-panel {
        background: #1a1d26;
        color: #f3f4f6;
        border-color: #2c3140;
    }
    html[data-theme="system"] .chat-body {
        background: #0b141a;
    }
    html[data-theme="system"] .chat-header {
        background: #1f2c34;
        color: #e9edef;
        border-bottom-color: #2a3942;
    }
    html[data-theme="system"] .chat-header .title h2,
    html[data-theme="system"] .chat-header .title p {
        color: #e9edef;
    }
    html[data-theme="system"] .list-header,
    html[data-theme="system"] .chat-list-panel,
    html[data-theme="system"] .new-chat-user-list {
        background: #1f2c34;
        border-color: #2a3942;
    }
    html[data-theme="system"] .list-header h1,
    html[data-theme="system"] .new-chat-user-label,
    html[data-theme="system"] .new-chat-user-meta .name,
    html[data-theme="system"] .bot-start-name {
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .room-meta .time,
    html[data-theme="system"] .room-meta .preview,
    html[data-theme="system"] .new-chat-user-meta .mxid,
    html[data-theme="system"] .bot-start-desc,
    html[data-theme="system"] .org-bot-row .preview,
    html[data-theme="system"] .preview-row .preview,
    html[data-theme="system"] .chat-header-icon,
    html[data-theme="system"] .header-fa-icon {
        color: #8696a0;
        -webkit-text-fill-color: #8696a0;
    }
    html[data-theme="system"] .room-meta .name {
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .room-row,
    html[data-theme="system"] .new-chat-user-row {
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .room-row:not(:last-child)::after {
        background: #2a3942;
    }
    html[data-theme="system"] .room-row:hover,
    html[data-theme="system"] .new-chat-user-row:hover {
        background: #182229;
    }
    html[data-theme="system"] .room-row.active,
    html[data-theme="system"] .new-chat-user-row.selected {
        background: #202c33;
    }
    html[data-theme="system"] .search {
        background: #111b21;
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .list-new-chat-btn {
        background: #111b21;
        color: #6366f1;
        -webkit-text-fill-color: #6366f1;
    }
    html[data-theme="system"] .list-new-chat-btn:hover {
        background: #182229;
        color: #a5b4fc;
        -webkit-text-fill-color: #a5b4fc;
    }
    html[data-theme="system"] .composer-input {
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .settings-panel,
    html[data-theme="system"] .settings-group,
    html[data-theme="system"] .settings-item,
    html[data-theme="system"] .settings-device,
    html[data-theme="system"] .settings-input {
        --settings-bg: #0b141a;
        --settings-group-bg: #1f2c34;
        --settings-divider: #2a3942;
        --settings-icon: #8696a0;
        --settings-chevron: #8696a0;
        --settings-label: #e9edef;
        --settings-value: #8696a0;
        --settings-subpanel-bg: #111b21;
    }
    /* حباب‌ها در تم سیستم+دارک گوشی — fill فقط روی متن، نه تیک/فایل */
    html[data-theme="system"] .bubble.mine {
        background: #005c4b;
        color: #e9edef;
    }
    html[data-theme="system"] .bubble.theirs {
        background: #1f2c34;
        color: #e9edef;
    }
    html[data-theme="system"] .bubble .text {
        color: #e9edef;
        -webkit-text-fill-color: #e9edef;
    }
    html[data-theme="system"] .bubble.mine:not(.deleted):not(.sticker-bubble)::before {
        background-color: #005c4b;
    }
    html[data-theme="system"] .bubble.theirs:not(.deleted):not(.sticker-bubble)::before {
        background-color: #1f2c34;
    }
    html[data-theme="system"] .bubble .meta,
    html[data-theme="system"] .bubble .meta .edited-label,
    html[data-theme="system"] .bubble .meta .tick.sent {
        color: #8696a0;
        -webkit-text-fill-color: #8696a0;
    }
    html[data-theme="system"] .bubble .meta .tick.read {
        color: #53bdeb;
        -webkit-text-fill-color: #53bdeb;
    }
    html[data-theme="system"] .bubble-file-size {
        color: #8696a0;
        -webkit-text-fill-color: #8696a0;
    }
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-root {
    background: #12141a;
    color: #f3f4f6;
}
html[data-theme="dark"] .nav-rail,
html[data-theme="dark"] .list-panel,
html[data-theme="dark"] .chat-panel {
    background: #1a1d26;
    color: #f3f4f6;
    border-color: #2c3140;
}
html[data-theme="dark"] .chat-body {
    background: #0b141a;
}
html[data-theme="dark"] .chat-header {
    background: #1f2c34;
    color: #e9edef;
    border-bottom-color: #2a3942;
}
html[data-theme="dark"] .chat-header .title h2,
html[data-theme="dark"] .chat-header .title p {
    color: #e9edef;
}
html[data-theme="dark"] .list-header,
html[data-theme="dark"] .chat-list-panel,
html[data-theme="dark"] .new-chat-user-list {
    background: #1f2c34;
    border-color: #2a3942;
}
html[data-theme="dark"] .list-header h1,
html[data-theme="dark"] .new-chat-user-label,
html[data-theme="dark"] .new-chat-user-meta .name,
html[data-theme="dark"] .bot-start-name {
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .room-meta .time,
html[data-theme="dark"] .room-meta .preview,
html[data-theme="dark"] .new-chat-user-meta .mxid,
html[data-theme="dark"] .bot-start-desc,
html[data-theme="dark"] .org-bot-row .preview,
html[data-theme="dark"] .preview-row .preview,
html[data-theme="dark"] .chat-header-icon,
html[data-theme="dark"] .header-fa-icon {
    color: #8696a0;
    -webkit-text-fill-color: #8696a0;
}
html[data-theme="dark"] .room-meta .name {
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .room-row,
html[data-theme="dark"] .new-chat-user-row {
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .room-row:not(:last-child)::after {
    background: #2a3942;
}
html[data-theme="dark"] .room-row:hover,
html[data-theme="dark"] .new-chat-user-row:hover {
    background: #182229;
}
html[data-theme="dark"] .room-row.active,
html[data-theme="dark"] .new-chat-user-row.selected {
    background: #202c33;
}
html[data-theme="dark"] .search {
    background: #111b21;
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .list-new-chat-btn {
    background: #111b21;
    color: #6366f1;
    -webkit-text-fill-color: #6366f1;
}
html[data-theme="dark"] .list-new-chat-btn:hover {
    background: #182229;
    color: #a5b4fc;
    -webkit-text-fill-color: #a5b4fc;
}
html[data-theme="dark"] .composer-input {
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .settings-group,
html[data-theme="dark"] .settings-item,
html[data-theme="dark"] .settings-device,
html[data-theme="dark"] .settings-input {
    --settings-bg: #0b141a;
    --settings-group-bg: #1f2c34;
    --settings-divider: #2a3942;
    --settings-icon: #8696a0;
    --settings-chevron: #8696a0;
    --settings-label: #e9edef;
    --settings-value: #8696a0;
    --settings-subpanel-bg: #111b21;
}
html[data-theme="dark"] .settings-btn-ghost {
    background: #2a3942;
    color: #e9edef;
}
html[data-theme="dark"] .settings-switch-slider {
    background: #3b4a54;
}
html[data-theme="dark"] .settings-switch-slider::before {
    background: #f0f2f5;
}
html[data-theme="dark"] .settings-badge {
    background: #005c4b;
    color: #d9fdd3;
}
html[data-theme="dark"] .bubble.mine {
    background: #005c4b;
    color: #e9edef;
}
html[data-theme="dark"] .bubble.theirs {
    background: #1f2c34;
    color: #e9edef;
}
html[data-theme="dark"] .bubble .text {
    color: #e9edef;
    -webkit-text-fill-color: #e9edef;
}
html[data-theme="dark"] .bubble.mine:not(.deleted):not(.sticker-bubble)::before {
    background-color: #005c4b;
}
html[data-theme="dark"] .bubble.theirs:not(.deleted):not(.sticker-bubble)::before {
    background-color: #1f2c34;
}
html[data-theme="dark"] .bubble .meta,
html[data-theme="dark"] .bubble .meta .edited-label,
html[data-theme="dark"] .bubble .meta .tick.sent {
    color: #8696a0;
    -webkit-text-fill-color: #8696a0;
}
html[data-theme="dark"] .bubble .meta .tick.read {
    color: #53bdeb;
    -webkit-text-fill-color: #53bdeb;
}
html[data-theme="dark"] .bubble-file-size {
    color: #8696a0;
    -webkit-text-fill-color: #8696a0;
}
html[data-theme="light"] body,
html[data-theme="light"] .app-root {
    background: #f1ede7;
    color: #1c1c21;
}
html[data-theme="light"] .bubble.mine,
html[data-theme="light"] .bubble.theirs {
    color: #111b21;
}
html[data-theme="light"] .bubble .text {
    color: #111b21;
    -webkit-text-fill-color: #111b21;
}
html[data-theme="light"] .bubble .meta .tick.read {
    color: #6366f1;
    -webkit-text-fill-color: #6366f1;
}



/* --- Contacts --- */
.contacts-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: 0 0 12px;
}
/* room-list stays mounted (empty) on Contacts tab and also has flex:1 —
   without this it steals half the column and the contacts list looks tiny. */
.contacts-panel--hidden {
    display: none !important;
}
.chat-list-panel:has(.contacts-panel:not(.contacts-panel--hidden)) .room-list {
    display: none;
}
.contacts-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 4px;
}
.contacts-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f2f5;
    border-radius: 10px;
    padding: 0 10px;
    min-width: 0;
}
.contacts-search .fa-icon {
    color: #667781;
    font-size: 13px;
}
.contacts-search input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 10px 0;
    font: inherit;
    outline: none;
    min-width: 0;
}
.contacts-tool-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    background: #e9edef;
    color: #111b21;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.contacts-tool-btn:disabled {
    opacity: 0.55;
    cursor: default;
}
.contacts-tool-btn--syncing {
    opacity: 1;
    min-width: 5.5rem;
}
.contacts-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(17, 27, 33, 0.2);
    border-top-color: #111b21;
    border-radius: 50%;
    animation: list-spinner-spin 0.75s linear infinite;
    vertical-align: -2px;
    margin-inline-end: 6px;
}
.contacts-sync-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #e7f8f2;
    color: #0d6b54;
    font-size: 13px;
    line-height: 1.35;
}
.contacts-sync-banner .contacts-btn-spinner {
    border-color: rgba(13, 107, 84, 0.25);
    border-top-color: #0d6b54;
    margin-inline-end: 0;
}
.contacts-status {
    margin: 0 14px 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #d9fdd3;
    color: #111b21;
    font-size: 13px;
    line-height: 1.35;
    direction: rtl;
}
.contacts-tool-btn--primary {
    background: #00a884;
    color: #fff;
}
.contacts-privacy-hint {
    margin: 4px 14px 8px;
    font-size: 12px;
    color: #667781;
    line-height: 1.45;
}
.contacts-help-intro,
.contacts-help-note {
    margin: 0 0 12px;
    font-size: 13px;
    color: #3b4a54;
    line-height: 1.55;
}
.contacts-help-note {
    color: #667781;
    font-size: 12px;
}
.contacts-help-steps {
    margin: 0 0 14px;
    padding-inline-start: 1.4em;
    font-size: 13px;
    color: #111b21;
    line-height: 1.7;
}
.contacts-help-steps li {
    margin-bottom: 4px;
}
.contacts-help-modal .contacts-add-actions {
    justify-content: flex-end;
}
.contacts-loading-msg {
    margin: 12px 0 0;
    font-size: 13px;
    color: #667781;
    text-align: center;
}
.list-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}
.contacts-add-card {
    margin: 0 12px 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f6f7f8;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.contacts-label {
    font-size: 12px;
    color: #667781;
}
.contacts-input {
    border: 0;
    border-bottom: 1px solid #d1d7db;
    background: transparent;
    padding: 8px 2px;
    font: inherit;
    outline: none;
}
.contacts-input:focus {
    border-bottom-color: #00a884;
}
.contacts-error {
    margin: 4px 0 0;
    color: #e53935;
    font-size: 12px;
}
.contacts-add-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.contacts-list {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
.contacts-pull-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #8696a0;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    transition: color 0.15s ease;
}
.contacts-pull-hint--ready {
    color: #00a884;
    font-weight: 600;
}
.contacts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #f0f2f5;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
    font: inherit;
    color: inherit;
}
.contacts-row:hover {
    background: #f5f6f8;
}
.contacts-row:disabled {
    opacity: 0.65;
    cursor: wait;
}
.contacts-row-meta {
    flex: 1;
    min-width: 0;
    text-align: right;
}
.contacts-row-name {
    font-size: 15px;
    font-weight: 600;
    color: #111b21;
}
.contacts-row-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #8696a0;
    direction: ltr;
    text-align: right;
}
.contacts-row-sub--ok {
    color: #00a884;
}
.contacts-row-actions {
    display: flex;
    gap: 4px;
}
.contacts-icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #54656f;
    cursor: pointer;
}
.contacts-icon-btn:hover {
    background: #f0f2f5;
}
.contacts-icon-btn--danger {
    color: #e53935;
}
.contacts-empty-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #8696a0;
}
.contacts-empty-sync-btn {
    margin-top: 16px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
}
