        :root {
            --green: #1bd96a;
            --green-hover: #14b858;
            --bg: #0e1217;
            --card-bg: #161b22;
            --border: #30363d;
            --text: #fff;
            --text-muted: #a4b1cd;
            --header-bg: rgba(14, 18, 23, 0.765);
            --font: 'Inter', sans-serif;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background: var(--bg);
            color: var(--text);
            font-family: var(--font);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            user-select: none;
        }

        main {
            flex: 1;
        }

        header {
            position: fixed;
            top: 10px;
            left: 50%;
            transform: translateX(-50%);
            width: 99%;
            z-index: 1000;
            background: var(--header-bg);
            backdrop-filter: blur(12px);
            height: 62px;
            border-radius: 5px;
        }

        .header-container {
            max-width: 1400px;
            margin: 0 auto;
            height: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 24px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: var(--text);
            font-weight: 800;
            font-size: 1.1rem;
        }

        .logo img {
            width: 32px;
            height: 32px;
        }

        .nav-link {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-muted);
            text-decoration: none;
            font-size: .9rem;
            font-weight: 600;
            transition: color .2s;
        }

        .nav-link:hover {
            color: var(--text);
        }

        .nav-link svg {
            width: 16px;
            height: 16px;
        }

        .tabs-wrapper {
            display: flex;
            justify-content: center;
            padding-top: 100px;
            margin-bottom: 20px;
        }

        .tabs-container {
            padding: 6px;
            border-radius: 50px;
            display: inline-flex;
            gap: 4px;
            border: 1px solid var(--border);
            background: var(--card-bg);
        }

        .tab-item {
            padding: 10px 24px;
            border-radius: 50px;
            font-weight: 700;
            font-size: .95rem;
            cursor: pointer;
            transition: all .2s;
            color: var(--text);
            border: none;
            background: transparent;
        }

        .tab-item:hover:not(.active) {
            background: rgba(255, 255, 255, 0.05);
        }

        .tab-item.active {
            background: rgba(27, 217, 106, 0.15);
            color: var(--green);
        }

        .tab-content {
            display: none;
            animation: fade .2s ease;
        }

        .tab-content.active {
            display: block;
        }

        @keyframes fade {
            from {
                opacity: 0;
                transform: translateY(8px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .tab-placeholder {
            text-align: center;
            color: var(--text-muted);
            padding: 40px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
        }

        .tab-placeholder svg {
            width: 48px;
            height: 48px;
            color: var(--green);
            opacity: .5;
        }

        .tab-placeholder h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text);
        }

        .tab-placeholder p {
            font-size: 1rem;
            max-width: 420px;
            line-height: 1.6;
        }

        .search-area {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 0 20px;
            margin: 0 auto 50px;
            max-width: 900px;
        }

        .search-row {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .search-input-wrapper {
            flex: 1;
            position: relative;
        }

        .search-input,
        .avail-dropdown-btn {
            width: 100%;
            padding: 12px 18px 12px 44px;
            border-radius: 50px;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text);
            font-size: .95rem;
            font-family: var(--font);
            outline: none;
            transition: border-color .2s;
        }

        .search-input:focus {
            border-color: rgba(27, 217, 106, 0.5);
        }

        .search-input::placeholder {
            color: var(--text-muted);
        }

        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
            display: flex;
            align-items: center;
        }

        .search-icon svg {
            width: 16px;
            height: 16px;
            stroke-width: 2.5;
        }

        .search-suggestions {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 14px;
            overflow: hidden;
            z-index: 200;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        }

        .search-suggestions.visible {
            display: block;
        }

        .suggestion-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            cursor: pointer;
            transition: background .15s;
            gap: 10px;
        }

        .suggestion-item:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .suggestion-item:not(:last-child) {
            border-bottom: 1px solid var(--border);
        }

        .suggestion-main {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            min-width: 0;
        }

        .suggestion-img {
            width: 40px;
            height: 28px;
            object-fit: cover;
            border-radius: 6px;
            background: #1a1f29;
            flex-shrink: 0;
        }

        .suggestion-text {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .suggestion-title {
            font-size: .88rem;
            font-weight: 700;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .suggestion-owner {
            font-size: .75rem;
            color: var(--text-muted);
        }

        .suggestion-badge {
            font-size: .75rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 20px;
            flex-shrink: 0;
        }

        .avail-dropdown {
            position: relative;
            flex-shrink: 0;
        }

        .avail-dropdown-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 18px;
            cursor: pointer;
            white-space: nowrap;
        }

        .avail-dropdown-btn:hover {
            border-color: rgba(27, 217, 106, 0.4);
        }

        .avail-dropdown-btn svg {
            width: 14px;
            height: 14px;
            stroke-width: 2.5;
            color: var(--text-muted);
            transition: transform .2s;
        }

        .avail-dropdown.open .avail-dropdown-btn svg {
            transform: rotate(180deg);
        }

        .avail-dropdown-menu {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 14px;
            overflow: hidden;
            z-index: 100;
            min-width: 140px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        .avail-dropdown.open .avail-dropdown-menu {
            display: block;
        }

        .avail-option {
            padding: 10px 16px;
            font-size: .9rem;
            font-family: var(--font);
            font-weight: 500;
            color: var(--text-muted);
            cursor: pointer;
            transition: background .15s, color .15s;
        }

        .avail-option:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text);
        }

        .avail-option.selected {
            color: var(--green);
            font-weight: 700;
        }

        .tags-scroll-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .tags-scroll-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            transition: all .2s;
        }

        .tags-scroll-btn:hover {
            background: rgba(255, 255, 255, 0.07);
            color: var(--text);
        }

        .tags-scroll-btn svg {
            width: 14px;
            height: 14px;
            stroke-width: 2.5;
        }

        .tags-container {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
            flex: 1;
            padding: 4px 2px;
        }

        .tags-container::-webkit-scrollbar {
            display: none;
        }

        .tag-item {
            padding: 6px 14px;
            border-radius: 50px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            font-size: .82rem;
            font-weight: 600;
            font-family: var(--font);
            cursor: pointer;
            white-space: nowrap;
            transition: all .2s;
            flex-shrink: 0;
        }

        .tag-item:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text);
        }

        .tag-item.selected {
            background: rgba(27, 217, 106, 0.15);
            color: var(--green);
            border-color: rgba(27, 217, 106, 0.3);
        }

        .card-carousel {
            position: relative;
            overflow-x: hidden;
            width: 96vw;
            margin: 0 calc(50% - 48vw) 60px;
            height: fit-content;
            white-space: nowrap;
            scrollbar-width: none;
        }

        .card-carousel::-webkit-scrollbar {
            display: none;
        }

        .card-carousel::before,
        .card-carousel::after {
            content: '';
            position: absolute;
            top: 0;
            width: 100px;
            height: 100%;
            z-index: 10;
            pointer-events: none;
            transition: opacity .3s;
        }

        .card-carousel::before {
            left: 0;
            background: linear-gradient(to right, #10131af0, transparent);
        }

        .card-carousel::after {
            right: 0;
            background: linear-gradient(to left, #10131af0, transparent);
        }

        .card-carousel.search-mode::before,
        .card-carousel.search-mode::after {
            opacity: 0;
        }

        .card-carousel-inner {
            display: inline-flex;
            gap: 20px;
            padding: 12px 4px;
            animation: scroll var(--scroll-duration, 40s) linear infinite;
        }

        .card-carousel-inner:hover {
            animation-play-state: paused !important;
        }

        .card-carousel-inner.search-mode {
            animation: none !important;
            display: flex;
            flex-wrap: wrap;
            white-space: normal;
            padding: 12px 24px 24px;
            width: 100%;
            box-sizing: border-box;
            gap: 16px;
            max-height: none;
            overflow: visible;
            justify-content: center;
        }

        .card-carousel.search-mode {
            overflow: visible;
        }

        .featured-grid,
        .all-grid {
            display: grid !important;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            padding: 0 20px 60px;
            max-width: 95%;
            margin: 0 auto;
        }

        @keyframes scroll {
            0% {
                transform: translateX(0);
            }

            100% {
                transform: translateX(-50%);
            }
        }

        .card {
            display: inline-flex;
            flex-direction: column;
            width: clamp(380px, 22vw, 420px);
            border-radius: 12px;
            overflow: hidden;
            background: var(--card-bg);
            border: 1px solid var(--border);
            transition: border-color .2s, transform .2s;
            cursor: pointer;
            flex-shrink: 0;
            white-space: normal;
            vertical-align: top;
            padding-bottom: 12px;
        }

        .all-grid .card,
        .featured-grid .card {
            width: 100%;
        }

        .card:hover {
            transform: scale(1.015);
            border-color: rgba(27, 217, 106, 0.67);
        }

        .card-img-wrapper {
            position: relative;
            width: 100%;
            aspect-ratio: 16/9;
            overflow: hidden;
        }

        .card-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #1a1f29;
            z-index: 0;
        }

        .featured-star-badge {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 5;
            color: #ff0;
            filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.6));
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .featured-star-badge svg {
            width: 32px;
            height: 32px;
            fill: #ff0;
        }

        .card-body {
            padding: 14px 16px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .card-title {
            font-size: 1rem;
            font-weight: 800;
            color: var(--text);
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .card-owner {
            font-size: .8rem;
            color: var(--text-muted);
            font-weight: 500;
            margin-bottom: 10px;
        }

        .card-desc {
            font-size: .82rem;
            color: var(--text-muted);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            line-height: 1.5;
        }

        .tag {
            font-size: .8rem;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 20px;
            border: 1px solid var(--border);
            color: var(--text-muted);
        }

        .badge {
            font-size: .88rem;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 20px;
            margin-left: 15px;
        }

        .card-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
        }

        .btn-download,
        .btn-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 34px;
            height: 34px;
            border-radius: 8px;
            cursor: pointer;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            transition: all .2s;
        }

        .btn-download:hover,
        .btn-icon:hover {
            background: rgba(255, 255, 255, 0.07);
            color: var(--text);
        }

        svg {
            width: 18px;
            height: 18px;
            stroke-width: 2.5;
        }

        .badge-free {
            background: rgba(27, 217, 106, 0.15);
            color: var(--green);
        }

        .badge-paid {
            background: rgba(255, 193, 7, 0.15);
            color: #f45e9a;
        }

        .badge-showcase {
            background: rgba(138, 43, 226, 0.15);
            color: #c796f9;
        }

        .no-results-msg {
            width: 100%;
            padding: 60px 40px;
            color: var(--text-muted);
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .no-results-msg h3 {
            color: var(--text);
            font-size: 1.1rem;
            margin-bottom: 6px;
        }

        .preview-overlay {
            position: fixed;
            inset: 0;
            z-index: 1000;
            background: rgba(8, 10, 16, 0.85);
            backdrop-filter: blur(16px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity .25s ease;
        }

        .preview-overlay.visible {
            opacity: 1;
            pointer-events: all;
        }

        .preview-modal {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 20px;
            width: 100%;
            max-width: 860px;
            max-height: 90vh;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
            transform: translateY(20px) scale(0.97);
            transition: transform .25s ease;
            position: relative;
        }

        .preview-overlay.visible .preview-modal {
            transform: translateY(0) scale(1);
        }

        .preview-modal::-webkit-scrollbar {
            width: 6px;
        }

        .preview-modal::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        .preview-img-section {
            position: relative;
            width: 100%;
            aspect-ratio: 16/9;
            background: #000;
            border-radius: 20px 20px 0 0;
            overflow: hidden;
        }

        .preview-main-img {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            user-select: none;
        }

        .preview-img-toggles {
            position: absolute;
            bottom: 14px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            background: rgba(10, 12, 20, 0.7);
            backdrop-filter: blur(10px);
            padding: 6px 10px;
            border-radius: 50px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 5;
        }

        .img-toggle-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 50px;
            border: none;
            cursor: pointer;
            font-size: .78rem;
            font-weight: 700;
            font-family: var(--font);
            transition: all .2s;
            color: var(--text-muted);
            background: transparent;
        }

        .img-toggle-btn svg {
            width: 13px;
            height: 13px;
            stroke-width: 2.5;
        }

        .img-toggle-btn.active {
            background: rgba(27, 217, 106, 0.18);
            color: var(--green);
        }

        .img-toggle-btn:hover:not(.active) {
            background: rgba(255, 255, 255, 0.07);
            color: var(--text);
        }

        .zoom-indicator {
            position: absolute;
            bottom: 14px;
            left: 14px;
            background: rgba(10, 12, 20, 0.7);
            backdrop-filter: blur(10px);
            padding: 6px 14px;
            border-radius: 50px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: var(--text);
            font-size: .78rem;
            font-weight: 700;
            z-index: 5;
        }

        .preview-body {
            padding: 22px 26px 26px;
        }

        .preview-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 14px;
        }

        .preview-title-block {
            display: flex;
            align-items: baseline;
            gap: 12px;
        }

        .preview-title {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--text);
            margin-bottom: 0;
        }

        .preview-owner {
            font-size: .85rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        .preview-owner a {
            color: var(--green);
            text-decoration: none;
            font-weight: 600;
        }

        .preview-owner a:hover {
            text-decoration: underline;
        }

        .preview-badge {
            font-size: .9rem;
            font-weight: 700;
            padding: 5px 14px;
            border-radius: 20px;
            flex-shrink: 0;
        }

        .preview-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 22px;
        }

        .preview-tag {
            padding: 5px 13px;
            border-radius: 50px;
            border: 1px solid var(--border);
            color: var(--text-muted);
            font-size: .8rem;
            font-weight: 600;
        }

        .preview-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .preview-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            font-size: .88rem;
            font-weight: 700;
            font-family: var(--font);
            cursor: pointer;
            transition: all .2s;
            text-decoration: none;
        }

        .preview-btn svg {
            width: 15px;
            height: 15px;
            stroke-width: 2.5;
        }

        .preview-btn:hover {
            background: rgba(255, 255, 255, 0.07);
            color: var(--text);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .preview-btn.primary {
            background: rgba(27, 217, 106, 0.12);
            color: var(--green);
            border-color: rgba(27, 217, 106, 0.3);
        }

        .preview-btn.primary:hover {
            background: rgba(27, 217, 106, 0.22);
            border-color: rgba(27, 217, 106, 0.5);
        }

        .preview-btn.disabled {
            opacity: 0.4;
            cursor: not-allowed;
            pointer-events: none;
        }

        .toast-container {
            position: fixed;
            bottom: 28px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 2000;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 50px;
            padding: 10px 20px;
            font-size: .87rem;
            font-weight: 600;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
            animation: toastIn .25s ease, toastOut .3s ease 1.8s forwards;
        }

        .toast svg {
            width: 15px;
            height: 15px;
            color: var(--green);
        }

        @keyframes toastIn {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes toastOut {
            from {
                opacity: 1;
            }

            to {
                opacity: 0;
                transform: translateY(8px);
            }
        }

        .liked svg {
            color: #e27383;
            stroke: none;
            fill: currentColor;
        }

        .loader-container {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        .loader {
            width: 50px;
            aspect-ratio: 1.154;
            position: relative;
            background: conic-gradient(from 120deg at 50% 64%, #0000, var(--green) 1deg 120deg, #0000 121deg);
            animation: l27-0 1.5s infinite cubic-bezier(0.3, 1, 0, 1);
            z-index: 1;
        }

        .loader:before,
        .loader:after {
            content: '';
            position: absolute;
            inset: 0;
            background: inherit;
            transform-origin: 50% 66%;
            animation: l27-1 1.5s infinite;
        }

        .loader:after {
            --s: -1;
        }

        @keyframes l27-0 {

            0%,
            30% {
                transform: rotate(0);
            }

            70% {
                transform: rotate(120deg);
            }

            70.01%,
            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes l27-1 {
            0% {
                transform: rotate(calc(var(--s, 1)*120deg)) translate(0);
            }

            30%,
            70% {
                transform: rotate(calc(var(--s, 1)*120deg)) translate(calc(var(--s, 1)*-5px), 10px);
            }

            100% {
                transform: rotate(calc(var(--s, 1)*120deg)) translate(0);
            }
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        footer {
            background: #050608;
            padding: 60px 0;
            border-top: 1px solid var(--border);
            margin-top: 80px;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 2rem;
            width: 80%;
        }

        .footer-logo {
            display: flex;
            align-items: center;
            gap: 7px;
            font-weight: 700;
            margin-bottom: 20px;
        }

        .footer-links h4 {
            margin-bottom: 16px;
            color: var(--text);
        }

        .footer-links ul {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }

        .footer-links a {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .footer-links a:hover {
            color: var(--green);
            text-decoration: underline;
        }

        .footer-links-wrapper {
            display: flex;
            gap: 40px;
        }

        .container {
            margin: 0 auto;
            padding: 0 24px;
        }

        @media (max-width:768px) {
            .footer-content {
                width: 100%;
            }

            .footer-links-wrapper {
                flex-direction: column;
                gap: 20px;
            }
        }

        /* ── Source Viewer Modal ── */
        .source-overlay {
            position: fixed;
            inset: 0;
            z-index: 1100;
            background: rgba(8, 10, 16, 0.88);
            backdrop-filter: blur(18px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity .25s ease;
        }

        .source-overlay.visible {
            opacity: 1;
            pointer-events: all;
        }

        .source-modal {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 20px;
            width: 100%;
            max-width: 860px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            transform: translateY(20px) scale(0.97);
            transition: transform .25s ease;
            position: relative;
            overflow: hidden;
        }

        .source-overlay.visible .source-modal {
            transform: translateY(0) scale(1);
        }

        .source-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px;
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
            gap: 12px;
        }

        .source-modal-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .source-modal-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            flex-shrink: 0;
        }

        .source-share-btn,
        .source-copy-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 9px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: all .2s;
            flex-shrink: 0;
        }
        .source-share-btn:hover,
        .source-copy-btn:hover {
            background: rgba(27, 217, 106, 0.12);
            color: var(--green);
            border-color: rgba(27, 217, 106, 0.3);
        }
        .source-copy-btn.copied {
            background: rgba(27, 217, 106, 0.18);
            color: var(--green);
            border-color: rgba(27, 217, 106, 0.4);
        }

        /* Custom copy icon — two overlapping squares (matches reference) */
        .copy-icon {
            position: relative;
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            display: inline-block;
        }
        /* back square — top-right */
        .copy-icon::before {
            content: '';
            position: absolute;
            width: 10px;
            height: 10px;
            top: 0;
            right: 0;
            border-radius: 2px;
            border: 1.8px solid currentColor;
            background: transparent;
        }
        /* front square — bottom-left, covers part of back square */
        .copy-icon::after {
            content: '';
            position: absolute;
            width: 10px;
            height: 10px;
            bottom: 0;
            left: 0;
            border-radius: 2px;
            border: 1.8px solid currentColor;
            background: var(--card-bg);
        }

        .source-code-wrapper {
            flex: 1;
            overflow-y: auto;
            overflow-x: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
            background: #0d1117;
            border-radius: 0 0 20px 20px;
        }

        .source-code-wrapper::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        .source-code-wrapper::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        .source-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            color: var(--text-muted);
            gap: 12px;
            font-size: .9rem;
        }

        .source-code-wrapper pre {
            margin: 0;
            padding: 22px 24px;
            font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
            font-size: .82rem;
            line-height: 1.7;
            color: #e2e8f0;
            white-space: pre;
            tab-size: 2;
        }

        .source-line-numbers {
            display: flex;
            gap: 0;
        }

        .line-nums {
            flex-shrink: 0;
            padding: 22px 14px 22px 22px;
            font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
            font-size: .82rem;
            line-height: 1.7;
            color: #4a5568;
            text-align: right;
            user-select: none;
            border-right: 1px solid var(--border);
        }

        .line-code {
            flex: 1;
            padding: 22px 24px;
            font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
            font-size: .82rem;
            line-height: 1.7;
            color: #e2e8f0;
            white-space: pre;
            overflow-x: auto;
        }

        /* CSS syntax highlighting */
        .css-selector { color: #7dd3fc; }
        .css-property { color: #93c5fd; }
        .css-value { color: #86efac; }
        .css-comment { color: #1fa340; font-style: italic; }
        .css-atrule { color: #c084fc; }
        .css-punctuation { color: #94a3b8; }
        .css-number { color: #fbbf24; }
        .css-color { color: #f472b6; }