/**
 * Vtorrent  -- Next-Gen UI Stylesheet
 *
 * Premium dark interface with animated gradient borders, glass morphism,
 * noise texture, neon glow interactions, and spring-based micro-animations.
 *
 * @package Vtorrent
 * @version 2.0
 * @copyright Vtorrent v1.0  -- AI Torrent Download Engine by velqai.com. All rights reserved.
 */

/* ===============================================================
   ANIMATED CSS PROPERTIES (for gradient border rotation)
   Firefox < 128 and Safari < 16.4 ignore @property  -- graceful degradation
   =============================================================== */

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ===============================================================
   DESIGN TOKENS
   =============================================================== */

:root {
    /* Core palette */
    --bat-bg: #030712;
    --bat-bg-raised: #0a101f;
    --bat-bg-card: rgba(12, 20, 42, 0.65);
    --bat-bg-card-solid: #0c142a;
    --bat-bg-card-hover: rgba(16, 26, 52, 0.85);
    --bat-bg-input: rgba(0, 0, 0, 0.35);

    /* Border system */
    --bat-border: rgba(255, 255, 255, 0.06);
    --bat-border-light: rgba(255, 255, 255, 0.12);
    --bat-border-accent: rgba(0, 212, 170, 0.25);

    /* Text hierarchy */
    --bat-text: #e8edf5;
    --bat-text-secondary: #a0aec0;
    --bat-text-muted: #5a6578;

    /* Accent colors */
    --bat-accent: #00d4aa;
    --bat-accent-rgb: 0, 212, 170;
    --bat-accent-dim: rgba(0, 212, 170, 0.10);
    --bat-accent-glow: rgba(0, 212, 170, 0.30);
    --bat-purple: #8b5cf6;
    --bat-purple-rgb: 139, 92, 246;
    --bat-purple-dim: rgba(139, 92, 246, 0.10);
    --bat-blue: #3b82f6;
    --bat-blue-rgb: 59, 130, 246;
    --bat-orange: #f59e0b;
    --bat-pink: #ec4899;
    --bat-red: #ef4444;
    --bat-green: #22c55e;

    /* Border radius */
    --bat-radius: 16px;
    --bat-radius-sm: 10px;
    --bat-radius-lg: 24px;
    --bat-radius-pill: 100px;

    /* Motion */
    --bat-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bat-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --bat-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Elevation */
    --bat-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --bat-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --bat-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --bat-shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15), 0 0 60px rgba(0, 212, 170, 0.05);
    --bat-shadow-purple: 0 0 30px rgba(139, 92, 246, 0.15);
    --bat-glass: rgba(255, 255, 255, 0.03);
}

/* ===============================================================
   RESET & BASE
   =============================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Eliminate 300ms tap delay on all interactive elements (mobile) */
button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

/* Ensure range inputs (seek bar, volume) work smoothly on touch */
input[type="range"] {
    -webkit-appearance: none;
    touch-action: none; /* prevents page scroll while dragging */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bat-bg);
    color: var(--bat-text);
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari: respects dynamic address bar */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ===============================================================
   ANIMATED BACKGROUND
   =============================================================== */

.bat-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Noise texture overlay for premium glass feel */
.bat-bg::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0; /* fallback for browsers without inset */
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    opacity: 0.4;
    z-index: 1;
    mix-blend-mode: overlay;
}

.bat-grid-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.4;
}

.bat-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    animation: bat-orb-float 25s ease-in-out infinite;
    will-change: transform;
}

.bat-bg-orb--1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, var(--bat-accent) 0%, transparent 70%);
    top: -250px; right: -150px;
    animation-delay: 0s;
}

.bat-bg-orb--2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--bat-purple) 0%, transparent 70%);
    bottom: -200px; left: -150px;
    animation-delay: -8s;
}

.bat-bg-orb--3 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--bat-blue) 0%, transparent 70%);
    top: 40%; left: 50%;
    transform: translateX(-50%);
    animation-delay: -16s;
}

@keyframes bat-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20%      { transform: translate(40px, -30px) scale(1.08); }
    40%      { transform: translate(-30px, 40px) scale(0.94); }
    60%      { transform: translate(25px, 15px) scale(1.04); }
    80%      { transform: translate(-15px, -25px) scale(0.98); }
}

/* ===============================================================
   APP WRAPPER & CONTAINER
   =============================================================== */

.bat-app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 1;
}

.bat-container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px; /* fallback for browsers without clamp() */
    padding: clamp(24px, 5vw, 64px) clamp(16px, 3vw, 40px);
    /* Safe-area padding for iPhone notch / Android cutout */
    padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right));
    padding-bottom: max(clamp(24px, 5vw, 64px), env(safe-area-inset-bottom));
}

/* ===============================================================
   PAGE HEADER
   =============================================================== */

.bat-page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    animation: bat-slide-down 0.7s var(--bat-ease-out) both;
}

.bat-page-header__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: var(--bat-shadow-glow);
    animation: bat-icon-glow 4s ease-in-out infinite;
}

@keyframes bat-icon-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(var(--bat-accent-rgb), 0.1); }
    50%      { box-shadow: 0 0 30px rgba(var(--bat-accent-rgb), 0.2), 0 0 60px rgba(var(--bat-accent-rgb), 0.05); }
}

.bat-page-header__title {
    font-size: 24px; /* fallback for browsers without clamp() */
    font-size: clamp(20px, 3.2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 40%, var(--bat-accent) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    animation: bat-gradient-text 8s ease infinite;
}

@keyframes bat-gradient-text {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.bat-page-header__sub {
    font-size: 12px;
    color: var(--bat-text-muted);
    font-weight: 400;
    margin-top: 3px;
    letter-spacing: 0.01em;
}

/* ===============================================================
   CONNECTION BADGE
   =============================================================== */

.bat-connection-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(12, 20, 42, 0.8);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--bat-text-muted);
    margin-left: auto;
    flex-shrink: 0;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transition: all 0.4s var(--bat-ease-out);
}

