/* ==========================================================================
   AUTOSHORT v6.5 ULTRA-LUXURY DOMOTIC SMART-PENTHOUSE ARCHITECTURE
   "La trasformazione da casa di legno a Smart Hub Domotico di Ultima Generazione"
   Brushed Titanium · Ambient Architectural LED Washes · Tactile Touch Switches · Quantum Telemetry
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. DOMOTIC COLOR SPECTRUM & ARCHITECTURAL TOKENS
   ========================================================================== */
:root {
    /* ⚡ Laser Neon Accent Spectrum (Smart Lighting Channels) */
    --neon-cyan: #00f0ff;
    --neon-cyan-glow: rgba(0, 240, 255, 0.45);
    --neon-cyan-subtle: rgba(0, 240, 255, 0.12);
    
    --neon-violet: #8b5cf6;
    --neon-violet-glow: rgba(139, 92, 246, 0.45);
    
    --neon-emerald: #00ff88;
    --neon-emerald-glow: rgba(0, 255, 136, 0.5);
    
    --neon-amber: #ffaa00;
    --neon-amber-glow: rgba(255, 170, 0, 0.45);
    
    --neon-rose: #ff0055;

    /* 🏛️ Titanium & OLED Obsidian Canvas (Smart Wall Panels) */
    --bg-page: #03060f;
    --bg-panel-titanium: #070c18;
    --bg-surface-glass: rgba(10, 16, 32, 0.78);
    --bg-surface-elevated: rgba(16, 25, 48, 0.88);
    --bg-card: rgba(8, 14, 28, 0.85);
    --bg-card-hover: rgba(14, 22, 44, 0.95);
    --bg-input-hub: rgba(4, 8, 18, 0.94);

    /* 💎 Glassmorphism & Precision Laser Borders */
    --border-titanium: rgba(255, 255, 255, 0.08);
    --border-titanium-hover: rgba(255, 255, 255, 0.22);
    --border-laser: rgba(0, 240, 255, 0.4);
    --border-laser-glow: rgba(0, 240, 255, 0.7);
    --border-laser-violet: rgba(139, 92, 246, 0.45);
    --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 16px rgba(255, 255, 255, 0.02);

    /* 🔠 Precision High-Tech Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /* 🪟 Domotic Lighting Shadows & HUD Corner Brackets */
    --shadow-domotic-main: 0 35px 90px -15px rgba(0, 0, 0, 0.98), 0 0 60px -10px rgba(0, 240, 255, 0.28);
    --shadow-tile-active: 0 14px 40px -5px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 255, 136, 0.35);
    --shadow-neon-glow: 0 0 30px var(--neon-cyan-glow);

    /* 📐 Radii */
    --radius-wall-panel: 24px;
    --radius-hud: 18px;
    --radius-tile: 14px;
    --radius-pill: 9999px;

    /* ⚡ Transitions */
    --transition-domotic: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   2. GLOBAL RESET & ARCHITECTURAL WALL BACKDROP
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: #e2e8f0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    background-image: 
        radial-gradient(ellipse 90% 45% at 50% -10%, rgba(0, 240, 255, 0.18), transparent 75%),
        radial-gradient(ellipse 70% 40% at 85% 10%, rgba(139, 92, 246, 0.12), transparent 60%),
        radial-gradient(ellipse 70% 40% at 15% 10%, rgba(0, 255, 136, 0.1), transparent 60%);
    background-attachment: fixed;
}

/* 🌌 Recessed Architectural LED Wall-Wash Lights (Philips Hue Glow) */
.ambient-glow,
.ambient-mesh-glow {
    position: fixed;
    top: -240px;
    left: 50%;
    transform: translateX(-50%);
    width: 1500px;
    height: 850px;
    background: radial-gradient(ellipse at 50% 30%, rgba(0, 240, 255, 0.2) 0%, rgba(139, 92, 246, 0.16) 40%, rgba(3, 6, 15, 0) 75%);
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
    animation: domoticAmbientBreath 12s ease-in-out infinite alternate;
}

@keyframes domoticAmbientBreath {
    0% { transform: translateX(-50%) scale(1.0); opacity: 0.85; }
    50% { transform: translateX(-48%) scale(1.08) translateY(20px); opacity: 1.0; }
    100% { transform: translateX(-52%) scale(0.97) translateY(-10px); opacity: 0.9; }
}

/* 📐 Architectural Laser Blueprint Grid Overlay */
.cyber-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(circle at 50% 30%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 30%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 80%);
}

/* ==========================================================================
   3. DOMOTIC TOP STATUS BAR (SMART WALL COMMAND BAR)
   ========================================================================== */
.navbar {
    position: relative;
    z-index: 100;
    max-width: 1300px;
    margin: 22px auto 0;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(7, 12, 24, 0.84);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-hud);
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.85), var(--glass-specular), 0 0 28px rgba(0, 240, 255, 0.16);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: #ffffff;
    user-select: none;
}

.logo-icon,
.logo-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-violet) 100%);
    border-radius: 11px;
    font-size: 21px;
    color: #03060f;
    box-shadow: 0 0 22px var(--neon-cyan-glow);
    font-weight: 900;
}

.logo .highlight {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-version-badge {
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.5);
    color: var(--neon-cyan);
    border-radius: 6px;
    letter-spacing: 0.6px;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Domotic Smart Wall Buttons & Modals */
.nav-history-btn,
.nav-telegram-btn,
.nav-training-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-titanium);
    padding: 9px 16px;
    border-radius: var(--radius-tile);
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    cursor: pointer;
    transition: var(--transition-domotic);
    box-shadow: var(--glass-specular);
}

.nav-history-btn:hover,
.nav-telegram-btn:hover,
.nav-training-badge:hover {
    background: rgba(0, 240, 255, 0.14);
    border-color: var(--border-laser);
    color: #ffffff;
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.3);
    transform: translateY(-1px);
}

.nav-subtle-btn {
    color: #94a3b8;
}
.nav-subtle-btn:hover {
    color: #ffffff;
}

.history-count-badge,
.training-counter {
    background: var(--neon-cyan);
    color: #03060f;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.telegram-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--neon-emerald);
    box-shadow: 0 0 8px var(--neon-emerald);
}

