/*
 * DigiWorld standalone live-chat experience.
 * This stylesheet is intentionally loaded last and is scoped to .chat-app so
 * the floating chat widget keeps its compact layout.
 */

:root {
    --dw-chat-orange: #ff6b00;
    --dw-chat-orange-soft: #ff9b45;
    --dw-chat-green: #3ddc97;
    --dw-chat-ink: #080b12;
    --dw-chat-panel: #10141d;
    --dw-chat-panel-raised: #171c27;
    --dw-chat-line: rgba(255, 255, 255, 0.09);
    --dw-chat-muted: #929daf;
    --dw-chat-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100svh;
    margin: 0;
    overflow: hidden;
    background: #070910;
}

body {
    color: #f7f9fc;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    position: fixed;
    z-index: 0;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    content: "";
    filter: blur(110px);
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    top: -23rem;
    left: -12rem;
    background: #ff6b00;
}

body::after {
    right: -18rem;
    bottom: -25rem;
    background: #3158cf;
}

#digix-chat-window.chat-app {
    position: fixed;
    z-index: 1;
    top: var(--chat-viewport-offset-top, 0);
    right: 0;
    bottom: auto;
    left: 0;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    width: 100vw;
    max-width: none;
    height: var(--chat-viewport-height);
    max-height: none;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #0a0d14;
    box-shadow: none;
    animation: none;
}

/* Header */
#digix-chat-window.chat-app .chat-header {
    position: relative;
    z-index: 20;
    isolation: isolate;
    display: flex;
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    min-height: 84px;
    align-items: center;
    gap: 17px;
    padding: 15px clamp(18px, 3vw, 44px);
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at 12% 0, rgba(255, 107, 0, 0.18), transparent 30%),
        linear-gradient(100deg, rgba(19, 23, 33, 0.98), rgba(10, 13, 20, 0.98));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    animation: dwChatHeaderReveal 640ms var(--dw-chat-ease) both;
}

#digix-chat-window.chat-app .chat-header::before {
    position: absolute;
    right: clamp(18px, 4vw, 64px);
    bottom: -1px;
    left: clamp(18px, 4vw, 64px);
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 135, 47, 0.5), transparent);
    background-size: 220% 100%;
    pointer-events: none;
    animation: dwChatHeaderLine 9s linear infinite;
}

#digix-chat-window.chat-app .chat-header::after {
    position: absolute;
    z-index: -1;
    top: -112px;
    left: clamp(120px, 26vw, 430px);
    display: block;
    width: 310px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 127, 35, 0.18), rgba(255, 127, 35, 0) 68%);
    content: "";
    filter: blur(6px);
    pointer-events: none;
    animation: dwChatHeaderAmbient 13s ease-in-out infinite alternate;
}

#digix-chat-window.chat-app .chat-brand-lockup {
    position: relative;
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
    gap: 13px;
    padding: 7px 15px 7px 7px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#digix-chat-window.chat-app .chat-logo-shell {
    position: relative;
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background:
        radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.22), transparent 42%),
        rgba(255, 255, 255, 0.07);
    box-shadow: 0 13px 28px rgba(255, 107, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#digix-chat-window.chat-app .chat-logo-shell::before {
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 158, 87, 0.16);
    border-radius: 13px;
    content: "";
    pointer-events: none;
}

#digix-chat-window.chat-app .chat-header .logo {
    position: relative;
    z-index: 1;
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    margin: 0;
    padding: 4px;
    border-radius: 11px;
    background: #fff;
    object-fit: contain;
    filter: none;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16);
}

#digix-chat-window.chat-app .chat-presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 13px;
    height: 13px;
    border: 3px solid #141821;
    border-radius: 50%;
    background: var(--dw-chat-green);
    box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.09), 0 0 14px rgba(61, 220, 151, 0.55);
}

#digix-chat-window.chat-app .chat-presence-dot::after {
    position: absolute;
    inset: -6px;
    border: 1px solid rgba(61, 220, 151, 0.58);
    border-radius: inherit;
    content: "";
    pointer-events: none;
    animation: dwPresenceRing 2.8s ease-out infinite;
}

#digix-chat-window.chat-app .header-title {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#digix-chat-window.chat-app .header-eyebrow {
    margin: 0;
    color: #ffb77d;
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.15em;
    line-height: 1.15;
    text-transform: uppercase;
}

#digix-chat-window.chat-app .header-title h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.05rem, 1.5vw, 1.28rem);
    font-weight: 790;
    letter-spacing: -0.035em;
    line-height: 1.18;
}

#digix-chat-window.chat-app .header-title p {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    margin: 2px 0 0;
    overflow: hidden;
    color: #97a2b4;
    font-size: 0.7rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#digix-chat-window.chat-app .header-title p::before {
    display: none;
}

#digix-chat-window.chat-app .header-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    margin: 0;
    border-radius: 50%;
    background: var(--dw-chat-green);
    box-shadow: 0 0 9px rgba(61, 220, 151, 0.75);
    animation: dwStatusBreathe 2.6s ease-in-out infinite;
}

#digix-chat-window.chat-app .chat-header-actions {
    display: flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    animation: dwHeaderActionsReveal 720ms 120ms var(--dw-chat-ease) both;
}

#digix-chat-window.chat-app .header-secure-label {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    margin-right: 4px;
    padding: 0 12px;
    border: 1px solid rgba(61, 220, 151, 0.14);
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.055);
    color: #a8e6ca;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 8px 22px rgba(61, 220, 151, 0.045);
}

#digix-chat-window.chat-app .header-secure-label i {
    color: var(--dw-chat-green);
    font-size: 0.6rem;
}

#digix-chat-window.chat-app .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.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    color: #e8edf5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
    cursor: pointer;
    transition: transform 180ms var(--dw-chat-ease), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

#digix-chat-window.chat-app .premium-icon-button::before {
    position: absolute;
    z-index: 0;
    top: -60%;
    bottom: -60%;
    left: -90%;
    display: block;
    width: 55%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    content: "";
    pointer-events: none;
    transform: rotate(18deg);
    transition: left 520ms var(--dw-chat-ease);
}

#digix-chat-window.chat-app .premium-icon-button > * {
    position: relative;
    z-index: 1;
}

@media (hover: hover) {
    #digix-chat-window.chat-app .premium-icon-button:hover {
        border-color: rgba(255, 144, 69, 0.42);
        background: rgba(255, 107, 0, 0.11);
        color: #fff;
        box-shadow: 0 10px 24px rgba(255, 107, 0, 0.12);
        transform: translateY(-1px);
    }

    #digix-chat-window.chat-app .premium-icon-button:hover::before {
        left: 140%;
    }
}

#digix-chat-window.chat-app .premium-icon-button:active {
    transform: scale(0.95);
}

/* Queue and conversation canvas */
#digix-chat-window.chat-app .dw-live-queue-status {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    border-radius: 0;
}

#digix-chat-window.chat-app #messages {
    position: relative;
    isolation: isolate;
    display: flex;
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: 14px;
    padding: clamp(22px, 4vh, 42px) clamp(18px, 5vw, 76px);
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-block: 30px;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    scrollbar-width: thin;
    background:
        radial-gradient(circle at 84% 8%, rgba(255, 107, 0, 0.07), transparent 27%),
        radial-gradient(circle at 14% 88%, rgba(66, 98, 214, 0.055), transparent 30%),
        #0a0d14;
}

#digix-chat-window.chat-app #messages::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    display: block;
    content: "";
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.75px, transparent 0.75px);
    background-size: 23px 23px;
    opacity: 0.22;
    pointer-events: none;
}

#digix-chat-window.chat-app #messages::-webkit-scrollbar {
    width: 8px;
}

#digix-chat-window.chat-app #messages::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.13);
    background-clip: padding-box;
}

#digix-chat-window.chat-app #messages > *,
#digix-chat-window.chat-app #messages .message-row,
#digix-chat-window.chat-app #messages .digix-options-container,
#digix-chat-window.chat-app #messages .dw-self-service-card,
#digix-chat-window.chat-app #messages .chat-rating-card,
#digix-chat-window.chat-app #messages .typing {
    position: relative;
    z-index: 1;
    width: min(100%, 960px);
    margin-right: auto;
    margin-left: auto;
}

#digix-chat-window.chat-app .message-row {
    display: flex;
    min-width: 0;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 2px;
}

