/* Smart Photo Upload System - Styles V2.2 */

#wc-smart-minime-upload-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

#wc-smart-minime-upload-container * {
    box-sizing: border-box;
}

/* Header */
.wc-smn-header {
    margin-bottom: 24px;
}

.wc-smn-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wc-smn-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* Status Labels & Transition */
.wc-smn-status {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-smn-status.good {
    background: #e6f7ff;
    color: #1890ff;
}

.wc-smn-status.strong {
    background: #f6ffed;
    color: #52c41a;
}

/* Popup Image */
.wc-smn-popup-img {
    display: block;
    max-width: 100px;
    height: auto;
    margin: 0 auto 15px;
    border-radius: 4px;
}

/* Popup Tip */
.wc-smn-popup-tip {
    margin-top: 15px;
    padding: 10px;
    background: #fdf6e3;
    border: 1px solid #fcebbd;
    border-radius: 4px;
    font-size: 13px;
    color: #8a6d3b;
    text-align: center;
    line-height: 1.4;
}

/* --- New Progress Bar Colors & Button Styles --- */

/* Progress Bar Colors */
/* Transition handled by base class, just override bg */
.wc-smn-progress-bar.wc-smn-level-1 {
    background-color: #ffec3d !important;
}

.wc-smn-progress-bar.wc-smn-level-2 {
    background-color: #1890ff !important;
}

.wc-smn-progress-bar.wc-smn-level-3 {
    background-color: #52c41a !important;
}

/* Buttons */
/* Delete All - White */
.wc-smn-btn-clear,
.wc-smn-btn-delete-all,
button[class*="delete"] {
    /* Fallback */
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #d9d9d9 !important;
}

.wc-smn-btn-clear:hover,
.wc-smn-btn-delete-all:hover {
    background-color: #f5f5f5 !important;
    color: #ff4d4f !important;
    /* Red on hover for delete usually looks good, or keep black */
    border-color: #ff4d4f !important;
}

/* Done - Black */
.wc-smn-btn-ok,
.wc-smn-btn-done {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
}

.wc-smn-btn-ok:hover,
.wc-smn-btn-done:hover {
    background-color: #333 !important;
    transform: translateY(-1px);
}

/* Help Link in Header */
.wc-smn-help-link {
    float: right;
    margin-right: 40px;
    /* Space from close button */
    font-size: 13px;
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
    margin-top: 2px;
}

.wc-smn-help-link:hover {
    text-decoration: underline;
}

.wc-smn-help-link .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
    vertical-align: text-bottom;
}

/* Help Popup */
.wc-smn-help-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.wc-smn-help-popup-content {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.wc-smn-help-popup-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 4px;
}

.wc-smn-help-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 18px;
    color: #333;
    transition: all 0.2s;
}

.wc-smn-help-close:hover {
    background: #f0f0f0;
}

/* New Tooltip Icon */
.wc-smn-tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #e0e0e0;
    color: #555;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
}

/* Tooltip Popup (CSS Only) */
.wc-smn-tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    min-width: 150px;
    max-width: 200px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    animation: wcSuTooltipFade 0.2s forwards;
    line-height: 1.4;
}