.nav-log-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.35);
    padding: 9px 15px;
    border-radius: var(--radius-tile);
    font-size: 12px;
    font-family: var(--font-code);
    color: var(--neon-cyan);
    text-decoration: none;
    transition: var(--transition-domotic);
}

.nav-log-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-cyan-glow);
    transform: translateY(-1px);
}

/* Telemetry Status Widget */
.nav-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-laser);
    padding: 8px 15px;
    border-radius: var(--radius-tile);
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--neon-emerald);
    box-shadow: 0 0 10px var(--neon-emerald);
}

.status-dot.pulsing {
    animation: domoticLedPulse 2s infinite;
}

@keyframes domoticLedPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.85); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* ==========================================================================
   DROPDOWN ARCHIVIO SERIE PRECEDENTI (DOMOTIC GLASS ARCHIVE)
   ========================================================================== */
.history-dropdown-wrapper {
    position: relative;
}

.history-dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 480px;
    max-width: min(480px, calc(100vw - 32px));
    max-height: 580px;
    background: rgba(6, 11, 24, 0.98);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--border-laser);
    border-radius: 18px;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.98), 0 0 40px rgba(0, 240, 255, 0.25);
    z-index: 10000;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: domoticModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

/* Angoli neon HUD decorativi */
.history-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 14px;
    width: 24px;
    height: 3px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan-glow);
    border-radius: 2px;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
    gap: 10px;
}

.history-panel-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history-panel-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.history-panel-sub {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

.history-refresh-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-titanium);
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-domotic);
    flex-shrink: 0;
}

.history-refresh-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
    transform: rotate(180deg);
}

.history-panel-list {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
}

/* Custom Scrollbar per l'archivio */
.history-panel-list::-webkit-scrollbar {
    width: 6px;
}

.history-panel-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
}

.history-panel-list::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 10px;
}

.history-panel-list::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan-glow);
}

/* Singola Card di una Serie */
.history-item-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.history-item-card:hover {
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 240, 255, 0.15);
    transform: translateX(4px);
}

/* Thumbnail Video Originale */
.history-card-thumb-wrap {
    width: 108px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: #02040a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.history-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.history-item-card:hover .history-card-thumb {
    transform: scale(1.06);
}

.history-card-clips-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(3, 7, 18, 0.88);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.4);
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
    font-family: var(--font-code);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Informazioni Serie */
.history-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-card-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    font-family: var(--font-code);
    flex-wrap: wrap;
}

.history-card-meta .meta-date {
    color: #94a3b8;
    font-size: 11px;
}

.history-card-meta .meta-badge {
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(0, 240, 255, 0.25);
    text-transform: uppercase;
}

/* Pulsanti Azione Serie */
.history-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-open-history {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.16) 0%, rgba(2, 132, 199, 0.25) 100%);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-open-history:hover {
    background: var(--neon-cyan);
    color: #03060f;
    box-shadow: 0 0 16px var(--neon-cyan-glow);
    transform: translateY(-1px);
}

.btn-delete-history {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-history:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Stato Vuoto della Cronologia */
.history-empty-state {
    padding: 30px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.history-empty-icon {
    font-size: 32px;
    opacity: 0.7;
}

.history-empty-text {
    font-size: 14px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.history-empty-sub {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    max-width: 280px;
    line-height: 1.4;
}

/* ==========================================================================
   4. HERO SMART STAGE & ARCHITECTURAL DISPLAY
   ========================================================================== */
.main-container {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 100px;
}

.hero-section {
    text-align: center;
    padding: 30px 0 50px;
}

.hero-chip-banner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 22px;
    background: rgba(0, 240, 255, 0.09);
    border: 1px solid rgba(0, 240, 255, 0.45);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    color: var(--neon-cyan);
    margin-bottom: 24px;
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.25);
    letter-spacing: 0.5px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 66px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -2.4px;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 0 60px rgba(0, 240, 255, 0.2);
}

.hero-gradient {
    background: linear-gradient(135deg, #00f0ff 0%, #a78bfa 50%, #00ff88 100%);
    background-size: 200% 200%;
    animation: domoticSheen 6s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes domoticSheen {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: 18px;
    color: #94a3b8;
    max-width: 760px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.hero-subtitle strong {
    color: #ffffff;
    font-weight: 700;
}

.social-proof {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(10, 16, 32, 0.75);
    border: 1px solid var(--border-titanium);
    padding: 8px 24px;
    border-radius: var(--radius-pill);
    margin-bottom: 40px;
    box-shadow: var(--glass-specular);
}

.avatars-group {
    display: flex;
    align-items: center;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-page);
    margin-left: -10px;
    object-fit: cover;
}
.avatar:first-child {
    margin-left: 0;
}

.stars-rating {
    color: #fbbf24;
    font-size: 14px;
    letter-spacing: 2px;
}

.proof-text {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

/* ==========================================================================
   5. THE CENTRAL DOMOTIC WALL CONSOLE (SMART HUB MASTER TOUCH SCREEN)
   ========================================================================== */
.input-card-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-wall-panel);
    padding: 14px;
    box-shadow: var(--shadow-domotic-main);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    transition: var(--transition-domotic);
}

/* High-Tech HUD Corner Bevels */
.input-card-wrapper::before,
.input-card-wrapper::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.input-card-wrapper::before {
    top: -2px;
    left: -2px;
    border-top: 3px solid var(--neon-cyan);
    border-left: 3px solid var(--neon-cyan);
    border-top-left-radius: 8px;
}

.input-card-wrapper::after {
    bottom: -2px;
    right: -2px;
    border-bottom: 3px solid var(--neon-cyan);
    border-right: 3px solid var(--neon-cyan);
    border-bottom-right-radius: 8px;
}

.input-card-wrapper:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 40px 95px -10px rgba(0, 0, 0, 0.98), 0 0 70px rgba(0, 240, 255, 0.38);
}

.pill-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-input-hub);
    border: 1px solid var(--border-titanium);
    border-radius: 16px;
    padding: 8px 10px 8px 22px;
    transition: var(--transition-domotic);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}

