        /* ============================================
           BASE STYLES
           ============================================ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        /* ============================================
           HEADER
           ============================================ */
        .header {
            background: white;
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .header-left h1 {
            color: #667eea;
            font-size: 28px;
            margin-bottom: 5px;
        }

        .header-left p {
            color: #666;
            font-size: 14px;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 15px;
            background: #f0f0f0;
            border-radius: 8px;
        }

        .user-info i {
            color: #667eea;
            font-size: 20px;
        }

        .user-name {
            font-weight: 600;
            color: #333;
        }

        .btn-logout {
            background: #ef4444;
            color: white;
            padding: 8px 15px;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .btn-logout:hover {
            background: #dc2626;
            transform: translateY(-2px);
        }

        .btn-login {
    background: #06c755;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

        .btn-login:hover {
            background: #05b34a;
        }

        .nav-links {
            display: flex;
            gap: 10px;
            margin-top: 10px;
            width: 100%;
        }

        .nav-link {
            color: #667eea;
            text-decoration: none;
            padding: 8px 15px;
            border-radius: 6px;
            font-weight: 600;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .nav-link:hover {
            background: #f0f0f0;
        }

        /* ============================================
           FORM ELEMENTS
           ============================================ */
        .card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .form-group {
            margin-bottom: 10px;
        }

        .form-label {
            display: block;
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            font-size: 16px;
        }

        .form-input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s;
        }
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: menulist;
    appearance: menulist;
    touch-action: manipulation;
    position: relative;
    z-index: 1;
}

/* Focus style (input + select) */
.form-input:focus,
.form-select:focus {
    outline: none;

    border: 2px solid transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(to right, #E100FF, #7F00FF) border-box;

    box-shadow: 0 0 0 2px rgba(127, 0, 255, 0.15);
}

select option:hover {
  background:linear-gradient(to right, #E100FF, #7F00FF)!important;
}



        /* ============================================
           SIZE FORM
           ============================================ */
        @keyframes border-glow {
            0%,100% { border-color: #E100FF; box-shadow: 0 0 8px rgba(225,0,255,0.3); }
            50%     { border-color: #7F00FF; box-shadow: 0 0 16px rgba(127,0,255,0.4); }
        }
        .size-form-container {
            border: 2px solid #E100FF;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            background: #fafafa;
            position: relative;
            /* animation: border-glow 3s ease-in-out infinite; */
        }

        .size-form-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        .size-form-title {
    font-size: 30px;
    font-weight: 700;
    
    color: #7F00FF;
    background: linear-gradient(to right, #11998e, #38ef7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


        .btn-remove-size {
            background: #ef4444;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-remove-size:hover {
            background: #dc2626;
            transform: translateY(-2px);
        }

        .frame-color-group {
            display: none;
            margin-top: 15px;
            padding: 15px;
            background: white;
            border-radius: 8px;
            border: 2px solid #667eea;
        }

        .frame-color-group.active {
            display: block;
        }

        /* ============================================
           UPLOAD AREA
           ============================================ */
        .upload-area {
            border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 5px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 9px;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
        }

        .upload-area:hover {
  border: 3px dashed #7F00FF;
 
}


        .upload-area i {
  font-size: 48px;
  margin-bottom: 6px;

  background: linear-gradient(to right, #11998e, #38ef7d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


        .upload-hint {
            color: #666;
            font-size: 14px;
            margin-top: 4px;
        }

        /* ============================================
           SIZE GUIDE - BASIC (Original)
           ============================================ */
        .size-guide {
            background: #e0f2fe;
            border-left: 4px solid #0284c7;
            padding: 15px;
            border-radius: 8px;
            margin-top: 15px;
            font-size: 14px;
            color: #075985;
        }

        .size-guide strong {
            display: block;
            margin-bottom: 5px;
        }

        /* ============================================
           SIZE GUIDE - ENHANCED
           ============================================ */
        .size-guide-enhanced {
            background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
            border-radius: 12px;
            padding: 20px;
            margin-top: 20px;
            border: 2px solid #0284c7;
        }

        .size-info {
            margin-bottom: 20px;
        }

        .size-detail-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #bae6fd;
        }

        .size-detail-row .label {
            color: #075985;
            font-weight: 600;
        }

        .size-detail-row .value {
            color: #0c4a6e;
        }

        .size-detail-row.alert {
            background: #fef3c7;
            padding: 10px;
            border-radius: 6px;
            border: none;
            margin-top: 10px;
            color: #92400e;
        }

        .size-detail-row.alert i {
            color: #f59e0b;
            margin-right: 8px;
        }

        .size-preview-box {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            background: white;
            border-radius: 8px;
        }

        .preview-box {
            position: relative;
            border: 3px dashed #0284c7;
            background: repeating-linear-gradient(
                45deg,
                #f0f9ff,
                #f0f9ff 10px,
                #e0f2fe 10px,
                #e0f2fe 20px
            );
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
        }

        .preview-label {
            text-align: center;
            color: #0c4a6e;
            font-size: 14px;
            line-height: 1.4;
        }

        .preview-corners {
            position: absolute;
            inset: 0;
        }

        .preview-corners .corner {
            position: absolute;
            width: 20px;
            height: 20px;
            border: 3px solid #0284c7;
        }

        .corner.top-left {
            top: -3px;
            left: -3px;
            border-right: none;
            border-bottom: none;
        }

        .corner.top-right {
            top: -3px;
            right: -3px;
            border-left: none;
            border-bottom: none;
        }

        .corner.bottom-left {
            bottom: -3px;
            left: -3px;
            border-right: none;
            border-top: none;
        }

        .corner.bottom-right {
            bottom: -3px;
            right: -3px;
            border-left: none;
            border-top: none;
        }

        .preview-hint {
            color: #64748b;
            font-size: 13px;
            font-style: italic;
        }

        /* ============================================
           PHOTO GRID - BASIC (Original)
           ============================================ */
        .photos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .photo-item {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            background: white;
        }

        .photo-preview {
            width: 100%;
            height: 150px;
            object-fit: cover;
        }

        /* ============================================
           PHOTO GRID - ENHANCED
           ============================================ */
        .photos-grid-enhanced {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .photo-item-enhanced {
            position: relative;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            background: white;
            cursor: pointer;
            transition: all 0.3s;
        }

        .photo-item-enhanced:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        }

        .photo-item-enhanced.needs-validation {
            border: 3px solid #f59e0b;
        }

        .photo-item-enhanced.valid {
            border: 3px solid #10b981;
        }

        .photo-preview-container {
            position: relative;
            width: 100%;
            height: 200px;
            overflow: hidden;
        }

        .photo-preview-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .validation-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(245, 158, 11, 0.9);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
        }

        .validation-overlay i {
            font-size: 36px;
            margin-bottom: 8px;
        }

        .photo-info-bar {
            display: flex;
            justify-content: space-between;
            padding: 8px 12px;
            background: #f8fafc;
            font-size: 12px;
        }

        .photo-size-info {
            color: #64748b;
            font-weight: 600;
        }

        .photo-controls {
            position: absolute;
            top: 0;
            right: 0;
            display: flex;
            gap: 5px;
            padding: 5px;
        }

        .photo-qty {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 8px;
            background: white;
            border-radius: 6px;
            font-weight: 600;
        }

        .photo-controls-bar {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 10px;
            background: white;
            border-top: 1px solid #e5e7eb;
        }

        .qty-btn {
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 4px;
            background: #667eea;
            color: white;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .qty-btn:hover {
            background: #5568d3;
        }

        .qty-value {
            min-width: 30px;
            text-align: center;
            font-size: 14px;
        }

        .btn-remove-photo {
            position: absolute;
            top: 5px;
            left: 5px;
            background: rgba(239, 68, 68, 0.95);
            color: white;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .btn-remove-photo:hover {
            background: #dc2626;
            transform: scale(1.1);
        }

        .orientation-badge {
            position: absolute;
            bottom: 5px;
            left: 5px;
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
        }

        .confirm-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #f59e0b;
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .valid-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #10b981;
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .photo-count-badge {
            position: absolute;
            bottom: 5px;
            right: 5px;
            background: rgba(102, 126, 234, 0.95);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 700;
        }

        /* ============================================
           VALIDATION SUMMARY
           ============================================ */
        .validation-summary {
            background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 10px;
    margin-top: 15px;
        }

        .validation-header {
            display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 7px;
        }

        .validation-header i {
            font-size: 24px;
            color: #f59e0b;
        }

        .validation-list {
            padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 7px;
        }

        .validation-count {
            font-size: 16px;
            color: #78350f;
        }

        .validation-count strong {
            color: #f59e0b;
            font-size: 20px;
        }

        .btn-confirm-all {
            width: 100%;
            background: #10b981;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s;
        }

        .btn-confirm-all:hover {
            background: #059669;
            transform: translateY(-2px);
        }

        /* ============================================
           PHOTO EDITOR MODAL
           ============================================ */
        .photo-editor-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 20px;
            overflow-y: auto;
        }

        .photo-editor-modal.active {
            display: flex;
        }

        .photo-editor-content {
            background: white;
            border-radius: 16px;
            max-width: 900px;
            width: 100%;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
        }

        .editor-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px;
            border-bottom: 2px solid #e5e7eb;
        }

        .editor-header h3 {
            color: #1f2937;
            font-size: 22px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .btn-close-editor {
            background: none;
            border: none;
            font-size: 28px;
            color: #6b7280;
            cursor: pointer;
            padding: 5px;
            transition: all 0.3s;
        }

        .btn-close-editor:hover {
            color: #ef4444;
            transform: rotate(90deg);
        }

        .editor-body {
            padding: 25px;
            overflow-y: auto;
            flex: 1;
        }

        .editor-info {
            background: #f8fafc;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .editor-info .info-row {
            display: flex;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid #e5e7eb;
        }

        .editor-info .info-row:last-child {
            border-bottom: none;
            padding-top: 15px;
            margin-top: 10px;
            border-top: 2px solid #e5e7eb;
        }

        .editor-info .info-row.warning {
            background: #fef3c7;
            padding: 12px;
            border-radius: 6px;
            color: #92400e;
        }

        .editor-info .info-row.success {
            background: #d1fae5;
            padding: 12px;
            border-radius: 6px;
            color: #065f46;
        }

        .editor-canvas-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            background: #f1f5f9;
            border-radius: 10px;
        }

        .canvas-guideline {
            position: relative;
            border: 4px solid #3b82f6;
            background: repeating-linear-gradient(
                45deg,
                #e0e7ff,
                #e0e7ff 10px,
                #dbeafe 10px,
                #dbeafe 20px
            );
            box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
            overflow: hidden;
            margin-bottom: 15px;
        }

        .guideline-label {
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(59, 130, 246, 0.95);
            color: white;
            padding: 8px 15px;
            border-radius: 6px;
            font-weight: 700;
            font-size: 14px;
            z-index: 10;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }

        .canvas-guideline img {
            max-width: none;
            max-height: none;
            user-select: none;
            cursor: grab;
        }

        .canvas-guideline img:active {
            cursor: grabbing !important;
        }

        .canvas-hint {
            color: #64748b;
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .canvas-hint i {
            color: #3b82f6;
            font-size: 18px;
        }

        .editor-footer {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            padding: 20px 25px;
            border-top: 2px solid #e5e7eb;
        }

        .editor-footer .btn-secondary {
            background: #6b7280;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .editor-footer .btn-secondary:hover {
            background: #4b5563;
        }

        .editor-footer .btn-primary {
            background: #10b981;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .editor-footer .btn-primary:hover {
            background: #059669;
            transform: translateY(-2px);
        }

        /* ============================================
           BUTTONS
           ============================================ */
        @keyframes pulse-purple {
            0%   { box-shadow: 0 0 0 0 rgba(225,0,255,0.7); }
            70%  { box-shadow: 0 0 0 14px rgba(127,0,255,0); }
            100% { box-shadow: 0 0 0 0 rgba(127,0,255,0); }
        }
        @keyframes border-run {
            0%   { background-position: 0% 50%; }
            50%  { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        @keyframes bounce-icon {
            0%,100% { transform: translateY(0); }
            50%     { transform: translateY(-4px); }
        }
        .btn-add-size {
            width: 100%;
            background: linear-gradient(270deg, #E100FF, #7F00FF, #E100FF);
            background-size: 300% 300%;
            color: #fff;
            border: none;
            padding: 15px;
            border-radius: 10px;
            font-size: 18px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            animation: pulse-purple 2s infinite, border-run 3s ease infinite;
        }
        .btn-add-size i {
            animation: bounce-icon 1.5s ease-in-out infinite;
        }
        .btn-add-size:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(127,0,255,0.6);
            animation: border-run 1s ease infinite;
        }

        .btn-submit {
            width: 100%;
            background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
            color: white;
            border: none;
            padding: 18px;
            border-radius: 12px;
            font-size: 20px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .btn-submit:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(251, 191, 36, 0.4);
        }

        .btn-submit:disabled {
            background: #9ca3af;
            cursor: not-allowed;
        }

        /* ============================================
           AGREEMENT SECTION
           ============================================ */
        .agreement-section {
            background: #fff7ed;
            border: 2px solid #fb923c;
            border-radius: 12px;
            padding: 20px;
            margin: 20px 0;
        }

        .checkbox-group {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 15px;
        }

        .checkbox-group input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            margin-top: 2px;
        }

        .checkbox-group label {
            font-size: 15px;
            cursor: pointer;
            line-height: 1.5;
        }

        /* ============================================
           PROGRESS & MODALS
           ============================================ */
        .upload-progress {
            display: none;
            margin-top: 20px;
        }

        .upload-progress.active {
            display: block;
        }

        /* Channel radio buttons */
        .channel-radio-group {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .channel-radio-btn {
            cursor: pointer;
            flex: 1;
            min-width: 85px;
        }
        @media (max-width: 600px) {
            .channel-radio-group {
                display: grid !important;
                grid-template-columns: repeat(4, 1fr) !important;
                gap: 6px;
                width: 100%;
                box-sizing: border-box;
            }
            .channel-radio-btn { min-width: 0 !important; flex: unset !important; width: 100%; box-sizing: border-box; overflow: hidden; }
            .channel-radio-inner { padding: 7px 4px; font-size: 10px; width: 100%; box-sizing: border-box; overflow: hidden; }
            .channel-radio-inner img { width: 44px !important; height: 28px !important; }
        }
        .channel-radio-btn {
            cursor: pointer;
            flex: 1;
            min-width: 85px;
        }
        .channel-radio-btn input[type="radio"] {
            display: none;
        }
        .channel-radio-inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding: 10px 8px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            background: #f9fafb;
            font-size: 12px;
            font-weight: 600;
            color: #555;
            transition: all 0.15s;
            user-select: none;
        }
        .channel-radio-btn:hover .channel-radio-inner {
            border-color: #764ba2;
            background: #f5f0ff;
        }
        .channel-radio-btn input:checked + .channel-radio-inner {
            border-color: #764ba2;
            background: linear-gradient(135deg, #f0e6ff, #ede0ff);
            color: #5b21b6;
            box-shadow: 0 2px 8px rgba(118,75,162,0.2);
        }
        .ch-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 800;
            color: #fff;
        }
        .shopee-icon  { background: #ee5522; }
        .tiktok-icon  { background: #010101; }
        .line-icon    { background: #06c755; }
        .lazada-icon  { background: #0f3eb5; }

        /* Upload lock overlay */
        #uploadLockOverlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99999;
            background: rgba(10, 5, 30, 0.75);
            backdrop-filter: blur(3px);
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 20px;
        }
        #uploadLockOverlay.active {
            display: flex;
        }
        .overlay-box {
            background: #fff;
            border-radius: 20px;
            padding: 32px 40px;
            text-align: center;
            max-width: 360px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }
        .overlay-title {
            font-size: 16px;
            font-weight: 700;
            color: #1a1a2e;
            margin-bottom: 6px;
        }
        .overlay-sub {
            font-size: 15px;
            font-weight: 700;
            color: #dc2626;
            margin-bottom: 18px;
            padding: 8px 12px;
            background: #fef2f2;
            border-radius: 8px;
            border: 1px solid #fca5a5;
        }
        .overlay-progress-wrap {
            width: 100%;
            height: 12px;
            background: #e5e7eb;
            border-radius: 99px;
            overflow: hidden;
            margin-bottom: 10px;
        }
        .overlay-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 99px;
            transition: width 0.3s ease;
            width: 0%;
        }
        .overlay-pct {
            font-size: 13px;
            font-weight: 800;
            color: #764ba2;
            font-family: monospace;
        }
        .overlay-status {
            font-size: 13px;
            color: #444;
            margin-top: 8px;
            font-weight: 500;
        }

        .progress-bar-container {
            width: 100%;
            height: 30px;
            background: #e5e7eb;
            border-radius: 15px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            transition: width 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 14px;
        }

        .upload-status {
            text-align: center;
            color: #374151;
            font-weight: 600;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 16px;
            max-width: 500px;
            width: 100%;
            text-align: center;
        }

        .modal-icon {
            font-size: 60px;
            margin-bottom: 20px;
        }

        .modal-icon.success {
            color: #10b981;
        }

        .modal-icon.error {
            color: #ef4444;
        }

        .modal-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .modal-message {
            font-size: 16px;
            color: #666;
            margin-bottom: 20px;
        }

        .btn-modal {
            background: #667eea;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
        }

        .btn-modal:hover {
            background: #5568d3;
        }

        /* ============================================
           MISC
           ============================================ */
        .max-upload-warning {
            background: #fef3c7;
            border: 2px solid #fbbf24;
            color: #92400e;
            padding: 10px;
            border-radius: 8px;
            margin-top: 10px;
            font-size: 14px;
            text-align: center;
            font-weight: 600;
        }

        .auth-required {
    background: #f3fff9;
    border: 2px solid #00cc71;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

        .auth-required h2 {
            color: #000;
            margin-bottom: 15px;
        }

        .auth-required p {
            color: #666;
            margin-bottom: 20px;
        }

        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255,255,255,0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s linear infinite;
        }

        /* ============================================
           ANIMATIONS
           ============================================ */
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }

        .photo-item-enhanced.needs-validation:hover {
            animation: shake 0.5s;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

        .validation-overlay {
            animation: pulse 2s infinite;
        }

        /* ============================================
           MOBILE RESPONSIVE
           ============================================ */

        /* Define nav/bottom heights used in auth-wrapper calc */
        :root {
            --nav-height: 56px;
            --mobile-bottom-height: 60px;
        }
        .auth-wrapper {
                margin-top: 50px !important;
        }

        @media (max-width: 768px) {
            html, body{
                padding: 8px !important;
            }
            
            /* Logged-in state: push content below fixed nav */
            .auth-wrapper {
                margin-top: 5px !important;       
                padding-top: var(--nav-height);
                padding-bottom: var(--nav-height);
            }

            /* Login (not-authenticated) state: fill viewport, center card */
            .auth-wrapper:has(.auth-required) {
                min-height: -webkit-fill-available;
                min-height: 100svh;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                padding-top: 0;
            }
            /* Fallback for browsers without :has() support */
            .auth-wrapper.not-logged-in {
                min-height: -webkit-fill-available;
                min-height: 100svh;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                padding-top: 0;
            }
            /* Hide spacepage spacer when not logged in (it pushes login card down) */
            .not-logged-in .spacepage {
                display: none;
            }
            /* Hide nav and bottom bar when not logged in */
            body:has(.not-logged-in) .mobile-bottom-nav,
            body:has(.not-logged-in) .top-navbar,
            body:has(.not-logged-in) nav {
                display: none !important;
            }
            .auth-wrapper.not-logged-in {
                position: fixed;
                inset: 0;
                margin: 0 !important;
                padding: 20px !important;
                overflow: hidden;
                z-index: 999;
                background: #f3f4f6;
                display: flex !important;
                align-items: center;
                justify-content: center;
            }


            .header {
                flex-direction: column;
                align-items: flex-start;
            }

            .header-left h1 {
                font-size: 22px;
            }

            .header-right {
                width: 100%;
                justify-content: space-between;
                margin-top: 10px;
            }

            .nav-links {
                flex-direction: column;
                gap: 5px;
            }

            .card {
                padding: 15px;
            }

            .size-form-container {
                padding: 15px;
            }

            .photos-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 10px;
            }

            .photos-grid-enhanced {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
                gap: 15px;
            }

            .photo-preview {
                height: 100px;
            }

            .photo-preview-container {
                height: 150px;
            }

            .btn-submit {
                font-size: 18px;
                padding: 15px;
            }

            .photo-editor-content {
                max-width: 100%;
                max-height: 95vh;
            }

            .canvas-guideline {
                max-width: 100%;
                height: auto !important;
            }

            .canvas-guideline img {
                width: 100%;
                height: auto;
                position: relative !important;
                left: 0 !important;
                top: 0 !important;
            }

            .editor-footer {
                flex-direction: column;
            }

            .editor-footer button {
                width: 100%;
            }

            .preview-box {
                transform: scale(0.8);
            }
