        :root {
            --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            --glass-bg: rgba(255, 255, 255, 0.7);
            --glass-border: rgba(255, 255, 255, 0.5);
            --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
            --surface-color: #f8fafc;
        }

        body {
            font-family: 'Inter', 'Noto Sans Thai', sans-serif;
            background-color: #f3f4f6;
            background-image:
                radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
                radial-gradient(at 0% 100%, rgba(34, 211, 238, 0.15) 0px, transparent 50%);
            background-attachment: fixed;
            color: #1e293b;
            -webkit-font-smoothing: antialiased;
            min-height: 100dvh;
        }

        body.modal-open {
            overflow: hidden;
        }

        main,
        #notification-container {
            transition: filter 0.3s ease;
        }

        body.modal-open main,
        body.modal-open #notification-container {
            filter: blur(8px);
        }

        body.modal-open #bottom-nav {
            pointer-events: none;
        }

        /* Glassmorphism Card */
        .card {
            background: var(--glass-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--glass-border);
            box-shadow: var(--glass-shadow);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
        }

        /* Form Elements */
        .form-select,
        .form-input {
            background-color: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(203, 213, 225, 0.6);
            transition: all 0.2s ease;
        }

        .form-select:focus,
        .form-input:focus {
            background-color: #ffffff;
            border-color: #8b5cf6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
            outline: none;
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: none;
            }
        }

        @keyframes fadeOutDown {
            from {
                opacity: 1;
                transform: translateY(0);
            }

            to {
                opacity: 0;
                transform: translateY(20px);
            }
        }

        .animate-fadeInUp {
            animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        .animate-fadeOutDown {
            animation: fadeOutDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.5);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.8);
        }

        /* Preview Box */
        .preview-bg {
            background-image:
                linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        }

        #preview-box {
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Collapsible Panel */
        .collapsible-panel summary {
            list-style: none;
            cursor: pointer;
        }

        .collapsible-panel summary::-webkit-details-marker {
            display: none;
        }

        .collapsible-body {
            max-height: 0;
            opacity: 0;
            overflow: hidden;
            transition: max-height 0.4s ease, opacity 0.3s ease;
        }

        .collapsible-panel[open] .collapsible-body {
            opacity: 1;
        }

        /* Helper Icons */
        .helper-icon-wrapper {
            position: relative;
            display: inline-flex;
            align-items: center;
            margin-left: 0.5rem;
            gap: 0.25rem;
            overflow: visible;
        }

        .hint-icon {
            width: 1.25rem;
            height: 1.25rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(139, 92, 246, 0.1);
            color: #8b5cf6;
            transition: all 0.2s;
        }

        .hint-icon:hover {
            background: rgba(139, 92, 246, 0.2);
            transform: scale(1.1);
        }

        .hint-icon:focus-visible {
            outline: 2px solid rgba(59, 130, 246, 0.6);
            outline-offset: 2px;
        }

        .helper-icon-wrapper .tooltip-text {
            position: absolute;
            top: calc(100% + 0.45rem);
            left: 50%;
            min-width: 12rem;
            max-width: 16rem;
            padding: 0.5rem 0.75rem;
            background: #0f172a;
            color: #f8fafc;
            font-size: 0.75rem;
            border-radius: 0.75rem;
            line-height: 1.4;
            box-shadow: 0 15px 30px rgba(15, 23, 42, 0.35);
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, -6px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            z-index: 400;
            text-align: left;
            white-space: normal;
        }

        .helper-icon-wrapper .tooltip-text::after {
            content: '';
            position: absolute;
            top: -6px;
            left: 50%;
            border-width: 6px;
            border-style: solid;
            border-color: transparent transparent #0f172a transparent;
            filter: drop-shadow(0 -1px 1px rgba(15, 23, 42, 0.3));
            transform: translateX(-50%);
        }

        .helper-icon-wrapper:hover .tooltip-text,
        .helper-icon-wrapper:focus-within .tooltip-text {
            opacity: 1;
            transform: translateY(0);
        }

        /* Template Cards */
        .section-hero {
            position: relative;
            overflow: hidden;
            padding: clamp(1.5rem, 4vw, 2.25rem);
            border: 1px solid rgba(255, 255, 255, 0.55);
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12)),
                radial-gradient(circle at 25% 20%, rgba(59, 130, 246, 0.2), transparent 45%),
                rgba(255, 255, 255, 0.8);
        }

        .section-hero__content {
            position: relative;
            z-index: 1;
            display: grid;
            gap: 0.5rem;
        }

        .section-hero__eyebrow {
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 700;
            color: #6366f1;
            font-size: 0.75rem;
        }

        .section-hero__title {
            font-size: clamp(1.25rem, 2vw, 1.6rem);
            font-weight: 800;
            color: #0f172a;
            letter-spacing: -0.01em;
        }

        .section-hero__copy {
            color: #475569;
            line-height: 1.6;
            max-width: 56ch;
        }

        .section-hero__actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
            margin-top: 0.5rem;
        }

        .section-hero__stat {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background: rgba(99, 102, 241, 0.08);
            color: #4338ca;
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: 999px;
            padding: 0.5rem 0.9rem;
            font-weight: 700;
            font-size: 0.85rem;
        }

        .template-hero::after,
        .gallery-hero::after {
            content: '';
            position: absolute;
            inset: -20% 40% auto auto;
            width: 320px;
            height: 320px;
            background: radial-gradient(circle, rgba(244, 114, 182, 0.16), transparent 55%);
            z-index: 0;
        }

        .pill-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            border-radius: 999px;
            padding: 0.65rem 1.1rem;
            font-weight: 700;
            font-size: 0.95rem;
            border: 1px solid rgba(99, 102, 241, 0.3);
            background: rgba(99, 102, 241, 0.1);
            color: #4338ca;
            transition: all 0.2s ease;
        }

        .pill-button--primary {
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff;
            border: none;
            box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
        }

        .pill-button--ghost {
            background: rgba(255, 255, 255, 0.72);
            border: 1px solid rgba(148, 163, 184, 0.6);
            color: #0f172a;
        }

        .pill-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 12px 24px rgba(99, 102, 241, 0.18);
        }

        .template-card {
            position: relative;
            display: flex;
            flex-direction: column;
            height: 100%;
            cursor: pointer;
            overflow: hidden;
        }

        .template-image-wrapper {
            position: relative;
            border-radius: 0.75rem;
            overflow: hidden;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        .template-image-wrapper img {
            width: 100%;
            transition: transform 0.5s ease;
        }

        .template-card:hover .template-image-wrapper img {
            transform: scale(1.05);
        }

        .template-tags {
            position: absolute;
            top: 0.75rem;
            left: 0.75rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        .template-tag {
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(4px);
            color: #f8fafc;
            font-size: 0.65rem;
            padding: 0.2rem 0.6rem;
            border-radius: 999px;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .template-recommended {
            position: absolute;
            top: 0.75rem;
            right: 0.75rem;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: #fff;
            font-size: 0.7rem;
            padding: 0.25rem 0.7rem;
            border-radius: 999px;
            font-weight: 700;
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
        }

        .template-cta {
            width: 100%;
            padding: 0.75rem;
            border-radius: 0.75rem;
            font-weight: 600;
            background: rgba(139, 92, 246, 0.1);
            color: #7c3aed;
            transition: all 0.2s;
            text-align: center;
        }

        .template-card:hover .template-cta {
            background: #7c3aed;
            color: #fff;
            box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
        }

        .template-grid-shell {
            border: 1px solid rgba(255, 255, 255, 0.55);
            background: rgba(255, 255, 255, 0.78);
        }

        .template-grid__eyebrow {
            font-weight: 700;
            color: #6366f1;
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.08em;
        }

        .template-grid__hint {
            color: #475569;
            margin-top: 0.2rem;
        }

        .template-card__footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            margin-top: auto;
        }

        .template-card__footer .template-cta {
            width: auto;
            white-space: nowrap;
        }

        .template-meta {
            display: flex;
            gap: 0.35rem;
            flex-wrap: wrap;
        }

        .template-meta__pill {
            padding: 0.35rem 0.65rem;
            border-radius: 999px;
            background: rgba(241, 245, 249, 0.8);
            color: #475569;
            font-weight: 600;
            font-size: 0.8rem;
        }

        /* Compact Toolbar */
        .compact-toolbar-container {
            padding: 0.5rem 0;
            margin: 0;
        }

        .compact-toolbar {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 0.5rem;
            padding: 0;
            min-width: 0;
        }

        .toolbar-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
            background: none;
            border: none;
            cursor: pointer;
            min-width: 0;
            width: 100%;
        }

        .toolbar-icon-wrapper {
            width: 3rem;
            height: 3rem;
            /* Slightly smaller for safe mobile fit */
            border-radius: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.6);
        }

        .toolbar-btn:hover .toolbar-icon-wrapper {
            transform: translateY(-4px) scale(1.05);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .toolbar-label {
            font-size: 0.65rem;
            font-weight: 600;
            color: #64748b;
            transition: color 0.2s;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .toolbar-btn:hover .toolbar-label {
            color: #1e293b;
        }

        /* Desktop adjustments */
        @media (min-width: 768px) {
            .compact-toolbar {
                gap: 1rem;
            }

            .toolbar-icon-wrapper {
                width: 3.5rem;
                height: 3.5rem;
                border-radius: 1rem;
            }

            .toolbar-btn {
                gap: 0.5rem;
            }

            .toolbar-label {
                font-size: 0.75rem;
            }
        }

        /* Desktop Settings Grid */
        .desktop-settings {
            display: none;
        }

        .desktop-settings.hidden {
            display: none;
        }

        .desktop-settings__grid {
            display: grid;
            gap: 1rem;
        }

        .desktop-panel {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            padding: 1.25rem;
            background: rgba(255, 255, 255, 0.75);
            border-radius: 1rem;
            border: 1px solid rgba(255, 255, 255, 0.6);
            box-shadow: var(--glass-shadow);
            height: 100%;
        }

        .desktop-panel__header {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }

        .desktop-panel__title {
            font-weight: 700;
            font-size: 1rem;
            color: #0f172a;
            letter-spacing: -0.01em;
        }

        .desktop-panel__hint {
            color: #64748b;
            font-size: 0.875rem;
            line-height: 1.4;
        }

        .desktop-panel .ios-list {
            margin-bottom: 0.75rem;
        }

        @media (min-width: 1024px) {
            .desktop-settings {
                display: block;
            }

            .desktop-settings__grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .desktop-panel--wide {
                grid-column: span 2;
            }
        }

        /* Apple Design System (Inset Grouped) */
        .ios-list {
            background: rgba(255, 255, 255, 0.5);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
        }

        .ios-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.4);
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            min-height: 48px;
            transition: background 0.2s;
        }

        .ios-row:last-child {
            border-bottom: none;
        }

        .ios-row:hover {
            background: rgba(255, 255, 255, 0.6);
        }

        .ios-label {
            font-size: 15px;
            font-weight: 500;
            color: #1c1c1e;
            flex-shrink: 0;
        }

        .ios-sublabel {
            font-size: 13px;
            color: #8e8e93;
            font-weight: 400;
            margin-left: 4px;
        }

        .ios-control {
            flex: 1;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-left: 16px;
            min-width: 0;
            /* Prevent overflow */
        }

        .ios-input {
            text-align: right;
            background: transparent;
            border: none;
            color: #3a3a3c;
            font-size: 15px;
            width: 100%;
            padding: 0;
            outline: none;
        }

        .ios-input:focus {
            color: #007aff;
        }

        .ios-select {
            appearance: none;
            background: transparent;
            border: none;
            color: #007aff;
            font-size: 15px;
            text-align: right;
            text-align-last: right;
            padding-right: 18px;
            cursor: pointer;
            outline: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23007aff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right center;
            background-size: 14px;
        }

        /* iOS Toggle Switch */
        .ios-toggle {
            appearance: none;
            width: 51px;
            height: 31px;
            background: #e9e9ea;
            border-radius: 15.5px;
            position: relative;
            cursor: pointer;
            transition: background 0.3s;
            flex-shrink: 0;
        }

        .ios-toggle::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 27px;
            height: 27px;
            background: white;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        }

        .ios-toggle:checked {
            background: #34c759;
        }

        .ios-toggle:checked::after {
            transform: translateX(20px);
        }

        /* iOS Slider */
        .ios-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 4px;
            background: #e5e5ea;
            border-radius: 2px;
            outline: none;
        }

        .ios-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            border: 0.5px solid rgba(0, 0, 0, 0.04);
        }

        /* Section Header */
        .ios-section-header {
            padding: 0 16px 8px;
            font-size: 13px;
            font-weight: 600;
            color: #6e6e73;
            text-transform: uppercase;
            letter-spacing: -0.01em;
        }

        /* Modals */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            width: 100vw;
            height: 100dvh;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(8px);
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
            padding: clamp(1rem, 3dvh, 2.25rem);
            overflow-y: auto;
        }

        .modal-backdrop[data-open="true"] {
            opacity: 1;
            pointer-events: auto;
        }

        .modal {
            background: #ffffff;
            border-radius: 1.5rem;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.1);
            width: min(420px, 95vw);
            max-height: min(88dvh, 640px);
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 0;
            overflow: hidden;
            transform: scale(0.95);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .modal-backdrop[data-open="true"] .modal {
            transform: scale(1);
        }

        .modal__header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .modal__header h3 {
            font-size: 1.25rem;
            font-weight: 700;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .modal__close {
            font-size: 1.5rem;
            line-height: 1;
            color: #94a3b8;
            transition: color 0.2s;
            padding: 0.25rem;
        }

        .modal__close:hover {
            color: #ef4444;
            background: #f1f5f9;
            border-radius: 0.5rem;
        }

        .modal__body {
            flex: 1;
            overflow-y: auto;
            margin: 0;
            min-height: 0;
            padding-right: 0.25rem;
            padding-bottom: 0.5rem;
        }

        .modal__footer {
            display: flex;
            justify-content: flex-end;
            padding-top: 0.5rem;
            border-top: 1px solid #f1f5f9;
            background: #ffffff;
        }

        .modal__done {
            background: #10b981;
            color: #fff;
            padding: 0.5rem 1.25rem;
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            transition: all 0.2s;
        }

        .modal__done:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        /* Mobile specific adjustments for modals */
        @media (max-width: 640px) {
            .modal {
                width: min(96vw, 480px);
                max-height: calc(100dvh - clamp(1.5rem, 5dvh, 3rem));
                padding: clamp(1rem, 3dvh, 1.5rem);
                border-radius: 1.25rem;
            }

            .modal__header h3 {
                font-size: 1.1rem;
            }
        }

        /* Bottom Nav */
        /* Color Wells (Apple Style) */
        input[type="color"] {
            -webkit-appearance: none;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            padding: 0;
            overflow: hidden;
            box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            background: none;
        }

        input[type="color"]::-webkit-color-swatch-wrapper {
            padding: 0;
        }

        input[type="color"]::-webkit-color-swatch {
            border: 2px solid #ffffff;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* Navigation Bar (iOS Tab Bar) */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 200;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            padding-bottom: env(safe-area-inset-bottom);
            height: calc(3.5rem + env(safe-area-inset-bottom));
        }

        .bottom-nav__items {
            display: flex;
            justify-content: space-around;
            align-items: center;
            max-width: 42rem;
            margin: 0 auto;
            height: 100%;
        }

        .bottom-nav__item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            font-size: 0.65rem;
            font-weight: 500;
            gap: 2px;
            height: 100%;
            background: none;
            border: none;
            cursor: pointer;
            transition: color 0.2s;
        }

        .bottom-nav__item svg {
            width: 24px;
            height: 24px;
            transition: transform 0.2s;
        }

        .bottom-nav__item--active {
            color: #2563eb;
            /* iOS Blue */
        }

        .bottom-nav__item:active svg {
            transform: scale(0.9);
        }

        .bottom-nav__indicator {
            display: none;
            /* Remove old indicator */
        }

        /* Utilities */
        .input-with-unit .input-unit {
            color: #94a3b8;
            font-weight: 500;
        }

        .section-hidden {
            display: none;
        }

        .pwa-view--hidden {
            display: none;
        }

        /* Responsive */
        @media (min-width: 768px) {
            .customizer-scroll {
                padding-right: 1rem;
            }
        }

        /* Library Cards */
        .library-card {
            display: flex;
            flex-direction: column;
            transition: all 0.3s ease;
        }

        .library-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.15);
        }

        .library-card__thumb {
            border-radius: 0.75rem;
            overflow: hidden;
            background: #f1f5f9;
            aspect-ratio: 16/9;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .library-card__thumb img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            transition: transform 0.5s ease;
            padding: 0.5rem;
        }

        .library-card:hover .library-card__thumb img {
            transform: scale(1.05);
        }

        .library-card__meta {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-top: 0.25rem;
        }

        .gallery-filters {
            border: 1px solid rgba(255, 255, 255, 0.6);
            background: rgba(255, 255, 255, 0.8);
        }

        .gallery-filters .form-input,
        .gallery-filters .form-select {
            background: rgba(255, 255, 255, 0.9);
        }

        #recent-badges-container,
        #all-badges-container {
            border: 1px solid rgba(255, 255, 255, 0.6);
            background: rgba(255, 255, 255, 0.86);
        }

        .library-card.card {
            border: 1px solid rgba(226, 232, 240, 0.9);
            background: rgba(255, 255, 255, 0.85);
        }

        .library-card__actions .pill-button {
            width: auto;
        }

        .library-action-button {
            padding: 0.4rem 0.8rem;
            border-radius: 0.5rem;
            font-size: 0.75rem;
            font-weight: 600;
            background: rgba(241, 245, 249, 0.8);
            color: #475569;
            transition: all 0.2s;
        }

        .library-action-button:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        .library-action-button--primary {
            background: rgba(124, 58, 237, 0.1);
            color: #7c3aed;
        }

        .library-action-button--primary:hover {
            background: #7c3aed;
            color: #fff;
        }