.pill-search-form:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.35), inset 0 2px 8px rgba(0,0,0,0.6);
}

.input-field-group {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 14px;
}

.search-icon {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px var(--neon-cyan));
    flex-shrink: 0;
}

.pill-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
}

.pill-input::placeholder {
    color: #64748b;
}

.btn-paste-shortcut {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-titanium);
    color: #94a3b8;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-domotic);
}

.btn-paste-shortcut:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

/* Master Ignition Button (Tactile Domotic Action Button) */
.pill-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, #2563eb 50%, var(--neon-violet) 100%);
    border: none;
    outline: none;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 0 28px rgba(0, 240, 255, 0.45);
    transition: var(--transition-spring);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.pill-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: domoticSweep 4s infinite;
}

@keyframes domoticSweep {
    0% { left: -100%; }
    30% { left: 200%; }
    100% { left: 200%; }
}

.pill-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.7), 0 12px 28px -5px rgba(0,0,0,0.85);
}

.pill-button:active {
    transform: translateY(1px) scale(0.98);
}

.form-subtext {
    font-size: 12px;
    color: #64748b;
    margin-top: 10px;
    text-align: center;
    font-family: var(--font-code);
}

/* Quick Options Sub-Bar */
.quick-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn-text-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-text-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-text-link strong,
#currentFormatBadge,
#currentFormatLabel {
    color: var(--neon-cyan);
    font-weight: 700;
}

.divider,
.dot-separator {
    color: #334155;
}

.badge-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.auto-curation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--neon-cyan);
    padding: 5px 16px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* ==========================================================================
   6. DOMOTIC SMART SENSOR TILES & VIRAL PILLARS
   ========================================================================== */
.settings-drawer {
    margin-top: 24px;
    background: rgba(7, 12, 24, 0.96);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-hud);
    padding: 24px;
    text-align: left;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.85), 0 12px 35px rgba(0, 240, 255, 0.12);
}

.settings-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-titanium);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.drawer-header-badge {
    display: inline-block;
    font-family: var(--font-code);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    background: rgba(0, 240, 255, 0.14);
    border: 1px solid rgba(0, 240, 255, 0.45);
    color: var(--neon-cyan);
    border-radius: 4px;
    margin-bottom: 6px;
}

.settings-drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.settings-drawer-header p {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

.btn-close-drawer {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-titanium);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-domotic);
}
.btn-close-drawer:hover {
    background: rgba(255, 0, 85, 0.18);
    border-color: var(--neon-rose);
    color: #fff;
}

/* Settings Content Grid & IoT Cards */
.settings-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.setting-card-box {
    background: rgba(12, 19, 38, 0.65);
    border: 1px solid var(--border-titanium);
    border-radius: var(--radius-tile);
    padding: 18px;
    transition: var(--transition-domotic);
}

.setting-card-box:hover {
    border-color: var(--border-laser);
    background: rgba(16, 26, 52, 0.88);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.setting-card-box.full-width-card {
    grid-column: span 2;
}

.setting-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.setting-box-icon {
    font-size: 22px;
}

.setting-title-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
}

.badge-anti-cut,
.badge-karaoke,
.badge-boost-fire,
.badge-brand-pro,
.badge-recommended {
    font-family: var(--font-code);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.badge-anti-cut,
.badge-recommended {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.45);
}

.badge-karaoke {
    background: rgba(0, 255, 136, 0.15);
    color: var(--neon-emerald);
    border: 1px solid rgba(0, 255, 136, 0.45);
}

.badge-boost-fire {
    background: rgba(255, 80, 0, 0.15);
    color: #ff6b35;
    border: 1px solid rgba(255, 80, 0, 0.45);
}

.badge-brand-pro {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.45);
}

.styled-select-modern,
.form-select {
    width: 100%;
    background: rgba(4, 8, 18, 0.92);
    border: 1px solid var(--border-titanium);
    color: #f1f5f9;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-domotic);
}

.styled-select-modern:focus,
.form-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

.setting-tip-banner {
    display: flex;
    gap: 10px;
    background: rgba(0, 240, 255, 0.06);
    border-left: 3px solid var(--neon-cyan);
    padding: 11px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: #cbd5e1;
}

/* Feature Toggles as Smart Domotic Switches */
.feature-toggles-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.feature-toggle-card-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(7, 12, 24, 0.85);
    border: 1px solid var(--border-titanium);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition-domotic);
    user-select: none;
}

.feature-toggle-card-modern:hover {
    border-color: var(--border-laser);
    background: rgba(12, 20, 42, 0.95);
}

.feature-toggle-card-modern.active-feature,
.feature-toggle-card-modern:has(.modern-toggle-cb:checked) {
    border-color: var(--neon-emerald);
    background: rgba(0, 255, 136, 0.09);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.18);
}

.modern-toggle-cb {
    accent-color: var(--neon-emerald);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-content {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.toggle-subtitle {
    font-size: 11px;
    color: #64748b;
}

/* Branding Inputs Grid */
.branding-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.brand-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}

.styled-input-modern {
    width: 100%;
    background: rgba(4, 8, 18, 0.92);
    border: 1px solid var(--border-titanium);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: var(--transition-domotic);
}

.styled-input-modern:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

/* Viral Pillars Chips HUD */
.viral-pillars-hud {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-titanium);
}

.pillars-hud-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.pillars-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.pillar-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(9, 15, 30, 0.88);
    border: 1px solid var(--border-titanium);
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    transition: var(--transition-domotic);
}

.pillar-chip.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.09);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.18);
}

.pillar-chip .p-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--neon-emerald);
    box-shadow: 0 0 8px var(--neon-emerald);
}

/* ==========================================================================
   7. HOLOGRAPHIC PROCESSING CHAMBER & TERMINAL LOGS
   ========================================================================== */
.processing-section {
    margin-top: 40px;
}

.processing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-hud);
    padding: 30px;
    box-shadow: var(--shadow-domotic-main);
    backdrop-filter: blur(28px);
}

.processing-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.pulse-ring {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--neon-cyan);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7);
    animation: domoticRing 1.5s infinite;
}

