/* Coast Bands chat widget - light-theme "Ask anything" module.
   Self-contained so it can be dropped onto any band page. Matches the main
   agency site design system: soft blush-lilac section tint, white cards,
   amber gradient accents, Poppins (inherited from the host theme). */

.coast-chat {
    --coast-chat-fg: #181819;
    --coast-chat-muted: #6b6169;
    --coast-chat-tint: #f6f2f4;
    --coast-chat-card: #ffffff;
    --coast-chat-amber-1: #fecc66;
    --coast-chat-amber-2: #f7a547;
    --coast-chat-amber-line: linear-gradient(90deg, #fecc66, #f7a547);
    --coast-chat-amber-fill: linear-gradient(to bottom, #fecc66, #f7a547);
    --coast-chat-border: #ece5ea;
    --coast-chat-bubble-bot-bg: #f3f0f2;
    --coast-chat-online: #22c55e;
    --coast-chat-radius: 16px;
    --coast-chat-shadow: 0 20px 50px rgba(90, 37, 82, 0.14);

    color: var(--coast-chat-fg);
    display: block;
}

/* ===================== Showcase section ===================== */

.coast-chat__ama {
    position: relative;
    overflow: hidden;
    background-color: var(--coast-chat-tint);
}

.coast-chat__ama-inner {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 20px;

}
    .coast-chat__ama-inner:after {
        content: '';
        position: absolute;
        top: -118px;
        right: 0;
        width: 339px;
        height: 433px;
        transform:  rotate(320deg);
        background-image: url('/images/common/squiggle.svg');
        background-repeat: no-repeat;
    }
    .coast-chat__ama-inner:before {
        content: '';
        position: absolute;
        bottom: -100px;
        right: 190px;
        width: 339px;
        height: 433px;
        transform: scale(60%) rotate(320deg);
        background-image: url('/images/common/squiggle.svg');
        background-repeat: no-repeat;
    }
@media (min-width: 768px) {
    .coast-chat__ama-inner {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* Desktop section rhythm: the band templates run 80px above / 48px below each
   section so every junction lands near 128px. The section's own contents are
   untouched - only this wrapper's vertical padding changes. */
@media (min-width: 1024px) {
    .coast-chat__ama-inner {
        padding-top: 80px;
        padding-bottom: 48px;
    }
}

.coast-chat__squiggle {
    position: absolute;
    top: 40px;
    right: 24px;
    width: 200px;
    height: auto;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.coast-chat__ama-grid {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 48px;
    align-items: center;
}

@media (min-width: 960px) {
    .coast-chat__ama-grid {
        grid-template-columns: 55fr 45fr;
    }
}

/* On the stacked layout, flatten the copy column so the preview card can sit
   between the subline and the suggestion chips. */
@media (max-width: 959.98px) {
    .coast-chat__ama-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .coast-chat__ama-copy { display: contents; }

    .coast-chat__eyebrow      { order: 1; }
    .coast-chat__ama-copy h2  { order: 2; }
    .coast-chat__ama-subline  { order: 3; }
    .coast-chat__preview      { order: 4; margin-top: 28px; }
    .coast-chat__chip-grid    { order: 5; }
    .coast-chat__ama-cta      { order: 6; }
    .coast-chat__trust        { order: 7; }
    .coast-chat__unavailable  { order: 8; }
}

.coast-chat__eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--coast-chat-amber-2);
}

.coast-chat__ama-copy h2 {
    margin-top: 12px;
}

.coast-chat__ama-subline {
    margin-top: 16px;
    max-width: 34rem;
    color: var(--coast-chat-muted);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.coast-chat__chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
    max-width: 40rem;
}

@media (max-width: 600px) {
    .coast-chat__chip-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.coast-chat__chip {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background: var(--coast-chat-card);
    color: var(--coast-chat-fg);
    border: 1px solid var(--coast-chat-border);
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.coast-chat__chip:hover {
    transform: translateY(-2px);
    border-color: var(--coast-chat-amber-2);
    box-shadow: 0 8px 20px rgba(247, 165, 71, 0.18);
}

.coast-chat__trust {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--coast-chat-muted);
    font-size: 13px;
}

.coast-chat__trust svg {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--coast-chat-amber-2);
}

/* The launcher CTA stays hidden until the availability probe confirms the
   band has an active row; an unavailable band shows the static message. */
.coast-chat:not([data-availability="available"]) .coast-chat__ama-cta { display: none; }

.coast-chat__unavailable {
    display: none;
    color: var(--coast-chat-muted);
    font-size: 14px;
    line-height: 1.4;
}

.coast-chat[data-availability="unavailable"] .coast-chat__unavailable { display: block; }

/* ===================== Static preview card ===================== */

.coast-chat__preview {
    position: relative;
    background: var(--coast-chat-card);
    border-radius: var(--coast-chat-radius);
    box-shadow: var(--coast-chat-shadow);
    overflow: hidden;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.coast-chat__preview::before,
.coast-chat__panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--coast-chat-amber-line);
    z-index: 2;
}

.coast-chat__preview-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--coast-chat-border);
}

