/*
|--------------------------------------------------------------------------
| AlaricForge Store Assistant
|--------------------------------------------------------------------------
*/

.afsa-widget [hidden] {
    display: none !important;
}

.afsa-widget {
    --afsa-primary: #171717;
    --afsa-primary-hover: #2b2b2b;
    --afsa-surface: #ffffff;
    --afsa-surface-soft: #f7f7f5;
    --afsa-text: #171717;
    --afsa-muted: #6b6b68;
    --afsa-border: rgba(23, 23, 23, 0.11);
    --afsa-success: #2f9e63;

    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    color: var(--afsa-text);
}

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

/*
|--------------------------------------------------------------------------
| Launcher
|--------------------------------------------------------------------------
*/

.afsa-launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 350px;
    min-height: 82px;
    padding: 14px 15px;
    border: 1px solid var(--afsa-border);
    border-radius: 18px;
    background: var(--afsa-surface);
    color: var(--afsa-text);
    box-shadow:
        0 16px 45px rgba(0, 0, 0, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-align: left;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.afsa-launcher:hover {
    transform: translateY(-2px);
    border-color: rgba(23, 23, 23, 0.18);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.17),
        0 3px 9px rgba(0, 0, 0, 0.06);
}

.afsa-launcher:focus-visible,
.afsa-close:focus-visible,
.afsa-nudge-close:focus-visible,
.afsa-send:focus-visible,
.afsa-input:focus-visible {
    outline: 3px solid rgba(23, 23, 23, 0.18);
    outline-offset: 2px;
}

.afsa-launcher-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: var(--afsa-primary);
    color: #ffffff;
}

.afsa-status-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 13px;
    height: 13px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: var(--afsa-success);
}

.afsa-launcher-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.afsa-launcher-eyebrow {
    margin-bottom: 2px;
    color: var(--afsa-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.afsa-launcher-title {
    color: var(--afsa-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.afsa-launcher-subtitle {
    margin-top: 3px;
    overflow: hidden;
    color: var(--afsa-muted);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afsa-launcher-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--afsa-surface-soft);
    color: var(--afsa-text);
    font-size: 17px;
    transition:
        transform 180ms ease,
        background 180ms ease;
}

.afsa-launcher:hover .afsa-launcher-arrow {
    transform: translateX(2px);
    background: #eeeeeb;
}

/*
|--------------------------------------------------------------------------
| Initial attention animation
|--------------------------------------------------------------------------
*/

.afsa-widget.afsa-intro .afsa-launcher {
    animation: afsa-arrive 520ms ease-out both;
}

@keyframes afsa-arrive {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/*
|--------------------------------------------------------------------------
| Proactive nudge
|--------------------------------------------------------------------------
*/

.afsa-nudge {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: 320px;
    padding: 15px 40px 15px 16px;
    border: 1px solid var(--afsa-border);
    border-radius: 16px;
    background: var(--afsa-surface);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.13),
        0 2px 7px rgba(0, 0, 0, 0.05);
}

.afsa-nudge:not([hidden]) {
    display: flex;
    flex-direction: column;
    animation: afsa-nudge-in 280ms ease-out both;
}

.afsa-nudge strong {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.35;
}

.afsa-nudge span {
    color: var(--afsa-muted);
    font-size: 13px;
    line-height: 1.45;
}

.afsa-nudge-close {
    position: absolute;
    top: 7px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #777;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.afsa-nudge-close:hover {
    background: var(--afsa-surface-soft);
    color: var(--afsa-text);
}

@keyframes afsa-nudge-in {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/*
|--------------------------------------------------------------------------
| Conversation panel
|--------------------------------------------------------------------------
*/

.afsa-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 390px;
    height: min(590px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid var(--afsa-border);
    border-radius: 20px;
    background: var(--afsa-surface);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.22),
        0 4px 14px rgba(0, 0, 0, 0.07);
    transform-origin: bottom right;
}

.afsa-panel:not([hidden]) {
    animation: afsa-panel-in 220ms ease-out both;
}

@keyframes afsa-panel-in {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.afsa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--afsa-border);
    background: var(--afsa-surface);
}

.afsa-header-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.afsa-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--afsa-primary);
    color: #ffffff;
}

.afsa-header-identity > div:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.afsa-header strong {
    color: var(--afsa-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.afsa-ready {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    color: var(--afsa-muted);
    font-size: 12px;
    line-height: 1.3;
}

.afsa-ready-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--afsa-success);
}