.bat-connection-badge--connected {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    color: var(--bat-accent);
    box-shadow: 0 0 20px rgba(var(--bat-accent-rgb), 0.08);
}

.bat-connection-badge--error {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--bat-red);
}

.bat-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bat-text-muted);
    flex-shrink: 0;
    transition: all 0.4s var(--bat-ease-out);
    position: relative;
}

.bat-connection-badge--connected .bat-connection-dot {
    background: var(--bat-accent);
    box-shadow: 0 0 8px rgba(var(--bat-accent-rgb), 0.6);
}

.bat-connection-badge--connected .bat-connection-dot::after {
    content: '';
    position: absolute;
    top: -4px; right: -4px; bottom: -4px; left: -4px;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--bat-accent-rgb), 0.4);
    animation: bat-ring-pulse 2s ease-out infinite;
}

@keyframes bat-ring-pulse {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.bat-connection-badge--error .bat-connection-dot {
    background: var(--bat-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ===============================================================
   DEVICE STATUS BAR
   =============================================================== */

.bat-device-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 16px;
    background: rgba(12, 20, 42, 0.5);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    margin-bottom: 28px;
    overflow-x: auto;
    animation: bat-slide-down 0.7s var(--bat-ease-out) 0.1s both;
}

.bat-device-bar__item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.bat-device-bar__item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.bat-device-bar__item svg {
    color: var(--bat-text-muted);
    flex-shrink: 0;
    opacity: 0.7;
}

.bat-device-bar__label {
    font-size: 10px;
    font-weight: 700;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bat-device-bar__value {
    font-size: 12px;
    font-weight: 600;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-device-bar__value--accent {
    color: var(--bat-accent);
}

.bat-device-bar__sep {
    width: 1px;
    height: 18px;
    background: var(--bat-border);
    flex-shrink: 0;
    margin: 0 4px;
}

.bat-device-bar__item--ai {
    position: relative;
}

.bat-ai-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bat-accent);
    box-shadow: 0 0 10px rgba(var(--bat-accent-rgb), 0.6);
    animation: bat-ai-breathe 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes bat-ai-breathe {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 10px rgba(var(--bat-accent-rgb), 0.6); }
    50%      { opacity: 0.6; transform: scale(0.85); box-shadow: 0 0 5px rgba(var(--bat-accent-rgb), 0.3); }
}

/* ===============================================================
   INPUT SECTION  -- Primary Action Card
   The heart of the app. Layered glass with depth cues that
   respond to user focus. No spinning borders  -- clean visual
   hierarchy that says "start here".
   =============================================================== */

.bat-input-section {
    margin-bottom: 32px;
    animation: bat-slide-up 0.7s var(--bat-ease-out) 0.15s both;
}

/* *"?*"? Card shell *"?*"? */
.bat-input-card {
    position: relative;
    background:
        linear-gradient(
            168deg,
            rgba(var(--bat-accent-rgb), 0.04) 0%,
            rgba(12, 20, 42, 0.7) 40%,
            rgba(var(--bat-purple-rgb), 0.03) 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--bat-radius-lg);
    padding: 28px; /* fallback for browsers without clamp() */
    padding: clamp(22px, 3vw, 34px);
    -webkit-backdrop-filter: blur(28px);
    backdrop-filter: blur(28px);
    overflow: hidden;
    transition: border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 4px 24px rgba(0, 0, 0, 0.25);
}

/* *"?*"? Focus state: card lifts & border brightens when user is typing *"?*"? */
.bat-input-card:focus-within {
    border-color: rgba(var(--bat-accent-rgb), 0.2);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 0 0 1px rgba(var(--bat-accent-rgb), 0.06),
        0 8px 40px rgba(0, 0, 0, 0.3),
        0 0 60px -10px rgba(var(--bat-accent-rgb), 0.08);
    background:
        linear-gradient(
            168deg,
            rgba(var(--bat-accent-rgb), 0.06) 0%,
            rgba(14, 24, 50, 0.75) 40%,
            rgba(var(--bat-purple-rgb), 0.04) 100%
        );
}

.bat-input-card:hover {
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 8px 40px rgba(0, 0, 0, 0.3);
}

/* *"?*"? Top accent line  -- widens on focus *"?*"? */
.bat-input-card__glow {
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--bat-accent-rgb), 0.5), rgba(var(--bat-purple-rgb), 0.35), transparent);
    opacity: 0.6;
    transition: left 0.5s ease, right 0.5s ease, opacity 0.5s ease;
}

.bat-input-card:focus-within .bat-input-card__glow {
    left: 5%;
    right: 5%;
    opacity: 1;
}

/* *"?*"? Corner accent dots  -- subtle "active area" cue *"?*"? */
.bat-input-card::before,
.bat-input-card::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--bat-accent-rgb), 0.15);
    transition: background 0.5s ease, box-shadow 0.5s ease;
    pointer-events: none;
}

.bat-input-card::before { top: 14px; left: 14px; }
.bat-input-card::after  { top: 14px; right: 14px; }

.bat-input-card:focus-within::before,
.bat-input-card:focus-within::after {
    background: rgba(var(--bat-accent-rgb), 0.5);
    box-shadow: 0 0 8px rgba(var(--bat-accent-rgb), 0.3);
}

/* *.*.*.* Tabs *.*.*.* */
.bat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: var(--bat-radius-sm);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.bat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    background: none;
    color: var(--bat-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-family: inherit;
    position: relative;
}

