/* ================================================================
   NeuroPISA Lab — Main CSS
   Design: Deep space neural theme with glassmorphism
   ================================================================ */

/* ---- Custom Properties ---- */
:root {
    --color-bg:        #0a0e27;
    --color-bg2:       #0f1435;
    --color-card:      rgba(255,255,255,0.05);
    --color-card-border: rgba(255,255,255,0.1);
    --color-accent:    #6c63ff;
    --color-accent2:   #00d4ff;
    --color-success:   #00ff9d;
    --color-warning:   #ffd700;
    --color-danger:    #ff4757;
    --color-text:      #e8eaf6;
    --color-muted:     #8892b0;
    --color-high:      #00ff9d;
    --color-med:       #ffd700;
    --color-low:       #ff4757;
    --radius:          16px;
    --radius-sm:       8px;
    --shadow:          0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow:     0 0 30px rgba(108,99,255,0.3);
    --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main:       'Inter', sans-serif;
    --font-display:    'Rubik', sans-serif;
    --nav-height:      64px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--color-accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Courier New', monospace; font-size: 0.85em; background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; }

/* ---- Background ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(108,99,255,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(0,212,255,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(15,20,53,0.8) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Navbar ---- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(10,14,39,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    transition: var(--transition);
}
.navbar.scrolled { background: rgba(10,14,39,0.98); }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { font-size: 24px; }
.nav-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--color-text);
    letter-spacing: -0.5px;
}
.nav-title .accent { color: var(--color-accent); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}
.nav-link:hover, .nav-link.active {
    color: var(--color-text);
    background: rgba(108,99,255,0.15);
}
.nav-link.active { color: var(--color-accent); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 16px; }
.nav-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.nav-name { font-size: 14px; color: var(--color-muted); }

/* ---- Main Content ---- */
.main-content {
    padding-top: calc(var(--nav-height) + 20px);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), #5a52e0);
    color: white;
    box-shadow: 0 4px 15px rgba(108,99,255,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(108,99,255,0.6); color: white; text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}
.btn-outline:hover { background: rgba(108,99,255,0.1); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--color-muted);
    border: 1px solid var(--color-card-border);
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-card); text-decoration: none; }
.btn-success {
    background: linear-gradient(135deg, #00c87a, #00ff9d);
    color: #0a0e27;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,255,157,0.3);
}
.btn-success:hover { box-shadow: 0 6px 25px rgba(0,255,157,0.5); text-decoration: none; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-danger:hover { background: #ff6b7a; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-large { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- Cards ---- */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { border-color: rgba(108,99,255,0.3); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-card-border);
}
.card-title { font-size: 16px; font-weight: 600; color: var(--color-text); }
.card-badge {
    font-size: 11px;
    background: rgba(108,99,255,0.2);
    color: var(--color-accent);
    padding: 3px 8px;
    border-radius: 20px;
}
.card-body { padding: 20px 24px; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(0,255,157,0.1); border: 1px solid rgba(0,255,157,0.3); color: var(--color-success); }
.alert-error   { background: rgba(255,71,87,0.1);  border: 1px solid rgba(255,71,87,0.3);  color: var(--color-danger); }
.alert-warning { background: rgba(255,215,0,0.1);  border: 1px solid rgba(255,215,0,0.3);  color: var(--color-warning); }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--color-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .answer-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 15px;
    padding: 12px 16px;
    transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus, .answer-textarea:focus {
    border-color: var(--color-accent);
    background: rgba(108,99,255,0.08);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-select { cursor: pointer; }
.form-select option { background: var(--color-bg2); }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.input-wrapper .form-input { padding-left: 44px; }
.toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; }

/* ---- Login Page ---- */
.login-body {
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}
.bg-particles { position: fixed; inset: 0; pointer-events: none; }
.particle {
    position: absolute;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0.15;
    animation: floatParticle linear infinite;
}
@keyframes floatParticle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.15; }
    90%  { opacity: 0.15; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}
.login-container { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 20px; }
.login-card {
    background: rgba(15,20,53,0.8);
    border: 1px solid rgba(108,99,255,0.3);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(30px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(108,99,255,0.1);
    animation: slideUp 0.5s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-logo-icon { font-size: 48px; filter: drop-shadow(0 0 15px rgba(108,99,255,0.6)); }
.login-app-name { display: block; font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.login-app-name .accent { color: var(--color-accent); }
.login-app-sub { display: block; font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.login-form { margin-top: 8px; }
.login-hints {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-card-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hint-item { font-size: 12px; color: var(--color-muted); }
.hint-role { font-weight: 600; margin-right: 4px; }

/* ---- Calendar Page ---- */
.calendar-page { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }
.calendar-hero {
    text-align: center;
    padding: 40px 20px 30px;
}
.calendar-welcome { font-size: 16px; color: var(--color-muted); margin-bottom: 12px; }
.welcome-emoji { margin-right: 6px; }
.calendar-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-text), var(--color-accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.calendar-subtitle { font-size: 16px; color: var(--color-muted); margin-bottom: 28px; }

.overall-progress { max-width: 500px; margin: 0 auto 20px; }
.progress-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-muted); margin-bottom: 8px; }
.progress-track {
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.progress-glow {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 20px;
    background: white;
    opacity: 0.4;
    filter: blur(4px);
    border-radius: 6px;
}
.progress-pct { text-align: right; font-size: 12px; color: var(--color-accent2); margin-top: 4px; }

.attempt-banner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    margin-top: 16px;
}
.attempt-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.attempt-tab {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-muted);
    border: 1px solid var(--color-card-border);
    transition: var(--transition);
    text-decoration: none;
}
.attempt-tab:hover, .attempt-tab.active {
    background: rgba(108,99,255,0.2);
    color: var(--color-accent);
    border-color: var(--color-accent);
    text-decoration: none;
}

/* ---- Calendar Grid ---- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}
@media (max-width: 900px) { .calendar-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .calendar-grid { grid-template-columns: repeat(3, 1fr); } }

.day-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: default;
    transition: var(--transition);
    min-height: 160px;
}
.day-card.day-available, .day-card.day25-unlocked {
    cursor: pointer;
    border: 1px solid rgba(108,99,255,0.2);
    background: rgba(15,20,53,0.8);
}
.day-card.day-available:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: 0 12px 40px rgba(108,99,255,0.3);
}
.day-card.day-completed {
    border: 1px solid rgba(0,255,157,0.3);
    background: rgba(0,255,157,0.05);
    cursor: pointer;
}
.day-card.day-completed:hover { transform: translateY(-4px); }
.day-card.day-locked {
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    opacity: 0.5;
}
.day-card.day25-card { border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.05); }
.day-card.day25-unlocked:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 12px 40px rgba(255,215,0,0.3); }
.day-card-inner { padding: 18px; position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; gap: 6px; }
.day-status-icon { font-size: 22px; }
.status-completed { color: var(--color-success); font-size: 20px; font-weight: 700; }
.status-locked { opacity: 0.5; font-size: 18px; }
.day-number { font-size: 13px; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.day-skill { font-size: 11px; color: var(--color-accent2); font-weight: 500; }
.day-title-short { font-size: 12px; color: var(--color-muted); line-height: 1.4; flex: 1; }
.day-completed-label { font-size: 11px; color: var(--color-success); font-weight: 600; }
.day-locked-label { font-size: 11px; color: var(--color-muted); opacity: 0.7; }
.day-start-label { font-size: 12px; color: var(--color-accent); font-weight: 600; }
.day-card-glow {
    position: absolute;
    bottom: -20px; right: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108,99,255,0.15), transparent);
    transition: var(--transition);
}
.day-card:hover .day-card-glow { width: 120px; height: 120px; }
.day25-glow { background: radial-gradient(circle, rgba(255,215,0,0.15), transparent); }

/* ---- Skill Legend ---- */
.skill-legend {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    padding: 24px;
}
.legend-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.legend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 700px) { .legend-grid { grid-template-columns: repeat(2, 1fr); } }
.legend-item { font-size: 13px; color: var(--color-muted); display: flex; align-items: center; gap: 8px; }

/* ---- Day Workflow Page ---- */
.day-page { max-width: 820px; margin: 0 auto; padding: 0 24px 80px; }
.day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.day-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-muted); }
.breadcrumb-skill-icon { font-size: 18px; }
.breadcrumb-skill { color: var(--color-accent2); font-weight: 500; }
.breadcrumb-sep { opacity: 0.4; }
.day-progress-steps { display: flex; align-items: center; gap: 4px; }
.step {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: var(--color-muted);
    transition: var(--transition);
}
.step.step-active { border-color: var(--color-accent); color: var(--color-accent); background: rgba(108,99,255,0.15); }
.step.step-done { border-color: var(--color-success); color: var(--color-success); background: rgba(0,255,157,0.1); }
.step-line { width: 20px; height: 2px; background: rgba(255,255,255,0.1); }