#digix-chat-window.chat-app .message-row.user {
    justify-content: flex-end;
}

#digix-chat-window.chat-app .avatar,
#digix-chat-window.chat-app .agent-avatar-initials {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 151, 79, 0.2);
    border-radius: 11px;
    background: linear-gradient(145deg, #fff, #eef1f6);
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.16);
    object-fit: contain;
}

#digix-chat-window.chat-app .message {
    max-width: min(74%, 680px);
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.55;
    letter-spacing: -0.008em;
    animation: dwChatMessageIn 420ms var(--dw-chat-ease) both !important;
}

#digix-chat-window.chat-app .message.bot,
#digix-chat-window.chat-app .message.admin,
#digix-chat-window.chat-app .message.agent {
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-bottom-left-radius: 6px;
    background: linear-gradient(145deg, rgba(30, 35, 47, 0.98), rgba(20, 24, 34, 0.98));
    color: #ecf0f6;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#digix-chat-window.chat-app .message.user {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom-right-radius: 6px;
    background: linear-gradient(135deg, #ff6200 0%, #ff861f 100%);
    color: #fff;
    box-shadow: 0 13px 30px rgba(255, 101, 0, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#digix-chat-window.chat-app .message.user .message-copy {
    color: #fff;
    overflow-wrap: anywhere;
}

#digix-chat-window.chat-app .message.user .meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    color: rgba(255, 255, 255, 0.82) !important;
}

#digix-chat-window.chat-app .message.user .meta .timestamp,
#digix-chat-window.chat-app .message.user .meta .message-delivery,
#digix-chat-window.chat-app .message.user .meta .message-delivery.delivered,
#digix-chat-window.chat-app .message.user .meta .message-delivery.sending {
    margin-left: 0;
    color: rgba(255, 255, 255, 0.96) !important;
}

#digix-chat-window.chat-app .chat-connection-retry {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    margin-top: 11px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 151, 79, 0.3);
    border-radius: 11px;
    background: rgba(255, 107, 0, 0.11);
    color: #ffc08f;
    font: 800 0.72rem/1 Inter, sans-serif;
    cursor: pointer;
    transition: transform 180ms var(--dw-chat-ease), border-color 180ms ease, background 180ms ease;
}

#digix-chat-window.chat-app .chat-connection-retry:hover:not(:disabled),
#digix-chat-window.chat-app .chat-connection-retry:focus-visible {
    border-color: rgba(255, 151, 79, 0.56);
    outline: none;
    background: rgba(255, 107, 0, 0.19);
    transform: translateY(-1px);
}

#digix-chat-window.chat-app .chat-connection-retry:disabled {
    cursor: wait;
    opacity: 0.66;
}

#digix-chat-window.chat-app .message.is-loading {
    opacity: 0.68;
}

#digix-chat-window.chat-app .message-meta,
#digix-chat-window.chat-app .message .meta {
    margin-top: 6px;
    color: rgba(217, 224, 235, 0.56);
    font-size: 0.62rem;
    font-weight: 600;
}

/* Menu choices belong to the conversation, so they use the same visual
   language as the message bubbles instead of the legacy low-contrast violet. */
#digix-chat-window.chat-app #messages .digix-options-container {
    display: flex;
    width: min(100%, 960px);
    flex-wrap: wrap;
    gap: 9px;
    padding: 2px 0 7px 44px;
}

#digix-chat-window.chat-app #messages .digix-option-chip {
    position: relative;
    min-height: 42px;
    padding: 9px 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 148, 70, 0.2);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 107, 0, 0.055));
    color: #e8edf5;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 180ms var(--dw-chat-ease), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

@media (hover: hover) {
    #digix-chat-window.chat-app #messages .digix-option-chip:hover {
        border-color: rgba(255, 148, 70, 0.44);
        background: linear-gradient(145deg, rgba(255, 107, 0, 0.18), rgba(255, 255, 255, 0.07));
        color: #fff;
        box-shadow: 0 12px 27px rgba(255, 107, 0, 0.13);
        transform: translateY(-2px);
    }
}

/* Commerce rows intentionally render only the card: no avatar, bubble or timestamp. */
#digix-chat-window.chat-app #messages .commerce-card-row {
    width: min(100%, 960px);
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}

#digix-chat-window.chat-app .commerce-card-row > .avatar,
#digix-chat-window.chat-app .commerce-card-row > .agent-avatar-initials {
    display: none !important;
}

#digix-chat-window.chat-app .commerce-card-row .card-message,
#digix-chat-window.chat-app .message.bot.card-message {
    width: min(100%, 640px);
    max-width: 640px;
    margin: 0;
    padding: 0 !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    animation: dwChatCardIn 520ms var(--dw-chat-ease) both !important;
}

#digix-chat-window.chat-app .card-message > .message-meta {
    display: none !important;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-commerce-card {
    width: 100%;
    max-width: none;
    grid-template-columns: clamp(148px, 27%, 176px) minmax(0, 1fr);
    min-height: 188px;
    border-radius: 23px;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-commerce-card::after {
    display: none !important;
    content: none !important;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media {
    min-height: 188px;
    padding: 20px 16px 37px;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media .digix-card-image {
    height: 118px;
}

#digix-chat-window.chat-app .commerce-card-row .digix-card-body {
    padding: 19px 20px 17px;
}

#digix-chat-window.chat-app .commerce-card-row .digix-card-body h4 {
    font-size: clamp(0.98rem, 1.4vw, 1.12rem);
}

#digix-chat-window.chat-app .commerce-card-row .card-desc {
    font-size: 0.72rem;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-product-price strong {
    overflow: visible;
    font-size: 1.16rem;
    text-overflow: clip;
}

#digix-chat-window.chat-app .commerce-card-row .digix-card-btn {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* Typing presence */
#digix-chat-window.chat-app #messages #typing.typing {
    position: relative;
    z-index: 4;
    width: fit-content;
    min-width: 222px;
    max-width: min(360px, 100%);
    margin-right: auto;
    margin-left: max(0px, calc((100% - 960px) / 2));
    padding: 10px 14px 10px 10px;
    gap: 10px;
    border: 1px solid rgba(255, 148, 62, 0.15);
    border-radius: 18px 18px 18px 7px;
    background: linear-gradient(145deg, rgba(29, 34, 46, 0.98), rgba(19, 23, 32, 0.98));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
    animation: dwTypingPresenceIn 220ms var(--dw-chat-ease) both !important;
}

@keyframes dwTypingPresenceIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#digix-chat-window.chat-app #typing .typing-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 6px;
    border: 1px solid rgba(255, 143, 57, 0.15);
    border-radius: 11px;
    background: #fff;
    object-fit: contain;
}

#digix-chat-window.chat-app #typing .typing-content {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#digix-chat-window.chat-app #typing .typing-label {
    color: #dbe1eb;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1.25;
    white-space: nowrap;
}

/* The dots need explicit layout boxes. Without this rule the legacy inline
   spans compute colors and animations but render at 0 × 0 in the full page. */
#digix-chat-window.chat-app #typing .typing-dots {
    position: relative;
    display: inline-flex;
    width: 34px;
    height: 14px;
    min-width: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
}

#digix-chat-window.chat-app #typing .typing-dots span {
    display: block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    flex: 0 0 7px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffad66, #ff6500);
    box-shadow: 0 2px 7px rgba(255, 101, 0, 0.28), 0 0 0 2px rgba(255, 107, 0, 0.055);
    transform-origin: center;
    animation: dwTypingDotWave 1.05s cubic-bezier(0.45, 0, 0.2, 1) infinite both !important;
}

#digix-chat-window.chat-app #typing .typing-dots span:nth-child(1) {
    animation-delay: -0.24s !important;
}

#digix-chat-window.chat-app #typing .typing-dots span:nth-child(2) {
    animation-delay: -0.12s !important;
}

#digix-chat-window.chat-app #typing .typing-dots span:nth-child(3) {
    animation-delay: 0s !important;
}

#digix-chat-window.chat-app #typing[data-source="agent"] .typing-dots span {
    background: linear-gradient(180deg, #74e9b5, #1fbe7a);
    box-shadow: 0 2px 7px rgba(31, 190, 122, 0.25), 0 0 0 2px rgba(31, 190, 122, 0.055);
}

@keyframes dwTypingDotWave {
    0%, 60%, 100% {
        opacity: 0.42;
        transform: translateY(1px) scale(0.82);
    }
    28% {
        opacity: 1;
        transform: translateY(-3px) scale(1.16);
    }
}

