:root {
    --chat-premium-orange: #ff6b00;
    --chat-premium-amber: #ff8533;
    --chat-premium-violet: #3b82f6; /* Switched violet to a subtle blue/accent */
    --chat-premium-surface: rgba(10, 10, 10, 0.88);
    --chat-premium-surface-soft: rgba(255, 255, 255, 0.05);
    --chat-premium-border: rgba(255, 255, 255, 0.08);
    --chat-premium-text: #f9fafb;
    --chat-premium-muted: #9ca3af;
    --chat-premium-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    --chat-premium-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html,
body {
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 106, 0, 0.16), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(139, 92, 246, 0.13), transparent 34%),
        linear-gradient(145deg, #050507 0%, #090912 48%, #050507 100%);
}

body::before,
body::after {
    position: fixed;
    width: 34rem;
    height: 34rem;
    border-radius: 999px;
    content: "";
    filter: blur(90px);
    opacity: 0.2;
    pointer-events: none;
}

body::before {
    top: -20rem;
    right: -12rem;
    background: #ff6a00;
    animation: premiumAuroraOne 16s ease-in-out infinite alternate;
}

body::after {
    bottom: -22rem;
    left: -12rem;
    background: #7c3aed;
    animation: premiumAuroraTwo 19s ease-in-out infinite alternate;
}

.chat-app {
    position: relative;
    isolation: isolate;
    border: 1px solid var(--chat-premium-border);
    background:
        linear-gradient(180deg, rgba(18, 19, 27, 0.96), rgba(8, 9, 14, 0.94)),
        var(--chat-premium-surface);
    box-shadow:
        var(--chat-premium-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
    .chat-app {
        width: min(1180px, calc(100vw - 48px));
        max-width: 1180px;
        height: min(90dvh, 900px);
        margin: 5dvh auto;
        border-radius: 30px;
        animation: premiumChatEntrance 0.72s var(--chat-premium-ease) both;
    }
}

.chat-header {
    position: relative;
    min-height: 78px;
    gap: 18px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(110deg, rgba(255, 106, 0, 0.11), transparent 38%),
        rgba(16, 17, 24, 0.82);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.chat-header::after {
    position: absolute;
    right: 12%;
    bottom: -1px;
    left: 12%;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 142, 54, 0.8), transparent);
}

.chat-brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.chat-logo-shell {
    position: relative;
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 17px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.14), transparent 45%),
        rgba(255, 255, 255, 0.055);
    box-shadow: 0 12px 30px rgba(255, 106, 0, 0.16);
}

.chat-header .logo {
    width: 39px !important;
    height: 39px !important;
    max-width: 39px !important;
    max-height: 39px !important;
    margin: 0;
    filter: drop-shadow(0 6px 12px rgba(255, 106, 0, 0.38));
}

#full-chat-availability[data-online="false"] {
    color: #f5c56d;
}

#full-chat-availability[data-online="false"] .header-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .14);
}

.chat-presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 13px;
    height: 13px;
    border: 3px solid #111219;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 0 4px rgba(57, 217, 138, 0.1), 0 0 16px rgba(57, 217, 138, 0.7);
}

.header-title {
    min-width: 0;
}

.header-eyebrow {
    display: block;
    margin-bottom: 2px;
    color: #ffb675;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.chat-header .header-title h2 {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 780;
    letter-spacing: -0.035em;
}