.day-header { text-align: center; margin-bottom: 32px; }
.day-num-badge {
    display: inline-block;
    background: rgba(108,99,255,0.2);
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.day-title { font-family: var(--font-display); font-size: clamp(20px,4vw,32px); font-weight: 700; margin-bottom: 12px; }
.day-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.day-skill-badge {
    background: rgba(0,212,255,0.1);
    color: var(--color-accent2);
    border: 1px solid rgba(0,212,255,0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.attempt-badge {
    background: rgba(255,215,0,0.1);
    color: var(--color-warning);
    border: 1px solid rgba(255,215,0,0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* Day Sections */
.day-section { margin-bottom: 32px; }
.day-section.hidden { display: none; }
.section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-number {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 900;
    color: rgba(108,99,255,0.3);
    line-height: 1;
    min-width: 60px;
}
.section-title { font-size: 20px; font-weight: 700; }

//* ── Unified Window (new 3-phase layout) ── */
.unified-window {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}
.unified-window:hover { border-color: rgba(108,99,255,0.2); }

.window-section { padding: 24px 28px; }
.window-section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ws-num { font-size: 18px; }
.window-divider {
    height: 1px;
    background: var(--color-card-border);
    margin: 0;
}

/* ── Reading text ── */
.text-content-wrap { position: relative; }
.text-content {
    font-size: 15px;
    line-height: 1.85;
    color: var(--color-text);
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
    transition: max-height 0.5s ease;
    white-space: pre-wrap;
}
.text-content.collapsed {
    max-height: 110px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.text-toggle {
    margin-top: 10px;
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    transition: var(--transition);
}
.text-toggle:hover { color: var(--color-accent2); }

/* ── Task + answer blocks ── */
.task-answer-block { margin-bottom: 4px; }
.task-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent2);
    line-height: 1.5;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: rgba(0,212,255,0.06);
    border-left: 3px solid var(--color-accent2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.task-separator { height: 1px; background: rgba(255,255,255,0.04); margin: 16px 0; }

.answer-textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.7;
    padding: 12px 14px;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}
.answer-textarea:focus {
    border-color: var(--color-accent);
    background: rgba(108,99,255,0.06);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.answer-textarea[readonly] {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.06);
    color: var(--color-muted);
    cursor: default;
    resize: none;
}
.final-textarea { min-height: 160px; }
.textarea-footer {
    display: flex;
    justify-content: flex-end;
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 6px;
    gap: 4px;
}
.char-count.near-limit { color: var(--color-warning); }

/* Phase 1 submit button */
.phase1-actions { margin-top: 24px; display: flex; justify-content: flex-end; }
.btn-submit-initial { min-width: 220px; }

/* ── AI Section (Phase 2) ── */
.ai-section { overflow: hidden; }
.ai-section.hidden { display: none; }
.ai-reveal-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 28px;
}
.ai-reveal-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(108,99,255,0.4), transparent); }
.ai-reveal-badge {
    background: rgba(108,99,255,0.15);
    border: 1px solid rgba(108,99,255,0.3);
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Recap of submitted answers */
.your-answers-recap {
    margin: 0 28px 20px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.recap-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.recap-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.recap-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.recap-q { font-size: 12px; color: var(--color-accent2); font-weight: 600; margin-bottom: 5px; }
.recap-a { font-size: 13px; color: var(--color-text); line-height: 1.6; }

/* AI prompt card */
.ai-prompt-card {
    margin: 0 28px 20px;
    background: rgba(108,99,255,0.04);
    border: 1px solid rgba(108,99,255,0.2);
    border-radius: var(--radius);
    padding: 20px;
}
.ai-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.ai-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.ai-title { font-weight: 700; font-size: 14px; color: var(--color-text); }
.ai-subtitle { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.copy-btn { margin-left: auto; flex-shrink: 0; }
.ai-prompt-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text);
    background: rgba(0,0,0,0.25);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    font-style: italic;
    margin-bottom: 12px;
}
.ai-prompt-hint {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.6;
    padding: 10px 14px;
    background: rgba(0,212,255,0.05);
    border-left: 3px solid rgba(0,212,255,0.3);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.ai-prompt-hint strong { color: var(--color-accent2); }

/* Final answer wrapper */
.final-answer-wrap { margin: 0 28px 20px; }
.phase2-actions { display: flex; gap: 12px; justify-content: flex-end; padding: 0 28px 24px; flex-wrap: wrap; }

/* ── Reflection Phase ── */
.reflection-phase { }
.reflection-phase.hidden { display: none; }
.reflection-hint { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; }
.reflection-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.reflection-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}
.reflection-item:hover { background: rgba(108,99,255,0.06); border-color: rgba(108,99,255,0.2); }
.reflection-item:has(.reflect-check:checked) {
    background: rgba(0,255,157,0.05);
    border-color: rgba(0,255,157,0.2);
}
.reflect-check {
    width: 18px; height: 18px;
    accent-color: var(--color-success);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}
.reflect-label { font-size: 14px; line-height: 1.5; }
.reflection-item:has(.reflect-check:checked) .reflect-label { color: var(--color-success); }
.reflection-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ── Completed banner ── */
.completed-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0,255,157,0.07);
    border: 1px solid rgba(0,255,157,0.25);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.completed-icon { font-size: 32px; }
.completed-title { font-weight: 700; color: var(--color-success); font-size: 16px; }
.completed-sub { font-size: 13px; color: var(--color-muted); margin-top: 4px; }

/* Autosave indicator */
.autosave-indicator {
    position: fixed;
    bottom: 24px; right: 24px;
    background: rgba(0,255,157,0.12);
    border: 1px solid rgba(0,255,157,0.35);
    color: var(--color-success);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 50;
    animation: fadeInOut 2.5s ease forwards;
}
@keyframes fadeInOut {
    0%   { opacity: 0; transform: translateY(10px); }
    15%  { opacity: 1; transform: translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}
.btn-next, .btn-complete, .btn-save { min-width: 180px; }

/* ---- Utility ---- */
.text-muted { color: var(--color-muted); font-size: 13px; }
.accent { color: var(--color-accent); }
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--color-muted); padding: 40px; font-size: 14px; }
.back-link { font-size: 13px; color: var(--color-muted); display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--color-accent); }
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.page-subtitle { color: var(--color-muted); font-size: 14px; margin-top: 4px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108,99,255,0.6); }

/* ---- Score Colors ---- */
.level-high { color: var(--color-high); }
.level-med  { color: var(--color-med);  }
.level-low  { color: var(--color-low);  }

/* ---- Copy button ---- */
.copy-btn { margin-left: auto; flex-shrink: 0; }
