/* ============================================================
   N5 DESIGN SYSTEM v2.0 — Dual Theme + Futuristic UI
   Enhanced animations, component library, micro-interactions
   ============================================================ */

/* === FONT FACES === */
@font-face { font-family: 'Outfit'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/outfit-400.ttf') format('truetype'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/outfit-600.ttf') format('truetype'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/outfit-700.ttf') format('truetype'); }
@font-face { font-family: 'Outfit'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/outfit-800.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/inter-500.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/inter-600.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/jbmono-400.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/jbmono-500.ttf') format('truetype'); }

/* === THEME: DARK (default) === */
:root {
    --bgMain: #0d1117;
    --bgSurface: #141920;
    --bgCard: #161b22;
    --bgCardHover: #1c2333;
    --bgCardActive: #21283b;
    --bgElevated: #1e2532;
    --borderCard: rgba(255, 255, 255, 0.08);
    --borderSubtle: rgba(255, 255, 255, 0.05);
    --textPrimary: #e6edf3;
    --textSecondary: #8b949e;
    --textMuted: #484f58;
    --inputBg: rgba(255, 255, 255, 0.04);
    --inputBorder: rgba(255, 255, 255, 0.1);
    --inputFocus: rgba(99, 102, 241, 0.35);
    --glassOpacity: 0.6;
    --glassBorder: rgba(255, 255, 255, 0.08);
    --shadowCard: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadowElevated: 0 8px 32px rgba(0, 0, 0, 0.4);
    --overlayBg: rgba(13, 17, 23, 0.88);
    --scrollThumb: rgba(255, 255, 255, 0.12);
    --scrollHover: rgba(255, 255, 255, 0.2);

    /* Accent palette */
    --c1: #a78bfa;  /* violeta */
    --c2: #34d399;  /* esmeralda */
    --c3: #60a5fa;  /* azul */
    --c4: #f472b6;  /* rosa */
    --c5: #fbbf24;  /* ámbar */
    --c6: #fb923c;  /* naranja */
    --c7: #f87171;  /* rojo */
    --c8: #2dd4bf;  /* teal */
    --c9: #818cf8;  /* indigo */
    --c10: #a3e635; /* lime */
    --c11: #e879f9; /* fucsia */
    --c12: #38bdf8; /* sky */

    --accentPrimary: #818cf8;
    --accentGlow: rgba(99, 102, 241, 0.15);
    --successGlow: rgba(52, 211, 153, 0.12);

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === THEME: LIGHT === */
[data-theme="light"] {
    --bgMain: #f0f2f5;
    --bgSurface: #f8f9fb;
    --bgCard: #ffffff;
    --bgCardHover: #f5f6f8;
    --bgCardActive: #eef0f4;
    --bgElevated: #ffffff;
    --borderCard: rgba(0, 0, 0, 0.08);
    --borderSubtle: rgba(0, 0, 0, 0.04);
    --textPrimary: #1f2937;
    --textSecondary: #6b7280;
    --textMuted: #9ca3af;
    --inputBg: rgba(0, 0, 0, 0.03);
    --inputBorder: rgba(0, 0, 0, 0.12);
    --inputFocus: rgba(99, 102, 241, 0.3);
    --glassOpacity: 0.85;
    --glassBorder: rgba(0, 0, 0, 0.06);
    --shadowCard: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadowElevated: 0 10px 40px rgba(0, 0, 0, 0.08);
    --overlayBg: rgba(255, 255, 255, 0.92);
    --scrollThumb: rgba(0, 0, 0, 0.15);
    --scrollHover: rgba(0, 0, 0, 0.25);

    --accentGlow: rgba(99, 102, 241, 0.08);
    --successGlow: rgba(52, 211, 153, 0.08);
}

/* Light theme overrides for accent readability */
[data-theme="light"] .gradient-title {
    background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 50%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === BASE === */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bgMain);
    color: var(--textPrimary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-smooth), color var(--transition-smooth);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === TYPOGRAPHY === */
.font-outfit { font-family: 'Outfit', sans-serif; }
.font-inter { font-family: 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* === ACCENT COLORS === */
.text-c1 { color: var(--c1); } .text-c2 { color: var(--c2); } .text-c3 { color: var(--c3); }
.text-c4 { color: var(--c4); } .text-c5 { color: var(--c5); } .text-c6 { color: var(--c6); }
.text-c7 { color: var(--c7); } .text-c8 { color: var(--c8); } .text-c9 { color: var(--c9); }
.text-c10 { color: var(--c10); } .text-c11 { color: var(--c11); } .text-c12 { color: var(--c12); }

.border-c1 { border-color: var(--c1); } .border-c2 { border-color: var(--c2); }
.border-c3 { border-color: var(--c3); } .border-c4 { border-color: var(--c4); }
.border-c5 { border-color: var(--c5); } .border-c6 { border-color: var(--c6); }

/* === SCROLLBAR === */
.custom-scrollbar::-webkit-scrollbar { width: 7px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--scrollThumb);
    border-radius: 99px;
    transition: background var(--transition-fast);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--scrollHover); }


/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS — Enhanced Library
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 8px var(--accentGlow); }
    50% { box-shadow: 0 0 20px var(--accentGlow); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ripple {
    from { transform: scale(0); opacity: 0.6; }
    to   { transform: scale(2.5); opacity: 0; }
}
@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}
@keyframes typewriterBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes tabSlide {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes rotateIn {
    from { transform: rotate(-90deg) scale(0); opacity: 0; }
    to   { transform: rotate(0deg) scale(1); opacity: 1; }
}
@keyframes countUp {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes borderGlow {
    0%, 100% { border-color: rgba(129, 140, 248, 0.2); }
    50%      { border-color: rgba(129, 140, 248, 0.5); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}
.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
    opacity: 0;
}
.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}
.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.animate-count-up {
    animation: countUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* ═══════════════════════════════════════════════════════════════
   CARD SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.list-card {
    background: var(--bgCard);
    border: 1px solid var(--borderCard);
    border-radius: 14px;
    box-shadow: var(--shadowCard);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.list-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, transparent 60%, rgba(129, 140, 248, 0.03));
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}
.list-card:hover {
    background: var(--bgCardHover);
    border-color: rgba(129, 140, 248, 0.15);
    box-shadow: var(--shadowElevated), 0 0 0 1px rgba(129, 140, 248, 0.05);
    transform: translateY(-2px);
}
.list-card:hover::before { opacity: 1; }

.list-card .card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.list-card.active .card-content { max-height: 600px; }
.list-card.active .expand-icon { transform: rotate(180deg); }
.expand-icon { transition: transform 0.3s ease; }

/* === GRID MODE === */
.grid-view .category-section [data-items] {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.grid-view .list-card .card-short-desc { white-space: normal; }


/* ═══════════════════════════════════════════════════════════════
   TOGGLE SWITCH (Engine modes)
   ═══════════════════════════════════════════════════════════════ */

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--inputBg);
    border: 1px solid var(--borderCard);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-normal);
}
.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--textMuted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
}
.toggle-switch:hover { border-color: var(--accentPrimary); }
.toggle-switch:hover::after { background: var(--textSecondary); }

