/**
 * Fuji Photo Upload v3.0 - Frontend Styles
 *
 * Design system: drewnianysklep.pl
 * Colors: charcoal #3d3d3d, olive #52583C, beige #AA8C74,
 *         light-beige #D6C1AE, ecru #EDE6DE, off-white #FBFBFB
 * Font: inherit (Manrope from theme)
 *
 * @package Fuji_Photo_Upload
 */

/* ╔══════════════════════════════════════════════════════════════╗
   ║  DESIGN TOKENS                                              ║
   ╚══════════════════════════════════════════════════════════════╝ */

:root {
    --fpu-charcoal:    #3d3d3d;
    --fpu-olive:       #52583C;
    --fpu-olive-light: #6b7350;
    --fpu-beige:       #AA8C74;
    --fpu-beige-light: #D6C1AE;
    --fpu-ecru:        #EDE6DE;
    --fpu-off-white:   #FBFBFB;
    --fpu-white:       #ffffff;
    --fpu-danger:      #c0392b;
    --fpu-danger-bg:   #fdf0ef;
    --fpu-success:     #27ae60;
    --fpu-success-bg:  #eafaf1;
    --fpu-warning:     #e67e22;
    --fpu-warning-bg:  #fef9e7;

    --fpu-radius-sm:   6px;
    --fpu-radius:      10px;
    --fpu-radius-lg:   14px;

    --fpu-shadow-sm:   0 1px 3px rgba(0,0,0,.06);
    --fpu-shadow:      0 2px 8px rgba(0,0,0,.07);
    --fpu-shadow-lg:   0 8px 24px rgba(0,0,0,.10);

    --fpu-transition:  .2s ease;
    --fpu-font:        inherit;

    --fpu-text:        #3d3d3d;
    --fpu-text-muted:  #6d6440;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  FOCUS INDICATORS (WCAG 2.1 AA)                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-wrap *:focus-visible {
    outline: 2px solid var(--fpu-olive);
    outline-offset: 2px;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  CONTAINER                                                  ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0 16px;
    font-family: var(--fpu-font);
    color: var(--fpu-charcoal);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Force full width — override theme content width restrictions */
.entry-content .fpu-wrap,
.site-content .fpu-wrap,
.page-content .fpu-wrap,
.post-content .fpu-wrap,
.elementor-widget-container .fpu-wrap,
.wp-block-post-content .fpu-wrap,
article .fpu-wrap {
    max-width: 100% !important;
    width: 100% !important;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  INTRO SCREEN (full-page)                                   ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-intro {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fpu-intro__card {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-lg);
    box-shadow:
        0 4px 24px rgba(0,0,0,.06),
        0 1px 4px rgba(0,0,0,.04);
    max-width: 740px;
    width: 100%;
    padding: 48px 56px;
}

.fpu-intro__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fpu-ecru);
    color: var(--fpu-olive);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.fpu-intro__badge svg {
    flex-shrink: 0;
}

.fpu-intro__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    margin: 0 0 24px;
    line-height: 1.4;
}

.fpu-intro__content {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--fpu-charcoal);
}

.fpu-intro__content ul {
    margin: 0 0 0 4px;
    padding: 0 0 0 20px;
    list-style: none;
}

.fpu-intro__content li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 4px;
}

.fpu-intro__content li::before {
    content: '✓';
    position: absolute;
    left: -22px;
    color: var(--fpu-olive);
    font-weight: 700;
    font-size: 13px;
}

.fpu-intro__content strong {
    color: var(--fpu-charcoal);
    font-weight: 700;
}

.fpu-intro__divider {
    border: none;
    border-top: 1px solid var(--fpu-ecru);
    margin: 24px 0;
}

.fpu-intro__note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--fpu-ecru) 0%, rgba(237,230,222,.5) 100%);
    border-radius: var(--fpu-radius);
    border-left: 3px solid var(--fpu-beige);
    font-size: 13px;
    line-height: 1.65;
    color: var(--fpu-text-muted);
}

.fpu-intro__note-icon {
    flex-shrink: 0;
    color: var(--fpu-beige);
    margin-top: 2px;
}

.fpu-intro__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--fpu-ecru);
}

.fpu-intro__dismiss {
    cursor: pointer;
}

.fpu-intro__dismiss .fpu-checkbox__label {
    font-size: 13px;
    color: var(--fpu-text-muted);
}

.fpu-intro__btn {
    padding: 14px 40px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    letter-spacing: .01em;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fpu-intro__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(82,88,60,.25);
}

.fpu-intro__card {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .fpu-intro {
        padding: 8px;
        align-items: flex-start;
    }
    .fpu-intro__card {
        padding: 20px 16px;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .fpu-intro__badge {
        margin-bottom: 12px;
    }
    .fpu-intro__title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    .fpu-intro__content {
        font-size: 13.5px;
        line-height: 1.6;
    }
    .fpu-intro__content li {
        margin-bottom: 4px;
    }
    .fpu-intro__divider {
        margin: 16px 0;
    }
    .fpu-intro__note {
        padding: 12px 14px;
        font-size: 12px;
        line-height: 1.55;
    }
    .fpu-intro__footer {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
        padding-top: 16px;
    }
    .fpu-intro__btn {
        width: 100%;
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
}

/* ── 3-column layout ──────────────────── */

.fpu-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr 280px;
    gap: 24px;
    align-items: start;
}

.fpu-layout__sidebar {
    position: sticky;
    top: 24px;
}

.fpu-layout__sidebar--left,
.fpu-layout__sidebar--right {
    display: block !important;
}

.fpu-layout__center {
    min-width: 0;
}

.fpu-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fpu-text-muted);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fpu-ecru);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpu-section-title svg {
    flex-shrink: 0;
    color: var(--fpu-beige);
}

.fpu-btn--block {
    width: 100%;
    justify-content: center;
}

.fpu-wrap *,
.fpu-wrap *::before,
.fpu-wrap *::after {
    box-sizing: border-box;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  0b. SESSION BAR                                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--fpu-success-bg);
    border: 1px solid #a3d9b1;
    border-radius: var(--fpu-radius);
    padding: 10px 16px;
    margin-bottom: 16px;
}

.fpu-session-bar__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1a5632;
}

.fpu-session-bar__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.fpu-session-bar__timer {
    font-size: 11px;
    font-weight: 400;
    color: #5a8a6a;
}

.fpu-session-bar--saved {
    animation: fpuBarFlash .6s ease;
}
@keyframes fpuBarFlash {
    0%   { background: #c8f0d4; }
    100% { background: var(--fpu-success-bg); }
}

.fpu-session-bar__actions {
    display: flex;
    gap: 8px;
}

/* ── Saved sessions list ────────────── */

.fpu-sessions-list {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--fpu-shadow);
}

.fpu-sessions-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fpu-sessions-list__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    margin: 0;
}

.fpu-sessions-list__close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--fpu-ecru);
    border-radius: 50%;
    font-size: 18px;
    color: var(--fpu-charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background var(--fpu-transition);
}

.fpu-sessions-list__close:hover {
    background: var(--fpu-beige-light);
}

.fpu-sessions-list__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fpu-session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--fpu-off-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    cursor: pointer;
    transition: all var(--fpu-transition);
}

.fpu-session-item:hover {
    border-color: var(--fpu-olive);
    box-shadow: var(--fpu-shadow-sm);
}

.fpu-session-item__info {
    flex: 1;
    min-width: 0;
}

.fpu-session-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--fpu-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpu-session-item__meta {
    font-size: 11px;
    color: var(--fpu-beige);
    margin-top: 2px;
}

.fpu-session-item__expiry {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    margin-top: 3px;
    line-height: 1.2;
}

.fpu-session-item__expiry--ok {
    color: var(--fpu-olive);
}

.fpu-session-item__expiry--warn {
    color: #d4940a;
    font-weight: 600;
}

.fpu-session-item__expiry--expired {
    color: var(--fpu-danger);
    font-weight: 600;
}

.fpu-session-item__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.fpu-session-item__delete {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--fpu-danger);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.6;
    transition: all var(--fpu-transition);
}

.fpu-session-item__delete:hover {
    opacity: 1;
    background: var(--fpu-danger-bg);
}

.fpu-sessions-list__empty {
    text-align: center;
    padding: 20px;
    color: var(--fpu-beige);
    font-size: 13px;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  1. SESSION CONFIG                                          ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-session-config {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-lg);
    padding: 0;
    box-shadow: var(--fpu-shadow);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.fpu-config__group {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-config__group:last-child {
    border-bottom: none;
}

.fpu-config__options {
    gap: 10px;
}

/* ── Field ─────────────────────────────── */

.fpu-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fpu-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.fpu-field__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fpu-field__required {
    color: var(--fpu-danger);
    text-decoration: none;
    font-weight: 700;
}

.fpu-field__input,
.fpu-field__select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    font-size: 14px;
    font-family: var(--fpu-font);
    color: var(--fpu-charcoal);
    background: var(--fpu-off-white);
    transition: border-color var(--fpu-transition), box-shadow var(--fpu-transition);
    outline: none;
}

.fpu-field__input:focus,
.fpu-field__select:focus {
    border-color: var(--fpu-olive);
    box-shadow: 0 0 0 3px rgba(82,88,60,.12);
}

.fpu-field__input::placeholder {
    color: var(--fpu-beige-light);
}

.fpu-field__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--fpu-charcoal);
}

.fpu-format-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--fpu-ecru);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .03em;
}

/* ── Checkbox ──────────────────────────── */

.fpu-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}

