:root {
    --bg: #070b14;
    --bg-2: #0c1322;
    --card: rgba(255, 255, 255, 0.04);
    --card-brd: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --muted: #94a3b8;
    --accent: #6366f1;
    --accent-2: #22d3ee;
    --green: #34d399;
    --red: #f87171;
    --radius: 18px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --header-h: 64px;
    --touch-min: 44px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(34, 211, 238, 0.12), transparent 55%),
        var(--bg);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ---------- animated background orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-1 { width: 380px; height: 380px; background: #4f46e5; top: -80px; right: -60px; animation: float 14s ease-in-out infinite; }
.orb-2 { width: 320px; height: 320px; background: #06b6d4; bottom: -100px; left: -60px; animation: float 18s ease-in-out infinite reverse; }
.orb-3 { width: 260px; height: 260px; background: #a855f7; top: 45%; left: 55%; animation: float 22s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.08); }
}

/* ---------- header / footer ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right)) 14px calc(16px + var(--safe-left));
    background: rgba(7, 11, 20, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: var(--touch-min); }
.brand-mark {
    width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center;
    border-radius: 12px; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.6);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; line-height: 1.15; }
.brand-domain { font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.brand-vid { color: #fff; }
.brand-linkit {
    background: linear-gradient(120deg, #a5b4fc, #67e8f9);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.site-main {
    flex: 1; width: 100%; max-width: 1040px; margin: 0 auto;
    padding: 8px calc(16px + var(--safe-right)) calc(32px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

.site-footer {
    text-align: center;
    padding: 28px calc(16px + var(--safe-right)) calc(32px + var(--safe-bottom)) calc(16px + var(--safe-left));
    color: var(--muted); font-size: 0.85rem;
    border-top: 1px solid var(--card-brd); margin-top: 12px;
}
.site-footer p { margin: 6px 0; }
.footer-brand { margin-bottom: 8px !important; }
.footer-logo {
    display: inline-flex; align-items: center; gap: 0;
    text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
}
.footer-logo .brand-vid { color: var(--text); }

.footer-nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 4px 10px; margin: 12px auto 14px; max-width: 520px;
}
.footer-nav-link {
    color: var(--muted); text-decoration: none; font-size: 0.82rem; font-weight: 600;
    padding: 6px 4px; transition: color 0.15s ease;
}
.footer-nav-link:hover,
.footer-nav-link.is-active { color: var(--accent-2); }
.footer-nav-sep { color: rgba(148, 163, 184, 0.45); font-size: 0.75rem; user-select: none; }

.footer-copy { font-size: 0.8rem; }
.footer-sub { font-size: 0.8rem; line-height: 1.5; max-width: 420px; margin-left: auto; margin-right: auto; }
.footer-disclaimer {
    font-size: 0.72rem; line-height: 1.6; color: #64748b;
    max-width: 680px; margin: 18px auto 0; padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.footer-disclaimer strong { color: var(--muted); font-weight: 700; }
.footer-disclaimer-more {
    display: inline-block; margin-top: 10px; color: var(--accent-2);
    text-decoration: none; font-weight: 600; font-size: 0.72rem;
}
.footer-disclaimer-more:hover { text-decoration: underline; }
.footer-sub a { color: var(--accent-2); text-decoration: none; }
.footer-sub a:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 20px 4px 24px; }
.hero-badge {
    display: inline-block; font-size: 0.78rem; font-weight: 600; color: #c7d2fe;
    background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 7px 14px; border-radius: 999px; margin-bottom: 16px;
}
.hero-title {
    font-size: clamp(2.2rem, 10vw, 4rem); font-weight: 800; letter-spacing: -0.03em; margin: 0;
    line-height: 1.1;
}
.hero-title .brand-vid { color: #fff; -webkit-text-fill-color: #fff; }
.hero-title .brand-linkit {
    background: linear-gradient(120deg, #fff 20%, #a5b4fc 60%, #67e8f9);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-tagline {
    color: var(--muted); font-size: clamp(0.95rem, 3.5vw, 1.15rem);
    max-width: 520px; margin: 12px auto 8px; line-height: 1.55; padding: 0 4px;
}
.hero-help { color: var(--muted); font-size: clamp(0.88rem, 2.8vw, 0.95rem); line-height: 1.55; max-width: 480px; margin: 0 auto; padding: 0 4px; }
.hero-help strong { color: var(--text); }
.hero-global { padding-bottom: 16px; }

/* ---------- global search ---------- */
.global-search {
    max-width: 720px; margin: 0 auto 28px;
    background: var(--card); border: 1px solid var(--card-brd); border-radius: 20px;
    padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.global-form { display: flex; flex-direction: column; gap: 10px; }
.global-input-wrap {
    position: relative; display: flex; align-items: center; min-height: var(--touch-min);
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.22));
    border: 1px solid var(--card-brd); border-radius: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.global-input-wrap:focus-within {
    border-color: rgba(99,102,241,0.65);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.global-input-wrap input {
    flex: 1; border: none; background: transparent; color: var(--text);
    font: inherit; font-size: 16px; padding: 14px 48px 14px 46px; outline: none; min-width: 0;
}
.global-input-wrap input::placeholder { color: #64748b; }
.global-go-btn { width: 100%; justify-content: center; padding: 15px 24px; font-size: 1.05rem; min-height: var(--touch-min); }
.detected-label {
    margin: 12px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--accent-2);
    text-align: center;
}
.global-results { margin-top: 20px; overflow: visible; }
.supported-now {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px;
}
.supported-chip {
    font-size: 0.78rem; font-weight: 700; color: #fff; padding: 5px 12px; border-radius: 999px;
    background: var(--chip-bg, linear-gradient(135deg, var(--accent), var(--accent-2)));
    box-shadow: 0 4px 14px -6px rgba(0,0,0,0.5);
}
.platforms-compact { margin-top: 10px; }
.section-label {
    text-align: center; color: var(--muted); font-size: 0.9rem; font-weight: 600;
    margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.06em;
}
.platform-grid-compact {
    grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.platform-card-sm { padding: 14px 8px; gap: 8px; min-height: var(--touch-min); }
.platform-icon-sm { width: 42px; height: 42px; border-radius: 12px; }
.platform-icon-sm svg { width: 22px; height: 22px; }
.platform-card-sm .platform-name { font-size: 0.82rem; }
.platform-card-sm .platform-tag { display: none; }

/* ---------- platform grid ---------- */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.platform-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 26px 16px 20px; text-decoration: none; color: var(--text);
    background: var(--card); border: 1px solid var(--card-brd); border-radius: var(--radius);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    backdrop-filter: blur(8px);
}
.platform-card.is-active:hover { transform: translateY(-5px); border-color: rgba(99, 102, 241, 0.5); background: rgba(255, 255, 255, 0.06); }
.platform-card.is-soon { opacity: 0.55; cursor: not-allowed; }

.platform-icon {
    width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8);
}
.platform-icon svg { width: 30px; height: 30px; }
.platform-icon.lg { width: 66px; height: 66px; border-radius: 18px; }
.platform-icon.lg svg { width: 34px; height: 34px; }

.platform-name { font-weight: 700; font-size: 1rem; }
.platform-tag { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 10px; border-radius: 999px; }
.tag-live { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.tag-soon { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }

/* ---------- back link ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; margin: 8px 0 20px; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 18px; height: 18px; }

/* ---------- downloader ---------- */
.downloader {
    background: var(--card); border: 1px solid var(--card-brd); border-radius: 20px;
    padding: 20px 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); max-width: 760px; margin: 0 auto;
}
.downloader-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.downloader-title { font-size: clamp(1.25rem, 5vw, 1.5rem); font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.downloader-hint { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; line-height: 1.45; }

.url-form { display: flex; flex-direction: column; gap: 10px; }
.url-form .input-wrap:not(.pwd-wrap) { flex: 1 1 auto; width: 100%; }
.pwd-wrap { flex: 1 1 100%; width: 100%; }
.input-wrap { position: relative; display: flex; align-items: center; min-height: var(--touch-min); }
.input-icon { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
#urlInput {
    width: 100%; padding: 14px 48px 14px 46px; font-size: 16px; color: var(--text);
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.22));
    border: 1px solid var(--card-brd); border-radius: 14px; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit; min-height: var(--touch-min);
}
#urlInput::placeholder { color: #64748b; }
#urlInput:focus { border-color: rgba(99, 102, 241, 0.65); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
.clear-btn {
    position: absolute; right: 10px; width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
    display: none; place-items: center; touch-action: manipulation;
}
.clear-btn.show { display: grid; }
.clear-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.15); }