.chat-header .header-title p {
    margin-top: 4px;
    color: var(--chat-premium-muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

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

.header-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 10px rgba(57, 217, 138, 0.8);
    vertical-align: 1px;
}

.chat-header-actions {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 9px;
}

.premium-icon-button {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin: 0;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    color: #eef2f8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition:
        transform 0.28s var(--chat-premium-ease),
        border-color 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease;
}

.premium-icon-button::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(135deg, rgba(255, 150, 64, 0.18), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.premium-icon-button:hover {
    border-color: rgba(255, 150, 64, 0.42);
    background: rgba(255, 124, 32, 0.12);
    box-shadow: 0 12px 24px rgba(255, 106, 0, 0.13);
    transform: translateY(-2px);
}

.premium-icon-button:hover::before {
    opacity: 1;
}

.premium-icon-button:active {
    transform: translateY(0) scale(0.94);
}

.back-btn {
    color: #cbd1dc;
}

.sound-icon {
    position: relative;
    z-index: 1;
    font-size: 0.93rem;
    font-weight: 900;
    transition: transform 0.32s var(--chat-premium-ease), opacity 0.2s ease;
}

.sound-toggle-btn.sound-muted .sound-icon {
    opacity: 0.48;
    transform: rotate(-12deg) scale(0.88);
}

.sound-toggle-btn.sound-muted::after {
    position: absolute;
    width: 21px;
    height: 2px;
    border-radius: 99px;
    background: #ff8a3d;
    content: "";
    transform: rotate(-45deg);
}

.end-chat-btn {
    color: #9cf0bf;
}

.end-chat-btn:hover {
    border-color: rgba(57, 217, 138, 0.4);
    background: rgba(57, 217, 138, 0.1);
    box-shadow: 0 12px 24px rgba(57, 217, 138, 0.1);
}

.dw-live-queue-status {
    position: relative;
    z-index: 2;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255, 139, 61, 0.16);
    background: linear-gradient(90deg, rgba(255, 106, 0, 0.13), rgba(139, 92, 246, 0.08));
    color: #ffc795;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    animation: premiumStatusIn 0.45s var(--chat-premium-ease) both;
}

.dw-live-queue-status[data-state="active"] {
    border-bottom-color: rgba(57, 217, 138, 0.16);
    background: linear-gradient(90deg, rgba(57, 217, 138, 0.11), rgba(29, 78, 216, 0.07));
    color: #9cf0bf;
}

#messages {
    position: relative;
    isolation: isolate;
    gap: 14px;
    padding: 24px clamp(18px, 4vw, 34px);
    background:
        radial-gradient(circle at 20% 14%, rgba(255, 106, 0, 0.045), transparent 28%),
        radial-gradient(circle at 80% 86%, rgba(139, 92, 246, 0.045), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}

#messages > * {
    flex: 0 0 auto;
}

#messages::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background-image: radial-gradient(rgba(255, 255, 255, 0.045) 0.65px, transparent 0.65px);
    background-size: 18px 18px;
    opacity: 0.24;
    pointer-events: none;
}

.message-row {
    gap: 11px;
    margin-bottom: 0;
    animation: premiumMessageIn 0.46s var(--chat-premium-ease) both;
}

.message-row.user {
    transform-origin: bottom right;
}

.message-row.bot,
.message-row.admin,
.message-row.agent {
    transform-origin: bottom left;
}

.avatar {
    width: 34px;
    height: 34px;
    padding: 5px;
    border: 1px solid rgba(255, 139, 61, 0.2);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.11);
}

.message {
    max-width: min(76%, 720px);
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 0.94rem;
    line-height: 1.58;
    letter-spacing: -0.005em;
}

.message.user {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom-right-radius: 6px;
    background:
        linear-gradient(135deg, #ff6a00 0%, #ff8b20 56%, #ff9d2e 100%);
    box-shadow:
        0 14px 30px rgba(255, 106, 0, 0.21),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.message.bot,
.message.admin,
.message.agent {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-bottom-left-radius: 6px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.045));
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.045);
    color: #edf0f6;
}

.message .meta,
.message-meta {
    display: flex;
    margin-top: 6px;
    justify-content: flex-end;
    color: currentColor;
    font-size: 0.67rem;
    opacity: 0.6;
}

.message-delivery {
    margin-left: 7px;
    font-weight: 750;
}

.message-delivery.sending {
    opacity: 0.82;
}

.message-delivery.delivered::before {
    margin-right: 3px;
    content: "✓";
}

.message-delivery.failed {
    color: #fff1f2;
    opacity: 1;
}

.message-delivery button {
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.message-row.system {
    justify-content: center;
}

.message.system {
    max-width: 88%;
    padding: 8px 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: #b8c0cf;
    font-size: 0.75rem;
    text-align: center;
}

.message.system .meta {
    display: none;
}

.digix-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.digix-card-body {
    padding: 18px;
}

.digix-card h4 {
    margin-bottom: 7px;
    font-size: 1.02rem;
}

.digix-card-btn,
.dw-self-service-link {
    position: relative;
    overflow: hidden;
    border-radius: 12px !important;
    font-weight: 750 !important;
    letter-spacing: -0.01em;
    transition:
        transform 0.28s var(--chat-premium-ease),
        border-color 0.28s ease,
        background 0.28s ease,
        box-shadow 0.28s ease !important;
}

.digix-card-btn::after,
.dw-self-service-link::after,
.digix-option-chip::after,
.dw-chat-quick-action::after {
    position: absolute;
    top: -120%;
    left: -55%;
    width: 36%;
    height: 340%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.19), transparent);
    transform: rotate(22deg);
    transition: left 0.6s var(--chat-premium-ease);
    pointer-events: none;
}