/* Tooltip Arrow */
.wc-smn-tooltip-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 105%;
    /* Just below the tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    z-index: 100;
    opacity: 0;
    animation: wcSuTooltipFade 0.2s forwards;
}

@keyframes wcSuTooltipFade {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Progress Bar - Simplified */
.wc-smn-progress-container {
    width: 100%;
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.wc-smn-progress-bar {
    height: 100%;
    background-color: #faad14;
    /* JS updates this */
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* Status Message Row */
.wc-smn-status-msg-row {
    margin-bottom: 8px;
    min-height: 20px;
}

.wc-smn-status-msg {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    font-weight: 500;
}

/* Hide Old Expectation Text */
.wc-smn-expectation-text {
    display: none;
}

/* Highlighted Text in Instructions */
.wc-smn-highlight {
    color: #ff4d4f;
    /* Bright Red */
    font-weight: 700;
    background: rgba(255, 77, 79, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Permanent Safety Line */
.wc-smn-safety-line {
    font-size: 11px;
    color: #888;
    background: #f9f9f9;
    padding: 6px;
    border-radius: 4px;
    border-left: 3px solid #ccc;
    margin-top: 8px;
    line-height: 1.4;
    font-style: italic;
}

/* Popups - Beautiful Minimal */
.wc-smn-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.wc-smn-popup-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border: none;
    border-radius: 16px;
    /* User requested rounded */
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: wcSuFadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes wcSuFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-smn-popup-icon {
    width: auto;
    /* Allow natural width up to max */
    max-width: 150px;
    /* Increased from 48px to 150px */
    height: auto;
    margin-bottom: 20px;
    display: block;
    border-radius: 8px;
    /* Slight rounding for images */
}

.wc-smn-popup-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #111;
    font-size: 19px;
    /* Slightly larger */
    font-weight: 700;
    /* Bold */
    line-height: 1.3;
}

.wc-smn-popup-body {
    font-size: 15px;
    /* Normal weight, clean */
    color: #444;
    line-height: 1.6;
    margin-bottom: 15px;
    max-width: 90%;
}

.wc-smn-popup-tip {
    font-size: 13px;
    color: #155724;
    /* Green text */
    background-color: #d4edda;
    /* Soft green bg */
    border: 1px solid #c3e6cb;
    /* Green border */
    padding: 10px 14px;
    /* Slightly more padding */
    border-radius: 6px;
    margin-bottom: 15px;
    display: inline-block;
}

.wc-smn-popup-disclaimer {
    font-size: 12px;
    color: #6c757d;
    /* Grey as requested */
    margin-bottom: 20px;
    font-weight: 500;
}

.wc-smn-popup-btn {
    background: #222;
    /* Dark background */
    color: #fff;
    border: none;
    border-radius: 50px;
    /* Rounded pill style */
    padding: 12px 32px;
    /* Medium padding */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-smn-popup-btn:hover {
    background: #000;
    transform: translateY(-2px);
    /* Slight hover lift */
}

.wc-smn-popup-btn:focus {
    outline: none;
}

.wc-smn-safety-note {
    font-size: 11px;
    color: #999;
    line-height: 1.4;
    margin: 0;
}

.wc-smn-guide-btn {
    background: none;
    border: none;
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

/* Tiles Container - CSS Grid */
.wc-smn-tiles-container {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Force exactly two inline columns ALWAYS */
    gap: 15px;
    width: 100%;
}

/* Modal Content (Edit Window) */
.wc-smn-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: wcSmnFadeIn 0.3s ease-out;
}

.wc-smn-modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.wc-smn-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.wc-smn-edit-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wc-smn-close-modal {
    font-size: 24px;
    cursor: pointer;
    background: #f0f0f0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.wc-smn-close-modal:hover {
    background: #e0e0e0;
}

.wc-smn-edit-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: 15px;
}

/* Individual Tile (Square) */
.wc-smn-tile {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    /* Aspect Ratio 1:1 */
    border: 2px dashed #cfd8dc;
    border-radius: 12px;
    background: #f8fafc;
    overflow: visible;
    /* Changed from hidden to show floating badge */
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.wc-smn-tile.has-custom-placeholder {
    border-style: solid;
    border-color: #eee;
}

/* Has Images State (New) */
.wc-smn-tile.has-images {
    border: 2px dashed #999;
    /* Dotted/Dashed border as requested */
    background-image: none !important;
    /* Hide cover image */
}

.wc-smn-tile:hover {
    border-color: #90a4ae;
    background-color: #f1f5f9;
}

.wc-smn-tile.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
}

/* Badge "Sticker" Style - Floating above corner */
.wc-smn-tile-overlay {
    position: absolute;
    top: -6px;
    right: -6px;
    width: auto;
    z-index: 10;
    /* Highest priority */
    pointer-events: none;
}

.wc-smn-banner {
    display: inline-block;
    padding: 3px 6px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    border-radius: 4px;
    /* Fully rounded, no cut corners */
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wc-smn-banner-required {
    background: #ff4d4f;
}

.wc-smn-banner-recommended {
    background: #1890ff;
}

.wc-smn-banner-optional {
    background: #52c41a;
}

/* Tile Content */
.wc-smn-tile-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* items flow from top */
    padding: 8px;
    z-index: 4;
    cursor: pointer;
}

.wc-smn-tile-inner-top {
    width: 100%;
    margin-bottom: 8px;
    /* Separator */
    flex-shrink: 0;
    position: relative;
    /* Reset from absolute */
    top: 0;
    left: 0;
}

/* Main Label */
.wc-smn-label-main {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Counter - Moved to Bottom Right (Avoid Button Overlap) */
.wc-smn-counter {
    position: absolute;
    bottom: 3px;
    right: 3px;
    left: auto;
    /* Reset left */
    font-size: 8px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 1px 3px;
    /* Tiny padding */
    border-radius: 3px;
    z-index: 21;
    /* Above button if needed, but position should clear */
    pointer-events: none;
}

/* New Guide Image Wrap - Becomes the background layer */
.wc-smn-tile-guide-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    border-radius: 12px;
    overflow: hidden;
}

.wc-smn-tile.has-images .wc-smn-tile-guide-wrap,
.wc-smn-tile.has-images .wc-smn-upload-placeholder-icon {
    display: none !important;
}

.wc-smn-tile-guide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.wc-smn-tile:hover .wc-smn-tile-guide-img {
    opacity: 0.6;
}

.wc-smn-upload-placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    display: flex !important;
}

/* Thumbnail Grid Area - Horizontal Scroll */
.wc-smn-preview-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    height: auto;
    max-height: 65px;
    /* Limit height */
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: all;
    margin-bottom: auto;
    /* Push button area */
    padding-bottom: 5px;
    /* Breathing room */

    /* Hide Scrollbar but allow scroll */
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* Fade effect on right to indicate scrolling */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.wc-smn-preview-grid::-webkit-scrollbar {
    display: none;
}

/* Thumbnails */
.wc-smn-thumb-wrapper {
    position: relative;
    width: 48px;
    /* Fixed sized 48-52px range */
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    /* Never shrink */
}

.wc-smn-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wc-smn-remove-btn-small {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #ff4d4f;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wc-smn-remove-btn-small:hover {
    background: #ff4d4f;
    color: #fff;
}

.wc-smn-warning-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #faad14;
    color: #fff;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    cursor: help;
}

/* Upload Button - Improved Compact Style */
.wc-smn-upload-btn {
    position: absolute;
    bottom: 12px;
    /* Fixed distance from bottom */
    left: 50%;
    transform: translateX(-50%);
    width: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;

    padding: 6px 14px !important;

    font-size: 10px !important;
    font-weight: 700 !important;
    color: #888 !important;
    /* Muted text */
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 20px !important;

    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s;
    pointer-events: all;
    z-index: 20;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: normal !important;
    min-height: unset !important;
    height: auto !important;
}

/* Specific "Edit / Add" Button Style */
.wc-smn-edit-shadow-btn {
    background: #fff !important;
    color: #1890ff !important;
    border: 1px solid #1890ff !important;
    box-shadow: 0 4px 10px rgba(24, 144, 255, 0.25) !important;
    transform: translateX(-50%) translateY(-2px);
    /* Lift */
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    /* Equal spacing */
    padding: 8px 16px !important;
    /* Ensure sufficient padding */
}

/* Ensure Icon Alignment */
.wc-smn-edit-shadow-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    /* Remove default margins */
}