.bat-tab:hover {
    color: var(--bat-text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.bat-tab--active {
    color: var(--bat-accent);
    background: rgba(var(--bat-accent-rgb), 0.10);
    box-shadow: 0 1px 0 rgba(var(--bat-accent-rgb), 0.18);
}

/* Active tab underline indicator */
.bat-tab--active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 25%; right: 25%;
    height: 2px;
    background: var(--bat-accent);
    border-radius: 1px;
    opacity: 0.6;
}

.bat-tab svg { width: 16px; height: 16px; opacity: 0.55; transition: opacity 0.2s ease; }
.bat-tab--active svg { opacity: 1; stroke: var(--bat-accent); }

/* *.*.*.* Tab Panels *.*.*.* */
.bat-tab-panel { display: none; }
.bat-tab-panel--active {
    display: block;
    animation: bat-tab-reveal 0.3s var(--bat-ease-out);
}

@keyframes bat-tab-reveal {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* *.*.*.* Magnet Input *.*.*.* */
.bat-magnet-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--bat-radius-sm);
    padding: 4px 4px 4px 16px;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.bat-magnet-input-wrap:focus-within {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: rgba(0, 0, 0, 0.35);
    box-shadow:
        0 0 0 3px rgba(var(--bat-accent-rgb), 0.05),
        0 0 20px rgba(var(--bat-accent-rgb), 0.03);
}

.bat-magnet-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.bat-magnet-input-wrap:focus-within .bat-magnet-icon { opacity: 1; }

.bat-magnet-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--bat-text);
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    padding: 13px 0;
    outline: none;
    min-width: 0;
    letter-spacing: -0.01em;
}

.bat-magnet-input::placeholder {
    color: var(--bat-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    letter-spacing: 0;
}

.bat-paste-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--bat-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bat-paste-btn:hover {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: rgba(var(--bat-accent-rgb), 0.08);
    box-shadow: 0 0 10px rgba(var(--bat-accent-rgb), 0.08);
    transform: translateY(-1px);
}

/* *.*.*.* Drop Zone *.*.*.* */
.bat-drop-zone {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.07);
    border-radius: var(--bat-radius);
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.12);
}

.bat-drop-zone:hover {
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: rgba(var(--bat-accent-rgb), 0.02);
}

.bat-drop-zone--active {
    border-color: rgba(var(--bat-accent-rgb), 0.5);
    background: rgba(var(--bat-accent-rgb), 0.04);
    box-shadow: 0 0 40px rgba(var(--bat-accent-rgb), 0.06) inset;
    transform: scale(1.005);
}

.bat-drop-zone__content { pointer-events: none; }

.bat-drop-zone__icon {
    margin-bottom: 14px;
    opacity: 0.45;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bat-drop-zone:hover .bat-drop-zone__icon {
    opacity: 0.75;
    transform: translateY(-2px);
}

.bat-drop-zone__text {
    font-size: 14px;
    color: var(--bat-text-secondary);
    margin-bottom: 4px;
}

.bat-drop-zone__sub {
    font-size: 12px;
    color: var(--bat-text-muted);
}

.bat-drop-zone__input {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* *.*.*.* Add Torrent Button *.*.*.* */
.bat-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 32px;
    margin-top: 20px;
    border: none;
    border-radius: var(--bat-radius-sm);
    background: linear-gradient(135deg, var(--bat-accent), #009e7e);
    color: #030712;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

/* Shimmer sweep */
.bat-start-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.bat-start-btn:not(:disabled):hover::after { left: 130%; }

.bat-start-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 24px rgba(var(--bat-accent-rgb), 0.3),
        0 0 0 1px rgba(var(--bat-accent-rgb), 0.15);
}

.bat-start-btn:not(:disabled):active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 2px 8px rgba(var(--bat-accent-rgb), 0.2);
}

.bat-start-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    filter: saturate(0.3) brightness(0.9);
}

.bat-start-btn__loader { display: none; }
.bat-start-btn--loading .bat-start-btn__text { display: none; }
.bat-start-btn--loading .bat-start-btn__icon { display: none; }
.bat-start-btn--loading .bat-start-btn__loader { display: flex; align-items: center; gap: 8px; }
.bat-start-btn--loading { opacity: 0.85; pointer-events: none; }

.bat-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(3, 7, 18, 0.15);
    border-top-color: #030712;
    border-radius: 50%;
    animation: bat-spin 0.7s linear infinite;
}

@keyframes bat-spin { to { transform: rotate(360deg); } }

/* ===============================================================
   SECTION HEADERS
   =============================================================== */

.bat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bat-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--bat-text);
    letter-spacing: -0.02em;
}

.bat-download-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--bat-accent);
    background: var(--bat-accent-dim);
    padding: 4px 14px;
    border-radius: var(--bat-radius-pill);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.15);
    letter-spacing: 0.02em;
}

/* ===============================================================
   DOWNLOAD CARDS  -- Next-Gen AI-Driven Torrent Status Cards
   
   Design Philosophy:
   *?* Each card = a live status dashboard for one torrent
   *?* Visual hierarchy: Name *?' Status *?' Files *?' Actions
   *?* State communicated through color, not animation noise
   *?* Three states: loading (muted), ready (accent), streaming (amber)
   *?* Zero background animations  -- all motion is purpose-driven
   =============================================================== */

.bat-downloads-section {
    margin-bottom: 36px;
    animation: bat-slide-up 0.5s var(--bat-ease-out) both;
}

.bat-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* *"?*"? Card Shell *"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"? */

.bat-dl-card {
    position: relative;
    background: linear-gradient(170deg,
        rgba(14, 22, 44, 0.82) 0%,
        rgba(10, 16, 32, 0.68) 50%,
        rgba(8, 13, 28, 0.58) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding-bottom: 6px;
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    backdrop-filter: blur(28px) saturate(1.2);
    transition:
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: bat-card-enter 0.5s var(--bat-ease-out) both;
    overflow: hidden;
    isolation: isolate;
}

/* Top glow line  -- state-aware accent strip */
.bat-dl-card__top-glow {
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--bat-accent-rgb), 0.0),
        transparent);
    transition: all 0.5s ease;
    z-index: 2;
}

/* Ready state  -- glow line activates */
/* BUG-FIX: :has() not supported in Firefox < 121 — use JS-applied class instead */
.bat-dl-card--has-files .bat-dl-card__top-glow,
.bat-dl-card--done .bat-dl-card__top-glow {
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--bat-accent-rgb), 0.5),
        rgba(var(--bat-accent-rgb), 0.7),
        rgba(var(--bat-accent-rgb), 0.5),
        transparent);
    box-shadow: 0 0 12px rgba(var(--bat-accent-rgb), 0.15);
}

