:root {
    color-scheme: dark;
    /* iOS 26 High-Fidelity Colors */
    --primary-color: #0A84FF;
    --primary-glow: rgba(10, 132, 255, 0.5);
    --success-color: #30D158;
    --warning-color: #FFD60A;
    --danger-color: #FF453A;

    /* Theme Tokens */
    --bg-body: #000000;
    --glass-base: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-tertiary: rgba(255, 255, 255, 0.45);

    /* Refined Radius (Professional Standard) */
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 8px;

    --header-height: 72px;

    /* Editor line alignment - MUST be identical between .line-numbers and textarea */
    --editor-font-size: 14px;
    --editor-line-height: 22px;
    --editor-padding-top: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    /* padding-top removed to let sticky elements push content down naturally */
}

main {
    /* No artificial padding needed with sticky positioning */
    flex: 1;
    position: relative;
    z-index: 1;
}

/* --- Marquee Bar --- */
.marquee-bar {
    width: 100%;
    background: linear-gradient(90deg, #001a4d, #000000, #001a4d);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: sticky;
    /* Sticky ensures it takes up space in the flow */
    top: 0;
    left: 0;
    z-index: 2002;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-left: 100%;
}

@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* --- Vivid Animated Background --- */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #050505;
    overflow: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}

body::before {
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, #0044ff 0%, transparent 70%);
    animation: flowGlobal 20s infinite alternate;
}

body::after {
    bottom: -200px;
    right: -200px;
    background: radial-gradient(circle, #00C6FF 0%, transparent 70%);
    animation: flowGlobal 25s infinite alternate-reverse;
}

@keyframes flowGlobal {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* --- Premium Glass Header --- */
header {
    height: var(--header-height);
    background: rgba(15, 15, 15, 0.85);
    /* Slightly darker for contrast */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    /* Sticky ensures it takes up space below the marquee */
    /* Sticks at 36px (height of marquee) */
    top: 36px;
    left: 0;
    width: 100%;
    /* Ensure full width when fixed */
    z-index: 2001;
    /* Above content, below marquee */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    margin-top: 0;
    /* Reset */
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.brand i {
    color: var(--primary-color);
    font-size: 26px;
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

#mainNav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.4);
}

/* Form Controls (Language) */
.lang-select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}

.lang-select option {
    background: #000;
    color: white;
}

/* Mobile Sub-Bar & Mobile Dropdown: STRICTLY HIDDEN ON PC DESKTOP */
#mobileSubBar,
.mobile-sub-bar,
.mobile-tool-select {
    display: none !important;
}

/* --- Main Layout --- */
main {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    /* Increased width to utilize space for side-by-side view */
    margin: 40px auto;
    padding: 0 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: stretch;
    /* Stretch to preserve equal heights if content allows */
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    header {
        padding: 0 20px;
    }
}

/* --- Glass Cards --- */
.card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    /* Added ensure height matching logic via flex if strictly needed,
       but align-items: stretch on grid mostly handles outer containers. */
}

/* Top shiny edge */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- Inputs --- */
/* --- Inputs --- */
/* Legacy textarea support (if any unwrapped exist) */
textarea:not(.textarea-wrapper textarea) {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: white;
    padding: 20px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    min-height: 250px;
}

textarea:not(.textarea-wrapper textarea):focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

/* --- Buttons --- */
.btn {
    width: 100%;
    height: 56px;
    border-radius: var(--radius-lg);
    border: none;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #2979FF, #0A84FF);
    color: white;
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 30px rgba(10, 132, 255, 0.5);
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn i {
    font-size: 18px;
}

.check-group {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

/* --- Mode Selectors --- */
.mode-selector {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 16px;
    display: flex;
    gap: 4px;
    border: 1px solid var(--glass-border);
    margin: 20px 0;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: var(--primary-color);
    /* Always colored when active */
    color: white;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.4);
}

#fastMode.active {
    background: var(--primary-color);
    /* Active mode button highlight style */
    /* Ensuring the selected mode button is highlighted in either Blue or Green instead of grey. 
       Primary-color (Blue) or Success-color (Green) are used to indicate active status. */
    background: var(--success-color);
    /* Keep turbo green to distinguish 'Fast' */
    box-shadow: 0 2px 15px rgba(48, 209, 88, 0.4);
    color: black;
}

/* --- Stats Cards (Top) --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    display: block;
    color: white;
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Updated List Rows (Compact Bottom) */
.results-summary-area {
    margin-top: auto;
    /* Push to bottom */
    padding-top: 10px;
}

.results-cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.result-row {
    flex: 1;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    gap: 4px;
}

.result-row:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
}