.digix-card-btn:hover::after,
.dw-self-service-link:hover::after,
.digix-option-chip:hover::after,
.dw-chat-quick-action:hover::after {
    left: 125%;
}

.digix-card-btn:hover,
.dw-self-service-link:hover {
    transform: translateY(-2px);
}

.digix-options-container {
    gap: 9px;
    margin: 0;
    padding: 0 0 4px 45px;
}

.digix-option-chip {
    position: relative;
    min-height: 40px;
    overflow: hidden;
    border: 1px solid rgba(163, 116, 255, 0.3);
    border-radius: 13px;
    background: rgba(124, 58, 237, 0.11);
    color: #d9c9ff;
    font-size: 0.82rem;
    font-weight: 720;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        transform 0.25s var(--chat-premium-ease),
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.digix-option-chip:hover {
    border-color: rgba(190, 156, 255, 0.52);
    background: rgba(124, 58, 237, 0.22);
    box-shadow: 0 12px 24px rgba(91, 33, 182, 0.15);
    transform: translateY(-2px);
}

#digix-self-service-actions.dw-chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px clamp(16px, 3vw, 26px);
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    background: rgba(12, 13, 19, 0.84);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

@media (min-width: 1080px) {
    #digix-self-service-actions.dw-chat-quick-actions {
        justify-content: flex-start;
    }

    #digix-self-service-actions .dw-chat-quick-action {
        min-height: 52px;
        flex-direction: column;
        gap: 4px;
        padding: 6px 4px;
        font-size: 0.67rem;
    }

    #digix-self-service-actions .dw-chat-quick-action-icon {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    #digix-chat-window #digix-self-service-actions .dw-chat-quick-action:last-child:nth-child(3n + 1) {
        grid-column: auto;
    }
}

#digix-self-service-actions .dw-chat-quick-action {
    position: relative;
    min-height: 43px;
    overflow: hidden;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255, 144, 65, 0.2);
    border-radius: 13px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
    color: #d9dde6;
    font-size: 0.75rem;
    font-weight: 720;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition:
        transform 0.25s var(--chat-premium-ease),
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

#digix-self-service-actions .dw-chat-quick-action:hover {
    border-color: rgba(255, 144, 65, 0.5);
    background: rgba(255, 106, 0, 0.11);
    color: #fff4e9;
    box-shadow: 0 10px 24px rgba(255, 106, 0, 0.12);
    transform: translateY(-2px);
}

#digix-self-service-actions .dw-chat-quick-action:active {
    transform: translateY(0) scale(0.98);
}

.input-area {
    gap: 11px;
    padding: 14px clamp(16px, 3vw, 26px) max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    background: rgba(12, 13, 19, 0.91);
    box-shadow: 0 -16px 38px rgba(0, 0, 0, 0.17);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.composer-attachment-button {
    display: inline-grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    margin: 0;
    padding: 0;
    place-items: center;
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.055);
    color: #aeb6c5;
    cursor: pointer;
    transition: transform 0.24s var(--chat-premium-ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.composer-attachment-button:hover,
.composer-attachment-button:focus-visible {
    border-color: rgba(96, 165, 250, 0.42);
    outline: none;
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    transform: translateY(-1px);
}

.composer-attachment-button:active {
    transform: translateY(0) scale(0.95);
}

.composer-attachment-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    transform: none;
}

.composer-shell {
    position: relative;
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: flex-end;
}

.composer-status-dot {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 17px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #39d98a;
    box-shadow: 0 0 12px rgba(57, 217, 138, 0.7);
    transform: translateY(-50%);
    pointer-events: none;
}

#message-input {
    width: 100%;
    min-height: 54px;
    max-height: 126px;
    padding: 16px 18px 15px 38px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 8px 24px rgba(0, 0, 0, 0.13);
    color: #f6f8fb;
    font-family: inherit;
    font-size: 0.93rem;
    line-height: 1.35;
    resize: none;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

#message-input::placeholder {
    color: #747c8e;
}

