/* ==========================================
   1. GLOBAL UTILITIES & VARIABLES
   ========================================== */
:root {
    --bg-main: #030712;
    --accent: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-muted: #dde0e3;
    interpolate-size: allow-keywords;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   2. BASE LAYOUT & TOUCH OPTIMIZATIONS
   ========================================== */
body {
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
    width: 100%;
    overscroll-behavior-y: none;
    /* Disables native "pull-to-refresh" bounce */
    -webkit-font-smoothing: antialiased;
}

.viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Instant Touch Response (Kills 300ms mobile delay & blue tap flash) */
button,
a,
.nav-brand,
.magnetic-btn,
.drop-trigger,
.custom-checkbox,
.tool-btn,
.drop-zone-content,
.btn-glow-primary {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* ==========================================
   3. CUSTOM SCROLLBARS
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ==========================================
   4. BACKGROUND & AMBIENT EFFECTS
   ========================================== */
.background-canvas {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #0f172a, #030712);
}

.background-canvas::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.15;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    mix-blend-mode: screen;
    will-change: transform;
}

.b1 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, #4338ca, transparent);
    top: -10%;
    left: 5%;
}

.b2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #6366f1, transparent);
    bottom: -5%;
    right: 10%;
}

.b3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #a855f7, transparent);
    top: 30%;
    left: 35%;
    opacity: 0.4;
}

/* ==========================================
   5. NAVIGATION
   ========================================== */
.floating-nav {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 100;
    transform-origin: center center;
    animation: navScaleY 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

.nav-brand {
    width: 48px;
    height: 48px;
    background: transparent;
    color: var(--text-muted);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.nav-brand.active,
.nav-brand:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Quantum atom fan spin */
@keyframes fanSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.orbit-group {
    transform-box: fill-box;
    transform-origin: center;
    animation: fanSpin 3s linear infinite;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.active,
.nav-btn:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ==========================================
   6. HEADER & GLASS CARDS
   ========================================== */
.heading-section {
    position: relative;
    /* FIX: Added 0.15s delay. Gives browser time to paint the background first on fresh Google clicks */
    animation: initFadeDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
}

.main-heading {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -3px;
    margin: 0;
    text-align: center;
}

.main-heading span {
    background: linear-gradient(to right, #7c8cff, #c6a0eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-heading {
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 1.1rem;
    text-align: center;
}

.hero-divider {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border: none;
    box-shadow: 0 0 10px var(--accent-glow);
    margin: 0;
    opacity: 0.8;
}

.glass-hub {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 50px;
    width: 100%;
    max-width: 420px;
    margin-top: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.session-hud {
    padding: 25px !important;
    display: flex;
    flex-direction: column;
    height: min(650px, calc(100vh - 205px));
    max-height: calc(100vh - 205px);
    transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), max-height 0.4s ease;
}

/* ==========================================
   7. UPLOAD UI & INPUTS
   ========================================== */
.drop-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    margin-bottom: 30px;
    transition: 0.3s;
}

.drop-trigger:hover {
    border-color: var(--accent);
    background: rgba(129, 140, 248, 0.05);
}

.pulse-icon {
    width: 85px;
    height: 85px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 20px;
    transition: 0.3s;
}

.drop-trigger:hover .pulse-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--accent-glow);
}

#single-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
    margin: 0 auto;
    display: block;
    text-align: center;
    color: var(--text-primary);
}

.input-glow-group {
    position: relative;
    margin-bottom: 15px;
}

.input-glow-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
}

input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    font-size: 1rem;
    transition: 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

input::placeholder,
textarea::placeholder {
    color: #979ca3;
    opacity: 1;
}

.btn-glow-primary,
.btn-action-save,
.btn-action-close {
    width: 100%;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-glow-primary {
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    letter-spacing: 1px;
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
}

.btn-glow-primary:hover {
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.6);
    transform: translateY(-2px);
}

/* ==========================================
   8. FILE LISTS & STREAM ITEMS
   ========================================== */