.coast-chat__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    background: var(--coast-chat-amber-fill);
    color: #181819;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.coast-chat__preview-id { display: flex; flex-direction: column; line-height: 1.25; }
.coast-chat__preview-name { font-weight: 700; font-size: 15px; color: var(--coast-chat-fg); }
.coast-chat__preview-powered { font-size: 12px; font-weight: 500; color: var(--coast-chat-amber-2); }

.coast-chat__online {
    width: 10px;
    height: 10px;
    margin-left: auto;
    flex: none;
    border-radius: 999px;
    background: var(--coast-chat-online);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.coast-chat__preview-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.coast-chat__preview-bubble {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
}

.coast-chat__preview-bubble--bot {
    align-self: flex-start;
    background: var(--coast-chat-bubble-bot-bg);
    color: var(--coast-chat-fg);
    border-bottom-left-radius: 4px;
}

.coast-chat__preview-bubble--user {
    align-self: flex-end;
    background: var(--coast-chat-amber-fill);
    color: #181819;
    border-bottom-right-radius: 4px;
}

.coast-chat__preview-typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    background: var(--coast-chat-bubble-bot-bg);
}

.coast-chat__preview-typing em {
    font-style: normal;
    font-size: 12px;
    color: var(--coast-chat-muted);
    margin-left: 2px;
}

.coast-chat__preview-typing span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #b7adb3;
    animation: coast-chat-dot 1.2s infinite ease-in-out;
}

.coast-chat__preview-typing span:nth-child(2) { animation-delay: 0.18s; }
.coast-chat__preview-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes coast-chat-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ===================== Opened assistant panel ===================== */

.coast-chat__panel {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 9999;
    width: min(424px, calc(100vw - 40px));
    height: min(624px, calc(100vh - 56px));
    background: var(--coast-chat-card);
    border-radius: 18px;
    box-shadow: 0 40px 90px -34px rgba(28, 27, 31, 0.5), 0 12px 30px -14px rgba(28, 27, 31, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.26s ease, visibility 0s linear 0.34s;
}

.coast-chat[data-state="open"] .coast-chat__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.26s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .coast-chat__panel { transition: opacity 0.2s ease, visibility 0s linear 0.2s; transform: none; }
    .coast-chat[data-state="open"] .coast-chat__panel { transform: none; transition: opacity 0.2s ease, visibility 0s; }
}

.coast-chat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--coast-chat-border);
    background: var(--coast-chat-card);
}

.coast-chat__header-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.coast-chat__title { font-weight: 700; font-size: 15px; color: var(--coast-chat-fg); }
.coast-chat__subtitle { font-size: 12px; font-weight: 500; color: var(--coast-chat-amber-2); margin-top: 1px; }

.coast-chat__close {
    background: transparent;
    color: var(--coast-chat-muted);
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 8px;
}
.coast-chat__close:hover { background: #f3f0f2; color: var(--coast-chat-fg); }

/* Slim instant-quote banner - soft amber tint, not the full gradient, so it
   never competes with the send button. Whole strip deep-links to the quote. */
.coast-chat__quote-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 12px 16px 4px;
    padding: 11px 13px;
    background: rgba(247, 165, 71, 0.10);
    border-radius: 12px;
    text-decoration: none;
    flex: none;
    transition: background 0.16s ease;
}
.coast-chat__quote-banner:hover { background: rgba(247, 165, 71, 0.18); }

.coast-chat__quote-icon,
.coast-chat__quote-chevron { width: 15px; height: 15px; flex: none; color: #b4630f; }

.coast-chat__quote-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
}