@keyframes domoticRing {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.8); }
    70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(0, 240, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.processing-header h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 30px;
}

.progress-bar-bg {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid var(--border-titanium);
    padding: 2px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-emerald) 100%);
    box-shadow: 0 0 18px var(--neon-cyan-glow);
    transition: width 0.4s ease;
}

.progress-percentage {
    font-family: var(--font-code);
    font-size: 16px;
    font-weight: 800;
    color: var(--neon-cyan);
}

/* Stepper Component */
.pipeline-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(7, 12, 24, 0.92);
    border: 2px solid var(--border-titanium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-code);
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    transition: var(--transition-domotic);
}

.step-item.active .step-dot {
    border-color: var(--neon-cyan);
    color: #03060f;
    background: var(--neon-cyan);
    box-shadow: 0 0 22px var(--neon-cyan-glow);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.step-item.active .step-label {
    color: #ffffff;
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border-titanium);
    margin: 0 10px;
    margin-bottom: 24px;
}

/* Live Terminal Log View (Quantum Telemetry Console) */
.terminal-toggle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(4, 8, 18, 0.94);
    border: 1px solid var(--border-titanium);
    border-radius: 12px 12px 0 0;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
}

.terminal-indicator {
    color: var(--neon-emerald);
    margin-right: 8px;
    font-size: 14px;
}

.terminal-logs {
    background: #020408;
    border: 1px solid var(--border-titanium);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 18px;
    max-height: 280px;
    overflow-y: auto;
    font-family: var(--font-code);
    font-size: 12px;
    color: #a7f3d0;
    line-height: 1.6;
    box-shadow: inset 0 4px 15px rgba(0,0,0,0.95);
}

/* ==========================================================================
   8. RESULTS STAGE & 9:16 FLOATING VIDEO CARDS
   ========================================================================== */
.results-section {
    margin-top: 40px;
}

.history-active-banner {
    background: rgba(10, 16, 32, 0.92);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-hud);
    padding: 20px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.7);
}

.history-banner-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.history-banner-thumb {
    width: 62px;
    height: 62px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border-laser);
}

.history-banner-badge {
    font-family: var(--font-code);
    font-size: 10px;
    font-weight: 800;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.history-banner-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.history-banner-meta {
    font-size: 12px;
    color: #94a3b8;
}

.btn-banner-download-all {
    background: rgba(0, 240, 255, 0.14);
    border: 1px solid var(--border-laser);
    color: var(--neon-cyan);
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-domotic);
}
.btn-banner-download-all:hover {
    background: var(--neon-cyan);
    color: #03060f;
    box-shadow: 0 0 22px var(--neon-cyan-glow);
}

/* ==========================================================================
   8. RESULTS SECTION, BATCH ACTIONS BAR & 9:16 SMART VIDEO CARDS
   ========================================================================== */
.results-section {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 16px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.results-header-left h2,
.results-header h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.results-header-left p,
.results-header p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

/* Bottone Bulk Download Superiore */
.btn-bulk-download,
.btn-banner-download-all {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, #0284c7 100%);
    border: none;
    color: #03060f;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 22px rgba(0, 240, 255, 0.35);
}

.btn-bulk-download:hover,
.btn-banner-download-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 240, 255, 0.55);
    filter: brightness(1.1);
}

/* Barra Batch Multiselezione Domotica */
.batch-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 16, 32, 0.88);
    border: 1px solid var(--border-laser);
    border-radius: 16px;
    padding: 14px 22px;
    margin: 18px 0 28px 0;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 240, 255, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    gap: 16px;
    flex-wrap: wrap;
}

.batch-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkbox-container-master {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #f1f5f9;
    user-select: none;
}

.checkbox-container-master input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-container-master .custom-checkbox {
    width: 22px;
    height: 22px;
    background: rgba(3, 7, 18, 0.9);
    border: 2px solid var(--border-titanium);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-domotic);
    flex-shrink: 0;
}

.checkbox-container-master input[type="checkbox"]:checked + .custom-checkbox {
    background: linear-gradient(135deg, var(--neon-cyan), #0284c7);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px var(--neon-cyan-glow);
}

.checkbox-container-master input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '✓';
    color: #03060f;
    font-size: 13px;
    font-weight: 900;
}

.checkbox-container-master input[type="checkbox"]:indeterminate + .custom-checkbox {
    background: rgba(0, 240, 255, 0.25);
    border-color: var(--neon-cyan);
}

.checkbox-container-master input[type="checkbox"]:indeterminate + .custom-checkbox::after {
    content: '—';
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: 900;
}

.selected-count-tag {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--neon-cyan);
    padding: 5px 14px;
    border-radius: 20px;
    font-family: var(--font-code);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.batch-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-batch-download {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-titanium);
    color: #e2e8f0;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-batch-download:not(:disabled):hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

.btn-batch-download:disabled,
.btn-batch-upload-yt:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-batch-upload-yt {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

.btn-batch-upload-yt:not(:disabled):hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.55);
    transform: translateY(-2px);
}

/* Griglia Short 9:16 Responsiva */
.shorts-grid,
#resultsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 290px));
    justify-content: center;
    gap: 24px;
    margin-top: 10px;
}

/* Card Singola Short */
.short-card,
.video-card-modern {
    background: rgba(10, 16, 32, 0.88);
    border: 1px solid var(--border-titanium);
    border-radius: var(--radius-hud);
    overflow: hidden;
    transition: var(--transition-domotic);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.short-card:hover,
.video-card-modern:hover {
    transform: translateY(-5px);
    border-color: var(--border-laser);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 240, 255, 0.28);
}

.short-card.selected {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4), inset 0 0 20px rgba(0, 240, 255, 0.1);
    transform: translateY(-4px);
}

/* Card Removal & Entry Animations */
.short-card.entering {
    animation: shortCardFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shortCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.short-card.removing {
    opacity: 0 !important;
    transform: scale(0.9) translateY(24px) !important;
    filter: blur(6px) !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.32s ease, transform 0.32s ease, max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1), margin 0.38s ease, padding 0.38s ease, filter 0.32s ease !important;
}

