.api-error-banner {
    text-align: center;
    color: #fff;
    background-color: #fd5c4c;
    padding: 8px;
}

.api-error-banner a {
    color: white;
    text-decoration: underline;
}

/* Keep Pakafront background variables consistent across layouts. */
body {
    background: var(--pf-bg) !important;
    color: var(--pf-ink-2) !important;
}

#mobileMenu .pf-offcanvas-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#mobileMenu .pf-offcanvas-nav > * {
    flex-shrink: 0;
}

#mobileMenu .pf-offcanvas-group.open .pf-offcanvas-submenu {
    max-height: 5000px;
}

/* Keep desktop side menus sticky on non-admin pages, matching admin UX. */
.pf-sidebar.pf-mobile-hide:not(.admin-sidebar) {
    --app-sidebar-offset: 96px;
    position: sticky;
    top: var(--app-sidebar-offset);
    align-self: flex-start;
    min-height: 0;
}

.pf-sidebar.pf-mobile-hide:not(.admin-sidebar) .pf-sidebar-group {
    max-height: calc(100vh - var(--app-sidebar-offset) - 1rem);
    max-height: calc(100dvh - var(--app-sidebar-offset) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Authentication pages layout */
.auth-divider-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.auth-divider-vertical {
    width: 1px;
    background-color: var(--pf-border);
    min-height: 80px;
    flex-grow: 1;
}

.auth-divider-horizontal {
    height: 1px;
    background-color: var(--pf-border);
    flex-grow: 1;
}

.flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Centered list with icons */
.yp-list-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.yp-list-centered li {
    padding-left: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: left;
}

.yp-list-centered .pf-icon {
    position: static !important;
    margin: 0 !important;
}

/* Your Pair layout utilities */
.yp-header-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.yp-action-left {
    order: 2;
    width: 100%;
    text-align: center;
}

.yp-action-right {
    order: 3;
    width: 100%;
    text-align: center;
}

.yp-info {
    order: 1;
    text-align: center;
}

@media (min-width: 768px) {
    .yp-header-layout {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 2rem;
    }

    .yp-action-left {
        order: 1;
        text-align: left;
    }

    .yp-info {
        order: 2;
    }

    .yp-action-right {
        order: 3;
        text-align: right;
    }
}

.yp-profile-card {
    margin-top: 72px;
    padding: 24px;
    position: relative;
    overflow: visible !important;
}

.yp-avatar-wrapper {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.yp-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    -o-object-fit: cover;
    object-fit: cover;
    border: 4px solid var(--pf-surface);
    box-shadow: var(--pf-shadow-card);
}

.yp-info-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.yp-info-badge {
    padding: 6px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
}

.yp-desc-body {
    line-height: 1.7;
    font-size: 15px;
}

.yp-desc-body-sm {
    line-height: 1.6;
}

.yp-border-bottom-none {
    border-bottom: none;
}

.yp-bg-transparent {
    background: transparent;
}

.yp-icon-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yp-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pf-danger);
    box-shadow: 0 0 0 2px var(--pf-surface);
    flex-shrink: 0;
}

textarea.pf-input {
    resize: vertical;
}

/* Pakafront checkbox is 20px tall; default pf-mt-1 (8px) over-shifts it in flex labels. */
label.pf-d-flex > .pf-checkbox.pf-mt-1 {
    margin-top: 2px !important;
}

.yp-loading {
    opacity: 0.5;
    pointer-events: none;
}

.yp-section-title-strong {
    font-weight: 800;
    color: var(--pf-ink-1);
}

.yp-message-list {
    max-height: 500px;
    overflow-y: auto;
}

.yp-message-inner {
    max-width: 85%;
}

.yp-message-bubble {
    border-radius: 16px;
}

.yp-message-bubble-mine {
    border-radius: 16px 16px 0 16px;
}

.yp-message-bubble-other {
    border-radius: 16px 16px 16px 0;
}

.yp-resize-none {
    resize: none !important;
}

.yp-reason-quote {
    border-left: 3px solid currentColor;
    opacity: 0.85;
}

.yp-terms-text {
    line-height: 1.4;
}

.yp-text-15 {
    font-size: 15px;
}

.yp-two-factor-secret {
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.yp-qr-code {
    width: 120px;
    height: 120px;
}

.yp-shipping-cta {
    --yp-cta-main: var(--pf-primary);
    --yp-cta-accent: #ff8a65;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, var(--yp-cta-main), var(--yp-cta-accent));
    box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--yp-cta-main) 70%, transparent);
}

.yp-shipping-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.16) 0%, transparent 55%),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.10) 0%, transparent 45%);
}

.yp-shipping-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.yp-shipping-cta-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    flex-shrink: 0;
}

.yp-shipping-cta-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    line-height: 1.35;
}