/* Composer dock */
#digix-chat-window.chat-app .input-area {
    position: relative;
    z-index: 12;
    display: grid;
    grid-column: 1;
    grid-row: 5;
    grid-template-columns: 46px minmax(0, 1fr) 54px;
    min-width: 0;
    align-items: end;
    gap: 10px;
    padding: 13px clamp(14px, 3vw, 26px) calc(13px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    background: rgba(11, 14, 21, 0.94);
    box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
}

#digix-chat-window.chat-app .composer-shell {
    position: relative;
    display: flex;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    align-items: flex-end;
    border: 0;
    border-radius: 18px;
    background: transparent;
}

#digix-chat-window.chat-app .composer-status-dot {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 17px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dw-chat-green);
    box-shadow: 0 0 11px rgba(61, 220, 151, 0.64);
    transform: translateY(-50%);
    pointer-events: none;
}

#digix-chat-window.chat-app #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;
    outline: 0;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 9px 25px rgba(0, 0, 0, 0.14);
    color: #f7f9fc;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    resize: none;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

#digix-chat-window.chat-app #message-input::placeholder {
    color: #798496;
}

#digix-chat-window.chat-app #message-input:focus {
    border-color: rgba(255, 132, 47, 0.52);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.08), 0 12px 30px rgba(0, 0, 0, 0.16);
}

#digix-chat-window.chat-app .composer-attachment-button,
#digix-chat-window.chat-app #send-btn {
    display: inline-grid;
    margin: 0;
    padding: 0;
    place-items: center;
    cursor: pointer;
    transition: transform 180ms var(--dw-chat-ease), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

#digix-chat-window.chat-app .composer-attachment-button {
    width: 46px;
    height: 46px;
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #aeb7c6;
}

#digix-chat-window.chat-app #send-btn {
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 18px;
    background: linear-gradient(135deg, #ff6200, #ff8e29);
    color: #fff;
    box-shadow: 0 13px 30px rgba(255, 101, 0, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#digix-chat-window.chat-app #send-btn::before {
    display: none;
}

@media (hover: hover) {
    #digix-chat-window.chat-app .composer-attachment-button:hover {
        border-color: rgba(255, 144, 69, 0.33);
        background: rgba(255, 107, 0, 0.08);
        color: #ffbc87;
        transform: translateY(-1px);
    }

    #digix-chat-window.chat-app #send-btn:hover {
        background: linear-gradient(135deg, #ff7416, #ff9b3d);
        box-shadow: 0 16px 34px rgba(255, 101, 0, 0.36);
        transform: translateY(-2px);
    }
}

#digix-chat-window.chat-app .composer-attachment-button:active,
#digix-chat-window.chat-app #send-btn:active {
    transform: scale(0.95);
}

#digix-chat-window.chat-app .scroll-to-bottom-btn {
    right: clamp(18px, 4vw, 50px);
    bottom: clamp(132px, 16vh, 164px);
    border-color: rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, #ff6200, #ff8e29);
    box-shadow: 0 10px 28px rgba(255, 101, 0, 0.28);
}

/* Desktop support rail */
.welcome-container {
    display: none;
}

.conversation-canvas-label {
    display: none;
}

