:root {
    --bg-primary: #141a27;
    --bg-secondary: #1a2132;
    --bg-card: #1e2738;
    --bg-card-hover: #252e40;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --text-dim: #555568;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --accent-2: #06b6d4;
    --accent-3: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient: linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-text: linear-gradient(135deg, #6366f1, #06b6d4, #8b5cf6);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.09);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
    --bg-primary: #e8e4df;
    --bg-secondary: #dedad5;
    --bg-card: rgba(245, 242, 237, 0.7);
    --bg-card-hover: rgba(238, 234, 228, 0.85);
    --border: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.14);
    --text-primary: #2a2a35;
    --text-secondary: #5a5a68;
    --text-dim: #8a8a95;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --glass: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
}
body.light-mode .nav { background: rgba(228, 224, 218, 0.92); border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .mobile-menu { background: rgba(228, 224, 218, 0.97); }
body.light-mode .terminal-card { background: rgba(235, 231, 225, 0.9); }
body.light-mode .terminal-bar { background: rgba(0, 0, 0, 0.04); }
body.light-mode .terminal-dot.red { background: #ff6058; }
body.light-mode .terminal-dot.yellow { background: #ffbd2e; }
body.light-mode .terminal-dot.green { background: #27c93f; }
body.light-mode .hero-bg .glow { opacity: 0.15; }
body.light-mode .hero { background: var(--bg-primary); }
body.light-mode .grid-overlay { opacity: 0.03; }
body.light-mode .btn-glass { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); color: var(--text-primary); }
body.light-mode .btn-glass:hover { background: rgba(0, 0, 0, 0.07); }
body.light-mode .section-badge { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.15); }
body.light-mode .feed-card { background: var(--bg-card); }
body.light-mode .feed-source { background: rgba(99, 102, 241, 0.06); }
body.light-mode .tool-card { background: var(--bg-card); }
body.light-mode .yt-carousel-frame { border-color: rgba(99,102,241,0.12); background: rgba(99,102,241,0.03); }
body.light-mode .yt-carousel-frame::before { background: linear-gradient(to right, var(--bg-primary), transparent); }
body.light-mode .yt-carousel-frame::after { background: linear-gradient(to left, var(--bg-primary), transparent); }
body.light-mode .explore-card { background: var(--bg-card); }
body.light-mode .lab-card { background: var(--bg-card); }
body.light-mode .social-icon { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.2); }
body.light-mode .chat-action-btn { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .chat-action-btn:hover { background: rgba(99, 102, 241, 0.08); }
body.light-mode .message-content code { background: rgba(0, 0, 0, 0.06); }
body.light-mode .message-content pre { background: rgba(0, 0, 0, 0.04); }
body.light-mode .chat-inline-btn:hover { background: rgba(0, 0, 0, 0.06); }
body.light-mode .chat-consent-icon { background: rgba(99, 102, 241, 0.08); }
body.light-mode .chat-attachment-chip { background: rgba(99, 102, 241, 0.06); }
body.light-mode .chat-input-container.drag-over { background: rgba(99, 102, 241, 0.05); }
body.light-mode .modal-overlay { background: rgba(0, 0, 0, 0.4); }
body.light-mode .modal-content { background: var(--bg-card); }
body.light-mode .diff-add { background: rgba(16, 185, 129, 0.08); }
body.light-mode .diff-remove { background: rgba(239, 68, 68, 0.08); }
body.light-mode .tag { background: rgba(99, 102, 241, 0.06); border-color: rgba(99, 102, 241, 0.12); }
body.light-mode .chat-avatar { background: rgba(99, 102, 241, 0.15); }
body.light-mode .chat-header-btn:hover,
body.light-mode .chat-close-btn:hover { background: rgba(0, 0, 0, 0.08); }
body.light-mode .chat-teaser {
    background: linear-gradient(135deg, #fff, #f5f3ef);
    border-color: rgba(99,102,241,0.2);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
body.light-mode .chat-teaser-text { color: #2a2a35; }
body.light-mode .chat-teaser-close { color: #8a8a95; }
body.light-mode .chat-teaser-close:hover { color: #2a2a35; }
body.light-mode .chat-messages { background: var(--bg-primary); }
body.light-mode .message-content { background: var(--bg-card); color: #2a2a35; }
body.light-mode .user-message .message-content { background: var(--accent); color: #fff; }
body.light-mode .chat-input-container { background: var(--bg-card); border-color: rgba(0,0,0,0.1); }
body.light-mode .chat-input { background: transparent; color: #2a2a35; }
body.light-mode .chat-input::placeholder { color: #8a8a95; }

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle cosmic stars */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.25), transparent),
        radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.5px 1.5px at 40% 8%, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 55% 42%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 70% 22%, rgba(255,255,255,0.18), transparent),
        radial-gradient(1.5px 1.5px at 85% 55%, rgba(255,255,255,0.22), transparent),
        radial-gradient(1px 1px at 15% 65%, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 35% 78%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 80% 85%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 5% 90%, rgba(255,255,255,0.18), transparent),
        radial-gradient(1px 1px at 92% 12%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.5px 1.5px at 48% 52%, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 72% 38%, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 18% 48%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 88% 72%, rgba(255,255,255,0.16), transparent);
    background-size: 100% 100%;
}
body.light-mode::after { display: none; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.yt-section .container { max-width: 1360px; }

#feed > .container,
#explore > .container,
#tools > .container,
#lab > .container {
    max-width: 1400px;
}

/* ─── Nav ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.brand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 8px;
    font-size: 0.85rem;
}

.brand-accent { color: var(--accent); }

.nav-links { display: flex; gap: 0.25rem; }

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-link:hover { color: var(--text-primary); background: var(--glass); }

/* Break it — red CTA nav button */
.nav-link-break {
    color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    font-weight: 700;
    animation: breakit-pulse 2s ease-in-out infinite;
    position: relative;
}
.nav-link-break i { margin-right: 0.3rem; }
.nav-link-break:hover {
    background: rgba(255, 68, 68, 0.25) !important;
    color: #fff !important;
    border-color: #ff4444;
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.4);
    transform: scale(1.05);
}
@keyframes breakit-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255, 68, 68, 0.2); }
    50% { box-shadow: 0 0 12px rgba(255, 68, 68, 0.5); }
}

/* Mobile break it */
.mobile-link-break {
    color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    font-weight: 700;
}
.mobile-link-break i { margin-right: 0.3rem; }

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}
.theme-toggle:hover { background: var(--bg-secondary); }

.nav-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu.active { display: flex; }

.mobile-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.mobile-link:hover { color: var(--text-primary); background: var(--glass); }

/* ─── Hero ─── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 6rem 1.5rem 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem 0 1.5rem;
    flex: 1;
    gap: 2rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -10%;
    left: -5%;
    animation: glowFloat 8s ease-in-out infinite;
}

.glow-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-2);
    bottom: -10%;
    right: -5%;
    animation: glowFloat 10s ease-in-out infinite reverse;
}

.glow-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-3);
    top: 40%;
    left: 50%;
    animation: glowFloat 12s ease-in-out infinite 2s;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.hero-title {
    font-size: clamp(1.6rem, 4.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.gradient-text {
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.stat-item { text-align: center; }

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--mono);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

.btn-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-glass:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

.hero-visual {
    position: relative;
    z-index: 2;
    margin-left: 0;
    perspective: 1200px;
    flex-shrink: 0;
}

/* ─── 3D Scene ─── */
.hero-3d-scene {
    position: relative;
}

/* ─── Terminal Card ─── */
.terminal-card {
    width: 504px;
    background: rgb(11, 11, 20);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: none;
    transform: rotateY(-8deg) rotateX(3deg) rotateZ(-0.5deg);
    transform-origin: center center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.65),
        0 0 0 1px rgba(99,102,241,0.1),
        inset 0 1px 0 rgba(255,255,255,0.06);
    transition: transform 0.5s cubic-bezier(0.23,1,0.32,1), box-shadow 0.5s ease;
}

.hero-3d-scene:hover .terminal-card {
    transform: rotateY(-4deg) rotateX(2deg) rotateZ(-0.25deg);
    box-shadow: 0 40px 100px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ─── AI Test Result Card ─── */
.aitest-card {
    position: absolute;
    bottom: -24px;
    right: -20px;
    width: 210px;
    background: rgba(10, 12, 28, 0.96);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 16px;
    padding: 0.9rem;
    backdrop-filter: blur(24px);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.55),
        0 0 0 1px rgba(99,102,241,0.1),
        0 0 30px rgba(99,102,241,0.08);
    animation: aitest-float 5s ease-in-out infinite;
    z-index: 10;
}

@keyframes aitest-float {
    0%, 100% { transform: translateY(0px) rotateY(2deg); }
    50%       { transform: translateY(-8px) rotateY(2deg); }
}

.aitest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.aitest-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.aitest-pass-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 6px;
    padding: 2px 8px;
    letter-spacing: 0.05em;
}

