/* ===== WIKII PROTOCOL - COMPLETE STYLES ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #030305;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

.font-display { font-family: 'Space Grotesk', sans-serif; }

/* ===== ANIMATED BACKGROUND ===== */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.12;
    z-index: -1;
    animation: orbFloat 25s ease-in-out infinite;
    pointer-events: none;
}

.bg-orb:nth-child(1) { width: 700px; height: 700px; background: #6366f1; top: -250px; left: -200px; animation-delay: 0s; }
.bg-orb:nth-child(2) { width: 600px; height: 600px; background: #a855f7; bottom: -200px; right: -200px; animation-delay: 8s; }
.bg-orb:nth-child(3) { width: 500px; height: 500px; background: #ec4899; top: 40%; left: 60%; animation-delay: 16s; }
.bg-orb:nth-child(4) { width: 400px; height: 400px; background: #06b6d4; top: 60%; left: 20%; animation-delay: 4s; opacity: 0.08; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -40px) scale(1.08); }
    50% { transform: translate(-30px, 60px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ===== GLASS PANEL ===== */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: 24px;
}

.glass-panel-strong {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 40%, #f472b6 70%, #fb7185 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 50%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.7s ease;
}

.btn-primary:hover::before { left: 100%; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.5), 0 0 20px rgba(124, 58, 237, 0.3); }
.btn-primary:active { transform: translateY(-1px) scale(0.98); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: white;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(129, 140, 248, 0.5); transform: translateY(-2px); }

.btn-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: none;
    color: #1a1a2e;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -10px rgba(251, 191, 36, 0.4); }
.btn-gold:active { transform: translateY(-1px) scale(0.98); }

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.4); }

/* ===== AGENT AVATARS ===== */
.agent-avatar-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.agent-avatar {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.agent-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--avatar-color-1), var(--avatar-color-2));
    z-index: -1;
    opacity: 0.6;
    animation: avatarRotate 8s linear infinite;
}

@keyframes avatarRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.agent-avatar:hover { transform: scale(1.05); box-shadow: 0 0 40px var(--avatar-glow); }