@media (min-width: 900px) {
    #digix-chat-window.chat-app {
        grid-template-columns: 336px minmax(0, 1fr);
        grid-template-rows: 88px auto minmax(0, 1fr) auto;
    }

    #digix-chat-window.chat-app .chat-header {
        min-height: 88px;
    }

    #digix-chat-window.chat-app .welcome-container {
        position: relative;
        z-index: 1;
        isolation: isolate;
        display: flex;
        grid-column: 1;
        grid-row: 2 / 5;
        min-width: 0;
        min-height: 0;
        flex-direction: column;
        padding: clamp(32px, 4.4vh, 50px) 27px 340px;
        overflow: hidden;
        border-right: 1px solid rgba(255, 255, 255, 0.075);
        background:
            radial-gradient(circle at 8% 2%, rgba(255, 107, 0, 0.2), transparent 31%),
            radial-gradient(circle at 108% 80%, rgba(56, 87, 200, 0.12), transparent 38%),
            linear-gradient(165deg, #151923 0%, #0e121a 62%, #10141d 100%);
        color: #f7f9fc;
        box-shadow: 20px 0 55px rgba(0, 0, 0, 0.08), inset -1px 0 0 rgba(255, 255, 255, 0.025);
        animation: dwSupportRailReveal 700ms 80ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .welcome-container::before {
        position: absolute;
        z-index: -1;
        top: -95px;
        right: -130px;
        width: 300px;
        height: 300px;
        border: 1px solid rgba(255, 151, 79, 0.12);
        border-radius: 50%;
        box-shadow: 0 0 0 36px rgba(255, 151, 79, 0.025), 0 0 0 72px rgba(255, 151, 79, 0.014);
        content: "";
        animation: dwSupportOrbDrift 14s ease-in-out infinite alternate;
    }

    #digix-chat-window.chat-app .welcome-container::after {
        position: absolute;
        z-index: -1;
        inset: 0;
        background-image:
            linear-gradient(115deg, transparent 0 56%, rgba(255, 255, 255, 0.018) 56% 57%, transparent 57%),
            radial-gradient(rgba(255, 255, 255, 0.075) 0.65px, transparent 0.65px);
        background-position: center, 0 0;
        background-size: auto, 21px 21px;
        content: "";
        opacity: 0.34;
        pointer-events: none;
    }

    #digix-chat-window.chat-app .support-rail-copy {
        position: relative;
        z-index: 1;
        max-width: 274px;
        animation: dwSupportContentReveal 720ms 180ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .support-rail-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 14px;
        color: #ffb679;
        font-size: 0.66rem;
        font-weight: 850;
        letter-spacing: 0.15em;
        text-transform: uppercase;
    }

    #digix-chat-window.chat-app .support-rail-eyebrow::before {
        width: 18px;
        height: 2px;
        border-radius: 99px;
        background: linear-gradient(90deg, #ff6500, #ffb26d);
        content: "";
        box-shadow: 0 0 12px rgba(255, 107, 0, 0.28);
        transform-origin: left center;
        animation: dwEyebrowLineReveal 680ms 420ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .support-rail-copy h1 {
        max-width: 265px;
        margin: 0;
        color: #fff;
        font-size: clamp(2rem, 2.6vw, 2.5rem);
        font-weight: 800;
        letter-spacing: -0.057em;
        line-height: 1.03;
        text-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
    }

    #digix-chat-window.chat-app .support-rail-copy p {
        margin: 15px 0 0;
        color: #9ba5b6;
        font-size: 0.8rem;
        line-height: 1.62;
    }

    #digix-chat-window.chat-app .support-rail-highlights {
        display: grid;
        gap: 8px;
        margin-top: 28px;
    }

    #digix-chat-window.chat-app .support-rail-highlight {
        position: relative;
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 11px;
        padding: 10px 11px;
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.035);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
        overflow: hidden;
        transition: transform 220ms var(--dw-chat-ease), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
        animation: dwSupportCardReveal 620ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .support-rail-highlight:nth-child(1) {
        animation-delay: 260ms;
    }

    #digix-chat-window.chat-app .support-rail-highlight:nth-child(2) {
        animation-delay: 340ms;
    }

    #digix-chat-window.chat-app .support-rail-highlight:nth-child(3) {
        animation-delay: 420ms;
    }

    #digix-chat-window.chat-app .support-rail-highlight::before {
        position: absolute;
        top: 10px;
        bottom: 10px;
        left: 0;
        width: 2px;
        border-radius: 0 99px 99px 0;
        background: linear-gradient(180deg, #ffab68, #ff6500);
        content: "";
        opacity: 0.4;
        box-shadow: 0 0 13px rgba(255, 107, 0, 0.23);
        transition: opacity 220ms ease, transform 220ms var(--dw-chat-ease);
    }

    #digix-chat-window.chat-app .support-rail-highlight::after {
        position: absolute;
        top: -70%;
        bottom: -70%;
        left: -55%;
        width: 28%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
        content: "";
        pointer-events: none;
        transform: rotate(15deg);
        transition: left 650ms var(--dw-chat-ease);
    }

    #digix-chat-window.chat-app .support-rail-highlight-icon {
        display: grid;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        place-items: center;
        border: 1px solid rgba(255, 145, 67, 0.15);
        border-radius: 11px;
        background: linear-gradient(145deg, rgba(255, 107, 0, 0.17), rgba(65, 91, 190, 0.08));
        color: #ffb77e;
        font-size: 0.72rem;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 17px rgba(255, 107, 0, 0.08);
        transition: transform 220ms var(--dw-chat-ease), background 220ms ease, box-shadow 220ms ease;
    }

    @media (hover: hover) {
        #digix-chat-window.chat-app .support-rail-highlight:hover {
            border-color: rgba(255, 146, 67, 0.2);
            background: linear-gradient(135deg, rgba(255, 107, 0, 0.085), rgba(255, 255, 255, 0.045));
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.055);
            transform: translateX(4px);
        }

        #digix-chat-window.chat-app .support-rail-highlight:hover::before {
            opacity: 1;
            transform: scaleY(1.18);
        }

        #digix-chat-window.chat-app .support-rail-highlight:hover::after {
            left: 130%;
        }

        #digix-chat-window.chat-app .support-rail-highlight:hover .support-rail-highlight-icon {
            background: linear-gradient(145deg, rgba(255, 107, 0, 0.26), rgba(65, 91, 190, 0.1));
            box-shadow: 0 10px 22px rgba(255, 107, 0, 0.15);
            transform: rotate(-4deg) scale(1.06);
        }
    }

    #digix-chat-window.chat-app .support-rail-highlight > span:last-child {
        display: grid;
        min-width: 0;
        gap: 3px;
    }

    #digix-chat-window.chat-app .support-rail-highlight strong {
        color: #edf1f7;
        font-size: 0.74rem;
        font-weight: 750;
    }

    #digix-chat-window.chat-app .support-rail-highlight small {
        color: #7f8a9c;
        font-size: 0.63rem;
    }

    #digix-chat-window.chat-app .support-rail-tip {
        position: relative;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin-top: auto;
        padding: 13px;
        border: 1px solid rgba(61, 220, 151, 0.12);
        border-radius: 15px;
        background: rgba(61, 220, 151, 0.045);
        color: #9ee4c7;
        overflow: hidden;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 12px 28px rgba(0, 0, 0, 0.08);
        animation: dwSupportCardReveal 620ms 500ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .support-rail-tip::after {
        position: absolute;
        top: -55px;
        right: -50px;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(61, 220, 151, 0.13), transparent 69%);
        content: "";
        pointer-events: none;
    }

    #digix-chat-window.chat-app .support-rail-tip > i {
        margin-top: 2px;
    }

    #digix-chat-window.chat-app .support-rail-tip p,
    #digix-chat-window.chat-app .support-rail-tip span {
        display: block;
        margin: 0;
    }

    #digix-chat-window.chat-app .support-rail-tip strong {
        display: block;
        margin-bottom: 4px;
        color: #b9efd8;
        font-size: 0.68rem;
    }

    #digix-chat-window.chat-app .support-rail-tip span {
        color: #769989;
        font-size: 0.59rem;
        line-height: 1.48;
    }

    #digix-chat-window.chat-app .support-rail-tools-label {
        position: absolute;
        right: 27px;
        bottom: 220px;
        left: 27px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        color: #e2e7ef;
        font-size: 0.68rem;
        font-weight: 750;
        padding-top: 13px;
        border-top: 1px solid rgba(255, 255, 255, 0.075);
        animation: dwSupportContentReveal 620ms 560ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app .support-rail-tools-label span:last-child {
        color: #6f7a8c;
        font-size: 0.56rem;
        font-weight: 600;
    }

    #digix-chat-window.chat-app .dw-live-queue-status {
        grid-column: 2;
        grid-row: 2;
    }

    #digix-chat-window.chat-app #messages {
        grid-column: 2;
        grid-row: 3;
        width: min(calc(100% - 58px), 1120px);
        align-self: stretch;
        justify-self: center;
        margin: 22px 0;
        padding-top: clamp(86px, 10vh, 108px);
        padding-bottom: clamp(48px, 7vh, 72px);
        border: 1px solid rgba(255, 255, 255, 0.075);
        border-radius: 28px;
        background:
            radial-gradient(circle at 88% 0, rgba(255, 107, 0, 0.075), transparent 30%),
            radial-gradient(rgba(255, 255, 255, 0.06) 0.7px, transparent 0.7px),
            rgba(255, 255, 255, 0.018);
        background-size: auto, 23px 23px, auto;
        box-shadow: 0 22px 62px rgba(0, 0, 0, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    }

    /* The scroll container is the conversation surface. Keeping the panel on
       the real element prevents cards and actions from escaping a pseudo-layer. */
    #digix-chat-window.chat-app #messages::before {
        display: none;
        content: none;
    }

    #digix-chat-window.chat-app .conversation-canvas-label {
        position: relative;
        z-index: 3;
        display: flex;
        grid-column: 2;
        grid-row: 3;
        width: min(calc(100% - 118px), 900px);
        align-self: start;
        justify-self: center;
        align-items: center;
        gap: 8px;
        margin-top: 43px;
        color: #788397;
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        line-height: 1;
        text-transform: uppercase;
        pointer-events: none;
    }

    #digix-chat-window.chat-app .conversation-canvas-label span:first-child {
        color: #d36118;
    }

    #digix-chat-window.chat-app .conversation-canvas-label span + span::before {
        margin-right: 8px;
        color: #a7afbb;
        content: "•";
    }

    #digix-chat-window.chat-app #messages > *,
    #digix-chat-window.chat-app #messages .message-row,
    #digix-chat-window.chat-app #messages .digix-options-container,
    #digix-chat-window.chat-app #messages .dw-self-service-card,
    #digix-chat-window.chat-app #messages .chat-rating-card,
    #digix-chat-window.chat-app #messages .typing {
        width: min(100%, 900px);
    }

    #digix-chat-window.chat-app #messages .commerce-card-row {
        width: min(100%, 900px);
    }

    /* New conversations open as a deliberate welcome state. The first real
       buyer action removes this class and returns to the standard timeline. */
    #digix-chat-window.chat-app #messages.is-onboarding {
        justify-content: flex-start;
        padding-top: clamp(86px, 10vh, 108px);
        padding-bottom: clamp(48px, 7vh, 72px);
    }

    #digix-chat-window.chat-app #messages.is-onboarding .message-row.bot {
        width: min(100%, 900px);
        justify-content: flex-start;
    }

    #digix-chat-window.chat-app #messages.is-onboarding .digix-options-container {
        width: min(100%, 900px);
        justify-content: flex-start;
        padding-left: 44px;
    }

    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden) {
        z-index: 4;
        display: grid;
        grid-column: 1;
        grid-row: 2 / 5;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-self: end;
        gap: 8px;
        margin: 0 22px 20px;
        padding: 0;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action {
        display: flex;
        width: 100%;
        min-width: 0;
        min-height: 45px;
        align-items: center;
        flex-direction: row !important;
        justify-content: flex-start;
        gap: 8px;
        padding: 7px 9px;
        border: 1px solid rgba(255, 255, 255, 0.075);
        border-radius: 13px;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
        color: #d9dee8;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
        font-size: 0.63rem;
        font-weight: 700;
        text-align: left;
        transition: transform 200ms var(--dw-chat-ease), border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, color 200ms ease;
        animation: dwSupportCardReveal 540ms var(--dw-chat-ease) both;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:nth-child(1),
    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:nth-child(2) {
        animation-delay: 600ms;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:nth-child(3),
    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:nth-child(4) {
        animation-delay: 660ms;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:nth-child(n + 5) {
        animation-delay: 720ms;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-content: center;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action-icon {
        display: grid;
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        place-items: center;
        border: 1px solid rgba(255, 146, 67, 0.14);
        border-radius: 9px;
        background: rgba(255, 107, 0, 0.1);
        color: #ffad70;
        font-size: 0.68rem;
        transition: transform 200ms var(--dw-chat-ease), box-shadow 200ms ease;
    }

    @media (hover: hover) {
        #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:hover {
            border-color: rgba(255, 145, 67, 0.28);
            background: linear-gradient(145deg, rgba(255, 107, 0, 0.12), rgba(255, 255, 255, 0.035));
            color: #fff;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
            transform: translateY(-1px);
        }

        #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:hover .dw-chat-quick-action-icon {
            box-shadow: 0 7px 16px rgba(255, 107, 0, 0.14);
            transform: translateY(-1px) scale(1.07);
        }
    }

    #digix-chat-window.chat-app .input-area {
        grid-column: 2;
        grid-row: 4;
        grid-template-columns: 46px minmax(0, 960px) 54px;
        justify-content: center;
        padding-right: clamp(28px, 5vw, 76px);
        padding-left: clamp(28px, 5vw, 76px);
    }

    #digix-chat-window.chat-app .scroll-to-bottom-btn {
        right: clamp(30px, 5vw, 78px);
        bottom: 98px;
    }
}

