/*
 * MedVinci Copilot Bar — v0.1 skeleton styles
 *
 * Mobile-first. Scoped under [data-mvr-copilot]. Mirrors mvrc-* design
 * tokens for visual continuity with the legacy mini-cart.
 */

[data-mvr-copilot] {
    --mvr-bg-bar:        #0e1014;
    --mvr-fg-bar:        #f5f7fa;
    --mvr-bg-sheet:      #ffffff;
    --mvr-fg-sheet:      #1a1d24;
    --mvr-fg-muted:      #6b7280;
    --mvr-accent:        #1e88e5;
    --mvr-overlay:       rgba(0, 0, 0, 0.45);
    --mvr-radius-sheet:  20px 20px 0 0;
    --mvr-radius-pill:   999px;
    --mvr-shadow-sheet:  0 -8px 32px rgba(0, 0, 0, 0.18);
    --mvr-z-bar:         9998;
    --mvr-z-overlay:     9999;
    --mvr-z-sheet:       10000;
    --mvr-bar-height:    64px;
    --mvr-sheet-height:  85vh;
    --mvr-anim-spring:   cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* ------------------------------------------------------------------ */
/* Mobile shop bar (desktop uses the cart bubble)                       */
/* ------------------------------------------------------------------ */

[data-mvr-copilot] .mvr-copilot-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--mvr-z-bar);
    display: flex;
    align-items: stretch;
    height: var(--mvr-bar-height);
    background: var(--mvr-bg-bar);
    color: var(--mvr-fg-bar);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: content-box;
}

[data-mvr-copilot] .mvr-copilot-bar__summary {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
}

[data-mvr-copilot] .mvr-copilot-bar__summary:focus-visible,
[data-mvr-copilot] .mvr-copilot-bar__cart:focus-visible,
[data-mvr-copilot] .mvr-copilot-bar__checkout:focus-visible {
    outline: 2px solid var(--mvr-accent);
    outline-offset: -3px;
}

[data-mvr-copilot] .mvr-copilot-bar__count {
    font-size: 14px;
    color: rgba(245, 247, 250, 0.75);
}

[data-mvr-copilot] .mvr-copilot-bar__price {
    font-size: 16px;
    font-weight: 600;
}

[data-mvr-copilot] .mvr-copilot-bar__savings {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    padding: 0 8px;
    color: inherit;
}

[data-mvr-copilot] .mvr-copilot-bar__savings-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.72;
}

[data-mvr-copilot] .mvr-copilot-bar__savings-value {
    font-size: 14px;
    font-weight: 850;
}

[data-mvr-copilot] .mvr-copilot-bar__cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 78px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.11);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

[data-mvr-copilot] .mvr-copilot-bar__cart:hover,
[data-mvr-copilot] .mvr-copilot-bar__cart:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

[data-mvr-copilot] .mvr-copilot-bar__checkout {
    display: inline-flex;
    align-items: center;
    padding: 0 22px;
    background: var(--mvr-accent);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
}

[data-mvr-copilot] .mvr-copilot-bar__checkout:visited,
[data-mvr-copilot] .mvr-copilot-bar__checkout:active,
[data-mvr-copilot] .mvr-copilot-bar__checkout:hover,
[data-mvr-copilot] .mvr-copilot-bar__checkout:focus-visible {
    color: #fff !important;
    text-decoration: none !important;
}

[data-mvr-copilot] .mvr-copilot-bar__checkout:hover,
[data-mvr-copilot] .mvr-copilot-bar__checkout:focus-visible {
    background: #1976d2;
    outline: 0;
}

html[data-theme="light"] body [data-mvr-copilot] .mvr-copilot-bar__checkout,
html[data-theme="light"] body [data-mvr-copilot] .mvr-copilot-bar__checkout:visited,
html[data-theme="light"] body [data-mvr-copilot] .mvr-copilot-bar__checkout:active,
html[data-theme="light"] body [data-mvr-copilot] .mvr-copilot-bar__checkout:hover,
html[data-theme="light"] body [data-mvr-copilot] .mvr-copilot-bar__checkout:focus-visible {
    color: #fff !important;
}