.aitest-body {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.aitest-gauge-wrap {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.aitest-gauge {
    width: 56px;
    height: 56px;
    display: block;
}

.aitest-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.aitest-score {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.aitest-score-lbl {
    font-size: 0.5rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aitest-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aitest-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.62rem;
}

.aitest-item-name {
    flex: 1;
    color: var(--text-secondary);
}

.aitest-icon.pass { color: #22c55e; font-size: 0.6rem; }
.aitest-icon.warn { color: #f59e0b; font-size: 0.6rem; }

.aitest-status {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.aitest-status.pass { color: #22c55e; }
.aitest-status.warn { color: #f59e0b; }

.aitest-sparkline {
    display: block;
    width: 100%;
    height: 28px;
    margin-top: 0.25rem;
    border-radius: 0 0 8px 8px;
    overflow: visible;
}

/* ─── Quick Tools Strip (inside hero, bottom row) ─── */
.tools-strip {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: auto;
    background: rgba(0,0,0,0.15);
}

.tools-strip-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tool-strip-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem 1.25rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.tool-strip-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c, #6366f1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.tool-strip-card:hover::before { opacity: 0.05; }

.tool-strip-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: color-mix(in srgb, var(--c, rgba(255,255,255,0.15)) 40%, transparent);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.tool-strip-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--c) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-bottom: 0.9rem;
}

.tool-strip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    margin-bottom: 1rem;
}

.tool-strip-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tool-strip-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.4;
    white-space: normal;
}

.tool-strip-arrow {
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: transform 0.2s;
    letter-spacing: 0.01em;
    margin-top: auto;
}

.tool-strip-card:hover .tool-strip-arrow {
    transform: translateX(4px);
}

.tools-strip-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 0.85rem 0 0;
    letter-spacing: 0.01em;
}
.tools-strip-hint a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.tools-strip-hint a:hover {
    text-decoration: underline;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--mono);
}

.terminal-body {
    padding: 1.1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.8;
    min-height: 220px;
    background: rgb(11, 11, 20);
}

.terminal-line { white-space: nowrap; }

.t-prompt { color: var(--success); }
.t-cmd { color: var(--accent); }
.t-arg { color: var(--text-dim); }
.t-output { color: var(--text-secondary); }
.t-success { color: var(--success); }
.t-info { color: var(--accent-2); }
.t-highlight { color: var(--warning); font-weight: 500; }
.t-dim { color: var(--text-dim); }

.t-cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

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

/* ─── Ticker ─── */
.ticker-wrapper {
    position: relative;
    z-index: 1;
    padding: 1.5rem 0;
}
.ticker-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, rgba(99,102,241,0.04), rgba(6,182,212,0.02));
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 44px;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-right: 1px solid var(--border);
}

.ticker-arrow {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    padding: 0 0.5rem; font-size: 0.7rem; transition: var(--transition);
    display: flex; align-items: center; flex-shrink: 0;
}
.ticker-arrow:hover { color: var(--accent); }

.ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: flex;
    gap: 3rem;
    animation: tickerScroll 60s linear infinite;
    white-space: nowrap;
    padding: 0 1rem;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ticker-item:hover { color: var(--text-primary); }
.ticker-item i { color: var(--accent); font-size: 0.5rem; }

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ─── Article Modal ─── */
.article-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.article-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
/* Article modal — large, full-featured */
.article-modal-card {
    width: 92vw;
    max-width: 1100px;
    height: 90vh;
    max-height: 88vh;
    background: linear-gradient(160deg, #12121f, #1a1a2e);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.12);
    transform: scale(0.92) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}
.article-modal-overlay.active .article-modal-card {
    transform: scale(1) translateY(0);
}
.article-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.article-modal-close:hover {
    background: rgba(99,102,241,0.5);
    border-color: var(--accent);
    transform: rotate(90deg) scale(1.1);
}
/* Hero section with gradient background */
.article-modal-hero {
    position: relative;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    flex-shrink: 0;
    overflow: hidden;
}
.article-modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18,18,31,0.88) 0%, rgba(18,18,31,0.96) 60%, #12121f 100%);
}
.article-modal-hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 200px;
}
.article-modal-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    align-self: flex-start;
    box-shadow: 0 2px 12px rgba(99,102,241,0.4);
}
.article-modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.article-modal-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.article-modal-cat {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #22d3ee;
    background: rgba(34,211,238,0.12);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}
.article-modal-date {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}
.article-modal-date i { margin-right: 0.3rem; }
/* Scrollable body */
.article-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2.5rem;
}
.article-modal-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
    white-space: pre-line;
}
.article-modal-desc.article-loading {
    opacity: 0.4;
}
/* Actions bar */
.article-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.article-modal-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    text-decoration: none;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.article-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(99,102,241,0.5);
}
.article-modal-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.4rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s;
}
.article-modal-btn-copy:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}
/* Light mode */
body.light-mode .article-modal-card { background: linear-gradient(160deg, #f5f3ef, #eae7e2); }
body.light-mode .article-modal-hero { background-color: #dedad5; }
body.light-mode .article-modal-hero-overlay { background: linear-gradient(180deg, rgba(245,243,239,0.1) 0%, rgba(245,243,239,0.85) 70%, #f5f3ef 100%); }
body.light-mode .article-modal-title { color: #2a2a35; text-shadow: none; }
body.light-mode .article-modal-desc { color: #5a5a68; }
body.light-mode .article-modal-actions { background: rgba(0,0,0,0.03); border-top-color: rgba(0,0,0,0.06); }
body.light-mode .article-modal-close { background: rgba(255,255,255,0.7); color: #2a2a35; border-color: rgba(0,0,0,0.1); }
body.light-mode .article-modal-date { color: #8a8a95; }

/* ─── YouTube Video Modal ─── */
.yt-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.yt-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.yt-modal {
    width: 92vw;
    max-width: 1250px;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s ease;
    position: relative;
}
.yt-modal-overlay.active .yt-modal {
    transform: scale(1) translateY(0);
}
.yt-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.yt-modal-close:hover {
    background: rgba(255,68,68,0.3);
    border-color: #ff4444;
    transform: rotate(90deg);
}
.yt-modal-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}
.yt-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.yt-modal-info {
    padding: 1rem 1.25rem;
    background: #1a1a2e;
}
.yt-modal-channel {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ff4444;
    margin-bottom: 0.3rem;
}
.yt-modal-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #e8e8ed;
    line-height: 1.4;
}

/* ─── YouTube Video Carousel ─── */
.yt-section {
    overflow: visible;
}
.yt-carousel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0 0 1rem;
}
.yt-carousel-frame {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99,102,241,0.15);
    background: linear-gradient(145deg, rgba(99,102,241,0.04), rgba(6,182,212,0.02));
    padding: 1.35rem 0;
    overflow: visible;
}

/* Large side arrows for YT carousel */
.yt-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,68,68,0.4);
    background: rgba(15,15,30,0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.yt-carousel-btn:hover {
    background: rgba(255,68,68,0.25);
    border-color: #ff4444;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 28px rgba(255,68,68,0.3);
}
.yt-carousel-btn-left { left: 12px; }
.yt-carousel-btn-right { right: 12px; }
.yt-carousel-frame::before,
.yt-carousel-frame::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}
.yt-carousel-frame::before {
    left: 0;
    background: linear-gradient(to right, rgba(11,16,32,0.95), rgba(11,16,32,0.6) 40%, transparent);
}
.yt-carousel-frame::after {
    right: 0;
    background: linear-gradient(to left, rgba(11,16,32,0.95), rgba(11,16,32,0.6) 40%, transparent);
}
.yt-carousel-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ff4444;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.yt-carousel-label .fab { font-size: 1.1rem; }
.yt-carousel-nav {
    display: flex;
    gap: 0.4rem;
}
.yt-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: var(--transition);
}
.yt-arrow:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255,68,68,0.08);
}
.yt-carousel-track {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    padding: 0 1.75rem;
    border-radius: var(--radius-lg);
    scroll-behavior: smooth;
}
.yt-carousel-track::-webkit-scrollbar { display: none; }
.yt-carousel-content {
    display: flex;
    gap: 1.15rem;
    width: max-content;
    will-change: scroll-position;
}

/* ─── Video Card ─── */
.yt-card {
    flex-shrink: 0;
    width: 364px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.yt-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255,68,68,0.35);
    box-shadow: 0 8px 30px rgba(255,68,68,0.12);
}
.yt-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}
.yt-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}
.yt-card:hover .yt-card-thumb img {
    opacity: 0;
}
.yt-card-thumb iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.yt-card:hover .yt-card-thumb iframe {
    opacity: 1;
}
.yt-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,68,68,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.yt-card:hover .yt-card-play {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
}
.yt-card-info {
    padding: 0.8rem 0.95rem 0.95rem;
}
.yt-card-channel {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ff4444;
    margin-bottom: 0.35rem;
}
.yt-card-title {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.yt-card:hover .yt-card-title {
    color: var(--text-primary);
}

/* Loading skeletons */
.yt-card-loading { pointer-events: none; }
.yt-skeleton {
    width: 100%;
    height: 100%;
    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: 4px;
    aspect-ratio: 16/9;
}
.yt-skeleton-text {
    display: block;
    height: 10px;
    border-radius: 4px;
    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;
    margin-bottom: 6px;
}
.yt-skeleton-text.short { width: 60%; }
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .yt-section .container { max-width: 100%; }
    .yt-card { width: 260px; }
    .yt-carousel-track { padding: 0 0.75rem; }
    .yt-carousel-frame::before,
    .yt-carousel-frame::after { width: 40px; }
}