.toggle-switch.active {
    background: var(--accentGlow);
    border-color: var(--accentPrimary);
}
.toggle-switch.active::after {
    transform: translateX(20px);
    background: var(--accentPrimary);
    box-shadow: 0 0 10px var(--accentGlow);
}


/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--inputBg);
    border: 1px solid var(--borderCard);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
}
.theme-toggle:hover {
    background: var(--bgCardHover);
    border-color: var(--accentPrimary);
}
.theme-toggle-icon {
    font-size: 1rem;
    transition: transform var(--transition-normal);
}
.theme-toggle:hover .theme-toggle-icon { transform: rotate(30deg); }
.theme-toggle-label {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--textSecondary);
}


/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAYS
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--overlayBg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.modal-overlay.visible { display: flex; opacity: 1; }

/* Close button standardized */
.modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 50%;
    color: var(--textSecondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #f87171;
    transform: rotate(90deg);
}

/* Modal inner panel */
.modal-panel {
    background: var(--bgElevated);
    border: 1px solid var(--borderCard);
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


/* ═══════════════════════════════════════════════════════════════
   GRADIENT TITLE
   ═══════════════════════════════════════════════════════════════ */

.gradient-title {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ═══════════════════════════════════════════════════════════════
   GLASS CARD
   ═══════════════════════════════════════════════════════════════ */

.glass-card {
    background: color-mix(in srgb, var(--bgCard) var(--glassOpacity), transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glassBorder);
    border-radius: 16px;
    box-shadow: var(--shadowCard);
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.35);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* Ripple effect on click */
.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 10%, transparent 10%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.8s;
    pointer-events: none;
    border-radius: inherit;
}
.btn-primary:active::after,
.btn-secondary:active::after {
    transform: scale(10);
    opacity: 0;
    transition: 0s;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--inputBg);
    color: var(--textSecondary);
    border: 1px solid var(--borderCard);
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.btn-secondary:hover {
    background: var(--bgCardHover);
    color: var(--textPrimary);
    border-color: var(--accentPrimary);
    transform: translateY(-1px);
}
.btn-secondary:active { transform: translateY(0) scale(0.98); }

/* Specific button variants */
.forge-btn:hover { background: rgba(16,185,129,0.3) !important; color: #34d399 !important; }
.chat-btn:hover { background: rgba(56,189,248,0.3) !important; color: #7dd3fc !important; }


/* ═══════════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════════ */

.input-main {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--textPrimary);
    font-size: 0.95rem;
    padding: 12px 0;
    font-family: 'Inter', sans-serif;
}
.input-main::placeholder { color: var(--textMuted); }


/* ═══════════════════════════════════════════════════════════════
   PROMPT BAR
   ═══════════════════════════════════════════════════════════════ */

.prompt-bar {
    display: flex;
    align-items: center;
    background: var(--inputBg);
    border: 1px solid var(--inputBorder);
    border-radius: 999px;
    padding: 4px 6px 4px 24px;
    transition: all var(--transition-normal);
}
.prompt-bar:focus-within {
    border-color: var(--accentPrimary);
    box-shadow: 0 0 0 3px var(--inputFocus);
    animation: borderGlow 2s ease infinite;
}


/* ═══════════════════════════════════════════════════════════════
   FILTER CHIPS
   ═══════════════════════════════════════════════════════════════ */

.filter-chip {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--borderCard);
    background: var(--inputBg);
    color: var(--textSecondary);
    transition: all var(--transition-fast);
}
.filter-chip:hover {
    background: var(--bgCardHover);
    color: var(--textPrimary);
    border-color: var(--accentPrimary);
}
.filter-chip.active {
    background: var(--accentGlow);
    color: var(--accentPrimary);
    border-color: var(--accentPrimary);
}


/* ═══════════════════════════════════════════════════════════════
   COMPONENT LIBRARY — NEW
   ═══════════════════════════════════════════════════════════════ */

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 9999;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.toast.success {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.4);
}
.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}
.toast.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
}