.go-btn {
    flex: 0 0 auto; width: 100%; min-width: 0; min-height: var(--touch-min);
    padding: 14px 28px; border: none; border-radius: 14px; cursor: pointer;
    font-family: inherit; font-size: 1rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 12px 26px -10px rgba(99, 102, 241, 0.8);
    touch-action: manipulation;
}
.go-btn:hover { transform: translateY(-2px); }
.go-btn:active { transform: translateY(0); }
.go-btn.loading { opacity: 0.8; pointer-events: none; }
.go-btn.loading .go-label { opacity: 0.6; }
.go-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.go-btn.loading .go-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- status ---------- */
.status { margin-top: 20px; padding: 14px 16px; border-radius: 12px; font-size: 0.92rem; font-weight: 500; }
.status.info { background: rgba(99, 102, 241, 0.12); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.25); }
.status.error { background: rgba(248, 113, 113, 0.1); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.3); }
.cookie-warn { margin-bottom: 18px; line-height: 1.55; }
.cookie-warn code { background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }

/* ---------- results ---------- */
.results { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; overflow: visible; }
.file-card {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--card-brd); border-radius: 16px;
    animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.file-thumb {
    width: 72px; height: 72px; flex: 0 0 auto; border-radius: 12px; object-fit: cover;
    background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ph { font-size: 1.7rem; }
.file-meta { flex: 1 1 auto; min-width: 0; }
.file-name { font-weight: 700; font-size: 0.98rem; margin: 0 0 4px; word-break: break-word; }
.file-size { color: var(--muted); font-size: 0.85rem; }
.dl-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
    padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; color: #04121a;
    background: linear-gradient(135deg, var(--accent-2), #06b6d4);
    transition: transform 0.12s ease;
    min-height: var(--touch-min); touch-action: manipulation;
    border: none; cursor: pointer; font-family: inherit;
}
.dl-content { display: inline-flex; align-items: center; gap: 8px; }
.dl-spinner {
    display: none;
    width: 16px; height: 16px; border-radius: 999px;
    border: 2px solid rgba(4, 18, 26, 0.2);
    border-top-color: rgba(4, 18, 26, 0.7);
    animation: spin 0.7s linear infinite;
}
.dl-btn.loading .dl-spinner { display: inline-block; }
.dl-btn.loading .dl-label { opacity: 0.7; }
.dl-btn:hover { transform: translateY(-2px); }
.dl-btn svg { width: 17px; height: 17px; }
.dl-btn.disabled { background: rgba(255,255,255,0.08); color: var(--muted); pointer-events: none; }

/* ---------- YouTube quality panel ---------- */
.yt-panel {
    display: flex; gap: 20px; padding: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--card-brd); border-radius: 18px;
    box-shadow: var(--shadow);
    animation: rise 0.35s ease both;
    overflow: visible;
}
.yt-preview {
    position: relative;
    width: 220px; aspect-ratio: 16 / 9; flex: 0 0 auto; border-radius: 14px; overflow: hidden;
    background: #000; display: grid; place-items: center;
    box-shadow: 0 10px 24px -12px rgba(0,0,0,0.8);
}
.yt-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-preview.no-img { background: linear-gradient(135deg, #1a1030, #0c1322); }
.yt-play {
    position: absolute; inset: 0; margin: auto; width: 54px; height: 54px;
    display: grid; place-items: center; border-radius: 50%;
    background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(2px);
    border: 1.5px solid rgba(255, 255, 255, 0.35); pointer-events: none;
    transition: transform 0.2s ease;
}
.yt-preview:hover .yt-play { transform: scale(1.08); }
.yt-play svg { width: 26px; height: 26px; margin-left: 3px; }
.yt-badge {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 0.75rem; font-weight: 700;
    padding: 3px 8px; border-radius: 6px; letter-spacing: 0.02em;
}
.yt-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow: visible; }
.yt-title { margin: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.35; word-break: break-word; }
.yt-uploader { margin: 0; color: var(--muted); font-size: 0.85rem; }
.yt-controls {
    margin-top: auto; padding-top: 16px;
    display: flex; flex-direction: column; align-items: stretch; gap: 12px;
    overflow: visible;
}

/* ---------- quality dropdown ---------- */
.quality-picker {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px;
    padding: 12px; border-radius: 16px;
    background: rgba(0, 0, 0, 0.18); border: 1px solid var(--card-brd);
}
.yt-quality-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.quality-dropdown { display: flex; flex-direction: column; gap: 0; }
.quality-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 14px; border-radius: 14px; border: 1px solid var(--card-brd);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.22));
    color: var(--text); font-family: inherit; cursor: pointer; text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    min-height: var(--touch-min); touch-action: manipulation;
}
.quality-trigger:hover { border-color: rgba(99, 102, 241, 0.45); background: rgba(255,255,255,0.07); }
.quality-trigger:focus { outline: none; border-color: rgba(99, 102, 241, 0.65); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
.quality-picker.is-open .quality-trigger {
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.quality-trigger-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.quality-trigger-label { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quality-trigger-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.quality-trigger-type {
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted);
    background: rgba(255,255,255,0.06); border: 1px solid var(--card-brd);
    padding: 4px 8px; border-radius: 6px;
}
.quality-chevron { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s ease; }
.quality-picker.is-open .quality-chevron { transform: rotate(180deg); color: var(--accent-2); }

.q-badge {
    display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.q-badge-fhd { color: #c4b5fd; background: rgba(139, 92, 246, 0.18); border: 1px solid rgba(139, 92, 246, 0.35); }
.q-badge-hd  { color: #6ee7b7; background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.35); }
.q-badge-sd  { color: #fcd34d; background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.35); }
.q-badge-sm  { color: #94a3b8; background: rgba(148, 163, 184, 0.12); border: 1px solid rgba(148, 163, 184, 0.28); }
.q-badge-audio { color: #f9a8d4; background: rgba(244, 114, 182, 0.14); border: 1px solid rgba(244, 114, 182, 0.35); }
.q-badge-vo  { color: #7dd3fc; background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.35); }

.quality-menu {
    position: relative; z-index: 1;
    margin: 8px 0 0; padding: 6px; list-style: none;
    background: rgba(8, 12, 24, 0.98); border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.65);
    max-height: min(220px, 42vh); overflow-y: auto;
    animation: menuDrop 0.18s ease both;
}
.quality-menu[hidden] { display: none !important; }
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.quality-menu::-webkit-scrollbar { width: 6px; }
.quality-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.quality-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px; border-radius: 10px; cursor: pointer;
    transition: background 0.12s ease;
    min-height: var(--touch-min);
}
.quality-option:hover,
.quality-option:focus { outline: none; background: rgba(99, 102, 241, 0.12); }
.quality-option.is-selected { background: rgba(99, 102, 241, 0.18); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35); }
.q-option-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.q-option-icon {
    width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
    border-radius: 8px; font-size: 0.82rem; color: var(--accent-2);
    background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.2);
}
.q-option-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-option-label { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-option-sub { font-size: 0.76rem; color: var(--muted); }

.quality-summary {
    margin: 0; font-size: 0.8rem; color: var(--muted); padding: 0 2px; line-height: 1.45;
}
.quality-select-native {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.yt-download-btn {
    flex: 0 0 auto; width: 100%; padding: 14px 22px;
    justify-content: center; align-self: stretch;
}
.yt-download-btn.loading { opacity: 0.75; pointer-events: none; }

/* ---------- coming soon box ---------- */
.soon-box { text-align: center; padding: 30px 10px 10px; }
.soon-emoji { font-size: 3rem; }
.soon-box h2 { margin: 12px 0 6px; font-size: 1.6rem; }
.soon-box p { color: var(--muted); margin: 0 0 22px; }
.soon-back { display: inline-block; padding: 12px 22px; border-radius: 12px; text-decoration: none; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #4f46e5); }

/* ---------- CMS pages ---------- */
.cms-page {
    max-width: 760px; margin: 0 auto 24px;
    background: var(--card); border: 1px solid var(--card-brd); border-radius: 20px;
    padding: 28px 24px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.cms-header { text-align: center; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--card-brd); }
.cms-title {
    margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #fff 20%, #a5b4fc 60%, #67e8f9);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cms-body { color: var(--muted); font-size: 0.92rem; line-height: 1.7; }
.cms-body h2 {
    color: var(--text); font-size: 1.1rem; font-weight: 700; margin: 28px 0 10px;
    letter-spacing: -0.01em;
}
.cms-body h2:first-child { margin-top: 0; }
.cms-body h3 { color: var(--text); font-size: 0.98rem; font-weight: 700; margin: 20px 0 8px; }
.cms-body p { margin: 0 0 14px; }
.cms-body a { color: var(--accent-2); text-decoration: none; }
.cms-body a:hover { text-decoration: underline; }
.cms-lead { font-size: 1rem; color: #c7d2fe !important; line-height: 1.65 !important; }
.cms-meta { font-size: 0.82rem; color: #64748b !important; margin-bottom: 20px !important; }
.cms-list { margin: 0 0 16px; padding-left: 1.25rem; }
.cms-list li { margin-bottom: 10px; padding-left: 4px; }
.cms-list li::marker { color: var(--accent-2); }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
    .site-main { padding-left: calc(20px + var(--safe-left)); padding-right: calc(20px + var(--safe-right)); }
    .hero { padding: 28px 10px 30px; }
    .global-search { padding: 22px; border-radius: 24px; margin-bottom: 36px; }
    .downloader { padding: 28px; border-radius: 24px; }
    .url-form { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 12px; }
    .url-form .input-wrap:not(.pwd-wrap) { flex: 1 1 320px; }
    .go-btn { width: auto; min-width: 120px; flex: 0 0 auto; }
    .platform-grid-compact { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .file-card { gap: 16px; padding: 14px; }
    .yt-controls {
        flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: 14px;
    }
    .quality-picker { flex: 1 1 260px; }
    .yt-download-btn {
        width: auto; min-width: 148px; align-self: flex-end;
        margin-top: 0;
    }
}

@media (max-width: 639px) {
    .orb-1 { width: 260px; height: 260px; }
    .orb-2 { width: 220px; height: 220px; }
    .orb-3 { display: none; }
    .footer-nav { gap: 2px 6px; margin-bottom: 12px; }
    .footer-nav-sep { display: none; }
    .footer-nav-link { font-size: 0.78rem; padding: 8px 6px; min-height: var(--touch-min); display: inline-flex; align-items: center; }
    .footer-disclaimer { font-size: 0.7rem; padding-left: 4px; padding-right: 4px; }
    .cms-page { padding: 22px 18px; border-radius: 18px; }
    .cms-body { font-size: 0.88rem; }
    .platform-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .platform-card { padding: 18px 12px 14px; }
    .platform-icon { width: 50px; height: 50px; border-radius: 14px; }
    .platform-icon svg { width: 26px; height: 26px; }
    .platform-name { font-size: 0.88rem; }
    .file-thumb { width: 64px; height: 64px; }
    .file-card { flex-wrap: wrap; }
    .file-meta { flex: 1 1 calc(100% - 80px); }
    .dl-btn { flex: 1 1 100%; }
    .yt-panel { flex-direction: column; padding: 14px; gap: 14px; }
    .yt-preview { width: 100%; }
    .yt-title { font-size: 1rem; }
    .yt-controls { flex-direction: column; align-items: stretch; gap: 12px; }
    .quality-picker { flex: 1 1 auto; padding: 10px; }
    .yt-download-btn { width: 100%; align-self: stretch; }
    .quality-menu { max-height: min(200px, 38vh); }
    .downloader-head { flex-wrap: wrap; }
    .back-link { margin: 4px 0 16px; min-height: var(--touch-min); display: inline-flex; align-items: center; }
    .quality-trigger-main { flex-wrap: wrap; }
    .quality-trigger-hint { display: none; }
}

@media (max-width: 380px) {
    .platform-grid-compact { grid-template-columns: repeat(2, 1fr); }
    .platform-card-sm .platform-name { font-size: 0.75rem; }
    .platform-icon-sm { width: 38px; height: 38px; }
    .hero-title { font-size: 2rem; }
    .brand-domain { font-size: 0.68rem; }
}

@media (hover: none) and (pointer: coarse) {
    .go-btn:hover, .dl-btn:hover, .platform-card.is-active:hover { transform: none; }
    .platform-card.is-active:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.06); }
    .go-btn:active { opacity: 0.9; }
}