/* Streaming state  -- amber glow */
.bat-dl-card--streaming .bat-dl-card__top-glow {
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(245, 158, 11, 0.5),
        rgba(245, 158, 11, 0.7),
        rgba(245, 158, 11, 0.5),
        transparent);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.12);
    animation: bat-stream-glow 2.5s ease-in-out infinite;
}

@keyframes bat-stream-glow {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1; }
}

.bat-dl-card:hover {
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    transform: translateY(-2px);
}

@keyframes bat-card-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Legacy alias  -- JS references both */
@keyframes bat-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bat-dl-card--done {
    border-color: rgba(var(--bat-accent-rgb), 0.12);
}

.bat-dl-card--removing {
    opacity: 0;
    transform: translateX(-40px) scale(0.95);
    filter: blur(4px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bat-dl-card--highlight {
    animation: bat-highlight-glow 1.5s ease;
}

@keyframes bat-highlight-glow {
    0%   { box-shadow: 0 0 0 0 rgba(var(--bat-accent-rgb), 0.5); }
    25%  { box-shadow: 0 0 28px 4px rgba(var(--bat-accent-rgb), 0.15); }
    100% { box-shadow: none; }
}

/* *"?*"? Card Header *"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"? */

.bat-dl-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 24px 0 24px;
}

.bat-dl-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bat-accent-rgb), 0.07);
    border-radius: 12px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.12);
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.bat-dl-card:hover .bat-dl-card__icon {
    background: rgba(var(--bat-accent-rgb), 0.12);
    border-color: rgba(var(--bat-accent-rgb), 0.22);
    box-shadow: 0 0 16px rgba(var(--bat-accent-rgb), 0.08) inset;
}

.bat-dl-card__info {
    flex: 1;
    min-width: 0;
}

.bat-dl-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

.bat-dl-card:hover .bat-dl-card__name {
    color: #fff;
}

/* Meta row  -- size -- file count */
.bat-dl-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.bat-dl-card__size {
    font-size: 12px;
    color: var(--bat-text-muted);
    font-weight: 500;
    display: inline;
    font-variant-numeric: tabular-nums;
}

.bat-dl-card__meta-sep {
    color: var(--bat-text-muted);
    opacity: 0.35;
    font-size: 10px;
    line-height: 1;
    align-self: center;
}

.bat-dl-card__file-count {
    font-size: 12px;
    color: var(--bat-accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    transition: opacity 0.25s ease;
}

.bat-dl-card:hover .bat-dl-card__file-count {
    opacity: 1;
}

.bat-dl-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* TTL Badge  -- clean, informational */
.bat-dl-card__ttl {
    font-size: 10px;
    color: var(--bat-text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: var(--bat-radius-pill);
    white-space: nowrap;
    letter-spacing: 0.03em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.bat-dl-card__ttl--warn {
    color: var(--bat-orange);
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.18);
    animation: bat-ttl-warn 2.5s ease-in-out infinite;
}

@keyframes bat-ttl-warn {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Remove Button */
.bat-dl-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--bat-text-muted);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bat-dl-card__btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--bat-text-secondary);
    border-color: rgba(255, 255, 255, 0.10);
}

.bat-dl-card__btn--remove:hover {
    color: var(--bat-red);
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.06);
}

/* *"?*"? Status Bar *"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"?*"? */

.bat-dl-card__status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px 4px;
    font-size: 13px;
}

.bat-dl-card__status-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bat-text-muted);
    flex-shrink: 0;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Active dot  -- pulsing ring */
.bat-dl-card__status-dot--active::after {
    content: '';
    position: absolute;
    top: -4px; right: -4px; bottom: -4px; left: -4px;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    opacity: 0;
    animation: bat-dot-pulse 2s ease-in-out infinite;
}

@keyframes bat-dot-pulse {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50%      { opacity: 0.45; transform: scale(1.2); }
}

/* Contextual dot glow  -- streaming amber */
.bat-dl-card__status-dot[style*="f59e0b"] {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}
/* Ready green */
.bat-dl-card__status-dot[style*="00d4aa"] {
    box-shadow: 0 0 6px rgba(var(--bat-accent-rgb), 0.28);
}

.bat-dl-card__status-text {
    color: var(--bat-text-secondary);
    font-weight: 500;
}

.bat-dl-card__peers {
    font-size: 11px;
    color: var(--bat-text-muted);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.bat-dl-card:hover .bat-dl-card__peers {
    opacity: 1;
}

.bat-dl-card__relay-speed {
    font-size: 12px;
    color: var(--bat-accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===============================================================
   FILE LIST  -- Collapsible Smart Panel
   =============================================================== */

.bat-dl-card__files-list {
    display: flex;
    flex-direction: column;
    padding: 0 16px 8px;
    margin-top: 2px;
}

/* *"?*"? Toggle Header  -- the primary CTA for browsing files *"?*"? */

.bat-files-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 12px;
    margin: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
    color: var(--bat-text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.bat-files-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--bat-text);
}

.bat-files-toggle:focus-visible {
    outline: 2px solid rgba(var(--bat-accent-rgb), 0.4);
    outline-offset: -2px;
    border-radius: 10px;
}

.bat-files-toggle__left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bat-files-toggle__chevron {
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: rotate(-90deg);
    opacity: 0.5;
    color: var(--bat-accent);
}

/* Chevron rotates when panel is open */
.bat-files-toggle[aria-expanded="true"] .bat-files-toggle__chevron {
    transform: rotate(0deg);
    opacity: 1;
}

/* File count badge  -- gradient border + accent fill */
.bat-files-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(var(--bat-accent-rgb), 0.14), rgba(var(--bat-accent-rgb), 0.06));
    border: 1px solid rgba(var(--bat-accent-rgb), 0.18);
    color: var(--bat-accent);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bat-files-toggle:hover .bat-files-toggle__count {
    background: linear-gradient(135deg, rgba(var(--bat-accent-rgb), 0.22), rgba(var(--bat-accent-rgb), 0.10));
    border-color: rgba(var(--bat-accent-rgb), 0.30);
    box-shadow: 0 0 10px rgba(var(--bat-accent-rgb), 0.06);
}

.bat-files-toggle__label {
    color: var(--bat-text);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.bat-files-toggle__sep {
    color: var(--bat-text-muted);
    opacity: 0.35;
    font-size: 11px;
}

.bat-files-toggle__size {
    color: var(--bat-text-muted);
    font-weight: 500;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Browse hint  -- accent colored with icon, gap widens on hover */
.bat-files-toggle__hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--bat-accent);
    font-weight: 600;
    opacity: 0.65;
    transition: opacity 0.25s ease, gap 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.01em;
}

.bat-files-toggle__hint svg {
    opacity: 0.8;
    stroke: var(--bat-accent);
    transition: opacity 0.25s ease;
}

.bat-files-toggle:hover .bat-files-toggle__hint {
    opacity: 1;
    gap: 7px;
}

.bat-files-toggle:hover .bat-files-toggle__hint svg {
    opacity: 1;
}

/* *"?*"? Collapsible Panel  -- CSS grid trick for smooth height animation *"?*"? */

.bat-files-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.15, 1);
    will-change: grid-template-rows;
}