/* --- Chip Component --- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}
.chip-purple { background: rgba(168, 85, 247, 0.1); color: #c084fc; border-color: rgba(168, 85, 247, 0.2); }
.chip-green  { background: rgba(52, 211, 153, 0.1); color: #34d399; border-color: rgba(52, 211, 153, 0.2); }
.chip-blue   { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border-color: rgba(56, 189, 248, 0.2); }
.chip-amber  { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.chip-red    { background: rgba(248, 113, 113, 0.1); color: #f87171; border-color: rgba(248, 113, 113, 0.2); }
.chip-indigo { background: rgba(129, 140, 248, 0.1); color: #818cf8; border-color: rgba(129, 140, 248, 0.2); }

/* --- Metric Bar --- */
.metric-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.metric-bar-label {
    width: 65px;
    font-size: 0.6rem;
    color: var(--textMuted);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}
.metric-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}
.metric-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}
.metric-bar-value {
    font-size: 0.7rem;
    font-weight: 700;
    width: 26px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-card {
    height: 72px;
    border-radius: 14px;
    margin-bottom: 10px;
}

/* --- Keyboard Shortcut Badge --- */
.kbd {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: var(--textMuted);
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Section Header --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.section-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.section-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.section-header-subtitle {
    font-size: 0.65rem;
    color: var(--textMuted);
    margin: 2px 0 0;
}

/* --- Status Dot (animated) --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}
.status-dot.online { background: var(--c2); box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.status-dot.offline { background: var(--c7); }
.status-dot.connecting {
    background: var(--c5);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
    animation: breathe 1.5s infinite;
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #818cf8, #a855f7);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* --- Copy Button (standardized) --- */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--textSecondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.72rem;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: all var(--transition-normal);
    text-transform: uppercase;
}
.copy-btn:hover {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.3);
    color: #34d399;
}
.copy-btn.copied {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.4);
    color: #34d399;
}