.coast-chat__quote-lead {
    font-size: 11.5px;
    color: var(--coast-chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coast-chat__quote-action {
    font-size: 11.5px;
    font-weight: 600;
    color: #b4630f;
    white-space: nowrap;
    flex: none;
}

/* Chips live hidden in the panel until a session starts, then JS relocates
   them into the feed under the greeting where they become a 2-up grid. */
.coast-chat__panel > .coast-chat__panel-chips { display: none; }

.coast-chat__feed .coast-chat__panel-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.coast-chat__chip--sm {
    justify-content: center;
    text-align: center;
    padding: 10px 14px;
    font-size: 12.5px;
    border-radius: 999px;
}

.coast-chat__chip--sm:hover {
    transform: translateY(-1px);
    background: #fff8ef;
}

.coast-chat__gate {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.coast-chat__gate form { display: flex; flex-direction: column; gap: 14px; }

.coast-chat__gate label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--coast-chat-fg);
}

.coast-chat__gate input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--coast-chat-border);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--coast-chat-fg);
    appearance: none;
    min-height: 44px;
}

.coast-chat__gate input:focus {
    outline: none;
    border-color: var(--coast-chat-amber-2);
    box-shadow: 0 0 0 3px rgba(247, 165, 71, 0.18);
}

.coast-chat__submit {
    background: var(--coast-chat-amber-fill);
    color: #181819;
    border: none;
    border-radius: 999px;
    padding: 18px 20px;
    /* Box and type come from the sitewide yellow CTA spec (site.css). */
    min-height: var(--cta-yellow-min-h, 60px);
    font-weight: var(--cta-yellow-fw, 600);
    font-size: var(--cta-yellow-fs, 16px);
    line-height: var(--cta-yellow-lh, 24px);
    cursor: pointer;
    margin-top: 4px;
}
.coast-chat__submit:hover { opacity: 0.92; }
.coast-chat__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.coast-chat__gate-intro {
    font-size: 14px;
    color: var(--coast-chat-fg);
    margin: 0;
}

.coast-chat__gate .cf-turnstile {
    width: 100%;
}

.coast-chat__email-form {
    margin: 0 16px 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--coast-chat-border);
    border-radius: 12px;
    flex: none;
    box-shadow: 0 10px 26px -18px rgba(28, 27, 31, 0.24);
}

.coast-chat__email-form form { display: flex; flex-direction: column; gap: 10px; }

.coast-chat__email-intro {
    font-size: 13px;
    font-weight: 600;
    color: var(--coast-chat-fg);
    margin: 0;
}

.coast-chat__email-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--coast-chat-fg);
}

.coast-chat__email-form input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--coast-chat-border);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--coast-chat-fg);
}

.coast-chat__email-form input:focus {
    outline: none;
    border-color: var(--coast-chat-amber-2);
    box-shadow: 0 0 0 3px rgba(247, 165, 71, 0.18);
}

.coast-chat__conversation {
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.coast-chat__feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* Keep scroll contained to the feed so hitting the top/bottom never
       chains through to the page behind the fixed panel. */
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coast-chat__bubble {
    max-width: 86%;
    padding: 11px 15px;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 14px;
    white-space: pre-line;
    word-wrap: break-word;
}

.coast-chat__bubble strong { font-weight: 600; }

.coast-chat__bubble ul {
    margin: 8px 0;
    padding-left: 19px;
    list-style: disc;
    white-space: normal;
}

.coast-chat__bubble li { margin: 2px 0; }

.coast-chat__bubble li::marker { color: #BCB6BC; }

.coast-chat__bubble--bot {
    background: var(--coast-chat-bubble-bot-bg);
    color: var(--coast-chat-fg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.coast-chat__bubble--user {
    background: var(--coast-chat-amber-fill);
    color: #181819;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.coast-chat__bubble--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    align-self: stretch;
    font-size: 13px;
}

.coast-chat__composer {
    padding: 10px 20px 16px;
    display: flex;
    gap: 10px;
    background: #fff;
    align-items: flex-end;
}

.coast-chat__composer textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--coast-chat-border);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    min-height: 46px;
    max-height: 120px;
    color: var(--coast-chat-fg);
    background: #fbfafb;
}

.coast-chat__composer textarea:focus {
    outline: none;
    border-color: var(--coast-chat-amber-2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(247, 165, 71, 0.18);
}

.coast-chat__composer textarea:disabled {
    background: #f0eef1;
    color: #a6a2ac;
    cursor: not-allowed;
}

.coast-chat__send {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--coast-chat-amber-fill);
    color: #181819;
    border: none;
    border-radius: 999px;
    width: 46px;
    height: 46px;
    padding: 0;
    cursor: pointer;
    flex: none;
    box-shadow: 0 10px 22px -12px rgba(247, 165, 71, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.coast-chat__send svg { width: 19px; height: 19px; }
.coast-chat__send:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(247, 165, 71, 0.82); }
.coast-chat__send:disabled {
    background: #e6e2e6;
    color: #a6a2ac;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.coast-chat__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 20px 0;
    flex: none;
}

/* Session counter: muted by default; amber + dot when low (1-2) or exhausted. */
.coast-chat__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--coast-chat-muted);
}

.coast-chat__meta-dot {
    display: none;
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--coast-chat-amber-2);
}