.afsa-close {
    position: relative;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--afsa-surface-soft);
    color: #555;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 150ms ease,
        color 150ms ease;
}

.afsa-close:hover {
    background: #ecece9;
    color: var(--afsa-text);
}

/*
|--------------------------------------------------------------------------
| Messages
|--------------------------------------------------------------------------
*/

.afsa-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 18px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--afsa-surface-soft);
    overscroll-behavior: contain;
}

.afsa-message {
    flex: 0 0 auto;
    max-width: 84%;
    padding: 11px 13px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.48;
    word-wrap: break-word;
}

.afsa-message span {
    display: block;
}

.afsa-message strong,
.afsa-message em {
    display: inline;
}

.afsa-message strong {
    font-weight: 700;
}

.afsa-assistant {
    align-self: flex-start;
    border: 1px solid var(--afsa-border);
    border-bottom-left-radius: 5px;
    background: #ffffff;
    color: var(--afsa-text);
}

.afsa-user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: var(--afsa-primary);
    color: #ffffff;
}

.afsa-thinking {
    color: var(--afsa-muted);
    font-size: 13px;
}

/*
|--------------------------------------------------------------------------
| Input
|--------------------------------------------------------------------------
*/

.afsa-form {
    padding: 12px;
    border-top: 1px solid var(--afsa-border);
    background: var(--afsa-surface);
}

.afsa-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.afsa-input {
    min-width: 0;
    min-height: 46px;
    flex: 1;
    padding: 10px 13px;
    border: 1px solid #d8d8d5;
    border-radius: 12px;
    background: #ffffff;
    color: var(--afsa-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.afsa-input::placeholder {
    color: #90908c;
}

.afsa-input:focus {
    border-color: #8d8d88;
    box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.06);
    outline: none;
}

.afsa-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 0 15px;
    border: 0;
    border-radius: 12px;
    background: var(--afsa-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 150ms ease,
        transform 150ms ease;
}

.afsa-send:hover {
    background: var(--afsa-primary-hover);
}

.afsa-send:active {
    transform: scale(0.98);
}

.afsa-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

.afsa-form-note {
    margin-top: 8px;
    color: #8a8a86;
    font-size: 10.5px;
    line-height: 1.35;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Accessibility
|--------------------------------------------------------------------------
*/

.afsa-screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/*
|--------------------------------------------------------------------------
| Position
|--------------------------------------------------------------------------
*/

.afsa-widget.afsa-position-left {
    right: auto;
    left: 24px;
}

.afsa-widget.afsa-position-left .afsa-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.afsa-widget.afsa-position-left .afsa-nudge {
    right: auto;
    left: 0;
}

/*
|--------------------------------------------------------------------------
| Widget templates
|--------------------------------------------------------------------------
*/

/*
 * Assistant Card is the default template.
 */

.afsa-launcher-standard {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.afsa-launcher-compact {
    display: none;
}

/*
|--------------------------------------------------------------------------
| Compact Assistant
|--------------------------------------------------------------------------
*/

.afsa-widget[data-afsa-template="compact-assistant"]
.afsa-launcher {
    width: auto;
    min-width: 205px;
    padding: 10px 13px;
    gap: 10px;
    border-radius: 999px;
}

.afsa-widget[data-afsa-template="compact-assistant"]
.afsa-launcher-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.afsa-widget[data-afsa-template="compact-assistant"]
.afsa-launcher-icon svg {
    width: 18px;
    height: 18px;
}

.afsa-widget[data-afsa-template="compact-assistant"]
.afsa-launcher-standard {
    display: none;
}

.afsa-widget[data-afsa-template="compact-assistant"]
.afsa-launcher-compact {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.afsa-compact-name {
    overflow: hidden;
    flex: 1;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afsa-compact-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.72;
}

.afsa-compact-status::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--afsa-success);
}

/*
 * Compact affects the launcher only.
 * The conversation panel intentionally retains the same dimensions
 * and functionality as the standard assistant.
 */

@media (max-width: 600px) {
    .afsa-widget[data-afsa-template="compact-assistant"]
    .afsa-launcher {
        width: auto;
        min-width: 190px;
        max-width: calc(100vw - 32px);
    }
}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 640px) {
    .afsa-widget {
        right: 14px;
        bottom: 14px;
        left: 14px;
    }

    .afsa-launcher {
        width: 100%;
        min-height: 72px;
        padding: 11px 12px;
        border-radius: 17px;
    }

    .afsa-launcher-icon {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .afsa-launcher-subtitle {
        font-size: 11px;
    }

    .afsa-nudge {
        right: 0;
        width: min(310px, calc(100vw - 28px));
    }

    .afsa-panel {
        position: fixed;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        width: auto;
        height: min(620px, calc(100vh - 20px));
        height: min(620px, calc(100dvh - 20px));
        max-height: calc(100dvh - 20px);
        border-radius: 18px;
    }

    .afsa-message {
        max-width: 90%;
    }
}

@media (max-width: 390px) {
    .afsa-launcher-subtitle {
        display: none;
    }

    .afsa-launcher {
        min-height: 66px;
    }

    .afsa-launcher-arrow {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .afsa-input-row {
        align-items: stretch;
    }

    .afsa-send span:first-child {
        display: none;
    }

    .afsa-send {
        width: 46px;
        padding: 0;
    }
}

/*
|--------------------------------------------------------------------------
| Reduced motion
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
    .afsa-widget *,
    .afsa-widget *::before,
    .afsa-widget *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* Milestone F: persistent conversation controls */
.afsa-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.afsa-new-conversation {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--afsa-border);
    border-radius: 999px;
    background: var(--afsa-surface-soft);
    color: var(--afsa-text);
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
}

.afsa-new-conversation:hover {
    background: #ecece9;
}

.afsa-new-conversation:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 420px) {
    .afsa-new-conversation {
        max-width: 92px;
        padding: 0 8px;
        white-space: normal;
        line-height: 1.1;
    }
}


/* Definitive product confirmation: deliberately compact, not a catalogue grid. */
.afsa-product-card {
    align-self: flex-start;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    width: min(86%, 330px);
    padding: 9px;
    margin: 2px 0 6px;
    border: 1px solid var(--afsa-border);
    border-radius: 14px;
    background: var(--afsa-surface-soft);
    box-sizing: border-box;
}

.afsa-product-card-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    background: #fff;
}