.bat-files-panel--open {
    grid-template-rows: 1fr;
}

.bat-files-panel__inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 420px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.bat-files-panel--open .bat-files-panel__inner {
    overflow-y: auto;
    padding-bottom: 2px;
}

.bat-files-panel__inner:hover {
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* Webkit scrollbar  -- hairline */
.bat-files-panel__inner::-webkit-scrollbar { width: 4px; }
.bat-files-panel__inner::-webkit-scrollbar-track { background: transparent; }
.bat-files-panel__inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.bat-files-panel__inner:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
}

/* *"?*"? File Row *"?*"? */

.bat-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.bat-file-row + .bat-file-row {
    border-top: 1px solid rgba(255, 255, 255, 0.025);
}

.bat-file-row:first-child { border-top: none; }

.bat-file-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.bat-file-row__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.bat-file-row:hover .bat-file-row__icon {
    opacity: 0.85;
}

.bat-file-row__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--bat-text-secondary);
    font-weight: 450;
    line-height: 1.4;
    transition: color 0.25s ease;
}

.bat-file-row:hover .bat-file-row__name {
    color: var(--bat-text);
}

.bat-file-row__size {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--bat-text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 56px;
    text-align: right;
}

.bat-file-row__progress {
    font-variant-numeric: tabular-nums;
}

/* *"?*"? Save / Download Button  -- sweep light effect *"?*"? */

.bat-file-row__save {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.20);
    background: rgba(var(--bat-accent-rgb), 0.04);
    color: var(--bat-accent);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.bat-file-row__save::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(var(--bat-accent-rgb), 0.08) 45%,
        rgba(var(--bat-accent-rgb), 0.12) 50%,
        rgba(var(--bat-accent-rgb), 0.08) 55%,
        transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    pointer-events: none;
    z-index: 1;
}

.bat-file-row__save:hover::before {
    transform: translateX(120%);
}

.bat-file-row__save:hover {
    background: rgba(var(--bat-accent-rgb), 0.10);
    border-color: rgba(var(--bat-accent-rgb), 0.40);
    box-shadow: 0 2px 12px rgba(var(--bat-accent-rgb), 0.08);
    transform: translateY(-1px);
}

.bat-file-row__save:active {
    transform: translateY(0);
    box-shadow: none;
}

.bat-file-row__save:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.bat-file-row__save--active {
    border-color: rgba(var(--bat-accent-rgb), 0.35);
    animation: bat-save-active 1.8s ease-in-out infinite;
}

@keyframes bat-save-active {
    0%, 100% { background: rgba(var(--bat-accent-rgb), 0.05); }
    50%      { background: rgba(var(--bat-accent-rgb), 0.12); }
}

.bat-file-row__save--done {
    border-color: rgba(var(--bat-accent-rgb), 0.35);
    background: rgba(var(--bat-accent-rgb), 0.10);
    color: var(--bat-accent);
}

.bat-file-row--more {
    font-size: 12px;
    color: var(--bat-text-muted);
    justify-content: center;
    padding: 8px 0;
}

.bat-file-row--actions {
    justify-content: flex-end;
    padding-top: 10px;
    border-top: none;
}

/* *"?*"? Download All Button  -- sweep light *"?*"? */

.bat-dl-all-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid rgba(var(--bat-purple-rgb), 0.22);
    background: rgba(var(--bat-purple-rgb), 0.05);
    color: var(--bat-purple);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.bat-dl-all-btn::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(var(--bat-purple-rgb), 0.08) 45%,
        rgba(var(--bat-purple-rgb), 0.12) 50%,
        rgba(var(--bat-purple-rgb), 0.08) 55%,
        transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    pointer-events: none;
    z-index: 1;
}

.bat-dl-all-btn:hover::before {
    transform: translateX(120%);
}

.bat-dl-all-btn:hover {
    background: rgba(var(--bat-purple-rgb), 0.12);
    border-color: rgba(var(--bat-purple-rgb), 0.40);
    box-shadow: 0 2px 12px rgba(var(--bat-purple-rgb), 0.08);
    transform: translateY(-1px);
}

.bat-dl-all-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Small Spinner (in save buttons) */
.bat-spinner-sm {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(var(--bat-accent-rgb), 0.2);
    border-top-color: var(--bat-accent);
    border-radius: 50%;
    animation: bat-spin 0.6s linear infinite;
}

/* ===============================================================
   PROGRESS BAR  -- Minimal, Clean
   =============================================================== */

.bat-dl-card__progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-top: 6px;
    margin-bottom: 4px;
}