@media (min-width: 900px) and (max-height: 790px) {
    #digix-chat-window.chat-app .welcome-container {
        padding-top: 26px;
        padding-bottom: 274px;
    }

    #digix-chat-window.chat-app .support-rail-copy h1 {
        font-size: 1.9rem;
    }

    #digix-chat-window.chat-app .support-rail-copy p {
        margin-top: 10px;
        font-size: 0.72rem;
    }

    #digix-chat-window.chat-app .support-rail-highlights {
        gap: 6px;
        margin-top: 18px;
    }

    #digix-chat-window.chat-app .support-rail-highlight {
        padding-block: 7px;
    }

    #digix-chat-window.chat-app .support-rail-tip {
        display: none;
    }

    #digix-chat-window.chat-app .support-rail-tools-label {
        bottom: 238px;
    }
}

/* Tablet and mobile action rail */
@media (max-width: 899px) {
    #digix-chat-window.chat-app #messages.is-onboarding {
        justify-content: flex-start;
        padding-top: 22px;
        padding-bottom: 22px;
    }

    #digix-chat-window.chat-app #messages.is-onboarding .message-row.bot {
        justify-content: flex-start;
    }

    #digix-chat-window.chat-app #messages.is-onboarding .digix-options-container {
        justify-content: flex-start;
        padding-left: 44px;
    }

    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden) {
        position: relative;
        z-index: 10;
        display: flex;
        grid-column: 1;
        grid-row: 4;
        flex-flow: row nowrap;
        gap: 8px;
        margin: 0;
        padding: 10px 14px;
        overflow-x: auto;
        overflow-y: hidden;
        border: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.065);
        background: rgba(13, 16, 24, 0.94);
        box-shadow: 0 -13px 35px rgba(0, 0, 0, 0.12);
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }

    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden)::after {
        position: sticky;
        right: -14px;
        width: 18px;
        min-width: 18px;
        align-self: stretch;
        margin-left: -18px;
        content: "";
        background: linear-gradient(90deg, transparent, rgba(13, 16, 24, 0.95));
        pointer-events: none;
    }

    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions::-webkit-scrollbar {
        display: none;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action,
    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:last-child:nth-child(odd) {
        display: inline-flex;
        width: auto;
        min-width: max-content;
        min-height: 39px;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 7px 13px 7px 9px;
        border: 1px solid rgba(255, 255, 255, 0.085);
        border-radius: 999px !important;
        background: rgba(255, 255, 255, 0.05);
        color: #d9dfe9;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
        font-size: 0.68rem;
        font-weight: 720;
        white-space: nowrap;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action-icon {
        display: grid;
        width: 23px;
        height: 23px;
        flex: 0 0 23px;
        place-items: center;
        border: 1px solid rgba(255, 147, 67, 0.13);
        border-radius: 50%;
        background: rgba(255, 107, 0, 0.1);
        color: #ffae71;
        font-size: 0.6rem;
    }

    #digix-chat-window.chat-app #messages #typing.typing {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 8px 12px;
        overflow: visible;
    }

    #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden)::after {
        display: none;
    }

    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action,
    #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action:last-child:nth-child(odd) {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 7px 5px;
        border-radius: 12px !important;
        font-size: 0.58rem;
        white-space: normal;
    }

    #digix-chat-window.chat-app .chat-header {
        min-height: 72px;
        gap: 9px;
        padding: max(11px, env(safe-area-inset-top)) 12px 11px;
    }

    #digix-chat-window.chat-app .chat-logo-shell {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
        border-radius: 14px;
    }

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

    #digix-chat-window.chat-app .header-secure-label,
    #digix-chat-window.chat-app .header-eyebrow {
        display: none;
    }

    #digix-chat-window.chat-app .header-title p {
        max-width: 38vw;
        font-size: 0.63rem;
    }

    #digix-chat-window.chat-app .chat-header-actions {
        gap: 5px;
    }

    #digix-chat-window.chat-app .premium-icon-button {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    #digix-chat-window.chat-app .back-btn {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    #digix-chat-window.chat-app #messages {
        gap: 11px;
        padding: 17px 12px;
    }

    #digix-chat-window.chat-app .message {
        max-width: 84%;
        padding: 11px 13px;
        font-size: 0.86rem;
    }

    #digix-chat-window.chat-app .avatar,
    #digix-chat-window.chat-app .agent-avatar-initials {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        border-radius: 10px;
    }

    #digix-chat-window.chat-app .commerce-card-row .card-message,
    #digix-chat-window.chat-app .message.bot.card-message {
        width: 100%;
        max-width: 100%;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-commerce-card {
        grid-template-columns: 124px minmax(0, 1fr);
        min-height: 168px;
        border-radius: 19px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media {
        min-height: 168px;
        padding: 17px 11px 34px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media .digix-card-image {
        height: 94px;
    }

    #digix-chat-window.chat-app .commerce-card-row .digix-card-body {
        padding: 14px 13px 12px;
    }

    #digix-chat-window.chat-app .commerce-card-row .digix-card-body h4 {
        font-size: 0.88rem;
    }

    #digix-chat-window.chat-app .commerce-card-row .card-desc {
        font-size: 0.63rem;
        -webkit-line-clamp: 1;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-footer {
        gap: 6px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-price strong {
        font-size: 0.92rem;
    }

    #digix-chat-window.chat-app .commerce-card-row .digix-card-btn {
        min-height: 42px;
        padding: 9px 10px;
        font-size: 0.61rem;
    }

    #digix-chat-window.chat-app .input-area {
        grid-template-columns: 42px minmax(0, 1fr) 50px;
        gap: 8px;
        padding: 10px 11px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    #digix-chat-window.chat-app .composer-attachment-button {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    #digix-chat-window.chat-app #send-btn {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    #digix-chat-window.chat-app #message-input {
        min-height: 50px;
        padding-top: 14px;
        padding-bottom: 13px;
        /* Prevent Safari/Chrome on iPhone from zooming and panning the chat. */
        font-size: 16px;
    }

    #digix-chat-window.chat-app .scroll-to-bottom-btn {
        right: 16px;
        bottom: 126px;
    }
}

@media (max-width: 420px) {
    #digix-chat-window.chat-app .header-title p {
        display: none;
    }

    #digix-chat-window.chat-app .chat-brand-lockup {
        gap: 9px;
    }

    #digix-chat-window.chat-app .premium-icon-button:not(.back-btn) {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    #digix-chat-window.chat-app #theme-toggle-btn {
        display: none;
    }

    #digix-chat-window.chat-app .message {
        max-width: 88%;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-commerce-card {
        grid-template-columns: 104px minmax(0, 1fr);
        min-height: 156px;
        border-radius: 17px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media {
        min-height: 156px;
        padding: 14px 8px 31px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media::before {
        width: 84px;
        height: 84px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-media .digix-card-image {
        height: 78px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-meta {
        margin-bottom: 5px;
        font-size: 0.47rem;
    }

    #digix-chat-window.chat-app .commerce-card-row .card-desc {
        display: none;
    }

    #digix-chat-window.chat-app .commerce-card-row .digix-card-body h4 {
        font-size: 0.78rem;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-price small {
        display: none;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-product-price strong {
        font-size: 0.79rem;
    }

    #digix-chat-window.chat-app .commerce-card-row .digix-card-btn {
        min-height: 42px;
        padding: 8px;
        font-size: 0.55rem;
    }
}

/* Premium light theme */
body.light-mode {
    background: #edf1f7;
    color: #172033;
}

body.light-mode::before {
    background: #ff9a4d;
    opacity: 0.13;
}

body.light-mode::after {
    background: #8aa2ef;
    opacity: 0.12;
}

body.light-mode #digix-chat-window.chat-app {
    background: #f4f6fa;
}

body.light-mode #digix-chat-window.chat-app .chat-header {
    border-bottom-color: rgba(21, 31, 48, 0.08);
    background:
        radial-gradient(circle at 12% 0, rgba(255, 107, 0, 0.12), transparent 31%),
        linear-gradient(100deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.98));
    box-shadow: 0 16px 40px rgba(37, 46, 64, 0.07);
}