/* ─── Section ─── */
.section { padding: 5rem 0; position: relative; z-index: 1; }
.section-alt { background: var(--bg-secondary); }

.section-header { text-align: center; margin-bottom: 3rem; }

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
}

/* ─── Feed ─── */
.feed-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
    position: relative;
    overflow: hidden;
}
.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.filter-btn[data-filter="ai"]::before { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1)); }
.filter-btn[data-filter="qa"]::before { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(6,182,212,0.1)); }
.filter-btn[data-filter="dev"]::before { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(239,68,68,0.1)); }
.filter-btn:hover::before { opacity: 1; }

.filter-btn:hover { border-color: rgba(255,255,255,0.18); color: var(--text-primary); transform: translateY(-1px); }
.filter-btn.active { border-color: var(--accent); color: #fff; }
.filter-btn.active::before { opacity: 0; }
.filter-btn[data-filter="all"].active { background: var(--accent); }
.filter-btn[data-filter="ai"].active { background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: #8b5cf6; }
.filter-btn[data-filter="qa"].active { background: linear-gradient(135deg, #10b981, #06b6d4); border-color: #10b981; }
.filter-btn[data-filter="dev"].active { background: linear-gradient(135deg, #f59e0b, #ef4444); border-color: #f59e0b; }

/* Feed as carousel */
.feed-carousel-wrap {
    position: relative;
    overflow: visible;
}
.feed-grid {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.25rem 1.75rem 0.75rem;
}
.feed-grid::-webkit-scrollbar { display: none; }


/* Large side arrows for feed carousel */
.feed-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(99,102,241,0.4);
    background: rgba(15,15,30,0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.feed-carousel-btn:hover {
    background: rgba(99,102,241,0.25);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 28px rgba(99,102,241,0.35);
}
.feed-carousel-btn-left  { left: 0; }
.feed-carousel-btn-right { right: 0; }
@media (max-width: 900px) {
    .feed-carousel-btn-left  { left: 0; }
    .feed-carousel-btn-right { right: 0; }
}


.feed-card {
    flex-shrink: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.35s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.feed-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.feed-card[data-category="ai"]::before { background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa); }
.feed-card[data-category="qa"]::before { background: linear-gradient(90deg, #10b981, #06b6d4, #22d3ee); }
.feed-card[data-category="dev"]::before { background: linear-gradient(90deg, #f59e0b, #ef4444, #f97316); }
.feed-card:hover::before { opacity: 1; }

.feed-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.feed-card-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.feed-source-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}
.feed-card[data-category="ai"] .feed-source-name { color: #8b5cf6; }
.feed-card[data-category="qa"] .feed-source-name { color: #10b981; }
.feed-card[data-category="dev"] .feed-source-name { color: #f59e0b; }

.feed-card-date {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.feed-card h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card-tag {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.feed-card[data-category="ai"] .feed-card-tag {
    background: rgba(139,92,246,0.12);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.2);
}
.feed-card[data-category="qa"] .feed-card-tag {
    background: rgba(16,185,129,0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16,185,129,0.2);
}
.feed-card[data-category="dev"] .feed-card-tag {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.2);
}

.feed-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.feed-more { text-align: center; margin-top: 2rem; }

/* ─── Explore ─── */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.explore-card {
    background: linear-gradient(145deg, var(--bg-card), rgba(99,102,241,0.03));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}
.explore-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.explore-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.explore-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(99,102,241,0.15), 0 0 0 1px rgba(99,102,241,0.1);
}
.explore-card:hover::before { opacity: 1; }

.explore-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 14px;
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 16px rgba(99,102,241,0.25);
    transition: transform 0.3s, box-shadow 0.3s;
}
.explore-card:hover .explore-icon {
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 6px 24px rgba(99,102,241,0.35);
}

.explore-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}
.explore-card:hover h3 { color: var(--accent); }

.explore-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.explore-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
    padding: 0.25rem 0.7rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 500;
    transition: all 0.2s;
}
.tag:hover {
    background: rgba(99,102,241,0.18);
    border-color: rgba(99,102,241,0.35);
    transform: translateY(-1px);
}

/* ─── Tools ─── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.25rem;
}

.tool-card {
    background: linear-gradient(145deg, var(--bg-card), rgba(99,102,241,0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    cursor: pointer;
}
.tool-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.tool-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 12px 36px rgba(99,102,241,0.18), 0 0 0 1px rgba(99,102,241,0.1);
    background: linear-gradient(145deg, rgba(99,102,241,0.08), var(--bg-card));
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 0;
    transition: transform 0.3s;
}
.tool-card:hover .tool-icon { transform: scale(1.15) rotate(-5deg); }
.tool-icon img { border-radius: 12px; object-fit: contain; }
.tool-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--tool-accent, #6366f1);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 20px color-mix(in srgb, var(--tool-accent, #6366f1) 20%, transparent);
    transition: all 0.3s ease;
}
.tool-card:hover .tool-icon-badge {
    background: color-mix(in srgb, var(--tool-accent, #6366f1) 15%, transparent);
    border-color: color-mix(in srgb, var(--tool-accent, #6366f1) 35%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--tool-accent, #6366f1) 30%, transparent);
}

.tool-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    transition: color 0.3s;
}
.tool-card:hover h4 { color: var(--accent); }

.tool-card p {
    font-size: 0.72rem;
    color: var(--text-dim);
    transition: color 0.3s;
}
.tool-card:hover p { color: var(--text-secondary); }

/* ─── Lab ─── */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.lab-card {
    background: linear-gradient(145deg, var(--bg-card), rgba(99,102,241,0.03));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.lab-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.lab-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.lab-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(99,102,241,0.15), 0 0 0 1px rgba(99,102,241,0.1);
}
.lab-card:hover::before { opacity: 1; }
.lab-card:hover h3 { color: var(--accent); }
.lab-card:hover .lab-icon { transform: scale(1.12) rotate(-3deg); }

.lab-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    position: relative;
    animation: labIconPulse 3s ease-in-out infinite;
}
.lab-card:nth-child(1) .lab-icon {
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(6,182,212,0.25));
    color: #6366f1;
    box-shadow: 0 0 20px rgba(99,102,241,0.2);
}
.lab-card:nth-child(2) .lab-icon {
    background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(139,92,246,0.18));
    color: #a855f7;
    box-shadow: 0 0 20px rgba(168,85,247,0.2);
}
.lab-card:nth-child(3) .lab-icon {
    background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(239,68,68,0.18));
    color: #f59e0b;
    box-shadow: 0 0 20px rgba(245,158,11,0.2);
}
.lab-card:nth-child(4) .lab-icon {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(245,158,11,0.18));
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239,68,68,0.2);
}
.lab-card:nth-child(5) .lab-icon {
    background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,182,212,0.18));
    color: #10b981;
    box-shadow: 0 0 20px rgba(16,185,129,0.2);
}
@keyframes labIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.lab-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.lab-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

/* ─── Modals ─── */
.json-modal, .diff-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.json-modal.active, .diff-modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: min(90vw, 600px);
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-wide { width: min(95vw, 900px); max-height: 90vh; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover { background: var(--glass); color: var(--text-primary); }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.code-input {
    width: 100%;
    min-height: 120px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 0.8rem;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.code-input:focus { border-color: var(--accent); }

.code-output {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--success);
    font-family: var(--mono);
    font-size: 0.8rem;
    overflow: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.diff-output {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    overflow: auto;
    max-height: 300px;
}

.diff-add { color: var(--success); background: rgba(16, 185, 129, 0.1); }
.diff-remove { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.diff-line { padding: 2px 4px; }

/* ─── Prompt Injection Inspector ─── */
.pitest-output {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.pitest-verdict {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid;
}
.pitest-verdict.clean  { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.25); }
.pitest-verdict.warn   { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); }
.pitest-verdict.danger { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.3); }
.pitest-verdict-icon { font-size: 1.6rem; flex-shrink: 0; }
.pitest-verdict-title { font-size: 1rem; font-weight: 700; }
.pitest-verdict-sub { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }
.pitest-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.pitest-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.pitest-section-header.red    { color: #ef4444; background: rgba(239,68,68,0.06); }
.pitest-section-header.yellow { color: #f59e0b; background: rgba(245,158,11,0.06); }
.pitest-section-header.blue   { color: #06b6d4; background: rgba(6,182,212,0.06); }
.pitest-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}
.pitest-item:last-child { border-bottom: none; }
.pitest-item-label { font-weight: 600; color: var(--text-primary); }
.pitest-item-detail { color: var(--text-secondary); font-size: 0.78rem; }
.pitest-char-highlight {
    display: inline-block;
    background: rgba(239,68,68,0.25);
    border: 1px solid rgba(239,68,68,0.5);
    border-radius: 4px;
    padding: 0 4px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: #fca5a5;
    margin: 0 2px;
}
.pitest-text-preview {
    font-family: var(--mono);
    font-size: 0.75rem;
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}
.pitest-text-preview mark {
    background: rgba(239,68,68,0.35);
    color: #fca5a5;
    border-radius: 2px;
    padding: 0 2px;
}

/* ─── Attack Generator ─── */
.attackgen-content { max-width: 920px; }
.attackgen-body { padding: 1.5rem; max-height: 80vh; overflow-y: auto; }

/* ─── Challenge Modal ─── */
.challenge-modal-content { max-width: 1100px; width: 95vw; }
.challenge-modal-body { padding: 1.25rem 1.5rem; max-height: 82vh; overflow-y: auto; }
.attackgen-disclaimer {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.6rem;
}
body.light-mode .attackgen-disclaimer { background: rgba(239,68,68,0.06); color: #b91c1c; border-color: rgba(239,68,68,0.2); }
.attackgen-form { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1.25rem; }
.attackgen-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.85rem; }
.attackgen-form label {
    display: flex; flex-direction: column; gap: 0.35rem;
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.attackgen-form label.attackgen-fullwidth { grid-column: 1 / -1; }
.attackgen-form select, .attackgen-form textarea {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 500;
    text-transform: none; letter-spacing: 0;
    font-family: inherit;
    transition: border-color 0.15s;
}
body.light-mode .attackgen-form select,
body.light-mode .attackgen-form textarea {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}
.attackgen-form select:focus, .attackgen-form textarea:focus {
    outline: none; border-color: #ef4444;
}
.attackgen-form textarea { resize: vertical; min-height: 50px; line-height: 1.5; }
.attackgen-actions { display: flex; gap: 0.6rem; }

.attackgen-loading {
    text-align: center; padding: 2rem;
    color: var(--text-secondary); font-size: 0.95rem;
}
.attackgen-loading i { margin-right: 0.5rem; color: #ef4444; }

.attackgen-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.5rem;
}
body.light-mode .attackgen-card {
    background: rgba(255,255,255,0.5);
    border-color: rgba(0,0,0,0.08);
}
.attackgen-card.attackgen-error { border-color: rgba(239,68,68,0.5); color: #fca5a5; }

.attackgen-card-header { margin-bottom: 1rem; }
.attackgen-title-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; margin-bottom: 0.4rem; flex-wrap: wrap;
}
.attackgen-title-row h4 {
    margin: 0; font-size: 1.15rem; font-weight: 700;
    color: var(--text-primary);
}
.attackgen-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.attackgen-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.attackgen-sev.sev-low      { background: rgba(34,197,94,0.18);  color: #22c55e; }
.attackgen-sev.sev-medium   { background: rgba(245,158,11,0.18); color: #f59e0b; }
.attackgen-sev.sev-high     { background: rgba(239,68,68,0.18);  color: #ef4444; }
.attackgen-sev.sev-critical { background: rgba(239,68,68,0.3);   color: #fff; box-shadow: 0 0 15px rgba(239,68,68,0.4); }
.attackgen-owasp { background: rgba(99,102,241,0.18); color: #a5b4fc; }
.attackgen-technique {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.attackgen-section { margin-top: 1.1rem; }
.attackgen-section-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.attackgen-section-title i { color: #ef4444; }
.attackgen-section p {
    font-size: 0.92rem; line-height: 1.65;
    color: var(--text-primary);
    margin: 0;
}
.attackgen-prompt-block {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.86rem;
    line-height: 1.6;
    color: #fef3f2;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'JetBrains Mono', 'Source Code Pro', monospace;
    overflow-x: auto;
    margin: 0;
}
body.light-mode .attackgen-prompt-block {
    background: rgba(0,0,0,0.04);
    color: #1f2937;
    border-color: rgba(239,68,68,0.2);
}

.attackgen-copy-btn {
    margin-left: auto;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.attackgen-copy-btn:hover { background: rgba(239,68,68,0.28); }

.attackgen-turn {
    display: flex; gap: 0.75rem;
    background: rgba(0,0,0,0.3);
    border-left: 3px solid #ef4444;
    border-radius: 4px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
}
body.light-mode .attackgen-turn { background: rgba(0,0,0,0.04); }
.attackgen-turn-num {
    flex-shrink: 0;
    font-size: 0.72rem; font-weight: 700;
    color: #ef4444;
    text-transform: uppercase; letter-spacing: 0.06em;
    min-width: 50px;
}
.attackgen-turn-text {
    font-size: 0.88rem; line-height: 1.55;
    color: var(--text-primary);
    flex: 1;
}

.attackgen-mitigation {
    background: rgba(34,197,94,0.06);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-top: 1.1rem;
}
.attackgen-mitigation .attackgen-section-title i { color: #22c55e; }

.attackgen-meta {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ─── Challenge ─── */
.challenge-card .lab-icon {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(245,158,11,0.18)) !important;
    color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239,68,68,0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(239,68,68,0.4); }

.challenge-playground {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    animation: msgIn 0.4s ease;
}

.challenge-playground-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.challenge-playground-header h3 {
    font-size: 1.3rem;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
}
.challenge-playground-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.challenge-playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.challenge-left,
.challenge-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.challenge-right { position: relative; }

.challenge-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.challenge-cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    text-align: center;
}
.challenge-cat-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.challenge-cat-btn.active {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239,68,68,0.08);
    box-shadow: 0 0 12px rgba(239,68,68,0.15);
}
.challenge-cat-btn i { font-size: 1.2rem; }
.challenge-cat-btn span { font-size: 0.75rem; font-weight: 600; }
.challenge-cat-btn small { font-size: 0.6rem; color: var(--text-dim); line-height: 1.2; }

.challenge-system-prompt {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.75rem;
}
.system-prompt-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.system-prompt-label i { color: var(--warning); }
#challenge-system-text {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
}

.challenge-input-area { display: flex; flex-direction: column; gap: 0.5rem; }
.challenge-textarea { min-height: 80px; max-height: 160px; }
.challenge-actions { display: flex; align-items: center; justify-content: space-between; }
.challenge-char-count { font-size: 0.7rem; color: var(--text-dim); }

.challenge-results { display: flex; flex-direction: column; gap: 1rem; animation: msgIn 0.4s ease; }

.challenge-result-section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.result-label i { color: var(--accent); }
.result-bot-response {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.challenge-verdict-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.challenge-verdict-card.verdict-broken {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.3);
    box-shadow: 0 0 30px rgba(239,68,68,0.1);
}
.challenge-verdict-card.verdict-safe {
    background: rgba(16,185,129,0.06);
    border-color: rgba(16,185,129,0.3);
    box-shadow: 0 0 30px rgba(16,185,129,0.1);
}

.verdict-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.verdict-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.verdict-broken .verdict-icon { background: rgba(239,68,68,0.15); color: var(--danger); }
.verdict-safe .verdict-icon { background: rgba(16,185,129,0.15); color: var(--success); }

.verdict-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.verdict-broken .verdict-title { color: var(--danger); }
.verdict-safe .verdict-title { color: var(--success); }

.verdict-metrics {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: center;
}
.verdict-metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.metric-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.metric-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.metric-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}
.verdict-broken .metric-fill { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.verdict-safe .metric-fill { background: linear-gradient(90deg, #06b6d4, #10b981); }
.metric-value { font-size: 0.75rem; font-weight: 700; font-family: var(--mono); color: var(--text-primary); }

.verdict-severity-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.severity-none { background: rgba(16,185,129,0.1); color: var(--success); }
.severity-low { background: rgba(6,182,212,0.1); color: var(--accent-2); }
.severity-medium { background: rgba(245,158,11,0.1); color: var(--warning); }
.severity-high { background: rgba(239,68,68,0.1); color: var(--danger); }
.severity-critical { background: rgba(239,68,68,0.2); color: #fff; border: 1px solid var(--danger); }

.verdict-detail { margin-bottom: 0.75rem; }
.verdict-detail:last-of-type { margin-bottom: 0; }
.verdict-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.verdict-detail-label i { color: var(--accent); font-size: 0.65rem; }
.verdict-detail p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.verdict-models {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    font-size: 0.6rem;
    color: var(--text-dim);
    font-family: var(--mono);
}

.challenge-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.challenge-stat { text-align: center; }
.challenge-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--mono);
}
.challenge-stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.challenge-loading {
    position: absolute;
    inset: 0;
    background: rgba(20,26,39,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}
.challenge-loading-inner { text-align: center; color: var(--text-secondary); }
.challenge-loading-inner p { font-size: 0.85rem; margin-top: 0.75rem; }
.challenge-loading-sub { font-size: 0.7rem !important; color: var(--text-dim); }

body.light-mode .challenge-loading { background: rgba(237,234,229,0.92); }
body.light-mode .challenge-cat-btn.active { background: rgba(239,68,68,0.06); }
body.light-mode .challenge-verdict-card.verdict-broken { background: rgba(239,68,68,0.04); }
body.light-mode .challenge-verdict-card.verdict-safe { background: rgba(16,185,129,0.04); }

@media (max-width: 900px) {
    .challenge-playground-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .challenge-categories { grid-template-columns: repeat(2, 1fr); }
    .verdict-metrics { flex-direction: column; gap: 0.75rem; }
}


/* ─── Footer ─── */
.footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-brand {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-copy-email {
    width: 100%;
    text-align: center;
    margin: 0.1rem 0 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.footer-contact-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.8rem; border: 1px solid var(--success);
    border-radius: 8px; color: var(--success); font-size: 0.9rem;
    font-weight: 500; text-decoration: none; transition: var(--transition);
    background: transparent;
}
.footer-contact-btn:hover {
    background: var(--success); color: #fff;
    box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

/* ── Forum button ── */
.footer-forum-wrap {
    width: 100%; display: flex; justify-content: center; margin: 0.1rem 0;
}
.footer-forum-btn {
    display: inline-flex; align-items: center; gap: 0.55rem;
    width: min(100%, 380px); justify-content: center;
    padding: 0.55rem 1.5rem; border: 1px solid rgba(34,197,94,0.5);
    border-radius: 10px; color: var(--success); font-size: 0.85rem;
    font-weight: 600; cursor: pointer; transition: var(--transition);
    background: rgba(34,197,94,0.06); font-family: var(--font);
    letter-spacing: 0.01em;
}
.footer-forum-btn:hover {
    background: var(--success); color: #fff;
    border-color: var(--success);
    box-shadow: 0 4px 20px rgba(34,197,94,0.35);
    transform: translateY(-2px);
}

/* ── Forum modal ── */
.forum-modal-content {
    width: min(90vw, 1300px);
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.forum-modal-body { display: flex; flex-direction: column; gap: 0; padding: 1.25rem 2rem; overflow-y: auto; flex: 1; }

.forum-compose { display: flex; flex-direction: column; gap: 0.6rem; }
.forum-handle-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); }
.forum-handle-badge {
    font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
    color: var(--success); background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3); border-radius: 6px;
    padding: 0.15rem 0.5rem; letter-spacing: 0.05em;
}
.forum-textarea {
    width: 100%; min-height: 90px; max-height: 200px;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary); font-size: 0.85rem;
    font-family: var(--font); padding: 0.65rem 0.9rem; resize: vertical;
    outline: none; transition: var(--transition); box-sizing: border-box;
}
.forum-textarea:focus { border-color: var(--success); }
.forum-textarea::placeholder { color: var(--text-dim); }
.forum-compose-footer { display: flex; justify-content: space-between; align-items: center; }
.forum-char-count { font-size: 0.75rem; color: var(--text-dim); font-family: var(--mono); }
.forum-submit-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.2rem; background: var(--success); color: #fff;
    border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.forum-submit-btn:hover { background: #16a34a; box-shadow: 0 4px 12px rgba(34,197,94,0.35); }
.forum-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.forum-status { font-size: 0.8rem; min-height: 1.2em; margin: 0; }
.forum-status.success { color: var(--success); }
.forum-status.error { color: var(--danger); }

.forum-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.forum-posts-list { display: flex; flex-direction: column; gap: 0.75rem; }
.forum-loading { text-align: center; color: var(--text-dim); font-size: 0.85rem; padding: 1.5rem 0; }
.forum-empty { text-align: center; color: var(--text-dim); font-size: 0.85rem; padding: 1.5rem 0; }

.forum-post {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 10px; padding: 0.8rem 1rem;
}
.forum-post-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.forum-post-handle {
    font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
    color: var(--success); background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2); border-radius: 5px;
    padding: 0.1rem 0.45rem;
}
.forum-post-time { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }
.forum-post-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.forum-post-actions { margin-top: 0.5rem; }
.forum-reply-btn {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-secondary); font-size: 0.75rem; cursor: pointer;
    padding: 0.2rem 0.65rem; transition: var(--transition); font-family: var(--font);
}
.forum-reply-btn:hover { border-color: var(--success); color: var(--success); }

.forum-replies { margin-top: 0.6rem; border-left: 2px solid var(--border); padding-left: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.forum-reply { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; }

.forum-inline-reply { margin-top: 0.6rem; display: flex; gap: 0.5rem; }
.forum-inline-reply textarea {
    flex: 1; min-height: 56px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary); font-size: 0.82rem; font-family: var(--font);
    padding: 0.5rem 0.7rem; resize: vertical; outline: none; transition: var(--transition);
}
.forum-inline-reply textarea:focus { border-color: var(--success); }
.forum-inline-reply textarea::placeholder { color: var(--text-dim); }
.forum-inline-reply-send {
    align-self: flex-end; padding: 0.5rem 1rem; background: var(--success); color: #fff;
    border: none; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: var(--font); white-space: nowrap;
}
.forum-inline-reply-send:hover { background: #16a34a; }
.forum-inline-reply-send:disabled { opacity: 0.5; cursor: not-allowed; }

body.light-mode .forum-textarea { background: rgba(0,0,0,0.03); }
body.light-mode .forum-post { background: rgba(0,0,0,0.03); }
body.light-mode .forum-inline-reply textarea { background: rgba(0,0,0,0.03); }

.newsletter-form { margin: 0.4rem 0; text-align: center; }
.newsletter-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.6rem; }
.newsletter-label i { color: var(--accent); margin-right: 0.3rem; }
.newsletter-input-wrap {
    display: flex; gap: 0.5rem; justify-content: center; max-width: 380px; margin: 0 auto;
}
.newsletter-input-wrap input {
    flex: 1; padding: 0.55rem 0.9rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary); font-size: 0.85rem; font-family: var(--font);
    outline: none; transition: var(--transition);
}
.newsletter-input-wrap input:focus { border-color: var(--accent); }
.newsletter-input-wrap input::placeholder { color: var(--text-dim); }
.newsletter-msg { font-size: 0.8rem; margin-top: 0.4rem; min-height: 1.2em; }
.newsletter-msg.success { color: var(--success); }
.newsletter-msg.error { color: var(--danger); }

.footer-socials {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25);
    color: var(--success); font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); text-decoration: none;
}
.social-icon:hover {
    background: var(--success); color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(34,197,94,0.35);
    border-color: var(--success);
}

.social-photo {
    position: relative;
    overflow: hidden;
    padding: 0;
    line-height: 0;
}

.social-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--success);
    background:
        radial-gradient(circle at 30% 20%, rgba(34,197,94,0.16), transparent 55%),
        linear-gradient(135deg, rgba(34,197,94,0.18), rgba(34,197,94,0.06));
}

.social-photo:hover .social-photo-placeholder {
    color: #fff;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
}

.social-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1.08);
    filter: grayscale(1);
}

/* ─── Nav Actions ─── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button.auth-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    -webkit-appearance: none;
    appearance: none;
}
button.auth-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.user-menu { position: relative; }
button.user-menu-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
button.user-menu-toggle:hover { border-color: var(--accent); }
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.user-dropdown a:hover { background: var(--glass); color: var(--text-primary); }

/* ─── Auth Modal ─── */
.auth-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}
.auth-overlay.open {
    display: flex;
}
.auth-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
.auth-modal-close:hover { color: var(--text-primary); }
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
button.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-dim);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
button.auth-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.auth-field { margin-bottom: 1rem; }
.auth-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-form input::placeholder { color: var(--text-dim); }
.auth-error {
    color: var(--danger);
    font-size: 0.8rem;
    min-height: 1.2em;
    margin-bottom: 0.5rem;
}
button.auth-submit {
    width: 100%;
    padding: 0.7rem;
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
button.auth-submit:hover { opacity: 0.9; transform: translateY(-1px); }
button.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-link-btn {
    background: none; border: none; color: var(--accent); font-size: 0.82rem;
    cursor: pointer; text-decoration: underline; padding: 0; font-family: var(--font);
}
.auth-link-btn:hover { color: var(--text-primary); }
.auth-success { color: var(--success); font-size: 0.82rem; min-height: 1.2em; margin-bottom: 0.5rem; }

.user-dashboard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.user-dashboard-overlay.open { display: flex; }
.user-dashboard-modal {
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 2.5rem));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-dashboard-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
}
.user-dashboard-close:hover { color: var(--text-primary); background: var(--glass); }
.user-dashboard-header {
    padding: 1.5rem 1.5rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.dashboard-kicker {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.user-dashboard-header h3 {
    margin: 0.35rem 0 0.25rem;
    color: var(--text-primary);
    font-size: 1.35rem;
}
.user-dashboard-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.dashboard-thread {
    min-height: 260px;
    max-height: 430px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dashboard-empty {
    margin: auto;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.dashboard-message {
    max-width: 78%;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    line-height: 1.45;
    white-space: pre-wrap;
}
.dashboard-message.user {
    align-self: flex-end;
    background: rgba(99,102,241,0.16);
    border-color: rgba(99,102,241,0.34);
}
.dashboard-message.admin {
    align-self: flex-start;
    background: rgba(255,255,255,0.04);
}
.dashboard-message-time {
    margin-top: 0.4rem;
    color: var(--text-dim);
    font-size: 0.68rem;
}
.dashboard-message-form {
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--border);
}
.dashboard-message-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 84px;
    max-height: 160px;
    padding: 0.75rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.dashboard-message-form textarea:focus { border-color: var(--accent); }
.dashboard-message-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}
.dashboard-status {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.dashboard-status.error { color: var(--danger); }
.dashboard-status.success { color: var(--success); }
.dashboard-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 8px;
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-family: var(--font);
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.dashboard-send-btn:hover { transform: translateY(-1px); }
.dashboard-send-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.admin-dashboard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.admin-dashboard-overlay.open { display: flex; }
.admin-dashboard-modal {
    width: min(1100px, 100%);
    max-height: min(820px, calc(100vh - 2.5rem));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-dashboard-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}
.admin-dashboard-close:hover { color: var(--text-primary); background: var(--glass); }
.admin-dashboard-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 4rem;
}
.admin-dashboard-header h3 {
    margin: 0.35rem 0 0.25rem;
    color: var(--text-primary);
    font-size: 1.35rem;
}
.admin-dashboard-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-family: var(--font);
    font-weight: 700;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}
.dashboard-refresh-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.admin-dashboard-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 520px;
    max-height: 650px;
}
.admin-conversation-list {
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.admin-conversation-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}
.admin-conversation-item:hover,
.admin-conversation-item.active {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.12);
}
.admin-conversation-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.admin-conversation-name {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.88rem;
}
.admin-conversation-time {
    color: var(--text-dim);
    font-size: 0.68rem;
    white-space: nowrap;
}
.admin-conversation-email,
.admin-conversation-preview {
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin-top: 0.32rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-thread-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.admin-thread-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.admin-thread-head strong {
    display: block;
    color: var(--text-primary);
}
.admin-thread-head span {
    display: block;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.78rem;
}
.admin-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.admin-reply-form {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
}
.admin-reply-form textarea {
    width: 100%;
    min-height: 84px;
    max-height: 160px;
    resize: vertical;
    padding: 0.75rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.admin-reply-form textarea:focus { border-color: var(--accent); }

/* ─── Chat Widget ─── */
.chat-widget { position: fixed; bottom: 56px; right: 20px; z-index: 9999; }

.chat-toggle {
    width: 64px; height: 64px; border-radius: 50%; background: var(--gradient);
    border: none; color: #fff; font-size: 1.6rem; cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow); transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    position: relative; animation: chatPulse 3s ease-in-out infinite;
}
.chat-toggle::before,
.chat-toggle::after {
    content: ''; position: absolute; inset: -8px; border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.5); animation: chatRipple 2.5s ease-out infinite;
    pointer-events: none;
}
.chat-toggle::after { inset: -6px; animation-delay: 1.25s; }
@keyframes chatRipple {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}
@keyframes chatPulse {
    0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); }
    50% { box-shadow: 0 8px 40px var(--accent-glow), 0 0 60px rgba(99,102,241,0.2); }
}
.chat-toggle:hover { transform: scale(1.08); }
.chat-toggle.active { transform: scale(0.95); animation: none; }
.chat-toggle.active::before, .chat-toggle.active::after { display: none; }