/* --- Typewriter cursor --- */
.cursor-blink::after {
    content: '▊';
    animation: typewriterBlink 0.8s infinite;
    color: #7c3aed;
    margin-left: 2px;
}


/* ═══════════════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════════════ */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--borderCard), transparent);
    margin: 24px 0;
}


/* ═══════════════════════════════════════════════════════════════
   FORGE-SPECIFIC
   ═══════════════════════════════════════════════════════════════ */

.forge-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #10b981;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.forge-brain-entry {
    margin-top: 8px;
    padding-left: 8px;
    border-left: 2px solid #818cf8;
    animation: fadeIn 0.3s ease;
}

@keyframes pulseActive {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.active-pulse { animation: pulseActive 2s infinite; }


/* ═══════════════════════════════════════════════════════════════
   MAIN SECTION NAVIGATION (Engine | Terminal | Forge)
   ═══════════════════════════════════════════════════════════════ */

.n5-nav-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 0 20px 16px;
    margin-top: -4px;
}

.n5-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--inputBg);
    border: 1px solid var(--borderCard);
    border-radius: 10px;
    color: var(--textMuted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.n5-nav-btn:hover {
    color: var(--textPrimary);
    background: var(--bgCardHover);
    border-color: var(--accentPrimary);
    transform: translateY(-1px);
}

.n5-nav-btn.active {
    color: var(--accentPrimary);
    background: var(--accentGlow);
    border-color: var(--accentPrimary);
    box-shadow: 0 0 16px var(--accentGlow);
}

.n5-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accentPrimary);
    border-radius: 2px;
    animation: tabSlide 0.3s ease;
}

.n5-section { display: none; }
.n5-section.active { display: block; }


/* ═══════════════════════════════════════════════════════════════
   WEB TERMINAL — INTEGRATED STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Sub-Tab bar */
.wt-tab-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--borderCard);
    background: var(--inputBg);
    flex-wrap: wrap;
}

.wt-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--textMuted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wt-tab-btn:hover {
    color: var(--textSecondary);
    background: var(--bgCardHover);
}

.wt-tab-btn.active {
    color: var(--accentPrimary);
    background: var(--accentGlow);
    border-color: rgba(129, 140, 248, 0.2);
}

.wt-tab-btn.active svg { stroke: var(--accentPrimary); }

.wt-info-chips {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.wt-info-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--borderCard);
    border-radius: 20px;
    font-size: 0.65rem;
}