/* ------------------------------------------------------------------ */
/* Overlay                                                             */
/* ------------------------------------------------------------------ */

[data-mvr-copilot] .mvr-copilot-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--mvr-z-overlay);
    background: var(--mvr-overlay);
    opacity: 0;
    transition: opacity 220ms ease-out;
}

[data-mvr-copilot]:not([data-state="idle"]) .mvr-copilot-overlay {
    opacity: 1;
}

[data-mvr-copilot] .mvr-copilot-overlay[hidden] {
    display: none;
}

/* ------------------------------------------------------------------ */
/* Sheet                                                               */
/* ------------------------------------------------------------------ */

[data-mvr-copilot] .mvr-copilot-sheet {
    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--mvr-z-sheet);
    height: var(--mvr-sheet-height);
    max-height: var(--mvr-sheet-height);
    background: var(--mvr-bg-sheet);
    color: var(--mvr-fg-sheet);
    border-radius: var(--mvr-radius-sheet);
    box-shadow: var(--mvr-shadow-sheet);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 280ms var(--mvr-anim-spring);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-mvr-copilot]:not([data-state="idle"]) .mvr-copilot-sheet {
    transform: translateY(calc(0px - var(--mvr-keyboard-offset, 0px)));
}

[data-mvr-copilot] .mvr-copilot-sheet[hidden] {
    display: none;
}

[data-mvr-copilot] .mvr-copilot-sheet:focus {
    outline: none;
}

[data-mvr-copilot] .mvr-copilot-sheet__handle {
    flex: 0 0 auto;
    width: 40px;
    height: 4px;
    margin: 8px auto 4px;
    border-radius: 999px;
    background: #d1d5db;
    cursor: grab;
    touch-action: none;
}

[data-mvr-copilot] .mvr-copilot-sheet__handle:active {
    cursor: grabbing;
    background: #9ca3af;
}

[data-mvr-copilot] .mvr-copilot-sheet__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #f1f3f6;
}

[data-mvr-copilot] .mvr-copilot-sheet__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

[data-mvr-copilot] .mvr-copilot-sheet__close {
    background: transparent;
    border: 0;
    color: var(--mvr-fg-muted);
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-mvr-copilot] .mvr-copilot-sheet__close:hover,
[data-mvr-copilot] .mvr-copilot-sheet__close:focus-visible {
    color: var(--mvr-fg-sheet);
    background: #f1f3f6;
    outline: 0;
}

[data-mvr-copilot] .mvr-copilot-sheet__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

[data-mvr-copilot] .mvr-copilot-empty {
    margin: 32px 0;
    color: var(--mvr-fg-muted);
    text-align: center;
    font-size: 15px;
}

/* ------------------------------------------------------------------ */
/* Body lock when sheet is open (prevents background scroll on iOS)    */
/* ------------------------------------------------------------------ */

body.mvr-copilot-locked {
    overflow: hidden;
    overscroll-behavior: contain;
}

/* ------------------------------------------------------------------ */
/* Screen-reader-only utility                                          */
/* ------------------------------------------------------------------ */

[data-mvr-copilot] .mvr-copilot-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------ */
/* Reduced motion — replace spring + slide with quick fade             */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    [data-mvr-copilot] .mvr-copilot-sheet {
        transition: opacity 120ms ease-out, transform 0ms;
        transform: translateY(0);
        opacity: 0;
    }

    [data-mvr-copilot]:not([data-state="idle"]) .mvr-copilot-sheet {
        opacity: 1;
    }

    [data-mvr-copilot] .mvr-copilot-overlay {
        transition: opacity 120ms ease-out;
    }
}

/* ------------------------------------------------------------------ */
/* Desktop — bar narrows + centers; sheet stays bottom-anchored        */
/* ------------------------------------------------------------------ */