.yp-shipping-cta-btn {
    position: relative;
    z-index: 1;
    align-self: center;
    border: none;
    background: white;
    color: var(--yp-cta-main);
    font-weight: 700;
}

.yp-shipping-cta-btn:hover {
    background: white;
    color: var(--yp-cta-main);
}

.yp-shipping-cta-track {
    --yp-cta-main: var(--pf-warning);
    --yp-cta-accent: #fbbf24;
}

.your-data-role-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.your-data-role-group {
    min-width: 0;
}

.your-data-role-group.is-hidden,
.your-data-role-divider.is-hidden {
    display: none;
}

.your-data-role-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pf-text-muted, #637083);
}

.your-data-role-divider-line {
    flex: 1;
    height: 1px;
    background: var(--pf-border-color, #d7dce3);
}

.your-data-role-divider-arrow {
    font-size: 20px;
}

.your-data-role-divider-arrow-desktop {
    display: none;
}

.your-data-additional-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    margin: 0 auto 10px;
    border: 1px solid color-mix(in srgb, var(--pf-primary) 28%, #d7dce3);
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--pf-primary) 6%, #fff), #fff);
}

.your-data-additional-hint.is-hidden {
    display: none;
}

.your-data-additional-hint-content {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.your-data-additional-hint-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.your-data-additional-hint-content .material-symbols-outlined {
    font-size: 18px;
    color: var(--pf-primary);
}

.your-data-additional-hint-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pf-text-color, #242b36);
}

.your-data-additional-hint-subtitle {
    font-size: 0.72rem;
    color: var(--pf-text-muted, #637083);
}

.your-data-additional-help-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--pf-border-color, #d7dce3);
    border-radius: 999px;
    background: #fff;
    color: var(--pf-text-muted, #637083);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.your-data-additional-help-btn:hover {
    border-color: var(--pf-primary);
    color: var(--pf-primary);
    background: color-mix(in srgb, var(--pf-primary) 8%, #fff);
}

.your-data-additional-help-btn .material-symbols-outlined {
    font-size: 17px;
}

.your-data-additional-hint.is-just-revealed {
    animation: your-data-additional-hint-reveal 1.2s ease;
}

@keyframes your-data-additional-hint-reveal {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--pf-primary) 0%, transparent);
    }
    35% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--pf-primary) 16%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--pf-primary) 0%, transparent);
    }
}