.history-item-card.removing {
    opacity: 0 !important;
    transform: translateX(-24px) !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Card Badges and Dismiss Button */
.btn-card-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(10, 16, 32, 0.75);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn-card-dismiss:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}

.uploaded-status-badge {
    position: absolute;
    top: 10px;
    right: 44px;
    z-index: 11;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: shortCardFadeIn 0.3s ease;
}

.short-card.is-uploaded {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.15) !important;
}

.btn-uploaded-yt {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #34d399 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

.btn-uploaded-yt:hover {
    background: rgba(16, 185, 129, 0.35) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4) !important;
}

#shortsInfiniteSentinel {
    grid-column: 1 / -1;
    height: 2px;
    width: 100%;
    margin: 0;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Video Player Frame 9:16 Contenuto & Anti-Taglio */
.video-container,
.video-player-container {
    position: relative;
    width: 100%;
    max-width: 240px;
    max-height: 426px;
    aspect-ratio: 9 / 16;
    margin: 12px auto 6px auto;
    background: #02040a;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.short-video,
.video-player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain !important; /* Mostra il 100% dell'immagine senza alcun taglio laterale o verticale */
    background: #000000;
    display: block;
    border-radius: 12px;
}

/* Checkbox Singola Card Video */
.clip-checkbox-label {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.clip-card-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-card-checkbox {
    width: 26px;
    height: 26px;
    background: rgba(3, 7, 18, 0.88);
    border: 2px solid var(--border-titanium);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-domotic);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.clip-card-checkbox:checked + .custom-card-checkbox {
    background: linear-gradient(135deg, var(--neon-cyan), #0284c7);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px var(--neon-cyan-glow);
}

.clip-card-checkbox:checked + .custom-card-checkbox::after {
    content: '✓';
    color: #03060f;
    font-size: 15px;
    font-weight: 900;
}

/* Viral Score Badge */
.viral-badge-float,
.viral-score-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(3, 6, 15, 0.9);
    border: 1px solid rgba(255, 107, 0, 0.6);
    color: #ff9800;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 0 16px rgba(255, 107, 0, 0.35);
    backdrop-filter: blur(10px);
    z-index: 5;
}

/* Dettagli Testuali & Copy Card */
.card-details,
.video-info-box {
    padding: 12px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 9px;
}

.short-title,
.video-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timestamps-row,
.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
    font-family: var(--font-code);
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 9px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.justification-box {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
    background: rgba(0, 240, 255, 0.04);
    border-left: 3px solid var(--neon-cyan);
    padding: 7px 9px;
    border-radius: 0 7px 7px 0;
    max-height: 75px;
    overflow-y: auto;
}

.justification-box strong {
    color: var(--neon-cyan);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pulsanti Azioni Card */
.card-actions,
.card-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.btn-card-action,
.btn-download,
.btn-copy,
.btn-action-yt,
.btn-action-social {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-titanium);
    color: #cbd5e1;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-domotic);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-download {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(2, 132, 199, 0.25) 100%);
    border-color: rgba(0, 240, 255, 0.4);
    color: #38bdf8;
}

.btn-download:hover {
    background: var(--neon-cyan);
    color: #03060f;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px var(--neon-cyan-glow);
    transform: translateY(-2px);
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-action-yt {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.btn-action-yt:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-action-social {
    border-color: rgba(0, 240, 255, 0.3);
    color: #67e8f9;
}

.btn-action-social:hover {
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.4), rgba(0, 242, 254, 0.4));
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
    transform: translateY(-2px);
}

/* ==========================================================================
   9. MODALS & POPUPS (DOMOTIC GLASS HUD DIALOGS)
   ========================================================================== */
.modal-backdrop,
.modal-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 5, 12, 0.85);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: domoticModalFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes domoticModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card,
.modal-content,
.modal-box {
    background: rgba(7, 12, 26, 0.97);
    border: 1px solid var(--border-laser);
    border-radius: var(--radius-hud);
    padding: 30px;
    max-width: 640px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px -15px rgba(0, 0, 0, 0.98), 0 0 50px rgba(0, 240, 255, 0.3);
    position: relative;
    animation: domoticModalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Precision HUD Corner Brackets on Modals */
.modal-card::before,
.modal-card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.modal-card::before {
    top: -2px;
    left: -2px;
    border-top: 3px solid var(--neon-cyan);
    border-left: 3px solid var(--neon-cyan);
    border-top-left-radius: 8px;
}

.modal-card::after {
    bottom: -2px;
    right: -2px;
    border-bottom: 3px solid var(--neon-cyan);
    border-right: 3px solid var(--neon-cyan);
    border-bottom-right-radius: 8px;
}

@keyframes domoticModalPop {
    from { opacity: 0; transform: scale(0.92) translateY(14px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border-titanium);
    padding-bottom: 18px;
    margin-bottom: 20px;
    position: relative;
    flex-shrink: 0;
}

.modal-icon-badge {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid var(--border-laser);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
    flex-shrink: 0;
}

.modal-icon-badge.yt-badge {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.modal-title-group {
    flex: 1;
}

.modal-title-group h3,
.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.4px;
    line-height: 1.25;
}

.modal-title-group p {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 5px;
    line-height: 1.5;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-titanium);
    color: #94a3b8;
    font-size: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-domotic);
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 0, 85, 0.18);
    border-color: var(--neon-rose);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body {
    overflow-y: auto;
    max-height: calc(88vh - 150px);
    padding-right: 6px;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* 🌐 SOTTOTITOLI & SELEZIONE LINGUA DOMOTICA */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.languages-grid::-webkit-scrollbar {
    width: 6px;
}
.languages-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}
.languages-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}

.btn-lang-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(12, 19, 38, 0.85);
    border: 1px solid var(--border-titanium);
    padding: 13px 16px;
    border-radius: var(--radius-tile);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-domotic);
    position: relative;
    overflow: hidden;
}

.btn-lang-choice:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.btn-lang-choice.recommended-lang {
    border-color: rgba(0, 255, 136, 0.5);
    background: rgba(0, 255, 136, 0.08);
}
.btn-lang-choice.recommended-lang:hover {
    border-color: var(--neon-emerald);
    background: rgba(0, 255, 136, 0.16);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.35);
}