.fpu-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fpu-checkbox__box {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--fpu-beige-light);
    border-radius: 4px;
    background: var(--fpu-white);
    transition: all var(--fpu-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpu-checkbox__input:checked + .fpu-checkbox__box {
    background: var(--fpu-olive);
    border-color: var(--fpu-olive);
}

.fpu-checkbox__input:checked + .fpu-checkbox__box::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--fpu-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.fpu-checkbox__input:focus-visible + .fpu-checkbox__box {
    box-shadow: 0 0 0 2px var(--fpu-white), 0 0 0 4px var(--fpu-olive);
}

.fpu-checkbox__label {
    font-size: 14px;
    color: var(--fpu-charcoal);
}

.fpu-field__info-link {
    font-size: 12px;
    color: var(--fpu-olive);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--fpu-transition);
    white-space: nowrap;
}

.fpu-field__info-link:hover {
    color: var(--fpu-charcoal);
}

/* ── Tooltip (?) button ────────────── */

.fpu-tooltip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--fpu-beige-light);
    background: var(--fpu-off-white);
    color: var(--fpu-beige);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--fpu-font);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    position: relative;
    transition: all var(--fpu-transition);
    flex-shrink: 0;
}

.fpu-tooltip-btn:hover,
.fpu-tooltip-btn--active {
    border-color: var(--fpu-olive);
    color: var(--fpu-olive);
    background: var(--fpu-ecru);
}

.fpu-tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fpu-charcoal);
    color: var(--fpu-white);
    padding: 10px 14px;
    border-radius: var(--fpu-radius-sm);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    width: 220px;
    z-index: 10000;
    box-shadow: var(--fpu-shadow-lg);
    pointer-events: none;
    animation: fpu-fadeIn .15s ease;
}

/* Fixed variant: appended to body, positioned via JS — avoids overflow:hidden clipping */
.fpu-tooltip-bubble--fixed {
    position: fixed;
    bottom: auto;
    left: auto;
    transform: none;
}

/* Arrow: above (default — tooltip opens upward) */
.fpu-tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--fpu-charcoal);
}

/* Fixed variant: arrow centered on bubble */
.fpu-tooltip-bubble--fixed::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Below variant (toolbar / viewport top edge) — tooltip opens downward */
.fpu-tooltip-bubble--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--fpu-charcoal);
}

/* Legacy: inside toolbar (kept for backwards compat) */
.fpu-toolbar .fpu-tooltip-bubble {
    bottom: auto;
    top: calc(100% + 8px);
}
.fpu-toolbar .fpu-tooltip-bubble::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--fpu-charcoal);
}

/* ── Volume Pricing ────────────────────── */

.fpu-volume {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 20px 16px;
}

.fpu-volume__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: var(--fpu-font);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--fpu-beige);
    cursor: pointer;
    padding: 4px 0;
    transition: color var(--fpu-transition);
}

.fpu-volume__toggle:hover {
    color: var(--fpu-olive);
}

.fpu-volume__chevron {
    transition: transform var(--fpu-transition);
}

.fpu-volume__toggle[aria-expanded="true"] .fpu-volume__chevron {
    transform: rotate(180deg);
}

.fpu-volume__table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
    table-layout: fixed;
}

.fpu-volume__th {
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--fpu-beige);
    border-bottom: 2px solid var(--fpu-ecru);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.fpu-volume__th:first-child {
    text-align: left;
}

.fpu-volume__td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-volume__td--tier {
    text-align: left;
    font-weight: 600;
    color: var(--fpu-charcoal);
    white-space: nowrap;
}

.fpu-volume__td--price {
    font-variant-numeric: tabular-nums;
    color: var(--fpu-charcoal);
}

.fpu-volume__row--active {
    background: rgba(82,88,60,.06);
}

.fpu-volume__row--active .fpu-volume__td--price {
    font-weight: 700;
    color: var(--fpu-olive);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  2. UPLOAD SECTION                                          ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-upload-section {
    margin-bottom: 24px;
}

/* ── Dropzone ──────────────────────────── */

.fpu-dropzone {
    border: 2px dashed var(--fpu-beige-light);
    border-radius: var(--fpu-radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--fpu-off-white);
    transition: all var(--fpu-transition);
    position: relative;
    outline: none;
}

.fpu-dropzone:hover,
.fpu-dropzone:focus-visible {
    border-color: var(--fpu-olive);
    background: rgba(82,88,60,.03);
}

.fpu-dropzone.fpu-dragover {
    border-color: var(--fpu-olive);
    background: rgba(82,88,60,.06);
    transform: scale(1.005);
}

.fpu-dropzone__icon {
    color: var(--fpu-beige-light);
    margin-bottom: 12px;
    transition: color var(--fpu-transition);
}

.fpu-dropzone:hover .fpu-dropzone__icon {
    color: var(--fpu-olive);
}

.fpu-dropzone__text {
    font-size: 16px;
    font-weight: 600;
    color: var(--fpu-charcoal);
    margin: 0 0 6px;
}

.fpu-dropzone__hint {
    font-size: 13px;
    color: var(--fpu-beige);
    margin: 0;
}

/* ── File input (hidden) ───────────────── */

.fpu-file-input {
    display: none !important;
}

/* ── Upload Progress ───────────────────── */

.fpu-upload-progress {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    padding: 16px 20px;
    margin-top: 16px;
    transition: background-color .4s ease, border-color .4s ease;
}

.fpu-upload-progress__bar {
    width: 100%;
    height: 8px;
    background: var(--fpu-ecru);
    border-radius: 4px;
    overflow: hidden;
}

.fpu-upload-progress__fill {
    height: 100%;
    width: 0%;
    background: hsl(30, 70%, 50%);
    border-radius: 4px;
    transition: width .3s ease, background-color .4s ease;
}

.fpu-upload-progress__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
}

.fpu-upload-progress__counter {
    font-size: 13px;
    color: var(--fpu-charcoal);
    font-variant-numeric: tabular-nums;
}

.fpu-upload-progress__pct {
    position: absolute;
    right: 0;
    top: -2px;
    font-size: 11px;
    font-weight: 700;
    color: inherit;
    font-variant-numeric: tabular-nums;
    transition: color .4s ease;
}

.fpu-upload-progress__bar {
    position: relative;
}

.fpu-upload-progress__eta {
    font-size: 12px;
    color: var(--fpu-beige);
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
}

/* ── Game button in progress bar ───────────── */

.fpu-upload-progress__game-btn {
    margin-left: auto;
    padding: 5px 14px;
    font-size: 12px;
    background: var(--fpu-off-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    color: var(--fpu-charcoal);
    font-family: var(--fpu-font);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fpu-transition);
    line-height: 1.3;
}

.fpu-upload-progress__game-btn:hover {
    background: var(--fpu-ecru);
    border-color: var(--fpu-beige);
    color: var(--fpu-olive);
}

/* ── Mini-game popup ──────────────────────── */

.fpu-game-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpu-game-popup__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.fpu-game-popup__dialog {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 840px;
    animation: fpu-game-popup-in .25s ease;
}

@keyframes fpu-game-popup-in {
    from { opacity: 0; transform: scale(.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Game invite popup ────────────────────── */

.fpu-game-invite {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpu-game-invite__backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(3px);
}

.fpu-game-invite__box {
    position: relative;
    z-index: 1;
    background: var(--fpu-off-white);
    border-radius: var(--fpu-radius-lg);
    padding: 28px 32px 24px;
    box-shadow: var(--fpu-shadow-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: fpu-game-popup-in .25s ease;
}

.fpu-game-invite__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--fpu-charcoal);
    margin: 0 0 18px;
}

.fpu-game-invite__btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.fpu-game-invite__play {
    padding: 10px 28px;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border: none;
    border-radius: var(--fpu-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.fpu-game-invite__play:hover {
    background: var(--fpu-olive-light);
    transform: scale(1.05);
}

.fpu-game-invite__skip {
    padding: 10px 20px;
    background: transparent;
    color: var(--fpu-beige);
    border: 1px solid var(--fpu-beige-light);
    border-radius: var(--fpu-radius);
    font-size: 13px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.fpu-game-invite__skip:hover {
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
}

/* ── Mini-game: Photo Rider ───────────────── */

.fpu-game {
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    background: var(--fpu-white);
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
}

.fpu-game__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--fpu-ecru);
}

.fpu-game__title {
    font-weight: 700;
    font-size: 13px;
    color: var(--fpu-charcoal);
}

.fpu-game__close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--fpu-charcoal);
    cursor: pointer;
    padding: 0 4px;
    opacity: .6;
    transition: opacity .2s;
    margin-left: auto;
}

.fpu-game__close:hover {
    opacity: 1;
}

.fpu-game__canvas {
    display: block;
    width: 100%;
    cursor: pointer;
}

/* Game over overlay */
.fpu-game__gameover {
    position: absolute;
    top: 36px; /* below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245,239,233,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.fpu-game__go-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.fpu-game__go-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--fpu-charcoal);
}

.fpu-game__go-score {
    font-size: 15px;
    color: var(--fpu-charcoal);
}

.fpu-game__replay-btn {
    padding: 10px 28px;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border: none;
    border-radius: var(--fpu-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    margin-top: 6px;
}

.fpu-game__replay-btn:hover {
    background: var(--fpu-olive-light);
    transform: scale(1.05);
}

.fpu-game__nick {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.fpu-game__nick-input {
    width: 130px;
    padding: 5px 10px;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}

.fpu-game__nick-input:focus {
    border-color: var(--fpu-olive);
}

.fpu-game__nick-btn {
    padding: 5px 14px;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border: none;
    border-radius: var(--fpu-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.fpu-game__nick-btn:hover {
    background: var(--fpu-olive-dark, #3d4a2a);
}

.fpu-game__nick-btn:disabled {
    opacity: .5;
    cursor: default;
}

.fpu-game__nick-msg {
    font-size: 11px;
    min-height: 16px;
}

/* Ranking table */
.fpu-game__ranking {
    padding: 0 14px 10px;
}

.fpu-game__rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 6px;
}

.fpu-game__rank-table th {
    text-align: left;
    font-weight: 700;
    color: var(--fpu-beige);
    border-bottom: 1px solid var(--fpu-ecru);
    padding: 4px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.fpu-game__rank-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(0,0,0,.04);
    color: var(--fpu-charcoal);
}

.fpu-game__rank-table tr:last-child td {
    border-bottom: none;
}

.fpu-game__rank-top td {
    font-weight: 600;
}

.fpu-game__rank-table td:last-child,
.fpu-game__rank-table th:last-child {
    text-align: right;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  3. TOOLBAR                                                 ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-toolbar {
    display: flex;
    flex-direction: column;
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    margin-bottom: 20px;
}

.fpu-toolbar[hidden] {
    display: none;
}

/* ── Toolbar rows ──────────── */

.fpu-toolbar__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    flex-wrap: wrap;
}

.fpu-toolbar__row--top {
    background: var(--fpu-off-white);
    border-bottom: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius) var(--fpu-radius) 0 0;
}

