:root {
            --primary: #4f46e5;
            --primary-dark: #7c3aed;
            --primary-light: #eef2ff;
            --success: #27ae60;
            --error: #e74c3c;
            --warning: #f39c12;
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-tertiary: #f1f5f9;
            --border: #e2e8f0;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
            --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
            --shadow-xl: 0 8px 32px rgba(0,0,0,0.15);
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 14px;
            --radius-xl: 16px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --tint-blue: rgba(79, 70, 229, 0.08);
            --tint-pink: rgba(236, 72, 153, 0.08);
            --tint-cyan: rgba(14, 165, 233, 0.08);
        }

        /* ── Dark Mode ── */
        @media (prefers-color-scheme: dark) {
            :root {
                --text-primary: #f1f5f9;
                --text-secondary: #cbd5e1;
                --text-tertiary: #94a3b8;
                --bg-primary: #1e293b;
                --bg-secondary: #0f172a;
                --bg-tertiary: #1a1f2e;
                --border: #334155;
                --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
                --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
                --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
                --shadow-xl: 0 8px 32px rgba(0,0,0,0.6);
                --tint-blue: rgba(79, 70, 229, 0.2);
                --tint-pink: rgba(236, 72, 153, 0.2);
                --tint-cyan: rgba(14, 165, 233, 0.2);
            }
        }

        /* ── Reduce Motion Support ── */
        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
            scrollbar-gutter: stable;
        }

        body {
            background:
                radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.18), transparent 40%),
                radial-gradient(circle at 90% 12%, rgba(14, 165, 233, 0.16), transparent 38%),
                radial-gradient(circle at 60% 100%, rgba(236, 72, 153, 0.14), transparent 42%),
                linear-gradient(145deg, #f8fafc 0%, #eef2ff 45%, #ede9fe 100%);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            color: var(--text-primary);
            min-height: 100vh;
            padding: 24px 16px 48px;
            line-height: 1.6;
            transition: background-color 0.3s ease;
        }

        .skip-link {
            position: absolute;
            left: -9999px;
            top: 12px;
            z-index: 10000;
            background: #0f172a;
            color: #fff;
            padding: 10px 14px;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 600;
        }

        .skip-link:focus {
            left: 12px;
        }

        .page-shell {
            max-width: 980px;
            margin: 0 auto;
        }

        .hero-header {
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(238, 242, 255, 0.86));
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 24px;
            backdrop-filter: blur(10px);
            box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
            padding: 24px 18px;
            margin-bottom: 18px;
        }

        @media (prefers-color-scheme: dark) {
            body {
                background:
                    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.28), transparent 42%),
                    radial-gradient(circle at 90% 14%, rgba(14, 165, 233, 0.2), transparent 40%),
                    radial-gradient(circle at 55% 100%, rgba(236, 72, 153, 0.16), transparent 42%),
                    linear-gradient(135deg, #0f172a 0%, #1a1f2e 50%, #1e1b4b 100%);
            }

            .hero-header {
                background: linear-gradient(140deg, rgba(30, 41, 59, 0.78), rgba(30, 27, 75, 0.72));
                border-color: rgba(148, 163, 184, 0.2);
            }
        }

        /* ── Scrollbar Styling ── */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-secondary);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 5px;
            transition: var(--transition);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-tertiary);
        }

        /* ── Focus Visible (Keyboard Navigation) ── */
        *:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
            border-radius: var(--radius-sm);
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }

        button:focus-visible,
        a:focus-visible,
        select:focus-visible,
        input:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        button, a, input, select, label {
            -webkit-tap-highlight-color: transparent;
        }

        /* ── Header & Search ── */
        .search-wrap {
            max-width: 680px;
            margin: 0 auto 32px;
        }

        .search-wrap h1 {
            font-size: clamp(24px, 6vw, 32px);
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
            text-align: center;
            letter-spacing: -0.5px;
        }

        .search-subtitle {
            max-width: 680px;
            margin: 0 auto 14px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 14px;
        }

        .brand-pills {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .brand-pill {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            transition: var(--transition);
            white-space: nowrap;
            border: 1px solid rgba(148, 163, 184, 0.28);
        }

        .brand-pill:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }

        .pill-tk { background: linear-gradient(135deg, rgba(0, 0, 0, 0.13), rgba(37, 244, 238, 0.14)); }
        .pill-ig { background: linear-gradient(135deg, rgba(236, 72, 153, 0.16), rgba(249, 115, 22, 0.16)); }
        .pill-yt { background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(248, 113, 113, 0.16)); }
        .pill-tw { background: linear-gradient(135deg, rgba(15, 23, 42, 0.14), rgba(51, 65, 85, 0.14)); }
        .pill-pi { background: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(236, 72, 153, 0.14)); }
        .pill-fb { background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(14, 165, 233, 0.15)); }
        .pill-li { background: linear-gradient(135deg, rgba(10, 102, 194, 0.15), rgba(0, 119, 181, 0.15)); }
        .pill-re { background: linear-gradient(135deg, rgba(255, 69, 0, 0.14), rgba(255, 120, 50, 0.14)); }
        .pill-qu { background: linear-gradient(135deg, rgba(185, 43, 39, 0.14), rgba(200, 60, 55, 0.14)); }
        .pill-ru { background: linear-gradient(135deg, rgba(79, 191, 89, 0.14), rgba(56, 173, 67, 0.14)); }
        .pill-bc { background: linear-gradient(135deg, rgba(221, 75, 57, 0.14), rgba(200, 60, 40, 0.14)); }
        .pill-dm { background: linear-gradient(135deg, rgba(0, 174, 239, 0.14), rgba(0, 140, 200, 0.14)); }
        .pill-od { background: linear-gradient(135deg, rgba(103, 58, 183, 0.14), rgba(81, 45, 168, 0.14)); }
        .pill-bl { background: linear-gradient(135deg, rgba(0, 161, 214, 0.14), rgba(0, 130, 180, 0.14)); }

        @media (prefers-color-scheme: dark) {
            .pill-tk, .pill-ig, .pill-yt, .pill-tw, .pill-pi, .pill-fb, .pill-li, .pill-re, .pill-qu, .pill-ru, .pill-bc, .pill-dm, .pill-od, .pill-bl {
                border-color: rgba(148, 163, 184, 0.45);
            }
        }

        .search-row {
            display: flex;
            gap: 12px;
            margin-bottom: 12px;
        }

        .input-wrap {
            flex: 1;
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-wrap input {
            width: 100%;
            padding: 14px 48px 14px 18px;
            font-size: 15px;
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            outline: none;
            background: var(--bg-primary);
            color: var(--text-primary);
            transition: var(--transition);
            font-family: inherit;
            box-shadow: var(--shadow-sm);
        }

        .input-wrap input:hover:not(:focus) {
            border-color: var(--text-tertiary);
            box-shadow: var(--shadow-md);
        }

        .input-wrap input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(61, 130, 247, 0.15);
        }

        .input-wrap input::placeholder {
            color: var(--text-tertiary);
            opacity: 0.8;
            transition: var(--transition);
        }

        .input-wrap input:focus::placeholder {
            opacity: 0.5;
        }

        .input-action-btn {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            font-size: 18px;
            color: var(--text-tertiary);
            line-height: 1;
            transition: var(--transition);
            display: none;
            z-index: 2;
            align-items: center;
            justify-content: center;
        }

        .input-action-btn:hover {
            color: var(--primary);
            background: var(--primary-light);
        }

        .input-action-btn.visible {
            display: flex;
        }

        #search-btn {
            padding: 14px 28px;
            font-size: 15px;
            font-weight: 600;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            border: none;
            border-radius: var(--radius-lg);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            font-family: inherit;
            position: relative;
            overflow: hidden;
            min-height: 50px;
            min-width: 132px;
        }

        #search-btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        #search-btn:hover:not(:disabled)::before {
            width: 300px;
            height: 300px;
        }

        #search-btn:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: var(--shadow-xl);
        }

        #search-btn:active:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: var(--shadow-lg);
        }

        #search-btn:disabled {
            background: var(--text-primary);
            color: var(--bg-primary);
            cursor: not-allowed;
            opacity: 0.8;
        }

        .settings-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .max-posts-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .max-posts-row select {
            padding: 6px 10px;
            font-size: 12px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--text-primary);
            cursor: pointer;
            outline: none;
            transition: var(--transition);
            font-family: inherit;
        }

        .max-posts-row select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(61, 130, 247, 0.1);
        }

        /* ── Spinner ── */
        .spin {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: _spin 0.8s linear infinite;
            display: none;
        }

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

        /* ── Messages ── */
        #msg {
            max-width: 680px;
            margin: 0 auto 20px;
            padding: 14px 16px;
            border-radius: var(--radius-md);
            font-size: 14px;
            display: none;
            border-left: 4px solid;
            animation: slideDown 0.3s ease;
            box-shadow: var(--shadow-md);
        }

        #msg.error {
            background: #fee;
            color: var(--error);
            border-left-color: var(--error);
        }

        #msg.success {
            background: #e8f5e9;
            color: var(--success);
            border-left-color: var(--success);
        }

        #msg.info {
            background: var(--primary-light);
            color: var(--primary);
            border-left-color: var(--primary);
        }

        /* Ad placements */
        .ad-slot {
            max-width: 680px;
            margin: 0 auto 18px;
            border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
            border-radius: var(--radius-lg);
            background: linear-gradient(140deg, rgba(255, 255, 255, 0.72), rgba(238, 242, 255, 0.62));
            box-shadow: var(--shadow-sm);
            overflow: hidden;
        }

        .ad-slot-label {
            font-size: 11px;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--text-tertiary);
            padding: 8px 12px 0;
        }

        .ad-slot-frame {
            width: 100%;
            min-height: 96px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 13px;
            padding: 12px;
        }

        @media (prefers-color-scheme: dark) {
            .ad-slot {
                background: linear-gradient(140deg, rgba(30, 41, 59, 0.88), rgba(30, 58, 138, 0.25));
            }
        }

        /* ── Single Post Result ── */
        #single-result {
            display: none;
            max-width: 680px;
            margin: 0 auto;
        }

        /* ── Carousel / Album Section ── */
        #carousel-section {
            display: none;
            max-width: 800px;
            margin: 28px auto 0;
            padding: 0 16px;
        }
        .carousel-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .carousel-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .carousel-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 14px;
        }
        .carousel-item {
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
            overflow: hidden;
        }
        .carousel-item-thumb {
            position: relative;
            aspect-ratio: 1/1;
            background: var(--bg-primary);
            overflow: hidden;
        }
        .carousel-item-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .carousel-item-thumb .ci-badge {
            position: absolute;
            top: 7px;
            left: 7px;
            background: rgba(0,0,0,.65);
            color: #fff;
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 20px;
            font-weight: 600;
            letter-spacing: .3px;
        }
        .carousel-item-thumb .ci-num {
            position: absolute;
            top: 7px;
            right: 7px;
            background: rgba(0,0,0,.55);
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 20px;
        }
        .carousel-item-body { padding: 10px; }
        .ci-dl-btn {
            width: 100%;
            padding: 9px 6px;
            background: linear-gradient(135deg,#833ab4,#c13584,#fd1d1d);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: opacity .2s;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }
        .ci-dl-btn:hover  { opacity: .88; }
        .ci-dl-btn:disabled { opacity: .55; cursor: not-allowed; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
        .ci-dl-btn.dl-done { background: linear-gradient(135deg,#22c55e,#16a34a); }
        .carousel-dl-all {
            margin-left: auto;
            padding: 8px 18px;
            background: linear-gradient(135deg,#833ab4,#c13584,#fd1d1d);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }
        .carousel-dl-all:hover    { opacity: .88; }
        .carousel-dl-all:disabled { opacity: .6; cursor: not-allowed; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

        .result-title-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        #single-result h2 {
            font-size: clamp(20px, 5vw, 28px);
            font-weight: 700;
            color: var(--text-primary);
            text-align: center;
            margin-bottom: 12px;
            letter-spacing: -0.5px;
        }

        #single-result .s-meta {
            text-align: center;
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 20px;
        }

        /* Options Row (Both/Video/Audio) */
        .options-row {
            max-width: 480px;
            margin: 0 auto 18px;
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .options-row label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            cursor: pointer;
            background: var(--bg-primary);
            padding: 10px 16px;
            border-radius: var(--radius-md);
            border: 2px solid var(--border);
            transition: var(--transition);
            font-weight: 500;
            user-select: none;
        }

        .options-row label:hover {
            border-color: var(--primary);
            background: var(--primary-light);
        }

        .options-row label:has(input:checked) {
            border-color: var(--primary);
            background: var(--primary-light);
            color: var(--primary);
        }

        .options-row input {
            cursor: pointer;
        }

        /* Quality Selectors */
        .yt-quality-row {
            max-width: 680px;
            margin: 0 auto 18px;
            display: none;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
        }

        .yt-quality-row.show {
            display: flex;
        }

        .yt-q-btn {
            padding: 9px 16px;
            font-size: 13px;
            font-weight: 600;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--text-primary);
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }

        .yt-q-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-light);
        }

        .yt-q-btn.active {
            border-color: var(--primary);
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            box-shadow: var(--shadow-md);
        }

        .yt-q-btn.tw-active {
            border-color: #1a8cd8;
            background: linear-gradient(135deg, #1a8cd8 0%, #1570b0 100%);
            color: #fff;
        }

        .yt-q-btn.fb-active {
            border-color: #1877f2;
            background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
            color: #fff;
        }

        .yt-q-btn.tk-active {
            border-color: #fe2c55;
            background: linear-gradient(135deg, #fe2c55 0%, #eb1e3a 100%);
            color: #fff;
        }

        .yt-q-btn.ru-active {
            border-color: #4fbf59;
            background: linear-gradient(135deg, #4fbf59 0%, #38ad43 100%);
            color: #fff;
        }
        .yt-q-btn.bc-active {
            border-color: #dd4b39;
            background: linear-gradient(135deg, #dd4b39 0%, #c0392b 100%);
            color: #fff;
        }
        .yt-q-btn.dm-active {
            border-color: #00aeef;
            background: linear-gradient(135deg, #00aeef 0%, #008cc8 100%);
            color: #fff;
        }
        .yt-q-btn.od-active {
            border-color: #673ab7;
            background: linear-gradient(135deg, #673ab7 0%, #512da8 100%);
            color: #fff;
        }
        .yt-q-btn.bl-active {
            border-color: #00a1d6;
            background: linear-gradient(135deg, #00a1d6 0%, #0082b4 100%);
            color: #fff;
        }
        .yt-q-btn.vk-active {
            border-color: #0077ff;
            background: linear-gradient(135deg, #0077ff 0%, #005bb5 100%);
            color: #fff;
        }

        /* Auto-download mode: hide manual quality/content selectors */
        body.auto-download-mode .options-row,
        body.auto-download-mode .yt-quality-row,
        body.auto-download-mode .yt-grid-quality {
            display: none !important;
        }

        /* Media Card */
        .media-card {
            background: linear-gradient(160deg, var(--bg-primary) 0%, rgba(224, 231, 255, 0.42) 100%);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--shadow-lg);
            margin: 0 auto 22px;
            max-width: 500px;
            animation: fadeIn 0.4s ease;
            border: 2px solid var(--border);
            transition: var(--transition);
        }

        .media-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-xl);
            border-color: var(--primary);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .thumb-wrap {
            position: relative;
            width: 100%;
            background: var(--bg-tertiary);
            min-height: 120px;
            overflow: hidden;
        }

        .thumb-wrap.ratio-16-9 {
            aspect-ratio: 16 / 9;
        }

        .thumb-wrap.ratio-1-1 {
            aspect-ratio: 1 / 1;
        }

        .thumb-wrap.ratio-9-16 {
            aspect-ratio: 9 / 16;
            max-height: 500px;
        }

        .thumb-wrap img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
            transition: var(--transition);
        }

        .media-card:hover .thumb-wrap img {
            transform: scale(1.1);
            filter: brightness(0.9);
        }

        .vc {
            position: absolute;
            top: 12px;
            right: 12px;
            display: flex;
            gap: 8px;
        }

        .vc button {
            background: rgba(0, 0, 0, 0.5);
            border: none;
            color: #fff;
            width: 40px;
            height: 40px;
            border-radius: var(--radius-md);
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            backdrop-filter: blur(4px);
        }

        .vc button:hover {
            background: rgba(0, 0, 0, 0.7);
            transform: scale(1.1);
        }

        .dl-btn-wrap {
            padding: 16px;
        }

        .dl-btn-wrap button {
            width: 100%;
            padding: 14px 16px;
            font-size: 16px;
            font-weight: 600;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            border: none;
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            font-family: inherit;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .dl-btn-wrap button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .dl-btn-wrap button:active:not(:disabled) {
            transform: translateY(0);
        }

        .dl-btn-wrap button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .dl-btn-wrap button.dl-done {
            background: linear-gradient(135deg, var(--success) 0%, #1e8449 100%);
        }

        .dl-btn-wrap button.yt-btn {
            background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
        }

        .dl-btn-wrap button.tw-btn {
            background: linear-gradient(135deg, #1a8cd8 0%, #1570b0 100%);
        }

        .dl-btn-wrap button.pi-btn {
            background: linear-gradient(135deg, #e60023 0%, #b8001c 100%);
        }

        .dl-btn-wrap button.fb-btn {
            background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
        }

        .dl-btn-wrap button.tk-btn {
            background: linear-gradient(135deg, #010101 0%, #333 100%);
        }

        .dl-btn-wrap button.li-btn {
            background: linear-gradient(135deg, #0a66c2 0%, #004182 100%);
        }

        .dl-btn-wrap button.ru-btn {
            background: linear-gradient(135deg, #4fbf59 0%, #38ad43 100%);
        }
        .dl-btn-wrap button.bc-btn {
            background: linear-gradient(135deg, #dd4b39 0%, #c0392b 100%);
        }
        .dl-btn-wrap button.dm-btn {
            background: linear-gradient(135deg, #00aeef 0%, #008cc8 100%);
        }
        .dl-btn-wrap button.od-btn {
            background: linear-gradient(135deg, #673ab7 0%, #512da8 100%);
        }
        .dl-btn-wrap button.bl-btn {
            background: linear-gradient(135deg, #00a1d6 0%, #0082b4 100%);
        }
        .dl-btn-wrap button.vk-btn {
            background: linear-gradient(135deg, #0077ff 0%, #005bb5 100%);
        }

        .dl-btn-wrap button.generic-btn {
            background: linear-gradient(135deg, #666 0%, #444 100%);
        }

        .dl-btn-wrap button.story-btn {
            background: linear-gradient(135deg, #c13584 0%, #833ab4 50%, #405de6 100%);
        }

        /* Caption/Description */
        .caption {
            max-width: 680px;
            margin: 0 auto 28px;
            font-size: 14px;
            color: var(--text-primary);
            line-height: 1.7;
            background: var(--bg-primary);
            padding: 16px;
            border-radius: var(--radius-lg);
            border: 2px solid var(--border);
        }

        /* Copy Button */
        .copy-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-primary);
            border: 2px solid var(--border);
            cursor: pointer;
            padding: 6px 12px;
            border-radius: var(--radius-md);
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            transition: var(--transition);
            white-space: nowrap;
            flex-shrink: 0;
            font-family: inherit;
        }

        .copy-btn:hover {
            color: var(--primary);
            background: var(--primary-light);
            border-color: var(--primary);
        }

        .copy-btn.copied {
            color: var(--success);
            background: #e8f5e9;
            border-color: var(--success);
        }

        .copy-row {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 8px;
        }

        .copy-row .copy-btn {
            margin-top: 4px;
        }

        /* Ready Card */
        .ready-card {
            max-width: 500px;
            margin: 0 auto 30px;
            background: linear-gradient(160deg, var(--bg-primary) 0%, rgba(220, 252, 231, 0.44) 100%);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--shadow-lg);
            display: none;
            border: 2px solid var(--success);
            animation: slideDown 0.4s ease;
        }

        .ready-card .rc-thumb img {
            width: 100%;
            display: block;
            object-fit: cover;
            max-height: 200px;
        }

        .ready-card .rc-body {
            padding: 20px;
        }

        .ready-card h3 {
            font-size: 16px;
            color: var(--success);
            margin-bottom: 12px;
            font-weight: 700;
        }

        .ready-card .rc-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            text-align: left;
            margin-bottom: 8px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .ready-card .rc-caption {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.6;
            text-align: left;
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .ready-card .rc-divider {
            border: none;
            border-top: 2px solid var(--border);
            margin: 12px 0;
        }

        .ready-card .rc-meta {
            font-size: 12px;
            color: var(--text-tertiary);
            text-align: left;
            margin-bottom: 4px;
            font-family: 'Monaco', 'Courier', monospace;
        }

        .ready-card a {
            display: inline-block;
            margin-top: 12px;
            padding: 10px 18px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            border: none;
            border-radius: var(--radius-md);
            font-weight: 600;
            text-decoration: none;
            font-size: 13px;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            font-family: inherit;
        }

        .ready-card a:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        /* ── Profile / Playlist Grid ── */
        #profile-result {
            display: none;
            max-width: 1200px;
            margin: 0 auto;
        }

        #profile-result h2 {
            font-size: clamp(24px, 6vw, 32px);
            font-weight: 700;
            color: var(--text-primary);
            text-align: center;
            margin-bottom: 6px;
            letter-spacing: -0.5px;
        }

        #profile-result .sub {
            text-align: center;
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 28px;
        }

        .posts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .post-card {
            background: linear-gradient(160deg, var(--bg-primary) 0%, rgba(237, 233, 254, 0.45) 100%);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-md);
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            border: 2px solid var(--border);
        }

        .post-card:hover {
            transform: translateY(-6px) scale(1.01);
            box-shadow: var(--shadow-xl);
            border-color: var(--primary);
        }

        .post-card .pc-thumb {
            position: relative;
            background: var(--bg-tertiary);
            aspect-ratio: 16 / 9;
            overflow: hidden;
        }

        .post-card.ig-card .pc-thumb {
            aspect-ratio: 1 / 1;
        }

        .post-card .pc-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: var(--transition);
        }

        .post-card:hover .pc-thumb img {
            transform: scale(1.1);
            filter: brightness(0.9);
        }

        .post-card .pc-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(0, 0, 0, 0.65);
            color: #fff;
            font-size: 11px;
            padding: 4px 10px;
            border-radius: 6px;
            backdrop-filter: blur(4px);
            font-weight: 600;
            z-index: 1;
        }

        .post-card .pc-dur {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.65);
            color: #fff;
            font-size: 11px;
            padding: 4px 9px;
            border-radius: 6px;
            backdrop-filter: blur(4px);
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            z-index: 1;
        }

        .thumb-loading {
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 50%, var(--bg-tertiary) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.6s infinite;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }

        .post-card .pc-body {
            padding: 14px 16px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .post-card .pc-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.4;
            margin-bottom: 6px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .post-card .pc-desc {
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 10px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .post-card .pc-uploader {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-bottom: 10px;
            margin-top: auto;
        }

        .post-card .pc-dl-btn {
            width: 100%;
            padding: 10px 12px;
            font-size: 13px;
            font-weight: 600;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            border: none;
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            font-family: inherit;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .post-card .pc-dl-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .post-card .pc-dl-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .post-card .pc-dl-btn.dl-done {
            background: linear-gradient(135deg, var(--success) 0%, #1e8449 100%);
        }

        .post-card.yt-card .pc-dl-btn {
            background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
        }

        .post-card.yt-card .pc-dl-btn.dl-done {
            background: linear-gradient(135deg, var(--success) 0%, #1e8449 100%);
        }

        /* ── Android App Promo Banner (non-intrusive, dismissible) ── */
        .app-promo {
            display: flex;
            align-items: center;
            gap: 16px;
            max-width: 920px;
            margin: 0 auto 18px;
            padding: 16px 20px;
            background:
                radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.14), transparent 45%),
                radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.12), transparent 45%),
                linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 249, 255, 0.9));
            border: 1px solid rgba(148, 163, 184, 0.3);
            border-radius: 20px;
            box-shadow: var(--shadow-md);
            position: relative;
        }

        .app-promo-icon {
            width: 62px;
            height: 62px;
            border-radius: 16px;
            flex-shrink: 0;
            box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
        }

        .app-promo-body {
            flex: 1;
            min-width: 0;
        }

        .app-promo-title {
            margin: 0 0 2px;
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .app-promo-tag {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: var(--primary);
            background: var(--primary-light);
            border: 1px solid rgba(79, 70, 229, 0.25);
            padding: 2px 8px;
            border-radius: 999px;
        }

        .app-promo-sub {
            margin: 0;
            font-size: 13px;
            color: var(--text-secondary);
        }

        .app-promo-features {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 16px;
            margin: 8px 0 0;
            padding: 0;
            list-style: none;
        }

        .app-promo-features li {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .app-promo-features li::before {
            content: '✓ ';
            color: var(--success);
            font-weight: 800;
        }

        .app-promo-cta {
            flex-shrink: 0;
        }

        .gplay-btn {
            display: inline-flex;
            align-items: center;
            gap: 9px;
            background: #0f172a;
            color: #fff;
            text-decoration: none;
            padding: 9px 16px;
            border-radius: 12px;
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .gplay-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3);
        }

        .gplay-btn small {
            display: block;
            font-size: 9px;
            line-height: 1;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0.75;
        }

        .gplay-btn strong {
            display: block;
            font-size: 14px;
            line-height: 1.2;
            font-weight: 600;
        }

        .app-promo-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 26px;
            height: 26px;
            border: none;
            background: transparent;
            color: var(--text-tertiary);
            font-size: 14px;
            cursor: pointer;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease, color 0.2s ease;
        }

        .app-promo-close:hover {
            background: rgba(100, 116, 139, 0.15);
            color: var(--text-primary);
        }

        @media (max-width: 640px) {
            .app-promo {
                flex-wrap: wrap;
                padding: 16px 14px;
            }

            .app-promo-cta {
                width: 100%;
                text-align: center;
            }

            .app-promo-close {
                top: 8px;
                right: 8px;
            }
        }

        @media (prefers-color-scheme: dark) {
            .app-promo {
                background:
                    radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.28), transparent 45%),
                    radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.22), transparent 45%),
                    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.9));
                border-color: rgba(148, 163, 184, 0.2);
            }
        }

        .site-footer {
            max-width: 960px;
            margin: 40px auto 0;
            padding: 26px 20px 36px;
            border-top: 1px solid var(--border);
            text-align: center;
            border-radius: 16px;
            background: linear-gradient(145deg, var(--tint-blue), var(--tint-pink));
        }

        .site-footer .footer-copy {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            line-height: 1.8;
        }

        .site-footer .footer-heading {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0 0 8px;
        }

        .site-footer .footer-links {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 8px 14px;
            margin: 8px 0 14px;
        }

        .site-footer .footer-links a {
            font-size: 13px;
            font-weight: 600;
        }

        .site-footer .footer-note {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 8px;
        }

        .site-footer strong {
            color: var(--text-primary);
        }

        .site-footer a {
            color: var(--primary);
            text-decoration: none;
        }

        .site-footer a:hover {
            text-decoration: underline;
        }


        @media (prefers-color-scheme: dark) {
            .media-card {
                background: linear-gradient(160deg, rgba(30, 41, 59, 0.9) 0%, rgba(49, 46, 129, 0.35) 100%);
            }

            .ready-card {
                background: linear-gradient(160deg, rgba(30, 41, 59, 0.92) 0%, rgba(21, 128, 61, 0.22) 100%);
            }

            .post-card {
                background: linear-gradient(160deg, rgba(30, 41, 59, 0.9) 0%, rgba(76, 29, 149, 0.28) 100%);
            }

            .site-footer {
                background: linear-gradient(145deg, rgba(30, 58, 138, 0.24), rgba(157, 23, 77, 0.2));
            }

            .dl-all-bar {
                background: linear-gradient(135deg, rgba(30, 58, 138, 0.26), rgba(76, 29, 149, 0.22));
            }
        }

        /* Download All Bar */
        .dl-all-bar {
            max-width: 1200px;
            margin: 0 auto 24px;
            background: linear-gradient(135deg, rgba(219, 234, 254, 0.36) 0%, rgba(237, 233, 254, 0.34) 100%);
            border-radius: var(--radius-lg);
            padding: 16px 20px;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
            border: 2px solid var(--border);
        }

        .dl-all-btn {
            padding: 12px 24px;
            font-size: 14px;
            font-weight: 600;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: #fff;
            border: none;
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            transition: var(--transition);
            box-shadow: var(--shadow-md);
            font-family: inherit;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .dl-all-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .dl-all-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .dl-all-btn.dl-done {
            background: linear-gradient(135deg, var(--success) 0%, #1e8449 100%);
        }

        .dl-all-btn.yt-dl-btn {
            background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
        }

        .stop-all-btn {
            padding: 12px 20px;
            font-size: 14px;
            font-weight: 600;
            color: var(--error);
            background: none;
            border: 2px solid var(--error);
            border-radius: var(--radius-md);
            cursor: pointer;
            white-space: nowrap;
            transition: var(--transition);
            font-family: inherit;
        }

        .stop-all-btn:hover {
            background: rgba(231, 76, 60, 0.1);
        }

        .dl-progress-wrap {
            flex: 1;
            min-width: 180px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .dl-progress-bar {
            flex: 1;
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .dl-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
            border-radius: 4px;
            transition: width 0.4s ease;
            width: 0%;
            box-shadow: 0 0 8px rgba(61, 130, 247, 0.4);
        }

        .dl-progress-fill.done {
            background: linear-gradient(90deg, var(--success) 0%, #1e8449 100%);
            box-shadow: 0 0 8px rgba(39, 174, 96, 0.4);
        }

        .dl-progress-text {
            font-size: 13px;
            color: var(--text-primary);
            white-space: nowrap;
            min-width: 100px;
            text-align: right;
            font-weight: 600;
        }

        .single-progress-wrap {
            display: none;
            margin: 14px 0 4px;
            padding: 14px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
        }

        .single-progress-wrap.active {
            display: block;
        }

        .single-progress-top {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            align-items: center;
            margin-bottom: 10px;
            font-size: 13px;
            color: var(--text-secondary);
        }

        .single-progress-title {
            font-weight: 700;
            color: var(--text-primary);
        }

        .single-progress-track {
            height: 9px;
            border-radius: 999px;
            overflow: hidden;
            background: var(--border);
        }

        .single-progress-fill {
            height: 100%;
            width: 12%;
            border-radius: 999px;
            background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--primary));
            background-size: 200% 100%;
            box-shadow: 0 0 10px rgba(61, 130, 247, 0.35);
            transition: width 0.5s ease;
            animation: progressShimmer 1.2s linear infinite;
        }

        .single-progress-fill.done {
            width: 100% !important;
            background: linear-gradient(90deg, var(--success), #1e8449);
            animation: none;
        }

        @keyframes progressShimmer {
            from { background-position: 0% 50%; }
            to { background-position: 200% 50%; }
        }

        /* Lightbox */
        .lightbox {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.92);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            cursor: zoom-out;
            backdrop-filter: blur(4px);
            padding: 20px;
        }

        .lightbox.show {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .lightbox img {
            max-width: 90vw;
            max-height: 90vh;
            border-radius: var(--radius-lg);
            object-fit: contain;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
            animation: zoomIn 0.3s ease;
        }

        @keyframes zoomIn {
            from {
                transform: scale(0.95);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.3);
            color: #fff;
            font-size: 24px;
            cursor: pointer;
            line-height: 1;
            opacity: 0.8;
            transition: var(--transition);
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }

        .lightbox-close:hover {
            opacity: 1;
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.5);
        }

        /* ── YouTube Grid Quality ── */
        .yt-grid-quality {
            display: none;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .yt-grid-quality.show {
            display: flex;
        }

        .yt-grid-quality select {
            padding: 7px 12px;
            font-size: 12px;
            border: 2px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            color: var(--text-primary);
            cursor: pointer;
            outline: none;
            transition: var(--transition);
            font-family: inherit;
        }

        .yt-grid-quality select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(61, 130, 247, 0.1);
        }

        /* ── Mobile & Tablet Responsive ── */
        @media (max-width: 768px) {
            body {
                padding: 16px 12px 36px;
            }

            .posts-grid {
                grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
                gap: 14px;
            }

            #profile-result h2 {
                font-size: clamp(20px, 5vw, 26px);
            }

            .media-card {
                max-width: 100%;
            }

            .ready-card {
                max-width: 100%;
            }

            .dl-all-bar {
                padding: 12px 14px;
                gap: 10px;
            }
        }

        @media (max-width: 640px) {
            body {
                padding: 12px 10px 32px;
            }

            .search-wrap {
                margin-bottom: 20px;
            }

            .search-wrap h1 {
                font-size: clamp(20px, 5vw, 26px);
                margin-bottom: 12px;
            }

            .search-subtitle {
                font-size: 13px;
                margin-bottom: 12px;
            }

            .brand-pills {
                margin-bottom: 16px;
                gap: 6px;
            }

            .brand-pill {
                font-size: 11px;
                padding: 5px 12px;
            }

            .search-row {
                flex-direction: column;
                gap: 10px;
            }

            .input-wrap input {
                font-size: 16px;
                padding: 14px 44px 14px 14px;
            }

            #search-btn {
                width: 100%;
                justify-content: center;
                padding: 14px 20px;
                font-size: 14px;
            }

            .settings-row {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                margin-top: 10px;
            }

            .max-posts-row {
                font-size: 11px;
                gap: 6px;
            }

            .max-posts-row select {
                font-size: 13px;
                padding: 7px 9px;
            }

            #msg {
                font-size: 13px;
                padding: 12px 14px;
                margin: 0 auto 16px;
            }

            .ad-slot {
                margin: 0 auto 14px;
            }

            .ad-slot-frame {
                min-height: 88px;
                font-size: 12px;
            }

            #single-result h2 {
                font-size: clamp(18px, 4vw, 24px);
                margin-bottom: 10px;
            }

            #single-result .s-meta {
                font-size: 12px;
                margin-bottom: 12px;
            }

            .options-row {
                max-width: 100%;
                gap: 8px;
                margin: 0 0 14px 0;
            }

            .options-row label {
                font-size: 13px;
                padding: 10px 14px;
                flex: 1;
                justify-content: center;
            }

            .yt-quality-row {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                justify-content: flex-start;
                padding: 0 0 6px 0;
                max-width: 100%;
                margin: 0 -10px 14px -10px;
                padding-left: 10px;
            }

            .yt-quality-row::-webkit-scrollbar {
                height: 4px;
            }

            .yt-quality-row::-webkit-scrollbar-thumb {
                background: var(--border);
                border-radius: 2px;
            }

            .yt-q-btn {
                flex-shrink: 0;
                padding: 10px 14px;
                font-size: 12px;
            }

            .media-card {
                border-radius: 12px;
                margin: 0 0 18px 0;
            }

            .vc {
                top: 8px;
                right: 8px;
                gap: 6px;
            }

            .vc button {
                width: 44px;
                height: 44px;
                font-size: 16px;
            }

            .dl-btn-wrap {
                padding: 12px;
            }

            .dl-btn-wrap button {
                padding: 14px 14px;
                font-size: 15px;
            }

            .caption {
                font-size: 13px;
                padding: 12px 14px;
                margin: 0 0 20px 0;
            }

            .copy-row {
                gap: 8px;
                margin-bottom: 6px;
            }

            .copy-btn {
                padding: 6px 10px;
                font-size: 11px;
            }

            .ready-card {
                border-radius: 12px;
            }

            .ready-card .rc-body {
                padding: 14px 12px;
            }

            .ready-card h3 {
                font-size: 15px;
                margin-bottom: 10px;
            }

            .ready-card .rc-title {
                font-size: 13px;
                margin-bottom: 6px;
            }

            .ready-card .rc-caption {
                font-size: 12px;
                margin-bottom: 10px;
            }

            .ready-card .rc-meta {
                font-size: 11px;
            }

            .ready-card a {
                font-size: 12px;
                padding: 9px 16px;
                margin-top: 10px;
            }

            #profile-result {
                margin: 0 auto;
                padding: 0;
            }

            #profile-result h2 {
                font-size: clamp(18px, 4vw, 24px);
                margin-bottom: 4px;
            }

            #profile-result .sub {
                font-size: 12px;
                margin-bottom: 16px;
            }

            .posts-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }

            .post-card {
                border-radius: 10px;
                border: 1px solid var(--border);
            }

            .post-card .pc-thumb {
                aspect-ratio: 1 / 1;
            }

            .post-card.ig-card .pc-thumb {
                aspect-ratio: 1 / 1;
            }

            .post-card .pc-body {
                padding: 10px 10px;
            }

            .post-card .pc-title {
                font-size: 12px;
                margin-bottom: 4px;
                -webkit-line-clamp: 1;
            }

            .post-card .pc-desc {
                font-size: 11px;
                -webkit-line-clamp: 1;
                margin-bottom: 8px;
            }

            .post-card .pc-uploader {
                font-size: 10px;
                margin-bottom: 8px;
            }

            .post-card .pc-dl-btn {
                padding: 9px 10px;
                font-size: 12px;
            }

            .post-card .pc-thumb .no-thumb {
                font-size: 28px;
                gap: 4px;
            }

            .post-card .pc-thumb .play-overlay svg {
                width: 44px;
                height: 44px;
            }

            .post-card .pc-badge {
                font-size: 10px;
                padding: 3px 8px;
                top: 6px;
                left: 6px;
            }

            .post-card .pc-dur {
                font-size: 10px;
                padding: 3px 6px;
                bottom: 6px;
                right: 6px;
            }

            .dl-all-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                padding: 12px 12px;
            }

            .dl-all-btn {
                justify-content: center;
                width: 100%;
                padding: 12px;
            }

            .stop-all-btn {
                text-align: center;
                width: 100%;
                padding: 12px;
            }

            .dl-progress-wrap {
                min-width: 0;
                width: 100%;
                gap: 10px;
            }

            .dl-progress-text {
                min-width: 80px;
                font-size: 11px;
            }

            .yt-grid-quality {
                justify-content: center;
                gap: 6px;
            }

            .yt-grid-quality select {
                font-size: 12px;
                padding: 7px 10px;
            }

            .site-footer {
                margin-top: 28px;
                padding: 20px 14px 26px;
            }

            .lightbox-close {
                top: 12px;
                right: 12px;
                width: 42px;
                height: 42px;
                font-size: 20px;
            }
        }

        @media (max-width: 420px) {
            body {
                padding: 10px 8px 28px;
            }

            .hero-header {
                padding: 16px 10px;
                border-radius: 18px;
            }

            .posts-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }

            .search-wrap h1 {
                font-size: clamp(18px, 4vw, 22px);
            }

            .brand-pills {
                margin-bottom: 12px;
                gap: 4px;
            }

            .brand-pill {
                font-size: 10px;
                padding: 4px 10px;
            }

            .input-wrap input::placeholder {
                font-size: 13px;
            }

            .max-posts-row {
                font-size: 10px;
            }

            .options-row label {
                padding: 9px 12px;
                font-size: 12px;
            }

            .yt-q-btn {
                padding: 8px 12px;
                font-size: 11px;
            }

            .post-card .pc-title {
                font-size: 11px;
            }

            .post-card .pc-desc {
                font-size: 10px;
            }
        }

        /* ── FAQ section ── */
        .site-faq {
            max-width: 860px;
            margin: 48px auto;
            padding: 0 20px;
        }
        .site-faq h2 {
            font-size: 24px;
            margin-bottom: 20px;
            color: var(--text-primary);
        }
        .faq-item {
            border: 1px solid var(--border);
            border-radius: 8px;
            margin-bottom: 8px;
            background: var(--bg-primary);
            overflow: hidden;
        }
        .faq-item summary {
            padding: 14px 18px;
            font-weight: 600;
            font-size: 15px;
            cursor: pointer;
            color: var(--text-primary);
            background: var(--bg-secondary);
        }
        .faq-item summary:hover {
            background: var(--bg-tertiary);
        }
        .faq-item p {
            padding: 12px 18px 16px;
            margin: 0;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        /* ── Platform guides section ── */
        .site-guides {
            max-width: 1100px;
            margin: 48px auto;
            padding: 0 20px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
        }
        .site-guides h2 {
            font-size: 24px;
            grid-column: 1 / -1;
            margin: 0 0 8px;
            color: var(--text-primary);
            text-align: center;
        }
        .guide-card {
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 14px 16px;
            background: var(--bg-primary);
        }
        .guide-card h3 {
            font-size: 15px;
            margin: 0 0 8px;
            color: var(--primary);
        }
        .guide-card ol {
            margin: 0 0 6px;
            padding-left: 18px;
        }
        .guide-card li {
            margin-bottom: 3px;
            line-height: 1.5;
            color: var(--text-secondary);
            font-size: 13px;
        }
        .guide-card p {
            margin: 0;
            color: var(--text-tertiary);
            font-size: 12.5px;
        }
        @media (max-width: 900px) {
            .site-guides { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 640px) {
            .site-guides { grid-template-columns: 1fr; }
        }
        .home-breadcrumb {
            max-width: 880px;
            margin: 0 auto;
            padding: 10px 20px 0;
            font-size: 13px;
            color: var(--text-tertiary);
        }
        .home-breadcrumb a {
            color: var(--accent);
            text-decoration: none;
        }
        .home-breadcrumb a:hover {
            text-decoration: underline;
        }
        .home-breadcrumb span {
            margin: 0 4px;
        }
        .guide-link {
            font-size: 13px;
            margin: 12px 0 4px;
            text-align: right;
        }
        .guide-link a {
            color: var(--accent);
            text-decoration: none;
            opacity: 0.85;
        }
        .guide-link a:hover {
            opacity: 1;
            text-decoration: underline;
        }