.agent-avatar.wikii { --avatar-color-1: #6366f1; --avatar-color-2: #8b5cf6; --avatar-glow: rgba(99, 102, 241, 0.4); }
.agent-avatar.pro { --avatar-color-1: #06b6d4; --avatar-color-2: #3b82f6; --avatar-glow: rgba(6, 182, 212, 0.4); }
.agent-avatar.max { --avatar-color-1: #f59e0b; --avatar-color-2: #ef4444; --avatar-glow: rgba(245, 158, 11, 0.4); }
.agent-avatar.elite { --avatar-color-1: #fbbf24; --avatar-color-2: #ec4899; --avatar-glow: rgba(251, 191, 36, 0.5); }

/* Agent Status Ring */
.agent-status-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: statusPulse 2s ease-in-out infinite;
}

.agent-status-ring.active { border-color: var(--success); box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
.agent-status-ring.paused { border-color: var(--warning); box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.agent-status-ring.stopped { border-color: var(--danger); box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }

@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

/* ===== PROFIT COUNTER ===== */
.profit-counter {
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.profit-glow { animation: profitPulse 2s ease-in-out infinite; }

@keyframes profitPulse {
    0%, 100% { text-shadow: 0 0 20px rgba(99, 102, 241, 0.3), 0 0 40px rgba(139, 92, 246, 0.1); }
    50% { text-shadow: 0 0 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(139, 92, 246, 0.3), 0 0 90px rgba(236, 72, 153, 0.1); }
}

.profit-glow-gold { animation: profitPulseGold 2s ease-in-out infinite; }

@keyframes profitPulseGold {
    0%, 100% { text-shadow: 0 0 20px rgba(251, 191, 36, 0.3); }
    50% { text-shadow: 0 0 40px rgba(251, 191, 36, 0.6), 0 0 80px rgba(245, 158, 11, 0.3); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-animate { animation: countUp 0.3s ease-out; }

/* ===== TIER CARDS ===== */
.tier-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(124, 58, 237, 0.03) 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tier-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tier-color-1), var(--tier-color-2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tier-card:hover::before { opacity: 1; }
.tier-card:hover { border-color: rgba(79, 70, 229, 0.4); transform: translateY(-4px); box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.2); }

.tier-card.wikii { --tier-color-1: #6366f1; --tier-color-2: #8b5cf6; }
.tier-card.pro { --tier-color-1: #06b6d4; --tier-color-2: #3b82f6; }
.tier-card.max { --tier-color-1: #f59e0b; --tier-color-2: #ef4444; }
.tier-card.elite { --tier-color-1: #fbbf24; --tier-color-2: #ec4899; }

.tier-card.featured {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(236, 72, 153, 0.03) 100%);
    transform: scale(1.02);
}

.tier-card.featured:hover { transform: scale(1.02) translateY(-4px); box-shadow: 0 25px 50px -10px rgba(251, 191, 36, 0.25); }

/* ===== AGENT CONTROL BUTTONS ===== */
.agent-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 70px;
    -webkit-tap-highlight-color: transparent;
}

.control-btn.start { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.control-btn.start:hover { box-shadow: 0 8px 20px -5px rgba(16, 185, 129, 0.4); transform: translateY(-2px); }
.control-btn.pause { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.control-btn.pause:hover { box-shadow: 0 8px 20px -5px rgba(245, 158, 11, 0.4); transform: translateY(-2px); }
.control-btn.stop { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.control-btn.stop:hover { box-shadow: 0 8px 20px -5px rgba(239, 68, 68, 0.4); transform: translateY(-2px); }
.control-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== WALLET CARDS ===== */
.wallet-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.wallet-card:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(79, 70, 229, 0.3); transform: translateY(-2px); }
.wallet-detected { border-color: rgba(16, 185, 129, 0.4) !important; background: rgba(16, 185, 129, 0.05) !important; }

/* ===== INPUTS ===== */
.custom-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: white;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.custom-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15), 0 0 20px rgba(79, 70, 229, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.custom-input::placeholder { color: #475569; }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.3s ease;
    overflow-y: auto;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-enter { animation: modalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #818cf8;
    border-radius: 50%;
    width: 24px; height: 24px;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PULSE EFFECTS ===== */
.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(79, 70, 229, 0.4);
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ===== LIVE INDICATOR ===== */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--success);
}

.live-indicator::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: liveBlink 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--success);
    flex-shrink: 0;
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== APY BADGE ===== */
.apy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.apy-badge::before { content: '↑'; font-size: 14px; }

/* ===== BONUS TAG ===== */
.bonus-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    box-shadow: 0 4px 15px -3px rgba(251, 191, 36, 0.4);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #030305; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ===== HERO SECTION ===== */
.hero-gradient { background: linear-gradient(180deg, transparent 0%, rgba(3, 3, 5, 0.8) 100%); }

/* ===== AGENT GRID ===== */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ===== INVESTMENT INSTANCE ===== */
.investment-instance {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.investment-instance:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); }
.investment-instance:last-child { margin-bottom: 0; }

.instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.instance-id {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    font-family: 'Space Grotesk', monospace;
}

.instance-amount { font-size: 14px; font-weight: 700; color: #e2e8f0; }

.instance-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.instance-status.active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.instance-status.paused { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.instance-status.stopped { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.instance-earnings {
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #34d399;
}

/* ===== LOGIN SYSTEM ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card { width: 100%; max-width: 420px; }

.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.login-tab.active { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-input-group { display: flex; flex-direction: column; gap: 0.5rem; }

.login-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.login-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.login-input::placeholder { color: #475569; }

.login-submit {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed, #a855f7);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.login-submit:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -10px rgba(79, 70, 229, 0.5); }
.login-submit:active { transform: translateY(0) scale(0.98); }

.login-error {
    color: #f87171;
    font-size: 13px;
    text-align: center;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-success {
    color: #34d399;
    font-size: 13px;
    text-align: center;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    max-width: 400px;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }
.toast.warning { border-color: rgba(245, 158, 11, 0.3); }

/* ===== BALANCE DISPLAY ===== */
.balance-display {
    font-family: 'Space Grotesk', monospace;
    font-variant-numeric: tabular-nums;
}

/* ===== TRANSACTION LIST ===== */
.tx-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.tx-item:hover { background: rgba(255, 255, 255, 0.03); border-left-color: var(--primary); }

/* ===== NETWORK STATUS ===== */
.network-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.network-status::before {
    content: '';
    width: 6px; height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: statusBlink 2s infinite;
    flex-shrink: 0;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 640px) {
    .glass-panel { margin: 0 0.5rem; border-radius: 20px; padding: 1rem; }
    .agent-grid { grid-template-columns: 1fr; }
    .profit-counter { font-size: 1.25rem; }
    .control-btn { padding: 10px 8px; font-size: 11px; min-width: 60px; }
    .modal-overlay { padding: 0.5rem; align-items: flex-end; }
    .modal-enter { border-radius: 24px 24px 0 0; max-height: 90vh; overflow-y: auto; }
    .tier-card { padding: 1.25rem; }
    .tier-card.featured { transform: none; }
    .tier-card.featured:hover { transform: translateY(-4px); }
    header { flex-direction: column !important; gap: 1rem; }
    header > div:last-child { width: 100%; flex-wrap: wrap; }
    .login-card { max-width: 100%; }
    .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
    .instance-header { flex-wrap: wrap; gap: 0.5rem; }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .agent-grid { grid-template-columns: repeat(2, 1fr); }
    .glass-panel { padding: 1.25rem; }
}

@media (min-width: 1024px) {
    .agent-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== TOUCH OPTIMIZATIONS ===== */
button, input, select, textarea { touch-action: manipulation; }

/* ===== SAFE AREA INSETS FOR MOBILE ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .modal-overlay { padding-bottom: env(safe-area-inset-bottom); }
    .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
}