body.light-mode #digix-chat-window.chat-app .chat-brand-lockup {
    border-color: rgba(28, 39, 58, 0.075);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 242, 0.58));
    box-shadow: inset 0 1px 0 #fff, 0 12px 30px rgba(37, 46, 64, 0.055);
}

body.light-mode #digix-chat-window.chat-app .chat-logo-shell {
    border-color: rgba(21, 31, 48, 0.08);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 12px 27px rgba(255, 107, 0, 0.1), inset 0 1px 0 #fff;
}

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

body.light-mode #digix-chat-window.chat-app .header-title h2 {
    color: #151b27;
}

body.light-mode #digix-chat-window.chat-app .header-title p {
    color: #6e788a;
}

body.light-mode #digix-chat-window.chat-app .header-secure-label {
    border-color: rgba(17, 143, 91, 0.13);
    background: rgba(20, 184, 112, 0.065);
    color: #168357;
}

body.light-mode #digix-chat-window.chat-app .premium-icon-button {
    border-color: rgba(21, 31, 48, 0.09);
    background: rgba(255, 255, 255, 0.76);
    color: #5d6778;
    box-shadow: 0 7px 18px rgba(37, 46, 64, 0.055), inset 0 1px 0 #fff;
}

body.light-mode #digix-chat-window.chat-app #messages {
    background:
        radial-gradient(circle at 84% 8%, rgba(255, 107, 0, 0.055), transparent 27%),
        radial-gradient(circle at 14% 88%, rgba(66, 98, 214, 0.04), transparent 30%),
        #f5f7fa;
}

body.light-mode #digix-chat-window.chat-app #messages::before {
    background-image: radial-gradient(rgba(30, 44, 67, 0.11) 0.7px, transparent 0.7px);
    opacity: 0.19;
}

body.light-mode #digix-chat-window.chat-app #messages .digix-option-chip {
    border-color: rgba(31, 43, 63, 0.1);
    background: linear-gradient(145deg, #fff, #faf7f3);
    color: #485469;
    box-shadow: 0 8px 22px rgba(37, 46, 64, 0.075), inset 0 1px 0 #fff;
}

@media (hover: hover) {
    body.light-mode #digix-chat-window.chat-app #messages .digix-option-chip:hover {
        border-color: rgba(255, 107, 0, 0.28);
        background: linear-gradient(145deg, #fff, #fff2e7);
        color: #b94c08;
        box-shadow: 0 12px 27px rgba(255, 107, 0, 0.12);
    }
}

body.light-mode #digix-chat-window.chat-app .message.bot,
body.light-mode #digix-chat-window.chat-app .message.admin,
body.light-mode #digix-chat-window.chat-app .message.agent {
    border-color: rgba(21, 31, 48, 0.075) !important;
    background: rgba(255, 255, 255, 0.97) !important;
    color: #283245 !important;
    box-shadow: 0 12px 32px rgba(37, 46, 64, 0.08), inset 0 1px 0 #fff !important;
}

body.light-mode #digix-chat-window.chat-app .message-meta,
body.light-mode #digix-chat-window.chat-app .message .meta,
body.light-mode #digix-chat-window.chat-app .message .timestamp {
    color: #667085 !important;
    opacity: 1;
}

body.light-mode #digix-chat-window.chat-app .chat-connection-retry {
    border-color: rgba(224, 86, 5, 0.2);
    background: #fff4e9;
    color: #b64b0c;
}

body.light-mode #digix-chat-window.chat-app .message.user {
    background: linear-gradient(135deg, #ff6200, #ff8b27) !important;
    color: #fff !important;
    box-shadow: 0 13px 28px rgba(255, 101, 0, 0.22) !important;
}

body.light-mode #digix-chat-window.chat-app .message.bot.card-message,
body.light-mode #digix-chat-window.chat-app .commerce-card-row .card-message {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.light-mode #digix-chat-window.chat-app #messages #typing.typing {
    border-color: rgba(255, 107, 0, 0.16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 13px 30px rgba(37, 46, 64, 0.1), 0 0 0 4px rgba(255, 107, 0, 0.035);
}

body.light-mode #digix-chat-window.chat-app #typing .typing-label {
    color: #4b5669;
}

body.light-mode #digix-chat-window.chat-app #typing .typing-dots span {
    background: linear-gradient(180deg, #ff9b46, #f35c00);
    box-shadow: 0 2px 7px rgba(255, 101, 0, 0.24), 0 0 0 2px rgba(255, 107, 0, 0.05);
}

body.light-mode #digix-chat-window.chat-app #typing[data-source="agent"] .typing-dots span {
    background: linear-gradient(180deg, #55dca0, #159963);
    box-shadow: 0 2px 7px rgba(21, 153, 99, 0.22), 0 0 0 2px rgba(21, 153, 99, 0.05);
}

body.light-mode #digix-chat-window.chat-app .input-area {
    border-top-color: rgba(21, 31, 48, 0.075);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 -17px 42px rgba(37, 46, 64, 0.065);
}

body.light-mode #digix-chat-window.chat-app #message-input {
    border-color: rgba(21, 31, 48, 0.09);
    background: #f5f7fa;
    box-shadow: inset 0 1px 0 #fff, 0 8px 22px rgba(37, 46, 64, 0.045);
    color: #202a3c;
}

body.light-mode #digix-chat-window.chat-app #message-input::placeholder {
    color: #8b94a3;
}

body.light-mode #digix-chat-window.chat-app #message-input:focus {
    border-color: rgba(255, 107, 0, 0.4);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.075), 0 12px 28px rgba(37, 46, 64, 0.07);
}

body.light-mode #digix-chat-window.chat-app .composer-attachment-button {
    border-color: rgba(21, 31, 48, 0.09);
    background: #fff;
    color: #697486;
    box-shadow: 0 7px 18px rgba(37, 46, 64, 0.055);
}

@media (min-width: 900px) {
    body.light-mode #digix-chat-window.chat-app #messages {
        border-color: rgba(30, 43, 63, 0.075);
        background:
            radial-gradient(circle at 88% 0, rgba(255, 107, 0, 0.065), transparent 30%),
            radial-gradient(rgba(30, 44, 67, 0.085) 0.7px, transparent 0.7px),
            rgba(255, 255, 255, 0.55);
        background-size: auto, 23px 23px, auto;
        box-shadow: 0 22px 62px rgba(37, 46, 64, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    }

    body.light-mode #digix-chat-window.chat-app .conversation-canvas-label {
        color: #7d8797;
    }

    body.light-mode #digix-chat-window.chat-app .welcome-container {
        border-right-color: rgba(21, 31, 48, 0.075);
        background:
            radial-gradient(circle at 8% 2%, rgba(255, 107, 0, 0.13), transparent 31%),
            radial-gradient(circle at 108% 80%, rgba(56, 87, 200, 0.07), transparent 38%),
            linear-gradient(165deg, #fff 0%, #f8fafc 62%, #f2f5f9 100%);
        color: #172033;
        box-shadow: 20px 0 55px rgba(37, 46, 64, 0.055), inset -1px 0 0 rgba(255, 255, 255, 0.8);
    }

    body.light-mode #digix-chat-window.chat-app .welcome-container::after {
        background-image:
            linear-gradient(115deg, transparent 0 56%, rgba(255, 107, 0, 0.022) 56% 57%, transparent 57%),
            radial-gradient(rgba(40, 55, 80, 0.095) 0.62px, transparent 0.62px);
        opacity: 0.3;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-copy h1 {
        color: #151b27;
        text-shadow: 0 12px 34px rgba(37, 46, 64, 0.09);
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-copy p {
        color: #687386;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-highlight {
        border-color: rgba(21, 31, 48, 0.07);
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 9px 22px rgba(37, 46, 64, 0.045), inset 0 1px 0 #fff;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-tools-label {
        border-top-color: rgba(30, 43, 63, 0.085);
    }

    @media (hover: hover) {
        body.light-mode #digix-chat-window.chat-app .support-rail-highlight:hover {
            border-color: rgba(255, 107, 0, 0.2);
            background: linear-gradient(135deg, #fff, #fff5ed);
            box-shadow: 0 15px 32px rgba(37, 46, 64, 0.09), 0 8px 24px rgba(255, 107, 0, 0.055), inset 0 1px 0 #fff;
        }
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-highlight strong,
    body.light-mode #digix-chat-window.chat-app .support-rail-tools-label {
        color: #30394a;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-highlight small,
    body.light-mode #digix-chat-window.chat-app .support-rail-tools-label span:last-child {
        color: #8791a1;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-tip {
        border-color: rgba(17, 143, 91, 0.12);
        background: rgba(20, 184, 112, 0.055);
        color: #168357;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-tip strong {
        color: #126c4a;
    }

    body.light-mode #digix-chat-window.chat-app .support-rail-tip span {
        color: #6e887e;
    }

    body.light-mode #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action {
        border-color: rgba(30, 43, 63, 0.085);
        background: linear-gradient(145deg, #fff, #f9fafc);
        color: #354156;
        box-shadow: 0 8px 20px rgba(37, 46, 64, 0.065), inset 0 1px 0 #fff;
    }
}