.bat-dl-card__progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bat-dl-card__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bat-accent);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.bat-dl-card__progress-glow {
    position: absolute;
    top: -2px;
    left: 0;
    height: 8px;
    width: 0%;
    background: linear-gradient(90deg, transparent, rgba(var(--bat-accent-rgb), 0.22));
    filter: blur(4px);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bat-dl-card__percent {
    font-size: 13px;
    font-weight: 700;
    color: var(--bat-accent);
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* *"?*"? Card Stats *"?*"? */

.bat-dl-card__stats {
    display: flex;
    gap: 20px;
    padding: 0 24px 4px;
    flex-wrap: wrap;
}

.bat-dl-card__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-dl-card__stat-icon {
    font-size: 14px;
    font-weight: 700;
    color: var(--bat-accent);
}

.bat-dl-card__stat-icon--up { color: var(--bat-purple); }

.bat-dl-card__stat-label {
    color: var(--bat-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
}

/* *"?*"? Watch Button  -- video streaming CTA *"?*"? */

.bat-file-row__watch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.bat-file-row__watch::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(59, 130, 246, 0.08) 45%,
        rgba(59, 130, 246, 0.14) 50%,
        rgba(59, 130, 246, 0.08) 55%,
        transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    pointer-events: none;
    z-index: 1;
}

.bat-file-row__watch:hover::before {
    transform: translateX(120%);
}

.bat-file-row__watch:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.40);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.10);
    transform: translateY(-1px);
}

.bat-file-row__watch:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Audio Listen button variant */
.bat-file-row__watch--audio {
    border-color: rgba(139, 92, 246, 0.22);
    background: rgba(139, 92, 246, 0.05);
    color: #8b5cf6;
}

.bat-file-row__watch--audio::before {
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(139, 92, 246, 0.08) 45%,
        rgba(139, 92, 246, 0.14) 50%,
        rgba(139, 92, 246, 0.08) 55%,
        transparent 65%);
}

.bat-file-row__watch--audio:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.40);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.10);
}

/* ===============================================================
   VIDEO PLAYER  -- Full-Screen Overlay with Controls
   
   Design: Cinema-grade dark overlay, glass controls bar,
   smooth seek, auto-hide UI, keyboard shortcuts.
   =============================================================== */

