@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('/public/assets/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('/public/assets/fonts/IBMPlexSansArabic-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('/public/assets/fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('/public/assets/fonts/IBMPlexSansArabic-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Deca';
    src: url('/public/assets/fonts/en/LexendDeca-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Deca';
    src: url('/public/assets/fonts/en/LexendDeca-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Deca';
    src: url('/public/assets/fonts/en/LexendDeca-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lexend Deca';
    src: url('/public/assets/fonts/en/LexendDeca-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #14213d;
    --muted: #718096;
    --line: #e7ebf2;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --navy: #142a72;
    --blue: #2457f5;
    --blue-soft: #edf2ff;
    --green: #16a36a;
    --green-soft: #e9f8f1;
    --yellow: #f6c945;
    --danger: #d44343;
    --shadow: 0 16px 44px rgba(28, 45, 92, .08);
    --radius: 18px;
    --font-arabic: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
    --font-ui: 'Lexend Deca', 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
}

.platform-context {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e5e7eb);
}

.platform-context h4 {
    margin: 0 0 10px;
    color: #142a72;
    font-size: 0.92rem;
}

.platform-context h4:not(:first-child) {
    margin-top: 18px;
}

.platform-context-state,
.platform-orders {
    color: #667085;
    font-size: 0.82rem;
}

.platform-orders {
    display: grid;
    gap: 9px;
}

.platform-order-card {
    display: grid;
    gap: 5px;
    padding: 8px;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    background: #f8faff;
}

.platform-order-card.is-clickable {
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.platform-order-card.is-clickable:hover,
.platform-order-card.is-clickable:focus-visible {
    border-color: #2457f5;
    box-shadow: 0 5px 16px rgba(36, 87, 245, .10);
    outline: none;
}

.platform-order-head,
.platform-order-totals {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.platform-order-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.platform-order-card strong,
.platform-order-card span,
.platform-order-card small {
    font-size: 0.76rem;
}

.platform-order-status {
    color: var(--status-color);
    font-weight: 700;
}

.platform-order-code {
    overflow: hidden;
    color: #718096;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-order-items {
    display: grid;
    gap: 5px;
    margin: 2px 0;
}

.platform-order-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.platform-order-item img {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 7px;
    background: #eef1f6;
    object-fit: cover;
}

.platform-order-item-details {
    display: grid;
    min-width: 0;
}

.platform-order-item-details b {
    overflow: hidden;
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-order-item-details small,
.platform-order-totals small,
.platform-order-store {
    color: #52627a;
}

.platform-order-totals {
    padding-top: 5px;
    border-top: 1px dashed #dce2ec;
    font-weight: 700;
}

.platform-order-link {
    justify-self: start;
    padding: 5px 10px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #2457f5;
    font-size: 0.74rem;
    cursor: pointer;
}

.platform-order-link:disabled {
    color: #52627a;
    background: #e7ebf2;
    cursor: default;
}

.platform-order-paste {
    padding: 5px 10px;
    border: 1px solid #cdd8ff;
    border-radius: 8px;
    color: #142a72;
    background: #edf2ff;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}

.platform-order-paste:hover:not(:disabled) {
    border-color: #2457f5;
    background: #e2e9ff;
}

.platform-order-paste:disabled {
    color: #8a94a6;
    border-color: #e3e7ee;
    background: #f1f3f6;
    cursor: default;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--font-arabic);
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] body {
    font-family: var(--font-ui);
}

button,
input,
textarea,
select {
    font: inherit;
}

.auth-page {
    background:
        radial-gradient(circle at 16% 12%, rgba(36, 87, 245, .18), transparent 28rem),
        radial-gradient(circle at 88% 88%, rgba(246, 201, 69, .24), transparent 26rem),
        #f3f6fb;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card {
    width: min(940px, 100%);
    min-height: 540px;
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    overflow: hidden;
    border: 1px solid rgba(20, 42, 114, .08);
    border-radius: 30px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 30px 90px rgba(25, 45, 100, .15);
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 48px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(20, 42, 114, .96), rgba(36, 87, 245, .9)),
        var(--navy);
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .14;
    background-image:
        linear-gradient(rgba(255, 255, 255, .4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .4) 1px, transparent 1px);
    background-size: 38px 38px;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.brand-mark {
    width: 76px;
    height: 76px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--navy);
    background: var(--yellow);
    border-radius: 22px;
    font-size: 2.7rem;
    font-weight: 900;
    box-shadow: 0 16px 30px rgba(0, 0, 0, .18);
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    object-fit: cover;
    background: var(--yellow);
}

.brand-logo-auth {
    width: 96px;
    height: 96px;
    border: 3px solid rgba(255, 255, 255, .28);
    border-radius: 26px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, .2);
}

.brand-logo-header {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.auth-brand .eyebrow {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, .72);
    font-weight: 700;
}

.auth-brand h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
}

.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 54px;
    text-align: center;
}

.auth-icon {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 50%;
    font-size: 2rem;
}

.auth-content h2 {
    margin: 0 0 12px;
    font-size: 2rem;
    font-weight: 900;
}

.auth-content p {
    max-width: 460px;
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.9;
}

.auth-button {
    min-width: 250px;
    padding: 14px 24px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(36, 87, 245, .22);
}

.language-link {
    margin-top: 20px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 800;
}

.app-frame {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    flex: 0 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 3px 16px rgba(20, 42, 114, .04);
    z-index: 10;
}

.brand-inline,
.header-actions,
.user-chip,
.connection-pill {
    display: flex;
    align-items: center;
}

.brand-inline {
    gap: 12px;
}

.brand-inline > div {
    display: flex;
    flex-direction: column;
}

.brand-inline strong {
    font-size: 1.05rem;
    font-weight: 900;
}

.brand-inline small {
    color: var(--muted);
}

.brand-mark-sm {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 1.55rem;
    box-shadow: none;
}

.header-actions {
    gap: 14px;
}

.preference-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--muted);
    background: #f5f7fa;
    border: 1px solid var(--line);
    border-radius: 10px;
    filter: grayscale(1);
}

.preference-button.active {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: rgba(36, 87, 245, .2);
    filter: none;
}

.quick-page-button {
    text-decoration: none;
    filter: none;
}

.connection-pill {
    gap: 7px;
    padding: 7px 11px;
    color: #117a51;
    background: var(--green-soft);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.connection-pill i {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(22, 163, 106, .12);
}

.header-link {
    margin: 0;
    padding: 7px 10px;
}

.user-chip {
    gap: 8px;
    font-size: .9rem;
    font-weight: 800;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--navy);
    border-radius: 11px;
}

.logout-button {
    padding: 8px 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 700;
}

.workspace {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(310px, 25%) minmax(460px, 1fr) minmax(245px, 21%);
    gap: 1px;
    background: var(--line);
    overflow: hidden;
}

[dir="rtl"] .workspace {
    grid-template-columns: minmax(310px, 25%) minmax(460px, 1fr) minmax(245px, 21%);
}

.queue-panel,
.chat-panel,
.details-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: var(--surface);
    overflow: hidden;
}

