/* ══════════════════════════════════════════════════════════
   PushAI v2 — Premium Design System
   Glassmorphism · Micro-Animations · Dark-First
   ══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-deep: #07070c;
    --bg-card: #111118;
    --bg-card-hover: #181822;
    --bg-glass: rgba(17, 17, 24, 0.65);
    --border-dim: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(108, 99, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #6b7280;
    --text-muted: #444;
    --accent: #6c63ff;
    --accent-light: #818cf8;
    --accent-glow: rgba(108, 99, 255, 0.35);
    --accent-soft: rgba(108, 99, 255, 0.12);
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --gradient-hero: linear-gradient(160deg,
            rgba(76, 29, 149, 0.8) 0%,
            rgba(30, 41, 82, 0.6) 30%,
            rgba(20, 80, 80, 0.5) 60%,
            rgba(10, 10, 15, 1) 100%);
    --gradient-login: linear-gradient(135deg,
            #0a0a14 0%,
            #0e0e1a 30%,
            #111128 60%,
            #0a0a14 100%);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --radius-full: 999px;
    --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Light Theme ── */
body.light-theme {
    --bg-deep: #f5f7ff;
    --bg-card: #ffffff;
    --bg-card-hover: #f2f4ff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-dim: rgba(15, 23, 42, 0.1);
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #5b5bd6;
    --accent-light: #4c4cbf;
    --accent-glow: rgba(91, 91, 214, 0.25);
    --accent-soft: rgba(91, 91, 214, 0.08);
    --gradient-hero: linear-gradient(160deg,
            rgba(167, 179, 255, 0.55) 0%,
            rgba(206, 225, 255, 0.7) 60%,
            rgba(255, 255, 255, 1) 100%);
    --gradient-login: linear-gradient(135deg,
            #e8ecf5 0%,
            #f0f2ff 50%,
            #e8ecf5 100%);
}

/* ── Reset ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes checkmark {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(-45deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   LOGIN & ONBOARDING SCREENS
   ══════════════════════════════════════════════════════════ */
.screen-login,
.screen-onboard-1,
.screen-onboard-2 {
    position: fixed;
    inset: 0;
    background: var(--gradient-login);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}

.screen-login.active,
.screen-onboard-1.active,
.screen-onboard-2.active {
    display: flex;
}

.login-ambient {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.login-ambient-2 {
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(76, 29, 149, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: scaleIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
    font-weight: 900;
    box-shadow: 0 8px 25px var(--accent-glow);
    animation: float 3s ease-in-out infinite;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #4c1d95 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    border: none;
    padding: 0.95rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 6px 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--accent-light);
    border: 1px solid var(--border-glow);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--accent-soft);
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.onboard-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 2rem;
}

.onboard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-dim);
    transition: all var(--transition-smooth);
}

.onboard-dot.active {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    width: 28px;
    border-radius: 5px;
}

.onboard-dot.done {
    background: var(--success);
}

.onboard-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    animation: fadeUp 0.4s ease;
}

.onboard-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════════════════════
   MAIN APP SHELL
   ══════════════════════════════════════════════════════════ */
.app-shell {
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: column;
}

.app-shell.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
    scrollbar-width: none;
}

.content-area::-webkit-scrollbar { display: none; }

/* ── Ambient Glow ── */
.ambient-glow {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 300px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ── Header ── */
.app-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideDown 0.3s ease;
}

.header-greeting {
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
    line-height: 1.3;
}

.badge-guest {
    font-size: 0.55rem;
    background: var(--accent-soft);
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
    border: 1px solid var(--border-glow);
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.streak-badge {
    background: var(--accent-soft);
    color: var(--accent-light);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    transition: transform var(--transition-spring);
}

.streak-badge:hover { transform: scale(1.05); }

/* ── Hero Card ── */
.hero-card {
    margin: 0 1.25rem 1.5rem;
    border-radius: var(--radius-xl);
    background: var(--gradient-hero);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
    animation: fadeUp 0.5s ease;
    transition: transform var(--transition-fast);
}

.hero-card:hover { transform: translateY(-2px); }

.hero-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 70%; height: 100%;
    background: radial-gradient(ellipse at top right, rgba(100, 200, 180, 0.2), transparent 60%);
    pointer-events: none;
}