@media (min-width: 768px) {
    [data-mvr-copilot] .mvr-copilot-bar {
        left: 50%;
        right: auto;
        bottom: 16px;
        transform: translateX(-50%);
        width: min(680px, calc(100vw - 32px));
        border-radius: var(--mvr-radius-pill);
        height: 56px;
        display: grid;
        grid-template-columns: minmax(148px, 1fr) minmax(84px, .55fr) 92px minmax(124px, .76fr);
        gap: 6px;
        align-items: center;
        padding: 6px 7px;
        background: rgba(8, 16, 25, 0.94);
        border: 1px solid rgba(141, 183, 255, 0.22);
        color: #f7fbff;
        box-shadow:
            0 16px 38px rgba(0, 0, 0, 0.28),
            0 0 22px rgba(0, 206, 255, 0.13);
        backdrop-filter: blur(18px) saturate(1.18);
        -webkit-backdrop-filter: blur(18px) saturate(1.18);
        box-sizing: border-box;
    }

    [data-mvr-copilot] .mvr-copilot-bar__summary {
        height: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        padding: 0 10px;
        text-align: center;
    }

    [data-mvr-copilot] .mvr-copilot-bar__count {
        color: rgba(228, 242, 255, 0.72);
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    [data-mvr-copilot] .mvr-copilot-bar__price {
        color: #ffffff;
        font-size: 17px;
        font-weight: 850;
        line-height: 1.1;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings {
        height: 44px;
        padding: 0 8px;
        border-radius: 16px;
        background: rgba(0, 206, 255, 0.08);
        border: 1px solid rgba(0, 206, 255, 0.16);
        color: #dffaff;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings-label {
        color: rgba(223, 250, 255, 0.66);
        font-size: 9px;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings-value {
        color: #ffffff;
        font-size: 12px;
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart,
    [data-mvr-copilot] .mvr-copilot-bar__checkout {
        height: 44px;
        min-width: 0;
        border: 0;
        border-radius: 16px;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart {
        padding: 0 12px;
        background: rgba(255, 255, 255, 0.07);
        color: #dffaff;
        border: 1px solid rgba(77, 208, 225, 0.34);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    }

    [data-mvr-copilot] .mvr-copilot-bar__checkout {
        justify-content: center;
        padding: 0 14px;
        background: linear-gradient(135deg, #0691fa 0%, #00ceff 100%);
        color: #ffffff;
        font-weight: 850;
        box-shadow: 0 8px 20px rgba(6, 145, 250, 0.30);
        text-shadow: 0 1px 2px rgba(0, 39, 75, 0.30);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar {
        background: rgba(248, 252, 255, 0.94);
        border-color: rgba(6, 129, 225, 0.20);
        color: #082033;
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.16),
            0 0 18px rgba(6, 145, 250, 0.12);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__count {
        color: rgba(8, 32, 51, 0.62);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__price {
        color: #081827;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings {
        background: rgba(6, 145, 250, 0.08);
        border-color: rgba(6, 145, 250, 0.18);
        color: #075fbd;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings-label {
        color: rgba(8, 32, 51, 0.54);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings-value {
        color: #075fbd;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__cart {
        background: #ffffff;
        border-color: rgba(6, 129, 225, 0.28);
        color: #075fbd;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__checkout {
        background: linear-gradient(135deg, #0681e1 0%, #00aeea 100%);
        color: #ffffff;
    }

    [data-mvr-copilot] .mvr-copilot-sheet {
        left: 50%;
        transform: translate(-50%, 100%);
        width: min(640px, calc(100vw - 32px));
        border-radius: 16px;
        bottom: 16px;
        max-height: 70vh;
    }

    [data-mvr-copilot]:not([data-state="idle"]) .mvr-copilot-sheet {
        transform: translate(-50%, 0);
    }
}

@media (max-width: 782px) {
    [data-mvr-copilot] {
        --mvr-bar-height: 62px;
    }

    [data-mvr-copilot] .mvr-copilot-bar {
        inset: auto 10px calc(10px + env(safe-area-inset-bottom, 0px)) 10px;
        width: auto;
        transform: none;
        display: grid;
        grid-template-columns: minmax(98px, 1fr) minmax(58px, 0.62fr) 64px minmax(88px, 0.82fr);
        gap: 5px;
        align-items: center;
        height: var(--mvr-bar-height);
        padding: 6px 7px;
        box-sizing: border-box;
        background: rgba(8, 16, 25, 0.94);
        border: 1px solid rgba(141, 183, 255, 0.22);
        border-radius: 999px;
        color: #f7fbff;
        box-shadow:
            0 16px 38px rgba(0, 0, 0, 0.34),
            0 0 22px rgba(0, 206, 255, 0.16);
        backdrop-filter: blur(18px) saturate(1.18);
        -webkit-backdrop-filter: blur(18px) saturate(1.18);
    }

    [data-mvr-copilot] .mvr-copilot-bar__summary {
        min-width: 0;
        height: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        padding: 0 6px;
        text-align: center;
    }

    [data-mvr-copilot] .mvr-copilot-bar__count {
        max-width: 100%;
        color: rgba(228, 242, 255, 0.72);
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    [data-mvr-copilot] .mvr-copilot-bar__price {
        max-width: 100%;
        color: #ffffff;
        font-size: 18px;
        font-weight: 850;
        line-height: 1.15;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings {
        height: 50px;
        padding: 0 5px;
        border-radius: 18px;
        background: rgba(0, 206, 255, 0.08);
        border: 1px solid rgba(0, 206, 255, 0.16);
        color: #dffaff;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings-label {
        color: rgba(223, 250, 255, 0.66);
        font-size: 9px;
        line-height: 1.1;
    }

    [data-mvr-copilot] .mvr-copilot-bar__savings-value {
        max-width: 100%;
        color: #ffffff;
        font-size: 12px;
        line-height: 1.12;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart,
    [data-mvr-copilot] .mvr-copilot-bar__checkout {
        height: 48px;
        min-width: 0;
        border: 0;
        border-radius: 18px;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart {
        gap: 5px;
        padding: 0 7px;
        background: rgba(255, 255, 255, 0.07);
        color: #dffaff;
        border: 1px solid rgba(77, 208, 225, 0.34);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart:hover,
    [data-mvr-copilot] .mvr-copilot-bar__cart:focus-visible {
        background: rgba(77, 208, 225, 0.16);
    }

    [data-mvr-copilot] .mvr-copilot-bar__checkout {
        justify-content: center;
        padding: 0 10px;
        background: linear-gradient(135deg, #0691fa 0%, #00ceff 100%);
        color: #ffffff;
        font-weight: 850;
        box-shadow: 0 8px 20px rgba(6, 145, 250, 0.34);
        text-shadow: 0 1px 2px rgba(0, 39, 75, 0.30);
    }

    [data-mvr-copilot] .mvr-copilot-bar__checkout:hover,
    [data-mvr-copilot] .mvr-copilot-bar__checkout:focus-visible {
        background: linear-gradient(135deg, #057fe0 0%, #04bae5 100%);
        color: #ffffff;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar {
        background: rgba(248, 252, 255, 0.94);
        border-color: rgba(6, 129, 225, 0.20);
        color: #082033;
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.16),
            0 0 18px rgba(6, 145, 250, 0.12);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__count {
        color: rgba(8, 32, 51, 0.62);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__price {
        color: #081827;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings {
        background: rgba(6, 145, 250, 0.08);
        border-color: rgba(6, 145, 250, 0.18);
        color: #075fbd;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings-label {
        color: rgba(8, 32, 51, 0.54);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__savings-value {
        color: #075fbd;
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__cart {
        background: #ffffff;
        border-color: rgba(6, 129, 225, 0.28);
        color: #075fbd;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.66);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__cart:hover,
    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__cart:focus-visible {
        background: rgba(6, 145, 250, 0.08);
    }

    html[data-theme="light"] [data-mvr-copilot] .mvr-copilot-bar__checkout {
        background: linear-gradient(135deg, #0681e1 0%, #00aeea 100%);
        color: #ffffff;
    }
}

@media (max-width: 360px) {
    [data-mvr-copilot] .mvr-copilot-bar {
        grid-template-columns: minmax(88px, 1fr) minmax(52px, 0.58fr) 50px minmax(76px, 0.72fr);
        gap: 4px;
        padding: 5px;
    }

    [data-mvr-copilot] .mvr-copilot-bar__cart span {
        display: none;
    }
}

/* CSS owns the viewport gate: cached HTML and takeover filters stay the
   same for mobile and desktop visitors. */
@media (min-width: 1024px) {
    [data-mvr-copilot] .mvr-copilot-bar {
        display: none !important;
    }
}

/* ------------------------------------------------------------------ */
/* v0.2 — Preact app: transcript, composer, cards                      */
/* ------------------------------------------------------------------ */

[data-mvr-copilot] .mvr-copilot-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

[data-mvr-copilot] .mvr-copilot-app__main {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 16px 8px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-mvr-copilot] .mvr-copilot-welcome {
    margin: 16px 0 4px;
}

[data-mvr-copilot] .mvr-copilot-welcome h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--mvr-fg-sheet);
}

[data-mvr-copilot] .mvr-copilot-welcome__hint {
    margin: 0;
    font-size: 14px;
    color: var(--mvr-fg-muted);
    line-height: 1.45;
}

/* Transcript */

[data-mvr-copilot] .mvr-copilot-transcript {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[data-mvr-copilot] .mvr-copilot-msg {
    display: flex;
    max-width: 88%;
}

[data-mvr-copilot] .mvr-copilot-msg--user {
    align-self: flex-end;
    justify-content: flex-end;
}

[data-mvr-copilot] .mvr-copilot-msg--assistant,
[data-mvr-copilot] .mvr-copilot-msg--system {
    align-self: flex-start;
    justify-content: flex-start;
}

[data-mvr-copilot] .mvr-copilot-msg__bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

[data-mvr-copilot] .mvr-copilot-msg--user .mvr-copilot-msg__bubble {
    background: var(--mvr-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

[data-mvr-copilot] .mvr-copilot-msg--assistant .mvr-copilot-msg__bubble {
    background: #f1f3f6;
    color: var(--mvr-fg-sheet);
    border-bottom-left-radius: 4px;
}

[data-mvr-copilot] .mvr-copilot-msg--system .mvr-copilot-msg__bubble {
    background: transparent;
    color: var(--mvr-fg-muted);
    font-style: italic;
    font-size: 13px;
}

/* Cards */

[data-mvr-copilot] .mvr-copilot-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-mvr-copilot] .mvr-copilot-card {
    background: #fff;
    border: 1px solid #e6e8ed;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-mvr-copilot] .mvr-copilot-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mvr-fg-sheet);
    margin-bottom: 6px;
}

[data-mvr-copilot] .mvr-copilot-card__body {
    font-size: 14px;
    line-height: 1.45;
    color: var(--mvr-fg-sheet);
}

[data-mvr-copilot] .mvr-copilot-card__body--muted {
    color: var(--mvr-fg-muted);
}

[data-mvr-copilot] .mvr-copilot-card__hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--mvr-fg-muted);
    border-top: 1px dashed #e6e8ed;
    padding-top: 8px;
}

[data-mvr-copilot] .mvr-copilot-card__cta {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: var(--mvr-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

[data-mvr-copilot] .mvr-copilot-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

[data-mvr-copilot] .mvr-copilot-card__action {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    font-size: 13px;
    color: var(--mvr-fg-sheet);
    cursor: pointer;
}

[data-mvr-copilot] .mvr-copilot-card__action:hover,
[data-mvr-copilot] .mvr-copilot-card__action:focus-visible {
    background: #f1f3f6;
    border-color: #9ca3af;
    outline: 0;
}

/* Refusal — light grey background, never error-red */

[data-mvr-copilot] .mvr-copilot-card--refusal {
    background: #f7f8fa;
    border-color: #dee2e6;
}

[data-mvr-copilot] .mvr-copilot-card--tone-firm {
    border-left: 3px solid #6b7280;
}

[data-mvr-copilot] .mvr-copilot-card--unknown {
    background: #fff8e6;
    border-color: #f5d479;
}

/* Cart card */

[data-mvr-copilot] .mvr-copilot-cart__lines {
    list-style: none;
    margin: 8px 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-mvr-copilot] .mvr-copilot-cart__line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    font-size: 13px;
    align-items: baseline;
}

[data-mvr-copilot] .mvr-copilot-cart__sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--mvr-fg-muted);
}

[data-mvr-copilot] .mvr-copilot-cart__qty {
    color: var(--mvr-fg-muted);
}

[data-mvr-copilot] .mvr-copilot-cart__totals {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid #f1f3f6;
    font-size: 14px;
}

[data-mvr-copilot] .mvr-copilot-cart__totals > div {
    display: flex;
    justify-content: space-between;
}

[data-mvr-copilot] .mvr-copilot-cart__grand-total {
    font-weight: 600;
}

/* Composer */

[data-mvr-copilot] .mvr-copilot-composer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f1f3f6;
    background: var(--mvr-bg-sheet);
}

[data-mvr-copilot] .mvr-copilot-composer__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
    color: var(--mvr-fg-sheet);
    background: #fff;
    outline: none;
}

[data-mvr-copilot] .mvr-copilot-composer__input:focus {
    border-color: var(--mvr-accent);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

[data-mvr-copilot] .mvr-copilot-composer__input:disabled {
    opacity: 0.6;
}

[data-mvr-copilot] .mvr-copilot-composer__send {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--mvr-accent);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

[data-mvr-copilot] .mvr-copilot-composer__send:disabled {
    background: #c4cad3;
    cursor: not-allowed;
}

/* Typing indicator */

[data-mvr-copilot] .mvr-copilot-typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 8px 12px;
    background: #f1f3f6;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

[data-mvr-copilot] .mvr-copilot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: mvr-blink 1.4s infinite both;
}

[data-mvr-copilot] .mvr-copilot-typing span:nth-child(2) { animation-delay: 0.2s; }
[data-mvr-copilot] .mvr-copilot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mvr-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40%           { opacity: 1; }
}

/* Error */

[data-mvr-copilot] .mvr-copilot-error {
    padding: 10px 14px;
    background: #fff8e6;
    border: 1px solid #f5d479;
    border-radius: 10px;
    color: #6b4f1d;
    font-size: 13px;
    align-self: flex-start;
}

/* Product-suggestion card */

[data-mvr-copilot] .mvr-copilot-products__list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[data-mvr-copilot] .mvr-copilot-products__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #f1f3f6;
}

[data-mvr-copilot] .mvr-copilot-products__row:first-child {
    border-top: 0;
    padding-top: 0;
}

[data-mvr-copilot] .mvr-copilot-products__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

[data-mvr-copilot] .mvr-copilot-products__sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--mvr-fg-muted);
}

[data-mvr-copilot] .mvr-copilot-products__name {
    font-size: 14px;
    color: var(--mvr-fg-sheet);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-mvr-copilot] .mvr-copilot-products__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

[data-mvr-copilot] .mvr-copilot-products__price {
    font-size: 14px;
    font-weight: 600;
    color: var(--mvr-fg-sheet);
}

[data-mvr-copilot] .mvr-copilot-products__link {
    color: var(--mvr-accent);
    text-decoration: none;
    font-size: 13px;
}

[data-mvr-copilot] .mvr-copilot-products__link:hover {
    text-decoration: underline;
}

/* Handoff-human card */

[data-mvr-copilot] .mvr-copilot-card--handoff.is-live {
    background: #f0f7ff;
    border-color: #bee0ff;
}

[data-mvr-copilot] .mvr-copilot-card--handoff.is-pending {
    background: #fff8e6;
    border-color: #f5d479;
}