.coast-chat__meta--low,
.coast-chat__meta--exhausted { color: #b4630f; font-weight: 600; }

.coast-chat__meta--low .coast-chat__meta-dot,
.coast-chat__meta--exhausted .coast-chat__meta-dot { display: block; }

.coast-chat__email {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    color: var(--coast-chat-muted);
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: color 0.16s ease;
}
.coast-chat__email svg { width: 14px; height: 14px; flex: none; }
.coast-chat__email:hover { color: var(--coast-chat-fg); }

.coast-chat__email:disabled,
.coast-chat__email--sent {
    color: var(--coast-chat-muted);
    cursor: default;
}

.coast-chat__typing {
    align-self: flex-start;
    color: var(--coast-chat-muted);
    font-size: 12px;
    font-style: italic;
}

/* ===================== Exhausted closing bubble ===================== */

.coast-chat__closing {
    align-self: flex-start;
    max-width: 92%;
    background: var(--coast-chat-bubble-bot-bg);
    color: var(--coast-chat-fg);
    padding: 14px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.coast-chat__closing-text { font-size: 15px; line-height: 1.5; }

.coast-chat__closing-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 13px;
}

.coast-chat__closing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.16s ease, box-shadow 0.15s ease;
}

.coast-chat__closing-btn--primary {
    border: none;
    background: var(--coast-chat-amber-fill);
    color: #181819;
    box-shadow: 0 10px 22px -12px rgba(247, 165, 71, 0.7);
}
.coast-chat__closing-btn--primary:hover { transform: translateY(-1px); }

.coast-chat__closing-btn--secondary {
    border: 1px solid var(--coast-chat-border);
    background: #fff;
    color: var(--coast-chat-fg);
}
.coast-chat__closing-btn--secondary:hover { border-color: var(--coast-chat-amber-2); }

/* ===================== Mobile bottom sheet ===================== */

@media (max-width: 600px) {
    .coast-chat__panel {
        right: 0;
        left: 0;
        bottom: 0;
        top: auto;
        width: auto;
        height: 94vh;            /* fallback for browsers without dvh */
        height: 100dvh;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        border-radius: 22px 22px 0 0;
        opacity: 1;
        transform-origin: bottom center;
        transform: translateY(101%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
    }

    .coast-chat[data-state="open"] .coast-chat__panel {
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
    }

    /* At the narrowest widths the exhausted actions stack full-width. */
    .coast-chat__closing-actions { gap: 8px; }

    /* iOS Safari force-zooms the page when a focused field's computed
       font-size is below 16px. Pin the interactive fields to 16px on mobile
       so tapping them never triggers the disruptive auto-zoom. */
    .coast-chat__composer textarea,
    .coast-chat__gate input,
    .coast-chat__email-form input {
        font-size: 16px;
    }
}

@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
    .coast-chat__panel { transform: none; }
    .coast-chat[data-state="open"] .coast-chat__panel { transform: none; }
}

/* ===================== "Soundcheck" floating launcher =====================
   Ported from 07-chat-launcher/design-source/Soundcheck.dc.html. At rest it is
   five amber EQ bars on a warm-glass puck; on pointer devices it plays a riff
   (JS) then unfurls into the "Ask {Band}" pill. Values are 1:1 with the source.
   The launcher is a single interactive element; bars/pill are presentational. */

@keyframes coast-eq-0 { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }
@keyframes coast-eq-1 { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.55); } }
@keyframes coast-eq-2 { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.35); } }