.queue-panel {
    display: flex;
    flex-direction: column;
}

.queue-top {
    display: flex;
    gap: 9px;
    padding: 16px 16px 10px;
}

.new-conversation-row {
    padding: 0 16px 12px;
}

.new-conversation-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(36, 87, 245, .2);
    font-size: .84rem;
    font-weight: 900;
}

.new-conversation-button:hover {
    transform: translateY(-1px);
}

.search-wrap {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #f4f6fa;
    border: 1px solid transparent;
    border-radius: 12px;
}

.search-wrap:focus-within {
    border-color: rgba(36, 87, 245, .35);
    background: #fff;
}

.search-wrap input {
    min-width: 0;
    width: 100%;
    height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: .88rem;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: var(--blue-soft);
    border: 0;
    border-radius: 12px;
    font-size: 1.25rem;
}

.counter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    padding: 2px 16px 12px;
}

.counter-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 9px;
    color: var(--muted);
    background: #f7f8fb;
    border: 1px solid transparent;
    border-radius: 11px;
    text-align: start;
}

.counter-card strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.counter-card span {
    width: 100%;
    overflow: hidden;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.counter-card.active {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: rgba(36, 87, 245, .16);
}

.counter-card.active strong {
    color: var(--blue);
}

.queue-tabs {
    display: flex;
    gap: 5px;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--line);
}

