    :root {
        --glass-bg: rgba(30, 41, 59, 0.7);
        --glass-border: rgba(255, 255, 255, 0.08);
        --glass-blur: blur(12px);
        --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
        --text-main: #f8fafc;
        --text-muted: #ffffff;
    }

    .tool-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px 20px;
        font-family: 'Inter', system-ui, sans-serif;
    }

    .tool-header {
        text-align: center;
        margin-bottom: 32px;
    }

    .tool-header h1,
    .tool-header h2 {
        font-size: 2.5rem;
        font-weight: 800;
        background: linear-gradient(to right, #fff, #ffffff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 12px;
    }

    .tool-header p {
        color: #ffffff;
        font-size: 1.1rem;
    }

    .premium-notice {
        display: block;
        clear: both;
        background: transparent !important;
        border: 1px solid #ffffff !important;
        border-radius: 12px;
        padding: 12px;
        margin-top: 16px;
        margin-bottom: 24px;
        text-align: center;
        color: #ffffff !important;
    }

    .premium-notice strong {
        color: #ffffff !important;
    }

    .premium-notice a {
        color: #ffffff !important;
        font-weight: 700;
        text-decoration: underline;
    }

    .premium-notice a:hover {
        color: #ffffff !important;
        opacity: 0.85;
    }

    .tool-workspace,
    .control-group,
    .upload-area,
    .file-queue-container {
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: 2px dotted #ffffff !important;
        border-radius: 20px;
    }

    /* Specs Banner */
    .specs-banner {
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 30px;
    }

    .spec-badge {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        padding: 10px 20px;
        border-radius: 12px;
        text-align: center;
        backdrop-filter: blur(4px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .spec-val {
        font-weight: 700;
        color: white;
        font-size: 1rem;
    }

    .spec-label {
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Upload Area */
    .upload-area {
        padding: 60px 20px;
        text-align: center;
        transition: all 0.3s;
        cursor: pointer;
        margin-bottom: 30px;
        min-height: 200px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .upload-area:hover,
    .upload-area.dragover {
        border-color: rgba(255, 255, 255, 0.9) !important;
        background: rgba(255, 255, 255, 0.02) !important;
        transform: translateY(-2px);
        box-shadow: none;
    }

    .upload-icon {
        font-size: 64px;
        margin-bottom: 20px;
        display: block;
        animation: float 3s ease-in-out infinite;
    }

    @keyframes float {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-8px);
        }
    }

    .upload-text {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-main);
        margin-bottom: 10px;
    }

    .upload-hint {
        color: #ffffff;
        font-size: 1rem;
    }

    .upload-input {
        display: none;
    }

    .upload-area[data-disabled="true"] {
        opacity: 0.6;
        cursor: not-allowed;
        border-color: #ef4444 !important;
    }

    /* Workspace */
    .workspace-grid {
        display: grid;
        gap: 24px;
        grid-template-columns: 1fr;
    }

    /* Preview Area */
    .preview-section {
        padding: 24px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 400px;
        position: relative;
    }

    .preview-grid {
        display: flex;
        gap: 40px;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .preview-card {
        text-align: center;
    }

    .preview-label {
        margin-bottom: 12px;
        color: var(--text-muted);
        font-size: 0.9rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .img-wrapper {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        border: 4px solid #fff;
        background: #fff;
        line-height: 0;
    }

    #originalPreview {
        max-height: 200px;
        max-width: 100%;
        object-fit: contain;
    }

    #resultCanvas {
        width: 132px;
        height: 170px;
    }

    /* Visual size matches logic size */

    .arrow-divider {
        font-size: 2rem;
        color: #ffffff;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Controls */
    .controls-column {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .control-label {
        color: var(--text-muted);
        font-size: 0.85rem;
        margin-bottom: 8px;
        font-weight: 600;
        display: block;
    }

    /* Color Options */
    .color-options {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .color-option {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid rgba(255, 255, 255, 0.1);
        transition: transform 0.2s;
    }

    .color-option.active {
        border-color: white;
        transform: scale(1.15);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .custom-color-wrapper {
        position: relative;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .custom-color-input {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        border: none;
        background: transparent;
        border-radius: 50%;
        padding: 0;
        z-index: 10;
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .custom-color-input::-webkit-color-swatch-wrapper {
        padding: 2px;
    }

    .custom-color-input::-webkit-color-swatch {
        border: none;
        border-radius: 50%;
    }

    .custom-color-input::-moz-color-swatch {
        border: none;
        border-radius: 50%;
    }

    /* Blue Add Button */
    .btn-add-more {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white !important;
        font-weight: 700;
        padding: 8px 16px;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.2s;
    }

    .btn-add-more:hover {
        transform: translateY(-2px);
        box-shadow: none;
    }

    /* Size Presets */
    .size-presets {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .size-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        padding: 10px;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        transition: all 0.2s;
    }

    .size-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .size-btn.active {
        background: rgba(59, 130, 246, 0.2);
        border-color: #3b82f6;
        color: white;
    }

    .size-val {
        font-size: 0.75rem;
        opacity: 0.7;
    }

    .btn-primary:disabled {
        opacity: 0.6;
    }

    /* File Queue */
    .queue-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
        max-height: 200px;
        overflow-y: auto;
        padding: 10px;
        background: transparent;
        border-radius: 12px;
        border: 2px dotted #ffffff;
    }

    .queue-item {
        aspect-ratio: 1;
        border-radius: 8px;
        overflow: visible !important;
        border: 2px solid transparent;
        background: #0f172a;
        cursor: pointer;
        position: relative !important;
    }

    .queue-item.active {
        border-color: #3b82f6;
    }

    .queue-item.completed {
        border-color: #10b981;
    }

    .queue-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 6px;
        /* Apply radius to image since parent is visible */
    }

    /* Actions */
    .action-btn {
        width: 100%;
        padding: 16px;
        border-radius: 12px;
        border: none;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 1rem;
        transition: all 0.2s;
    }

    .btn-primary {
        background: var(--accent-gradient);
        color: white;
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
    }

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: none;
    }

    .btn-secondary {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        color: #ffffff;
    }

    .btn-secondary:hover {
        background: rgba(59, 130, 246, 0.2);
        border-color: #3b82f6;
        color: white;
        transform: translateY(-2px);
    }

    #btnDownloadSingle {
        background: var(--accent-gradient);
        color: white;
        border: none;
        opacity: 1;
    }

    #btnDownloadSingle:hover {
        transform: none;
        box-shadow: none;
        opacity: 1;
    }

    #btnDownloadSingle:disabled {
        background: rgba(59, 130, 246, 0.3);
        cursor: not-allowed;
        opacity: 0.7;
    }

    /* Loading */
    .loading-overlay {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.9);
        z-index: 10;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 20px;
    }

    .spinner {
        font-size: 40px;
        animation: spin 1s linear infinite;
        margin-bottom: 20px;
        display: block;
    }

    @keyframes spin {
        100% {
            transform: rotate(360deg);
        }
    }

    .progress-bar {
        width: 200px;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
    }

    .progress-fill {
        height: 100%;
        background: #3b82f6;
        width: 0%;
        transition: width 0.3s;
    }

    /* Queue Position Info */
    .queue-position-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 16px;
        padding: 14px 24px;
        background: rgba(59, 130, 246, 0.1);
        border: 1px solid rgba(59, 130, 246, 0.25);
        border-radius: 12px;
        backdrop-filter: blur(8px);
        animation: queueFadeIn 0.4s ease-out;
    }

    @keyframes queueFadeIn {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .queue-position-icon {
        font-size: 24px;
        line-height: 1;
    }

    .queue-position-text {
        color: #93c5fd;
        font-size: 0.9rem;
        font-weight: 600;
        text-align: center;
    }

    .queue-position-text span {
        color: #60a5fa;
        font-size: 1.4rem;
        font-weight: 800;
    
        animation: queueCountPulse 2s ease-in-out infinite;
    }

    @keyframes queueCountPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7;  }
    }

    .queue-position-dots {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .queue-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #60a5fa;
        animation: queueDotBounce 1.4s ease-in-out infinite;
    }

    .queue-dot:nth-child(2) { animation-delay: 0.2s; }
    .queue-dot:nth-child(3) { animation-delay: 0.4s; }

    @keyframes queueDotBounce {
        0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
        40% { opacity: 1; transform: scale(1.2); }
    }

    @media (min-width: 900px) {
        .workspace-grid {
            grid-template-columns: 1fr 340px;
            align-items: start;
        }

        .controls-column {
            order: 2;
        }

        .preview-section {
            min-height: 600px;
            order: 1;
        }
    }

    @media (max-width: 600px) {
        .tool-container {
            padding: 20px 10px;
        }

        .tool-header h1 {
            font-size: 1.8rem;
        }

        .upload-area {
            padding: 40px 20px;
            min-height: 160px;
        }

        .preview-grid {
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .arrow-divider {
            transform: rotate(90deg);
            margin: 10px 0;
        }

        .controls-column {
            gap: 16px;
        }
    }

    /* Remove Button */
    .queue-remove-btn {
        position: absolute;
        top: -10px;
        right: -10px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        width: 26px;
        height: 26px;
        font-size: 16px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        border: 2px solid #1e293b;
        z-index: 100;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .queue-item:hover .queue-remove-btn {
        opacity: 1;
    }

    /* Mobile always show */
    @media (max-width: 768px) {
        .queue-remove-btn {
            opacity: 1 !important;
        }
    }