.wt-chip-label {
    color: var(--textMuted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
}

.wt-chip-value {
    color: #22d3ee;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Content panels */
.wt-content { display: none; flex-direction: column; flex: 1; min-height: 0; }
.wt-content.active { display: flex; }

/* Dashboard layout */
.wt-dashboard-layout {
    display: flex;
    flex: 1;
    min-height: 450px;
    overflow: hidden;
}

.wt-sidebar {
    width: 200px;
    background: var(--inputBg);
    border-right: 1px solid var(--borderCard);
    padding: 12px 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.wt-sidebar::-webkit-scrollbar { width: 0; }

.wt-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--textMuted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.wt-sidebar-btn:hover {
    background: var(--bgCardHover);
    color: var(--textPrimary);
    transform: translateX(3px);
}

.wt-sidebar-btn.active {
    background: var(--accentGlow);
    border-color: rgba(129, 140, 248, 0.2);
    color: var(--textPrimary);
    box-shadow: inset 3px 0 0 var(--accentPrimary);
}

.wt-sb-icon { font-size: 14px; }

/* Dashboard grid */
.wt-dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wt-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    padding: 16px 20px;
    overflow-y: auto;
    align-content: start;
}

.wt-grid::-webkit-scrollbar { width: 4px; }
.wt-grid::-webkit-scrollbar-thumb { background: var(--scrollThumb); border-radius: 4px; }

/* Command cards */
.wt-card {
    background: var(--bgCard);
    border: 1px solid var(--borderCard);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.15s ease;
}

.wt-card:hover {
    border-color: rgba(129, 140, 248, 0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.wt-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--borderCard);
}

.wt-card-icon { font-size: 14px; flex-shrink: 0; }
.wt-card-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; color: #22d3ee; }
.wt-card-count { font-size: 0.55rem; padding: 2px 6px; border-radius: 10px; background: var(--accentGlow); color: var(--textMuted); font-weight: 700; }

.wt-card[data-color="emerald"] .wt-card-title { color: #34d399; }
.wt-card[data-color="violet"] .wt-card-title { color: #a78bfa; }
.wt-card[data-color="amber"] .wt-card-title { color: #fbbf24; }
.wt-card[data-color="rose"] .wt-card-title { color: #fb7185; }
.wt-card[data-color="yellow"] .wt-card-title { color: #facc15; }

.wt-card-body { display: flex; flex-direction: column; gap: 2px; padding: 6px; }

.wt-cmd-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--textSecondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
}

.wt-cmd-btn:hover {
    background: var(--bgCardHover);
    color: var(--textPrimary);
    transform: translateX(3px);
}

.wt-cmd-btn:active { transform: translateX(1px); }
.wt-cmd-icon { font-size: 12px; flex-shrink: 0; }
.wt-cmd-label { flex: 1; }

/* Danger card */
.wt-danger-card { border-color: rgba(239, 68, 68, 0.15); background: rgba(30, 10, 10, 0.3); }
.wt-danger-card .wt-card-header { background: rgba(239, 68, 68, 0.05); }
.wt-danger-card .wt-cmd-btn:hover { background: rgba(239, 68, 68, 0.1); color: #fb7185; }

/* Output panel */
.wt-output-panel {
    flex-shrink: 0;
    margin: 0 20px 12px;
    background: var(--bgElevated);
    border: 1px solid var(--borderCard);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.wt-output-panel.has-content { box-shadow: 0 -4px 20px rgba(0,0,0,0.15); }

.wt-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--inputBg);
    border-bottom: 1px solid var(--borderCard);
}

.wt-output-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--textMuted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wt-output-actions { display: flex; gap: 4px; }

.wt-output-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--textMuted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.62rem;
    cursor: pointer;
    transition: all 0.12s ease;
}

.wt-output-btn:hover {
    color: var(--textSecondary);
    border-color: var(--borderCard);
    background: var(--bgCardHover);
}

.wt-output-body { max-height: 200px; overflow-y: auto; }
.wt-output-body::-webkit-scrollbar { width: 4px; }
.wt-output-body::-webkit-scrollbar-thumb { background: var(--scrollThumb); border-radius: 4px; }

.wt-output-panel.collapsed .wt-output-body { max-height: 0; }

.wt-output-pre {
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--textSecondary);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ═══ Terminal Container ═══ */
.wt-terminal-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.wt-xterm-container {
    flex: 1;
    padding: 8px;
    background: #0a0e17;
    min-height: 400px;
}

[data-theme="light"] .wt-xterm-container { background: #ffffff; }

.wt-terminal-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--inputBg);
    border-top: 1px solid var(--borderCard);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
}

.wt-status-left, .wt-status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wt-conn-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f87171;
    transition: all 0.2s ease;
}

.wt-conn-indicator.wt-connected {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
    animation: pulse 2s infinite;
}

.wt-conn-indicator.wt-connecting {
    background: #fbbf24;
    animation: breathe 1s infinite;
}

.wt-sep { color: var(--borderCard); }

/* ═══ Config Editor ═══ */
.wt-config-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

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

.wt-config-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--textPrimary);
}

.wt-config-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wt-config-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--inputBg);
    border: 1px solid var(--borderCard);
    border-radius: 8px;
    color: var(--textSecondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wt-config-btn:hover {
    background: var(--bgCardHover);
    color: var(--textPrimary);
    border-color: var(--accentPrimary);
}

.wt-config-btn-accent {
    background: var(--accentGlow);
    color: var(--accentPrimary);
    border-color: rgba(129, 140, 248, 0.2);
}

.wt-config-btn-accent:hover {
    background: rgba(129, 140, 248, 0.2);
    border-color: var(--accentPrimary);
}

.wt-config-list { display: flex; flex-direction: column; gap: 6px; }

.wt-config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bgCard);
    border: 1px solid var(--borderCard);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.wt-config-item:hover {
    background: var(--bgCardHover);
    border-color: rgba(129, 140, 248, 0.15);
}