.chat-badge {
    position: absolute; top: -4px; right: -4px; background: var(--success);
    color: #fff; font-size: 0.55rem; font-weight: 700; padding: 2px 6px;
    border-radius: 999px; border: 2px solid var(--bg-primary);
}

/* Notification dot */
.chat-notification-dot {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    animation: notifPulse 2s ease-in-out infinite;
    z-index: 2;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Chat teaser bubble */
.chat-teaser {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 260px;
    background: linear-gradient(135deg, #1e293b, #1a2332);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 14px 14px 4px 14px;
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    animation: teaserSlideIn 0.5s ease 2s both;
    z-index: 1;
}
@keyframes teaserSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-teaser-text {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-primary);
}
.chat-teaser-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}
.chat-teaser-close:hover { color: var(--text-primary); }
.chat-teaser.hidden { display: none; }

.chat-window {
    position: absolute; bottom: 72px; right: 0; width: 380px; height: 520px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; display: flex;
    flex-direction: column; box-shadow: var(--shadow-lg);
    transform: scale(0.8) translateY(20px); opacity: 0; pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.25s ease;
}
.chat-window.active { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.chat-window.maximized {
    position: fixed; top: 10vh; right: 20px; bottom: 20px;
    left: auto; width: min(560px, 50vw); height: auto;
    border-radius: var(--radius-lg); z-index: 10001;
}
.chat-window.resizing { transition: none; }

.chat-resize-handle { position: absolute; z-index: 2; }
.chat-resize-handle-top { top: 0; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.chat-resize-handle-left { top: 0; left: 0; bottom: 0; width: 6px; cursor: ew-resize; }

.chat-header {
    background: var(--gradient); color: #fff; padding: 1rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar {
    width: 36px; height: 36px; background: rgba(255,255,255,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.chat-header h4 { font-size: 0.9rem; font-weight: 600; margin: 0; }
.chat-status { font-size: 0.7rem; opacity: 0.9; display: flex; align-items: center; gap: 0.3rem; }
.status-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.chat-header-actions { display: flex; gap: 0.25rem; }
.chat-header-btn, .chat-close-btn {
    background: none; border: none; color: #fff; font-size: 1rem; cursor: pointer;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: var(--transition);
}
.chat-header-btn:hover, .chat-close-btn:hover { background: rgba(255,255,255,0.2); }

.chat-messages {
    flex: 1; padding: 1.25rem; overflow-y: auto; display: flex;
    flex-direction: column; gap: 1rem; background: var(--bg-primary);
}
.chat-message { display: flex; gap: 0.5rem; max-width: 85%; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-message.user-message { flex-direction: row-reverse; align-self: flex-end; }

.message-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--glass);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: var(--accent); flex-shrink: 0;
}
.user-message .message-avatar { background: var(--accent); color: #fff; }
.message-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px 12px 12px 4px; padding: 0.75rem 1rem;
    font-size: 0.85rem; line-height: 1.5; color: var(--text-primary); word-break: break-word;
}
.user-message .message-content {
    background: var(--accent); border-color: var(--accent); color: #fff;
    border-radius: 12px 12px 4px 12px;
}
.message-content p { margin: 0; }
.message-content p + p { margin-top: 0.4rem; }
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
    margin: 0.6rem 0 0.3rem; font-weight: 600; line-height: 1.25;
}
.message-content h1 { font-size: 1.05rem; }
.message-content h2 { font-size: 1rem; }
.message-content h3 { font-size: 0.95rem; }
.message-content h4, .message-content h5, .message-content h6 { font-size: 0.9rem; }
.message-content ul, .message-content ol { margin: 0.3rem 0; padding-left: 1.25rem; }
.message-content li { margin: 0.15rem 0; }
.message-content strong { font-weight: 600; }
.message-content em { font-style: italic; }
.message-content code {
    background: rgba(255,255,255,0.08); padding: 0.1rem 0.3rem;
    border-radius: 4px; font-family: var(--mono); font-size: 0.8rem;
}
.message-content pre {
    background: rgba(0,0,0,0.3); padding: 0.75rem; border-radius: 8px;
    overflow-x: auto; margin: 0.5rem 0; font-family: var(--mono); font-size: 0.75rem; line-height: 1.5;
}

.typing-indicator { display: flex; gap: 4px; padding: 0.75rem 1rem; align-items: center; }
.typing-dot {
    width: 7px; height: 7px; background: var(--text-dim);
    border-radius: 50%; animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
.chat-routed-info { text-align: center; font-size: 0.65rem; color: var(--text-dim); font-family: var(--mono); padding: 2px 0; }

.chat-input-container { border-top: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
.chat-file-input { display: none !important; position: absolute; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; transition: var(--transition); }
.chat-attachments:not(:empty) { padding: 0.5rem 0.75rem 0; }
.chat-attachment-chip {
    width: 100%;
    min-width: 0;
}
.chat-attachment-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 12px;
    color: var(--text-primary);
}
.chat-attachment-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}
.chat-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-attachment-file-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: var(--accent);
    font-size: 1.15rem;
}
.chat-attachment-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.chat-attachment-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-attachment-subtitle {
    font-size: 0.64rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-attachment-preview-text {
    font-size: 0.66rem;
    color: var(--text-secondary);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-attachment-remove {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.95rem; line-height: 1; padding: 0 2px; transition: var(--transition);
    align-self: flex-start;
}
.chat-attachment-remove:hover { color: var(--danger); }

.message-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.message-content p + .message-attachments,
.message-attachments + p {
    margin-top: 0.55rem;
}
.message-attachments .chat-attachment-card {
    min-width: 220px;
    max-width: 100%;
}
.user-message .message-attachments .chat-attachment-card {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.18);
}
.user-message .chat-attachment-file-icon,
.user-message .chat-attachment-thumb {
    background: rgba(255,255,255,0.14);
}
.user-message .chat-attachment-file-icon,
.user-message .chat-attachment-title {
    color: #fff;
}
.user-message .chat-attachment-subtitle,
.user-message .chat-attachment-preview-text {
    color: rgba(255,255,255,0.78);
}

.chat-consent {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-secondary); z-index: 10;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.chat-consent.hidden { display: none; }
.chat-consent-inner {
    text-align: center; max-width: 320px;
}
.chat-consent-icon {
    width: 48px; height: 48px; border-radius: 50%; background: rgba(99,102,241,0.12);
    color: var(--accent); font-size: 1.3rem; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
}
.chat-consent-inner h4 {
    font-size: 1rem; color: var(--text-primary); margin-bottom: 0.6rem;
}
.chat-consent-inner p {
    font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 1rem;
}
.chat-consent-check {
    display: flex; align-items: flex-start; gap: 0.5rem; text-align: left;
    font-size: 0.7rem; color: var(--text-secondary); cursor: pointer; margin-bottom: 1rem;
}
.chat-consent-check input { margin-top: 2px; accent-color: var(--accent); }
.chat-consent-check a { color: var(--accent); text-decoration: underline; }
.chat-consent-agree {
    width: 100%; padding: 0.6rem; border: none; border-radius: 10px;
    background: var(--gradient); color: #fff; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: var(--font);
}
.chat-consent-agree:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-consent-agree:not(:disabled):hover { transform: scale(1.02); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

.chat-terms-panel {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; background: var(--bg-secondary);
}
.chat-terms-panel.hidden { display: none; }
.chat-terms-back {
    display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.75rem;
    background: none; border: none; border-bottom: 1px solid var(--border);
    color: var(--accent); font-size: 0.8rem; cursor: pointer; font-family: var(--font);
    flex-shrink: 0;
}
.chat-terms-back:hover { color: #fff; }
.chat-terms-scroll {
    flex: 1; overflow-y: auto; padding: 1rem; font-size: 0.72rem;
    color: var(--text-secondary); line-height: 1.6;
}
.chat-terms-scroll h4 {
    font-size: 0.9rem; color: var(--text-primary); margin-bottom: 0.8rem;
}
.chat-terms-section { margin-bottom: 0.8rem; }
.chat-terms-section h5 {
    font-size: 0.78rem; color: var(--accent); margin-bottom: 0.3rem;
}
.chat-terms-section ul {
    margin: 0; padding-left: 1.1rem; list-style: disc;
}
.chat-terms-section li { margin-bottom: 0.25rem; }

.chat-form {
    display: flex; gap: 0.5rem; padding: 0.6rem 0.75rem;
    align-items: center; background: var(--bg-secondary);
}
.chat-action-btn {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08); color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; transition: var(--transition); flex-shrink: 0; position: relative;
}
.chat-action-btn:hover {
    color: var(--accent); background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3); transform: scale(1.08);
}
.chat-action-btn.active {
    color: #fff; background: var(--danger); border-color: var(--danger);
    animation: micPulse 1.5s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}
.mic-lang-badge {
    position: absolute; bottom: -4px; right: -4px; font-size: 0.5rem; font-weight: 700;
    background: var(--accent); color: #fff; padding: 1px 4px;
    border-radius: 4px; line-height: 1.2;
}

.chat-input-wrap {
    flex: 1; position: relative; display: flex; align-items: center;
    --voice-level: 0.14;
}
.chat-input {
    width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 20px; padding: 0.6rem 8.8rem 0.9rem 1rem;
    color: var(--text-primary); font-size: 0.85rem; font-family: var(--font);
    outline: none; transition: var(--transition);
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-drop-hint {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.62rem;
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 999px;
    background: rgba(99,102,241,0.08);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.chat-drop-hint:hover {
    color: var(--text-primary);
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.16);
}
.chat-input:not(:placeholder-shown) ~ .chat-drop-hint,
.chat-input-wrap.listening .chat-drop-hint,
.chat-input-wrap:has(.chat-stop-btn.visible) .chat-drop-hint {
    opacity: 0;
    pointer-events: none;
}
.chat-input-wrap.drag-over .chat-input {
    border-color: var(--accent);
    background: rgba(99,102,241,0.1);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.22), 0 0 24px rgba(99,102,241,0.16);
}
.chat-input-wrap.drag-over .chat-drop-hint {
    color: #fff;
    border-color: rgba(76,201,240,0.55);
    background: linear-gradient(135deg, rgba(99,102,241,0.45), rgba(6,182,212,0.38));
    transform: translateY(-50%) scale(1.03);
}
.chat-voice-meter {
    position: absolute;
    left: 1rem;
    right: 8.8rem;
    bottom: 0.42rem;
    height: 10px;
    display: flex;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.chat-input-wrap.listening .chat-voice-meter { opacity: 1; }
.chat-voice-meter-wave {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    transform-origin: center;
    transform: scaleY(var(--voice-level));
    transition: transform 0.1s linear, opacity 0.18s ease;
    opacity: calc(0.45 + (var(--voice-level) * 0.55));
    background:
        linear-gradient(90deg, rgba(99,102,241,0.0) 0%, rgba(99,102,241,0.95) 12%, rgba(76,201,240,0.95) 50%, rgba(99,102,241,0.95) 88%, rgba(99,102,241,0.0) 100%),
        repeating-linear-gradient(
            90deg,
            transparent 0 5px,
            rgba(255,255,255,0.92) 5px 7px,
            transparent 7px 11px
        );
    box-shadow: 0 0 12px rgba(99,102,241,0.2);
    mix-blend-mode: screen;
}

.chat-inline-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    width: 24px; height: 24px; display: none; align-items: center; justify-content: center;
    font-size: 0.65rem; border-radius: 50%; transition: var(--transition);
}
.chat-inline-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.chat-stop-btn { right: 28px; }
.chat-stop-btn.visible { display: flex; color: var(--danger); }
.chat-clear-btn { right: 6px; }
.chat-clear-btn.visible { display: flex; }

.chat-send-btn {
    width: 36px; height: 36px; border-radius: 50%; background: var(--gradient);
    border: none; color: #fff; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 0.85rem; transition: var(--transition); flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(99,102,241,0.35);
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 18px rgba(99,102,241,0.5); }

.chat-input-container.drag-over {
    background: rgba(99,102,241,0.08); border-color: var(--accent);
}

/* ─── Animations ─── */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 7rem;
    }

    .hero-content { max-width: 100%; }

    .hero-stats { justify-content: center; }

    .hero-actions { justify-content: center; }

    .hero-visual { margin-left: 0; margin-top: 2.5rem; }

    .terminal-card { width: 100%; max-width: 420px; }

    .diff-inputs { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }
    .nav-menu-btn { display: flex; align-items: center; justify-content: center; }

    .hero-stats { flex-direction: column; gap: 0.75rem; padding: 1rem; }
    .stat-divider { width: 40px; height: 1px; }

    .feed-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: repeat(3, 1fr); }
    .explore-grid { grid-template-columns: 1fr; }
    .lab-grid { grid-template-columns: repeat(2, 1fr); }

    .chat-window { width: calc(100vw - 40px); right: -10px; }
    .chat-input { padding-right: 5.2rem; }
    .chat-drop-hint { width: 28px; padding: 0; justify-content: center; }
    .chat-drop-hint span { display: none; }
    .chat-voice-meter { right: 5.2rem; }
    .admin-dashboard-layout { grid-template-columns: 1fr; max-height: calc(100vh - 190px); overflow-y: auto; }
    .admin-conversation-list { border-right: none; border-bottom: 1px solid var(--border); max-height: 240px; }
    .admin-thread-messages { min-height: 220px; }

    .footer-inner { flex-direction: column; text-align: center; }
}