.your-data-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .your-data-role-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (min-width: 1100px) {
    .your-data-role-layout.has-additional-roles {
        flex-direction: row;
        align-items: stretch;
    }

    .your-data-role-group-main {
        flex: 1 1 auto;
    }

    .your-data-role-group-additional {
        flex: 0 1 360px;
        max-width: 360px;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .your-data-additional-hint {
        position: absolute;
        top: -46px;
        left: 50%;
        transform: translateX(-50%);
        width: min(330px, calc(100% - 12px));
        margin: 0;
        z-index: 2;
    }

    .your-data-role-divider {
        flex-direction: column;
        justify-content: center;
        width: 36px;
        gap: 8px;
    }

    .your-data-role-divider-line {
        width: 1px;
        height: auto;
        min-height: 24px;
        align-self: center;
    }

    .your-data-role-divider-arrow-mobile {
        display: none;
    }

    .your-data-role-divider-arrow-desktop {
        display: inline-flex;
    }

    .your-data-role-grid-additional {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        gap: 12px;
        padding-top: 14px;
    }

    .your-data-role-grid-additional .your-data-role-card {
        width: min(170px, 100%);
    }
}

.your-data-role-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    border: 1px solid var(--pf-border-color, #d7dce3);
    border-radius: 12px;
    background: var(--pf-white, #fff);
    color: inherit;
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.your-data-role-card:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--pf-primary);
    box-shadow: 0 10px 20px -18px rgba(24, 96, 182, 0.9);
}

.your-data-role-card.is-selected {
    border-color: var(--pf-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pf-primary) 35%, transparent);
    background: color-mix(in srgb, var(--pf-primary) 7%, #fff);
}

.your-data-role-card.is-selected,
.your-data-role-card.is-selected:disabled {
    opacity: 1;
    filter: none;
}

.your-data-role-card.is-disabled,
.your-data-role-card:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.your-data-role-card-media {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid var(--pf-border-color, #d7dce3);
    background: linear-gradient(145deg, #f8fafc, #eef2f7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.your-data-role-card-media img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.your-data-role-card-media .material-symbols-outlined {
    font-size: 34px;
    color: var(--pf-text-muted, #637083);
}

.your-data-role-card-name {
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.your-data-role-card-state {
    min-height: 1em;
    font-size: 0.75rem;
    color: var(--pf-danger);
    text-align: center;
}

.your-data-role-card.is-hidden {
    display: none;
}

html.darkmode #yourDataForm .your-data-role-card {
    background: linear-gradient(180deg, color-mix(in srgb, var(--pf-surface) 96%, #111827), color-mix(in srgb, var(--pf-surface) 90%, #0b1220));
    border-color: color-mix(in srgb, var(--pf-border-color) 84%, #334155);
    box-shadow: 0 12px 24px -22px rgba(0, 0, 0, 0.65);
}

html.darkmode #yourDataForm .your-data-role-card:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--pf-primary) 42%, #64748b);
    box-shadow: 0 16px 28px -24px rgba(0, 0, 0, 0.72);
}

html.darkmode #yourDataForm .your-data-role-card.is-selected {
    background: linear-gradient(180deg, color-mix(in srgb, var(--pf-primary) 8%, #182231), color-mix(in srgb, var(--pf-primary) 5%, #101826));
    border-color: color-mix(in srgb, var(--pf-primary) 46%, #64748b);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pf-primary) 20%, transparent), 0 16px 30px -26px rgba(0, 0, 0, 0.78);
}

html.darkmode #yourDataForm .your-data-role-card-media {
    border-color: color-mix(in srgb, var(--pf-border-color) 82%, #475569);
    background: linear-gradient(145deg, #111827, #18212f);
}

html.darkmode #yourDataForm .your-data-role-card-media .material-symbols-outlined {
    color: #93c5fd;
}

html.darkmode #yourDataForm .your-data-additional-hint {
    border-color: color-mix(in srgb, var(--pf-border-color) 74%, #475569);
    background: linear-gradient(145deg, color-mix(in srgb, var(--pf-surface) 94%, #172033), color-mix(in srgb, var(--pf-surface) 88%, #0f172a));
    box-shadow: 0 12px 24px -22px rgba(0, 0, 0, 0.68);
}

html.darkmode #yourDataForm .your-data-additional-hint-content .material-symbols-outlined,
html.darkmode #yourDataForm .your-data-additional-help-btn:hover .material-symbols-outlined {
    color: #86b8ff;
}

html.darkmode #yourDataForm .your-data-additional-hint-title {
    color: #f1f5f9;
}

html.darkmode #yourDataForm .your-data-additional-hint-subtitle {
    color: #8e9bad;
}

html.darkmode #yourDataForm .your-data-additional-help-btn {
    border-color: color-mix(in srgb, var(--pf-border-color) 82%, #475569);
    background: #111827;
    color: #8e9bad;
}

html.darkmode #yourDataForm .your-data-additional-help-btn:hover {
    background: color-mix(in srgb, var(--pf-primary) 10%, #111827);
    border-color: color-mix(in srgb, var(--pf-primary) 38%, #64748b);
    color: #86b8ff;
}

.shipping-exclusions-card {
    overflow: visible;
}

.shipping-exclusions-card:focus-within {
    z-index: 100;
}

.shipping-exclusions-token-field {
    position: relative;
}

.shipping-exclusions-token-field.is-locked .shipping-exclusions-pills {
    margin-bottom: 0;
}

.shipping-exclusions-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.shipping-exclusions-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 32px;
    padding: 4px 6px 4px 10px;
    border: 1px solid color-mix(in srgb, var(--pf-primary) 35%, var(--pf-border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--pf-primary) 9%, var(--pf-surface));
    color: var(--pf-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.shipping-exclusions-pill-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.shipping-exclusions-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--pf-text-muted);
    cursor: pointer;
}

.shipping-exclusions-pill-remove:hover,
.shipping-exclusions-pill-remove:focus-visible {
    background: color-mix(in srgb, var(--pf-danger) 14%, transparent);
    color: var(--pf-danger);
}

.shipping-exclusions-pill-remove .material-symbols-outlined {
    font-size: 18px;
}

.shipping-exclusions-suggestions {
    position: absolute;
    z-index: 101;
    right: 0;
    left: 0;
    top: calc(100% + 4px);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--pf-border-color);
    border-radius: 8px;
    background: var(--pf-surface);
    box-shadow: 0 14px 34px -24px rgba(15, 23, 42, 0.45);
}

.shipping-exclusions-suggestion {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--pf-text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.shipping-exclusions-suggestions-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--pf-text-muted);
    font-size: 0.875rem;
}

.shipping-exclusions-suggestion:hover,
.shipping-exclusions-suggestion:focus-visible,
.shipping-exclusions-suggestion.is-active {
    background: color-mix(in srgb, var(--pf-primary) 10%, transparent);
}

html.darkmode .shipping-exclusions-pill {
    border-color: color-mix(in srgb, var(--pf-primary) 40%, #475569);
    background: color-mix(in srgb, var(--pf-primary) 12%, #111827);
}

html.darkmode .shipping-exclusions-suggestions {
    border-color: color-mix(in srgb, var(--pf-border-color) 82%, #475569);
    background: #111827;
    box-shadow: 0 16px 34px -24px rgba(0, 0, 0, 0.72);
}