#message-input:focus {
    border-color: rgba(255, 133, 47, 0.54);
    background: rgba(0, 0, 0, 0.4);
    box-shadow:
        0 0 0 4px rgba(255, 106, 0, 0.09),
        0 14px 34px rgba(0, 0, 0, 0.2);
}

#message-input:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.chat-close-dialog {
    position: absolute;
    z-index: 50;
    display: grid;
    inset: 0;
    padding: 22px;
    place-items: center;
    border-radius: inherit;
    background: rgba(4, 5, 10, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: premiumDialogIn 0.24s ease both;
}

.chat-close-dialog.hidden {
    display: none;
}

.chat-close-card {
    width: min(100%, 430px);
    box-sizing: border-box;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background:
        radial-gradient(circle at 86% 12%, rgba(57, 217, 138, 0.11), transparent 35%),
        linear-gradient(150deg, rgba(30, 32, 43, 0.98), rgba(14, 15, 22, 0.98));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
    color: #f8fafc;
    text-align: center;
    animation: premiumCloseCardIn 0.36s var(--chat-premium-ease) both;
}

.chat-close-icon,
.chat-rating-thanks-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    place-items: center;
    border: 1px solid rgba(57, 217, 138, 0.24);
    border-radius: 16px;
    background: rgba(57, 217, 138, 0.12);
    color: #7ce5a9;
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(57, 217, 138, 0.09);
}

.chat-close-card h3 {
    margin: 0;
    font-size: 1.22rem;
    letter-spacing: -0.03em;
}

.chat-close-card p {
    margin: 10px auto 20px;
    color: #abb2c1;
    font-size: 0.84rem;
    line-height: 1.55;
}

.chat-close-card p.error {
    color: #fecaca;
}

.chat-close-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.chat-close-actions button,
.chat-rating-submit {
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.065);
    color: #eef2f8;
    font: 800 0.78rem/1 Inter, sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

#confirm-close-chat,
.chat-rating-submit {
    border-color: transparent;
    background: linear-gradient(135deg, #ff6a00, #ff9128);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 106, 0, 0.2);
}

.chat-close-actions button:hover,
.chat-rating-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.chat-close-actions button:disabled,
.chat-rating-submit:disabled {
    cursor: wait;
    opacity: 0.55;
}

.chat-rating-card {
    align-self: center;
    width: min(92%, 490px);
    box-sizing: border-box;
    margin: 8px auto;
    padding: 22px;
    border: 1px solid rgba(57, 217, 138, 0.18);
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% 5%, rgba(57, 217, 138, 0.1), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.23);
    color: #f8fafc;
    text-align: center;
    animation: premiumMessageIn 0.46s var(--chat-premium-ease) both;
}

.chat-rating-eyebrow {
    color: #7ce5a9;
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chat-rating-card h3 {
    margin: 6px 0 5px;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.chat-rating-card p {
    margin: 0;
    color: #a8afbf;
    font-size: 0.76rem;
}

.chat-rating-stars {
    display: flex;
    margin: 15px 0 13px;
    justify-content: center;
    gap: 6px;
}

.chat-rating-stars button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #5c6372;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.16));
    transition: color 0.2s ease, transform 0.24s var(--chat-premium-ease);
}

.chat-rating-stars button:hover,
.chat-rating-stars button.selected {
    color: #ff9d2e;
    transform: translateY(-2px) scale(1.08);
}

.chat-rating-card textarea {
    width: 100%;
    min-height: 64px;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.24);
    color: #f8fafc;
    font: 500 0.78rem/1.45 Inter, sans-serif;
    resize: vertical;
}

.chat-rating-card textarea:focus {
    border-color: rgba(255, 133, 47, 0.5);
    outline: 3px solid rgba(255, 106, 0, 0.09);
}

.chat-rating-submit {
    width: 100%;
}

