:root {
            --bg: #ffffff;
            --text: #000000;
            --border: #4468a9;
            --accent: #ff5e5b;
            --accent-hover: #e04e4b;
            --secondary: #f3f3f3;
            --success: #107225;
            --goal-green: #3ed676;
            --border-width: 2px;
            --radius: 0px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg);
            color: var(--border);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding-bottom: 80px;
        }

        .global-loader {
            position: fixed;
            inset: 0;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            gap: 20px;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

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

        .spinner-ring {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: conic-gradient(var(--teal), var(--red), #8844ff, var(--teal));
            padding: 5px;
            animation: spin 1.6s linear infinite;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .spinner-ring img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            background: var(--bg);
        }

        .loader-label {
            font-size: 1rem;
            font-weight: 600;
            letter-spacing: 0.2em;
            text-transform: uppercase;
        }

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

        .float-support {
            position: fixed;
            bottom: 52px;
            left: 18px;
            background: var(--accent);
            color: #fff;
            padding: 10px 16px;
            border-radius: 50px;
            font-size: 13px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 7px;
            box-shadow: 0 4px 20px rgba(0, 185, 254, 0.3);
            transition: transform 0.2s, background 0.2s;
            z-index: 99;
            text-decoration: none;
        }

        .float-support:hover {
            transform: translateY(-3px);
            background: #009ad6;
        }

        .float-support img {
            width: 20px;
            height: 20px;
        }

        .container {
            width: 100%;
            max-width: 640px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            flex: 1;
            padding: 15px;
        }

        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            border-bottom: var(--border-width) solid var(--border);
            padding-top: 12px;
            padding-bottom: 12px;
            padding-left: 8px;
            padding-right: 8px;
        }

        .logo-area {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .logo-img {
            height: 32px;
            width: auto;
        }

        .header-title h1 {
            font-size: 1.1rem;
            font-weight: 800;
            letter-spacing: -0.5px;
        }

        .tools-btn {
            background: var(--secondary);
            color: var(--text);
            border: var(--border-width) solid var(--border);
            padding: 6px 12px;
            font-size: 0.7rem;
            font-weight: 800;
            text-decoration: none;
            transition: all 0.1s;
        }

        .tools-btn:hover {
            background: var(--border);
            color: var(--bg);
        }

        .card {
            border: var(--border-width) solid var(--border);
            margin-bottom: 20px;
            background: white;
        }

        .card-header {
            background: var(--border);
            color: white;
            padding: 10px 15px;
            font-weight: 800;
            font-size: 0.85rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .format-tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            border-bottom: var(--border-width) solid var(--border);
        }

        .tab-btn {
            padding: 12px;
            font-weight: 700;
            font-size: 0.9rem;
            border: none;
            border-right: var(--border-width) solid var(--border);
            background: white;
            color: var(--text);
            cursor: pointer;
            text-transform: uppercase;
        }

        .tab-btn:last-child {
            border-right: none;
        }

        .tab-btn.active {
            background: #d7e0fb;
            text-decoration: underline;
            text-underline-offset: 4px;
        }

        .input-section {
            padding: 15px;
            border-bottom: var(--border-width) solid var(--border);
        }

        .input-group {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 15px;
        }

        @media (min-width: 480px) {
            .input-group {
                flex-direction: row;
            }
        }

        input {
            flex: 1;
            padding: 12px;
            border: var(--border-width) solid var(--border);
            font-size: 0.95rem;
            font-weight: 600;
            background: white;
        }

        input:focus {
            outline: 2px solid var(--text);
            outline-offset: 2px;
        }

        .btn-go {
            background: var(--border);
            color: white;
            border: none;
            padding: 12px 20px;
            font-weight: 800;
            font-size: 0.95rem;
            text-transform: uppercase;
            cursor: pointer;
            white-space: nowrap;
        }

        .btn-go:hover {
            opacity: 0.9;
        }

        .btn-go:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        .options-row {
            display: flex;
            gap: 10px;
            padding: 0 15px 15px 15px;
        }

        .opt-group {
            flex: 1;
        }

        .opt-group label {
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            margin-bottom: 5px;
            display: block;
        }

        select {
            width: 100%;
            padding: 10px;
            border: var(--border-width) solid var(--border);
            background: white;
            font-weight: 600;
            font-family: inherit;
            font-size: 0.9rem;
        }

        /* ═══════════════════════════════════════════
           RAHUL CONTAINER — improved styles
           ═══════════════════════════════════════════ */

        /* 1. Thumbnail: full-width, centered, 16:9 */
        #video-preview {
            display: none;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 14px 14px 0;
            gap: 10px;
            border-top: 2px solid var(--border);
            border-bottom: 2px solid var(--border);
        }

        #video-preview.visible {
            display: flex;
        }

        #video-thumb {
            width: 100%;
            max-width: 380px;
            aspect-ratio: 16 / 9;
            object-fit: cover;
            border-radius: 0px;
            background: #1a1a1a;
            display: block;
            margin: 0 auto;
            /* centers it */
        }

        /* 2. Title + channel: below the thumb, centered */
        .video-meta {
            width: 100%;
        }

        .video-title {
            font-size: 0.93rem;
            font-weight: 700;
            line-height: 1.45;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-align: center;
        }

        .video-channel {
            font-size: 0.76rem;
            opacity: 0.5;
            margin-top: 3px;
            text-align: center;
        }

        /* 3. Status box: white background, loader LEFT, text RIGHT */
        #progress-track {
            display: none !important;
        }

        .round-spinner-wrap {
            display: none !important;
        }

        #status-box {
            display: none;
            flex-direction: row;
            /* loader on LEFT, label on RIGHT */
            align-items: center;
            gap: 8px;
            margin: 12px 14px 14px;
            padding: 0px 10px;
            background: #ffffff;
            border-radius: 0px;
        }

        #status-box.visible {
            display: flex;
        }

        /* 4. Infinity loader — small, left side */
        #status-box .infinity-loader {
            width: 50px;
            height: 50px;
            flex-shrink: 0;
            object-fit: contain;
        }

        /* 5. Text — right of loader, left-aligned */
        #status-label {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--border);
            text-align: left;
            line-height: 1;
        }

        /* ═══════════════════════════════════════════ */

        #download-btn {
            display: none;
            width: 100%;
            padding: 16px;
            background: var(--success);
            color: white;
            border: none;
            border-top: var(--border-width) solid var(--border);
            font-size: 1rem;
            font-weight: 800;
            text-transform: uppercase;
            cursor: pointer;
            margin-bottom: 1rem;
        }

        #download-btn.visible {
            display: block;
        }

        #success-view {
            display: none;
            text-align: center;
            padding: 30px 20px;
            border: var(--border-width) solid var(--border);
            margin-bottom: 20px;
            background: white;
        }

        #success-view.visible {
            display: block;
        }

        .success-title {
            font-size: 1.4rem;
            font-weight: 800;
            margin-bottom: 15px;
            line-height: 1.2;
        }

        .kofi-btn {
            display: block;
            background: var(--accent);
            color: white;
            padding: 14px 20px;
            font-size: 1rem;
            font-weight: 800;
            text-decoration: none;
            border: var(--border-width) solid var(--secondary);
            margin-bottom: 15px;
            width: 100%;
            text-transform: uppercase;
            box-shadow: 3px 3px 0px var(--border);
            transition: all 0.1s;
        }

        .kofi-btn:hover {
            transform: translate(-2px, -2px);
            box-shadow: 5px 5px 0px var(--border);
            background: var(--accent-hover);
        }

        .kofi-btn:active {
            transform: translate(2px, 2px);
            box-shadow: none;
        }

        .convert-again-btn {
            display: inline-block;
            background: white;
            color: var(--text);
            padding: 12px 25px;
            font-size: 0.9rem;
            font-weight: 800;
            border: var(--border-width) solid var(--border);
            text-transform: uppercase;
            cursor: pointer;
            box-shadow: 3px 3px 0px var(--border);
            transition: all 0.1s;
        }

        .convert-again-btn:hover {
            transform: translate(-2px, -2px);
            box-shadow: 5px 5px 0px var(--border);
        }

        .fixed-footer {
            width: 100%;
            background: white;
            padding: 10px 15px;
            margin-top: -10px;
        }

        .goal-pill {
            background: #f2f4eb;
            border-radius: 10px;
            height: 50px;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 4px;
            border: 1.5px solid var(--border);
            box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
        }

        .goal-fill {
            position: absolute;
            left: 4px;
            top: 4px;
            bottom: 4px;
            background: var(--goal-green);
            border-radius: 10px;
            width: 0%;
            transition: width 1s ease;
            z-index: 1;
        }

        .goal-text-left {
            position: relative;
            z-index: 2;
            font-size: 0.9rem;
            font-weight: 800;
            padding-left: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .goal-text-right {
            position: relative;
            z-index: 2;
            font-size: 0.9rem;
            font-weight: 800;
            padding-right: 12px;
        }

        .goal-icon {
            width: 28px;
            height: 28px;
        }

        footer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            text-align: center;
            font-size: 1rem;
            font-weight: 600;
            color: #09759c;
            padding: 10px 0;
            border: 1.5px solid var(--border);
        }

        .fade-out {
            opacity: 0;
            transition: opacity 0.3s ease;
        }