.fpu-toolbar__hint {
    margin: 0;
    padding: 6px 18px;
    font-size: 11.5px;
    color: var(--fpu-text-muted);
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-toolbar__row--actions {
    padding: 8px 18px;
    gap: 6px;
}

/* ── Separator ─────────────── */

.fpu-toolbar__sep {
    width: 1px;
    height: 20px;
    background: var(--fpu-beige-light);
    flex-shrink: 0;
}

.fpu-toolbar__spacer {
    flex: 1;
}

/* ── Select all ────────────── */

.fpu-toolbar__select-all {
    /* no margin-right, row handles spacing */
}

/* ── Sort ──────────────────── */

.fpu-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpu-toolbar__sort-icon {
    color: var(--fpu-text-muted);
    flex-shrink: 0;
}

.fpu-toolbar__sort-select {
    padding: 5px 26px 5px 8px;
    border: 1px solid transparent;
    border-radius: var(--fpu-radius-sm);
    font-size: 13px;
    font-family: var(--fpu-font);
    color: var(--fpu-charcoal);
    background: transparent url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color var(--fpu-transition), background-color var(--fpu-transition);
}

.fpu-toolbar__sort-select:hover {
    background-color: rgba(0,0,0,.04);
}

.fpu-toolbar__sort-select:focus {
    border-color: var(--fpu-olive);
    background-color: var(--fpu-white);
}

/* ── Bulk copies ───────────── */

.fpu-toolbar__bulk {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpu-toolbar__bulk-icon {
    color: var(--fpu-text-muted);
    flex-shrink: 0;
}

.fpu-toolbar__qty-label {
    font-size: 12px;
    color: var(--fpu-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.fpu-toolbar__qty-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--fpu-beige-light);
    border-radius: var(--fpu-radius-sm);
    font-size: 13px;
    font-family: var(--fpu-font);
    text-align: center;
    color: var(--fpu-charcoal);
    background: var(--fpu-white);
    outline: none;
    transition: border-color var(--fpu-transition);
}

.fpu-toolbar__qty-input:focus {
    border-color: var(--fpu-olive);
}

/* ── Thumbnail zoom controls ── */

.fpu-toolbar__zoom {
    display: flex;
    align-items: center;
    gap: 2px;
}

.fpu-toolbar__zoom-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fpu-radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--fpu-text-muted);
    cursor: pointer;
    padding: 0;
    transition: all var(--fpu-transition);
}

.fpu-toolbar__zoom-btn:hover {
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
}

.fpu-toolbar__zoom-btn:disabled {
    opacity: .3;
    cursor: default;
    pointer-events: none;
}

/* ── Ghost buttons for actions row ── */

.fpu-btn--ghost {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--fpu-charcoal) !important;
    font-weight: 500;
}

.fpu-btn--ghost:hover {
    background: var(--fpu-ecru) !important;
}

.fpu-btn--danger-ghost {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--fpu-danger) !important;
    font-weight: 500;
}

.fpu-btn--danger-ghost:hover {
    background: var(--fpu-danger-bg) !important;
}

.fpu-btn--compact {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  BUTTONS                                                    ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--fpu-radius-sm);
    font-family: var(--fpu-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--fpu-transition);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    outline: none;
}

.fpu-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--fpu-white), 0 0 0 4px var(--fpu-olive);
}

.fpu-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Primary = "Kup teraz" */
.fpu-btn--primary {
    background: linear-gradient(135deg, var(--fpu-beige), var(--fpu-olive));
    color: var(--fpu-white);
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--fpu-radius);
}

.fpu-btn--primary:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: var(--fpu-shadow);
}

/* Secondary = "Dodaj do koszyka" */
.fpu-btn--secondary {
    background: var(--fpu-olive);
    color: var(--fpu-white);
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--fpu-radius);
}

.fpu-btn--secondary:hover:not(:disabled) {
    background: var(--fpu-olive-light);
    box-shadow: var(--fpu-shadow);
}

/* Outline = "Przejdź do koszyka" */
.fpu-btn--outline {
    background: transparent;
    color: var(--fpu-olive);
    border: 2px solid var(--fpu-olive);
    padding: 12px 28px;
    font-weight: 600;
    border-radius: var(--fpu-radius);
    text-decoration: none;
    text-align: center;
}

.fpu-btn--outline:hover {
    background: var(--fpu-olive);
    color: var(--fpu-white);
    box-shadow: var(--fpu-shadow);
}

/* Small */
.fpu-btn--small {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
}

.fpu-btn--small:hover:not(:disabled) {
    background: var(--fpu-beige-light);
}

/* Icon */
.fpu-btn--icon {
    padding: 6px 12px;
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
    font-size: 13px;
}

.fpu-btn--icon:hover:not(:disabled) {
    background: var(--fpu-beige-light);
}

.fpu-btn__text {
    font-size: 12px;
}

/* Danger */
.fpu-btn--danger {
    background: transparent;
    color: var(--fpu-danger);
    border: 1px solid var(--fpu-danger);
}

.fpu-btn--danger:hover:not(:disabled) {
    background: var(--fpu-danger);
    color: var(--fpu-white);
}

/* Uploading state — pulsing disabled */
.fpu-btn--uploading {
    opacity: .5;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.fpu-btn--uploading::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
    animation: fpu-btn-shimmer 1.5s ease-in-out infinite;
}

@keyframes fpu-btn-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  4. PHOTO GALLERY GRID                                     ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-quality-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 11px;
    color: var(--fpu-text-muted);
    line-height: 1.4;
}

.fpu-quality-hint svg {
    flex-shrink: 0;
    color: var(--fpu-text-muted);
}

.fpu-photo-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    min-height: 0;
    transition: grid-template-columns .2s ease;
}

/* Zoom levels — controlled by JS */
.fpu-photo-list--cols-2 { grid-template-columns: repeat(2, 1fr); }
.fpu-photo-list--cols-3 { grid-template-columns: repeat(3, 1fr); }
.fpu-photo-list--cols-4 { grid-template-columns: repeat(4, 1fr); }
.fpu-photo-list--cols-5 { grid-template-columns: repeat(5, 1fr); }
.fpu-photo-list--cols-6 { grid-template-columns: repeat(6, 1fr); }

.fpu-photo-list:empty {
    display: none;
}

/* ── Photo Card ────────────────────────── */

.fpu-photo-card {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--fpu-transition), transform var(--fpu-transition);
    cursor: default;
}

.fpu-photo-card:hover {
    box-shadow: var(--fpu-shadow);
}

.fpu-photo-card--selected {
    border-color: var(--fpu-olive);
    box-shadow: 0 0 0 2px rgba(82,88,60,.2);
}

.fpu-photo-card--focused {
    outline: 2px solid var(--fpu-olive);
    outline-offset: 2px;
}

.fpu-photo-card--uploading {
    opacity: .55;
    filter: grayscale(.25);
    transition: opacity .4s ease, filter .4s ease;
}
.fpu-photo-card--uploading .fpu-photo-card__edit-btn,
.fpu-photo-card--uploading .fpu-photo-card__rotate-btn {
    pointer-events: none;
    opacity: 0;
}

/* ── Batch processing state ──── */
.fpu-photo-card--processing {
    pointer-events: none;
}

.fpu-photo-card--processing .fpu-photo-card__thumb::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    background: rgba(255,255,255,.65);
    z-index: 5;
    animation: fpu-processing-pulse 1.2s ease-in-out infinite;
}

.fpu-photo-card__processing-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    width: 28px;
    height: 28px;
    border: 3px solid var(--fpu-ecru);
    border-top-color: var(--fpu-olive);
    border-radius: 50%;
    animation: fpu-spin .7s linear infinite;
}

@keyframes fpu-processing-pulse {
    0%, 100% { opacity: .5; }
    50%      { opacity: .8; }
}

@keyframes fpu-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Paper preview mockup — physical print feel */
/* (checkerboard background replaces paper mockup) */

.fpu-photo-card:not(.fpu-photo-card--uploading):not(.fpu-photo-card--error) {
    box-shadow: var(--fpu-shadow-sm), 2px 3px 8px rgba(0,0,0,.06);
}

.fpu-photo-card:not(.fpu-photo-card--uploading):hover {
    box-shadow: var(--fpu-shadow), 3px 4px 12px rgba(0,0,0,.10);
}

.fpu-photo-card--error {
    border-color: var(--fpu-danger);
}