.chat-start-new-button {
    width: 100%;
    min-height: 43px;
    margin-top: 11px;
    padding: 10px 13px;
    border: 1px solid rgba(57, 217, 138, 0.22);
    border-radius: 13px;
    background: rgba(57, 217, 138, 0.11);
    color: #a7f3d0;
    font: 800 0.76rem/1.2 Inter, sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.chat-start-new-button:hover:not(:disabled),
.chat-start-new-button:focus-visible {
    border-color: rgba(57, 217, 138, 0.42);
    outline: none;
    background: rgba(57, 217, 138, 0.17);
    transform: translateY(-1px);
}

.chat-start-new-button.secondary {
    border-color: transparent;
    background: transparent;
    color: #a8afbf;
    box-shadow: none;
}

.chat-start-new-button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.chat-rating-status {
    min-height: 17px;
    margin-top: 7px !important;
    color: #fecaca !important;
}

.chat-rating-card.submitted {
    padding-top: 26px;
    padding-bottom: 26px;
}

.dw-live-queue-status[data-state="closed"] {
    border-bottom-color: rgba(148, 163, 184, 0.14);
    background: rgba(148, 163, 184, 0.08);
    color: #bdc5d3;
}

#send-btn {
    position: relative;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 34%),
        linear-gradient(135deg, #ff5f00, #ff8d20);
    box-shadow:
        0 14px 32px rgba(255, 106, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transition:
        transform 0.3s var(--chat-premium-ease),
        box-shadow 0.3s ease,
        filter 0.3s ease;
}

#send-btn::before {
    position: absolute;
    top: -50%;
    left: -110%;
    width: 60%;
    height: 200%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
    transform: rotate(24deg);
    transition: left 0.7s var(--chat-premium-ease);
}

#send-btn:hover {
    filter: saturate(1.08) brightness(1.05);
    box-shadow:
        0 18px 38px rgba(255, 106, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.03);
}

#send-btn:hover::before {
    left: 130%;
}

#send-btn:active {
    transform: translateY(0) scale(0.94);
}

#send-btn[aria-busy="true"] svg {
    animation: premiumSendPulse 0.9s ease-in-out infinite alternate;
}

.typing {
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.typing span {
    background: linear-gradient(180deg, #ff9d2e, #ff6a00);
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.28);
}

.premium-icon-button:focus-visible,
.digix-option-chip:focus-visible,
.dw-chat-quick-action:focus-visible,
.dw-self-service-link:focus-visible,
#send-btn:focus-visible,
#message-input:focus-visible {
    outline: 2px solid #ffae69;
    outline-offset: 3px;
}

body.light-mode {
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 106, 0, 0.13), transparent 31%),
        radial-gradient(circle at 88% 82%, rgba(139, 92, 246, 0.1), transparent 34%),
        #f4f5f9;
}

body.light-mode .chat-app {
    border-color: rgba(29, 34, 48, 0.09);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 34px 90px rgba(38, 42, 57, 0.16);
}

body.light-mode .chat-header {
    border-bottom-color: rgba(29, 34, 48, 0.08);
    background:
        linear-gradient(110deg, rgba(255, 106, 0, 0.08), transparent 38%),
        rgba(255, 255, 255, 0.9);
}

body.light-mode .premium-icon-button {
    border-color: rgba(29, 34, 48, 0.1);
    background: rgba(255, 255, 255, 0.72);
    color: #353b49;
}

body.light-mode .chat-logo-shell {
    border-color: rgba(29, 34, 48, 0.09);
    background: rgba(255, 255, 255, 0.76);
}

body.light-mode .chat-presence-dot {
    border-color: #fff;
}

body.light-mode .chat-header .header-title p {
    color: #697184;
}

body.light-mode #messages {
    background:
        radial-gradient(circle at 20% 14%, rgba(255, 106, 0, 0.055), transparent 28%),
        radial-gradient(circle at 80% 86%, rgba(139, 92, 246, 0.04), transparent 28%),
        #f7f8fb;
}

body.light-mode #messages::before {
    background-image: radial-gradient(rgba(22, 25, 35, 0.08) 0.6px, transparent 0.6px);
}

body.light-mode .message.bot,
body.light-mode .message.admin,
body.light-mode .message.agent {
    border-color: rgba(29, 34, 48, 0.08);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 30px rgba(38, 42, 57, 0.08);
    color: #252a35;
}

body.light-mode #digix-self-service-actions.dw-chat-quick-actions,
body.light-mode .input-area {
    border-top-color: rgba(29, 34, 48, 0.08);
    background: rgba(255, 255, 255, 0.89);
}

