:root {
    --bg-primary: #000000;
    --bg-secondary: #080808;
    --bg-card: #0c0c0c;
    --bg-card-hover: #141414;
    --bg-input: #050505;
    
    --border-color: #222222;
    --border-glow: rgba(0, 255, 102, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-blue: #0084ff;
    --accent-cyan: #00f2fe;
    --accent-purple: #a855f7;
    --accent-green: #00ff66;
    --accent-red: #ff1744;
    --accent-amber: #ffab00;
    --accent-magenta: #ff007f;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.85);
    --shadow-glow: 0 0 25px rgba(0, 255, 102, 0.2);
    
    --font-main: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Glows */
.glow-bg {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.glow-1 {
    top: -100px;
    left: 10%;
    background: radial-gradient(circle, var(--accent-blue), transparent 70%);
}
.glow-2 {
    bottom: -100px;
    right: 10%;
    background: radial-gradient(circle, var(--accent-purple), transparent 70%);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Firebase Google Sign-In Gatekeeper Overlay */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 9, 14, 0.92);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 132, 255, 0.4);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 132, 255, 0.25);
}
.auth-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #0084ff, #00c6ff);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.5);
}
.auth-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 26px;
    line-height: 1.5;
}
.btn-google-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #ffffff;
    color: #1f1f1f;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}
.btn-google-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
    background: #f5f5f5;
}
.auth-footer {
    margin-top: 22px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* User Profile Mini Badge */
.user-auth-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}
.user-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-cyan);
}
.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.user-name-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.user-email-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.btn-signout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.btn-signout:hover {
    color: var(--accent-red);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(14, 19, 31, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0084ff, #00c6ff);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.4);
}

.logo-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(0, 230, 118, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.3);
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-red);
    transition: all 0.3s ease;
}

.status-pill.running {
    background: rgba(0, 230, 118, 0.12);
    border-color: rgba(0, 230, 118, 0.3);
    color: var(--accent-green);
}
.status-pill.typing {
    background: rgba(255, 171, 0, 0.12);
    border-color: rgba(255, 171, 0, 0.3);
    color: var(--accent-amber);
}
.status-pill.seen {
    background: rgba(0, 242, 254, 0.12);
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--accent-cyan);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.uptime-box {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}
.uptime-box span {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Stats Overview Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 132, 255, 0.4);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-cyan { background: rgba(0, 242, 254, 0.12); color: var(--accent-cyan); }
.icon-purple { background: rgba(157, 78, 221, 0.12); color: var(--accent-purple); }
.icon-amber { background: rgba(255, 171, 0, 0.12); color: var(--accent-amber); }
.icon-green { background: rgba(0, 230, 118, 0.12); color: var(--accent-green); }

.stat-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stat-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}
.user-name-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-main);
    font-size: 1rem;
}