.afsa-product-card-body { min-width: 0; }
.afsa-product-card-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.afsa-product-card-attributes { margin-top: 3px; font-size: 11px; opacity: .72; line-height: 1.35; }
.afsa-product-card-price { margin-top: 5px; font-size: 13px; font-weight: 700; }
.afsa-product-card-link {
    grid-column: 2;
    justify-self: start;
    font-size: 11px;
    font-weight: 650;
    text-decoration: underline;
}

.afsa-product-card-image {
    display: block;
    width: min(86%, 330px);
}
.afsa-product-card-image .afsa-product-card-thumb {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}
.afsa-product-card-image .afsa-product-card-link {
    display: inline-block;
    margin-top: 7px;
}


/* WooCommerce-authoritative compact mini cart inside the conversation. */
[data-afsa-widget] .afsa-cart-message {
    display: block;
    width: min(88%, 315px);
    max-width: min(88%, 315px);
    padding: 0;
    overflow: hidden;
    background: var(--afsa-surface);
    box-sizing: border-box;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card {
    display: block;
    position: static;
    align-self: flex-start;
    height: auto;
    min-height: 0;
    max-height: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
    color: var(--afsa-text);
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 7px;
    border-bottom: 1px solid var(--afsa-border);
    font-size: 11px;
    line-height: 1.2;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-header strong {
    font-size: 12px;
    font-weight: 700;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-header span {
    color: var(--afsa-muted);
    font-size: 10px;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 9px;
    border-bottom: 1px solid var(--afsa-border);
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-thumb {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--afsa-surface-soft);
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--afsa-muted);
    font-size: 18px;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item-body {
    min-width: 0;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item-name {
    overflow: hidden;
    color: var(--afsa-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item-attrs {
    overflow: hidden;
    margin-top: 2px;
    color: var(--afsa-muted);
    font-size: 9.5px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
    font-size: 10px;
    color: var(--afsa-muted);
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-item-meta strong {
    color: var(--afsa-text);
    font-size: 11px;
    font-weight: 700;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    font-size: 10px;
    color: var(--afsa-muted);
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-total strong {
    color: var(--afsa-text);
    font-size: 12px;
    font-weight: 800;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-view {
    flex: 0 0 auto;
    color: var(--afsa-primary) !important;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-view:hover {
    text-decoration: underline !important;
}

[data-afsa-widget] .afsa-cart-message .afsa-cart-card-empty {
    padding: 9px 10px;
    color: var(--afsa-muted);
    font-size: 11px;
}


/* WooCommerce-authoritative two-product comparison table. */
[data-afsa-widget] .afsa-comparison-message {
    display: block;
    width: min(96%, 380px);
    max-width: min(96%, 380px);
    padding: 0;
    overflow: hidden;
    background: var(--afsa-surface);
    box-sizing: border-box;
}

[data-afsa-widget] .afsa-comparison-card {
    display: block;
    width: 100%;
    padding: 9px;
    box-sizing: border-box;
}

[data-afsa-widget] .afsa-comparison-heading {
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 750;
    opacity: .72;
}

[data-afsa-widget] .afsa-comparison-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--afsa-border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 10.5px;
    line-height: 1.3;
}

[data-afsa-widget] .afsa-comparison-table th,
[data-afsa-widget] .afsa-comparison-table td {
    padding: 6px;
    border-right: 1px solid var(--afsa-border);
    border-bottom: 1px solid var(--afsa-border);
    vertical-align: top;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

[data-afsa-widget] .afsa-comparison-table tr > :last-child {
    border-right: 0;
}

[data-afsa-widget] .afsa-comparison-table tbody tr:last-child > * {
    border-bottom: 0;
}

[data-afsa-widget] .afsa-comparison-label-cell {
    width: 22%;
    text-align: left;
    font-size: 9.5px;
    font-weight: 700;
    opacity: .7;
    background: var(--afsa-surface-soft);
}

[data-afsa-widget] .afsa-comparison-corner {
    vertical-align: middle;
}

[data-afsa-widget] .afsa-comparison-product-head {
    width: 39%;
    text-align: left;
    font-weight: 400;
    background: var(--afsa-surface-soft);
}

[data-afsa-widget] .afsa-comparison-thumb {
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 0 5px;
    object-fit: cover;
    border-radius: 7px;
    background: #fff;
}

[data-afsa-widget] .afsa-comparison-name {
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.25;
}

[data-afsa-widget] .afsa-comparison-price {
    font-weight: 750;
}

[data-afsa-widget] .afsa-comparison-link {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 650;
    text-decoration: underline;
}

@media (max-width: 420px) {
    [data-afsa-widget] .afsa-comparison-message {
        width: 98%;
        max-width: 98%;
    }

    [data-afsa-widget] .afsa-comparison-card {
        padding: 7px;
    }

    [data-afsa-widget] .afsa-comparison-table th,
    [data-afsa-widget] .afsa-comparison-table td {
        padding: 5px;
    }

    [data-afsa-widget] .afsa-comparison-label-cell {
        width: 21%;
    }

    [data-afsa-widget] .afsa-comparison-product-head {
        width: 39.5%;
    }
}

/* Secure WooCommerce checkout handoff CTA. */
[data-afsa-widget] .afsa-checkout-cta-message {
    padding-top: 0;
    background: transparent;
    box-shadow: none;
}

[data-afsa-widget] .afsa-checkout-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 10px;
    background: var(--afsa-primary);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
}

[data-afsa-widget] .afsa-checkout-cta:hover,
[data-afsa-widget] .afsa-checkout-cta:focus-visible {
    text-decoration: none !important;
    filter: brightness(0.96);
}



/* Visitor capability guide */
.afsa-help-guide {
    margin: 0 16px 12px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    background: var(--afsa-surface-color, #fff);
    font-size: 12px;
}
.afsa-help-guide summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 600;
    list-style: none;
}
.afsa-help-guide summary::-webkit-details-marker { display: none; }
.afsa-help-guide summary::after { content: '+'; float: right; font-size: 16px; line-height: 1; }
.afsa-help-guide[open] summary::after { content: '−'; }
.afsa-help-guide-body {
    display: grid;
    gap: 7px;
    padding: 0 12px 11px;
    color: var(--afsa-muted-color, #6b6b68);
}
.afsa-help-guide-body span::before { content: '•'; margin-right: 7px; }


/* Close-control hardening: keep header controls above chat content and third-party overlays inside the widget. */
.afsa-panel > .afsa-header {
    position: relative;
    z-index: 100;
    flex: 0 0 auto;
    pointer-events: auto;
}
.afsa-header-actions {
    position: relative;
    z-index: 101;
    pointer-events: auto;
}
.afsa-header-actions .afsa-close {
    position: relative;
    z-index: 102;
    pointer-events: auto !important;
    touch-action: manipulation;
}