.coast-chat__launcher {
    position: fixed;
    right: 24px;
    /* viewport-fit=cover means the home-indicator zone is ours to avoid. */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 9998; /* above page content, below the panel (9999) and modals */
    box-sizing: border-box;
    height: 56px;
    width: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .93), rgba(255, 251, 245, .8));
    -webkit-backdrop-filter: blur(26px) saturate(140%);
    backdrop-filter: blur(26px) saturate(140%);
    border: 1px solid rgba(27, 27, 28, .07);
    box-shadow: 0 16px 40px -14px rgba(27, 27, 28, .30), 0 3px 10px -3px rgba(27, 27, 28, .10);
    color: #1B1B1C;
    font-family: 'Poppins', system-ui, sans-serif;
    cursor: pointer;
    /* Skip the tap delay / double-tap-zoom heuristics so a touch tap activates
       immediately (see the touchend handler in coast-chat-widget.js). */
    touch-action: manipulation;
    overflow: hidden;
    outline: none;
    /* Hidden until the availability probe passes and JS marks it ready (~1s
       after load, so the entrance never races the page). */
    opacity: 0;
    transform: translateY(12px);
    visibility: hidden;
    pointer-events: none;
    transition: width .34s cubic-bezier(.34, 1.28, .5, 1), border-radius .34s ease,
        opacity .38s cubic-bezier(.2, .7, .2, 1), transform .38s cubic-bezier(.2, .7, .2, 1),
        box-shadow .22s ease, background .22s ease, visibility 0s linear .38s;
}

.coast-chat[data-availability="available"] .coast-chat__launcher.is-ready {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: width .34s cubic-bezier(.34, 1.28, .5, 1), border-radius .34s ease,
        opacity .38s cubic-bezier(.2, .7, .2, 1), transform .38s cubic-bezier(.2, .7, .2, 1),
        box-shadow .22s ease, background .22s ease, visibility 0s;
}

/* Hidden while the assistant panel (or any open state) is showing. This must
   out-specify the reveal rule above (which is available + .is-ready), so it
   repeats those qualifiers to win the cascade. */
.coast-chat[data-state="open"] .coast-chat__launcher,
.coast-chat[data-availability="available"][data-state="open"] .coast-chat__launcher.is-ready {
    opacity: 0;
    transform: translateY(12px);
    visibility: hidden;
    pointer-events: none;
}

/* Scaled out of the way whenever ANY overlay is open - enquiry sheet, callback
   sheet, mobile nav, the chat panel itself. The body class is set centrally by
   coast-overlay-state.js, so overlays added later need no rule here. Repeats
   the reveal rule's qualifiers so it wins the cascade. */
body.coast-overlay-open .coast-chat__launcher,
body.coast-overlay-open .coast-chat[data-availability="available"] .coast-chat__launcher.is-ready {
    opacity: 0;
    transform: translateY(8px) scale(.9);
    visibility: hidden;
    pointer-events: none;
    /* Hold visibility until the scale-out has played; the reveal rule's own
       transition takes over again on close. */
    transition: opacity .22s ease, transform .22s cubic-bezier(.4, 0, 1, 1),
        visibility 0s linear .22s;
}

/* Pressed: compress ~0.97 (source PRESSED state). */
.coast-chat__launcher:active {
    transform: scale(.97);
    box-shadow: 0 8px 22px -10px rgba(27, 27, 28, .30), 0 2px 6px -2px rgba(27, 27, 28, .10);
}

/* Focus: visible purple ring on both forms (keyboard-visible). */
.coast-chat__launcher:focus-visible {
    box-shadow: 0 16px 40px -14px rgba(27, 27, 28, .30), 0 3px 10px -3px rgba(27, 27, 28, .10),
        0 0 0 3px rgba(162, 63, 176, .55);
}

/* Unfurled pill (JS adds .is-expanded, gated to pointer devices). Lifts +
   brightens per the source's unfurled hover treatment. */
.coast-chat__launcher.is-expanded {
    width: var(--coast-launcher-w, 220px);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 253, 250, .92));
    box-shadow: 0 24px 52px -14px rgba(27, 27, 28, .40), 0 6px 16px -4px rgba(27, 27, 28, .14);
    transform: translateY(-2px);
}

.coast-chat__launcher.is-expanded:focus-visible {
    box-shadow: 0 24px 52px -14px rgba(27, 27, 28, .40), 0 6px 16px -4px rgba(27, 27, 28, .14),
        0 0 0 3px rgba(162, 63, 176, .55);
}

/* ---- Bars layer ---- */
.coast-chat__eq {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding-bottom: 13px;
    box-sizing: border-box;
    pointer-events: none;
    transform-origin: bottom;
    opacity: 1;
    transition: opacity .2s ease;
}