.hero-card::after {
    content: '';
    position: absolute;
    top: 0; left: 30%;
    width: 50%; height: 60%;
    background: radial-gradient(ellipse at center, rgba(200, 120, 180, 0.15), transparent 60%);
    pointer-events: none;
}

.hero-body {
    padding: 2rem 1.75rem 0;
    position: relative;
    z-index: 1;
}

.hero-tag {
    background: rgba(129, 140, 248, 0.25);
    color: #a5b4fc;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-footer {
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
}

.hero-sub {
    font-size: 0.85rem;
    opacity: 0.55;
    font-style: italic;
}

/* ── Buttons ── */
.start-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.start-btn:active { transform: scale(0.96); }

.ghost-btn {
    width: 100%;
    border: 1px solid var(--border-glow);
    background: transparent;
    color: var(--accent-light);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ghost-btn:hover { background: var(--accent-soft); }

.install-btn {
    background: var(--accent-soft);
    color: var(--accent-light);
    border: 1px solid var(--border-glow);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* ── Streak Bar ── */
.streak-bar {
    margin: 0 1.25rem 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeUp 0.6s ease;
}

.streak-ring {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: var(--accent-light);
    transition: all var(--transition-spring);
}

.streak-info { flex: 1; }
.streak-title { font-weight: 700; font-size: 1rem; }

.streak-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.streak-checks { display: flex; gap: 2px; }

.streak-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streak-check.filled { color: var(--accent-light); }
.streak-check.empty { color: #333; }

/* ── Section Title ── */
.section-title {
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.5rem 1.5rem 1rem;
}

/* ── Task Pills ── */
.task-pill {
    margin: 0 1.25rem 0.75rem;
    padding: 1.15rem 1.25rem;
    border-radius: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    gap: 1.15rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    animation: fadeUp 0.3s ease backwards;
}

.task-pill:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.task-pill:active { transform: scale(0.98); }

.task-pill.done { opacity: 0.5; }

.pill-check {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid rgba(108, 99, 255, 0.35);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.task-pill.done .pill-check {
    background: var(--accent);
    border-color: var(--accent);
}

.task-pill.done .pill-text {
    opacity: 0.4;
    text-decoration: line-through;
}

.pill-text { font-weight: 600; font-size: 0.95rem; }

.pill-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.pill-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    opacity: 0;
}

.task-pill:hover .pill-delete { opacity: 1; }
.pill-delete:hover { color: var(--danger); background: rgba(248, 113, 113, 0.1); }

/* ── Add Task Card ── */
.add-task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    padding: 1rem;
    margin: 0 1.25rem 1rem;
}

.add-task-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.add-task-grid { display: grid; gap: 0.65rem; }

.task-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.9rem;
    outline: none;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.task-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-textarea { min-height: 72px; resize: vertical; }
.add-task-btn { width: 100%; justify-content: center; }

/* ── Sprint Stats ── */
.sprint-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    padding: 1.25rem;
    margin: 0 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    animation: fadeUp 0.4s ease;
}

.sprint-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sprint-val { font-size: 1.8rem; font-weight: 900; }

.sprint-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.sprint-divider {
    width: 1px;
    height: 40px;
    background: var(--border-dim);
}

/* ── Settings & Profile ── */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.65rem 0;
}

.settings-row + .settings-row { border-top: 1px solid var(--border-dim); }

.settings-label { font-weight: 700; font-size: 0.92rem; }

.settings-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.settings-action { width: auto; white-space: nowrap; }