body.light-mode #digix-self-service-actions .dw-chat-quick-action {
    border-color: rgba(255, 106, 0, 0.16);
    background: linear-gradient(160deg, #ffffff 0%, #fff8f1 100%);
    color: #2b3340;
    box-shadow:
        0 8px 18px rgba(255, 106, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.light-mode #message-input {
    border-color: rgba(29, 34, 48, 0.1);
    background: rgba(245, 246, 249, 0.94);
    color: #242936;
}

body.light-mode .composer-attachment-button {
    border-color: rgba(29, 34, 48, 0.1);
    background: rgba(245, 246, 249, 0.92);
    color: #667085;
}

.dw-chat-screenshot-message-image {
    display: block;
    width: min(100%, 420px);
    max-height: 310px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: #0b0d12;
    object-fit: contain;
}

.dw-chat-screenshot-message-copy {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
}

body.light-mode .message.system {
    border-color: rgba(29, 34, 48, 0.08);
    background: rgba(29, 34, 48, 0.055);
    color: #667085;
}

body.light-mode .chat-close-dialog {
    background: rgba(236, 238, 244, 0.72);
}

body.light-mode .chat-close-card,
body.light-mode .chat-rating-card {
    border-color: rgba(29, 34, 48, 0.09);
    background:
        radial-gradient(circle at 92% 6%, rgba(57, 217, 138, 0.1), transparent 35%),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 26px 70px rgba(38, 42, 57, 0.17);
    color: #252a35;
}

body.light-mode .chat-close-card p,
body.light-mode .chat-rating-card p {
    color: #697184;
}

body.light-mode .chat-close-actions button {
    border-color: rgba(29, 34, 48, 0.1);
    background: #f4f5f8;
    color: #353b49;
}

body.light-mode #confirm-close-chat {
    border-color: transparent;
    background: linear-gradient(135deg, #ff6a00, #ff9128);
    color: #fff;
}

body.light-mode .chat-rating-card textarea {
    border-color: rgba(29, 34, 48, 0.1);
    background: #f5f6f9;
    color: #252a35;
}

body.light-mode .chat-start-new-button {
    border-color: rgba(5, 150, 105, 0.2);
    background: rgba(16, 185, 129, 0.09);
    color: #047857;
}

body.light-mode .chat-start-new-button.secondary {
    border-color: transparent;
    background: transparent;
    color: #697184;
}

@media (max-width: 767px) {
    .chat-header {
        min-height: 70px;
        gap: 10px;
        padding: max(12px, env(safe-area-inset-top)) 14px 12px;
    }

    .chat-logo-shell {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 14px;
    }

    .chat-header .logo {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .header-eyebrow {
        display: none;
    }

    .chat-header .header-title p {
        max-width: 46vw;
        font-size: 0.68rem;
    }

    .premium-icon-button {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        border-radius: 13px;
    }

    .back-btn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .chat-header-actions {
        gap: 6px;
    }

    .end-chat-btn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    #messages {
        padding: 16px 13px;
    }

    .message {
        max-width: min(84%, 34rem);
        padding: 11px 13px;
        font-size: 0.9rem;
    }

    #digix-self-service-actions.dw-chat-quick-actions {
        padding: 10px 12px;
    }

    #digix-self-service-actions .dw-chat-quick-action {
        min-height: 41px;
        font-size: 0.71rem;
    }

    .input-area {
        padding: 11px 12px max(11px, env(safe-area-inset-bottom));
    }

    #message-input {
        min-height: 50px;
        padding-top: 14px;
        padding-bottom: 13px;
    }

    #send-btn {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
        border-radius: 16px;
    }

    .composer-attachment-button {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
        border-radius: 14px;
    }

    .chat-close-dialog {
        padding: 16px;
    }

    .chat-close-card {
        padding: 23px 18px;
    }

    .chat-rating-card {
        width: min(96%, 490px);
        padding: 18px 15px;
    }
}