.queue-tab {
    flex: 1;
    padding: 8px 6px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 800;
}

.queue-tab.active {
    color: var(--blue);
    background: var(--blue-soft);
}

.conversation-list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 16px;
    color: inherit;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #f0f2f6;
    text-align: start;
}

.conversation-item:hover,
.conversation-item.active {
    background: #f7f9ff;
}

.conversation-item.active {
    box-shadow: inset 3px 0 0 var(--blue);
}

[dir="rtl"] .conversation-item.active {
    box-shadow: inset -3px 0 0 var(--blue);
}

.conversation-avatar,
.contact-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--avatar-color, var(--navy));
    background: var(--avatar-bg, #eef2ff);
    border: 1px solid var(--avatar-border, #dfe6ff);
    border-radius: 14px;
    font-weight: 900;
}

.conversation-copy {
    min-width: 0;
}

.conversation-name-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.conversation-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-size: .9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-preview {
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .79rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    color: var(--muted);
    font-size: .68rem;
}

.unread-badge {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    color: #fff;
    background: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .10);
    border-radius: 999px;
    font-size: .67rem;
    font-weight: 900;
}

.conversation-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.conversation-status-badge i {
    font-size: .72rem;
    line-height: 1;
}

.conversation-status-badge.status-new {
    color: #8a6200;
    background: #fff8df;
    border-color: #f8e6a8;
}

.conversation-status-badge.status-open {
    color: #0f766e;
    background: #e9f9f5;
    border-color: #c7eee5;
}

.conversation-status-badge.status-waiting {
    color: #76520b;
    background: #fff4df;
    border-color: #f2ddb5;
}

.conversation-status-badge.status-closed {
    color: #5f6877;
    background: #f1f3f6;
    border-color: #dfe3e9;
}

.status-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
    background: var(--green);
}

.chat-panel {
    position: relative;
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--muted);
    text-align: center;
    background:
        linear-gradient(rgba(255, 255, 255, .88), rgba(255, 255, 255, .88)),
        radial-gradient(circle, #dfe5f2 1px, transparent 1px);
    background-size: auto, 22px 22px;
}

.empty-illustration {
    width: 112px;
    height: 88px;
    position: relative;
    margin-bottom: 20px;
}

.empty-illustration span:first-child {
    width: 86px;
    height: 68px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 26px 26px 26px 8px;
    font-size: 2.5rem;
}

.empty-illustration span:last-child {
    width: 36px;
    height: 36px;
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--green);
    border: 4px solid #fff;
    border-radius: 50%;
}

.empty-state h2 {
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 900;
}