/* Multi-Server Runner Hub */
.multi-server-card {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(14, 19, 31, 0.9);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: var(--radius-lg);
}
.multi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.multi-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.multi-title i {
    font-size: 1.5rem;
}
.multi-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.multi-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Server Instances Grid */
.server-instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.server-instance-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
}
.server-instance-card.active-server {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}
.instance-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.instance-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.instance-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.status-running { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); border: 1px solid rgba(0, 230, 118, 0.3); }
.status-stopped { background: rgba(255, 23, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(255, 23, 68, 0.3); }
.status-typing { background: rgba(255, 171, 0, 0.15); color: var(--accent-amber); border: 1px solid rgba(255, 171, 0, 0.3); }

.instance-details {
    font-size: 0.76rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.instance-details b {
    color: var(--text-primary);
}
.instance-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.btn-inst-action {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.btn-inst-action:hover {
    background: var(--bg-card-hover);
}
.btn-inst-start { background: rgba(0, 132, 255, 0.2); border-color: rgba(0, 132, 255, 0.4); color: var(--accent-cyan); }
.btn-inst-stop { background: rgba(255, 23, 68, 0.2); border-color: rgba(255, 23, 68, 0.4); color: var(--accent-red); }
.btn-inst-configure { background: rgba(0, 230, 118, 0.2); border-color: rgba(0, 230, 118, 0.4); color: var(--accent-green); }
.btn-inst-delete { flex: 0 0 28px; color: var(--accent-red); }

/* Workspace Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(14, 19, 31, 0.5);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-cyan);
}

.header-title h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.top-actions {
    display: flex;
    gap: 10px;
}

/* Forms & Inputs */
.config-form {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Auto-Remember Banner */
.session-remember-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.banner-left strong {
    color: var(--accent-green);
}

/* Mode Switcher Grid */
.mode-switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .mode-switch-grid {
        grid-template-columns: 1fr;
    }
}
.mode-pill {
    cursor: pointer;
}
.mode-pill input {
    display: none;
}
.mode-pill span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.mode-pill span i {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin-bottom: 2px;
}
.mode-pill span strong {
    font-size: 0.88rem;
    color: var(--text-primary);
}
.mode-pill span small {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.mode-pill input:checked + span {
    background: rgba(0, 132, 255, 0.12);
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(0, 132, 255, 0.25);
}
.mode-pill input:checked + span strong {
    color: #fff;
}

.target-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

/* Trigger Type Selector */
.trigger-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 600px) {
    .trigger-type-selector {
        grid-template-columns: 1fr;
    }
}
.radio-card {
    cursor: pointer;
}
.radio-card input {
    display: none;
}
.radio-card span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.trig-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--text-primary);
}
.trig-top i {
    color: var(--accent-amber);
}
.radio-card span small {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.radio-card input:checked + span {
    background: rgba(255, 171, 0, 0.1);
    border-color: var(--accent-amber);
    box-shadow: 0 0 14px rgba(255, 171, 0, 0.2);
}
.radio-card input:checked + span .trig-top strong {
    color: #fff;
}

.radio-pill {
    cursor: pointer;
}
.radio-pill input {
    display: none;
}
.radio-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.radio-pill input:checked + span {
    background: rgba(0, 132, 255, 0.15);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 132, 255, 0.2);
}

.label-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vault-row {
    margin-bottom: 6px;
}

.form-select {
    width: 100%;
    background: #080c14;
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--accent-cyan);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.form-select:hover, .form-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.form-input, .form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.15);
}

.code-font {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.helper-text {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 6px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    width: fit-content;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-content {
    display: none;
    margin-top: 6px;
}
.tab-content.active {
    display: block;
}

/* File Dropzones */
.file-dropzone {
    border: 2px dashed var(--border-color);
    background: rgba(10, 14, 23, 0.6);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.file-dropzone:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 132, 255, 0.05);
}

.file-dropzone i {
    font-size: 1.8rem;
    color: var(--accent-cyan);
}

.file-dropzone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cookie-status-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cookie-status-msg.valid {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.25);
}
.cookie-status-msg.invalid {
    background: rgba(255, 23, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(255, 23, 68, 0.25);
}

/* Speed Box & Presets */
.speed-control-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.speed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.presets-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.preset-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover, .preset-btn.active {
    background: rgba(0, 242, 254, 0.12);
    border-color: var(--accent-cyan);
    color: #fff;
}

.sliders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .sliders-grid {
        grid-template-columns: 1fr;
    }
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.manual-input-wrap {
    display: inline-flex;
    align-items: center;
    background: #080c14;
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    gap: 4px;
}

.manual-num-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    width: 50px;
    text-align: right;
}