.hud-header {

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Left side */
.hud-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hud-icon-badge {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(129, 140, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #a5b4fc;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.hud-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hud-title {
    font-size: 1.05rem;
    font-weight: 800;
    background: linear-gradient(120deg, #ffffff 0%, #c4b5fd 60%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.2;
}

.hud-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.hud-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
    flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* Right side — counter pill */
.hud-header-right {
    flex-shrink: 0;
}

.hud-counter-pill {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: auto;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(165, 180, 252, 0.2);
}

.hud-count-num {
    font-size: 1rem;
    font-weight: 700;
    color: #c4b5fd;
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.hud-count-max {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hud-count-label {
    display: none;
}

.hud-count-bar {
    display: none;
}

.hud-count-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}



.session-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px 0px 15px;
    margin-bottom: -9px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.tool-btn.action:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.tool-btn.danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

.tool-btn.danger:hover {
    background: #ff6b6b;
    color: white;
}

/* The File List Container */
.data-stream {
    flex-grow: 1;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px;
    margin-top: 20px;
    /* Touch scroll optimizations */
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    will-change: scroll-position;
    /* Hides the scrollbar entirely but keeps functionality */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.data-stream::-webkit-scrollbar {
    display: none;
}

.data-stream.drag-over {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--accent);
}

/* Individual Files */
.stream-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 0 2px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
    border: 1px solid transparent;
    min-width: 0;
    flex-shrink: 0;
    height: 54px;
    min-height: 54px;
    overflow: hidden;
    animation: smoothItemAdd 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stream-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stream-item.selected {
    background: rgba(129, 140, 248, 0.15);
    border-color: rgba(129, 140, 248, 0.3);
}

.file-name {
    flex-grow: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 10px;
    color: #e2e8f0;
    min-width: 0;
}

.btn-item-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-item-remove:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.btn-item-download {
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-item-download:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

/* ==========================================
   9. COMPONENTS & UTILITIES
   ========================================== */
/* Custom Checkboxes */
.custom-checkbox {
    display: block;
    position: relative;
    padding-left: 20px;
    cursor: pointer;
    font-size: 22px;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -10px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: 0.2s;
}

.custom-checkbox:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.retrieve-mode .custom-checkbox {
    display: none;
}

/* Edit Mode Layouts */
.results-stream {
    max-height: 250px;
}

.highlight-code {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 2px;
}

.edit-dropzone {
    margin-top: 15px;
    min-height: 120px;
    border: 1px dashed rgba(129, 140, 248, 0.4);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.edit-dropzone:hover {
    border-color: var(--accent);
    background: rgba(129, 140, 248, 0.1);
}

.edit-dropzone i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.edit-dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.results-footer {
    margin-top: 20px;
    gap: 10px;
}

.btn-action-save {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: white;
    padding: 12px;
    border-radius: 8px;
}

.btn-action-save:hover {
    background: rgba(99, 102, 241, 0.4);
}

.btn-action-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 12px;
    border-radius: 8px;
}

.btn-action-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Success, Errors, & Loaders */
.success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 20px auto;
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
}

.code-display-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

#generated-code {
    font-family: 'Courier New', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

#copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

#copy-btn:hover {
    color: white;
}

.caution-box {
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    color: #facc15;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(129, 140, 248, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s infinite linear;
    box-shadow: 0 0 20px var(--accent-glow);
}

.loading-overlay span {
    text-align: center;
    max-width: 85%;
    word-break: break-word;
    /* Wrap long filenames */
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 10px;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent);
    color: white;
    padding: 15px 25px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: 0.5s;
}

.toast.show {
    transform: translateX(0);
}

/* ==========================================
   New Drop Zone Icon System
   ========================================== */
.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.4s ease;
    min-height: 150px;
    padding: 25px 15px;
    gap: 6px;
}

.drop-zone-content:hover {
    color: white;
}

/* Icon Wrapper — positions glow, orbit, circle */
.drop-zone-icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* Soft ambient glow behind the icon */
.drop-zone-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
    animation: dz-glow-pulse 3s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Orbit ring container */
.drop-zone-orbit {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px solid rgba(129, 140, 248, 0.12);
    animation: dz-orbit-spin 14s linear infinite;
}

/* Orbiting dots */
.orbit-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

.orbit-dot.d1 {
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-dot.d2 {
    bottom: 12px;
    right: -1px;
}

.orbit-dot.d3 {
    bottom: 12px;
    left: -1px;
}

/* Central circle holding the SVG */
.drop-zone-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    border: 1.5px solid rgba(129, 140, 248, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        background 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
    z-index: 1;
}

.drop-zone-svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
    filter: drop-shadow(0 0 6px rgba(129, 140, 248, 0.3));
    transition: color 0.4s ease, filter 0.4s ease;
}

.upload-arrow {
    animation: dz-arrow-float 2.5s ease-in-out infinite;
}

.cloud-path {
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

/* Drop zone text */
.drop-zone-label {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.drop-zone-hint {
    font-size: 0.75rem;
    opacity: 0.45;
    letter-spacing: 0.2px;
}

/* ---- Hover states ---- */
.drop-zone-content:hover .drop-zone-glow {
    animation: dz-glow-pulse-hover 1.5s ease-in-out infinite alternate;
}

.drop-zone-content:hover .drop-zone-orbit {
    animation-duration: 5s;
    border-color: rgba(129, 140, 248, 0.3);
}

.drop-zone-content:hover .drop-zone-circle {
    transform: scale(1.1);
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.drop-zone-content:hover .drop-zone-svg {
    color: #a5b4fc;
    filter: drop-shadow(0 0 12px rgba(165, 180, 252, 0.5));
}

.drop-zone-content:hover .cloud-path {
    opacity: 1;
}

.drop-zone-content:hover .upload-arrow {
    animation: dz-arrow-bounce 1s ease-in-out infinite;
}

/* ---- Keyframes ---- */
@keyframes dz-glow-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes dz-glow-pulse-hover {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.3);
        opacity: 1;
    }
}

@keyframes dz-orbit-spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dz-arrow-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes dz-arrow-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* ==========================================
   10. SEO, INFO SECTION & FOOTER
   ========================================== */
.trust-badge {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-align: center;
    padding-bottom: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0.8;
}

.trust-badge i {
    color: #4ade80;
    font-size: 0.65rem;
}

.view-home-container {
    width: 100%;
    margin-top: 20px;
}

.seo-content-section {
    max-width: 800px;
    margin: 20px auto 40px auto;
    padding: 0 25px;
    color: var(--text-muted);
    line-height: 1.7;
    position: relative;
    z-index: 5;
}

.seo-content-section h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 800;
}

.seo-content-section h2 span {
    background: linear-gradient(to right, #7c8cff, #c6a0eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 800;
}

.typing-heading {
    display: inline-block;
    animation: typeCenter 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.seo-faq {
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    /* Ensure full width */
}

.seo-faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.seo-faq-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.seo-faq-item h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.seo-faq-item h3::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--accent);
}

.site-footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 100%;
}