/* ── Thumbnail area ────────────────────── */

.fpu-photo-card__thumb {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 square */
    background: #e8e8e8;
    overflow: hidden;
}

.fpu-photo-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity var(--fpu-transition);
    cursor: zoom-in;
}

/* ── Global border preview ─────────── */
/* When .fpu-photo-list--border is toggled, add white border on all cards */
.fpu-photo-list--border .fpu-photo-card__img {
    /* Scale down the image to make room for the border (~4mm simulated) */
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    top: 6px;
    left: 6px;
    border-radius: 1px;
    transition: all .3s ease;
}

.fpu-photo-list--border .fpu-photo-card__thumb {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* Lazy loading placeholder */
.fpu-photo-card__img.fpu-lazy {
    background: linear-gradient(90deg, #e0e0e0 25%, #ebebeb 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: fpu-skeleton 1.5s ease-in-out infinite;
    filter: blur(4px);
    transform: scale(1.02);
}

/* Smooth reveal after lazy-load */
.fpu-photo-card__img {
    transition: filter .3s ease, transform .3s ease;
}

/* Skeleton loading placeholder */
.fpu-photo-card__skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e0e0e0 25%, #ebebeb 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: fpu-skeleton 1.5s ease-in-out infinite;
}

/* Camera icon shown during upload */
.fpu-photo-card__upload-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: #ccc;
    transition: color .3s ease;
    animation: fpu-upload-icon-pulse 1.8s ease-in-out infinite;
}

.fpu-photo-card__upload-icon svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}

@keyframes fpu-upload-icon-pulse {
    0%, 100% { opacity: .6; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;  transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes fpu-skeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Upload progress on card */
.fpu-photo-card__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,.08);
    z-index: 4;
}

.fpu-photo-card__progress-fill {
    height: 100%;
    width: 0%;
    background: var(--fpu-olive);
    border-radius: 0 2px 2px 0;
    transition: width .3s ease;
}

/* ── Card overlays ─────────────────────── */

.fpu-photo-card__select {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    opacity: 0;
    transition: opacity var(--fpu-transition);
}

.fpu-photo-card:hover .fpu-photo-card__select,
.fpu-photo-card--selected .fpu-photo-card__select {
    opacity: 1;
}

.fpu-photo-card__actions {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 5;
    opacity: 0;
    transition: opacity var(--fpu-transition);
}

.fpu-photo-card:hover .fpu-photo-card__actions {
    opacity: 1;
}

.fpu-photo-card__action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: var(--fpu-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--fpu-transition);
}

.fpu-photo-card__action:hover {
    background: rgba(0,0,0,.8);
}

.fpu-photo-card__action--delete:hover {
    background: var(--fpu-danger);
}

/* Grip handle for drag & drop sorting */
.fpu-photo-card__grip {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fpu-radius-sm);
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.9);
    font-size: 14px;
    line-height: 1;
    cursor: grab;
    opacity: 0;
    transition: opacity var(--fpu-transition);
    user-select: none;
}

.fpu-photo-card:hover .fpu-photo-card__grip {
    opacity: 1;
}

.fpu-photo-card__grip:active {
    cursor: grabbing;
    background: rgba(0,0,0,.7);
}

/* On touch devices there is no hover — always show the grip */
@media (hover: none) and (pointer: coarse) {
    .fpu-photo-card__grip {
        opacity: .6;
    }
    .fpu-photo-card__zoom-btn {
        opacity: .7;
    }

    /* Minimum 44px touch targets per WCAG/Apple HIG */
    .fpu-qty__btn {
        min-width: 44px;
        min-height: 44px;
    }
    .fpu-tooltip-trigger,
    .fpu-photo-card__action {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .fpu-photo-card__select .fpu-checkbox__box {
        width: 28px;
        height: 28px;
    }
}

/* Zoom button on card */
.fpu-photo-card__zoom-btn {
    position: absolute;
    top: 38px;
    right: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: var(--fpu-white);
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: all var(--fpu-transition);
}

.fpu-photo-card:hover .fpu-photo-card__zoom-btn {
    opacity: 1;
}

.fpu-photo-card__zoom-btn:hover {
    background: rgba(0,0,0,.8);
    transform: scale(1.1);
}

/* Rotate button on card */
.fpu-photo-card__rotate-btn {
    position: absolute;
    top: 70px;
    right: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: var(--fpu-white);
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: all var(--fpu-transition);
}

.fpu-photo-card:hover .fpu-photo-card__rotate-btn {
    opacity: 1;
}

.fpu-photo-card__rotate-btn:hover {
    background: rgba(0,0,0,.8);
    transform: scale(1.1);
}

.fpu-photo-card__rotate-btn.fpu-photo-card__rotate-btn--loading {
    pointer-events: none;
    opacity: .5;
}

/* Always-visible edit button on card */
.fpu-photo-card__edit-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border: none;
    cursor: pointer;
    font-family: var(--fpu-font);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    transition: all var(--fpu-transition);
    opacity: 0.9;
}

.fpu-photo-card__edit-btn:hover {
    opacity: 1;
    background: var(--fpu-olive-light);
    box-shadow: var(--fpu-shadow-sm);
}

.fpu-photo-card__edit-btn svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

/* Crop overlay (aspect ratio visualization) */
.fpu-photo-card__crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* crop-inner box-shadow handles the dimming outside the crop area;
   no extra ::before overlay needed (it was double-darkening the image). */

.fpu-photo-card__crop-inner {
    position: absolute;
    /* top/left/transform set inline by JS (_getCropOverlayHtml) */
    border: 2px dashed rgba(255,255,255,.7);
    border-radius: 2px;
    z-index: 2;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.3);
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.fpu-photo-card__crop-inner.fpu-dragging {
    cursor: grabbing;
}



.fpu-photo-card__crop-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    background: rgba(0,0,0,.45);
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.3;
    z-index: 1;
    white-space: nowrap;
}

/* ── Before/After comparison overlay ── */
.fpu-photo-card__before-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}

.fpu-photo-card__thumb:hover .fpu-photo-card__before-after {
    opacity: 1;
}

.fpu-photo-card__before-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(0 50% 0 0);
    transition: clip-path .3s ease;
}

.fpu-photo-card__thumb:hover .fpu-photo-card__before-img {
    clip-path: inset(0 50% 0 0);
}

.fpu-photo-card__before-after::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,.8);
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(0,0,0,.3);
}

.fpu-photo-card__ba-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 700;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.3;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

/* Show badge even when not hovering - indicate photo was edited */
.fpu-photo-card__thumb .fpu-photo-card__ba-badge {
    opacity: 1;
}

/* Error overlay */
.fpu-photo-card__error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(192,57,43,.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--fpu-danger);
    font-size: 12px;
    font-weight: 600;
    padding: 8px;
    text-align: center;
}

.fpu-photo-card__retry-btn {
    display: block;
    margin: 8px auto 0;
    padding: 6px 16px;
    background: var(--fpu-white);
    color: var(--fpu-charcoal);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: var(--fpu-radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.fpu-photo-card__retry-btn:hover {
    background: var(--fpu-ecru);
}

/* ── Card body ─────────────────────────── */

.fpu-photo-card__body {
    padding: 10px 12px 12px;
}

.fpu-photo-card__name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fpu-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* ── Quantity control ──────────────────── */

.fpu-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.fpu-qty__btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--fpu-beige-light);
    background: var(--fpu-off-white);
    color: var(--fpu-charcoal);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--fpu-transition);
    line-height: 1;
}

.fpu-qty__btn:first-child {
    border-radius: var(--fpu-radius-sm) 0 0 var(--fpu-radius-sm);
}

.fpu-qty__btn:last-child {
    border-radius: 0 var(--fpu-radius-sm) var(--fpu-radius-sm) 0;
}

.fpu-qty__btn:hover {
    background: var(--fpu-ecru);
    border-color: var(--fpu-beige);
}

.fpu-qty__input {
    width: 40px;
    height: 28px;
    border: 1px solid var(--fpu-beige-light);
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--fpu-font);
    color: var(--fpu-charcoal);
    background: var(--fpu-white);
    outline: none;
    -moz-appearance: textfield;
}

.fpu-qty__input::-webkit-inner-spin-button,
.fpu-qty__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  5. SUMMARY                                                 ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-summary {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-lg);
    padding: 0;
    box-shadow: var(--fpu-shadow);
    overflow: hidden;
}

.fpu-summary[hidden] {
    display: none;
}

.fpu-summary--sticky {
    position: sticky;
    bottom: 0;
    z-index: 90;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Pricing block */
.fpu-summary__pricing {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-summary__dl {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0 12px;
    padding: 0;
}

.fpu-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.fpu-summary__label {
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--fpu-text-muted);
    margin: 0;
}

.fpu-summary__value {
    font-size: 15px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    margin: 0;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.fpu-summary__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 2px solid var(--fpu-ecru);
}

.fpu-summary__total-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.fpu-summary__total-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--fpu-olive);
    font-variant-numeric: tabular-nums;
}

/* Action buttons block */
.fpu-summary__actions {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fpu-summary__actions .fpu-btn {
    padding: 12px 16px;
    font-size: 14px;
}

/* Tools row (PDF + Share) */
.fpu-summary__tools {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--fpu-ecru);
}

.fpu-summary__tool-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: none;
    border: none;
    border-right: 1px solid var(--fpu-ecru);
    color: var(--fpu-text-muted);
    font-family: var(--fpu-font);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fpu-transition);
    min-height: 40px;
}

.fpu-summary__tool-btn:last-child {
    border-right: none;
}