.chat-view {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.contact-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.mobile-back {
    display: none;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    color: var(--blue);
    background: var(--blue-soft);
    border: 0;
    border-radius: 10px;
    font-size: 1.6rem;
    line-height: 1;
}

.contact-heading h2 {
    margin: 0;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .78rem;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.action-button,
.agent-select {
    height: 36px;
    padding: 0 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .76rem;
    font-weight: 800;
}

.action-button.primary {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: transparent;
}

.action-button.danger {
    color: var(--danger);
}

.agent-select {
    max-width: 150px;
}

.message-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 22px;
    background:
        linear-gradient(rgba(246, 248, 252, .94), rgba(246, 248, 252, .94)),
        radial-gradient(circle, #cbd3e2 1px, transparent 1px);
    background-size: auto, 20px 20px;
}

.message-row {
    max-width: min(76%, 620px);
    display: flex;
    flex-direction: column;
}

.message-row.incoming {
    align-self: flex-start;
}

.message-row.outgoing {
    align-self: flex-end;
}

.message-bubble {
    padding: 10px 13px 8px;
    border-radius: 15px;
    box-shadow: 0 4px 14px rgba(21, 35, 76, .05);
}

.message-row.incoming .message-bubble {
    background: #fff;
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .message-row.incoming .message-bubble {
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 15px;
}

.message-row.outgoing .message-bubble {
    color: #17251a;
    background: #d9fdd3;
    border: 1px solid #c5edbe;
    box-shadow: 0 4px 14px rgba(45, 91, 48, .08);
    border-bottom-right-radius: 4px;
}

[dir="rtl"] .message-row.outgoing .message-bubble {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 15px;
}

.message-text {
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.interactive-options-preview {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    color: #25314d;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(14, 31, 75, .10);
    pointer-events: none;
    user-select: text;
}

.interactive-options-preview > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid #e7ebf2;
}

.interactive-options-preview > header strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #142a72;
    font-size: .73rem;
}

.interactive-options-preview > header small {
    color: #7b8497;
    font-size: .58rem;
}

.interactive-options-list {
    display: grid;
    gap: 6px;
}

.interactive-option-readonly {
    display: grid;
    gap: 2px;
    padding: 7px 9px;
    color: #263451;
    background: #f7f9fd;
    border: 1px solid #e3e8f2;
    border-radius: 9px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.5;
}

.interactive-option-readonly small {
    color: #778198;
    font-size: .62rem;
    font-weight: 500;
}

.message-media {
    display: block;
    max-width: 100%;
    margin-bottom: 7px;
    border-radius: 10px;
}

img.message-media {
    max-height: 360px;
    object-fit: contain;
    background: rgba(0, 0, 0, .06);
}

audio.message-media {
    width: min(320px, 68vw);
    min-width: 240px;
}

video.message-media {
    width: min(420px, 68vw);
    max-height: 420px;
    background: #000;
}

.document-card,
.location-card,
.attachment-state {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(320px, 62vw);
    padding: 11px 12px;
    color: inherit;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(113, 128, 150, .18);
    border-radius: 11px;
    text-decoration: none;
}

.message-row.incoming .document-card,
.message-row.incoming .location-card,
.message-row.incoming .attachment-state {
    background: #f5f7fa;
}

.document-card strong,
.location-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.document-card small,
.location-card small,
.attachment-state {
    color: var(--muted);
}

.message-row.outgoing .document-card small,
.message-row.outgoing .location-card small,
.message-row.outgoing .attachment-state {
    color: #657367;
}

.message-foot {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    color: rgba(113, 128, 150, .9);
    font-size: .64rem;
}

.message-row.outgoing .message-foot {
    color: #667668;
}

.message-failed {
    color: #c62828;
}

.composer {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 13px 18px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.composer-popup {
    position: absolute;
    z-index: 25;
    bottom: calc(100% - 6px);
    min-width: 235px;
    max-width: min(390px, calc(100% - 36px));
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 18px 45px rgba(22, 36, 82, .18);
}

.composer-popup[hidden],
.recording-panel[hidden],
.support-modal[hidden] {
    display: none;
}

.attachment-menu {
    inset-inline-start: 18px;
    padding: 7px;
}

.composer .attachment-menu button {
    width: 100%;
    min-width: 0;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--ink);
    background: transparent;
    border-radius: 10px;
    font-size: .86rem;
    text-align: start;
}

.composer .attachment-menu button:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.attachment-menu button span {
    width: 24px;
    text-align: center;
}

.quick-reply-suggestions {
    inset-inline-start: 72px;
    bottom: calc(100% - 7px);
    width: min(470px, calc(100% - 170px));
    max-height: 320px;
    overflow-y: auto;
    padding: 7px;
}

.composer .quick-suggestion-item {
    width: 100%;
    min-width: 0;
    height: auto;
    display: block;
    padding: 10px 12px;
    color: var(--ink);
    background: transparent;
    border-radius: 10px;
    text-align: start;
}

.composer .quick-suggestion-item:hover,
.composer .quick-suggestion-item.active {
    color: var(--blue);
    background: var(--blue-soft);
}

.quick-suggestion-item strong,
.quick-suggestion-item small {
    display: block;
}

.quick-suggestion-item small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-suggestion-empty {
    padding: 14px;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

.recording-panel {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: #8f2020;
    background: #fff0f0;
    border-radius: 11px;
    font-size: .8rem;
}

.recording-dot {
    width: 9px;
    height: 9px;
    background: #e23d3d;
    border-radius: 50%;
    animation: recordingPulse 1s infinite;
}

.recording-panel #recordingTimer {
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.composer .recording-panel button {
    min-width: 0;
    width: auto;
    height: 30px;
    margin-inline-start: auto;
    padding: 0 10px;
    background: #c93434;
    border-radius: 8px;
    font-size: .74rem;
}

.composer .recording-panel #cancelRecordingButton {
    width: 30px;
    margin-inline-start: 0;
    padding: 0;
    color: #9f2929;
    background: transparent;
}

@keyframes recordingPulse {
    50% {
        opacity: .35;
        transform: scale(.82);
    }
}

.attachment-selection {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--blue-soft);
    border-radius: 10px;
    font-size: .8rem;
}

.attachment-selection[hidden] {
    display: none;
}

.attachment-selection span:nth-child(2) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-selection button {
    min-width: 28px;
    width: 28px;
    height: 28px;
    color: var(--danger);
    background: transparent;
}

.composer textarea {
    min-height: 44px;
    max-height: 140px;
    flex: 1;
    resize: none;
    padding: 11px 14px;
    outline: none;
    background: #f5f7fa;
    border: 1px solid transparent;
    border-radius: 13px;
    line-height: 1.5;
}

.composer textarea:focus {
    background: #fff;
    border-color: rgba(36, 87, 245, .35);
}

.composer button {
    min-width: 92px;
    height: 44px;
    color: #fff;
    background: var(--blue);
    border: 0;
    border-radius: 13px;
    font-weight: 900;
}

.composer .attach-button {
    min-width: 44px;
    width: 44px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 1.15rem;
}

.composer .attachment-selection button {
    min-width: 28px;
    width: 28px;
    height: 28px;
    color: var(--danger);
    background: transparent;
}

.message-bubble {
    position: relative;
}

.save-quick-message {
    position: absolute;
    top: 7px;
    inset-inline-end: 7px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--blue);
    background: rgba(255, 255, 255, .82);
    border: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity .15s ease;
}