@media (max-width: 420px) {
    .chat-header {
        padding-right: 10px;
        padding-left: 10px;
    }

    .chat-header .header-title p {
        max-width: 39vw;
    }

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

    .message {
        max-width: 87%;
    }

    .chat-header-actions {
        gap: 4px;
    }

    .premium-icon-button:not(.back-btn) {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .chat-close-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes premiumChatEntrance {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premiumMessageIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premiumStatusIn {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes premiumDialogIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes premiumCloseCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premiumSendPulse {
    from {
        opacity: 0.55;
        transform: translateX(-2px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateX(2px) scale(1.04);
    }
}

@keyframes premiumAuroraOne {
    from {
        transform: translate3d(0, 0, 0) scale(0.92);
    }
    to {
        transform: translate3d(-7vw, 8vh, 0) scale(1.08);
    }
}

@keyframes premiumAuroraTwo {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(8vw, -7vh, 0) scale(0.9);
    }
}

/* Unified premium treatment for buyer-help cards */
.chat-app .dw-self-service-card.page {
    width: min(calc(100% - 56px), 660px);
    max-width: 660px;
    padding: 19px;
    margin: 3px 0 3px 45px;
    border: 1px solid rgba(255, 150, 64, 0.2);
    border-radius: 22px 22px 22px 8px;
    background:
        radial-gradient(circle at 96% 0, rgba(255, 106, 0, 0.14), transparent 32%),
        radial-gradient(circle at 5% 100%, rgba(139, 92, 246, 0.1), transparent 36%),
        linear-gradient(145deg, rgba(34, 35, 44, 0.97), rgba(19, 20, 27, 0.98));
    box-shadow:
        0 20px 52px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.065);
    animation: premiumMessageIn 0.46s var(--chat-premium-ease) both;
}

.chat-app .dw-self-service-card.page .dw-self-service-card-head {
    min-height: 42px;
    margin-bottom: 11px;
}

.chat-app .dw-self-service-card.page .dw-self-service-card-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-color: rgba(255, 150, 64, 0.2);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 106, 0, 0.2), rgba(139, 92, 246, 0.13));
    color: #ffbc82;
    font-size: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 24px rgba(255, 106, 0, 0.08);
}

.chat-app .dw-self-service-card.page .dw-self-service-card-head strong {
    color: #f8fafc;
    font-size: 0.96rem;
}

.chat-app .dw-self-service-card.page > p {
    margin-bottom: 13px;
    color: #b8c0cf;
    font-size: 0.8rem;
    line-height: 1.58;
}

.chat-app .dw-self-service-card.page .dw-self-service-badge {
    padding: 5px 8px;
    border-color: rgba(255, 150, 64, 0.18);
    background: rgba(255, 106, 0, 0.11);
    color: #ffbf89;
}

.chat-app .dw-self-service-card.page .dw-self-service-link {
    min-height: 38px;
    padding: 9px 12px;
    border-color: rgba(255, 150, 64, 0.2);
    background: rgba(255, 106, 0, 0.09);
    color: #ffc18d;
}

.chat-app .dw-self-service-card.page .dw-self-service-link.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #ff6500, #ff8b22);
    color: #fff;
    box-shadow: 0 12px 26px rgba(255, 106, 0, 0.2);
}

.chat-app .dw-cid-tabs,
.chat-app .dw-screenshot-field select,
.chat-app .dw-activation-form input {
    border-radius: 12px;
}

.chat-app .dw-cid-upload,
.chat-app .dw-screenshot-picker {
    border-radius: 15px;
    transition:
        transform 0.25s var(--chat-premium-ease),
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.chat-app .dw-cid-upload:hover,
.chat-app .dw-screenshot-picker:hover {
    border-color: rgba(255, 144, 65, 0.5);
    box-shadow: 0 12px 26px rgba(255, 106, 0, 0.09);
    transform: translateY(-1px);
}

#digix-self-service-actions .dw-chat-quick-action-icon {
    border: 1px solid rgba(255, 144, 65, 0.15);
    background: linear-gradient(145deg, rgba(255, 106, 0, 0.16), rgba(139, 92, 246, 0.1));
    color: #ffb273;
}

body.light-mode .chat-app .dw-self-service-card.page {
    border-color: rgba(31, 41, 55, 0.08);
    background:
        radial-gradient(circle at 96% 0, rgba(255, 106, 0, 0.09), transparent 32%),
        radial-gradient(circle at 5% 100%, rgba(139, 92, 246, 0.055), transparent 36%),
        rgba(255, 255, 255, 0.96);
    box-shadow:
        0 20px 48px rgba(44, 48, 61, 0.1),
        inset 0 1px 0 #fff;
}