/* ── Personality Mode Selector ── */
.personality-selector {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.personality-pill {
    flex: 1;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-dim);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.personality-pill:hover { background: var(--accent-soft); }

.personality-pill.active {
    background: var(--accent-soft);
    border-color: var(--border-glow);
    color: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
}

.personality-pill .pill-emoji {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

/* ── Profile Card ── */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    padding: 1rem;
}

.profile-status {
    min-height: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.profile-info-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.profile-info-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-info-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   CHAT UI
   ══════════════════════════════════════════════════════════ */
.chat-container {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0;
    bottom: 70px;
    background: var(--bg-deep);
    z-index: 1500;
}

.chat-head {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(14, 14, 20, 0.9);
    backdrop-filter: blur(12px);
}

.ai-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.8rem;
    color: white;
    box-shadow: 0 0 18px var(--accent-glow);
    position: relative;
}

.ai-avatar::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    background: var(--success);
    border-radius: 50%;
    bottom: 1px; right: 1px;
    border: 2px solid var(--bg-deep);
}

.chat-head-title { font-weight: 800; font-size: 1.05rem; }

.chat-head-sub {
    font-size: 0.6rem;
    color: var(--success);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.info-btn {
    background: none;
    border: 1px solid #333;
    color: #888;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.info-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* ── Chat Log ── */
.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: none;
}

.chat-log::-webkit-scrollbar { display: none; }

.msg-wrap-ai {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 88%;
    animation: fadeUp 0.3s ease;
}

.msg-ai {
    background: transparent;
    padding: 0;
    border-radius: 0;
    line-height: 1.55;
    font-size: 0.95rem;
    border: none;
    white-space: pre-wrap;
}

.msg-wrap-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    align-self: flex-end;
    max-width: 85%;
    animation: fadeUp 0.3s ease;
}

.msg-user {
    background: var(--accent-soft);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 18px 18px 4px 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
    border: 1px solid var(--border-glow);
}

.msg-time {
    font-size: 0.6rem;
    color: #555;
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ── HITL Approval Card ── */
.hitl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    max-width: 88%;
    margin-top: 0.5rem;
    animation: scaleIn 0.3s ease;
}

.hitl-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warning);
    margin-bottom: 0.75rem;
}

.hitl-badge::before { content: '🤝'; font-size: 0.85rem; }

.hitl-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.hitl-tasks { display: grid; gap: 6px; margin-bottom: 1rem; }

.hitl-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.hitl-task-icon { color: var(--accent-light); flex-shrink: 0; }

.hitl-actions {
    display: flex;
    gap: 8px;
}

.hitl-approve {
    flex: 1;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hitl-approve:hover { background: #5b54e6; transform: translateY(-1px); }

.hitl-reject {
    flex: 1;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-dim);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hitl-reject:hover { border-color: var(--danger); color: var(--danger); }

.hitl-card.resolved {
    opacity: 0.5;
    pointer-events: none;
}

.hitl-card.resolved .hitl-actions { display: none; }

.hitl-resolved-msg {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.hitl-resolved-msg.approved {
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

.hitl-resolved-msg.rejected {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

/* ── Insight Card ── */
.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    padding: 1.15rem 1.25rem;
    max-width: 88%;
    margin-top: 0.25rem;
    animation: scaleIn 0.3s ease;
}

.insight-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 0.75rem;
}

.insight-badge::before { content: '💡'; font-size: 0.75rem; }

.insight-text {
    font-size: 0.9rem;
    font-style: italic;
    color: #bbb;
    line-height: 1.55;
}

/* ── Action Card ── */
.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    max-width: 88%;
    margin-top: 0.25rem;
    animation: scaleIn 0.3s ease;
}

.action-card-text {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dim);
    border-radius: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.action-row:hover { background: rgba(255, 255, 255, 0.06); }

.action-cmd {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--accent-light);
    font-size: 0.85rem;
    font-weight: 600;
}

.action-label {
    color: #bbb;
    font-size: 0.85rem;
    margin-left: 8px;
}

/* ── Chat Footer ── */
.chat-foot {
    padding: 1rem 1.25rem;
    background: var(--bg-deep);
    border-top: 1px solid var(--border-dim);
}

.quick-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.quick-tags::-webkit-scrollbar { display: none; }

.quick-tag {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    color: #bbb;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.quick-tag:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    color: var(--accent-light);
}

.chat-row {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: 30px;
    padding: 5px 5px 5px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color var(--transition-fast);
}

.chat-row:focus-within { border-color: var(--accent); }

.chat-row input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 8px 0;
}