@media (min-width: 901px) {
    .hero { display: flex; gap: 4rem; }
}

/* ─── RAG Hallucination Tester ─── */
.hallucination-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }

.hallucination-field { display: flex; flex-direction: column; gap: 0.4rem; }

.hallucination-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn-xs {
    padding: 0.2rem 0.65rem;
    font-size: 0.72rem;
    gap: 0.3rem;
    height: auto;
    line-height: 1.6;
    white-space: nowrap;
}
.hfi-limit-hint {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-dim);
    margin-left: 0.2rem;
    opacity: 0.8;
}

.hallucination-context-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.3rem;
}

.hallucination-file-info {
    font-size: 0.76rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hallucination-char-count {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.hallucination-char-count.hcc-warn { color: #f59e0b; }
.hallucination-char-count.hcc-over { color: #ef4444; font-weight: 600; }
.hfi-ok { color: #10b981; }
.hfi-error { color: #f87171; }
.hfi-loading { color: var(--text-dim); }
.hfi-warn { color: #f59e0b; }
@keyframes hfi-spin { to { transform: rotate(360deg); } }
.hfi-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(99,102,241,0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: hfi-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.hallucination-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.hallucination-hint {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.hallucination-textarea { height: 120px; resize: vertical; }
.hallucination-textarea-sm { height: 70px; }

.hallucination-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem;
    color: var(--text-dim);
    gap: 0.75rem;
}

.hallucination-error {
    padding: 1rem 1.25rem;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px;
    color: #f87171;
    font-size: 0.88rem;
}

.hallucination-output { margin-top: 1rem; }

.hallucination-report { display: flex; flex-direction: column; gap: 1.25rem; }

.hr-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.hr-score-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.1rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.hr-score-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.hr-score-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.hr-score-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
}
.hr-score-stats { gap: 0; justify-content: center; }
.hr-stats-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.9rem;
    padding: 0.2rem 0;
}
.hr-stats-row span { font-size: 1.4rem; font-weight: 700; }
.hr-stats-row small { font-size: 0.7rem; color: var(--text-dim); }

.hr-section { display: flex; flex-direction: column; gap: 0.6rem; }
.hr-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hf-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0.35rem;
}
.hf-icon { font-size: 0.95rem; margin-top: 0.1rem; flex-shrink: 0; }
.hf-supported { color: #10b981; }
.hf-hallucinated { color: #ef4444; }
.hf-contradicted { color: #f59e0b; }
.hf-unknown { color: #94a3b8; }
.hf-content { display: flex; flex-direction: column; gap: 0.2rem; }
.hf-fact { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.hf-explanation { font-size: 0.76rem; color: var(--text-dim); line-height: 1.4; }

.hf-patterns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hf-pattern-tag {
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}

.hf-recs {
    margin: 0;
    padding: 0 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.hf-recs li { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 640px) {
    .hr-scores { grid-template-columns: 1fr 1fr; }
    .hr-score-stats { display: none; }
}
