body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25) !important;
}

/* Dynamic color support - will be overridden by inline styles */
.btn-primary {
    background-color: var(--theme-primary, #1218d6) !important;
    border-color: var(--theme-primary, #1218d6) !important;
}

.btn-outline-primary {
    color: var(--theme-primary, #1218d6) !important;
    border-color: var(--theme-primary, #1218d6) !important;
}

.btn-outline-primary:hover {
    background-color: var(--theme-primary, #1218d6) !important;
    border-color: var(--theme-primary, #1218d6) !important;
    color: #fff !important;
}

.coin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff8e1;
    border: 1px solid #f1d9a9;
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a6d3b;
    white-space: nowrap;
}

.coin-badge i {
    color: #f1b300;
}

.coin-badge .coin-label {
    font-weight: 500;
    font-size: 0.7rem;
}

.coin-badge-compact {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
}

.btn-outline-primary:focus {
    color: #fff !important;
}

.text-primary {
    color: var(--theme-primary, #1218d6) !important;
}

.bg-primary {
    background-color: var(--theme-primary, #1218d6) !important;
}

.bg-gradient-primary {
    background: linear-gradient(to right, var(--theme-gradient-start, #1218d6), var(--theme-gradient-end, #6610f2)) !important;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

.hover-bg-light:hover {
    background-color: #f8f9fa !important;
    border-color: #1218d6 !important;
}

.cursor-pointer {
    cursor: pointer;
}

.bg-gradient-primary {
    background: linear-gradient(to right, #1218d6, #6610f2);
}

/* Comparison Slider */
#comparisonContainer {
    user-select: none;
}

.img-comp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    border-right: 2px solid white;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    right: -16px; /* Half width of handle */
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: ew-resize;
    z-index: 10;
}

.card-img-top-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background-color: #f8f9fa;
    cursor: pointer; /* Make it look clickable */
    transition: all 0.3s ease;
}

.card-img-top-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.7s ease, opacity 0.7s ease;
}

.card-img-top-wrapper.processing img {
    filter: grayscale(1) brightness(1.12) contrast(0.85) saturate(0.35);
    opacity: 0.82;
}

.card-img-top-wrapper.reveal img {
    animation: revealColor 0.9s ease-out forwards;
}

@keyframes revealColor {
    0% {
        filter: grayscale(1) brightness(1.12) contrast(0.85) saturate(0.35);
        opacity: 0.85;
    }
    100% {
        filter: none;
        opacity: 1;
    }
}

.card:hover .card-img-top-wrapper img {
    transform: scale(1.05);
}

.overlay-status {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    z-index: 2;
}

.overlay-status.overlay-processing {
    background: rgba(0,0,0,0.28);
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem;
}

.google-signin-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.google-signin-widget--nav {
    min-width: 200px;
}

.google-signin-widget > div,
.google-signin-widget iframe {
    max-width: 100%;
}

/* Online gallery unlock and sharing controls */
.gallery-share-control {
    min-height: 48px;
    max-width: 230px;
    padding: 7px 12px;
    border: 1px solid #d9dde7;
    border-radius: 12px;
    background: #fff;
    color: #343a40;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    position: relative;
    overflow: hidden;
    text-align: left;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.gallery-share-control:hover {
    border-color: #b7bfce;
    background: #f8f9fb;
    transform: translateY(-1px);
}

.gallery-share-control:focus-visible,
.gallery-dashboard-action:focus-visible,
.gallery-view-control:focus-visible {
    outline: 3px solid rgba(3, 9, 199, .2);
    outline-offset: 2px;
}

.gallery-share-control__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef0f5;
    color: #687080;
}

.gallery-share-control__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.gallery-share-control__copy strong {
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.gallery-share-control__copy small {
    margin-top: 3px;
    color: #737b89;
    font-size: .68rem;
    white-space: nowrap;
}

.gallery-share-control.is-locked {
    border-color: #eed795;
    background: #fffaf0;
    color: #5d4810;
}

.gallery-share-control.is-locked .gallery-share-control__icon {
    background: #fff0bd;
    color: #8c6800;
}

.gallery-share-control.is-ready {
    border-color: #0309c7;
    background: #0309c7;
    color: #fff;
    box-shadow: 0 5px 14px rgba(3, 9, 199, .18);
}

.gallery-share-control.is-ready:hover {
    border-color: #0207a4;
    background: #0207a4;
}

.gallery-share-control.is-ready .gallery-share-control__icon {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.gallery-share-control.is-ready .gallery-share-control__copy small {
    color: rgba(255, 255, 255, .72);
}

.gallery-share-control__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(140, 104, 0, .12);
}

.gallery-share-control__progress span {
    display: block;
    height: 100%;
    border-radius: 0 3px 3px 0;
    background: #d49f00;
    transition: width .3s ease;
}

.project-card .card-body.has-gallery-share > .d-flex:first-child,
.project-card .card-body.has-gallery-share > small {
    margin-right: 9.75rem;
}

.gallery-dashboard-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    height: 42px;
    padding: 3px;
    border: 1px solid #dfe2eb;
    border-radius: 12px;
    background: #f7f8fb;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 3px 10px rgba(17, 24, 39, .06);
}

.gallery-dashboard-action {
    height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .73rem;
    font-weight: 650;
    line-height: 1;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.gallery-dashboard-view:hover {
    background: #fff;
    color: #0309c7;
    box-shadow: 0 1px 5px rgba(17, 24, 39, .08);
}

.gallery-dashboard-share {
    background: #0309c7;
    color: #fff;
}

.gallery-dashboard-share:hover {
    background: #0207a4;
    color: #fff;
}

.gallery-dashboard-action.is-sharing,
.gallery-dashboard-action.is-loading {
    min-width: 76px;
    font-size: .68rem;
}

.workspace-publish-actions {
    flex: 0 0 auto;
}

.workspace-publish-actions #enhanceAllBtn {
    min-height: 44px;
    white-space: nowrap;
}

.gallery-publish-actions {
    display: inline-flex;
    align-items: stretch;
}

.gallery-view-control {
    min-height: 44px;
    padding: 0 13px;
    border: 0;
    background: #fff;
    color: #0309c7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 650;
    white-space: nowrap;
}

.gallery-publish-actions.is-ready {
    border: 1px solid #cfd3e1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 12px rgba(17, 24, 39, .07);
}

.gallery-publish-actions.is-ready .gallery-view-control:hover {
    background: #f3f4ff;
}

.gallery-publish-actions.is-ready .gallery-share-control {
    min-height: 44px;
    max-width: none;
    padding: 0 14px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, .22);
    border-radius: 0;
    gap: 7px;
    box-shadow: none;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.gallery-publish-actions.is-ready .gallery-share-control:hover {
    transform: none;
}

.gallery-publish-actions.is-ready .gallery-share-control.is-sharing,
.gallery-view-control.is-loading {
    min-width: 104px;
    font-size: .72rem;
}

.gallery-action-pulse {
    animation: gallery-action-pulse .7s ease-in-out 2;
}

@keyframes gallery-action-pulse {
    50% { box-shadow: 0 0 0 6px rgba(3, 9, 199, .16); }
}

@media (max-width: 575.98px) {
    .workspace-toolbar {
        flex-wrap: wrap;
        align-items: stretch !important;
    }

    .workspace-publish-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .gallery-share-control {
        max-width: 100%;
    }

    .gallery-share-control__copy small {
        white-space: normal;
    }
}

/* Keep every Bootstrap modal inside the visible mobile viewport when the keyboard opens. */
.modal.keyboard-aware {
    height: var(--modal-visible-height, 100dvh);
    bottom: auto;
}

.modal.keyboard-aware .modal-dialog.modal-fullscreen {
    height: var(--modal-visible-height, 100dvh);
    max-height: var(--modal-visible-height, 100dvh);
}

.modal.keyboard-aware .modal-content {
    max-height: var(--modal-visible-height, 100dvh);
}

.airbnb-import-progress .spinner-border {
    width: 2rem;
    height: 2rem;
}

@media (max-width: 767.98px) {
    .modal.keyboard-aware .modal-dialog:not(.modal-fullscreen) {
        height: calc(var(--modal-visible-height, 100dvh) - 1rem);
        max-height: calc(var(--modal-visible-height, 100dvh) - 1rem);
        margin: .5rem auto;
    }

    .modal.keyboard-aware .modal-dialog:not(.modal-fullscreen) .modal-content {
        max-height: calc(var(--modal-visible-height, 100dvh) - 1rem);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-share-control,
    .gallery-share-control__progress span {
        transition: none;
    }

    .gallery-action-pulse {
        animation: none;
    }
}

.overlay-status.overlay-processing.high-demand {
    background: rgba(82, 52, 5, 0.5);
}

.overlay-processing.high-demand .progress-ring__fg {
    stroke: #fbbf24;
}

.job-queue-message {
    max-width: 260px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}

.overlay-status.overlay-uploading {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    flex-direction: column;
    gap: 0.75rem;
}

/* Circular Upload Progress */
.upload-progress-container {
    position: relative;
    width: 72px;
    height: 72px;
}

.upload-progress-ring {
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}

.upload-progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 6;
}

.upload-progress-bar {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.2s ease;
}

.upload-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-progress-value {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.upload-progress-message {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    opacity: 0.9;
}

.card-uploading {
    pointer-events: none;
}

.card-uploading .card-img-top-wrapper {
    cursor: default;
}

.card-img-top-wrapper.uploading img {
    filter: grayscale(100%) brightness(0.9);
    transition: filter 0.3s ease;
}

.overlay-status.overlay-finish {
    background: rgba(0,0,0,0.2);
    animation: overlayFadeOut 0.4s ease 0.8s forwards;
}

@keyframes overlayFadeOut {
    to {
        opacity: 0;
    }
}

.progress-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
}

.progress-ring {
    width: 96px;
    height: 96px;
    transform: rotate(-90deg);
}

.progress-ring__bg {
    stroke: rgba(255,255,255,0.2);
    stroke-width: 6;
    fill: none;
}

.progress-ring__fg {
    stroke: #7dd3fc;
    stroke-width: 6;
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    animation: ringFill var(--progress-duration, 45s) linear forwards;
}

.progress-wrapper.queued .progress-ring__fg {
    stroke-dasharray: 62.8 188.4;
    animation: ringQueue 1.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes ringQueue {
    from { stroke-dashoffset: 251.2; }
    to { stroke-dashoffset: 0; }
}

.overlay-finish .progress-ring__fg {
    stroke: #0ca100;
    animation: ringFillFast var(--progress-duration, 0.6s) ease-out forwards;
}

.progress-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    gap: 2px;
}

.progress-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.progress-sub {
    font-size: 0.65rem;
    opacity: 0.75;
}

.progress-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0ca100;
    font-size: 1.6rem;
    opacity: 0;
    transform: scale(0.7);
    animation: checkPop 0.35s ease-out 0.6s forwards;
}

@keyframes ringFill {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes ringFillFast {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes checkPop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* New Hover Overlay */
.overlay-hover {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}.card-img-top-wrapper:hover .overlay-hover {
    opacity: 1;
}

.card-info-text {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Version details popover */
.version-pill {
    position: relative;
}

.version-info-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.6rem 1.2rem rgba(0, 0, 0, 0.12);
    padding: 10px 12px;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1060;
    color: #212529;
    text-align: left;
    white-space: normal;
}

.version-pill:hover .version-info-popover {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 150ms;
}

.version-info-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 6px;
}

.version-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
    gap: 4px 8px;
    font-size: 0.75rem;
    line-height: 1.3;
}

.version-info-label {
    font-weight: 600;
    color: #495057;
    display: inline-flex;
    align-items: center;
}

.version-info-value {
    color: #212529;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.version-info-label i {
    margin-right: 6px;
    font-size: 0.7rem;
    color: #6c757d;
}

/* Order Badge (Top-Left Corner) */
.card-order-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-order-number {
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-cover-label {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    backdrop-filter: blur(2px);
}


/* Drag and Drop - Native (Grid) */
.col[draggable="true"] {
    cursor: grab;
}

.col[draggable="true"]:active {
    cursor: grabbing;
}

/* SortableJS Reorder Modal Styles */
.reorder-card {
    cursor: grab;
    transition: transform 0.2s;
    user-select: none;
}

.reorder-card:active {
    cursor: grabbing;
}

.reorder-img-wrapper {
    position: relative;
    padding-top: 100%; /* Square Aspect Ratio */
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #eee;
}

.reorder-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Prevent browser image drag */
}

.reorder-seq-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.3);
}

.reorder-cover-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(13, 110, 253, 0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    padding: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* SortableJS Classes */
.sortable-ghost {
    opacity: 0.2;
}

.sortable-drag {
    cursor: grabbing;
    opacity: 1;
    z-index: 1000;
    transform: scale(1.05);
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.25);
}

.sortable-drag .reorder-img-wrapper {
    box-shadow: 0 0 0 2px #1218d6;
}

/* Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#imageGrid {
    transition: all 0.3s ease;
}

/* Presets & Tags */
.hover-danger:hover {
    color: #d61212 !important;
}

.preset-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

/* Fix preset card images on mobile */
@media (max-width: 767.98px) {
    .preset-card {
        max-height: none !important;
    }
    .preset-card .row {
        flex-direction: row;
        height: auto;
    }
    .preset-card .col-md-5,
    .preset-card .col-lg-4 {
        max-width: 120px;
        flex: 0 0 120px;
        max-height: 100px !important;
        min-height: 100px;
    }
    .preset-card .col-md-7,
    .preset-card .col-lg-8 {
        max-width: calc(100% - 120px);
        flex: 1 1 auto;
    }
    .preset-card .card-body {
        padding: 0.75rem !important;
        min-height: 100px;
        display: flex;
        align-items: center;
    }
    .preset-card .w-50 {
        max-height: 100px !important;
        height: 100px !important;
    }
    .preset-card img {
        object-fit: cover;
    }
}

/* Presets Modal Layout */
.presets-modal-body {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    transition: all 0.3s ease;
    position: relative;
}

.presets-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: 12px;
}

.presets-loading-overlay.show {
    display: flex;
}

.presets-column {
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    padding: 1rem;
    min-height: 60vh;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.05);
    transition: all 0.3s ease;
}

.presets-column-header {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.presets-selected {
    flex: 0 0 0;
    max-width: 0;
    opacity: 0;
    transform: translateX(16px);
    overflow: hidden;
    padding: 0;
    border: 0;
    box-shadow: none;
    min-height: 0;
    height: 0;
}

.presets-modal-body.has-selected .presets-selected {
    flex: 0 0 50%;
    max-width: 50%;
    opacity: 1;
    transform: translateX(0);
    padding: 1rem;
    border: 1px solid #e6e8ec;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.05);
    min-height: 60vh;
    height: auto;
}

.presets-available {
    flex: 1 1 auto;
    max-width: 100%;
}

.presets-modal-body.has-selected .presets-available {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 991.98px) {
    .presets-modal-body {
        flex-direction: column;
    }
    /* Reorder: Selected presets appear first (on top) on mobile when they exist */
    .presets-available {
        order: 1;
    }
    .presets-selected,
    .presets-modal-body.has-selected .presets-selected,
    .presets-available,
    .presets-modal-body.has-selected .presets-available {
        flex: 1 1 auto;
        max-width: 100%;
        transform: none;
    }
    .presets-selected {
        opacity: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        min-height: 0;
        height: 0;
        order: 2;
    }
    .presets-modal-body.has-selected .presets-selected {
        opacity: 1;
        padding: 1rem;
        border: 1px solid #e6e8ec;
        box-shadow: 0 .25rem .75rem rgba(0,0,0,.05);
        min-height: auto;
        height: auto;
        order: 1; /* Selected appears first when it has content */
    }
    .presets-modal-body.has-selected .presets-available {
        order: 2; /* Available appears below selected when selected exists */
    }
}

/* Modal sizing tweaks */
@media (min-width: 1200px) {
    .modal-xl {
        --bs-modal-width: 1140px;
    }
}

/* Credits wallet */
.credits-wallet {
    gap: .35rem;
    padding: .3rem;
    border: 1px solid #e7e9f3;
    border-radius: 999px;
    background: #f7f8fc;
}

.credits-wallet__balance {
    min-width: 3.8rem;
    padding: 0 .65rem 0 .75rem;
    color: #34364f;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.credits-wallet__button {
    min-height: 2rem;
    padding: .42rem .78rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--theme-primary, #0309c7);
    box-shadow: 0 2px 8px rgba(19, 23, 87, .09);
    font-size: .78rem;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.credits-wallet__button:hover {
    transform: translateY(-1px);
    background: #fdfdff;
    box-shadow: 0 5px 14px rgba(19, 23, 87, .14);
}

.credits-wallet__button:focus-visible {
    outline: 3px solid rgba(3, 9, 199, .18);
    outline-offset: 2px;
}

/* Buy coins experience */
.buy-coins-modal .modal-dialog {
    max-width: 820px;
}

.buy-coins-shell {
    overflow: hidden;
    border-radius: 28px;
    background: #f8f9fd;
    box-shadow: 0 30px 90px rgba(15, 19, 64, .28);
}

.buy-coins-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 4;
    width: 2.25rem;
    height: 2.25rem;
    padding: .65rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 18px rgba(11, 15, 69, .16);
    opacity: .88;
}

.buy-coins-close:hover {
    opacity: 1;
    transform: scale(1.03);
}

.buy-coins-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 2.65rem 3rem 2.35rem;
    background: linear-gradient(132deg, #11146f 0%, #272dcc 54%, #5a32b5 100%);
    color: #fff;
}

.buy-coins-hero__glow {
    position: absolute;
    z-index: -1;
    width: 26rem;
    height: 26rem;
    top: -18rem;
    right: -5rem;
    border-radius: 50%;
    background: rgba(142, 224, 255, .34);
    filter: blur(10px);
}

.buy-coins-hero__icon {
    display: grid;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    margin-bottom: 1.35rem;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 15px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
    font-size: 1.2rem;
}

.buy-coins-eyebrow,
.buy-coins-section-kicker {
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.buy-coins-eyebrow {
    margin-bottom: .55rem;
    color: #c7d2ff;
}

.buy-coins-title {
    max-width: 650px;
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 750;
    line-height: 1.12;
    letter-spacing: -.045em;
}

.buy-coins-message {
    max-width: 620px;
    margin: .8rem 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: .98rem;
    line-height: 1.6;
}

.buy-coins-context {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.35rem;
    padding: .58rem .8rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(9, 12, 72, .28);
    color: rgba(255, 255, 255, .83);
    font-size: .76rem;
    font-weight: 650;
    backdrop-filter: blur(8px);
}

.buy-coins-context__balance {
    color: #fff;
}

.buy-coins-context__divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8ee0ff;
}

.buy-coins-body {
    padding: 2rem 2.25rem 1.65rem;
}

.buy-coins-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.buy-coins-section-kicker {
    margin-bottom: .35rem;
    color: #686c83;
}

.buy-coins-section-heading h3 {
    margin: 0;
    color: #181a2b;
    font-size: 1.03rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.buy-coins-rate {
    flex: 0 0 auto;
    padding: .42rem .65rem;
    border: 1px solid #e4e6f0;
    border-radius: 999px;
    background: #fff;
    color: #565a70;
    font-size: .72rem;
    font-weight: 700;
}

.buy-coins-packs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.buy-coins-pack {
    position: relative;
    min-height: 168px;
    padding: 1.2rem;
    overflow: hidden;
    border: 1px solid #e3e5ef;
    border-radius: 18px;
    background: #fff;
    color: #17192b;
    text-align: left;
    box-shadow: 0 3px 12px rgba(20, 24, 72, .045);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.buy-coins-pack:hover {
    transform: translateY(-2px);
    border-color: #a9adea;
    box-shadow: 0 12px 28px rgba(28, 32, 105, .12);
}

.buy-coins-pack:focus-visible {
    outline: 3px solid rgba(3, 9, 199, .18);
    outline-offset: 2px;
}

.buy-coins-pack--popular {
    border-color: #858be5;
    background: linear-gradient(145deg, #fff 0%, #f4f4ff 100%);
}

.buy-coins-pack__badge {
    position: absolute;
    top: .9rem;
    right: .9rem;
    padding: .3rem .5rem;
    border-radius: 999px;
    background: #171b8f;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.buy-coins-pack__topline {
    display: flex;
    align-items: baseline;
    gap: .32rem;
    padding-right: 4.2rem;
}

.buy-coins-pack__coin-icon {
    align-self: center;
    margin-right: .2rem;
    color: #e4a900;
    font-size: 1rem;
}

.buy-coins-pack__coins {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.04em;
}

.buy-coins-pack__label {
    color: #777b8f;
    font-size: .75rem;
    font-weight: 650;
}

.buy-coins-pack__photos {
    display: block;
    margin-top: .3rem;
    color: #6b6f82;
    font-size: .74rem;
}

.buy-coins-pack__footer {
    position: absolute;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 1.1rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.buy-coins-pack__footer strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1;
}

.buy-coins-pack__footer small {
    color: #8a8da0;
    font-size: .64rem;
}

.buy-coins-pack__arrow {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #eef0ff;
    color: #252abc;
    transition: transform .18s ease, background-color .18s ease;
}

.buy-coins-pack:hover .buy-coins-pack__arrow {
    transform: translateX(2px);
    background: #252abc;
    color: #fff;
}

.buy-coins-pack.is-loading {
    cursor: wait;
    opacity: .72;
}

.buy-coins-pack.is-loading .buy-coins-pack__arrow i {
    animation: buy-coins-spin .8s linear infinite;
}

@keyframes buy-coins-spin {
    to { transform: rotate(360deg); }
}

.buy-coins-assurance {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .65rem 1.15rem;
    margin-top: 1.25rem;
    color: #73778a;
    font-size: .68rem;
    font-weight: 600;
}

.buy-coins-assurance i {
    margin-right: .3rem;
    color: #4b4fb7;
}

.buy-coins-test-mode {
    color: #9a6500;
}

.buy-coins-test-mode i {
    color: #c58200;
}

.buy-coins-empty {
    grid-column: 1 / -1;
    padding: 1.5rem;
    border: 1px dashed #d9dbe7;
    border-radius: 16px;
    color: #73778a;
    text-align: center;
}

@media (max-width: 767.98px) {
    .credits-wallet__button span {
        display: none;
    }

    .credits-wallet__button {
        width: 2rem;
        padding: 0;
    }

    .buy-coins-modal .modal-dialog {
        margin: .55rem;
    }

    .buy-coins-shell {
        max-height: calc(100dvh - 1.1rem);
        overflow-y: auto;
        border-radius: 22px;
    }

    .buy-coins-hero {
        padding: 2.15rem 1.35rem 1.6rem;
    }

    .buy-coins-hero__icon {
        width: 2.7rem;
        height: 2.7rem;
        margin-bottom: 1rem;
    }

    .buy-coins-body {
        padding: 1.35rem 1rem 1.25rem;
    }

    .buy-coins-section-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: .9rem;
    }

    .buy-coins-packs {
        grid-template-columns: 1fr;
    }

    .buy-coins-pack {
        min-height: 148px;
    }

    .buy-coins-context {
        align-items: flex-start;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .credits-wallet__button,
    .buy-coins-pack,
    .buy-coins-pack__arrow {
        transition: none;
    }
}

/* Sliding Status Bar */
.status-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1.25rem;
}

.status-bar--visible {
    transform: translateY(0);
    opacity: 1;
}

.status-bar__content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-bar__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111;
}

.status-bar__message {
    font-size: 0.85rem;
    color: #4b5563;
}

.status-bar__progress {
    position: relative;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.status-bar__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--theme-primary, #1218d6);
    transition: width 0.2s ease;
}

.status-bar__progress--indeterminate .status-bar__progress-bar {
    width: 50%;
    animation: status-bar-indeterminate 1.2s ease-in-out infinite;
}

.status-bar--success .status-bar__progress-bar {
    background: #0ca100;
}

.status-bar--warning .status-bar__progress-bar {
    background: #d97706;
}

.status-bar--error .status-bar__progress-bar {
    background: #dc2626;
}

@keyframes status-bar-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(20%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* New listing source selection, aligned with the landing onboarding modal */
.source-selection-dialog {
    width: min(720px, calc(100% - 32px));
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
}

.source-selection-content {
    position: relative;
    padding: clamp(28px, 5vw, 48px);
    border: 0;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.source-selection-close {
    position: absolute;
    z-index: 2;
    top: 22px;
    right: 22px;
    opacity: 0.62;
}

.source-selection-close:hover,
.source-selection-close:focus {
    opacity: 1;
}

.source-selection-heading {
    padding-right: 44px;
}

.source-selection-logo {
    display: block;
    width: min(210px, 55%);
    height: auto;
    margin: 0 auto 26px;
}

.source-selection-heading > p {
    margin: 0 0 8px;
    color: var(--theme-primary, #0309c7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.source-selection-heading h2 {
    margin: 0;
    color: #17181c;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 650;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.source-selection-heading > span {
    display: block;
    margin-top: 12px;
    color: #6c7078;
    font-size: 14px;
    line-height: 1.55;
}

.source-selection-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 30px;
}

.source-selection-option {
    position: relative;
    display: grid;
    min-height: 152px;
    padding: 38px 18px 18px;
    grid-template-columns: 48px 1fr 18px;
    gap: 11px;
    align-items: center;
    color: #17181c;
    background: #fff;
    border: 1px solid #dfe1e6;
    border-radius: 13px;
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.source-selection-option:hover {
    transform: translateY(-2px);
    background: #f8f8ff;
    border-color: var(--theme-primary, #0309c7);
    box-shadow: 0 8px 24px rgba(3, 9, 199, 0.1);
}

.source-selection-option:focus-visible {
    outline: 3px solid rgba(3, 9, 199, 0.2);
    outline-offset: 2px;
}

.source-selection-icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border-radius: 12px;
}

.source-selection-option-upload .source-selection-icon {
    color: #1724d9;
    background: #e8eaff;
}

.source-selection-option-airbnb .source-selection-icon {
    color: #ff385c;
    background: #fff0f3;
}

.source-selection-copy strong,
.source-selection-copy small {
    display: block;
}

.source-selection-copy strong {
    font-size: 14px;
}

.source-selection-copy small {
    margin-top: 4px;
    color: #737780;
    font-size: 11px;
    line-height: 1.45;
}

.source-selection-arrow {
    color: var(--theme-primary, #0309c7);
    font-size: 12px;
    transition: transform 160ms ease;
}

.source-selection-option:hover .source-selection-arrow {
    transform: translateX(3px);
}

.source-selection-badge {
    position: absolute;
    top: 11px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.source-selection-badge-recommended {
    color: #136c3b;
    background: #dcfce7;
}

.source-selection-badge-quality {
    color: #676b73;
    background: #eceef1;
}

.source-selection-privacy {
    margin: 22px 0 0;
    color: #737780;
    font-size: 11px;
    text-align: center;
}

.source-selection-privacy i {
    margin-right: 5px;
    color: var(--theme-primary, #0309c7);
}

@media (max-width: 575.98px) {
    .source-selection-dialog {
        width: calc(100% - 20px);
    }

    .source-selection-content {
        max-height: calc(100dvh - 20px);
        padding: 30px 20px 24px;
        overflow-y: auto;
        border-radius: 16px;
    }

    .source-selection-close {
        top: 16px;
        right: 16px;
    }

    .source-selection-logo {
        width: min(170px, 55%);
        margin-bottom: 20px;
    }

    .source-selection-heading h2 {
        font-size: 34px;
    }

    .source-selection-options {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .source-selection-option {
        min-height: 108px;
    }
}