.lang-flag {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
    flex-shrink: 0;
}

.lang-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.lang-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.lang-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-lang-rec {
    font-family: var(--font-code);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 255, 136, 0.2);
    color: var(--neon-emerald);
    border: 1px solid rgba(0, 255, 136, 0.4);
    letter-spacing: 0.5px;
}

.lang-type {
    font-size: 11px;
    color: var(--neon-cyan);
    font-family: var(--font-code);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.modal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #64748b;
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-titanium);
}

.modal-divider span {
    padding: 0 16px;
    color: #94a3b8;
}

/* ⚡ TASTO WHISPER GPU OVERRIDE */
.btn-whisper-gpu {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(0, 240, 255, 0.08) 100%);
    border: 1px dashed rgba(139, 92, 246, 0.55);
    padding: 15px 18px;
    border-radius: var(--radius-tile);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-domotic);
}

.btn-whisper-gpu:hover {
    border-color: var(--neon-violet);
    border-style: solid;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(0, 240, 255, 0.16) 100%);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-whisper-gpu .gpu-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--neon-violet) 0%, var(--neon-cyan) 100%);
    color: #03060f;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--neon-violet-glow);
    flex-shrink: 0;
}

.btn-whisper-gpu .gpu-text-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.btn-whisper-gpu .gpu-text-group strong {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-heading);
}

.btn-whisper-gpu .gpu-text-group span {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
}

/* Telegram Auto-Detect Section */
.telegram-auto-detect-box {
    background: rgba(0, 240, 255, 0.05);
    border: 1px dashed rgba(0, 240, 255, 0.35);
    border-radius: 10px;
    padding: 14px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* YouTube Modal Controls */
.modal-card-yt {
    max-width: 680px;
}

.yt-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.yt-mode-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-titanium);
    padding: 11px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-domotic);
}

.yt-mode-pill.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.yt-options-row,
.yt-field-group {
    margin-bottom: 16px;
}

.yt-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.yt-field-label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    display: block;
    margin-bottom: 6px;
}

.char-count {
    font-family: var(--font-code);
    font-size: 11px;
    color: #64748b;
}

.yt-input,
.yt-textarea,
.yt-select,
.yt-datetime-input {
    width: 100%;
    background: rgba(4, 8, 18, 0.94);
    border: 1px solid var(--border-titanium);
    color: #ffffff;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-domotic);
}

.yt-input:focus,
.yt-textarea:focus,
.yt-select:focus,
.yt-datetime-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

.yt-help-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}

/* ==========================================================================
   10. RESPONSIVE DESIGN (TABLET & SMARTPHONE HUD)
   ========================================================================== */
@media (max-width: 900px) {
    .hero-title {
        font-size: 42px;
        letter-spacing: -1.2px;
    }
    .settings-content-grid {
        grid-template-columns: 1fr;
    }
    .setting-card-box.full-width-card {
        grid-column: span 1;
    }
    .branding-grid-modern {
        grid-template-columns: 1fr;
    }
    .pipeline-stepper {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ==========================================================================
   11. MONETIZATION SUITE v3.5: CREATION MODE & FACELESS GENERATOR
   ========================================================================== */
.creation-mode-container {
    max-width: 820px;
    margin: 0 auto 16px auto;
    text-align: center;
}

.creation-mode-header {
    margin-bottom: 8px;
}

.creation-mode-title-tag {
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    background: rgba(0, 240, 255, 0.1);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 240, 255, 0.25);
}

.creation-mode-select-wrap {
    display: inline-block;
    width: 100%;
    max-width: 640px;
}

.creation-mode-dropdown {
    width: 100%;
    background: rgba(8, 14, 28, 0.95);
    border: 2px solid var(--neon-cyan);
    color: #ffffff;
    padding: 13px 20px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
    cursor: pointer;
    outline: none;
    transition: var(--transition-domotic);
}

.creation-mode-dropdown:focus {
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.45);
    border-color: #38bdf8;
}

.faceless-input-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: var(--radius-hud);
    padding: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.15);
}

.faceless-form-header {
    text-align: center;
    margin-bottom: 22px;
}

.faceless-badge {
    display: inline-block;
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 800;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
}

.faceless-form-header h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.faceless-form-header p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.5;
}

.faceless-field-group {
    margin-bottom: 18px;
}

.faceless-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.faceless-hint {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.faceless-textarea {
    width: 100%;
    background: rgba(4, 8, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    padding: 14px 16px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    resize: vertical;
    transition: var(--transition-domotic);
}

.faceless-textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.faceless-controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.faceless-select {
    width: 100%;
    background: rgba(4, 8, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
}

.faceless-select:focus {
    border-color: #8b5cf6;
}

.faceless-submit-row {
    text-align: center;
}

.faceless-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4) !important;
}

/* ==========================================================================
   12. PODCAST AUTOPILOT & SMART CALENDAR
   ========================================================================== */
.modal-card-wide {
    max-width: 900px;
    max-height: 88vh;
    overflow-y: auto;
}

.autopilot-add-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}

.autopilot-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.autopilot-input-col {
    flex: 1;
    min-width: 180px;
}

.autopilot-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.autopilot-btn-col {
    flex-shrink: 0;
}

.autopilot-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.autopilot-status-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #34d399;
    font-weight: 600;
}

.autopilot-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.autopilot-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autopilot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 16px;
}

.autopilot-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autopilot-item-url {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.autopilot-empty {
    text-align: center;
    padding: 18px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.autopilot-history-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
    font-family: var(--font-code);
    font-size: 12px;
}

/* Smart Calendar Golden HUD */
.calendar-golden-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.golden-hud-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #fef3c7;
}

.golden-tag {
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-family: var(--font-code);
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.calendar-day-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: var(--transition-domotic);
}

.calendar-day-card.has-event {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.day-header-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.day-num {
    font-size: 20px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 6px;
}

.day-slot-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
}

.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.calendar-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 14px;
}

/* ==========================================================================
   13. RETENTION CURVE PREVIEW & VIRAL SCORE 2.0
   ========================================================================== */