.vt-player {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.vt-player--open {
    opacity: 1;
    visibility: visible;
}

.vt-player__backdrop {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.vt-player__container {
    position: relative;
    width: 92vw;
    max-width: 1400px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    animation: vt-player-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vt-player--open .vt-player__container {
    animation: vt-player-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes vt-player-enter {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* *"?*"? Header *"?*"? */

.vt-player__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vt-player__header--hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.vt-player__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.vt-player__live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.30);
    color: #ef4444;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.vt-player__resource-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.12);
    color: rgba(59, 130, 246, 0.8);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.vt-player__cache-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.vt-player__cache-text {
    font-variant-numeric: tabular-nums;
}

.vt-player__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    animation: vt-live-pulse 1.5s ease-in-out infinite;
}

@keyframes vt-live-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.vt-player__title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.vt-player__size {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.vt-player__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.vt-player__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* *"?*"? Viewport *"?*"? */

.vt-player__viewport {
    position: relative;
    width: 100%;
    height: 0; /* fallback for browsers without aspect-ratio */
    padding-bottom: 56.25%; /* 16:9 fallback via padding-bottom trick */
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation; /* prevent accidental zoom on mobile double-tap to fullscreen */
}

/* Undo padding-bottom trick when aspect-ratio is supported */
@supports (aspect-ratio: 16 / 9) {
    .vt-player__viewport {
        height: auto;
        padding-bottom: 0;
    }
}

.vt-player__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.vt-player__loading {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.vt-player__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: bat-spin 0.7s linear infinite;
}

.vt-player__loading-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.vt-player__center-play {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    color: rgba(255, 255, 255, 0.8);
    transition: opacity 0.25s ease;
    pointer-events: auto;
}

.vt-player__center-play:hover {
    color: #fff;
}

.vt-player__unmute {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: vt-unmute-pulse 2s ease infinite;
    transition: background 0.2s ease, transform 0.15s ease;
    pointer-events: auto;
}

.vt-player__unmute:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateX(-50%) scale(1.05);
}

@keyframes vt-unmute-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.vt-player__error {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.6);
    z-index: 6;
}

.vt-player__error-text {
    font-size: 13px;
    max-width: 400px;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.vt-player__error-retry {
    margin-top: 12px;
    padding: 10px 28px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.vt-player__error-retry:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* *"?*"? Audio Art (shown in audio mode instead of video) *"?*"? */

.vt-player__audio-art {
    display: none;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 2;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

.vt-player--audio .vt-player__audio-art {
    display: flex;
}

.vt-player--audio .vt-player__viewport {
    aspect-ratio: auto;
    min-height: 300px;
    max-height: 360px;
    background: linear-gradient(180deg, #0a0a1a 0%, #030712 100%);
}

.vt-player--audio .vt-player__container {
    max-width: 600px;
}

.vt-player__audio-disc {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.04));
    border: 2px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    transition: transform 0.3s ease;
}

.vt-player__audio-disc--spinning {
    animation: vt-disc-spin 4s linear infinite;
}

@keyframes vt-disc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vt-player__audio-title {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    max-width: 400px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vt-player__audio-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Audio mode  -- purple accent instead of blue */
.vt-player--audio .vt-player__live-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.vt-player--audio .vt-player__live-dot {
    background: #8b5cf6;
}

.vt-player--audio .vt-player__played {
    background: #8b5cf6;
}

.vt-player--audio .vt-player__spinner {
    border-top-color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
}

/* *"?*"? Controls Bar *"?*"? */

.vt-player__controls {
    padding: 0 16px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vt-player__controls--hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Progress bar */
.vt-player__progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.vt-player__progress-bar:hover {
    height: 6px;
}

.vt-player__prefetched {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    transition: width 0.5s ease;
    pointer-events: none;
}

.vt-player__buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.vt-player__played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #3b82f6;
    border-radius: 2px;
    z-index: 1;
    transition: width 0.1s linear;
}

.vt-player__seek {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Controls row */
.vt-player__controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vt-player__controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vt-player__controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vt-player__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.vt-player__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.vt-player__volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vt-player__volume {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.vt-player__volume:hover {
    opacity: 1;
}

.vt-player__volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.vt-player__volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.vt-player__time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    margin-left: 4px;
    white-space: nowrap;
}

/* ===============================================================
   PLAYER  -- BUFFER HEALTH INDICATOR
   =============================================================== */

.vt-player__buffer-health {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.vt-player__health-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.vt-player__health-text {
    font-variant-numeric: tabular-nums;
}

/* ===============================================================
   PLAYER  -- SPEED MENU
   =============================================================== */

.vt-player__speed-btn {
    font-size: 12px !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}

.vt-player__speed-menu,
.vt-player__sub-menu,
.vt-player__audio-track-menu {
    position: absolute;
    bottom: 70px;
    right: 20px;
    background: rgba(10, 12, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    z-index: 20;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    max-height: 300px;
    overflow-y: auto;
    animation: vt-menu-enter 0.2s ease both;
}

@keyframes vt-menu-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vt-player__speed-opt,
.vt-player__sub-opt {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vt-player__speed-opt:hover,
.vt-player__sub-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.vt-player__speed-opt--active,
.vt-player__sub-opt--active {
    color: var(--bat-accent);
    background: rgba(var(--bat-accent-rgb), 0.1);
    font-weight: 700;
}

.vt-player__speed-opt--active:hover,
.vt-player__sub-opt--active:hover {
    background: rgba(var(--bat-accent-rgb), 0.15);
    color: var(--bat-accent);
}

/* ===============================================================
   PLAYER  -- KEYBOARD SHORTCUTS OVERLAY
   =============================================================== */

.vt-player__shortcuts-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: vt-menu-enter 0.2s ease both;
}

.vt-player__shortcuts-card {
    background: rgba(12, 16, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.vt-player__shortcuts-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    text-align: center;
}

.vt-player__shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.vt-player__shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.vt-player__shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    white-space: nowrap;
}

.vt-player__shortcut span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.vt-player__shortcuts-close {
    display: block;
    margin: 20px auto 0;
    padding: 8px 24px;
    background: rgba(var(--bat-accent-rgb), 0.12);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.25);
    color: var(--bat-accent);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.vt-player__shortcuts-close:hover {
    background: rgba(var(--bat-accent-rgb), 0.2);
}

/* ===============================================================
   PLAYER  -- MINI PLAYER MODE
   =============================================================== */

.vt-player--mini {
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
    padding: 20px;
}

.vt-player--mini .vt-player__backdrop {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.vt-player--mini .vt-player__container {
    width: 400px;
    max-width: 400px;
    pointer-events: auto;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: vt-mini-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    resize: both;
    overflow: auto;
    min-width: 280px;
    min-height: 180px;
}

@keyframes vt-mini-enter {
    from { opacity: 0; transform: scale(0.8) translateX(30px) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateX(0) translateY(0); }
}

.vt-player--mini .vt-player__header {
    padding: 8px 12px;
}

.vt-player--mini .vt-player__title {
    font-size: 11px;
}

.vt-player--mini .vt-player__size,
.vt-player--mini .vt-player__live-badge {
    display: none;
}

.vt-player--mini .vt-player__controls {
    padding: 0 10px 8px;
}

.vt-player--mini .vt-player__time {
    display: none;
}

.vt-player--mini .vt-player__volume-group {
    display: none;
}

.vt-player--mini .vt-player__buffer-health,
.vt-player--mini .vt-player__shortcuts-btn,
.vt-player--mini .vt-player__sub-btn,
.vt-player--mini .vt-player__cache-badge,
.vt-player--mini .vt-player__resource-badge {
    display: none;
}

/* Audio mode mini-player tweaks */
.vt-player--mini.vt-player--audio .vt-player__viewport {
    min-height: 120px;
    max-height: 180px;
}

.vt-player--mini.vt-player--audio .vt-player__audio-disc {
    width: 60px;
    height: 60px;
}

.vt-player--mini.vt-player--audio .vt-player__audio-disc svg {
    width: 40px;
    height: 40px;
}

.vt-player--mini.vt-player--audio .vt-player__audio-title {
    font-size: 12px;
}

.vt-player--mini.vt-player--audio .vt-player__audio-sub {
    display: none;
}

/* ===============================================================
   PLAYER  -- MOBILE RESPONSIVE
   =============================================================== */

@media (max-width: 640px) {
    .vt-player__container { width: 100vw; max-width: 100vw; border-radius: 0; }
    .vt-player__shortcuts-grid { grid-template-columns: 1fr; }
    .vt-player__shortcuts-card { padding: 20px 16px; width: 95%; }
    .vt-player--mini .vt-player__container { width: 260px; min-width: 200px; }
    .vt-player__speed-menu,
    .vt-player__sub-menu,
    .vt-player__audio-track-menu { right: 10px; bottom: 60px; min-width: 100px; }
    .vt-player__header { padding: 10px 12px; }
    .vt-player__title { font-size: 12px; }
    .vt-player__controls { padding: 0 10px 10px; }
    .vt-player__controls-row { gap: 2px; }
    .vt-player__btn { width: 30px; height: 30px; }
    .vt-player__volume { width: 50px; }
    .vt-player__buffer-health { font-size: 9px; padding: 2px 6px; }
}

/* ===============================================================
   ANALYTICS SECTION
   =============================================================== */

.bat-analytics-section {
    margin-bottom: 32px;
    animation: bat-slide-up 0.5s var(--bat-ease-out) 0.1s both;
}

.bat-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.bat-analytics-card {
    background: var(--bat-bg-card);
    border: 1px solid var(--bat-border);
    border-radius: var(--bat-radius);
    padding: 20px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bat-analytics-card:hover {
    border-color: var(--bat-border-light);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.bat-analytics-card__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.bat-chart-canvas {
    width: 100%;
    max-height: 180px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.bat-analytics-card__stats {
    display: flex;
    gap: 20px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bat-border);
}

.bat-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bat-stat__icon { font-size: 15px; font-weight: 700; }
.bat-stat__icon--down { color: var(--bat-accent); }
.bat-stat__icon--up   { color: var(--bat-purple); }

.bat-stat__label {
    font-size: 10px;
    font-weight: 700;
    color: var(--bat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bat-stat__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--bat-text-secondary);
    font-variant-numeric: tabular-nums;
}

.bat-stat__value--accent { color: var(--bat-accent); }

/* ===============================================================
   COMPLETED SECTION
   =============================================================== */

.bat-completed-section {
    margin-bottom: 32px;
    animation: bat-slide-up 0.5s var(--bat-ease-out) both;
}

.bat-completed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bat-completed-card {
    background: var(--bat-bg-card);
    border: 1px solid rgba(var(--bat-accent-rgb), 0.12);
    border-radius: var(--bat-radius);
    padding: 20px;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    animation: bat-card-enter 0.4s var(--bat-ease-out) both;
}

.bat-completed-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.bat-completed-card__check {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bat-accent-dim);
    border-radius: 12px;
    animation: bat-check-pop 0.5s var(--bat-spring) both;
}

@keyframes bat-check-pop {
    0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.bat-completed-card__info {
    flex: 1;
    min-width: 0;
}

.bat-completed-card__info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--bat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bat-completed-card__meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--bat-text-muted);
    margin-top: 4px;
    flex-wrap: wrap;
}

.bat-completed-card__save-all {
    flex-shrink: 0;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
    color: var(--bat-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.bat-completed-card__save-all:hover {
    background: rgba(var(--bat-accent-rgb), 0.18);
    box-shadow: 0 0 20px rgba(var(--bat-accent-rgb), 0.12);
    transform: translateY(-1px);
}

.bat-completed-card__files {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bat-completed-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bat-completed-file:first-child { border-top: none; }

.bat-completed-file__icon { flex-shrink: 0; display: flex; align-items: center; }

.bat-completed-file__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bat-text-secondary);
}

.bat-completed-file__size {
    flex-shrink: 0;
    color: var(--bat-text-muted);
    font-variant-numeric: tabular-nums;
}

.bat-completed-file__save {
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid var(--bat-border);
    background: var(--bat-glass);
    color: var(--bat-text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}

.bat-completed-file__save:hover {
    color: var(--bat-accent);
    border-color: rgba(var(--bat-accent-rgb), 0.3);
    background: var(--bat-accent-dim);
}

.bat-completed-file--more {
    color: var(--bat-text-muted);
    font-style: italic;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===============================================================
   PAGE FOOTER
   =============================================================== */

.bat-page-footer {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--bat-border);
    text-align: center;
}

.bat-page-footer__text {
    font-size: 12px;
    color: var(--bat-text-muted);
}

.bat-page-footer__text a {
    color: var(--bat-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bat-page-footer__text a:hover {
    color: var(--bat-accent);
}

/* ===============================================================
   METADATA RETRY BUTTON
   =============================================================== */

.bat-meta-retry {
    margin-left: 10px;
    padding: 3px 12px;
    font-size: 11px;
    border: 1px solid rgba(var(--bat-accent-rgb), 0.3);
    color: var(--bat-accent);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.25s ease;
}

.bat-meta-retry:hover {
    background: var(--bat-accent-dim);
    box-shadow: 0 0 10px rgba(var(--bat-accent-rgb), 0.1);
}

/* ===============================================================
   LEGACY v1.0 LAYOUT CLASSES (backward compat)
   =============================================================== */

.bat-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* ===============================================================
   SCROLLBAR & SELECTION
   =============================================================== */

.bat-app ::-webkit-scrollbar { width: 5px; height: 5px; }
.bat-app ::-webkit-scrollbar-track { background: transparent; }
.bat-app ::-webkit-scrollbar-thumb { background: rgba(var(--bat-accent-rgb), 0.2); border-radius: 3px; }
.bat-app ::-webkit-scrollbar-thumb:hover { background: rgba(var(--bat-accent-rgb), 0.35); }

.bat-app ::selection {
    background: rgba(var(--bat-accent-rgb), 0.2);
    color: #fff;
}

/* ===============================================================
   KEYFRAME ANIMATIONS
   =============================================================== */

@keyframes bat-slide-down {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bat-slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bat-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes bat-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bat-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ===============================================================
   RESPONSIVE
   =============================================================== */

@media (max-width: 768px) {
    .bat-device-bar {
        gap: 0;
        padding: 6px 10px;
        flex-wrap: nowrap;
    }

    .bat-device-bar__item { padding: 4px 8px; }
    .bat-device-bar__label { display: none; }

    .bat-dl-card__stats { gap: 12px; }
    .bat-analytics-grid { grid-template-columns: 1fr; }

    .bat-completed-card__header { flex-wrap: wrap; }
    .bat-completed-card__save-all { width: 100%; text-align: center; }

    .bat-connection-badge {
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 5px 12px;
    }

    .bat-page-header {
        padding-right: 130px;
    }

    /* No animated borders on mobile  -- save battery */
    .bat-dl-card::before,
    .bat-input-card::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .bat-page-header {
        flex-direction: column;
        text-align: center;
        padding-right: 0;
    }

    .bat-connection-badge {
        position: relative;
        top: auto;
        right: auto;
        margin: 0 auto;
    }

    .bat-tabs { flex-direction: column; }

    .bat-dl-card { padding: 16px; }
    .bat-dl-card__header { flex-wrap: wrap; }

    .bat-file-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .bat-file-row__save {
        align-self: stretch;
        justify-content: center;
    }

    .bat-completed-card__meta {
        flex-direction: column;
        gap: 2px;
    }
}

/* ===============================================================
   PREFERS REDUCED MOTION
   =============================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bat-bg-orb { animation: none; }
    .bat-dl-card::before,
    .bat-input-card::before { display: none; }
}
