:root {
    --support-ink: #132238;
    --support-muted: #65758b;
    --support-border: #dfe7ed;
    --support-surface: #ffffff;
    --support-soft: #f3f8f7;
    --support-primary: #0f766e;
    --support-primary-dark: #0a5b56;
    --support-accent: #e8f5f2;
    --support-danger: #c0392b;
    --support-warning: #b7791f;
    --support-shadow: 0 24px 70px rgba(19, 34, 56, .12);
}

.support-entry-page,
.support-room-page,
.support-dashboard-page {
    min-height: calc(100vh - 70px);
    color: var(--support-ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(15, 118, 110, .11), transparent 34%),
        radial-gradient(circle at 90% 80%, rgba(34, 197, 94, .08), transparent 30%),
        #f7faf9;
}

.support-entry-shell {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
    gap: 5rem;
    align-items: center;
    padding-block: 5rem;
    max-width: 1120px;
}

.support-intro h1,
.support-dashboard-header h1 {
    margin: .8rem 0 1rem;
    color: var(--support-ink);
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    font-weight: 750;
    line-height: 1.04;
    letter-spacing: -.04em;
}

.support-intro > p,
.support-dashboard-header p {
    max-width: 610px;
    color: var(--support-muted);
    font-size: 1.08rem;
    line-height: 1.8;
}

.support-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--support-primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.support-benefits {
    display: grid;
    gap: .8rem;
    margin-top: 2rem;
}

.support-benefits span {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #405168;
    font-weight: 550;
}

.support-benefits i {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: var(--support-primary);
    background: var(--support-accent);
}

.support-entry-card,
.support-room-card,
.support-inbox-card {
    border: 1px solid rgba(223, 231, 237, .9);
    border-radius: 24px;
    background: var(--support-surface);
    box-shadow: var(--support-shadow);
}

.support-entry-card { padding: 2rem; }

.support-resume-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    border: 1px solid #bfe1da;
    border-radius: 16px;
    background: #f1fbf8;
}