.fpu-summary__tool-btn:hover:not(:disabled) {
    background: rgba(82, 88, 60, .04);
    color: var(--fpu-olive);
}

.fpu-summary__tool-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.fpu-summary__tool-btn svg {
    flex-shrink: 0;
}

/* Photo details collapsible */
.fpu-summary__details {
    border-top: 1px solid var(--fpu-ecru);
}

.fpu-summary__details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--fpu-font);
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-text-muted);
    transition: color var(--fpu-transition);
}

.fpu-summary__details-toggle:hover {
    color: var(--fpu-olive);
}

.fpu-summary__details-arrow {
    transition: transform var(--fpu-transition);
    flex-shrink: 0;
}

.fpu-summary__details--open .fpu-summary__details-arrow {
    transform: rotate(180deg);
}

.fpu-summary__details-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.fpu-summary__details--open .fpu-summary__details-list {
    max-height: 400px;
    overflow-y: auto;
}

.fpu-summary__details-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 20px;
    font-size: 11.5px;
    line-height: 1.3;
    border-top: 1px solid rgba(0,0,0,.04);
}

.fpu-summary__details-item:first-child {
    border-top: 1px solid var(--fpu-ecru);
}

.fpu-summary__details-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fpu-charcoal);
    font-weight: 500;
}

.fpu-summary__details-qty {
    flex-shrink: 0;
    color: var(--fpu-text-muted);
    font-variant-numeric: tabular-nums;
}

.fpu-summary__details-price {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--fpu-olive);
    font-variant-numeric: tabular-nums;
    min-width: 55px;
    text-align: right;
}

/* Savings hint */
/* Upload status in summary */
.fpu-upload-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef9e7;
    border-bottom: 1px solid #f0e6c0;
    border-radius: 0;
    padding: 10px 20px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--fpu-charcoal);
    margin: 0;
    transition: background-color .4s ease, border-color .4s ease;
}
.fpu-upload-status__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #d4c9a0;
    border-top-color: var(--fpu-olive);
    border-radius: 50%;
    animation: fpu-spin .8s linear infinite;
    flex-shrink: 0;
}
@keyframes fpu-spin {
    to { transform: rotate(360deg); }
}
.fpu-upload-status__text {
    flex: 1;
    min-width: 0;
}
.fpu-upload-status__remaining {
    color: #888;
    white-space: nowrap;
}
.fpu-upload-status__ok {
    color: var(--fpu-success);
    font-weight: 600;
}

.fpu-savings-hint {
    background: var(--fpu-success-bg);
    border-bottom: 1px solid #b2dfdb;
    border-radius: 0;
    padding: 10px 20px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--fpu-charcoal);
    margin: 0;
}

.fpu-savings-hint strong {
    font-weight: 700;
    color: var(--fpu-success);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  5b. POPUP                                                    ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fpu-fadeIn .2s ease;
}

.fpu-popup {
    background: var(--fpu-white);
    border-radius: var(--fpu-radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: var(--fpu-shadow-lg);
    text-align: center;
}

.fpu-popup__close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--fpu-ecru);
    border-radius: 50%;
    font-size: 20px;
    color: var(--fpu-charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background var(--fpu-transition);
}

.fpu-popup__close:hover {
    background: var(--fpu-beige-light);
}

.fpu-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    margin: 0 0 16px;
}

.fpu-popup__content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--fpu-charcoal);
    margin-bottom: 24px;
}

.fpu-popup__content p {
    margin: 0 0 8px;
}

.fpu-popup__ok {
    padding: 12px 36px !important;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  5c. PAGINATION                                              ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.fpu-pagination__btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    background: var(--fpu-white);
    color: var(--fpu-charcoal);
    font-family: var(--fpu-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: all var(--fpu-transition);
}

.fpu-pagination__btn:hover:not(:disabled) {
    border-color: var(--fpu-olive);
    background: var(--fpu-ecru);
}

.fpu-pagination__btn--active {
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border-color: var(--fpu-olive);
}

.fpu-pagination__btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.fpu-pagination__info {
    font-size: 12px;
    color: var(--fpu-beige);
    margin-left: 12px;
}

.fpu-pagination__ellipsis {
    font-size: 14px;
    color: var(--fpu-beige);
    padding: 0 4px;
    user-select: none;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  5d. KEYBOARD SHORTCUTS PANEL                                ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-toolbar__shortcuts-btn {
    /* sits at end of actions row via spacer */
}

.fpu-shortcuts-panel {
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--fpu-shadow);
    animation: fpu-fadeIn .15s ease;
}

.fpu-shortcuts-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fpu-shortcuts-panel__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--fpu-charcoal);
}

.fpu-shortcuts-panel__close {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--fpu-ecru);
    border-radius: 50%;
    font-size: 16px;
    color: var(--fpu-charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background var(--fpu-transition);
}

.fpu-shortcuts-panel__close:hover {
    background: var(--fpu-beige-light);
}

.fpu-shortcuts-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 24px;
}

.fpu-shortcuts-panel__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.fpu-shortcuts-panel__key {
    display: inline-block;
    min-width: 64px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--fpu-beige-light);
    background: var(--fpu-ecru);
    font-family: var(--fpu-font);
    font-size: 11px;
    font-weight: 600;
    color: var(--fpu-charcoal);
    text-align: center;
    white-space: nowrap;
}

.fpu-shortcuts-panel__desc {
    font-size: 12px;
    color: var(--fpu-charcoal);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  6. MESSAGES                                                ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-message {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 10000;
    padding: 0;
    border-radius: var(--fpu-radius);
    font-size: 14px;
    transition: all .3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    max-width: 500px;
    width: max-content;
}

.fpu-message.fpu-message--visible {
    padding: 14px 20px;
    max-height: 200px;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.fpu-message--success {
    background: var(--fpu-success-bg);
    color: #1a5632;
    border: 1px solid #a3d9b1;
}

.fpu-message--error {
    background: var(--fpu-danger-bg);
    color: #922b21;
    border: 1px solid #f1a9a0;
}

.fpu-message--warning {
    background: var(--fpu-warning-bg);
    color: #7d5a29;
    border: 1px solid #f5cba7;
}

/* ── Undo toast ─────────────────────── */

.fpu-undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--fpu-charcoal);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--fpu-radius);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
    z-index: 10100;
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    font-size: 14px;
}
.fpu-undo-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.fpu-undo-toast__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
.fpu-undo-toast__btn {
    background: none;
    border: 1px solid rgba(255,255,255,.4);
    color: #ffd78a;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.fpu-undo-toast__btn:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.6);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  6b. FOOTER INFO BAR                                        ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-footer-info {
    background: var(--fpu-ecru);
    border-radius: var(--fpu-radius);
    padding: 14px 20px;
    margin-top: 8px;
}

.fpu-footer-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    color: var(--fpu-beige);
    line-height: 1.5;
}

.fpu-footer-info p + p {
    margin-top: 6px;
}

.fpu-footer-info svg {
    flex-shrink: 0;
    color: var(--fpu-beige);
}

.fpu-footer-info a {
    color: var(--fpu-olive);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: color var(--fpu-transition);
}

.fpu-footer-info a:hover {
    color: var(--fpu-charcoal);
}

.fpu-footer-info__version {
    justify-content: flex-end;
    font-size: 10px !important;
    opacity: .45;
    margin-top: 8px !important;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  7. PHOTO EDITOR MODAL                                     ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fpu-editor-overlay.fpu-editor-visible {
    opacity: 1;
    visibility: visible;
}

.fpu-editor-modal {
    background: var(--fpu-white);
    border-radius: var(--fpu-radius-lg);
    width: 94vw;
    max-width: 1100px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--fpu-shadow-lg);
    overflow: hidden;
    transform: scale(.95);
    transition: transform .25s ease;
}

/* Wide mode for adjust tab */
.fpu-editor-modal--wide {
    max-width: 1300px;
}

.fpu-editor-visible .fpu-editor-modal {
    transform: scale(1);
}

/* ── Header ────────────────────────── */

.fpu-editor-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-editor-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fpu-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

.fpu-editor-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--fpu-transition);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
}

.fpu-editor-close:hover {
    background: var(--fpu-beige-light);
}

/* ── Tabs ──────────────────────────── */

.fpu-editor-tabs {
    display: flex;
    gap: 4px;
    background: var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    padding: 3px;
    flex-shrink: 0;
}

.fpu-editor-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--fpu-beige);
    font-family: var(--fpu-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--fpu-transition);
    white-space: nowrap;
}

.fpu-editor-tab:hover {
    color: var(--fpu-charcoal);
}

.fpu-editor-tab--active {
    background: var(--fpu-white);
    color: var(--fpu-olive);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Editor body (shared) ──────────── */

.fpu-editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    min-height: 400px;
}

.fpu-editor-canvas {
    width: 100%;
    height: 100%;
    max-height: 72vh;
    position: relative;
    touch-action: none; /* allow Cropper.js pinch-to-zoom on mobile */
}

.fpu-editor-canvas--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--fpu-ecru);
    border-top-color: var(--fpu-olive);
    border-radius: 50%;
    animation: fpu-spin .8s linear infinite;
    z-index: 10;
}

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

/* ── Adjust mode loader ────────── */
.fpu-editor-adjust-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 253, 247, .92);
    z-index: 20;
    border-radius: var(--fpu-radius);
}

/* Camera loader — spinning lens */
.fpu-camera-loader {
    margin-bottom: 16px;
    color: var(--fpu-olive);
}
.fpu-camera-loader__svg {
    display: block;
}
.fpu-camera-loader__lens-inner {
    transform-origin: 32px 35px;
    animation: fpu-lens-spin 1.2s linear infinite;
}
.fpu-camera-loader__lens-outer {
    transform-origin: 32px 35px;
    animation: fpu-lens-pulse 2s ease-in-out infinite;
}
@keyframes fpu-lens-spin {
    to { transform: rotate(360deg); }
}
@keyframes fpu-lens-pulse {
    0%, 100% { r: 12; opacity: 1; }
    50% { r: 10; opacity: .7; }
}

