.ew-chat {
    --ew-red: var(--transwide-base, #DD111E);
    --ew-navy: var(--transwide-black, #06416F);
    --ew-navy-2: var(--transwide-black2, #04243D);
    --ew-ink: #16324a;
    --ew-muted: #5d7386;
    --ew-line: #e4ebf1;
    --ew-paper: #f6f8fb;
    --ew-font: var(--transwide-font, "Plus Jakarta Sans", sans-serif);
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000000;
    font-family: var(--ew-font);
    color: var(--ew-ink);
    line-height: 1.45;
}

.ew-chat__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ew-chat__launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid var(--ew-red);
    border-radius: 50%;
    background: #fff;
    color: var(--ew-red);
    box-shadow: 0 10px 24px rgba(221, 17, 30, 0.25);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ew-chat__launcher:hover,
.ew-chat__launcher:focus-visible {
    border-color: var(--ew-navy);
    box-shadow: 0 12px 28px rgba(6, 65, 111, 0.3);
    transform: translateY(-1px);
    outline: none;
}

.ew-chat__launcher-bot {
    width: 46px;
    height: 46px;
    object-fit: contain;
    pointer-events: none;
}

.ew-chat__launcher-close {
    display: none;
}

.ew-chat.is-open .ew-chat__launcher-open {
    display: none;
}

.ew-chat.is-open .ew-chat__launcher-close {
    display: inline-block;
}

.ew-chat__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(4, 36, 61, 0.22);
    border: 1px solid rgba(6, 65, 111, 0.08);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.ew-chat.is-open .ew-chat__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.ew-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(135deg, var(--ew-navy) 0%, var(--ew-navy-2) 100%);
    color: #fff;
}

.ew-chat__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ew-chat__logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.ew-chat__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ew-chat__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ew-chat__product {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.ew-chat__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.ew-chat__presence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    opacity: 0.9;
}

.ew-chat__presence-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3dd68c;
    box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.7);
    animation: ew-chat-pulse 1.8s infinite;
}

.ew-chat__header-actions {
    display: flex;
    gap: 6px;
}

.ew-chat__icon-btn,
.ew-chat__send {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ew-chat__icon-btn:hover,
.ew-chat__icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.ew-chat__messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(6, 65, 111, 0.03), transparent 80px),
        var(--ew-paper);
}

.ew-chat__row {
    display: flex;
    margin-bottom: 10px;
}

.ew-chat__row--user {
    justify-content: flex-end;
}

.ew-chat__bubble {
    max-width: 92%;
    padding: 10px 12px 8px;
    border-radius: 14px;
    font-size: 13.5px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ew-chat__row--bot .ew-chat__bubble {
    background: #fff;
    color: var(--ew-ink);
    border: 1px solid var(--ew-line);
    border-bottom-left-radius: 4px;
}

.ew-chat__row--user .ew-chat__bubble {
    background: var(--ew-navy);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}

.ew-chat__row--bot .ew-chat__bubble--rich {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    padding: 10px;
}

.ew-chat__time {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.01em;
    opacity: 0.62;
    font-style: normal;
}

.ew-chat__row--user .ew-chat__time {
    text-align: right;
}

.ew-chat__typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 16px;
}

.ew-chat__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ew-navy);
    animation: ew-chat-dot 1s infinite ease-in-out;
}

.ew-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.ew-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

.ew-chat__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 8px;
}

.ew-chat__choice {
    appearance: none;
    border: 1px solid var(--ew-line);
    background: #fff;
    color: var(--ew-navy);
    border-radius: 999px;
    padding: 7px 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
}

.ew-chat__choice:hover,
.ew-chat__choice:focus-visible {
    border-color: var(--ew-red);
    color: var(--ew-red);
    outline: none;
}

.ew-chat__composer {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--ew-line);
    background: #fff;
}

.ew-chat__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--ew-line);
    background: var(--ew-paper);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13.5px;
    color: var(--ew-ink);
}

.ew-chat__input:focus {
    outline: 2px solid rgba(221, 17, 30, 0.25);
    border-color: var(--ew-red);
    background: #fff;
}

.ew-chat__send {
    background: var(--ew-red);
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.ew-chat__send:hover:not(:disabled),
.ew-chat__send:focus-visible:not(:disabled) {
    background: var(--ew-navy);
    outline: none;
}

.ew-chat__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ew-card {
    background: #fff;
    border: 1px solid var(--ew-line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 8px;
}

.ew-card--status {
    background: linear-gradient(180deg, #fff 0%, #f8fbfd 100%);
}

.ew-card__status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ew-card__status-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(221, 17, 30, 0.1);
    color: var(--ew-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 auto;
}

.ew-card__kicker {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ew-muted);
}

.ew-card__status strong {
    display: block;
    font-size: 14px;
    color: var(--ew-navy);
}

.ew-card__rows,
.ew-card__meta {
    margin: 0;
}

.ew-card__line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-top: 1px solid var(--ew-line);
    font-size: 12.5px;
}

.ew-card__line dt {
    color: var(--ew-muted);
    font-weight: 500;
}

.ew-card__line dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    color: var(--ew-ink);
}

.ew-card__route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--ew-navy);
    font-size: 13px;
}

.ew-card__route i {
    color: var(--ew-red);
    font-size: 11px;
}

.ew-card__link {
    display: inline-flex;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ew-red);
    text-decoration: none;
}

.ew-card__link:hover {
    color: var(--ew-navy);
}