body.light-mode .chat-app .dw-self-service-card.page .dw-self-service-card-head strong {
    color: #202532;
}

body.light-mode .chat-app .dw-self-service-card.page > p {
    color: #677083;
}

body.light-mode .chat-app .dw-self-service-card.page .dw-self-service-card-icon {
    border-color: rgba(255, 106, 0, 0.13);
    background: linear-gradient(145deg, rgba(255, 106, 0, 0.14), rgba(139, 92, 246, 0.08));
    color: #e85b00;
    box-shadow: inset 0 1px 0 #fff;
}

body.light-mode .chat-app .dw-self-service-card.page .dw-self-service-link {
    border-color: rgba(255, 106, 0, 0.16);
    background: #fff7ed;
    color: #c2410c;
}

body.light-mode .chat-app .dw-self-service-card.page .dw-self-service-link.primary {
    color: #fff;
}

body.light-mode #digix-self-service-actions .dw-chat-quick-action-icon {
    border-color: rgba(255, 106, 0, 0.12);
    background: linear-gradient(145deg, rgba(255, 106, 0, 0.12), rgba(139, 92, 246, 0.07));
    color: #e85b00;
}

@media (max-width: 767px) {
    .chat-app .dw-self-service-card.page {
        width: calc(100% - 43px);
        padding: 15px;
        margin-left: 39px;
        border-radius: 19px 19px 19px 7px;
    }
}

/* ============================================================
   SCROLL-TO-BOTTOM FLOATING BUTTON
   ============================================================ */

.scroll-to-bottom-btn {
    position: fixed;
    right: clamp(18px, 4vw, 48px);
    bottom: clamp(88px, 12vh, 110px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 150, 64, 0.35);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.88), rgba(255, 140, 30, 0.9));
    color: #fff;
    box-shadow: 0 8px 24px rgba(255, 106, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition:
        opacity 0.28s ease,
        transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.28s ease;
    animation: scrollBtnIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scroll-to-bottom-btn.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.85);
    pointer-events: none;
}

.scroll-to-bottom-btn:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scroll-to-bottom-btn:hover {
    box-shadow: 0 12px 32px rgba(255, 106, 0, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.scroll-to-bottom-btn:active {
    transform: scale(0.94);
}

@keyframes scrollBtnIn {
    from { opacity: 0; transform: translateY(12px) scale(0.82); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   AGENT INITIALS AVATAR
   ============================================================ */

.agent-avatar-initials {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid rgba(255, 139, 61, 0.22);
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6500 0%, #ff9a30 100%);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(255, 106, 0, 0.2);
    user-select: none;
}

body.light-mode .agent-avatar-initials {
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.16);
}

/* ============================================================
   MESSAGE DELIVERY TICK POLISH
   ============================================================ */

.message-delivery.delivered {
    color: #34d399;
}

body.light-mode .message-delivery.delivered {
    color: #059669;
}

.message-delivery.failed {
    color: #fca5a5;
}

body.light-mode .message-delivery.failed {
    color: #dc2626;
}

/* ============================================================
   BROWSER TAB NOTIFICATION INDICATOR (visual only — JS drives it)
   ============================================================ */

/* No CSS needed — handled purely by JS document.title swapping */

/* ============================================================
   LIGHT MODE — WELCOME SIDEBAR POLISH FIX
   ============================================================ */

@media (min-width: 900px) {
    body.light-mode .support-rail-eyebrow {
        color: #c2500a;
    }

    body.light-mode .support-rail-highlight-icon {
        background: linear-gradient(145deg, rgba(255, 106, 0, 0.14), rgba(139, 92, 246, 0.07));
        color: #c2500a;
        border-color: rgba(255, 106, 0, 0.14);
    }

    body.light-mode .support-rail-tools-label {
        color: #374151;
    }
}

/* ============================================================
   QUEUE WAIT TIME BADGE
   ============================================================ */

.dw-wait-estimate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 199, 149, 0.15);
    color: #ffb675;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    vertical-align: middle;
}

body.light-mode .dw-wait-estimate {
    background: rgba(255, 107, 0, 0.1);
    color: #c2500a;
}