.fpu-editor-adjust-loader__text {
    font-size: 15px;
    font-weight: 600;
    color: var(--fpu-text);
    margin: 0 0 4px;
}

.fpu-editor-adjust-loader__sub {
    font-size: 12px;
    color: var(--fpu-text-muted);
    margin: 0 0 12px;
}

.fpu-editor-adjust-loader__bar {
    width: 200px;
    height: 6px;
    background: var(--fpu-ecru);
    border-radius: 3px;
    overflow: hidden;
}

.fpu-editor-adjust-loader__fill {
    height: 100%;
    width: 0;
    background: var(--fpu-olive);
    border-radius: 3px;
    transition: width .2s ease;
}

.fpu-editor-canvas img,
.fpu-editor-canvas .cropper-container img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    /* Server already auto-orients pixels; prevent browser from
       double-rotating via residual EXIF orientation tag. */
    image-orientation: none;
}

/* ── Cropper.js handle overrides ──── */
/* Corner handles: visible round knobs */
.cropper-point.point-ne,
.cropper-point.point-nw,
.cropper-point.point-sw,
.cropper-point.point-se {
    width: 14px;
    height: 14px;
    background: var(--fpu-white);
    border: 2px solid var(--fpu-olive);
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform .15s ease;
}

.cropper-point.point-ne { top: -7px; right: -7px; }
.cropper-point.point-nw { top: -7px; left: -7px; }
.cropper-point.point-sw { bottom: -7px; left: -7px; }
.cropper-point.point-se { bottom: -7px; right: -7px; }

/* Remove default point-se special sizing */
.cropper-point.point-se::before { display: none; }

/* Edge midpoint handles: smaller, subtle */
.cropper-point.point-n,
.cropper-point.point-e,
.cropper-point.point-s,
.cropper-point.point-w {
    width: 10px;
    height: 10px;
    background: var(--fpu-white);
    border: 2px solid var(--fpu-olive);
    border-radius: 50%;
    opacity: .85;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* Override Cropper.js crop box outline */
.cropper-view-box {
    outline-color: var(--fpu-olive);
}

.cropper-line {
    background-color: var(--fpu-olive);
}

/* Hover: enlarge corner knobs */
.cropper-point.point-ne:hover,
.cropper-point.point-nw:hover,
.cropper-point.point-sw:hover,
.cropper-point.point-se:hover {
    transform: scale(1.25);
}

/* Touch devices: bigger hit targets */
@media (hover: none) and (pointer: coarse) {
    .cropper-point.point-ne,
    .cropper-point.point-nw,
    .cropper-point.point-sw,
    .cropper-point.point-se {
        width: 20px;
        height: 20px;
    }
    .cropper-point.point-ne { top: -10px; right: -10px; }
    .cropper-point.point-nw { top: -10px; left: -10px; }
    .cropper-point.point-sw { bottom: -10px; left: -10px; }
    .cropper-point.point-se { bottom: -10px; right: -10px; }

    .cropper-point.point-n,
    .cropper-point.point-e,
    .cropper-point.point-s,
    .cropper-point.point-w {
        width: 14px;
        height: 14px;
    }
}

/* ── Adjust mode layout ───────────── */

.fpu-editor-adjust-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
}

.fpu-editor-preview-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1a1a1a;
    padding: 16px;
}

.fpu-editor-preview-canvas {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 4px;
    display: block;
}

/* ── Compare slider (before/after) ── */

.fpu-editor-compare {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 72vh;
    user-select: none;
}

.fpu-editor-compare__orig,
.fpu-editor-compare__edited {
    display: block;
    max-width: 100%;
    max-height: 72vh;
}

.fpu-editor-compare__edited {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 0 0 50%);
}

.fpu-editor-compare__slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    touch-action: none;
}

.fpu-editor-compare__line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,.8);
    box-shadow: 0 0 4px rgba(0,0,0,.4);
}

.fpu-editor-compare__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--fpu-white);
    color: var(--fpu-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    cursor: ew-resize;
}

.fpu-editor-compare__label {
    position: absolute;
    top: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,.6);
    padding: 3px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fpu-editor-compare__label--before {
    left: 8px;
}

.fpu-editor-compare__label--after {
    right: 8px;
}

/* ── Sliders panel (right sidebar) ── */

.fpu-editor-sliders-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--fpu-off-white);
    border-left: 1px solid var(--fpu-ecru);
    overflow-y: auto;
    padding: 0;
}

.fpu-editor-sliders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fpu-beige);
    border-bottom: 1px solid var(--fpu-ecru);
    position: sticky;
    top: 0;
    background: var(--fpu-off-white);
    z-index: 1;
}

/* ── Presets ──────────────────────── */

.fpu-editor-presets {
    padding: 12px 18px 8px;
    border-bottom: 1px solid var(--fpu-ecru);
}

.fpu-editor-presets__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fpu-beige);
    margin-bottom: 8px;
}

.fpu-editor-presets__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fpu-editor-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    background: var(--fpu-white);
    cursor: pointer;
    transition: all var(--fpu-transition);
    min-width: 54px;
    font-family: var(--fpu-font);
}

.fpu-editor-preset:hover {
    border-color: var(--fpu-beige-light);
    background: var(--fpu-ecru);
}

.fpu-editor-preset--active {
    border-color: var(--fpu-olive);
    background: var(--fpu-olive);
    color: var(--fpu-white);
}

.fpu-editor-preset--active:hover {
    background: var(--fpu-olive-light);
    border-color: var(--fpu-olive-light);
}

.fpu-editor-preset__icon {
    font-size: 16px;
    line-height: 1;
}

.fpu-editor-preset__name {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}

.fpu-editor-sliders {
    padding: 12px 18px 18px;
}

/* ── Individual slider row ─────────── */

.fpu-slider-row {
    display: grid;
    grid-template-columns: 80px 1fr 44px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,.04);
}

.fpu-slider-row:last-child {
    border-bottom: none;
}

.fpu-slider-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-charcoal);
    white-space: nowrap;
    user-select: none;
}

.fpu-slider-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-olive);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
}

/* ── Range slider styling ──────────── */

.fpu-slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--fpu-beige-light);
    outline: none;
    cursor: pointer;
    margin: 0;
}

.fpu-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fpu-olive);
    border: 2px solid var(--fpu-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fpu-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.fpu-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
    background: var(--fpu-olive-light);
}

.fpu-slider-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fpu-olive);
    border: 2px solid var(--fpu-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    cursor: pointer;
}

.fpu-slider-input::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--fpu-beige-light);
}

/* ── Reset button ──────────────────── */

.fpu-editor-btn--reset {
    padding: 4px 10px;
    font-size: 11px;
    gap: 4px;
    background: transparent;
    color: var(--fpu-beige);
    border: 1px solid var(--fpu-beige-light);
}

.fpu-editor-btn--reset:hover {
    color: var(--fpu-charcoal);
    border-color: var(--fpu-beige);
    background: var(--fpu-ecru);
}

/* ── EXIF / Info panel ────────────── */

#fpu-editor-mode-exif {
    background: var(--fpu-off-white, #FBFBFB);
    overflow-y: auto;
}

.fpu-editor-exif-layout {
    display: flex;
    gap: 24px;
    padding: 24px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    align-items: flex-start;
}

.fpu-editor-exif-thumb {
    flex-shrink: 0;
    width: 180px;
}

.fpu-editor-exif-thumb__img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--fpu-beige);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.fpu-editor-exif-data {
    flex: 1;
    min-width: 0;
}

.fpu-editor-exif-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fpu-editor-exif-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--fpu-beige);
    font-size: 13px;
    line-height: 1.4;
}

.fpu-editor-exif-row:last-child {
    border-bottom: none;
}

.fpu-editor-exif-row__icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-size: 14px;
}

.fpu-editor-exif-row__label {
    flex-shrink: 0;
    width: 120px;
    color: var(--fpu-text-muted, #6d6440);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.fpu-editor-exif-row__value {
    flex: 1;
    color: var(--fpu-text, #3d3d3d);
    word-break: break-word;
}

@media (max-width: 600px) {
    .fpu-editor-exif-layout {
        flex-direction: column;
        align-items: center;
        padding: 16px;
    }
    .fpu-editor-exif-thumb { width: 120px; }
    .fpu-editor-exif-row__label { width: 90px; }
}

/* ── Toolbar ───────────────────────── */

.fpu-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--fpu-ecru);
    flex-wrap: wrap;
}

.fpu-editor-toolbar__crop,
.fpu-editor-toolbar__adjust {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fpu-editor-adj-info {
    font-size: 12px;
    color: var(--fpu-beige);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Crop mode selector — removed (always classic) */

.fpu-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: none;
    border-radius: var(--fpu-radius-sm);
    background: var(--fpu-ecru);
    color: var(--fpu-charcoal);
    font-family: var(--fpu-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--fpu-transition);
    gap: 6px;
}

.fpu-editor-btn:hover {
    background: var(--fpu-beige-light);
}

.fpu-editor-separator {
    flex: 1;
}

.fpu-editor-btn--cancel {
    background: transparent;
    color: var(--fpu-beige);
}

.fpu-editor-btn--cancel:hover {
    color: var(--fpu-charcoal);
    background: var(--fpu-ecru);
}

.fpu-editor-btn--save {
    background: var(--fpu-olive);
    color: var(--fpu-white);
    font-weight: 600;
    padding: 8px 24px;
}

.fpu-editor-btn--save:hover {
    background: var(--fpu-olive-light);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  8. LIGHTBOX                                                ║
   ╚══════════════════════════════════════════════════════════════╝ */

.fpu-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.85);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    backdrop-filter: blur(6px);
}