.wc-smn-edit-shadow-btn:hover {
    box-shadow: 0 6px 14px rgba(24, 144, 255, 0.4) !important;
    transform: translateX(-50%) translateY(-3px);
    background: #e6f7ff !important;
}

/* Delete All Button Alignment */
.wc-smn-btn-delete-all {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
}

.wc-smn-edit-shadow-btn .dashicons,
.wc-smn-edit-shadow-btn span {
    font-size: 14px;
    line-height: 1;
}

.wc-smn-upload-btn:hover {
    color: #333 !important;
    border-color: #bbb !important;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.wc-smn-file-input {
    display: none !important;
}

/* Guide Modal */
.wc-smn-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wc-smn-modal-content {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wc-smn-close-modal {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

/* Responsive Mobile Adjustments */
@media (max-width: 600px) {
    .wc-smn-tiles-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .wc-smn-upload-btn {
        padding: 5px 10px !important;
        /* Smaller on mobile */
        font-size: 10px !important;
    }

    .wc-smn-thumb-wrapper {
        width: 42px;
        /* Slightly smaller on very small screens */
        height: 42px;
    }
}

/* Footer Label */
.wc-smn-footer-label {
    margin-top: 15px;
    text-align: center;
    font-size: 11px;
    color: #888;
    font-style: italic;
    width: 100%;
    clear: both;
    line-height: 1.4;
    padding-bottom: 5px;
}

/* =========================================
   STACKED VIEW & EDIT MODAL STYLES
   ========================================= */

/* 1. Grid Logic for Stacked View */
/* 1. Grid Logic for Stacked View */
/* 1. Grid Logic for Stacked View (Restored) */
.wc-smn-stacked-grid {
    overflow: visible !important;
    height: 100% !important;
    display: block !important;
}

.wc-smn-stack-container {
    position: absolute;
    top: 56%;
    /* Added more space from top to avoid label overlap */
    left: 50%;
    transform: translate(-50%, -50%);
    /* True Center */
    width: 64px;
    /* Slightly larger for visibility */
    height: 64px;
    z-index: 15;
    /* Lower than button (20/25) but check label */
    overflow: visible;
}

.wc-smn-tile {
    position: relative;
    width: 100%;
    /* Responsive Grid */
    aspect-ratio: 1 / 1;
    /* Square Tile */
    background: #fff;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: visible !important;
    /* Allow stack to pop out if needed, prevents cropping */
    box-sizing: border-box;
}

.wc-smn-tile:hover {
    border-color: #1890ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    z-index: 10;
    /* Bring to front on hover */
}

.wc-smn-stack-item {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fff;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Ensure contain works inside */
}

.wc-smn-stack-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* CRITICAL: No Crop */
    background: #fdfdfd;
}

/* Stack Offsets - Visible without Hover */
.wc-smn-stack-item.idx-0 {
    /* Bottom */
    transform: rotate(-6deg) translate(-4px, 2px);
    z-index: 10;
}

.wc-smn-stack-item.idx-1 {
    /* Middle */
    transform: rotate(4deg) translate(4px, -2px);
    z-index: 11;
}

.wc-smn-stack-item.idx-2 {
    /* Top */
    transform: rotate(-1deg);
    z-index: 12;
    border-color: #f0f0f0;
}

/* Image Count Indicator Badge */
.wc-smn-stack-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4d4f;
    color: white;
    font-size: 11px;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    z-index: 25;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover: Fan out slightly */
.wc-smn-tile:hover .wc-smn-stack-item.idx-2 {
    transform: scale(1.05);
}


/* 2. Edit Button - Centered and Styled */
.wc-smn-edit-btn {
    position: absolute;
    bottom: 40px;
    /* Moved up slightly to clear upload button */
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    /* Reset top */

    background: #fff;
    color: #333;
    padding: 2px 8px;
    /* Ultra compact padding */
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
}

.wc-smn-edit-btn:hover {
    background: #fff;
    color: #1890ff;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wc-smn-edit-btn span {
    font-size: 14px;
}

/* Disabled/Greyed Out Button State */
.wc-smn-btn-disabled {
    background: #f5f5f5 !important;
    color: #a0a0a0 !important;
    border-color: #e0e0e0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    pointer-events: none;
}


/* 3. Edit Modal System */
#wc-smn-edit-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);

    /* Flex Centering */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Specific Modal Content Override */
#wc-smn-edit-modal .wc-smn-modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 0;
    /* Important for flex centering */
    max-height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Reset static */
    animation: wcSuSlideUp 0.3s ease-out;
}