@media (max-width: 899px) {
    body.light-mode #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden) {
        border-top-color: rgba(21, 31, 48, 0.07);
        background: rgba(255, 255, 255, 0.93);
        box-shadow: 0 -12px 32px rgba(37, 46, 64, 0.055);
    }

    body.light-mode #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden)::after {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.96));
    }

    body.light-mode #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action {
        border-color: rgba(21, 31, 48, 0.075);
        background: #fff;
        color: #4f5b6e;
        box-shadow: 0 7px 18px rgba(37, 46, 64, 0.05), inset 0 1px 0 #fff;
    }
}

/* ============================================================
   STANDALONE NIGHT MODE COMPLETION

   live-chat.html is dark by default and only adds `body.light-mode` when the
   customer explicitly selects the light theme. Several optional panels are
   injected after page load by the self-service and conversation-history
   modules, so their light base styles need a final, full-page-only dark pass.
   Keeping this block in the last stylesheet prevents a white flash or white
   card from appearing when a late panel is mounted.
   ============================================================ */
body:not(.light-mode) {
    color-scheme: dark;
}

body:not(.light-mode) #digix-chat-window.chat-app {
    --dw-night-canvas: #090c13;
    --dw-night-panel: #111620;
    --dw-night-panel-raised: #181e2a;
    --dw-night-panel-soft: rgba(255, 255, 255, 0.055);
    --dw-night-border: rgba(255, 255, 255, 0.1);
    --dw-night-copy: #f4f7fb;
    --dw-night-muted: #a8b2c2;
    background: var(--dw-night-canvas);
    color: var(--dw-night-copy);
}

/* Primary shell, status bars, conversation canvas and composer. */
body:not(.light-mode) #digix-chat-window.chat-app .chat-header,
body:not(.light-mode) #digix-chat-window.chat-app .input-area,
body:not(.light-mode) #digix-chat-window.chat-app #digix-self-service-actions.dw-chat-quick-actions:not(.hidden) {
    border-color: var(--dw-night-border);
    background-color: rgba(10, 14, 22, 0.96);
}

body:not(.light-mode) #digix-chat-window.chat-app #messages {
    background-color: var(--dw-night-canvas);
    color: var(--dw-night-copy);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-live-queue-status,
body:not(.light-mode) #digix-chat-window.chat-app .conversation-canvas-label,
body:not(.light-mode) #digix-chat-window.chat-app .support-rail-tools-label {
    border-color: var(--dw-night-border);
    color: var(--dw-night-muted);
}

body:not(.light-mode) #digix-chat-window.chat-app .premium-icon-button,
body:not(.light-mode) #digix-chat-window.chat-app .composer-attachment-button,
body:not(.light-mode) #digix-chat-window.chat-app .scroll-to-bottom-btn {
    border-color: var(--dw-night-border);
}

body:not(.light-mode) #digix-chat-window.chat-app .premium-icon-button,
body:not(.light-mode) #digix-chat-window.chat-app .composer-attachment-button {
    background: var(--dw-night-panel-soft);
    color: #dbe2ed;
}

body:not(.light-mode) #digix-chat-window.chat-app .chat-logo-shell,
body:not(.light-mode) #digix-chat-window.chat-app .chat-header .logo,
body:not(.light-mode) #digix-chat-window.chat-app #typing .typing-avatar,
body:not(.light-mode) #digix-chat-window.chat-app .avatar {
    border-color: rgba(255, 148, 70, 0.2);
    background: #171c27;
}

/* Messages, typing presence, restored history and delivery state. */
body:not(.light-mode) #digix-chat-window.chat-app .message.bot,
body:not(.light-mode) #digix-chat-window.chat-app .message.admin,
body:not(.light-mode) #digix-chat-window.chat-app .message.agent,
body:not(.light-mode) #digix-chat-window.chat-app .premium-agent-message,
body:not(.light-mode) #digix-chat-window.chat-app #messages #typing.typing {
    border-color: var(--dw-night-border) !important;
    background: linear-gradient(145deg, #1d2330, #141923) !important;
    color: var(--dw-night-copy) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body:not(.light-mode) #digix-chat-window.chat-app .message.user {
    color: #fff;
}

body:not(.light-mode) #digix-chat-window.chat-app .message.system {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.1);
    color: #c9d1dd;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.message.bot, .message.admin, .message.agent) :is(.message-copy, .message-content),
body:not(.light-mode) #digix-chat-window.chat-app #typing .typing-label,
body:not(.light-mode) #digix-chat-window.chat-app .premium-agent-message > .message-content {
    color: var(--dw-night-copy);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.message-meta, .message .meta, .premium-agent-message > .message-meta) {
    color: #98a4b6;
}

body:not(.light-mode) #digix-chat-window.chat-app .message.bot.card-message,
body:not(.light-mode) #digix-chat-window.chat-app .commerce-card-row .card-message {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Composer controls and native form popovers stay dark, including iOS. */
body:not(.light-mode) #digix-chat-window.chat-app #message-input,
body:not(.light-mode) #digix-chat-window.chat-app .chat-rating-card textarea,
body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-activation-form, .dw-cid-field) input,
body:not(.light-mode) #digix-chat-window.chat-app .dw-cid-field textarea,
body:not(.light-mode) #digix-chat-window.chat-app .dw-screenshot-field select {
    border-color: var(--dw-night-border);
    background: #0f141d;
    color: var(--dw-night-copy);
    color-scheme: dark;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

body:not(.light-mode) #digix-chat-window.chat-app #message-input::placeholder,
body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-activation-form, .dw-cid-field) input::placeholder,
body:not(.light-mode) #digix-chat-window.chat-app .dw-cid-field textarea::placeholder {
    color: #7f8a9c;
    opacity: 1;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-screenshot-field select option {
    background: #111620;
    color: var(--dw-night-copy);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(#message-input, .chat-rating-card textarea, .dw-activation-form input, .dw-cid-field input, .dw-cid-field textarea, .dw-screenshot-field select):focus {
    border-color: rgba(255, 132, 47, 0.58);
    outline: 0;
    background: #141a25;
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.09), 0 12px 30px rgba(0, 0, 0, 0.2);
}

body:not(.light-mode) #digix-chat-window.chat-app #message-input:disabled {
    background: #0d1119;
    color: #7f8999;
    -webkit-text-fill-color: #7f8999;
    opacity: 1;
}