.message-bubble:hover .save-quick-message,
.save-quick-message:focus {
    opacity: 1;
}

.message-moderation-actions {
    position: absolute;
    top: 7px;
    inset-inline-start: 7px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease;
}

.message-bubble:hover .message-moderation-actions,
.message-moderation-actions:focus-within,
.message-bubble-hidden .message-moderation-actions {
    opacity: 1;
    transform: translateY(0);
}

.message-moderation-actions button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ink);
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(113, 128, 150, .2);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(10, 24, 61, .12);
    font-size: .78rem;
}

.message-moderation-actions button:hover {
    background: #fff;
    transform: translateY(-1px);
}

.message-moderation-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .64rem;
    line-height: 1.45;
}

.message-moderation-badge.edited {
    color: #1e3a8a;
    background: #dbeafe;
}

.message-row.outgoing .message-moderation-badge.edited {
    color: #1e3a8a;
    background: rgba(219, 234, 254, .86);
}

.message-bubble-hidden {
    min-width: min(360px, 72vw);
    color: #64748b !important;
    background: #f1f5f9 !important;
    border: 1px dashed #94a3b8;
    box-shadow: none;
}

.message-hidden-state {
    display: grid;
    gap: 5px;
    padding: 5px 36px 5px 2px;
}

[dir="rtl"] .message-hidden-state {
    padding: 5px 2px 5px 36px;
}

.message-hidden-state strong {
    color: #334155;
    font-size: .83rem;
}

.message-hidden-state small,
.message-hidden-state span {
    color: #64748b;
    font-size: .68rem;
    line-height: 1.55;
}

.support-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.support-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 19, 49, .52);
    backdrop-filter: blur(2px);
}

.support-modal-card {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 18px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(8, 20, 59, .28);
}

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

.support-modal-card > header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
}

.support-modal-card > header button {
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--muted);
    background: #f3f5f8;
    border: 0;
    border-radius: 10px;
    font-size: 1.25rem;
}

.support-modal-card form {
    display: grid;
    gap: 12px;
}

.support-modal-card label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 800;
}