.label {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.stat-number {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
    margin: 0;
    line-height: 1.2;
}

/* Action Icons (Smaller) */
.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: white;
    color: black;
}

/* File Upload */
.file-upload {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
    margin-top: 10px;
}

.file-upload:hover {
    background: rgba(10, 132, 255, 0.1);
    border-color: var(--primary-color);
}

.file-upload i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-tertiary);
}

/* Table - Detailed Log (Expanded) */
.table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    /* Strict dimensions to prevent expansion */
    height: 380px !important;
    max-height: 380px !important;
    min-height: 380px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    position: relative;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #181818;
}

/* Textarea Wrapper to fix Scrollbar Cursor (I-beam -> Arrow) */
.textarea-wrapper {
    display: flex;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    min-height: 250px;
    height: 380px;
    /* Fixed height */
    overflow: hidden;
    /* No outer scroll, inner element handles it */
    position: relative;
    transition: all 0.3s;
}

.line-numbers {
    width: 46px;
    min-width: 46px;
    padding: 20px 8px 20px 8px;
    text-align: right;
    font-family: monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    opacity: 0.65;
    user-select: none;
    pointer-events: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    white-space: pre;
    box-sizing: border-box;
}

#lineNumbersInner {
    will-change: transform;
    transition: none;
}