.footer-links {
    margin-top: 10px;
    color: var(--accent);
    opacity: 0.8;
}

.footer-links span {
    margin: 0 5px;
}

/* Legacy Info Classes */
.hero-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.hero-sub {
    font-size: 16px;
    opacity: 0.8;
    max-width: 600px;
}

.seo-footer {
    font-size: 14px;
    opacity: 0.6;
    text-align: center;
    margin-top: 40px;
}

/* ==========================================
   11. ANIMATION KEYFRAMES
   ========================================== */
/* FIX: Applies delayed entrance to Single View AND Home (SEO) View so it always animates on arrival */
#view-single:not(.hidden),
.view-home-container:not(.hidden) {
    animation: initFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both;
}

@keyframes initFadeDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes initFadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navScaleY {
    0% {
        opacity: 0;
        transform: translateY(-50%) scaleY(0);
    }

    100% {
        opacity: 1;
        transform: translateY(-50%) scaleY(1);
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}



@keyframes typeCenter {
    0% {
        clip-path: inset(0 50% 0 50%);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

@keyframes smoothItemAdd {
    0% {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        height: 54px;
        min-height: 54px;
        padding-top: 8px;
        padding-bottom: 8px;
        transform: translateY(0);
    }
}

/* ========================================= */
/* 12. RESPONSIVE MOBILE BREAKPOINT          */
/* ========================================= */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto !important;
        position: relative;
        width: 100%;
        height: auto;
    }


    /* Pin Q Logo Inside the Glass */
    /* --- MOBILE RESPONSIVE LOGO SWAP --- */

    /* 1. Show the new dedicated glass container perfectly at the top-left */
    /* --- MOBILE RESPONSIVE LOGO SWAP --- */

    /* 1. Position absolutely so it scrolls away and NEVER hides text! */
    .mobile-top-glass {
        display: none !important;
    }

    .mobile-hide {
        display: none !important;
    }

    /* 2. Shrink the Q logo slightly to make it an elegant, unobtrusive watermark */
    .mobile-top-glass .nav-brand {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
        border-radius: 12px !important;
        opacity: 0.8 !important;
        /* Slight fade to blend into the background */
    }

    /* 3. Hide the trapped logo inside the bottom pill */
    .floating-nav #nav-brand {
        display: flex !important;
    }

    /* Edge-to-Edge Footer */
    /* Consolidating footer below */

    /* Wrap Fix */
    .seo-content-section h2 {
        color: var(--text-primary);
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 25px;
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Mobile Nav Layout */
    .floating-nav {
        left: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%) !important;
        flex-direction: row;
        width: auto;
        max-width: 95%;
        padding: 12px 20px;
        gap: 15px;
        border-radius: 50px;
        /* CHANGED: Increased delay to 0.35s to follow the title and card smoothly */
        animation: navScaleY 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
    }

    @keyframes navScaleYMobile {
        0% {
            opacity: 0;
            transform: translateX(-50%) scaleY(0);
        }

        100% {
            opacity: 1;
            transform: translateX(-50%) scaleY(1);
        }
    }

    /* .nav-brand { display: none; } */

    /* Layout Scaling */
    .viewport {
        padding: 40px 15px 140px 15px;
        /* Offset for both header and bottom nav */
        justify-content: center;
        min-height: 100svh;
        width: 100%;
        overflow: visible;
        /* Let body handle scroll */
        position: relative;
        gap: 20px;
        /* Restored balance for functional views */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .main-heading {
        font-size: 2.2rem;
        margin-top: -20px;
        /* Pull header up slightly */
        margin-bottom: 5px;
    }

    .hero-divider {
        position: relative;
        bottom: auto !important;
        margin-top: 5px;
        margin-bottom: 0;
    }

    .glass-hub {
        padding: 25px 25px;
        margin-top: 0px;
        /* Removed margin to follow the shift */
        max-width: 100%;
        width: calc(100% - 24px);
        border-radius: 28px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.02);
    }

    .drop-zone-content {
        padding: 5px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .drop-zone-svg {
        transform: scale(0.9);
    }

    .drop-zone-label {
        font-size: 0.85rem !important;
        margin-top: 6px;
    }

    /* Session Card Mobile Scaling */
    .session-hud {
        height: min(480px, calc(100svh - 120px)) !important;
        max-height: calc(100svh - 140px) !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .data-stream {
        transform: translateZ(0);
        will-change: transform;
        max-height: 227px !important;
        margin-bottom: auto;
        margin-top: auto;
    }

    /* Minor Visual Adjustments */
    .hud-title {
        font-size: 0.95rem !important;
    }

    .hud-subtitle {
        font-size: 0.65rem !important;
    }

    .shield-path {
        animation: shieldGlow 3s ease-in-out infinite;
    }

    @keyframes shieldGlow {

        0%,
        100% {
            filter: drop-shadow(0 0 2px var(--accent));
            opacity: 0.35;
        }

        50% {
            filter: drop-shadow(0 0 10px var(--accent));
            opacity: 0.6;
        }
    }

    /* SEO Section Mobile Refinement */
    .view-home-container {
        margin-top: -15px;
        /* Moved down slightly from -45px */
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        width: 100%;
    }

    .seo-content-section {
        padding: 0px 10px 40px 10px;
        /* Removed top padding entirely */
        text-align: center;
    }

    .seo-content-section h2 {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
    }

    .seo-content-section h2 span {
        font-size: 1.8rem !important;
    }

    .seo-content-section p {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--text-muted);
        margin-bottom: 25px;
    }

    .seo-faq-item {
        padding: 20px;
        text-align: left;
    }

    .seo-faq-item h3 {
        font-size: 1.05rem !important;
        line-height: 1.4;
    }

    /* Final Mobile Footer Design - Reference Perfect */
    /* --- ULTRA-PREMIUM MOBILE FOOTER REDESIGN --- */
    .site-footer {
        width: calc(100% + 30px) !important;
        margin: 0 -15px !important;
        margin-bottom: -200px !important;
        padding: 70px 24px 160px 24px !important;
        /* Premium airy padding */
        text-align: center;
        position: relative;
        z-index: 10;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;

        /* Advanced Glassmorphism: Deep & Vibrant */
        background: linear-gradient(to bottom,
                rgba(15, 23, 42, 0.4) 0%,
                rgba(3, 7, 18, 0.92) 50%,
                rgba(3, 7, 18, 1) 100%) !important;
        backdrop-filter: blur(28px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(28px) saturate(160%) !important;

        /* Elite Accent Glow Divider */
        border-top: 1px solid rgba(129, 140, 248, 0.15);
        box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    /* Floating Navigation Safe-Zone Indicator */
    .site-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 2px;
        background: var(--accent);
        border-radius: 2px;
        opacity: 0.3;
        box-shadow: 0 0 10px var(--accent);
    }

    .footer-content p {
        font-family: 'Inter', system-ui, sans-serif;
        font-size: 1.05rem;
        font-weight: 500;
        line-height: 1.6;
        margin-bottom: 24px;
        color: rgba(255, 255, 255, 0.95);
        letter-spacing: 0.4px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px 18px;
        font-size: 0.88rem !important;
        font-weight: 600;
        max-width: 320px;
        margin: 0 auto !important;
        letter-spacing: 0.2px;
    }

    .footer-links span {
        color: var(--accent);
        opacity: 0.7;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 4px 0;
        position: relative;
    }

    /* Custom Vertical Dividers - REMOVED */
    .footer-links span:not(:last-child)::after {
        display: none;
    }

    .footer-links span:hover {
        opacity: 1;
        color: #fff;
        transform: translateY(-1px);

    }

    .session-toolbar {
        padding: 0 5px 0px 17px;
        margin-bottom: 0px;
    }

    /* ==============================================================
   14. UI/UX SURGEON: THE "FIXED ANCHOR" PTR ARCHITECTURE
   ============================================================== */


    /* 1. THE ENGINE: Keep Body scrollable to keep PTR alive */
    body:has(#view-single:not(.hidden),
        #view-session:not(.hidden),
        #view-retrieve:not(.hidden),
        #view-success:not(.hidden),
        #view-results:not(.hidden)) {
        height: 100svh !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
        margin: 0 !important;
    }

    /* 2. THE ANCHOR: Lock the Viewport so it cannot scroll up/down */
    body:has(#view-single:not(.hidden),
        #view-session:not(.hidden),
        #view-retrieve:not(.hidden),
        #view-success:not(.hidden),
        #view-results:not(.hidden)) .viewport {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100svh !important;

        /* Razor blade: Invisibly cuts off the 140px padding that was causing the scroll */
        overflow: hidden !important;
        box-sizing: border-box !important;

        /* THE MAGIC KEY: Explicitly tells the mobile browser to pass vertical pull gestures 
           through the fixed container directly to the body to trigger PTR. */
        touch-action: pan-y !important;
    }
}




/* Hides the separated mobile logo on laptops/desktops */
.mobile-top-glass {
    display: none;
}

/* ========================================= */
/* 13. LOW-END DEVICE (4GB RAM) OPTIMIZATIONS*/
/* ========================================= */

/* ========================================= */
/* ELITE SMOOTH ANIMATION FOR 4GB PHONES     */
/* ========================================= */

@keyframes optimalFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

body.low-tier-device .heading-section,
body.low-tier-device #view-single:not(.hidden),
body.low-tier-device .view-home-container:not(.hidden),
body.low-tier-device .floating-nav {
    /* Swaps the heavy sliding glass animation for a pure opacity fade. 
       Moving a blurred element kills low-end GPUs. Fading it is buttery smooth and fast! */
    animation-name: optimalFadeIn !important;
}

/* Triggered strictly by JS hardware detection. High-end phones remain untouched. */
body.low-tier-device .glass-hub,
body.low-tier-device .floating-nav {
    /* Retains the glass look, but cuts GPU rendering cost by 80% */
    backdrop-filter: blur(12px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(120%) !important;
}

body.low-tier-device .background-canvas::after {
    mix-blend-mode: normal !important;
    /* Saves GPU pixel-math calculations */
    opacity: 0.03 !important;
}

body.low-tier-device .bubble {
    filter: blur(15px) !important;
    mix-blend-mode: normal !important;
    transform: translateZ(0) !important;
}

body.low-tier-device .neural-core-svg,
body.low-tier-device .hud-title {
    /* Disables incredibly laggy SVG and text drop-shadows on weak mobile processors */
    filter: none !important;
}

body.low-tier-device .btn-glow-primary,
body.low-tier-device .pulse-icon {
    /* Drastically reduces shadow spread radius to stop the GPU from painting massive bounding boxes */
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2) !important;
}



/* ==============================================================
   15. UI/UX SURGEON: DEDICATED TABLET (iPAD) REFINEMENT
   ============================================================== */
@media (min-width: 500px) and (max-width: 768px) {

    /* 1. RESTORE CARD PROPORTIONS */
    /* Stops the card from stretching across the entire 768px iPad screen */
    .glass-hub {
        max-width: 480px !important;
        /* Elegant tablet-optimized width */
        width: 100% !important;

        /* Restore premium internal breathing room lost in the mobile query */
        padding: 40px !important;

        /* Mathematically guarantee it stays dead-center in the viewport */
        margin-left: auto !important;
        margin-right: auto !important;

        /* Soften the border radius slightly for larger screens */
        border-radius: 36px !important;
    }

    /* 2. OPTIMIZE THE NEURAL SESSION HEIGHT */
    /* Tablets have more vertical real estate; give the multi-file list room to breathe */
    .session-hud {
        height: min(600px, calc(100svh - 220px)) !important;
        max-height: calc(100svh - 220px) !important;
        padding: 35px !important;
    }

    /* 3. EXPAND THE DATA STREAM (File List) */
    /* Prevents the internal file list from feeling cramped on an iPad */
    .data-stream {
        max-height: 350px !important;
        margin-top: 25px !important;
    }

    /* 4. RE-BALANCE THE MAIN HEADING */
    /* Keeps the QuantC logo and text from crowding the beautifully restored card */
    .main-heading {
        font-size: 3.5rem !important;
        margin-bottom: 10px !important;
    }
}


/* ==============================================================
   16. UI/UX SURGEON: COMPACT MOBILE (iPHONE SE / SHORT SCREENS)
   ============================================================== */
@media (max-width: 430px) and (max-height: 720px) {

    /* 1. Reclaim Space from the Header */
    .heading-section {
        margin-top: 5vh !important;
        /* Pull up closer to the top edge */
    }

    .main-heading {
        font-size: 2.2rem !important;
        margin-bottom: 0px !important;
    }

    .sub-heading {
        font-size: 0.85rem !important;
        margin-top: 5px !important;
        margin-bottom: 12px !important;
    }

    /* 2. Compress the Main Hub's Outer Shell */
    .glass-hub {
        padding: 20px !important;
        /* Reduced from 25px/30px */
        margin-top: 0 !important;
    }

    /* 3. Shrink the Drop Zone (The biggest vertical space hog) */
    .drop-trigger {
        padding: 15px !important;
        /* Shaves 20px off height */
        margin-bottom: 15px !important;
        border-radius: 20px !important;
    }

    .pulse-icon {
        width: 45px !important;
        /* Shaves 15px */
        height: 45px !important;
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }

    /* 4. Tame the Inputs and Buttons */
    .trust-badge {
        margin-bottom: 10px !important;
    }

    .input-glow-group {
        margin-bottom: 10px !important;
    }

    input {
        padding: 14px 20px 14px 50px !important;
        /* Slimmer input fields */
        font-size: 0.9rem !important;
    }

    .btn-glow-primary {
        padding: 15px !important;
        /* Slimmer button */
        font-size: 0.95rem !important;
    }

    /* 5. Session HUD Adjustments (Ensures Multi-file view also fits) */
    .session-hud {
        height: min(420px, calc(100svh - 130px)) !important;
        padding: 15px !important;
    }

    .data-stream {
        max-height: 160px !important;
        /* Prevents list from pushing button off-screen */
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
}


/* ==============================================================
   17. UI/UX SURGEON: 4GB EXACT VISUAL REPLICA (PRE-BLURRED ORBS)
   ============================================================== */

/* 1. BRING BACK ALL 3 ORBS: Override the low-tier rule that hid b2 and b3 */
body.low-tier-device .b2,
body.low-tier-device .b3,
[data-tier="low"] .b2,
[data-tier="low"] .b3 {
    display: block !important;
}

/* 2. STRIP THE GPU TAX: Remove the heavy blur and screen blend mode, 
   but KEEP the exact original positions, top/left coordinates, and sizes. */
body.low-tier-device .bubble,
[data-tier="low"] .bubble {
    filter: none !important;
    mix-blend-mode: normal !important;
    animation: none !important;
    will-change: auto !important;
    opacity: 1 !important;
    /* Opacity is managed directly in the gradients below */
}

/* 3. INJECT MATHEMATICAL BLUR: Recreate the 40px blur effect purely through 
   fading CSS color stops. This looks identical to a blur but costs 0 GPU math. */
body.low-tier-device .b1,
[data-tier="low"] .b1 {
    /* Indigo Top-Left Orb */
    background: radial-gradient(closest-side, rgba(67, 56, 202, 0.55) 0%, rgba(67, 56, 202, 0.2) 60%, transparent 100%) !important;
}

body.low-tier-device .b2,
[data-tier="low"] .b2 {
    /* Blue Bottom-Right Orb */
    background: radial-gradient(closest-side, rgba(99, 102, 241, 0.55) 0%, rgba(99, 102, 241, 0.2) 60%, transparent 100%) !important;
}

body.low-tier-device .b3,
[data-tier="low"] .b3 {
    /* Purple Middle-Left Orb */
    background: radial-gradient(closest-side, rgba(168, 85, 247, 0.35) 0%, rgba(168, 85, 247, 0.1) 60%, transparent 100%) !important;
}

/* 4. RESTORE PREMIUM GLASS: Give the cards back their frosted aesthetic 
   using a lightweight, highly optimized 12px blur that 4GB phones can handle. */
body.low-tier-device .glass-hub,
[data-tier="low"] .glass-hub {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.02) !important;
}

body.low-tier-device .floating-nav,
[data-tier="low"] .floating-nav {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
}

/* ==============================================================
   18. UI/UX SURGEON: 4GB TYPING & INPUT ZERO-LAG OPTIMIZATION
   ============================================================== */

/* Kills the repaints caused by cursor blinking and transition math */
body.low-tier-device input,
body.low-tier-device input:focus,
[data-tier="low"] input,
[data-tier="low"] input:focus {
    /* Instantly applies focus states without calculating easing frames */
    transition: none !important;

    /* Removes the glowing box-shadow which forces the GPU to constantly 
       re-render the blurred glass underneath the input field */
    box-shadow: none !important;

    /* Forces the mobile browser to put the input box on its own 
       hardware-accelerated compositor layer, completely isolating it 
       from the background math */
    transform: translateZ(0) !important;
    will-change: transform !important;
}

body.low-tier-device .btn-glow-primary,
[data-tier="low"] .btn-glow-primary {
    transition: none !important;
}



/* ==============================================================
   19. UI/UX SURGEON: DYNAMIC NETWORK SPEED INDICATOR
   ============================================================== */
.network-speed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: -10px;
    /* Pulls it slightly closer to the text above it */
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    transition: all 0.4s ease;
    animation: initFadeUp 0.4s ease forwards;
}

/* Fast Connection (Green) */
.network-speed-badge.fast {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

/* Slow Connection Warning (Amber) */
.network-speed-badge.slow {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}