.support-modal-card input,
.support-modal-card textarea,
.support-modal-card select {
    width: 100%;
    padding: 10px 12px;
    outline: none;
    background: #f7f8fb;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.support-modal-card input:focus,
.support-modal-card textarea:focus,
.support-modal-card select:focus {
    background: #fff;
    border-color: rgba(36, 87, 245, .45);
}

.new-conversation-card {
    width: min(590px, 100%);
}

.new-conversation-description {
    margin: 0 0 16px;
    padding: 11px 13px;
    color: #31506d;
    background: #eef7ff;
    border: 1px solid #d7ebff;
    border-radius: 12px;
    font-size: .78rem;
    line-height: 1.7;
}

.phone-input-wrap {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #f7f8fb;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.phone-input-wrap:focus-within {
    background: #fff;
    border-color: rgba(36, 87, 245, .45);
}

.phone-input-wrap > span {
    padding: 0 12px;
    color: var(--blue);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.phone-input-wrap input {
    border: 0;
    border-inline-start: 1px solid var(--line);
    border-radius: 0;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.phone-input-wrap input:focus {
    border-color: var(--line);
}

.template-state {
    min-height: 20px;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: .72rem;
}

.opt-in-confirmation {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 9px !important;
    padding: 11px 13px;
    color: #31506d !important;
    background: #f7fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    line-height: 1.6;
}

.opt-in-confirmation input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    accent-color: var(--blue);
}

.support-modal-card footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 14px;
}

.close-confirm-card {
    width: min(570px, 100%);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
}

.close-confirm-card .close-confirm-header {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.close-confirm-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffd7d2;
    border-radius: 50%;
    font-size: 1.15rem;
}

.close-confirm-header > div {
    min-width: 0;
}

.close-confirm-card .close-confirm-header h2 {
    margin: 0;
    color: #172033;
    font-size: 1.08rem;
    font-weight: 900;
}

.close-confirm-header p {
    margin: 4px 0 0;
    color: #667085;
    font-size: .76rem;
}

.close-confirm-body {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.close-confirm-body > p {
    margin: 0;
    color: #344054;
    font-size: .84rem;
    line-height: 1.75;
}

.close-confirm-contact {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    background: #f8f9fc;
    border: 1px solid #e7ebf2;
    border-radius: 12px;
}

.close-confirm-contact > span {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    color: var(--avatar-color, #173bba);
    background: var(--avatar-bg, #eef2ff);
    border: 1px solid var(--avatar-border, #dfe6ff);
    border-radius: 50%;
    font-size: .9rem;
    font-weight: 900;
}

.close-confirm-contact > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.close-confirm-contact strong {
    overflow: hidden;
    color: #172033;
    font-size: .84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-confirm-contact small {
    color: #667085;
    font-size: .74rem;
    text-align: start;
}

.close-confirm-note {
    padding: 13px 15px;
    color: #694b00;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
}

.close-confirm-note strong {
    display: block;
    margin-bottom: 7px;
    color: #7a5200;
    font-size: .8rem;
}

.close-confirm-note ul {
    margin: 0;
    padding-inline-start: 20px;
    font-size: .76rem;
    line-height: 1.8;
}

.close-confirm-card .close-confirm-footer {
    margin: 0;
    padding: 14px 20px;
    background: #f8f9fc;
    border-top: 1px solid var(--line);
}

.close-confirm-footer .action-button {
    min-height: 38px;
    padding-inline: 15px;
}

.close-confirm-footer .action-button.danger {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

.close-confirm-footer .action-button.danger:hover:not(:disabled) {
    background: #bb2d3b;
    border-color: #b02a37;
}

.rating-action { border-color:#edb514; color:#805d00; background:#fffaf0; }
.rating-action:hover:not(:disabled) { background:#fff3ca; border-color:#d99d00; }
.rating-confirm-card { width:min(620px,calc(100vw - 30px)); }
.rating-confirm-icon { background:linear-gradient(135deg,#fff3bf,#ffd14a); }
.rating-preview { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; padding:14px; border:1px dashed #e4c05d; border-radius:14px; background:#fffaf0; }
.rating-preview span { padding:5px 9px; border-radius:999px; background:#fff; box-shadow:0 3px 12px rgba(111,82,0,.08); }

.moderation-modal-card {
    width: min(610px, 100%);
}

.moderation-modal-card [hidden] {
    display: none !important;
}

.moderation-warning {
    display: grid;
    gap: 5px;
    margin-bottom: 14px;
    padding: 12px 14px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 13px;
    font-size: .76rem;
    line-height: 1.65;
}

.moderation-warning strong {
    color: #78350f;
}

.location-search {
    margin-bottom: 12px;
}

.location-map {
    height: min(52vh, 430px);
    overflow: hidden;
    background: #eef1f7;
    border-radius: 14px;
}

.location-address {
    min-height: 22px;
    margin: 10px 2px 0;
    color: var(--muted);
    font-size: .8rem;
}

.emoji-modal-card {
    width: min(720px, 100%);
}

.emoji-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.emoji-tabs button {
    flex: 0 0 auto;
    padding: 8px 12px;
    color: var(--muted);
    background: #f4f6fa;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.emoji-tabs button:hover,
.emoji-tabs button.active {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: rgba(36, 87, 245, .16);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(42px, 1fr));
    gap: 7px;
    max-height: min(52vh, 390px);
    overflow-y: auto;
    padding: 4px;
}

.emoji-grid button {
    min-width: 0;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    background: #f7f8fb;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 1.55rem;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.emoji-grid button:hover,
.emoji-grid button:focus {
    background: var(--blue-soft);
    border-color: rgba(36, 87, 245, .2);
    outline: none;
    transform: scale(1.08);
}

.quick-replies-page {
    min-height: 100vh;
    background: #f5f7fb;
}

.quick-page-header {
    position: sticky;
    top: 0;
}

.quick-back-link {
    display: grid;
    place-items: center;
    text-decoration: none;
}

.quick-page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto;
}

.quick-page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.quick-page-toolbar .search-wrap {
    flex: 1;
    background: #fff;
}

.quick-reply-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
}

.quick-reply-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 17px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 7px 25px rgba(17, 35, 88, .05);
}

.quick-reply-card.inactive {
    opacity: .62;
}

.quick-reply-card > header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.quick-reply-card h2 {
    margin: 0 0 6px;
    font-size: .98rem;
    font-weight: 900;
}

.quick-reply-card code {
    color: var(--blue);
    direction: ltr;
}

.quick-reply-card > p {
    flex: 1;
    margin: 16px 0;
    color: #4d5974;
    line-height: 1.75;
    white-space: pre-wrap;
}

.quick-reply-card > footer {
    display: flex;
    gap: 8px;
}

.quick-status-badge {
    align-self: flex-start;
    padding: 5px 8px;
    color: #117a51;
    background: var(--green-soft);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
}

.quick-reply-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    color: var(--muted);
    background: #fff;
    border-radius: 16px;
    text-align: center;
}

.quick-active-field {
    display: flex !important;
    align-items: center;
}

.quick-active-field input {
    width: 18px;
}

.staff-page-shell {
    width: min(1240px, calc(100% - 32px));
}

.staff-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
}

.staff-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 17px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: 0 7px 25px rgba(17, 35, 88, .05);
}

.staff-card.disabled {
    opacity: .62;
}

.staff-card-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: linear-gradient(135deg, #e7ecff, #fff2c9);
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 900;
}

.staff-card-copy {
    min-width: 0;
}

.staff-card-copy h2 {
    margin: 0 0 4px;
    overflow: hidden;
    font-size: .98rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-card-copy p,
.staff-card-copy small {
    display: block;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 9px 0 6px;
}

.staff-card-meta span {
    padding: 4px 7px;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
}

.staff-card-meta span.active {
    color: #117a51;
    background: var(--green-soft);
}

.staff-card-meta span.disabled {
    color: #9f2929;
    background: #fff0f0;
}

.staff-modal-card {
    width: min(960px, 100%);
}

.staff-modal-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-modal-heading small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 500;
}

.staff-settings-row {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    padding: 13px;
    background: #f7f8fb;
    border-radius: 14px;
}

.staff-settings-row select {
    min-height: 42px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.staff-settings-row select:disabled,
.staff-active-toggle:has(input:disabled) {
    opacity: .72;
    cursor: not-allowed;
}

.staff-source-note {
    margin: -3px 2px 2px;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 700;
}

.staff-active-toggle {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.staff-active-toggle input {
    width: 18px;
}

.permissions-title {
    margin: 6px 0 10px;
    font-size: .9rem;
    font-weight: 900;
}

.permission-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.permission-group {
    padding: 12px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.permission-group h4 {
    margin: 0 0 9px;
    color: var(--navy);
    font-size: .8rem;
    font-weight: 900;
}

.permission-check-grid {
    display: grid;
    gap: 5px;
}

.permission-check-grid label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px;
    background: #fff;
    border-radius: 9px;
    cursor: pointer;
}

.permission-check-grid input {
    width: 17px;
    margin-top: 2px;
}

.permission-check-grid strong,
.permission-check-grid small {
    display: block;
}

.permission-check-grid strong {
    font-size: .76rem;
}

.permission-check-grid small {
    margin-top: 2px;
    color: var(--muted);
    direction: ltr;
    font-family: monospace;
    font-size: .62rem;
    text-align: start;
}

.details-panel {
    padding: 22px 18px;
    overflow-y: auto;
}

.details-placeholder {
    color: var(--muted);
    font-weight: 800;
}

.details-profile {
    padding: 12px 0 24px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.details-avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: var(--avatar-color, var(--navy));
    background: var(--avatar-bg, #eef2ff);
    border: 1px solid var(--avatar-border, #dfe6ff);
    border-radius: 22px;
    font-size: 1.5rem;
    font-weight: 900;
}

.details-list dd .conversation-status-badge {
    font-size: .72rem;
    padding: 5px 9px;
}

.details-profile h3 {
    margin: 0 0 5px;
    font-size: 1.05rem;
    font-weight: 900;
}

.details-profile p {
    margin: 0;
    color: var(--muted);
    direction: ltr;
}

.details-list {
    margin: 8px 0 0;
}

.details-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #f0f2f6;
}

.details-list dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.details-list dd {
    margin: 0;
    font-size: .78rem;
    font-weight: 900;
    text-align: end;
}

.empty-list {
    padding: 36px 20px;
    color: var(--muted);
    text-align: center;
}

.skeleton {
    height: 72px;
    margin: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(90deg, #f1f3f7 25%, #fafbfc 50%, #f1f3f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.app-toast {
    position: fixed;
    z-index: 50;
    bottom: 24px;
    left: 50%;
    max-width: min(420px, calc(100% - 36px));
    padding: 11px 16px;
    color: #fff;
    background: var(--ink);
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px);
    transition: .2s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.app-toast.error {
    background: #9f2929;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: minmax(300px, 34%) minmax(440px, 1fr);
    }

    .details-panel {
        display: none;
    }
}

@media (max-width: 820px) {
    .app-header {
        padding: 10px 14px;
    }

    .connection-pill,
    .user-chip span:last-child {
        display: none;
    }

    .workspace {
        display: block;
        position: relative;
    }

    .queue-panel,
    .chat-panel {
        height: 100%;
        min-height: 0;
    }

    .chat-panel {
        display: none;
        position: absolute;
        inset: 0;
        z-index: 8;
    }

    body.chat-open .chat-panel {
        display: block;
    }

    body.chat-open .queue-panel {
        display: none;
    }

    .conversation-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .mobile-back {
        display: grid;
    }

    .chat-header {
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        padding: 14px;
    }

    .auth-card {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 210px;
        padding: 28px;
    }

    .auth-content {
        padding: 36px 24px;
    }

    .app-header {
        gap: 8px;
    }

    .brand-inline small,
    .header-link {
        display: none;
    }

    .counter-grid {
        grid-template-columns: repeat(4, minmax(68px, 1fr));
        overflow-x: auto;
    }

    .chat-header {
        min-height: 112px;
        flex-direction: column;
    }

    .conversation-actions {
        width: 100%;
    }

    .action-button,
    .agent-select {
        flex: 1;
    }

    .message-row {
        max-width: 90%;
    }

    .composer button {
        min-width: 64px;
    }

    .quick-reply-suggestions {
        inset-inline-start: 14px;
        width: calc(100% - 28px);
        max-width: none;
    }

    .quick-page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .support-modal {
        padding: 8px;
    }

    .support-modal-card {
        max-height: calc(100vh - 16px);
        border-radius: 15px;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, minmax(40px, 1fr));
    }

    .staff-cards,
    .permission-groups {
        grid-template-columns: 1fr;
    }

    .staff-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .staff-card > button {
        grid-column: 1 / -1;
    }

    .staff-settings-row {
        grid-template-columns: 1fr;
    }
}