.fpu-lightbox--visible {
    opacity: 1;
    visibility: visible;
}

.fpu-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--fpu-radius);
}

.fpu-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--fpu-transition);
}

.fpu-lightbox__nav:hover {
    background: rgba(255,255,255,.3);
}

.fpu-lightbox__nav--prev { left: 24px; }
.fpu-lightbox__nav--next { right: 24px; }

.fpu-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--fpu-transition);
}

.fpu-lightbox__close:hover {
    background: rgba(255,255,255,.3);
}

.fpu-lightbox__edit {
    position: absolute;
    top: 20px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--fpu-olive);
    color: var(--fpu-white);
    border: none;
    cursor: pointer;
    font-family: var(--fpu-font);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--fpu-transition);
}

.fpu-lightbox__edit:hover {
    background: var(--fpu-olive-light);
    box-shadow: var(--fpu-shadow);
}

.fpu-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  9. DRAG & DROP SORTING                                    ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Drag placeholder — shows drop target */
.fpu-photo-card.sortable-ghost {
    opacity: .15;
    background: var(--fpu-olive);
    border: 2px dashed var(--fpu-olive);
    border-radius: var(--fpu-radius);
}

.fpu-photo-card.sortable-ghost * {
    visibility: hidden;
}

/* Dragged card */
.fpu-photo-card.sortable-chosen {
    box-shadow: var(--fpu-shadow-lg), 0 0 0 3px rgba(82,88,60,.25);
    transform: scale(1.05) rotate(1deg);
    z-index: 10;
    transition: none;
}

.fpu-photo-card.sortable-drag {
    opacity: .92;
    cursor: grabbing;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  9b. COVER PRINT (ODBITKA TYTUŁOWA)                          ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Config section in left panel */
.fpu-config__cover {
    border-top: 1px solid var(--fpu-ecru);
    padding-top: 16px;
    margin-top: 4px;
}

.fpu-config__cover-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fpu-olive);
    margin: 0 0 10px;
}

.fpu-config__cover-title svg {
    flex-shrink: 0;
}

.fpu-cover-price-info {
    font-size: 11px;
    line-height: 1.5;
    color: var(--fpu-text-muted);
    margin: 6px 0 12px;
    padding: 0;
}

.fpu-cover-price-info strong {
    color: var(--fpu-olive);
    font-weight: 700;
}

.fpu-cover-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.fpu-cover-mode__option {
    flex: 1;
}

.fpu-cover-mode__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fpu-cover-mode__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-text-muted);
    background: var(--fpu-off-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    cursor: pointer;
    transition: all var(--fpu-transition);
}

.fpu-cover-mode__label:hover {
    border-color: var(--fpu-beige-light);
}

.fpu-cover-mode__radio:checked + .fpu-cover-mode__label {
    color: var(--fpu-olive);
    background: rgba(82,88,60,.08);
    border-color: var(--fpu-olive);
}

.fpu-cover-preview {
    position: relative;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    overflow: hidden;
    background: #f9f8f6;
    margin-bottom: 10px;
}

.fpu-cover-preview__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
}

.fpu-cover-preview__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--fpu-text-muted);
    font-size: 12px;
}

.fpu-cover-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fpu-text-muted);
    background: none;
    border: 1px dashed var(--fpu-beige-light);
    border-radius: var(--fpu-radius-sm);
    cursor: pointer;
    transition: all var(--fpu-transition);
}

.fpu-cover-upload-btn:hover {
    border-color: var(--fpu-olive);
    color: var(--fpu-olive);
    background: rgba(82,88,60,.04);
}

/* Pinned cover card in gallery */
.fpu-cover-card {
    background: var(--fpu-white);
    border: 2px solid var(--fpu-olive);
    border-radius: var(--fpu-radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--fpu-shadow-sm);
    display: flex;
    align-items: stretch;
    gap: 0;
    cursor: pointer;
    transition: box-shadow var(--fpu-transition), transform var(--fpu-transition);
}

.fpu-cover-card:hover {
    box-shadow: var(--fpu-shadow), 0 0 0 3px rgba(82,88,60,.15);
    transform: translateY(-1px);
}

.fpu-cover-card__thumb {
    width: 120px;
    min-height: 100px;
    flex-shrink: 0;
    background: #f5f3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fpu-cover-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fpu-cover-card__body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.fpu-cover-card__header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpu-cover-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fpu-olive);
    background: rgba(82,88,60,.1);
    border-radius: 4px;
}

.fpu-cover-card__free {
    display: inline-flex;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--fpu-success);
    background: var(--fpu-success-bg);
    border-radius: 4px;
}

.fpu-cover-card__paid {
    display: inline-flex;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--fpu-beige);
    background: rgba(170,140,116,.12);
    border-radius: 4px;
}

.fpu-cover-card__desc {
    font-size: 11px;
    color: var(--fpu-text-muted);
    line-height: 1.4;
    margin: 0;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  10. ANIMATIONS                                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

@keyframes fpu-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fpu-photo-card {
    animation: fpu-fadeIn .3s ease backwards;
}

/* Stagger cards */
.fpu-photo-card:nth-child(5n+1) { animation-delay: 0s; }
.fpu-photo-card:nth-child(5n+2) { animation-delay: .03s; }
.fpu-photo-card:nth-child(5n+3) { animation-delay: .06s; }
.fpu-photo-card:nth-child(5n+4) { animation-delay: .09s; }
.fpu-photo-card:nth-child(5n+5) { animation-delay: .12s; }

/* ╔══════════════════════════════════════════════════════════════╗
   ║  10b. MOBILE WIZARD / STEPPER                                ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Hidden on desktop by default */
.fpu-steps {
    display: none;
}

@media (max-width: 1024px) {
    .fpu-steps {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 12px 16px;
        margin-bottom: 16px;
        background: var(--fpu-white);
        border: 1px solid var(--fpu-ecru);
        border-radius: var(--fpu-radius);
        box-shadow: var(--fpu-shadow-sm);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .fpu-steps__btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border: none;
        background: none;
        cursor: pointer;
        font-family: var(--fpu-font);
        font-size: 13px;
        color: var(--fpu-text-muted);
        border-radius: var(--fpu-radius-sm);
        transition: all var(--fpu-transition);
        white-space: nowrap;
    }

    .fpu-steps__btn:hover {
        background: var(--fpu-ecru);
    }

    .fpu-steps__num {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--fpu-ecru);
        color: var(--fpu-text-muted);
        font-size: 12px;
        font-weight: 700;
        flex-shrink: 0;
        transition: all var(--fpu-transition);
    }

    .fpu-steps__btn--active {
        color: var(--fpu-olive);
        font-weight: 600;
    }

    .fpu-steps__btn--active .fpu-steps__num {
        background: var(--fpu-olive);
        color: var(--fpu-white);
    }

    .fpu-steps__btn--done .fpu-steps__num {
        background: var(--fpu-success);
        color: var(--fpu-white);
    }

    .fpu-steps__divider {
        width: 20px;
        height: 1px;
        background: var(--fpu-beige-light);
        flex-shrink: 0;
    }

    /* Hide non-active sections on mobile when wizard is active */
    .fpu-layout--wizard .fpu-layout__sidebar--left,
    .fpu-layout--wizard .fpu-layout__center,
    .fpu-layout--wizard .fpu-layout__sidebar--right {
        display: none !important;
    }

    .fpu-layout--wizard .fpu-layout__sidebar--left.fpu-step--visible,
    .fpu-layout--wizard .fpu-layout__center.fpu-step--visible,
    .fpu-layout--wizard .fpu-layout__sidebar--right.fpu-step--visible {
        display: block !important;
    }

    /* Mobile next/prev buttons at bottom of each step */
    .fpu-step-nav {
        display: flex;
        gap: 10px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--fpu-ecru);
    }

    .fpu-step-nav__btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 12px 16px;
        border: 1px solid var(--fpu-ecru);
        border-radius: var(--fpu-radius-sm);
        background: var(--fpu-white);
        color: var(--fpu-charcoal);
        font-family: var(--fpu-font);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--fpu-transition);
        min-height: 44px;
    }

    .fpu-step-nav__btn:hover {
        background: var(--fpu-ecru);
    }

    .fpu-step-nav__btn--primary {
        background: var(--fpu-olive);
        color: var(--fpu-white);
        border-color: var(--fpu-olive);
    }

    .fpu-step-nav__btn--primary:hover {
        background: var(--fpu-olive-light);
    }
}

@media (max-width: 480px) {
    .fpu-steps {
        gap: 0;
        padding: 8px 10px;
    }

    .fpu-steps__btn {
        padding: 6px 8px;
        font-size: 12px;
        gap: 4px;
    }

    .fpu-steps__num {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .fpu-steps__divider {
        width: 12px;
    }
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  10c. SHARE MODAL & SHARED GALLERY                           ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* (Share button now in .fpu-summary__tools row) */

/* Share modal */
.fpu-share-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fpu-share-modal__backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fpu-share-modal__dialog {
    position: relative;
    background: var(--fpu-white);
    border-radius: var(--fpu-radius-lg);
    box-shadow: var(--fpu-shadow-lg);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.fpu-share-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.fpu-share-modal__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--fpu-charcoal);
    margin: 0;
}

.fpu-share-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    font-size: 22px;
    color: var(--fpu-text-muted);
    cursor: pointer;
    border-radius: var(--fpu-radius-sm);
    transition: background var(--fpu-transition);
}