@keyframes wcSuSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-smn-edit-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.wc-smn-edit-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

#wc-smn-close-edit {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.2s;
}

#wc-smn-close-edit:hover {
    color: #333;
}

.wc-smn-edit-instructions {
    padding: 16px 20px 8px;
    font-size: 13px;
    color: #555;
    background: #fff;
    line-height: 1.5;
    flex-shrink: 0;
}

/* Modal Body Scroll */
.wc-smn-modal-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

/* Person Card - Dotted Container */
.wc-smn-person-card {
    background: #fff;
    border: 2px dashed #d9d9d9;
    /* Dotted/Dashed container as requested */
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    transition: border-color 0.2s;
}

.wc-smn-person-card:hover {
    border-color: #1890ff;
}

.wc-smn-person-header h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #555;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Remove Person Button (Corner) */
.wc-smn-remove-person {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all 0.2s;
    display: block !important;
    /* Force show */
}

.wc-smn-remove-person:hover {
    background: #d9363e;
    transform: scale(1.1);
}

/* Person Grid - Small Thumbnails */
.wc-smn-person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    /* Small thumbnails (60px) */
    gap: 10px;
}

/* Grid Item (Image) */
.wc-smn-grid-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    /* Square */
    border-radius: 4px;
    /* Slight rounded */
    overflow: hidden;
    border: 1px solid #eee;
    background: #fff;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wc-smn-grid-item:active {
    cursor: grabbing;
}

.wc-smn-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover for thumbnail look */
    display: block;
}