.wt-config-icon { font-size: 18px; flex-shrink: 0; }

.wt-config-details { flex: 1; min-width: 0; }

.wt-config-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--textPrimary);
    display: block;
}

.wt-config-cmd {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--textMuted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.wt-config-cat {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accentGlow);
    color: var(--accentPrimary);
    font-weight: 600;
}

.wt-config-item-actions { display: flex; gap: 4px; }

.wt-config-btn-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    font-size: 14px;
}

.wt-config-btn-sm:hover {
    background: var(--bgCardHover);
    border-color: var(--borderCard);
}

.wt-config-btn-sm.wt-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Config modal */
.wt-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.wt-modal {
    background: var(--bgElevated);
    border: 1px solid var(--borderCard);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 440px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.wt-modal h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--textPrimary);
}

.wt-modal label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--textSecondary);
    font-family: 'Outfit', sans-serif;
}

.wt-modal input, .wt-modal select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    background: var(--inputBg);
    border: 1px solid var(--borderCard);
    border-radius: 8px;
    color: var(--textPrimary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.wt-modal input:focus, .wt-modal select:focus { border-color: var(--accentPrimary); }
.wt-modal input.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }

.wt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* Toast */
.wt-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    padding: 12px 24px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.4);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.wt-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.wt-toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4); }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .grid-view .category-section [data-items] {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .prompt-bar { border-radius: 16px; padding: 4px 4px 4px 16px; }

    /* Stack Forge panels vertically on mobile */
    #forgeModal .modal-content > div:last-child {
        flex-direction: column !important;
    }

    .grid-view .category-section [data-items] {
        grid-template-columns: 1fr;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 18px;
        font-size: 0.78rem;
    }

    /* Terminal responsive */
    .n5-nav-bar { gap: 4px; padding: 0 12px 12px; }
    .n5-nav-btn { padding: 8px 16px; font-size: 0.75rem; }
    .wt-sidebar { display: none; }
    .wt-dashboard-layout { min-height: 350px; }
    .wt-grid { grid-template-columns: 1fr; padding: 12px; }
    .wt-info-chips { display: none; }
    .wt-terminal-wrapper { min-height: 350px; }
}

@media (max-width: 480px) {
    header {
        padding: 30px 16px 16px !important;
    }

    .btn-primary, .btn-secondary {
        padding: 8px 14px;
        font-size: 0.72rem;
    }

    .filter-chip {
        padding: 5px 10px;
        font-size: 0.65rem;
    }
}