.retention-score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.score-card-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.score-val {
    font-size: 26px;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    line-height: 1.1;
    margin-bottom: 4px;
}

.score-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.retention-chart-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
}

.chart-header-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    font-family: var(--font-code);
}

.safe-benchmark {
    color: #34d399;
}

.retention-svg-wrapper {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-tips-box {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.tips-header {
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 10px;
}

.tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

/* ==========================================================================
   14. MULTILINGUAL AI DUBBING & THUMBNAIL CRAFTER
   ========================================================================== */
.dubbing-step-label {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.dubbing-lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.dubbing-lang-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-domotic);
}

.dubbing-lang-card.active,
.dubbing-lang-card:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.lang-flag-big {
    font-size: 24px;
}

.lang-text-grp strong {
    display: block;
    font-size: 13px;
    color: #ffffff;
}

.lang-text-grp span {
    font-size: 11px;
    color: var(--text-muted);
}

.dubbing-preview-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: #c4b5fd;
}

.thumb-preview-wrap {
    display: inline-block;
    max-width: 220px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.thumb-916-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================================================
   15. 📱 MOBILE WEB APP ARCHITECTURE & DUAL PC/MOBILE RESPONSIVENESS
   "Esperienza Desktop Professionale + Esperienza Mobile Nativa Touch-First"
   ========================================================================== */

/* ── Pulsante Hamburger per Mobile ── */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: rgba(14, 22, 44, 0.85);
    border: 1px solid var(--border-laser);
    border-radius: 12px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-domotic);
    z-index: 1001;
}

.mobile-menu-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.hamburger-bar {
    width: 22px;
    height: 2.5px;
    background: var(--neon-cyan);
    border-radius: 3px;
    transition: var(--transition-spring);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ── Barra di Navigazione Mobile Inferiore (Mobile App Bottom Dock) ── */
.mobile-bottom-dock {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(6, 11, 23, 0.94);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-top: 1px solid rgba(0, 240, 255, 0.22);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.1);
    z-index: 999;
    padding: 0 8px;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.dock-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-domotic);
    flex: 1;
    max-width: 75px;
    height: 52px;
    position: relative;
}

.dock-tab:active {
    transform: scale(0.92);
}

.dock-icon {
    font-size: 20px;
    line-height: 1;
    transition: var(--transition-spring);
}

.dock-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.2px;
    transition: var(--transition-domotic);
}

.dock-tab.active {
    color: var(--neon-cyan);
}

.dock-tab.active .dock-icon {
    transform: translateY(-2px) scale(1.1);
}

.dock-tab.active::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 20px;
    height: 3px;
    background: var(--neon-cyan);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* ==========================================================================
   TABLET & MOBILE BREAKPOINTS (max-width: 991px)
   ========================================================================== */
@media screen and (max-width: 991px) {
    .mobile-menu-btn {
        display: flex;
    }

    .navbar {
        margin: 12px 14px 0;
        padding: 10px 16px;
        border-radius: 16px;
    }

    /* Il menu desktop si trasforma in drawer a comparsa */
    .nav-right {
        display: none;
        position: fixed;
        top: 72px;
        left: 14px;
        right: 14px;
        background: rgba(7, 12, 24, 0.96);
        backdrop-filter: blur(32px) saturate(200%);
        -webkit-backdrop-filter: blur(32px) saturate(200%);
        border: 1px solid var(--border-laser);
        border-radius: 20px;
        padding: 20px 16px;
        flex-direction: column;
        gap: 12px;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px var(--neon-cyan-subtle);
        z-index: 1000;
        animation: domoticSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-right.mobile-open {
        display: flex;
    }

    .nav-right .nav-history-btn,
    .nav-right .nav-log-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.04);
    }

    .nav-right .nav-status {
        width: 100%;
        justify-content: center;
        margin-top: 6px;
    }

    .history-dropdown-wrapper {
        width: 100%;
    }

    .history-dropdown-panel {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.08);
    }
}