.coast-chat__launcher.is-expanded .coast-chat__eq { opacity: 0; }

.coast-chat__eq-bar {
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #FCC463, #F3A23C);
    transform-origin: bottom;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}

.coast-chat__eq-bar:nth-child(1) { height: 14px; }
.coast-chat__eq-bar:nth-child(2) { height: 26px; }
.coast-chat__eq-bar:nth-child(3) { height: 19px; }
.coast-chat__eq-bar:nth-child(4) { height: 29px; }
.coast-chat__eq-bar:nth-child(5) { height: 16px; }

/* ---- Pill layer ---- */
.coast-chat__launcher-pill {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 18px 8px 8px;
    box-sizing: border-box;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .24s ease .06s;
}

.coast-chat__launcher.is-expanded .coast-chat__launcher-pill { opacity: 1; }

.coast-chat__launcher-avatar {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FCC463, #F3A23C);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: #1B1B1C;
    letter-spacing: .02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px -4px rgba(243, 162, 60, .6);
}

.coast-chat__launcher-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22B364;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(27, 27, 28, .04);
}

.coast-chat__launcher-label {
    font-weight: 500;
    font-size: 15px;
    color: #1B1B1C;
    letter-spacing: .005em;
    max-width: calc(var(--coast-launcher-w, 220px) - 77px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Nudge bubble (ships flag-OFF) ---- */
.coast-chat__nudge {
    position: fixed;
    right: 24px;
    bottom: 92px; /* clears the 56px launcher + gap */
    z-index: 9998;
    box-sizing: border-box;
    max-width: 252px;
    padding: 12px 32px 12px 14px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 253, 250, .95));
    -webkit-backdrop-filter: blur(26px) saturate(140%);
    backdrop-filter: blur(26px) saturate(140%);
    border: 1px solid rgba(27, 27, 28, .07);
    border-radius: 16px;
    box-shadow: 0 20px 46px -18px rgba(27, 27, 28, .34), 0 4px 12px -4px rgba(27, 27, 28, .12);
    color: #1B1B1C;
    font-family: 'Poppins', system-ui, sans-serif;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .28s ease, transform .28s ease;
}

.coast-chat__nudge.is-visible { opacity: 1; transform: translateY(0); }
.coast-chat[data-state="open"] .coast-chat__nudge { display: none; }

/* Pointer notch bottom-right, aimed at the launcher below. */
.coast-chat__nudge::after {
    content: '';
    position: absolute;
    right: 22px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 253, 250, .95));
    border-right: 1px solid rgba(27, 27, 28, .07);
    border-bottom: 1px solid rgba(27, 27, 28, .07);
    transform: rotate(45deg);
}

.coast-chat__nudge-eyebrow {
    display: block;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #F3A23C;
}

.coast-chat__nudge-message {
    display: block;
    margin-top: 3px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #1B1B1C;
}

.coast-chat__nudge-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6E6E76;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.coast-chat__nudge-close:hover { background: rgba(27, 27, 28, .06); color: #1B1B1C; }
.coast-chat__nudge-close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(162, 63, 176, .55); }

/* Mobile: 16px from the right, safe-area-aware bottom. No unfurl on touch -
   that gating lives in JS (pointer/hover match), so only the inset changes. */
@media (max-width: 600px) {
    .coast-chat__launcher {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .coast-chat__nudge {
        right: 16px;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}

/* Reduced motion: no riff/pulse (JS-gated); the unfurl becomes an instant
   crossfade and the entrance is a plain fade. Keep the pill opacity crossfade. */
@media (prefers-reduced-motion: reduce) {
    .coast-chat__launcher {
        transition: opacity .2s ease, background .2s ease, box-shadow .2s ease, visibility 0s linear .2s;
        transform: none;
    }
    .coast-chat[data-availability="available"] .coast-chat__launcher.is-ready {
        transform: none;
        transition: opacity .2s ease, background .2s ease, box-shadow .2s ease, visibility 0s;
    }
    .coast-chat[data-state="open"] .coast-chat__launcher { transform: none; }
    body.coast-overlay-open .coast-chat__launcher,
    body.coast-overlay-open .coast-chat[data-availability="available"] .coast-chat__launcher.is-ready {
        transform: none;
        transition: opacity .2s ease, visibility 0s linear .2s;
    }
    .coast-chat__launcher.is-expanded { transform: none; }
    .coast-chat__eq-bar { animation: none !important; }
}