.textarea-wrapper:hover,
.table-container:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.textarea-wrapper:focus-within {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.textarea-wrapper textarea {
    flex: 1;
    display: block;
    width: 100%;
    height: 100%;
    /* Fill wrapper */
    background: transparent;
    border: none;
    padding: 20px 16px;
    border-radius: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    box-shadow: none;
    outline: none !important;
    overflow-y: auto;
    /* Inner scrollbar */
    color: white;
    cursor: text;
    white-space: pre;
}

.table-container th,
.table-container td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-container th:nth-child(1),
.table-container td:nth-child(1) {
    width: 60px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.table-container th:nth-child(2),
.table-container td:nth-child(2) {
    width: calc(65% - 40px);
}

.table-container th:nth-child(3),
.table-container td:nth-child(3) {
    width: calc(35% - 20px);
}

th {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

/* Ensure corners of the container are respected */
.table-container th:first-child {
    border-top-left-radius: 12px;
}

.table-container th:last-child {
    border-top-right-radius: 12px;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 13px;
    font-family: monospace;
    vertical-align: middle;
}

/* Status Text (No Badge Background) to match Results */
.count-badge {
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.bg-success {
    color: var(--success-color);
}

.bg-warning {
    color: var(--warning-color);
}

.bg-danger {
    color: var(--danger-color);
}

.bg-neutral {
    color: var(--text-secondary);
}

/* Pulse Live Indicator */
.live-indicator {
    font-size: 12px;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success-color);
}


/* Progress Bar (Legacy Style restored) */
.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0A84FF, #5E5CE6);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 5px;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

.helper-text {
    background: rgba(10, 132, 255, 0.15);
    padding: 10px;
    border-radius: 10px;
    color: #4da3ff;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.helper-link {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

/* 2FA/Notepad Fixes */
.secret-input {
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3) !important;
    text-align: center;
    font-family: monospace;
    font-size: 20px;
    letter-spacing: 1px;
}

::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: #555;
    border: 3px solid rgba(30, 30, 30, 1);
    border-radius: 8px;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    border-color: rgba(30, 30, 30, 1);
}

#mobileBottomNav {
    display: none;
}

/* --- Mobile Bottom Navigation & Header Optimization --- */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }

    /* Hide desktop nav inside header on mobile */
    #mainNav {
        display: none !important;
    }

    /* Mobile Header: Row 1 */
    header {
        height: 52px;
        padding: 0 12px;
        background: rgba(15, 17, 21, 0.98) !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        top: 36px;
        z-index: 2001;
        gap: 8px;
    }

    .brand {
        font-size: 15px;
        gap: 6px;
        flex-shrink: 0;
    }

    .brand i {
        font-size: 18px;
    }

    .controls {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0;
    }

    /* On mobile, desktop action buttons in header are hidden (they appear in mobileSubBar) */
    header .controls #vipUpgradeBtn,
    header .controls #adminPanelBtn {
        display: none !important;
    }

    .lang-select {
        padding: 4px 6px !important;
        font-size: 11.5px !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        flex-shrink: 0;
    }

    #userProfileHeader {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        padding: 4px 8px !important;
        font-size: 11.5px !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        flex-shrink: 0;
    }

    #headerUsername {
        max-width: 85px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        font-size: 11.5px;
        font-weight: 600;
    }

    #headerTierBadge {
        display: inline-flex !important;
        font-size: 9px !important;
        font-weight: 800 !important;
        padding: 2px 5px !important;
        border-radius: 5px !important;
        letter-spacing: 0.5px !important;
    }

    /* Mobile Sub-Bar: Row 2 (Tool Selector & Actions) */
    #mobileSubBar, .mobile-sub-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        background: rgba(21, 23, 28, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 88px;
        z-index: 1999;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        gap: 8px;
    }

    .mobile-sub-bar-left {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
    }

    .mobile-tool-select {
        display: inline-block !important;
        background: rgba(255, 255, 255, 0.09) !important;
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, 0.22) !important;
        padding: 6px 10px !important;
        border-radius: 8px !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        outline: none !important;
        width: 100%;
        max-width: 220px;
    }

    .mobile-tool-select option {
        background: #15171c;
        color: #fff;
        font-size: 13px;
    }

    .mobile-sub-bar-right {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .mob-action-btn {
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 11.5px;
        font-weight: 700;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        transition: all 0.2s;
    }

    .mob-action-btn.vip-btn {
        background: linear-gradient(135deg, #FFD700, #FFA500);
        color: #111;
    }

    .mob-action-btn.admin-btn {
        background: linear-gradient(135deg, #ff6b35, #ff9f1c);
        color: #1a1a1a;
    }

    /* Modal padding adjustment */
    .modal-card {
        padding-bottom: 40px !important;
        margin-bottom: 20px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
}

/* --- Feature Switches Bar (Fast Mode, Check Flag, Check Deleted) --- */
.feature-switches-wrapper {
    margin: 16px 0 20px 0;
}

.feature-switches-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 12px 16px;
    background: rgba(18, 24, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    position: relative;
}

.feature-switch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.feature-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    cursor: pointer;
}

.feature-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.feature-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3b4252;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.feature-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.feature-toggle input:checked + .feature-slider {
    background-color: #2563eb;
}

.feature-toggle input:checked + .feature-slider:before {
    transform: translateX(22px);
}

.feature-toggle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.feature-toggle.disabled .feature-slider {
    cursor: not-allowed;
}

.feature-switch-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #e2e8f0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.vip-lock-icon {
    color: #eab308;
    font-size: 10px;
}

/* --- Popover Card matching User Reference Image --- */
.flag-popover-card {
    display: none;
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    background: #181f2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 1000;
    text-align: left;
    animation: popoverFadeIn 0.2s ease-out forwards;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 6px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.flag-popover-card::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #181f2a;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.feature-switch-item:hover .flag-popover-card,
.flag-popover-card.active {
    display: block;
}

.flag-popover-header {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
}

.flag-popover-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
    line-height: 1.4;
}

.flag-popover-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 10px 0;
}

.flag-popover-bold {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.flag-popover-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 12px;
}

.flag-popover-vip {
    font-size: 12px;
    font-weight: 600;
    color: #eab308;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Flag Badge in Results Table */
.badge-flagged-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: help;
    vertical-align: middle;
}

/* Screen Reader Only & SEO Off-screen Utilities */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.seo-content {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