.chat-row input::placeholder { color: var(--text-muted); }

.plus-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid #444;
    background: none;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.plus-btn:hover { border-color: var(--accent); }

.send-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.send-btn:hover { background: #5b54e6; }
.send-btn:active { transform: scale(0.9); }

/* ── Typing Dots ── */
.dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-light);
    animation: blink 1.4s infinite;
}

/* ── FAB ── */
.fab-mentor {
    position: fixed;
    bottom: 82px;
    right: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 35px var(--accent-glow);
    cursor: pointer;
    z-index: 2000;
    transition: all var(--transition-spring);
}

.fab-mentor:hover { transform: scale(1.08); }
.fab-mentor:active { transform: scale(0.92); }
.fab-mentor span { display: none; }
.fab-mentor.hidden { display: none !important; }

/* ── Navigation Bar ── */
.nav-bar {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 70px;
    background: rgba(8, 8, 12, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-btn.active { color: var(--accent); }

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--transition-smooth);
}

.nav-btn.active::after { width: 20px; }

.nav-btn span {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── View Sections ── */
.view-section {
    display: none;
    flex-direction: column;
    min-height: 100%;
    padding-top: 0.5rem;
}

.view-section.active {
    display: flex;
    animation: fadeUp 0.3s ease;
}

/* ── Light Theme Overrides ── */
body.light-theme .nav-bar { background: rgba(255, 255, 255, 0.95); }
body.light-theme .nav-btn { color: #7b8190; }
body.light-theme .chat-head { background: rgba(245, 247, 255, 0.95); }
body.light-theme .chat-foot { background: #f5f7ff; }

body.light-theme .chat-row,
body.light-theme .task-input,
body.light-theme .msg-ai,
body.light-theme .insight-card,
body.light-theme .action-card,
body.light-theme .hitl-card,
body.light-theme .quick-tag {
    background: #ffffff;
    color: #111827;
    border-color: rgba(15, 23, 42, 0.12);
}

body.light-theme .msg-user {
    background: rgba(91, 91, 214, 0.1);
    border-color: rgba(91, 91, 214, 0.2);
}

body.light-theme .msg-time,
body.light-theme .action-label { color: #6b7280; }

body.light-theme .info-btn {
    border-color: rgba(15, 23, 42, 0.2);
    color: #6b7280;
}

body.light-theme .ambient-glow {
    background: radial-gradient(circle, rgba(108, 99, 255, 0.1) 0%, transparent 70%);
}

body.light-theme .form-input {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .login-card {
    background: rgba(255, 255, 255, 0.8);
}

/* ── Desktop ── */
@media (min-width: 800px) {
    .content-area {
        max-width: 500px;
        margin: 0 auto;
    }

    .app-shell { flex-direction: row; }

    .nav-bar {
        position: static;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding: 2.5rem 1rem;
        border-top: none;
        border-right: 1px solid var(--border-dim);
    }

    .nav-btn {
        width: 100%;
        flex-direction: row;
        gap: 1rem;
        padding: 14px 20px;
        border-radius: 14px;
    }

    .nav-btn.active { background: var(--accent-soft); }
    .nav-btn::after { display: none; }
    .nav-btn span { font-size: 0.9rem; text-transform: none; }

    .fab-mentor {
        width: auto;
        height: auto;
        padding: 14px 24px;
        border-radius: 40px;
        justify-content: flex-start;
        gap: 10px;
        right: 2rem;
        bottom: 90px;
    }

    .fab-mentor span {
        display: inline;
        font-weight: 800;
        font-size: 0.95rem;
    }

    .login-card { max-width: 440px; }
}