/* Quick replies, self-service menus and all injected support cards. */
body:not(.light-mode) #digix-chat-window.chat-app #messages .digix-option-chip,
body:not(.light-mode) #digix-chat-window.chat-app #digix-self-service-actions .dw-chat-quick-action,
body:not(.light-mode) #digix-chat-window.chat-app .dw-self-service-link,
body:not(.light-mode) #digix-chat-window.chat-app .dw-activation-examples button {
    border-color: rgba(255, 148, 70, 0.22) !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 107, 0, 0.055)) !important;
    color: #e8edf5 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-self-service-link.primary {
    border-color: transparent !important;
    background: linear-gradient(135deg, #ff6500, #ff8b22) !important;
    color: #fff !important;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-self-service-card,
body:not(.light-mode) #digix-chat-window.chat-app .dw-cid-helper-card,
body:not(.light-mode) #digix-chat-window.chat-app .dw-screenshot-helper-card,
body:not(.light-mode) #digix-chat-window.chat-app .chat-rating-card,
body:not(.light-mode) #digix-chat-window.chat-app .chat-close-card {
    border-color: rgba(255, 150, 73, 0.18);
    background:
        radial-gradient(circle at 96% 0, rgba(255, 107, 0, 0.11), transparent 35%),
        linear-gradient(145deg, #1b202b, #111620) !important;
    color: var(--dw-night-copy);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-card-head strong, .chat-rating-card h3, .chat-close-card h3) {
    color: var(--dw-night-copy);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-card > p, .chat-rating-card p, .chat-close-card p, .dw-cid-upload-copy span, .dw-screenshot-picker-copy span) {
    color: var(--dw-night-muted);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-badge, .dw-self-service-order-status.pending, .dw-delivery-state.pending) {
    background: rgba(194, 65, 12, 0.2);
    color: #fed7aa;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-order-status.paid, .dw-delivery-state.ready, .dw-screenshot-success-icon) {
    background: rgba(6, 95, 70, 0.24);
    color: #a7f3d0;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-delivery-state.awaiting, .dw-delivery-state.error) {
    background: rgba(127, 29, 29, 0.25);
    color: #fecaca;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-delivery-state.manual {
    background: rgba(30, 64, 175, 0.22);
    color: #bfdbfe;
}

/* Orders, delivery summaries, commerce cards and late history restores. */
body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-order, .dw-delivery-item, .dw-order-horizontal-card) {
    border-color: var(--dw-night-border);
    background: linear-gradient(145deg, #202632, #161b24);
    color: var(--dw-night-copy);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-order-card-top > strong, .dw-delivery-product, .dw-order-card-product) {
    color: #eef2f8;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-order span, .dw-delivery-item .dw-delivery-detail) {
    color: #c1c9d5;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-self-service-order small, .dw-order-card-facts small, .dw-delivery-meta, .dw-delivery-resend-note) {
    color: #929daf;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-commerce-card {
    border-color: rgba(255, 150, 73, 0.18);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 107, 0, 0.12), transparent 38%),
        linear-gradient(145deg, #202631, #141922) !important;
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-product-media {
    border-color: var(--dw-night-border);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.065), transparent 30%),
        linear-gradient(145deg, #30261f, #181d27);
}

/* Full-page variant of the instant WhatsApp handoff card. */
#digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card {
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 180px;
    border-color: rgba(34, 197, 94, 0.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.14), transparent 42%),
        linear-gradient(145deg, #ffffff, #f5fff8);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(34, 197, 94, 0.09);
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .dw-chat-product-media {
    min-height: 180px;
    border-right-color: rgba(34, 197, 94, 0.15);
    background: linear-gradient(155deg, #ecfdf3, #dcfce7);
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .digix-card-image {
    width: 68px;
    height: 68px;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .card-desc {
    max-width: 470px;
    font-size: 0.78rem;
    line-height: 1.55;
    -webkit-line-clamp: 3;
}

#digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .digix-card-btn {
    min-width: 148px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.24);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-support-card {
    border-color: rgba(74, 222, 128, 0.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.13), transparent 42%),
        linear-gradient(145deg, #1d2923, #171f1b) !important;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-support-card .dw-chat-product-media {
    border-color: rgba(74, 222, 128, 0.15);
    background: linear-gradient(145deg, #203b2b, #1b2921);
}

@media (max-width: 560px) {
    #digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card {
        grid-template-columns: 92px minmax(0, 1fr);
        min-height: 170px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .dw-chat-product-media {
        min-height: 170px;
    }

    #digix-chat-window.chat-app .commerce-card-row .dw-chat-support-card .digix-card-btn {
        min-width: 0;
    }
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-product-badge {
    border-color: rgba(255, 154, 82, 0.2);
    background: rgba(18, 22, 30, 0.9);
    color: #ffb77a;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-commerce-card .digix-card-body h4 {
    color: var(--dw-night-copy);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-commerce-card .card-desc,
body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-product-assurance {
    color: var(--dw-night-muted);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-order-card-media {
    border-color: rgba(255, 154, 82, 0.14);
    background: linear-gradient(145deg, #35291f, #25221f);
    color: #ffad67;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-order-card-media i {
    border-color: rgba(255, 154, 82, 0.18);
    background: rgba(255, 255, 255, 0.045);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-delivery-item.state-ready .dw-order-card-media {
    border-color: rgba(52, 211, 153, 0.14);
    background: linear-gradient(145deg, rgba(6, 78, 59, 0.42), #17251f);
    color: #6ee7b7;
}

/* Activation, CID and screenshot helper states. */
body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-cid-tabs, .dw-screenshot-preview) {
    border-color: var(--dw-night-border);
    background: rgba(0, 0, 0, 0.24);
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-cid-tabs button, .dw-cid-status, .dw-screenshot-status) {
    color: #cbd5e1;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-cid-tabs button.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffd4af;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-cid-privacy, .dw-cid-result.success, .dw-cid-value) {
    border-color: rgba(52, 211, 153, 0.18);
    background: rgba(6, 78, 59, 0.24);
    color: #a7f3d0;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-cid-result.error, .dw-cid-status.error, .dw-screenshot-status.error) {
    border-color: rgba(248, 113, 113, 0.18);
    background: rgba(127, 29, 29, 0.24);
    color: #fecaca;
}

body:not(.light-mode) #digix-chat-window.chat-app :is(.dw-cid-upload, .dw-screenshot-picker) {
    border-color: rgba(255, 154, 82, 0.28);
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.09), rgba(59, 130, 246, 0.1));
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-screenshot-privacy {
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(30, 64, 175, 0.2);
    color: #bfdbfe;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-chat-screenshot-message-image {
    border-color: var(--dw-night-border);
    background: #0d1118;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* End-chat overlay, rating flow and resolved conversation surfaces. */
body:not(.light-mode) #digix-chat-window.chat-app .chat-close-dialog {
    background: rgba(3, 5, 10, 0.8);
}

body:not(.light-mode) #digix-chat-window.chat-app .chat-close-actions button:not(#confirm-close-chat),
body:not(.light-mode) #digix-chat-window.chat-app .chat-start-new-button.secondary {
    border-color: var(--dw-night-border);
    background: rgba(255, 255, 255, 0.06);
    color: #e6ebf3;
}

body:not(.light-mode) #digix-chat-window.chat-app .chat-rating-stars button {
    color: #687386;
}

body:not(.light-mode) #digix-chat-window.chat-app .chat-rating-stars button:is(:hover, .selected) {
    color: #ff9d2e;
}

body:not(.light-mode) #digix-chat-window.chat-app.conversation-resolved .input-area {
    background: rgba(9, 13, 20, 0.97);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-resolved-composer {
    border-color: rgba(52, 211, 153, 0.2);
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.3), #131923);
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-resolved-composer-copy strong {
    color: #d1fae5;
}

body:not(.light-mode) #digix-chat-window.chat-app .dw-resolved-composer-copy small {
    color: #9fb0b8;
}

/* Keyboard and motion accessibility */
#digix-chat-window.chat-app :is(button, a, textarea):focus-visible {
    outline: 3px solid rgba(255, 126, 35, 0.36);
    outline-offset: 3px;
}

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

@keyframes dwChatCardIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes dwHeaderActionsReveal {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dwChatHeaderLine {
    from { background-position: 160% 0; }
    to { background-position: -60% 0; }
}

@keyframes dwChatHeaderAmbient {
    from { transform: translate3d(-18px, -4px, 0) scale(0.94); }
    to { transform: translate3d(48px, 10px, 0) scale(1.08); }
}

@keyframes dwPresenceRing {
    0% { opacity: 0.75; transform: scale(0.72); }
    72%, 100% { opacity: 0; transform: scale(1.5); }
}

@keyframes dwStatusBreathe {
    0%, 100% { opacity: 0.72; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes dwSupportRailReveal {
    from { opacity: 0; transform: translateX(-18px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes dwSupportOrbDrift {
    from { transform: translate3d(-10px, -8px, 0) scale(0.94); }
    to { transform: translate3d(26px, 24px, 0) scale(1.08); }
}

@keyframes dwEyebrowLineReveal {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 1; transform: scaleX(1); }
}

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

/* Loaded last: defend every standalone field against iOS focus zoom. */
@media (max-width: 768px) {
    #digix-chat-window.chat-app :is(
        input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
        textarea,
        select
    ) {
        font-size: 16px !important;
    }
}
