        body {
            overflow: hidden;
        }

        .pixel-cell {
            cursor: inherit;
        }

        .cursor-draw {
            cursor: crosshair;
        }

        .cursor-erase {
            cursor: crosshair;
        }

        .cursor-fill {
            cursor: crosshair;
        }

        .cursor-line {
            cursor: url('icons/cursor/line-cursor.svg'), crosshair;
        }

        .cursor-rectangle {
            cursor: url('icons/cursor/rectangle-cursor.svg'), crosshair;
        }

        .cursor-ellipse {
            cursor: url('icons/cursor/ellipse-cursor.svg'), crosshair;
        }

        .cursor-move {
            cursor: move;
        }

        .cursor-add-image {
            cursor: crosshair;
        }

        .cursor-zoom-in {
            cursor: url('icons/cursor/zoom-in-cursor.svg'), zoom-in;
        }

        .cursor-zoom-out {
            cursor: url('icons/cursor/zoom-out-cursor.svg'), zoom-out;
        }

        /* Transparency checkerboard pattern */
        .checkerboard-bg {
            background-image:
                linear-gradient(45deg, #ccc 25%, transparent 25%),
                linear-gradient(-45deg, #ccc 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #ccc 75%),
                linear-gradient(-45deg, transparent 75%, #ccc 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        }

        .dark .checkerboard-bg {
            background-image:
                linear-gradient(45deg, #444 25%, transparent 25%),
                linear-gradient(-45deg, #444 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #444 75%),
                linear-gradient(-45deg, transparent 75%, #444 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        }

        /* Shape tool dropdown styles */
        .shape-tool-group {
            position: relative;
        }

        .shape-tool-dropdown {
            position: absolute;
            left: 68px;
            top: 0;
            background-color: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            padding: 4px;
            opacity: 0;
            visibility: hidden;
            flex-direction: column;
            gap: 4px;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 48px;
            transition: opacity 0.15s ease, visibility 0.15s ease;
            pointer-events: none;
        }

        .dark .shape-tool-dropdown {
            background-color: rgba(45, 45, 45, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .shape-tool-dropdown.open {
            opacity: 1;
            visibility: visible;
            display: flex;
            pointer-events: auto;
        }

        .shape-tool-dropdown-item {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            background-color: transparent;
            border: none;
            color: #404040;
        }

        .dark .shape-tool-dropdown-item {
            color: #ffffff;
        }

        .shape-tool-dropdown-item:hover {
            background-color: rgba(0, 0, 0, 0.08);
        }

        .dark .shape-tool-dropdown-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .shape-tool-dropdown-item.active {
            background-color: rgba(139, 92, 246, 0.15);
        }

        .dark .shape-tool-dropdown-item.active {
            background-color: rgba(139, 92, 246, 0.25);
        }

        .tool-dropdown-indicator {
            position: absolute;
            bottom: 2px;
            right: 2px;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            border-radius: 50%;
            transition: background-color 0.2s;
        }

        .tool-dropdown-indicator:hover {
            background-color: rgba(139, 92, 246, 0.2);
        }

        .dark .tool-dropdown-indicator:hover {
            background-color: rgba(0, 0, 0, 0.2);
        }

        .draw-context-menu {
            position: absolute;
            width: 320px;
            background-color: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            padding: 12px;
            z-index: 1200;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        }

        .draw-context-menu.dark {
            background-color: rgba(45, 45, 45, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        }

        .draw-context-menu-title {
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 10px;
            color: #4b5563;
        }

        .draw-context-menu-title.dark {
            color: #d4d4d8;
        }

        .draw-context-menu-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .draw-context-menu-label {
            font-size: 12px;
            color: #4b5563;
        }

        .draw-context-menu-label.dark {
            color: #d4d4d8;
        }

        .draw-context-menu-control {
            margin-bottom: 10px;
        }

        .draw-context-menu-control:last-child {
            margin-bottom: 0;
        }

        /* Removed hover transform for performance */

        .slider::-webkit-slider-track {
            background: transparent;
            border: none;
            height: 8px;
        }

        .slider::-moz-range-track {
            background: transparent;
            border: none;
            height: 8px;
        }

        .slider::-webkit-slider-thumb {
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #8b5cf6;
            cursor: pointer;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: all 0.2s ease;
        }

        .slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        }

        .slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #8b5cf6;
            cursor: pointer;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .progress-slider-container {
            position: relative;
            height: 8px;
            border-radius: 4px;
        }

        .progress-slider-track {
            width: 100%;
            height: 100%;
            border-radius: 4px;
            position: absolute;
            top: 0;
            left: 0;
        }

        .progress-slider-fill {
            height: 100%;
            background: #8b5cf6;
            border-radius: 4px;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
        }

        .progress-slider-input {
            position: absolute;
            top: -6px;
            left: 0;
            width: 100%;
            height: 20px;
            background: transparent;
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            z-index: 2;
            pointer-events: auto;
        }

        .progress-slider-input::-webkit-slider-track {
            background: transparent;
            border: none;
        }

        .progress-slider-input::-moz-range-track {
            background: transparent;
            border: none;
        }

        /* Custom color swatch and hex input to match size and style */
        .color-input {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            border-radius: 0.5rem;
            /* rounded-lg */
            padding: 0;
            width: 3rem;
            /* w-12 - square size */
            height: 3rem;
            /* h-12 - square size */
            min-width: 3rem;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            background: transparent;
            cursor: pointer;
            box-sizing: border-box;
        }

        .color-input::-webkit-color-swatch-wrapper {
            padding: 0;
            border-radius: 0.5rem;
        }

        .color-input::-webkit-color-swatch {
            border: none;
            border-radius: 0.375rem;
            /* Slightly smaller to account for border */
        }

        .color-input::-moz-color-swatch {
            border: none;
            border-radius: 0.375rem;
            /* Slightly smaller to account for border */
        }

        .color-input:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        }

        .color-input:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.45);
        }

        .hex-input {
            min-width: 8rem;
            /* w-32 */
            height: 3rem;
            /* h-12 */
            border-radius: 0.5rem;
            /* rounded-lg - matches color-input */
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            max-width: 100%;
            box-sizing: border-box;
        }

        .hex-input:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
        }

        .hex-input:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.45);
        }

        /* Custom scrollbar styles for sidebar */
        .sidebar-scroll {
            scrollbar-width: thin;
            scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
        }

        .sidebar-scroll::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar-scroll::-webkit-scrollbar-track {
            background: transparent;
        }

        .sidebar-scroll::-webkit-scrollbar-thumb {
            background-color: rgba(156, 163, 175, 0.5);
            border-radius: 3px;
            transition: background-color 0.2s ease;
        }

        .sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background-color: rgba(156, 163, 175, 0.8);
        }

        /* Dark theme scrollbar */
        .dark .sidebar-scroll {
            scrollbar-color: rgba(82, 82, 82, 0.5) transparent;
        }

        .dark .sidebar-scroll::-webkit-scrollbar-thumb {
            background-color: rgba(82, 82, 82, 0.5);
        }

        .dark .sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background-color: rgba(82, 82, 82, 0.8);
        }

        .sidebar-footer {
            position: relative;
        }

        .footer-link {
            position: relative;
            color: inherit;
            text-decoration: none;
            transition: color 250ms ease;
        }

        .footer-link::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: -2px;
            height: 1px;
            width: 100%;
            background-color: currentColor;
            transform: translateX(-50%) scaleX(0);
            transform-origin: center;
            transition: transform 250ms ease;
        }

        .footer-link:hover::after {
            transform: translateX(-50%) scaleX(1);
        }

        .footer-tooltip {
            position: absolute;
            left: 50%;
            bottom: calc(100% + 8px);
            transform: translateX(-50%) translateY(4px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 200ms ease, transform 200ms ease;
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 50;
            background-color: var(--tooltip-bg);
            color: var(--tooltip-text);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        }

        .footer-tooltip.visible {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
            pointer-events: auto;
        }

        .footer-tooltip::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-width: 6px;
            border-style: solid;
            border-color: var(--tooltip-bg) transparent transparent transparent;
        }

        :root {
            --tooltip-bg: rgba(255, 255, 255, 0.95);
            --tooltip-text: #111827;
        }

        .dark {
            --tooltip-bg: rgba(31, 41, 55, 0.95);
            --tooltip-text: #F9FAFB;
        }

        /* Modal animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(-20px);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                max-height: 0;
            }

            to {
                opacity: 1;
                max-height: 400px;
            }
        }

        .pro-feature-locked {
            position: relative;
        }

        .pro-feature-locked::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 1px solid rgba(245, 158, 11, 0.45);
            pointer-events: none;
        }

        .license-celebration {
            position: absolute;
            inset: -20px;
            pointer-events: none;
            opacity: 0;
        }

        .license-celebration.active {
            animation: licenseBurst 800ms ease-out;
        }

        @keyframes licenseBurst {
            0% {
                opacity: 0;
                transform: scale(0.9);
                box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.45);
            }

            30% {
                opacity: 1;
            }

            100% {
                opacity: 0;
                transform: scale(1.05);
                box-shadow: 0 0 0 36px rgba(139, 92, 246, 0);
            }
        }

        .toast-pop {
            animation: toastPop 220ms ease-out;
        }

        @keyframes toastPop {
            from {
                opacity: 0;
                transform: translateY(8px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Custom scrollbar for modal */
        .overflow-y-auto::-webkit-scrollbar {
            width: 8px;
        }

        .overflow-y-auto::-webkit-scrollbar-track {
            background: transparent;
        }

        .overflow-y-auto::-webkit-scrollbar-thumb {
            background-color: rgba(156, 163, 175, 0.5);
            border-radius: 4px;
        }

        .overflow-y-auto::-webkit-scrollbar-thumb:hover {
            background-color: rgba(156, 163, 175, 0.8);
        }

        .dark .overflow-y-auto::-webkit-scrollbar-thumb {
            background-color: rgba(82, 82, 82, 0.5);
        }

        .dark .overflow-y-auto::-webkit-scrollbar-thumb:hover {
            background-color: rgba(82, 82, 82, 0.8);
        }

        .app-loader {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            background: #ffffff;
            transition: opacity 250ms ease;
        }

        .dark .app-loader {
            background: #171717;
        }

        .app-loader-content {
            display: flex;
            align-items: center;
            gap: 14px;
            color: #111827;
        }

        .dark .app-loader-content {
            color: #F9FAFB;
        }

        .app-spinner {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 3px solid rgba(139, 92, 246, 0.2);
            border-top-color: #8b5cf6;
            animation: spin 800ms linear infinite;
        }

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

        .app-loader.fade-out {
            opacity: 0;
        }

        .app-loader.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