@keyframes domoticSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   SMARTPHONE WEB BREAKPOINT (max-width: 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Spazio per la dock inferiore fissa */
    body {
        padding-bottom: 84px !important;
    }

    .mobile-bottom-dock {
        display: flex;
    }

    .main-container {
        padding: 0 12px;
    }

    /* Hero Section Mobile */
    .hero-section {
        padding: 16px 4px 12px;
    }

    .hero-chip-banner {
        font-size: 11px;
        padding: 6px 12px;
        margin-bottom: 12px;
    }

    .hero-title {
        font-size: clamp(24px, 7vw, 32px);
        line-height: 1.22;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 13.5px;
        line-height: 1.5;
        padding: 0 4px;
        margin-bottom: 16px;
    }

    .social-proof {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
    }

    .proof-text {
        font-size: 12px;
        text-align: center;
        width: 100%;
    }

    /* Modalità di Creazione */
    .creation-mode-container {
        margin: 14px auto 16px;
        max-width: 100%;
        padding: 0 4px;
    }

    .creation-mode-dropdown {
        font-size: 14px;
        height: 48px;
        border-radius: 12px;
    }

    /* Search Pill & Form da Video Lungo */
    .pill-search-form {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        border-radius: 18px;
        background: rgba(6, 11, 23, 0.92);
    }

    .input-field-group {
        width: 100%;
        border-radius: 12px;
        padding: 4px 10px;
        background: rgba(255, 255, 255, 0.03);
    }

    .pill-input {
        font-size: 15px;
        height: 44px;
    }

    .btn-paste-shortcut {
        font-size: 12px;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .pill-button {
        width: 100% !important;
        height: 52px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        border-radius: 14px !important;
        justify-content: center !important;
    }

    .form-subtext {
        font-size: 11.5px;
        padding: 0 6px;
        line-height: 1.4;
    }

    /* Scheda Faceless Generator Mobile */
    .faceless-card-form {
        padding: 16px;
        border-radius: 18px;
    }

    .faceless-form-header h3 {
        font-size: 18px;
    }

    .faceless-form-header p {
        font-size: 12.5px;
    }

    .faceless-textarea {
        font-size: 15px;
        min-height: 85px;
        padding: 12px;
    }

    .faceless-controls-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .faceless-select {
        height: 46px;
        font-size: 14px;
    }

    .faceless-btn {
        height: 52px;
        font-size: 15px;
    }

    /* Opzioni Rapide (Esempio & Carica MP4) */
    .quick-options {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        font-size: 12.5px;
        margin-top: 14px;
    }

    /* Pannello Impostazioni / Settings */
    .settings-panel {
        padding: 16px;
        border-radius: 18px;
        margin-top: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .setting-card {
        padding: 14px;
        border-radius: 14px;
    }

    /* Griglia Clip Shorts Generate */
    .shorts-grid {
        grid-template-columns: 1fr !important;
        gap: 22px;
        margin-top: 24px;
    }

    .short-card {
        padding: 16px;
        border-radius: 20px;
        max-width: 100%;
    }

    .video-wrapper {
        max-width: 290px;
        margin: 0 auto 14px;
        border-radius: 16px;
        overflow: hidden;
    }

    .video-wrapper video {
        width: 100%;
        display: block;
    }

    .card-actions-row {
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .btn-card-action {
        width: 100% !important;
        height: 46px;
        font-size: 14px;
        font-weight: 600;
        justify-content: center;
        border-radius: 12px;
    }

    .tab-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Modali Mobile Bottom-Sheet Feel */
    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 90vh !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        padding: 18px 16px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding-bottom: 12px;
        margin-bottom: 14px;
    }

    .modal-close-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

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

    .dubbing-lang-card {
        padding: 10px;
        gap: 8px;
    }

    .lang-flag-big {
        font-size: 20px;
    }

    .lang-text-grp strong {
        font-size: 12px;
    }

    .lang-text-grp span {
        font-size: 10px;
    }
}

/* ==========================================================================
   MINI SMARTPHONE BREAKPOINT (max-width: 480px)
   ========================================================================== */
@media screen and (max-width: 480px) {
    .logo-version-badge {
        display: none;
    }

    .logo-text {
        font-size: 19px;
    }

    .dock-label {
        font-size: 9.5px;
    }

    .dock-icon {
        font-size: 18px;
    }

    .dubbing-lang-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   COOKIE YOUTUBE MANAGER & BOT BYPASS STYLES
   ========================================================================== */
.cookie-dot-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    transition: all 0.3s ease;
}

.cookie-dot-indicator.configured {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.cookie-status-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cookie-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.cookie-status-dot.active {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.cookie-status-sub {
    font-size: 11.5px;
    color: #94a3b8;
}

.cookie-guide-box {
    background: rgba(30, 41, 59, 0.6);
    border-left: 3px solid #38bdf8;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #cbd5e1;
}

.cookie-guide-box h4 {
    color: #38bdf8;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 12.5px;
}

.cookie-guide-box ol {
    margin: 0;
    padding-left: 18px;
}

.cookie-guide-box li {
    margin-bottom: 4px;
}

.cookie-dropzone {
    border: 2px dashed rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cookie-dropzone:hover, .cookie-dropzone.dragover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    transform: translateY(-1px);
}

.cookie-dropzone .dropzone-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.cookie-dropzone .dropzone-note {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 6px;
}

.cookie-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e2e8f0;
    font-family: var(--font-code, monospace);
    font-size: 11px;
    padding: 10px;
    resize: vertical;
    box-sizing: border-box;
}

.cookie-textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   UNIVERSAL MOBILE & IOS WEB APP (PWA) STYLES
   ========================================================================== */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
}

/* Mobile Bottom Navigation Dock for iOS / Android */
.mobile-bottom-dock {
    display: none;
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 900px) {
    body {
        padding-bottom: calc(75px + var(--sab));
        -webkit-tap-highlight-color: transparent;
    }

    .navbar {
        padding-top: max(12px, var(--sat));
        padding-left: max(16px, var(--sal));
        padding-right: max(16px, var(--sar));
        position: sticky;
        top: 0;
        z-index: 900;
        background: rgba(8, 12, 20, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        cursor: pointer;
        padding: 8px;
        transition: all 0.2s ease;
    }

    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.12);
        transform: scale(0.95);
    }

    .hamburger-bar {
        width: 22px;
        height: 2px;
        background: #f1f5f9;
        border-radius: 2px;
        transition: all 0.25s ease;
    }

    .mobile-menu-btn.active .hamburger-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-btn.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active .hamburger-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-right {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(10, 14, 24, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 16px 20px 24px;
        flex-direction: column;
        gap: 12px;
        z-index: 899;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    }

    .nav-right.mobile-open {
        display: flex !important;
        animation: slideDownMobile 0.25s ease forwards;
    }

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

    .nav-right .nav-history-btn,
    .nav-right .nav-log-btn,
    .nav-right .nav-status {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 13.5px;
        border-radius: 10px;
    }

    /* Fixed Native App Dock on iOS & Mobile */
    .mobile-bottom-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(60px + var(--sab));
        padding-bottom: var(--sab);
        background: rgba(8, 12, 22, 0.94);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid rgba(255, 255, 255, 0.09);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .dock-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #94a3b8;
        font-family: inherit;
        font-size: 10.5px;
        font-weight: 600;
        cursor: pointer;
        padding: 6px 14px;
        gap: 4px;
        border-radius: 12px;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .dock-tab:active {
        transform: scale(0.92);
    }

    .dock-tab.active {
        color: #00f0ff;
    }

    .dock-tab.active .dock-icon {
        transform: scale(1.2);
        filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.7));
    }

    .dock-icon {
        font-size: 21px;
        line-height: 1;
        transition: transform 0.2s ease;
    }

    /* Prevent auto-zoom on iOS Safari when tapping inputs */
    input[type="text"],
    input[type="url"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Responsive inputs on mobile */
    .pill-search-form {
        flex-direction: column;
        border-radius: 16px;
        padding: 8px;
    }

    .pill-input {
        width: 100%;
        padding: 12px 14px;
    }

    .pill-button {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .hero-title {
        font-size: 1.85rem;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 0.92rem;
    }
}