.unit-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.duration-row {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.helper-badge {
    font-size: 0.72rem;
    color: var(--accent-amber);
    background: rgba(255, 171, 0, 0.12);
    border: 1px solid rgba(255, 171, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.slider-val {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 700;
}

.range-slider {
    width: 100%;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.slider-item small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Checkbox Toggle Switch */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 132, 255, 0.05);
    border: 1px solid rgba(0, 132, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: var(--radius-full);
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .switch-slider {
    background-color: var(--accent-blue);
}
input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.checkbox-info {
    display: flex;
    flex-direction: column;
}
.checkbox-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
}
.checkbox-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0084ff, #0055ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.4);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(0, 132, 255, 0.6);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff1744, #d50000);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 23, 68, 0.4);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 23, 68, 0.6);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}
.btn-outline:hover {
    background: rgba(0, 242, 254, 0.1);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-text:hover {
    text-decoration: underline;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Terminal Console Layout */
.terminal-card {
    display: flex;
    flex-direction: column;
}

.terminal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.autoscroll-toggle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

.terminal-wrapper {
    flex: 1;
    background: #05070a;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    overflow-y: auto;
    min-height: 480px;
    max-height: 600px;
}

.terminal-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    word-break: break-word;
    line-height: 1.4;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-time {
    color: var(--text-muted);
    font-size: 0.74rem;
    flex-shrink: 0;
}

.log-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-info { background: rgba(139, 155, 180, 0.15); color: #8b9bb4; }
.tag-success { background: rgba(0, 230, 118, 0.18); color: var(--accent-green); }
.tag-typing { background: rgba(255, 171, 0, 0.18); color: var(--accent-amber); }
.tag-seen { background: rgba(0, 242, 254, 0.18); color: var(--accent-cyan); }
.tag-comment { background: rgba(157, 78, 221, 0.2); color: #c77dff; border: 1px solid rgba(157, 78, 221, 0.4); }
.tag-warn { background: rgba(255, 171, 0, 0.18); color: var(--accent-amber); }
.tag-error { background: rgba(255, 23, 68, 0.18); color: var(--accent-red); }

.log-text {
    color: var(--text-primary);
}

.terminal-footer {
    padding: 14px 20px;
    background: rgba(14, 19, 31, 0.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-indicator-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feat-badge {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}
.feat-badge strong {
    color: var(--accent-cyan);
}

.live-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
}

.pulse-ring {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: var(--shadow-card);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

/* Link Auto-Sync Badge */
.sync-badge {
    margin-top: 4px;
    font-size: 0.76rem;
    color: var(--accent-green);
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* Modal Overlay & Dialog */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(14, 19, 31, 0.6);
}
.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.btn-close:hover { color: #fff; }

.modal-body {
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
}
.modal-body h4 {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}
.modal-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}
.modal-body code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: var(--accent-amber);
    font-size: 0.8rem;
}
.alert-box {
    margin-top: 14px;
    background: rgba(255, 171, 0, 0.1);
    border: 1px solid rgba(255, 171, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--accent-amber);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & DESKTOP FRIENDLY)
   ========================================================================== */

/* Large Desktop (> 1200px) */
@media (min-width: 1200px) {
    .main-layout {
        grid-template-columns: 1.15fr 1fr;
        gap: 28px;
    }
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    .terminal-container {
        height: 540px;
    }
}

/* Tablet & Smaller Laptops (768px - 1024px) */
@media (max-width: 1024px) {
    .app-container {
        padding: 16px;
    }
    .main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .terminal-container {
        height: 420px;
    }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
    .app-container {
        padding: 10px 8px;
    }
    
    /* Navbar Mobile */
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        margin-bottom: 14px;
    }
    .logo-group {
        gap: 12px;
    }
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .logo-title {
        font-size: 1.15rem;
        flex-wrap: wrap;
    }
    .logo-subtitle {
        font-size: 0.72rem;
    }
    .nav-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 10px;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 14px;
    }
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .stat-label {
        font-size: 0.65rem;
    }
    .stat-value {
        font-size: 1.05rem;
    }
    
    /* Card & Forms */
    .card {
        border-radius: var(--radius-md);
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }
    .header-title h2 {
        font-size: 1rem;
    }
    .top-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .top-actions .btn {
        width: 100%;
        padding: 12px;
        font-size: 0.88rem;
        justify-content: center;
    }
    .config-form {
        padding: 14px;
    }
    
    /* Mode switchers & triggers */
    .mode-switch-grid, .trigger-type-selector {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .target-type-selector {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .radio-pill {
        padding: 8px 6px;
        font-size: 0.72rem;
    }
    .speed-preset-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .preset-btn {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
    
    /* Terminal Console */
    .terminal-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .terminal-container {
        height: 320px;
        max-height: 320px;
        padding: 10px;
        font-size: 0.73rem;
    }
    .terminal-footer {
        padding: 10px 14px;
    }
    .status-indicator-group {
        display: none;
    }
    
    /* Auth Modal Mobile */
    .auth-card {
        padding: 24px 18px;
        max-width: 95%;
    }
    .modal-card {
        max-width: 95%;
        margin: 10px;
    }
}

/* =========================================================================
   PURE WHITE / LIGHT THEME MODE STYLES (100% COMPLETE OVERRIDE)
   ========================================================================= */
body.theme-light,
body.theme-bright {
    --bg-primary: #f4f6fb;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    
    --border-color: #cbd5e1;
    --border-glow: rgba(0, 132, 255, 0.25);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(0, 132, 255, 0.15);

    background-color: #f4f6fb !important;
    color: #0f172a !important;
}

body.theme-light .app-container,
body.theme-bright .app-container {
    color: #0f172a !important;
}

body.theme-light .glow-1,
body.theme-bright .glow-1 {
    background: radial-gradient(circle, rgba(0, 132, 255, 0.15), transparent 70%);
}
body.theme-light .glow-2,
body.theme-bright .glow-2 {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15), transparent 70%);
}

body.theme-light .navbar,
body.theme-light .stat-card,
body.theme-light .card,
body.theme-light .multi-server-card,
body.theme-light .server-instance-card,
body.theme-light .account-card,
body.theme-light .speed-control-box,
body.theme-bright .navbar,
body.theme-bright .stat-card,
body.theme-bright .card,
body.theme-bright .multi-server-card,
body.theme-bright .server-instance-card,
body.theme-bright .account-card,
body.theme-bright .speed-control-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    color: #0f172a !important;
}

body.theme-light .logo-title,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light .form-label,
body.theme-light .stat-label,
body.theme-light .checkbox-title,
body.theme-light .account-name-title,
body.theme-bright .logo-title,
body.theme-bright h1,
body.theme-bright h2,
body.theme-bright h3,
body.theme-bright h4,
body.theme-bright .form-label,
body.theme-bright .stat-label,
body.theme-bright .checkbox-title,
body.theme-bright .account-name-title {
    color: #0f172a !important;
}

body.theme-light .logo-subtitle,
body.theme-light .stat-label,
body.theme-light .checkbox-desc,
body.theme-bright .logo-subtitle,
body.theme-bright .stat-label,
body.theme-bright .checkbox-desc {
    color: #475569 !important;
}

body.theme-light .form-input,
body.theme-light .form-textarea,
body.theme-light .form-select,
body.theme-light .manual-num-input,
body.theme-bright .form-input,
body.theme-bright .form-textarea,
body.theme-bright .form-select,
body.theme-bright .manual-num-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
}

body.theme-light .form-input:focus,
body.theme-light .form-textarea:focus,
body.theme-light .form-select:focus,
body.theme-bright .form-input:focus,
body.theme-bright .form-textarea:focus,
body.theme-bright .form-select:focus {
    background: #ffffff !important;
    border-color: #0084ff !important;
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.15) !important;
}

body.theme-light .tab-btn,
body.theme-bright .tab-btn {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

body.theme-light .tab-btn.active,
body.theme-bright .tab-btn.active {
    background: #ffffff !important;
    color: #0084ff !important;
    border-color: #0084ff !important;
    font-weight: 700 !important;
}

body.theme-light .radio-pill,
body.theme-bright .radio-pill {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

body.theme-light .uptime-box,
body.theme-light .status-pill,
body.theme-bright .uptime-box,
body.theme-bright .status-pill {
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.theme-light .proxy-box,
body.theme-bright .proxy-box {
    background: #f0f9ff !important;
    border: 1.5px dashed #38bdf8 !important;
}

/* =========================================================================
   MULTI-ACCOUNT CARDS & VAULT
   ========================================================================= */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 220px;
    flex: 1 1 calc(33.333% - 10px);
    transition: all 0.2s ease;
}

.account-card:hover {
    border-color: var(--accent-magenta);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.account-card.active-account {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.06);
}

.account-avatar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-magenta), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.account-details {
    flex: 1;
    overflow: hidden;
}

.account-name-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-sub-uid {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.account-actions {
    display: flex;
    gap: 6px;
}

/* =========================================================================
   HACKER TERMINAL CONSOLE STYLES & SCANLINES
   ========================================================================= */
.hacker-terminal-card {
    background: #06080c !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 0 35px rgba(0, 255, 102, 0.08) !important;
}

.hacker-term-header {
    background: #090d14 !important;
    border-bottom: 1px solid #1e293b !important;
    padding: 10px 14px !important;
}

.hacker-terminal-wrapper {
    background: #030508 !important;
    min-height: 400px;
    max-height: 460px;
    overflow-y: auto;
    position: relative;
}

/* CRT Scanline overlay */
.terminal-scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.28) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.03),
        rgba(0, 255, 0, 0.01),
        rgba(0, 0, 255, 0.03)
    );
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.55;
}

.hacker-body {
    padding: 14px;
    color: #e2e8f0;
    position: relative;
    z-index: 1;
}

.hacker-body .log-row {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    margin-bottom: 5px;
    word-break: break-word;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hacker-body .log-row.success .log-text {
    color: #00ff66 !important;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
    font-weight: 600;
}

.hacker-body .log-row.typing .log-text {
    color: #00f2fe !important;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.hacker-body .log-row.seen .log-text {
    color: #ff007f !important;
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.4);
}

.hacker-body .log-row.warn .log-text {
    color: #ffab00 !important;
}

.hacker-body .log-row.error .log-text {
    color: #ff1744 !important;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
    font-weight: 700;
}

@keyframes blinkCursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hacker-cursor {
    display: inline-block;
    color: var(--accent-green);
    font-weight: 900;
    animation: blinkCursor 0.8s infinite;
}