.ew-timeline {
    list-style: none;
    margin: 8px 0 0;
    padding: 0 0 0 4px;
}

.ew-timeline__title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ew-navy);
}

.ew-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 10px;
    padding-bottom: 12px;
}

.ew-timeline__item:last-child {
    padding-bottom: 0;
}

.ew-timeline__item::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: #d5dee6;
}

.ew-timeline__item:last-child::before {
    display: none;
}

.ew-timeline__marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 2px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    background: #fff;
    border: 2px solid #c5d0da;
}

.ew-timeline__item.is-done .ew-timeline__marker {
    background: var(--ew-navy);
    border-color: var(--ew-navy);
}

.ew-timeline__item.is-current .ew-timeline__marker {
    background: var(--ew-red);
    border-color: var(--ew-red);
    box-shadow: 0 0 0 4px rgba(221, 17, 30, 0.15);
}

.ew-timeline__item.is-pending .ew-timeline__name,
.ew-timeline__item.is-pending .ew-timeline__meta {
    color: #8ea0ae;
}

.ew-timeline__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ew-navy);
}

.ew-timeline__meta {
    font-size: 12px;
    color: var(--ew-muted);
}

.ew-timeline__desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ew-ink);
}

.ew-timeline__desc strong {
    font-weight: 700;
}

.ew-card__status-message {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ew-line);
    font-size: 12px;
    line-height: 1.45;
    color: var(--ew-ink);
}

.ew-card__status-message strong {
    font-weight: 700;
}

.ew-timeline__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.ew-timeline__item.is-done .ew-timeline__badge {
    background: rgba(6, 65, 111, 0.1);
    color: var(--ew-navy);
}

.ew-timeline__item.is-current .ew-timeline__badge {
    background: rgba(221, 17, 30, 0.12);
    color: var(--ew-red);
}

.ew-timeline__item.is-pending .ew-timeline__badge {
    background: #eef2f5;
    color: #8ea0ae;
}

.ew-chat__empty {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ew-muted);
}

body .scroll-to-top {
    bottom: 104px;
    right: 32px;
}

@keyframes ew-chat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(61, 214, 140, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}

@keyframes ew-chat-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 575px) {
    .ew-chat {
        right: 14px;
        bottom: 14px;
    }

    .ew-chat__panel {
        width: calc(100vw - 28px);
        height: min(520px, calc(100dvh - 104px));
        right: 0;
    }

    .ew-chat__launcher {
        width: 54px;
        height: 54px;
    }

    body .scroll-to-top {
        bottom: 84px;
        right: 18px;
    }
}

.ew-chat__choices--menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 4px 0 8px;
}

.ew-chat__choice--menu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    border-radius: 999px;
    padding: 7px 12px 7px 8px;
}

.ew-chat__choice-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ew-paper);
    color: var(--ew-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.ew-chat__choice--menu .ew-chat__choice-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ew-navy);
    line-height: 1.2;
    white-space: nowrap;
}

.ew-chat__bubble--welcome .ew-chat__welcome-copy {
    white-space: pre-wrap;
    font-size: 13.5px;
    line-height: 1.45;
}

.ew-chat__bubble--welcome .ew-chat__welcome-copy--outro {
    margin-top: 2px;
}

.ew-chat__bubble--welcome .ew-chat__choices--in-bubble {
    margin: 10px 0 12px;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.ew-chat__bubble--welcome .ew-chat__choice--menu {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}

.ew-chat__bubble--welcome .ew-chat__choice--menu .ew-chat__choice-title {
    white-space: normal;
    text-align: left;
    line-height: 1.35;
}

.ew-chat__choice-icon--emoji {
    background: transparent;
    font-size: 16px;
    line-height: 1;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.ew-chat__form-panel {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.ew-chat__field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ew-muted);
    margin-bottom: 3px;
}

.ew-chat__field input,
.ew-chat__field select {
    width: 100%;
    border: 1px solid var(--ew-line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.ew-chat__field-error {
    color: var(--ew-red);
    font-size: 11px;
}

.ew-chat__form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ew-chat__btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ew-chat__btn--primary {
    background: var(--ew-red);
    color: #fff;
}

.ew-chat__btn--ghost {
    background: var(--ew-paper);
    color: var(--ew-navy);
}

.ew-chat__btn--icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ew-line);
    background: #fff;
    color: var(--ew-muted);
    white-space: nowrap;
}

.ew-chat__btn--icon:hover,
.ew-chat__btn--icon:focus-visible {
    color: var(--ew-red);
    border-color: rgba(221, 17, 30, 0.35);
    outline: none;
}

.ew-chat__field-hint {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--ew-muted);
    font-weight: 500;
}

.ew-chat__field--extras {
    margin-top: 4px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--ew-line);
    background: var(--ew-paper);
}

.ew-chat__field--extras > label {
    color: var(--ew-navy);
    font-size: 12px;
    margin-bottom: 4px;
}

.ew-chat__field--extras [data-ew-add-location] {
    margin-top: 6px;
    width: 100%;
}

.ew-chat__extra-loc-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.ew-chat__extra-loc-row:last-child {
    margin-bottom: 0;
}

.ew-chat__extra-loc-row__main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ew-chat__extra-loc-row__main .ewqf-extra {
    flex: 1 1 auto;
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ew-chat__panel,
    .ew-chat__launcher,
    .ew-chat__presence-dot,
    .ew-chat__typing span {
        animation: none;
        transition: none;
    }
}