/* Close Button (X) - Improved for Mobile */
.wc-smn-remove-item {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    /* Better touch target */
}

.wc-smn-remove-item:hover {
    background: #ff4d4f;
    transform: scale(1.1);
}

/* Add Image Card (Same Size as Thumbnail) */
.wc-smn-add-image-card {
    border: 2px dashed #1890ff;
    border-radius: 4px;
    background: #f0f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1890ff;
    aspect-ratio: 1;
    /* Square Match */
    transition: all 0.2s;
    width: 100%;
}

.wc-smn-add-image-card:hover {
    background: #e6f7ff;
    transform: scale(0.98);
}

.wc-smn-add-image-card span {
    font-size: 28px;
    /* Big + Icon */
    font-weight: 300;
    line-height: 1;
    margin-top: -2px;
}

/* Reinforced Button Styles by ID */
#wc-smn-btn-delete-all {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #d9d9d9 !important;
}

#wc-smn-btn-delete-all:hover {
    color: #ff4d4f !important;
    border-color: #ff4d4f !important;
    background: #fff1f0 !important;
}

#wc-smn-modal-save {
    background-color: #000 !important;
    /* Black */
    color: #fff !important;
    border: 1px solid #000 !important;
}

#wc-smn-modal-save:hover {
    background-color: #333 !important;
    border-color: #333 !important;
}

.wc-smn-add-person-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #1890ff;
    border: 1px dashed #1890ff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 10px;
    /* Space at bottom */
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wc-smn-add-person-btn:hover {
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(24, 144, 255, 0.1);
}

.wc-smn-empty-msg {
    grid-column: 1 / -1;
    text-align: left;
    color: #999;
    font-size: 11px;
    font-style: italic;
    padding: 4px 0;
}


.wc-smn-edit-thumb-wrapper:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #d9d9d9;
}

.wc-smn-edit-thumb-wrapper:active {
    cursor: grabbing;
}

.wc-smn-edit-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Show full image */
    padding: 4px;
    background: #fff;
    border-radius: 8px;
}

/* Remove 'x' in Modal */
.wc-smn-remove-btn-modal {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4d4f;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    z-index: 10;
    transition: all 0.2s;
    border: 2px solid #fff;
}

.wc-smn-remove-btn-modal:hover {
    background: #cf1322;
    transform: scale(1.1);
}

/* Footer in Modal */
.wc-smn-edit-footer {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: #fff;
    flex-shrink: 0;
}

.wc-smn-btn-delete-all {
    background: none;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.wc-smn-btn-delete-all:hover {
    background: #fff1f0;
    border-color: #ff4d4f;
}

.wc-smn-upload-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    z-index: 20;
    /* Ensure label is on top of border but let's check stack */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wc-smn-btn-ok {
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.25);
    transition: all 0.2s;
}

.wc-smn-btn-ok:hover {
    background: #40a9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(24, 144, 255, 0.4);
}

/* Sortable Placeholder (jQuery UI) */
.wc-smn-sortable-placeholder {
    border: 2px dashed #1890ff !important;
    background: #e6f7ff;
    border-radius: 8px;
    visibility: visible !important;
}

/* View Label in Modal */
.wc-smn-view-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    letter-spacing: 0.5px;
}

/* Tile Counter */
.wc-smn-counter {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-weight: 500;
}

/* Drag & Drop Tip in Modal */
.wc-smn-drag-tip {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d48806;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-smn-drag-tip .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Uploading State Overlays */
.wc-smn-is-uploading img {
    opacity: 0.3 !important;
    filter: blur(2px) grayscale(100%);
    transition: all 0.3s ease;
}

.wc-smn-loader-spinner {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wc-smn-spin 1s ease-in-out infinite;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

@keyframes wc-smn-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.wc-smn-upload-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 16px;
    background: rgba(0,0,0,0.7);
    z-index: 10;
    overflow: hidden;
}

.wc-smn-progress-fill {
    height: 100%;
    background: #007cba;
    width: 0%;
    transition: width 0.4s ease;
}

.wc-smn-progress-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: center;
    font-size: 9px;
    line-height: 16px;
    color: #fff;
    font-weight: bold;
    z-index: 11;
    text-shadow: 0px 1px 2px rgba(0,0,0,0.8);
}

.wc-smn-progress-processing {
    background: #46b450;
    animation: wc-smn-pulse 1s infinite alternate;
}

@keyframes wc-smn-pulse {
    from { opacity: 1; }
    to { opacity: 0.6; }
}