.support-resume-card strong { margin-inline-start: .45rem; }
.support-resume-card p { margin: .25rem 0 0 1.35rem; color: var(--support-muted); font-size: .86rem; }
.support-resume-actions { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.support-status-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: #22c55e; }
.support-status-finished { background: #94a3b8; }
.support-unread-badge { min-width: 1.65rem; padding: .22rem .5rem; border-radius: 99px; color: white; background: #dc2626; text-align: center; font-size: .78rem; font-weight: 700; }
.support-divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0; color: #94a3b8; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.support-divider::before, .support-divider::after { content: ""; height: 1px; flex: 1; background: var(--support-border); }

.support-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.support-field { display: grid; gap: .42rem; }
.support-field-full { grid-column: 1 / -1; }
.support-field label { color: #34455d; font-size: .86rem; font-weight: 650; }
.support-field label span { color: #8a99ab; font-weight: 400; }
.support-field input,
.support-search input,
.support-composer textarea {
    width: 100%;
    border: 1px solid var(--support-border);
    border-radius: 12px;
    outline: 0;
    color: var(--support-ink);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}
.support-field input { min-height: 48px; padding: .75rem .9rem; }
.support-field input:focus,
.support-search input:focus,
.support-composer textarea:focus { border-color: #55a99f; box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.support-primary-button {
    display: flex;
    width: 100%;
    min-height: 52px;
    margin-top: 1.2rem;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    border: 0;
    border-radius: 13px;
    color: white;
    background: var(--support-primary);
    font-weight: 700;
    transition: transform .16s, background .16s;
}
.support-primary-button:hover { background: var(--support-primary-dark); transform: translateY(-1px); }
.support-primary-button:disabled { opacity: .65; transform: none; }
.support-privacy-note { margin: .9rem 0 0; color: var(--support-muted); font-size: .78rem; text-align: center; }
.support-form-error { margin-top: 1rem; padding: .8rem 1rem; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; background: #fef2f2; }

.support-room-shell { max-width: 1040px; padding-block: 2.5rem; }
.support-room-card { display: flex; min-height: 680px; max-height: calc(100vh - 120px); overflow: hidden; flex-direction: column; }
.support-room-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--support-border); }
.support-room-heading, .support-room-actions { display: flex; align-items: center; gap: .9rem; }
.support-room-heading h1 { margin: 0; font-size: 1rem; font-weight: 720; }
.support-room-meta { display: flex; flex-wrap: wrap; gap: .65rem; color: var(--support-muted); font-size: .75rem; }
.support-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #0f766e, #22a06b); }
.support-back-link, .support-icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--support-border); border-radius: 10px; color: #516176; background: #fff; text-decoration: none; }
.support-back-link { width: 36px; height: 36px; }
.support-icon-button { min-height: 38px; padding: .5rem .7rem; font-size: .82rem; }
.support-close-button { border-color: #fecaca; color: #a12b22; background: #fff7f6; }
.support-connection { display: inline-flex; align-items: center; gap: .35rem; }
.support-connection i { width: .48rem; height: .48rem; border-radius: 50%; background: #94a3b8; }
.support-connection.is-online i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .14); }
.support-connection.is-offline i { background: #f59e0b; }
.support-room-status { padding: .35rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.support-room-status-active { color: #9a5d0b; background: #fff7df; }
.support-room-status-opened { color: #0d675f; background: #e9f8f4; }
.support-room-status-finished { color: #526173; background: #edf1f5; }
.support-visitor-strip { display: flex; flex-wrap: wrap; gap: .75rem 1.2rem; padding: .72rem 1.25rem; border-bottom: 1px solid var(--support-border); color: #526173; background: #f8fafb; font-size: .78rem; }
.support-visitor-strip a { text-decoration: none; }
.support-contact-item { display: inline-flex; align-items: center; gap: .45rem; }
.support-contact-phone { color: #334155; font-weight: 600; }
.support-contact-actions { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.support-contact-pill { display: inline-flex; align-items: center; gap: .38rem; padding: .26rem .58rem; border: 1px solid transparent; border-radius: 999px; font-weight: 700; line-height: 1; transition: transform .15s, box-shadow .15s, opacity .15s; }
.support-contact-pill i { font-size: .82rem; }
.support-contact-pill span { white-space: nowrap; }
.support-contact-pill:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
.support-contact-pill--email { color: #475569; border-color: #d9e1e8; background: #fff; }
.support-contact-pill--telegram { color: #006f9f; border-color: #c8e6f5; background: #eaf7fd; }
.support-contact-pill--whatsapp { color: #128c7e; border-color: #cceee8; background: #ecfbf7; }
.support-chat-notice { margin: .75rem 1rem 0; padding: .7rem 1rem; border-radius: 10px; color: #79550c; background: #fff8df; font-size: .84rem; }
.support-message-list { flex: 1; min-height: 260px; padding: 1.3rem; overflow-y: auto; background: linear-gradient(rgba(248, 251, 250, .95), rgba(248, 251, 250, .95)), radial-gradient(#b8cbc7 1px, transparent 1px); background-size: auto, 18px 18px; }
.support-message-row { display: flex; margin: .45rem 0; }
.support-message-row.is-mine { justify-content: flex-end; }
.support-message { max-width: min(75%, 620px); padding: .72rem .9rem .48rem; border: 1px solid #e0e7eb; border-radius: 5px 17px 17px 17px; background: white; box-shadow: 0 4px 15px rgba(19, 34, 56, .05); }
.support-message-row.is-mine .support-message { border-color: #a9ddd2; border-radius: 17px 5px 17px 17px; background: #dcf5ee; }
.support-message-text { margin: 0; color: #24364d; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-message-meta { display: flex; justify-content: flex-end; gap: .35rem; margin-top: .28rem; color: #8190a2; font-size: .68rem; }
.support-message.is-pending { opacity: .65; }
.support-message.is-failed { border-color: #ef9a9a; }
.support-loading-messages { display: flex; height: 100%; align-items: center; justify-content: center; gap: .4rem; }
.support-loading-messages span, .support-typing > span { width: .42rem; height: .42rem; border-radius: 50%; background: #78918d; animation: supportBounce 1.2s infinite; }
.support-loading-messages span:nth-child(2), .support-typing span:nth-child(2) { animation-delay: .15s; }
.support-loading-messages span:nth-child(3), .support-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes supportBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
.support-typing { display: flex; align-items: center; gap: .25rem; padding: .4rem 1.4rem; color: var(--support-muted); background: #f8fbfa; font-size: .75rem; }
.support-typing em { margin-inline-start: .4rem; font-style: normal; }
.support-composer { padding: .9rem 1.1rem .65rem; border-top: 1px solid var(--support-border); background: white; }
.support-composer-row { display: flex; align-items: flex-end; gap: .7rem; }
.support-composer textarea { min-height: 46px; max-height: 140px; padding: .72rem .9rem; resize: none; line-height: 1.45; }
.support-send-button { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border: 0; border-radius: 13px; color: white; background: var(--support-primary); }
.support-send-button:disabled { opacity: .45; }
.support-composer-help { display: flex; justify-content: space-between; padding: .35rem .15rem 0; color: #94a3b8; font-size: .67rem; }
.support-closed-actions { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-top: 1px solid var(--support-border); background: #f8fafb; }
.support-closed-actions > i { color: #22a06b; font-size: 1.4rem; }
.support-closed-actions div { display: grid; flex: 1; }
.support-closed-actions span { color: var(--support-muted); font-size: .78rem; }

.support-dashboard-shell { max-width: 1320px; padding-block: 2.5rem 4rem; }
.support-dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.support-dashboard-header h1 { margin-block: .4rem; font-size: clamp(2rem, 4vw, 3rem); }
.support-dashboard-header p { margin: 0; font-size: .96rem; }
.support-dashboard-connection { display: flex; align-items: center; gap: .8rem; }
.support-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.8rem 0; }
.support-summary-grid article { position: relative; display: grid; min-height: 112px; padding: 1rem 1.15rem; overflow: hidden; border: 1px solid var(--support-border); border-radius: 17px; background: white; box-shadow: 0 10px 35px rgba(19, 34, 56, .06); }
.support-summary-grid span { color: var(--support-muted); font-size: .79rem; font-weight: 600; }
.support-summary-grid strong { align-self: end; font-size: 1.8rem; }
.support-summary-grid i { position: absolute; right: 1rem; bottom: .9rem; color: rgba(15, 118, 110, .13); font-size: 2rem; }
.support-inbox-card { overflow: hidden; box-shadow: 0 18px 50px rgba(19, 34, 56, .08); }
.support-inbox-toolbar { display: flex; padding: 1rem; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--support-border); }
.support-search { position: relative; min-width: 290px; flex: 1; max-width: 460px; }
.support-search i { position: absolute; top: 50%; left: .9rem; color: #94a3b8; transform: translateY(-50%); }
.support-search input { min-height: 42px; padding: .6rem .8rem .6rem 2.45rem; }
.support-filter-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.support-filter-tabs button { padding: .45rem .7rem; border: 0; border-radius: 9px; color: #607086; background: transparent; font-size: .78rem; font-weight: 650; }
.support-filter-tabs button.active { color: var(--support-primary); background: var(--support-accent); }
.support-table-wrap { overflow-x: auto; }
.support-inbox-table { width: 100%; border-collapse: collapse; }
.support-inbox-table th { padding: .8rem 1rem; color: #7c8b9c; background: #f8fafb; font-size: .7rem; text-align: start; text-transform: uppercase; letter-spacing: .06em; }
.support-inbox-table td { padding: .95rem 1rem; border-top: 1px solid #edf1f3; vertical-align: middle; }
.support-inbox-table tbody tr { cursor: pointer; transition: background .15s; }
.support-inbox-table tbody tr:hover { background: #f8fcfb; }
.support-inbox-table tbody tr:focus-visible { outline: 2px solid var(--support-primary); outline-offset: -2px; }
.support-inbox-table tbody tr.has-unread { background: #f4fbf9; }
.support-inbox-table tbody tr.has-unread .support-table-primary { font-weight: 750; }
.support-table-primary { max-width: 280px; overflow: hidden; color: var(--support-text); font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.support-table-secondary { display: block; max-width: 280px; margin-top: .12rem; overflow: hidden; color: var(--support-muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.support-status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.support-status-badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.support-status-badge.is-active { color: #a6670b; background: #fff7df; }
.support-status-badge.is-opened { color: #0f766e; background: #e9f8f4; }
.support-status-badge.is-finished { color: #64748b; background: #eef2f6; }
.support-inbox-table .support-unread-badge { display: inline-grid; margin-inline-start: .35rem; }
.support-agent-label, .support-table-time { color: #526174; font-size: .76rem; white-space: nowrap; }
.support-row-action { padding: .42rem .65rem; border: 1px solid var(--support-border); border-radius: 9px; color: var(--support-primary); background: white; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.support-row-action:hover { border-color: var(--support-primary); background: var(--support-accent); }
.support-row-action:disabled { cursor: wait; opacity: .6; }
.support-icon-button.is-loading i { animation: supportSpin .8s linear infinite; }
.support-visitor-cell { display: flex; align-items: center; gap: .7rem; min-width: 170px; }
.support-visitor-initial { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--support-primary); background: var(--support-accent); font-weight: 750; }
.support-cell-stack { display: grid; gap: .12rem; }
.support-cell-stack strong { font-size: .84rem; }
.support-cell-stack span { max-width: 270px; overflow: hidden; color: var(--support-muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.support-table-status { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 99px; font-size: .7rem; font-weight: 700; }
.support-table-status::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.support-table-status-active { color: #a6670b; background: #fff7df; }
.support-table-status-opened { color: #0f766e; background: #e9f8f4; }
.support-table-status-finished { color: #64748b; background: #eef2f6; }
.support-row-unread { display: inline-grid; min-width: 1.45rem; height: 1.45rem; margin-inline-start: .35rem; padding-inline: .35rem; place-items: center; border-radius: 99px; color: white; background: #dc2626; font-size: .68rem; font-weight: 750; }
.support-table-action { padding: .42rem .65rem; border: 1px solid var(--support-border); border-radius: 9px; color: var(--support-primary); background: white; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.support-inbox-empty { display: grid; min-height: 260px; place-content: center; justify-items: center; gap: .5rem; color: var(--support-muted); text-align: center; }
.support-inbox-empty > i { color: #b7c3cf; font-size: 2.4rem; }
.support-spinner { width: 28px; height: 28px; border: 3px solid #d9e7e4; border-top-color: var(--support-primary); border-radius: 50%; animation: supportSpin .8s linear infinite; }
@keyframes supportSpin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .support-entry-shell { grid-template-columns: 1fr; gap: 2rem; padding-block: 2.5rem; }
    .support-intro { text-align: center; }
    .support-intro > p { margin-inline: auto; }
    .support-benefits { grid-template-columns: repeat(3, 1fr); }
    .support-benefits span { flex-direction: column; text-align: center; font-size: .78rem; }
    .support-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .support-inbox-toolbar { align-items: stretch; flex-direction: column; }
    .support-search { max-width: none; }
}

@media (max-width: 620px) {
    .support-entry-shell, .support-room-shell, .support-dashboard-shell { padding: 1rem .65rem 2rem; }
    .support-entry-card { padding: 1.2rem; }
    .support-form-grid { grid-template-columns: 1fr; }
    .support-field-full { grid-column: auto; }
    .support-resume-card { align-items: stretch; flex-direction: column; }
    .support-room-card { min-height: calc(100vh - 90px); max-height: calc(100vh - 80px); border-radius: 16px; }
    .support-room-header { align-items: flex-start; }
    .support-room-actions { align-items: flex-end; flex-direction: column; }
    .support-icon-button span { display: none; }
    .support-message { max-width: 88%; }
    .support-composer-help span:first-child { display: none; }
    .support-dashboard-header { align-items: flex-start; flex-direction: column; }
    .support-summary-grid { gap: .6rem; }
    .support-summary-grid article { min-height: 95px; }
    .support-filter-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
    .support-inbox-table th:nth-child(4), .support-inbox-table td:nth-child(4),
    .support-inbox-table th:nth-child(5), .support-inbox-table td:nth-child(5) { display: none; }
}