.fpu-share-modal__close:hover {
    background: var(--fpu-ecru);
}

.fpu-share-modal__body {
    padding: 20px 24px 24px;
}

.fpu-share-modal__desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--fpu-text-muted);
    margin: 0 0 16px;
}

.fpu-share-modal__fields {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.fpu-share-modal__fields .fpu-field {
    flex: 1;
}

.fpu-share-modal__subtitle {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--fpu-text-muted);
    margin: 20px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--fpu-ecru);
}

.fpu-share-modal__empty,
.fpu-share-modal__loading {
    font-size: 13px;
    color: var(--fpu-text-muted);
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

/* Share link item */
.fpu-share-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-sm);
    margin-bottom: 8px;
}

.fpu-share-link__info {
    flex: 1;
    min-width: 0;
}

.fpu-share-link__url {
    display: block;
    font-size: 12px;
    font-family: monospace;
    color: var(--fpu-olive);
    word-break: break-all;
    line-height: 1.4;
    margin-bottom: 4px;
}

.fpu-share-link__meta {
    font-size: 11px;
    color: var(--fpu-text-muted);
    line-height: 1.5;
}

.fpu-share-link__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Shared gallery page */
.fpu-share-body {
    margin: 0;
    background: #f5f0eb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--fpu-charcoal, #3d3d3d);
    line-height: 1.5;
}

.fpu-share-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.fpu-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #d6c1ae;
    margin-bottom: 24px;
}

.fpu-share-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fpu-share-header__icon {
    color: #AA8C74;
    flex-shrink: 0;
}

.fpu-share-header__title {
    font-size: 18px;
    font-weight: 700;
    color: #3d3d3d;
    margin: 0;
}

.fpu-share-header__meta {
    font-size: 13px;
    color: #8a8060;
    margin: 2px 0 0;
}

.fpu-share-header__back {
    font-size: 13px;
    color: #52583C;
    text-decoration: none;
    font-weight: 600;
}

.fpu-share-header__back:hover {
    text-decoration: underline;
}

/* Shared gallery layout — reuse main layout pattern */
.fpu-share-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 24px;
    align-items: start;
}

.fpu-share-layout__sidebar {
    position: sticky;
    top: 24px;
}

.fpu-share-layout__center {
    min-width: 0;
}

.fpu-share-volume-card {
    margin-top: 16px;
    background: var(--fpu-white);
    border: 1px solid var(--fpu-ecru);
    border-radius: var(--fpu-radius-lg);
    box-shadow: var(--fpu-shadow);
    overflow: hidden;
}

.fpu-share-volume-card .fpu-volume {
    padding: 12px 16px 14px;
}

.fpu-share-volume-card .fpu-volume__table {
    font-size: 12px;
}

.fpu-share-volume-card .fpu-volume__th,
.fpu-share-volume-card .fpu-volume__td {
    padding: 5px 8px;
}

@media (max-width: 1024px) {
    .fpu-share-layout {
        grid-template-columns: 1fr;
    }
    .fpu-share-layout__sidebar {
        position: static;
    }
    .fpu-share-layout__center { order: 1; }
    .fpu-share-layout__sidebar--left { order: 2; }
    .fpu-share-layout__sidebar--right { order: 3; }
}

@media (max-width: 600px) {
    .fpu-share-modal {
        padding: 8px;
    }
    .fpu-share-modal__dialog {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .fpu-share-modal__fields {
        flex-direction: column;
    }
    .fpu-share-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  11. RESPONSIVE                                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Large desktop (wide layout) */
@media (min-width: 1200px) {
    .fpu-layout {
        grid-template-columns: 300px 1fr 300px !important;
    }
}

/* Tablet landscape - sidebars narrower */
@media (max-width: 1199px) and (min-width: 1025px) {
    .fpu-layout {
        grid-template-columns: 260px 1fr 260px !important;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .fpu-layout {
        grid-template-columns: 1fr !important;
        overflow-x: hidden;
    }

    /* Mobile order: upload/gallery first → config → summary */
    .fpu-layout__center         { order: 1; min-width: 0; }
    .fpu-layout__sidebar--left  { order: 2; position: static; min-width: 0; }
    .fpu-layout__sidebar--right { order: 3; position: static; min-width: 0; }

    .fpu-photo-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    /* On tablet, allow zoom (full width available) */
    .fpu-photo-list--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .fpu-photo-list--cols-3 { grid-template-columns: repeat(3, 1fr); }
    .fpu-photo-list--cols-4 { grid-template-columns: repeat(4, 1fr); }
    .fpu-photo-list--cols-5 { grid-template-columns: repeat(5, 1fr); }
    .fpu-photo-list--cols-6 { grid-template-columns: repeat(6, 1fr); }

    .fpu-summary__pricing {
        padding: 16px 20px 12px;
    }

    .fpu-summary__dl {
        flex-direction: row;
        gap: 0;
        margin-bottom: 10px;
    }

    .fpu-summary__item {
        flex: 1;
        padding: 0 12px 0 0;
    }

    .fpu-summary__actions {
        flex-direction: row;
        padding: 12px 20px;
    }

    .fpu-summary__actions .fpu-btn {
        flex: 1;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .fpu-photo-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .fpu-photo-list[class*="fpu-photo-list--cols-"] {
        grid-template-columns: repeat(3, 1fr);
    }
    .fpu-toolbar__zoom { display: none; }

    .fpu-summary__dl {
        flex-direction: column;
        margin-bottom: 10px;
    }

    .fpu-summary__item {
        padding: 5px 0;
    }

    .fpu-toolbar__row {
        gap: 10px;
        padding: 8px 14px;
    }

    .fpu-editor-modal {
        width: 95vw;
        max-height: 95vh;
    }

    /* iOS: prevent auto-zoom on input focus (requires >=16px) */
    .fpu-field__input,
    .fpu-field__select {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .fpu-wrap {
        padding: 0 12px;
    }

    .fpu-photo-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .fpu-photo-list[class*="fpu-photo-list--cols-"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .fpu-config__group {
        padding: 12px 16px;
    }

    .fpu-summary__pricing {
        padding: 14px 16px 10px;
    }

    .fpu-summary__actions {
        padding: 12px 16px;
    }

    .fpu-summary__total-price {
        font-size: 20px;
    }

    .fpu-dropzone {
        padding: 32px 16px;
    }

    .fpu-toolbar__row {
        padding: 8px 12px;
        gap: 8px;
    }

    .fpu-toolbar__sep {
        display: none;
    }

    .fpu-toolbar__row--top {
        flex-wrap: wrap;
    }

    .fpu-toolbar__sort {
        order: 2;
    }

    .fpu-toolbar__sort-select {
        flex: 1;
    }

    .fpu-toolbar__bulk {
        order: 3;
    }

    .fpu-toolbar__row--actions .fpu-btn__text {
        display: none;
    }

    .fpu-editor-toolbar {
        padding: 10px 16px;
    }

    .fpu-editor-header {
        padding: 10px 16px;
        gap: 8px;
    }

    .fpu-editor-tabs {
        order: 10;
        width: 100%;
        justify-content: center;
    }

    .fpu-editor-adjust-layout {
        flex-direction: column;
        min-height: auto;
    }

    .fpu-editor-compare__label {
        font-size: 12px;
        padding: 4px 12px;
        top: 6px;
        background: rgba(0,0,0,.7);
    }

    .fpu-editor-compare__label--before { left: 6px; }
    .fpu-editor-compare__label--after  { right: 6px; }

    .fpu-editor-sliders-panel {
        width: 100%;
        max-height: 220px;
        border-left: none;
        border-top: 1px solid var(--fpu-ecru);
    }

    .fpu-slider-row {
        grid-template-columns: 70px 1fr 40px;
        gap: 6px;
        padding: 5px 0;
    }

    .fpu-editor-adj-info {
        max-width: 200px;
        font-size: 11px;
    }

    .fpu-lightbox__nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .fpu-lightbox__nav--prev { left: 10px; }
    .fpu-lightbox__nav--next { right: 10px; }
}

/* Ultra-small phones */
@media (max-width: 380px) {
    .fpu-toolbar__row {
        padding: 6px 10px;
        gap: 6px;
    }

    .fpu-toolbar__bulk {
        flex-wrap: wrap;
    }

    .fpu-toolbar__sort,
    .fpu-toolbar__bulk-qty {
        display: none;
    }

    .fpu-photo-card__name {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fpu-photo-card__edit-btn span {
        display: none;
    }
}

/* ── Empty state ───────────────────── */

.fpu-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--fpu-muted);
    text-align: center;
    gap: 12px;
}

.fpu-empty-state p {
    font-size: 15px;
    margin: 0;
}

/* ── Confirm dialog ────────────────── */

.fpu-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fpu-fade-in .15s ease;
}

.fpu-confirm-dialog {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    padding: 28px 28px 20px;
    max-width: 420px;
    width: 90vw;
    animation: fpu-scale-in .2s ease;
}

.fpu-confirm-dialog__title {
    font-size: 16px;
    font-weight: 700;
    color: #3d3d3d;
    margin-bottom: 10px;
}

.fpu-confirm-dialog__message {
    font-size: 14px;
    color: #5a5a5a;
    line-height: 1.5;
    white-space: pre-line;
    margin-bottom: 20px;
}

.fpu-confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fpu-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fpu-scale-in {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Stagger animation limit ──────── */

.fpu-photo-card:nth-child(n+51) {
    animation-delay: 0s !important;
}

/* ── Reduced motion ────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
