/* ==========================================================================
   TAIS Training — Premium Design System
   Winning Mind branded dark theme
   ========================================================================== */

/* --- Design Tokens --- */

:root {
    /* Brand colors */
    --wm-black: #0a0a0a;
    --wm-charcoal: #141414;
    --wm-dark: #1a1a1a;
    --wm-dark-elevated: #222222;
    --wm-dark-surface: #2a2a2a;
    --wm-red: #e63946;
    --wm-red-dark: #c5303c;
    --wm-red-glow: rgba(230, 57, 70, 0.25);

    /* Text hierarchy (white at various opacities) */
    --text-95: rgba(255, 255, 255, 0.95);
    --text-90: rgba(255, 255, 255, 0.92);
    --text-80: rgba(255, 255, 255, 0.80);
    --text-70: rgba(255, 255, 255, 0.75);
    --text-60: rgba(255, 255, 255, 0.60);
    --text-50: rgba(255, 255, 255, 0.55);
    --text-40: rgba(255, 255, 255, 0.50);
    --text-30: rgba(255, 255, 255, 0.40);
    --text-20: rgba(255, 255, 255, 0.35);
    --text-10: rgba(255, 255, 255, 0.10);
    --text-05: rgba(255, 255, 255, 0.05);

    /* Background surfaces (white at low opacities for dark theme) */
    --bg-10: rgba(255, 255, 255, 0.05);
    --bg-20: rgba(255, 255, 255, 0.08);

    /* Semantic colors */
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.15);

    /* Callout accents */
    --accent-orange: #ffbd7a;
    --accent-orange-dim: rgba(255, 189, 122, 0.12);
    --accent-purple: #9e7aff;
    --accent-purple-dim: rgba(158, 122, 255, 0.12);

    /* Scale group colors */
    --group-attention: #e63946;
    --group-attention-dim: rgba(230, 57, 70, 0.12);
    --group-control: #f59e0b;
    --group-control-dim: rgba(245, 158, 11, 0.12);
    --group-interpersonal: #14b8a6;
    --group-interpersonal-dim: rgba(20, 184, 166, 0.12);

    /* Quadrant colors */
    --quadrant-broad-ext: #e63946;
    --quadrant-broad-int: #9e7aff;
    --quadrant-narrow-ext: #14b8a6;
    --quadrant-narrow-int: #f59e0b;

    /* Layout */
    --sidebar-width: 260px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-red: 0 4px 20px rgba(230, 57, 70, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}


/* --- Reset & Base --- */

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-80);
    background: var(--wm-black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--wm-red); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #ff4d5a; }

::selection { background: rgba(230, 57, 70, 0.3); color: white; }

/* Skip to content link (accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--wm-red);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
    color: white;
}

/* Focus visible ring (keyboard navigation) */
*:focus-visible {
    outline: 2px solid var(--wm-red);
    outline-offset: 2px;
}

button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--wm-red);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--wm-red-glow);
}


/* ==========================================================================
   AUTH LAYOUT (Login / Register)
   ========================================================================== */

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wm-black);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(230, 57, 70, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(230, 57, 70, 0.05) 0%, transparent 50%);
}

.auth-card {
    background: var(--wm-dark-elevated);
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--text-10);
}

.auth-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-95);
    margin-bottom: var(--space-1);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-40);
    margin-bottom: var(--space-8);
    font-size: 0.875rem;
}

.auth-brand-tagline {
    text-align: center;
    color: var(--wm-red);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-6);
}

.auth-switch {
    text-align: center;
    margin-top: var(--space-6);
    color: var(--text-40);
    font-size: 0.875rem;
}

.auth-switch a { color: var(--wm-red); font-weight: 500; }
.auth-switch a:hover { color: #ff4d5a; }


/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-60);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--wm-dark-surface);
    color: var(--text-95);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input::placeholder { color: rgba(255,255,255,0.50); }

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--wm-red);
    box-shadow: 0 0 0 3px var(--wm-red-glow);
}

.form-group select,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--wm-dark-surface);
    color: var(--text-95);
    appearance: none;
    cursor: pointer;
}


/* ==========================================================================
   TRACK SELECTION (Registration)
   ========================================================================== */

.track-selection {
    margin: var(--space-6) 0;
    padding: var(--space-5) var(--space-4);
    border: 2px solid var(--wm-red);
    border-radius: var(--radius-lg);
    background: rgba(230, 57, 70, 0.04);
}

.track-selection-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-1);
    text-align: center;
}

.track-selection-hint {
    font-size: 0.8rem;
    color: var(--text-40);
    text-align: center;
    margin-bottom: var(--space-4);
}

.track-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.track-option {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.track-option:hover {
    border-color: var(--text-30);
}

.track-option--selected,
.track-option:has(input:checked) {
    border-color: var(--wm-red);
    background: rgba(230, 57, 70, 0.08);
}

.track-option input[type="radio"] {
    display: none;
}

.track-option-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-95);
}

.track-option-subtitle {
    font-size: 0.78rem;
    color: var(--text-40);
    margin-top: 2px;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--wm-red);
    color: white;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    background: var(--wm-red-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-red);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
    background: var(--wm-dark-surface);
    color: var(--text-80);
    border: 1px solid var(--text-10);
}

.btn-secondary:hover {
    background: var(--text-10);
    color: var(--text-95);
    border-color: var(--text-20);
}

.btn-full { width: 100%; }
.btn-lg { padding: 0.875rem 2.5rem; font-size: 1.0625rem; }


/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: 0.875rem;
}

.alert-error {
    background: var(--danger-dim);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}


/* ==========================================================================
   APP LAYOUT
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}


/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--wm-black);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid var(--text-05);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--text-10);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-95);
    letter-spacing: -0.02em;
}

.sidebar-header .subtitle {
    font-size: 0.6875rem;
    color: var(--wm-red);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    padding: var(--space-3) 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem var(--space-6);
    color: var(--text-60);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-links li a:hover {
    background: var(--text-05);
    color: var(--text-95);
    border-left-color: var(--text-20);
}

.nav-links li a.active {
    background: rgba(230, 57, 70, 0.1);
    color: var(--wm-red);
    border-left-color: var(--wm-red);
    font-weight: 600;
}

.nav-links li a.status-locked { opacity: 0.3; pointer-events: none; }
.nav-links li a.status-completed { color: var(--success); }
.nav-links li a.status-completed:hover { color: var(--text-95); }

.module-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-10);
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--text-60);
}

.status-completed .module-num { background: var(--success); color: white; }
.active .module-num { background: var(--wm-red); color: white; }

.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--text-10);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 0.8125rem;
}

.sidebar-footer .user-name { flex: 1; color: var(--text-40); font-weight: 500; }
.sidebar-footer a { color: var(--text-20); text-decoration: none; font-weight: 500; }
.sidebar-footer a:hover { color: var(--wm-red); }


/* ==========================================================================
   HAMBURGER MENU (Mobile)
   ========================================================================== */

.hamburger {
    display: none;
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 200;
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-80);
    border-radius: 1px;
    transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active { display: block; }


/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-10) var(--space-12);
    max-width: 1000px;
    min-height: 100vh;
    animation: fadeInUp 0.4s ease;
}


/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
    margin-bottom: var(--space-8);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-95);
    margin-bottom: var(--space-1);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-40);
    font-size: 0.9375rem;
}


/* ==========================================================================
   PROGRESS BAR (Global)
   ========================================================================== */

.progress-bar-container {
    margin-bottom: var(--space-8);
}

.progress-bar {
    height: 6px;
    background: var(--text-10);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wm-red), #ff6b6b);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.4);
}

.progress-label {
    font-size: 0.8125rem;
    color: var(--text-40);
}


/* ==========================================================================
   DASHBOARD — Hero Section
   ========================================================================== */

.dashboard-hero {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
    padding: var(--space-10);
    background: var(--wm-dark-elevated);
    border-radius: var(--radius-xl);
    border: 1px solid var(--text-05);
}

.dashboard-hero-text {
    flex: 1;
}

.dashboard-hero-text h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-95);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

.dashboard-hero-text .hero-subtitle {
    color: var(--text-40);
    font-size: 1rem;
    margin-bottom: var(--space-6);
}

.dashboard-stats {
    display: flex;
    gap: var(--space-6);
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-95);
}

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

/* SVG Progress Ring */
.progress-ring-container {
    flex-shrink: 0;
}

.progress-ring-text {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    fill: var(--text-95);
}

.progress-ring-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    fill: var(--text-40);
}


/* ==========================================================================
   DASHBOARD — Continue CTA
   ========================================================================== */

.continue-cta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-6);
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--wm-red);
}

.btn-continue {
    white-space: nowrap;
}

.continue-label {
    font-size: 0.8125rem;
    color: var(--text-40);
}


/* ==========================================================================
   DASHBOARD — Certificate Banner
   ========================================================================== */

.certificate-banner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1), rgba(230, 57, 70, 0.04));
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: var(--radius-lg);
}

.cert-icon {
    font-size: 2rem;
    line-height: 1;
}

.cert-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.cert-text strong {
    font-size: 1rem;
    color: var(--text-95);
}

.cert-text span {
    font-size: 0.8125rem;
    color: var(--text-40);
}


/* ==========================================================================
   DASHBOARD — Module Grid
   ========================================================================== */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.module-card {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--text-10);
    transition: background var(--transition-base);
}

.module-card:hover {
    border-color: var(--text-10);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Gradient top borders by status */
.module-card.status-available::before,
.module-card.status-in_progress::before {
    background: linear-gradient(90deg, var(--wm-red), #ff6b6b);
}

.module-card.status-completed::before {
    background: linear-gradient(90deg, var(--success), #4ade80);
}

.module-card.status-locked {
    opacity: 0.4;
    animation: fadeInUp 0.4s ease forwards;
}

.module-card.status-locked:hover { transform: none; box-shadow: none; }

/* Staggered entrance animation */
.module-card:nth-child(1) { animation-delay: 0ms; }
.module-card:nth-child(2) { animation-delay: 80ms; }
.module-card:nth-child(3) { animation-delay: 160ms; }
.module-card:nth-child(4) { animation-delay: 240ms; }
.module-card:nth-child(5) { animation-delay: 320ms; }

/* Module number watermark */
.module-card-watermark {
    position: absolute;
    top: -10px;
    right: -5px;
    font-size: 6rem;
    font-weight: 900;
    color: var(--text-05);
    line-height: 1;
    pointer-events: none;
}

.module-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.module-number {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-40);
    letter-spacing: 0.05em;
}

.status-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-locked { background: var(--text-05); color: var(--text-20); }
.badge-available { background: rgba(230, 57, 70, 0.15); color: var(--wm-red); }
.badge-in_progress { background: var(--warning-dim); color: var(--warning); }
.badge-completed { background: var(--success-dim); color: var(--success); }

.module-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-2);
}

.module-card p {
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-bottom: var(--space-4);
    line-height: 1.5;
}

.module-card-meta {
    display: flex;
    gap: var(--space-4);
    font-size: 0.6875rem;
    color: var(--text-20);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Mini progress bar inside card */
.card-progress {
    height: 3px;
    background: var(--text-05);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
    overflow: hidden;
}

.card-progress-fill {
    height: 100%;
    background: var(--wm-red);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.quiz-score {
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-bottom: var(--space-4);
}

.locked-message {
    font-size: 0.8125rem;
    color: var(--text-20);
    text-align: center;
    padding: var(--space-3);
}


/* ==========================================================================
   MODULE VIEW
   ========================================================================== */

.module-meta {
    display: flex;
    gap: var(--space-6);
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-top: var(--space-2);
}

.lesson-list {
    margin-bottom: var(--space-8);
}

.lesson-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--text-05);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    text-decoration: none;
    color: var(--text-80);
    transition: all var(--transition-fast);
    background: var(--wm-dark-elevated);
    border-left: 3px solid transparent;
}

.lesson-row:hover {
    background: var(--wm-dark-surface);
    border-color: var(--text-10);
    border-left-color: var(--wm-red);
    color: var(--text-95);
    transform: translateX(4px);
}

.lesson-row.completed { border-left-color: var(--success); }
.lesson-row.completed:hover { border-left-color: var(--success); }

.lesson-check {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    color: var(--text-20);
}

.lesson-row.completed .lesson-check { color: var(--success); }

.module-quiz-section {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-4);
}

.module-quiz-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-2);
}

.module-quiz-section p {
    color: var(--text-60);
    font-size: 0.9375rem;
    margin-bottom: var(--space-4);
}


/* ==========================================================================
   LESSON VIEW
   ========================================================================== */

/* Breadcrumb */
.lesson-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-bottom: var(--space-6);
}

.lesson-breadcrumb a {
    color: var(--text-40);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.lesson-breadcrumb a:hover { color: var(--wm-red); }
.lesson-breadcrumb .separator { color: var(--text-20); }
.lesson-breadcrumb .current { color: var(--text-60); }

/* Reading progress bar (top of viewport) */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wm-red), #ff6b6b);
    z-index: 1000;
    transition: width 0.1s linear;
}

/* Lesson meta row */
.lesson-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.8125rem;
    color: var(--text-40);
}

.lesson-meta .read-time {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* Lesson progress dots */
.lesson-dots {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.lesson-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-10);
    transition: all var(--transition-fast);
}

.lesson-dot.completed { background: var(--success); }
.lesson-dot.current { background: var(--wm-red); box-shadow: 0 0 6px var(--wm-red-glow); }

/* Legacy back link (keep for compatibility) */
.lesson-nav-top { margin-bottom: var(--space-6); }

.back-link {
    color: var(--text-40);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.back-link:hover { color: var(--wm-red); }

/* Lesson content (reading experience) */
.lesson-content {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    margin-bottom: var(--space-6);
    max-width: 780px;
}

.lesson-content h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-95);
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.lesson-content h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-95);
    margin: var(--space-8) 0 var(--space-4);
    letter-spacing: -0.01em;
}

.lesson-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-95);
    margin: var(--space-6) 0 var(--space-3);
}

.lesson-content p {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-80);
    margin-bottom: var(--space-5);
}

.lesson-content ul, .lesson-content ol {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.0625rem;
    line-height: 1.85;
    margin: var(--space-2) 0 var(--space-5) var(--space-6);
    color: var(--text-80);
}

.lesson-content li { margin-bottom: var(--space-2); }

.lesson-content strong { color: var(--text-95); font-weight: 700; }
.lesson-content em { font-style: italic; color: var(--text-80); }

.lesson-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--wm-dark-surface);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--wm-red);
}

.lesson-content pre {
    background: var(--wm-black);
    border: 1px solid var(--text-10);
    color: var(--text-80);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-5);
    font-size: 0.875rem;
}

.lesson-content pre code {
    background: none;
    padding: 0;
    color: var(--text-80);
}

.lesson-content blockquote {
    border-left: 3px solid var(--wm-red);
    padding: var(--space-4) var(--space-5);
    background: var(--wm-dark-surface);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-60);
    margin: var(--space-5) 0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
}

.lesson-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-5) 0;
    display: block;
    overflow-x: auto;
}

.lesson-content th, .lesson-content td {
    border: 1px solid var(--text-10);
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-size: 0.9375rem;
}

.lesson-content th {
    background: var(--wm-dark-surface);
    font-weight: 600;
    color: var(--text-95);
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lesson-content td { color: var(--text-80); }

.lesson-content tr:nth-child(even) td { background: var(--text-05); }


/* --- Callout Blocks --- */

.callout {
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-md);
    margin: var(--space-6) 0;
    border-left: 4px solid;
}

.callout-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-2);
}

.callout p {
    font-size: 0.9375rem !important;
    margin-bottom: 0 !important;
    line-height: 1.7 !important;
}

.callout-coach-note {
    background: var(--accent-purple-dim);
    border-color: var(--accent-purple);
}
.callout-coach-note .callout-title { color: var(--accent-purple); }

.callout-key-insight {
    background: var(--accent-orange-dim);
    border-color: var(--accent-orange);
}
.callout-key-insight .callout-title { color: var(--accent-orange); }

.callout-warning {
    background: var(--danger-dim);
    border-color: var(--danger);
}
.callout-warning .callout-title { color: #fca5a5; }

.callout-exercise {
    background: var(--success-dim);
    border-color: var(--success);
}
.callout-exercise .callout-title { color: var(--success); }


/* Lesson footer */
.lesson-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.completed-badge {
    color: var(--success);
    font-weight: 600;
}

.lesson-nav {
    display: flex;
    gap: var(--space-2);
}

/* Mark complete button pulse on success */
@keyframes greenPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-complete-success {
    background: var(--success) !important;
    animation: greenPulse 0.6s ease;
}


/* ==========================================================================
   QUIZ VIEW
   ========================================================================== */

.quiz-view .page-header { margin-bottom: var(--space-6); }

/* Quiz progress bar (sticky) */
.quiz-progress {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--wm-dark);
    border-bottom: 1px solid var(--text-10);
    padding: var(--space-3) var(--space-5);
    margin: 0 calc(-1 * var(--space-12)) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.quiz-progress-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-60);
    white-space: nowrap;
}

.quiz-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--text-10);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--wm-red);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.quiz-question {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.question-number {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-40);
    letter-spacing: 0.05em;
}

.question-points {
    font-size: 0.6875rem;
    color: var(--text-20);
}

.question-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

/* Multiple choice options */
.mc-options { display: flex; flex-direction: column; gap: var(--space-2); }

.mc-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--wm-dark-surface);
}

.mc-option:hover {
    background: var(--text-05);
    border-color: var(--text-20);
}

.mc-option:has(input:checked) {
    border-color: var(--wm-red);
    background: rgba(230, 57, 70, 0.08);
}

.mc-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--wm-red);
}

.mc-label { font-size: 0.9375rem; color: var(--text-80); }

/* Matching questions */
.matching-instructions {
    font-size: 0.875rem;
    color: var(--text-40);
    margin-bottom: var(--space-3);
}

.matching-grid { display: flex; flex-direction: column; gap: var(--space-2); }

.matching-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.matching-key {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-95);
}

.matching-select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--wm-dark-surface);
    color: var(--text-80);
    transition: border-color var(--transition-fast);
}

.matching-select:focus {
    outline: none;
    border-color: var(--wm-red);
    box-shadow: 0 0 0 2px var(--wm-red-glow);
}

/* Matching card UI (upgraded from dropdowns) */
.matching-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.matching-card-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    color: var(--text-80);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.matching-card-btn:hover {
    border-color: var(--text-20);
    background: var(--text-05);
}

.matching-card-btn.selected {
    border-color: var(--wm-red);
    background: rgba(230, 57, 70, 0.1);
    color: var(--wm-red);
    font-weight: 600;
}

/* Free response */
.free-response-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    background: var(--wm-dark-surface);
    color: var(--text-80);
    transition: border-color var(--transition-fast);
}

.free-response-input:focus {
    outline: none;
    border-color: var(--wm-red);
    box-shadow: 0 0 0 3px var(--wm-red-glow);
}

.free-response-input::placeholder { color: rgba(255,255,255,0.50); }

.quiz-submit {
    text-align: center;
    margin-top: var(--space-6);
}


/* ==========================================================================
   QUIZ RESULTS
   ========================================================================== */

.score-card {
    text-align: center;
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
    border: 1px solid;
}

.score-pass {
    background: var(--success-dim);
    border-color: rgba(34, 197, 94, 0.3);
}

.score-fail {
    background: var(--danger-dim);
    border-color: rgba(239, 68, 68, 0.3);
}

.score-big {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.score-pass .score-big { color: var(--success); }
.score-fail .score-big { color: var(--danger); }

.score-detail {
    font-size: 0.9375rem;
    color: var(--text-40);
    margin-bottom: var(--space-4);
}

.verdict-pass {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.3rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.verdict-fail {
    display: inline-block;
    background: var(--danger);
    color: white;
    padding: 0.3rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-verdict p {
    color: var(--text-60);
    margin-top: var(--space-2);
}

/* Confetti animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Score count-up */
.score-counting { transition: none; }

/* Feedback section */
.feedback-section { margin-bottom: var(--space-8); }
.feedback-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.feedback-item {
    border: 1px solid var(--text-05);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: var(--wm-dark-elevated);
}

.feedback-correct { border-left: 3px solid var(--success); }
.feedback-incorrect { border-left: 3px solid var(--danger); }
.feedback-pending { border-left: 3px solid var(--warning); }

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.feedback-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.feedback-correct .feedback-badge { background: var(--success-dim); color: var(--success); }
.feedback-incorrect .feedback-badge { background: var(--danger-dim); color: #fca5a5; }
.feedback-pending .feedback-badge { background: var(--warning-dim); color: var(--warning); }

.feedback-question {
    font-size: 0.9375rem;
    color: var(--text-80);
    margin-bottom: var(--space-2);
}

.feedback-answer {
    font-size: 0.875rem;
    color: var(--text-60);
    margin-bottom: var(--space-1);
}

.feedback-text {
    font-size: 0.875rem;
    color: var(--text-40);
}

.results-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}


/* ==========================================================================
   SCALE EXPLORER WIDGET
   ========================================================================== */

.se-widget {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.se-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.se-tab {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-60);
    font-family: inherit;
}

.se-tab.active {
    background: var(--wm-red);
    color: white;
    border-color: var(--wm-red);
}

.se-tab:hover:not(.active) {
    background: var(--text-05);
    color: var(--text-80);
}

.se-scale-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--text-05);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.se-scale-row:last-child { border-bottom: none; }

.se-scale-row:hover {
    background: var(--text-05);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-md);
}

.se-scale-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--space-1);
}

.se-scale-key {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.6875rem;
    background: var(--wm-dark-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    color: var(--wm-red);
}

.se-scale-name { font-weight: 600; font-size: 0.875rem; color: var(--text-80); }

.se-slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--space-1);
}

.se-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--text-10);
    border-radius: 2px;
    outline: none;
}

.se-slider:focus-visible {
    outline: 2px solid var(--wm-red, #C4302B);
    outline-offset: 2px;
}

.se-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wm-red);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(230, 57, 70, 0.4);
}

.se-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wm-red);
    cursor: pointer;
    border: none;
}

.se-score-display {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.875rem;
    width: 32px;
    text-align: right;
    color: var(--text-60);
}

.se-range-low { color: var(--text-40); }
.se-range-mod { color: var(--text-60); }
.se-range-high { color: var(--warning); }
.se-range-vhigh { color: var(--wm-red); }

.se-meaning {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-40);
}

.se-meaning .se-low { text-align: left; max-width: 45%; }
.se-meaning .se-high { text-align: right; max-width: 45%; }

.se-detail-card {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-top: var(--space-4);
    animation: fadeInUp 0.2s ease;
}

.se-detail-card h3 { font-size: 1rem; margin-bottom: var(--space-2); color: var(--text-95); }
.se-detail-desc { font-size: 0.875rem; color: var(--text-60); margin-bottom: var(--space-3); }

.se-detail-range {
    display: flex;
    gap: var(--space-2);
    font-size: 0.8125rem;
    margin-bottom: var(--space-1);
    color: var(--text-60);
}

.se-range-label { font-weight: 600; min-width: 90px; color: var(--text-40); }


/* ==========================================================================
   SCALE CARD (Inline in lessons)
   ========================================================================== */

.scale-card {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-4) 0;
    border-left: 3px solid var(--wm-red);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.scale-card:hover {
    background: var(--text-05);
    border-color: var(--text-20);
}

.scale-card.expanded {
    background: var(--wm-dark-elevated);
    border-color: var(--text-20);
}

/* Group-colored borders */
.scale-card-attention { border-left-color: var(--group-attention); }
.scale-card-control { border-left-color: var(--group-control); }
.scale-card-interpersonal { border-left-color: var(--group-interpersonal); }

.scale-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    flex-wrap: wrap;
}

.scale-card-key {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    background: var(--wm-red);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
}

.scale-card-tais-name { font-weight: 700; font-size: 1.05rem; color: var(--text-95); }
.scale-card-name { font-weight: 400; font-size: 0.8rem; color: var(--text-50); }
.scale-card-desc { font-size: 0.875rem; color: var(--text-60); }

/* Group badge (tiny colored pill) */
.group-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
}

.group-badge-attention { background: var(--group-attention-dim); color: var(--group-attention); }
.group-badge-control { background: var(--group-control-dim); color: var(--group-control); }
.group-badge-interpersonal { background: var(--group-interpersonal-dim); color: var(--group-interpersonal); }

/* Pair indicator */
.scale-card-pair-indicator {
    font-size: 0.6875rem;
    color: var(--text-40);
    margin-left: auto;
    font-weight: 500;
}

.scale-card-pair-indicator.shadow { color: var(--danger); }
.scale-card-pair-indicator.capacity { color: var(--success); }

/* Expandable detail */
.scale-card-detail {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--text-10);
    animation: fadeIn 0.2s ease;
}

.scale-card-meaning-row {
    font-size: 0.8125rem;
    color: var(--text-60);
    margin-bottom: var(--space-2);
    line-height: 1.5;
}

.meaning-label {
    font-weight: 600;
    color: var(--text-80);
    display: inline;
}


/* ==========================================================================
   PROFILE VIEWER (Chart.js radar chart)
   ========================================================================== */

.profile-viewer {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.profile-viewer h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.profile-viewer canvas {
    max-height: 400px;
}


/* ==========================================================================
   ATTENTION QUADRANT WIDGET (.aq-*)
   ========================================================================== */

.aq-widget {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.aq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.aq-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-95);
}

.aq-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-full);
    background: var(--wm-dark-surface);
    color: var(--text-60);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.aq-toggle:hover { border-color: var(--text-20); color: var(--text-80); }

.aq-toggle.active {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: #fca5a5;
}

.aq-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-20);
    transition: background var(--transition-fast);
}

.aq-toggle.active .aq-toggle-dot {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.aq-body {
    display: flex;
    gap: var(--space-6);
}

.aq-svg-container {
    flex: 1;
    min-width: 0;
}

.aq-svg {
    width: 100%;
    height: auto;
}

.aq-info-panel {
    width: 320px;
    flex-shrink: 0;
}

.aq-info-placeholder {
    padding: var(--space-10);
    text-align: center;
    color: var(--text-20);
    font-size: 0.875rem;
}

.aq-axis-label {
    fill: rgba(255, 255, 255, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.aq-quad-title {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.aq-scale-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
}

.aq-scale-sublabel {
    fill: rgba(255, 255, 255, 0.4);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
}

.aq-shadow-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.aq-shadow-sublabel {
    fill: rgba(239, 68, 68, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    transition: opacity 0.3s ease;
}

.aq-quad {
    transition: all 0.2s ease;
}

.aq-quad:hover {
    filter: brightness(1.3);
}

.aq-quad-selected {
    stroke-width: 2.5 !important;
    filter: brightness(1.4);
}

.aq-info-card {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    animation: fadeInUp 0.2s ease;
}

.aq-info-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-2);
}

.aq-info-desc {
    font-size: 0.8125rem;
    color: var(--text-60);
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.aq-info-section {
    margin-bottom: var(--space-4);
}

.aq-info-section h5 {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    margin-bottom: var(--space-2);
}

.aq-info-section p {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
}

.aq-examples {
    list-style: none;
    padding: 0;
}

.aq-examples li {
    font-size: 0.8125rem;
    color: var(--text-60);
    padding: var(--space-1) 0;
    padding-left: var(--space-4);
    position: relative;
    line-height: 1.5;
}

.aq-examples li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--text-20);
}

.aq-pressure-section {
    background: var(--danger-dim);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    margin-top: var(--space-3);
}

.aq-info-scales {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.aq-narrow-note {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-30);
    font-style: italic;
    margin-top: var(--space-1);
}

.aq-info-scale {
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.aq-info-scale.capacity { background: var(--success-dim); color: var(--success); }
.aq-info-scale.shadow { background: var(--danger-dim); color: #fca5a5; }


/* ==========================================================================
   SCALE EXPLORER V2 (.se2-*)
   ========================================================================== */

.se2-widget {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.se2-view-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.se2-view-tab {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-60);
    font-family: inherit;
}

.se2-view-tab.active {
    background: var(--wm-red);
    color: white;
    border-color: var(--wm-red);
}

.se2-view-tab:hover:not(.active) {
    background: var(--text-05);
    color: var(--text-80);
}

/* Group accordion */
.se2-group {
    margin-bottom: var(--space-3);
}

.se2-group-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.se2-group-header:hover { background: var(--text-05); }

.se2-group-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.se2-swatch-attention { background: var(--group-attention); }
.se2-swatch-control { background: var(--group-control); }
.se2-swatch-interpersonal { background: var(--group-interpersonal); }

.se2-group-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-95);
    flex: 1;
}

.se2-group-count {
    font-size: 0.6875rem;
    color: var(--text-40);
}

.se2-group-arrow {
    font-size: 0.75rem;
    color: var(--text-40);
}

.se2-group-body {
    padding: var(--space-2) 0 var(--space-2) var(--space-4);
}

/* Scale row */
.se2-scale-row {
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--text-05);
}

.se2-scale-row:last-child { border-bottom: none; }

.se2-scale-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.se2-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.se2-dot-attention { background: var(--group-attention); }
.se2-dot-control { background: var(--group-control); }
.se2-dot-interpersonal { background: var(--group-interpersonal); }

.se2-key {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.6875rem;
    background: var(--wm-dark-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    color: var(--wm-red);
}

.se2-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-80);
}

.se2-pair-badge {
    font-size: 0.625rem;
    font-weight: 600;
    margin-left: auto;
}

.se2-pair-badge.shadow { color: var(--danger); }
.se2-pair-badge.capacity { color: var(--success); }

.se2-expand-arrow {
    font-size: 0.6875rem;
    color: var(--text-40);
    padding: var(--space-1);
}

.se2-slider-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
}

.se2-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--text-10);
    border-radius: 2px;
    outline: none;
}

.se2-slider:focus-visible {
    outline: 2px solid var(--wm-red, #C4302B);
    outline-offset: 2px;
}

.se2-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wm-red);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(230, 57, 70, 0.4);
}

.se2-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wm-red);
    cursor: pointer;
    border: none;
}

/* Group-colored slider thumbs */
.se2-slider-attention::-webkit-slider-thumb { background: var(--group-attention); box-shadow: 0 0 6px rgba(230, 57, 70, 0.4); }
.se2-slider-control::-webkit-slider-thumb { background: var(--group-control); box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.se2-slider-interpersonal::-webkit-slider-thumb { background: var(--group-interpersonal); box-shadow: 0 0 6px rgba(20, 184, 166, 0.4); }

.se2-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.875rem;
    width: 32px;
    text-align: right;
}

.se2-range-low { color: var(--text-40); }
.se2-range-mod { color: var(--text-60); }
.se2-range-high { color: var(--warning); }
.se2-range-vhigh { color: var(--wm-red); }

.se2-interpretation {
    font-size: 0.75rem;
    color: var(--text-40);
    line-height: 1.5;
    margin-top: var(--space-1);
    transition: all var(--transition-fast);
}

.se2-expanded-detail {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--text-10);
    animation: fadeIn 0.2s ease;
}

.se2-detail-desc {
    font-size: 0.8125rem;
    color: var(--text-60);
    margin-bottom: var(--space-3);
    line-height: 1.6;
}

.se2-detail-meanings {
    font-size: 0.8125rem;
    color: var(--text-60);
}

.se2-detail-meanings > div { margin-bottom: var(--space-1); }

.se2-meaning-label {
    font-weight: 600;
    color: var(--text-80);
}

/* Oppositional Pairs view */
.se2-pairs-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.se2-pair-card {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.se2-pair-label {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-95);
    margin-bottom: var(--space-3);
    text-align: center;
}

.se2-pair-sides {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.se2-pair-side {
    flex: 1;
}

.se2-pair-side .se2-pair-key {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
}

.se2-pair-side.capacity .se2-pair-key { color: var(--success); }
.se2-pair-side.shadow .se2-pair-key { color: var(--danger); }

.se2-pair-side .se2-pair-name {
    font-size: 0.75rem;
    color: var(--text-40);
    display: block;
    margin-bottom: var(--space-1);
}

.se2-pair-tension {
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.se2-tension-bar {
    height: 6px;
    background: var(--text-10);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-1);
}

.se2-tension-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-base);
}

.se2-pair-tension.resilient .se2-tension-fill { background: var(--success); }
.se2-pair-tension.moderate .se2-tension-fill { background: var(--warning); }
.se2-pair-tension.vulnerable .se2-tension-fill { background: var(--danger); }
.se2-pair-tension.inverted .se2-tension-fill { background: #dc2626; }

.se2-tension-label {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.se2-pair-tension.resilient .se2-tension-label { color: var(--success); }
.se2-pair-tension.moderate .se2-tension-label { color: var(--warning); }
.se2-pair-tension.vulnerable .se2-tension-label { color: var(--danger); }
.se2-pair-tension.inverted .se2-tension-label { color: #fca5a5; }

.se2-pair-explanation {
    font-size: 0.75rem;
    color: var(--text-40);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--text-05);
    line-height: 1.5;
}

/* All Scales view */
.se2-search-bar {
    margin-bottom: var(--space-4);
}

.se2-search {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    color: var(--text-80);
    font-size: 0.875rem;
    font-family: inherit;
}

.se2-search::placeholder { color: rgba(255,255,255,0.50); }
.se2-search:focus { outline: none; border-color: var(--wm-red); box-shadow: 0 0 0 2px var(--wm-red-glow); }

.se2-all-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    flex-wrap: wrap;
}

.se2-all-row:hover { background: var(--text-05); }

.se2-all-detail {
    width: 100%;
    margin-top: var(--space-2);
    padding: var(--space-3);
    background: var(--wm-dark-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--text-10);
    animation: fadeIn 0.2s ease;
}

.se2-all-detail p {
    font-size: 0.8125rem;
    color: var(--text-60);
    margin-bottom: var(--space-2);
    line-height: 1.5;
}


/* ==========================================================================
   EXERCISES (.ex-*)
   ========================================================================== */

.ex-widget {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.ex-header h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-1);
}

.ex-instructions {
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-bottom: var(--space-5);
}

.ex-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.ex-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-95);
}

/* Match exercise */
.ex-match-layout {
    display: flex;
    gap: var(--space-5);
}

.ex-match-keys {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 80px;
}

.ex-key-btn {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    color: var(--text-80);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ex-key-btn:hover { border-color: var(--wm-red); color: var(--text-95); }
.ex-key-btn.selected { background: var(--wm-red); color: white; border-color: var(--wm-red); }
.ex-key-btn.paired { border-color: var(--text-20); color: var(--text-40); }

.ex-match-descs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.ex-desc-card {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    font-size: 0.8125rem;
    color: var(--text-60);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
}

.ex-desc-card:hover { border-color: var(--text-20); background: var(--text-05); }

.ex-desc-card.paired {
    border-color: var(--text-20);
    background: var(--text-05);
}

.ex-desc-card.correct {
    border-color: var(--success);
    background: var(--success-dim);
}

.ex-desc-card.incorrect {
    border-color: var(--danger);
    background: var(--danger-dim);
}

.ex-paired-key {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.6875rem;
    background: var(--text-10);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--text-80);
    flex-shrink: 0;
}

/* Quadrant Sort exercise */
.ex-qs-zones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ex-qs-zone {
    background: var(--wm-dark-surface);
    border: 2px dashed var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    min-height: 120px;
    transition: all var(--transition-fast);
}

.ex-qs-zone:hover { border-color: var(--text-20); }

.ex-qs-zone-attention { border-color: rgba(230, 57, 70, 0.3); }
.ex-qs-zone-purple { border-color: rgba(158, 122, 255, 0.3); }
.ex-qs-zone-interpersonal { border-color: rgba(20, 184, 166, 0.3); }
.ex-qs-zone-warning { border-color: rgba(245, 158, 11, 0.3); }

.ex-qs-zone-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-40);
    margin-bottom: var(--space-2);
    text-align: center;
}

.ex-qs-placed {
    font-size: 0.75rem;
    color: var(--text-60);
    padding: var(--space-1) var(--space-2);
    background: var(--text-05);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-1);
}

.ex-qs-placed.correct { background: var(--success-dim); color: var(--success); }
.ex-qs-placed.incorrect { background: var(--danger-dim); color: #fca5a5; }

.ex-qs-behaviors {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.ex-qs-card {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    font-size: 0.8125rem;
    color: var(--text-60);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ex-qs-card:hover { border-color: var(--text-20); color: var(--text-80); }
.ex-qs-card.selected { border-color: var(--wm-red); color: var(--wm-red); background: rgba(230, 57, 70, 0.08); }

/* Build Profile exercise */
.ex-bp-scenario {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-left: 3px solid var(--accent-purple);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
}

.ex-bp-scenario p {
    font-size: 0.9375rem;
    color: var(--text-80);
    line-height: 1.7;
}

.ex-bp-row {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    transition: background var(--transition-fast);
}

.ex-bp-row:hover { background: var(--text-05); }

.ex-bp-close { background: var(--success-dim); }
.ex-bp-moderate { background: var(--warning-dim); }
.ex-bp-far { background: var(--danger-dim); }

.ex-bp-scale-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.ex-bp-slider-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ex-bp-target {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

.ex-bp-reason {
    font-size: 0.75rem;
    color: var(--text-40);
    margin-top: var(--space-1);
    line-height: 1.5;
}

/* Pair Predict exercise */
.ex-pp-given,
.ex-pp-predict {
    background: var(--wm-dark-surface);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    text-align: center;
}

.ex-pp-scale {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.ex-pp-fixed-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-95);
}

.ex-pp-label {
    font-size: 0.6875rem;
    color: var(--text-40);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ex-pp-slider-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    justify-content: center;
    max-width: 300px;
    margin: var(--space-2) auto;
}

.ex-pp-result {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

.ex-pp-result.correct {
    background: var(--success-dim);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.ex-pp-result.incorrect {
    background: var(--danger-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ex-pp-range {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-95);
    margin-bottom: var(--space-2);
}

.ex-pp-explanation {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
}


/* ==========================================================================
   PROFILE VIEWER V2 (.pv2-*)
   ========================================================================== */

.pv2-container {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

.pv2-container h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.pv2-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.pv2-tab {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-surface);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-60);
    font-family: inherit;
}

.pv2-tab.active {
    background: var(--wm-red);
    color: white;
    border-color: var(--wm-red);
}

.pv2-tab:hover:not(.active) {
    background: var(--text-05);
    color: var(--text-80);
}

.pv2-content {
    position: relative;
}

.pv2-content canvas {
    max-height: 500px;
}


/* ==========================================================================
   TAIS PROFILE CHART (.tpc-*)  — Authentic TAIS Percentile Scores format
   ========================================================================== */

.tpc {
    padding: 12px 0;
    overflow-x: auto;
}

.tpc-title {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    text-decoration: underline;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 14px;
}

.tpc-norm-group {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 12px;
}
.tpc-norm-group strong {
    color: rgba(255,255,255,0.65);
}

.tpc-header {
    display: flex;
    align-items: flex-end;
    margin-bottom: 6px;
    height: 18px;
}

.tpc-row {
    display: flex;
    align-items: center;
    padding: 1.5px 0;
}

.tpc-name-col {
    width: 240px;
    min-width: 240px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
    font-weight: 500;
}

.tpc-pct-col {
    width: 48px;
    min-width: 48px;
    text-align: right;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-family: 'JetBrains Mono', monospace;
    padding-right: 12px;
}

.tpc-bar-col {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.tpc-row .tpc-bar-col {
    height: 16px;
}

.tpc-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.tpc-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.08);
    z-index: 1;
}

.tpc-profile-name,
.tsr-profile-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2px;
}

.tpc-marker {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 7px;
    margin-left: -3.5px;
    border-radius: 1.5px;
    z-index: 2;
    opacity: 0.9;
}

.tpc-marker-outlier {
    box-shadow: 0 0 6px 2px rgba(255,255,255,0.35);
    width: 9px !important;
    margin-left: -4.5px !important;
}

.tpc-norm-band {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(255,255,255,0.12);
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
    z-index: 0;
}

.tpc-legend {
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tpc-legend-swatch {
    display: inline-block;
    width: 20px;
    height: 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2px;
}

.tpc-spacer {
    height: 7px;
}

.tpc-mark-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255,255,255,0.3);
    bottom: 0;
    white-space: nowrap;
}

/* Responsive: narrower name column on small screens */
@media (max-width: 640px) {
    .tpc-name-col { width: 150px; min-width: 150px; font-size: 10px; }
    .tpc-pct-col { width: 38px; min-width: 38px; font-size: 10px; padding-right: 8px; }
    .pv2-container { padding: var(--space-4); }
    .pv2-tabs { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .tpc-name-col { width: 110px; min-width: 110px; font-size: 9px; }
    .tpc-bar-col { min-width: 120px; }
    .pv2-container { padding: var(--space-3); }
    .lesson-content { padding: var(--space-3); }
    .lesson-view { overflow-x: hidden; }
}

/* Classic vertical profile SVG */
.tpc-vertical {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

/* ==========================================================================
   TAIS SCALE REPORT (.tsr-*) — Full classic report page
   ========================================================================== */

.tsr {
    padding: 8px 0;
}

.tsr-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    font-style: italic;
    text-decoration: underline;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
}

.tsr-norm-group {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 14px;
}
.tsr-norm-group strong {
    color: rgba(255,255,255,0.65);
}

.tsr-columns {
    display: flex;
    gap: 32px;
    margin-bottom: 18px;
}

.tsr-col {
    flex: 1;
    min-width: 0;
}

.tsr-group-header {
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    text-decoration: underline;
    color: rgba(255,255,255,0.6);
    margin: 10px 0 4px 0;
}

.tsr-col .tsr-group-header:first-child {
    margin-top: 0;
}

.tsr-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.5px 0;
    font-size: 11px;
}

.tsr-row[style*="border-left"] {
    padding-left: 6px;
}

.tsr-name {
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.tsr-score {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    min-width: 28px;
    text-align: right;
}

.tsr-legend {
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tsr-legend-swatch {
    display: inline-block;
    width: 20px;
    height: 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2px;
}

@media (max-width: 640px) {
    .tsr-columns { flex-direction: column; gap: 8px; }
}


/* ==========================================================================
   DASHBOARD — Badges
   ========================================================================== */

.badges-section {
    margin-bottom: var(--space-8);
}

.badges-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.badge-item.earned {
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.2);
    color: var(--text-95);
}

.badge-item.locked {
    background: var(--text-05);
    border: 1px solid var(--text-05);
    color: var(--text-20);
    opacity: 0.5;
}

.badge-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.badge-name {
    white-space: nowrap;
}


/* ==========================================================================
   EXERCISE HISTORY (Module View)
   ========================================================================== */

.exercise-history-section {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}

.exercise-history-section h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.exercise-history-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.exercise-history-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--wm-dark-surface);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.ex-hist-type {
    flex: 1;
    color: var(--text-80);
    font-weight: 600;
}

.ex-hist-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--success);
}

.ex-hist-attempts {
    color: var(--text-40);
    font-size: 0.75rem;
}


/* ==========================================================================
   GLOSSARY PAGE
   ========================================================================== */

.glossary-search-bar {
    margin-bottom: var(--space-6);
}

.glossary-search {
    width: 100%;
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    background: var(--wm-dark-elevated);
    color: var(--text-80);
    font-size: 1rem;
    font-family: inherit;
}

.glossary-search::placeholder { color: rgba(255,255,255,0.50); }
.glossary-search:focus { outline: none; border-color: var(--wm-red); box-shadow: 0 0 0 3px var(--wm-red-glow); }

.glossary-group {
    margin-bottom: var(--space-8);
}

.glossary-group-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-4);
}

.glossary-group-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.glossary-dot-attention { background: var(--group-attention); }
.glossary-dot-control { background: var(--group-control); }
.glossary-dot-interpersonal { background: var(--group-interpersonal); }

.glossary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
}

.glossary-card {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    transition: all var(--transition-fast);
}

.glossary-card:hover {
    border-color: var(--text-10);
    box-shadow: var(--shadow-sm);
}

.glossary-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.glossary-card-name {
    font-weight: 600;
    color: var(--text-95);
    font-size: 0.9375rem;
}

.glossary-pair-tag {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    margin-left: auto;
}

.glossary-pair-tag.capacity { background: var(--success-dim); color: var(--success); }
.glossary-pair-tag.shadow { background: var(--danger-dim); color: #fca5a5; }

.glossary-card-desc {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
    margin-bottom: var(--space-2);
}

.glossary-pair-link {
    font-size: 0.75rem;
    color: var(--text-40);
}

.glossary-terms {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.glossary-term-row {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
}

.glossary-term {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-95);
    margin-bottom: var(--space-1);
}

.glossary-def {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
}


/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

#toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-95);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    max-width: 360px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-10);
}

.toast-success {
    background: var(--success-dim);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.toast-error {
    background: var(--danger-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast-warning {
    background: var(--warning-dim);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}


/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .content {
        padding: var(--space-8) var(--space-6);
    }

    .dashboard-hero {
        flex-direction: column;
        text-align: center;
    }

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

    .quiz-progress {
        margin-left: calc(-1 * var(--space-6));
        margin-right: calc(-1 * var(--space-6));
    }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .aq-body { flex-direction: column; }
    .aq-info-panel { width: 100%; }

    .se2-pair-sides { flex-direction: column; }
    .se2-pair-tension { width: 100%; }

    .ex-match-layout { flex-direction: column; }
    .ex-qs-zones { grid-template-columns: 1fr; }


    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }

    .sidebar.open { transform: translateX(0); }

    .content {
        margin-left: 0;
        padding: var(--space-16) var(--space-4) var(--space-4);
    }

    .module-grid { grid-template-columns: 1fr; }

    .dashboard-hero {
        padding: var(--space-6);
        gap: var(--space-6);
    }

    .dashboard-stats {
        gap: var(--space-4);
    }

    .stat-value { font-size: 1.25rem; }

    .lesson-content { padding: var(--space-5); }

    .lesson-footer { flex-direction: column; gap: var(--space-4); }

    .se-meaning { flex-direction: column; }
    .se-meaning .se-low, .se-meaning .se-high { max-width: 100%; text-align: left; }

    .matching-row { flex-direction: column; gap: var(--space-2); }

    .quiz-progress {
        margin-left: calc(-1 * var(--space-4));
        margin-right: calc(-1 * var(--space-4));
    }

    .results-actions { flex-direction: column; }
    .results-actions .btn { width: 100%; }

    .continue-cta { flex-direction: column; text-align: center; }
    .certificate-banner { flex-direction: column; text-align: center; }

    #toast-container {
        top: auto;
        bottom: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
    }
    .toast { max-width: 100%; }
}


/* ==========================================================================
   Admin Dashboard
   ========================================================================== */

.admin-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.admin-header {
    margin-bottom: var(--space-8);
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--text-95);
    margin-bottom: var(--space-2);
}

.admin-subtitle {
    color: var(--text-60);
    font-size: 0.95rem;
}

/* Stats Cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.admin-stat-card {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--wm-red);
    line-height: 1;
    margin-bottom: var(--space-2);
}

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

/* Track Cards */
.admin-track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.admin-track-card {
    background: var(--wm-dark);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-track-name {
    color: var(--text-80);
    font-weight: 600;
}

.admin-track-count {
    color: var(--wm-red);
    font-weight: 800;
    font-size: 1.25rem;
}

.admin-track-badge {
    display: inline-block;
    background: var(--wm-dark);
    color: var(--text-60);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    text-transform: capitalize;
}

/* Admin Sections */
.admin-section {
    margin-bottom: var(--space-8);
}

.admin-section h2 {
    font-size: 1.25rem;
    color: var(--text-95);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--text-10);
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    color: var(--text-60);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--text-10);
}

.admin-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--text-05);
    color: var(--text-80);
}

.admin-table tr:hover td {
    background: var(--wm-dark);
}

.admin-table a {
    color: var(--wm-red);
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.admin-empty {
    text-align: center;
    color: var(--text-40);
    padding: var(--space-8) !important;
}

/* Progress Bar in Table */
.admin-bar-container {
    position: relative;
    background: var(--text-05);
    border-radius: var(--radius-full);
    height: 20px;
    min-width: 100px;
    overflow: hidden;
}

.admin-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--wm-red);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.admin-bar-label {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-95);
}

/* Pass/Fail badges */
.admin-pass {
    color: var(--success);
    font-weight: 600;
}

.admin-fail {
    color: var(--danger);
    font-weight: 600;
}

/* Filter Controls */
.admin-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.admin-filter-btn {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--wm-dark);
    color: var(--text-60);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--text-10);
    transition: all var(--transition-fast);
}

.admin-filter-btn:hover {
    border-color: var(--wm-red);
    color: var(--text-95);
}

.admin-filter-btn.active {
    background: var(--wm-red);
    color: white;
    border-color: var(--wm-red);
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.btn-secondary {
    background: var(--wm-dark-surface);
    color: var(--text-80);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid var(--text-10);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--wm-dark-elevated);
    color: var(--text-95);
    border-color: var(--text-20);
}

/* Admin Link in Sidebar */
.admin-link {
    color: var(--wm-red);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

/* Admin responsive */
@media (max-width: 768px) {
    .admin-page { padding: var(--space-4); }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: var(--space-2) var(--space-3); }
    .admin-filters { gap: var(--space-1); }
}

/* ==========================================================================
   Profile Lab — Hero Interactive Widget
   ========================================================================== */

/* --- Layout --- */

.pl-container {
    background: var(--wm-dark);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pl-split {
    display: flex;
    min-height: 500px;
}

.pl-canvas {
    flex: 0 0 60%;
    padding: var(--space-4) var(--space-3);
    overflow-x: auto;
    overflow-y: auto;
    border-right: 1px solid var(--text-05);
}

.pl-drawer {
    flex: 0 0 40%;
    padding: var(--space-4) var(--space-5);
    overflow-y: auto;
    max-height: 700px;
}

.pl-drawer-empty {
    color: var(--text-40);
    font-size: 0.875rem;
    text-align: center;
    padding: var(--space-10) var(--space-4);
}

/* --- Toolbar --- */

.pl-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--wm-dark-elevated);
    border-bottom: 1px solid var(--text-05);
    flex-wrap: wrap;
}

.pl-toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pl-toolbar-label {
    font-size: 0.75rem;
    color: var(--text-40);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.pl-preset-dropdown,
.pl-tour-dropdown {
    background: var(--wm-dark);
    color: var(--text-80);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
}

.pl-preset-dropdown:focus,
.pl-tour-dropdown:focus {
    outline: 2px solid var(--wm-red);
    outline-offset: 1px;
}

.pl-pressure-toggle {
    background: var(--wm-dark);
    color: var(--text-60);
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pl-pressure-toggle:hover {
    border-color: var(--wm-red);
    color: var(--text-80);
}

.pl-pressure-toggle.pl-pressure-active {
    background: rgba(230, 57, 70, 0.15);
    border-color: var(--wm-red);
    color: var(--wm-red);
    font-weight: 600;
}

.pl-pressure-on .pl-svg {
    filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.2));
}

/* --- SVG Profile Canvas --- */

.pl-svg {
    display: block;
}

.pl-group-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.pl-bar-label {
    font-size: 11px;
    font-weight: 600;
    fill: rgba(255, 255, 255, 0.7);
    font-family: 'JetBrains Mono', monospace;
}

.pl-bar-track {
    transition: fill 0.2s ease;
}

.pl-bar-fill {
    transition: width 0.15s ease;
}

.pl-bar-score {
    font-size: 10px;
    font-weight: 600;
    fill: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
}

.pl-drag-handle {
    cursor: ew-resize;
}

/* Bar states */
.pl-bar-row { opacity: 1; transition: opacity 0.2s ease; }
.pl-bar-row:hover { opacity: 1 !important; }
.pl-bar-row:hover .pl-bar-fill { filter: brightness(1.2); }
.pl-bar-dimmed { opacity: 0.4; }
.pl-bar-active { opacity: 1; }
.pl-bar-active .pl-bar-fill { filter: brightness(1.2) drop-shadow(0 0 6px currentColor); }
.pl-bar-active .pl-bar-label { fill: rgba(255, 255, 255, 0.95); }
.pl-bar-active .pl-bar-score { fill: rgba(255, 255, 255, 0.9); }

/* --- Detail Drawer Layers --- */

.pl-layer {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--text-05);
}

.pl-layer:last-child {
    border-bottom: none;
}

.pl-layer-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    margin-bottom: var(--space-2);
    cursor: pointer;
    user-select: none;
}

details.pl-layer > summary.pl-layer-header {
    list-style: none;
    padding: var(--space-1) 0;
}

details.pl-layer > summary.pl-layer-header::before {
    content: '+ ';
    color: var(--text-20);
}

details[open].pl-layer > summary.pl-layer-header::before {
    content: '- ';
}

.pl-layer-content {
    padding-top: var(--space-2);
}

/* Layer 1: Identity */
.pl-identity-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.pl-scale-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 800;
}

.pl-scale-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-95);
}

.pl-identity-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.pl-group-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: capitalize;
}

.pl-scale-short {
    font-size: 0.75rem;
    color: var(--text-40);
}

.pl-pair-indicator {
    font-size: 0.75rem;
    color: var(--text-40);
}

.pl-scale-desc {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.5;
    margin: 0;
}

/* Layer 2: Score */
.pl-score-display {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.pl-score-bar-mini {
    flex: 1;
    height: 8px;
    background: var(--text-05);
    border-radius: 99px;
    overflow: hidden;
}

.pl-score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease;
}

.pl-score-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-95);
    min-width: 28px;
    text-align: right;
}

.pl-score-band {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.pl-interp-text {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
    margin: var(--space-2) 0;
}

.pl-meanings {
    font-size: 0.75rem;
    color: var(--text-40);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.pl-meaning-label {
    font-weight: 600;
    color: var(--text-60);
}

/* Layer 3: Pair Dynamics */
.pl-pair-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.pl-pair-bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pl-pair-bar-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-60);
    min-width: 36px;
}

.pl-pair-bar-track {
    flex: 1;
    height: 10px;
    background: var(--text-05);
    border-radius: 99px;
    overflow: hidden;
}

.pl-pair-bar-fill {
    height: 100%;
    border-radius: 99px;
}

.pl-pair-bar-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-40);
    min-width: 24px;
    text-align: right;
}

.pl-gap-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
}

.pl-gap-label {
    color: var(--text-40);
}

.pl-gap-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.pl-pattern-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-60);
    background: var(--text-05);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Layer 4: Performance Errors */
.pl-layer-errors .pl-layer-content {
    display: flex;
    gap: var(--space-4);
}

.pl-errors-col {
    flex: 1;
    opacity: 0.5;
}

.pl-errors-col.pl-errors-active {
    opacity: 1;
}

.pl-errors-col h5 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-40);
    margin: 0 0 var(--space-1);
}

.pl-errors-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pl-errors-col li {
    font-size: 0.8125rem;
    color: var(--text-60);
    padding: var(--space-1) 0;
    line-height: 1.4;
}

/* Layer 5: Coaching */
.pl-coaching-section {
    margin-bottom: var(--space-3);
}

.pl-coaching-section:last-child {
    margin-bottom: 0;
}

.pl-coaching-section h5 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-40);
    margin: 0 0 var(--space-1);
}

.pl-coaching-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pl-coaching-section li {
    font-size: 0.8125rem;
    color: var(--text-60);
    padding: var(--space-1) 0;
    line-height: 1.4;
    padding-left: var(--space-3);
    position: relative;
}

.pl-coaching-section li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--text-20);
}

/* Pressure comparison */
.pl-layer-pressure-compare {
    background: rgba(230, 57, 70, 0.06);
    border: 1px solid rgba(230, 57, 70, 0.15);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-3);
}

.pl-pressure-shift {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-60);
    margin-bottom: var(--space-2);
}

.pl-pressure-arrow {
    color: var(--wm-red);
    font-weight: 700;
}

/* --- Navigation Bar --- */

.pl-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--wm-dark-elevated);
    border-top: 1px solid var(--text-05);
}

.pl-nav-btn {
    background: none;
    border: 1px solid var(--text-10);
    border-radius: var(--radius-md);
    color: var(--text-60);
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pl-nav-btn:hover:not(:disabled) {
    border-color: var(--wm-red);
    color: var(--text-80);
}

.pl-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pl-nav-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-60);
}

/* --- Tour Overlay --- */

.pl-tour-overlay {
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}

.pl-tour-narration {
    font-size: 0.875rem;
    color: var(--text-80);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.pl-tour-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pl-tour-btn {
    background: none;
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: var(--radius-md);
    color: var(--wm-red);
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
}

.pl-tour-btn:hover:not(:disabled) {
    background: rgba(230, 57, 70, 0.1);
}

.pl-tour-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pl-tour-progress {
    font-size: 0.6875rem;
    color: var(--text-40);
    font-family: 'JetBrains Mono', monospace;
}

/* --- Inline Score Badges --- */

.pl-inline-score {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: baseline;
}

.pl-inline-attention {
    background: rgba(230, 57, 70, 0.12);
    color: #e63946;
}

.pl-inline-control {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.pl-inline-interpersonal {
    background: rgba(20, 184, 166, 0.12);
    color: #14b8a6;
}

.pl-inline-bar {
    display: inline-block;
    height: 3px;
    border-radius: 2px;
    margin-left: 2px;
}

/* --- Block Score Chart --- */

.pl-score-block {
    background: var(--wm-dark-elevated);
    border: 1px solid var(--text-05);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin: var(--space-3) 0;
}

.pl-block-svg {
    display: block;
}

/* --- Sidebar Tools Section --- */

.nav-section-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-20);
    padding: var(--space-3) var(--space-4) var(--space-1);
    list-style: none;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .pl-split {
        flex-direction: column;
    }

    .pl-canvas {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--text-05);
        max-height: 400px;
    }

    .pl-drawer {
        flex: none;
        max-height: 60vh;
        padding: var(--space-3);
    }

    .pl-toolbar {
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
    }

    .pl-layer-errors .pl-layer-content {
        flex-direction: column;
    }
}

/* ============================================================
   PROFILE LAB — COMPARISON MODE
   ============================================================ */

.pl-compare-section {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border-left: 3px solid var(--text-20);
}

.pl-compare-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-40);
    margin-bottom: var(--space-2);
}

.pl-compare-scores {
    display: flex;
    gap: var(--space-3);
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
}

.pl-compare-interp {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.5;
}

/* ============================================================
   PROFILE LAB — NORM BANDS
   ============================================================ */

.pl-norm-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-40);
    padding: var(--space-2) 0;
}

.pl-norm-legend strong {
    color: var(--text-60);
}

.pl-norm-swatch {
    display: inline-block;
    width: 16px;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.12);
}

.pl-norm-context {
    font-size: 0.8125rem;
    color: var(--text-50);
    margin-top: var(--space-2);
    padding: var(--space-2);
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

/* ============================================================
   PRACTICE CASES
   ============================================================ */

.pc-filters {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.pc-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-20);
    color: var(--text-80);
    border: 1px solid var(--text-10);
    border-radius: 6px;
    font-size: 0.875rem;
}

.pc-count {
    font-size: 0.8125rem;
    color: var(--text-40);
}

.pc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.pc-card {
    background: var(--bg-20);
    border: 1px solid var(--text-05);
    border-radius: 10px;
    padding: var(--space-4);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.pc-card:hover {
    border-color: var(--text-20);
    transform: translateY(-2px);
}

.pc-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.pc-domain {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    background: var(--bg-10);
    padding: 2px 8px;
    border-radius: 4px;
}

.pc-difficulty {
    font-size: 0.6875rem;
    color: var(--text-30);
}

.pc-diff-1 { border-left: 3px solid #22c55e; }
.pc-diff-2 { border-left: 3px solid #f59e0b; }
.pc-diff-3 { border-left: 3px solid #e63946; }

.pc-card-title {
    font-size: 1rem;
    margin: 0 0 var(--space-2);
    color: var(--text-90);
}

.pc-card-context {
    font-size: 0.8125rem;
    color: var(--text-50);
    line-height: 1.5;
}

.pc-back-btn {
    background: none;
    border: none;
    color: var(--text-40);
    cursor: pointer;
    font-size: 0.875rem;
    margin-bottom: var(--space-3);
    padding: var(--space-1) 0;
}

.pc-back-btn:hover { color: var(--text-80); }

.pc-case-header {
    margin-bottom: var(--space-5);
}

.pc-case-header h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
}

.pc-case-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}

.pc-profile-panel h3,
.pc-interpret-panel h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    margin-bottom: var(--space-3);
}

.pc-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-group-header {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--space-3);
    padding-bottom: 2px;
}

.pc-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 22px;
}

.pc-bar-label {
    width: 40px;
    font-size: 0.6875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-50);
    text-align: right;
}

.pc-bar-track {
    flex: 1;
    height: 14px;
    background: var(--bg-10);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.pc-norm-band {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    pointer-events: none;
}

.pc-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
    position: relative;
    z-index: 1;
}

.pc-bar-score {
    width: 28px;
    font-size: 0.6875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-60);
    text-align: right;
}

.pc-norm-label {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-40);
    background: rgba(255,255,255,0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-left: var(--space-2);
}

.pc-norm-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-40);
    padding: var(--space-2) 0;
}

.pc-norm-legend strong {
    color: var(--text-60);
}

.pc-norm-swatch {
    display: inline-block;
    width: 16px;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.12);
}

.pc-prompt {
    font-size: 0.875rem;
    color: var(--text-50);
    margin-bottom: var(--space-3);
    line-height: 1.5;
}

.pc-textarea {
    width: 100%;
    background: var(--bg-10);
    color: var(--text-80);
    border: 1px solid var(--text-10);
    border-radius: 8px;
    padding: var(--space-3);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
}

.pc-submit-btn {
    margin-top: var(--space-3);
    padding: 0.625rem 1.25rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pc-submit-btn:hover { opacity: 0.9; }
.pc-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pc-loading {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-40);
    font-style: italic;
}

.pc-feedback {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-10);
    border-radius: 10px;
}

.pc-score-badge {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #e63946;
    margin-bottom: var(--space-2);
}

.pc-feedback-text {
    font-size: 0.875rem;
    color: var(--text-70);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.pc-reveal {
    margin-top: var(--space-2);
    border-top: 1px solid var(--text-05);
    padding-top: var(--space-2);
}

.pc-reveal summary {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-50);
    cursor: pointer;
    padding: var(--space-1) 0;
}

.pc-reveal ul {
    margin: var(--space-2) 0 0 var(--space-4);
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
}

.pc-reveal p {
    font-size: 0.8125rem;
    color: var(--text-60);
    line-height: 1.6;
    margin-top: var(--space-2);
}

.pc-error {
    color: #e63946;
    padding: var(--space-3);
}

@media (max-width: 768px) {
    .pc-case-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SIMULATED DEBRIEF
   ============================================================ */

.ds-select-view {
    max-width: 720px;
}

.ds-intro {
    font-size: 0.9375rem;
    color: var(--text-60);
    line-height: 1.6;
    margin-bottom: var(--space-5);
}

.ds-domain-section {
    margin-bottom: var(--space-5);
}

.ds-domain-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    margin-bottom: var(--space-2);
}

.ds-case-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.ds-case-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: var(--space-3);
    background: var(--bg-20);
    border: 1px solid var(--text-05);
    border-radius: 8px;
    color: var(--text-70);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ds-case-btn:hover { border-color: var(--text-20); }
.ds-case-btn strong { color: var(--text-90); }
.ds-case-btn span { font-size: 0.75rem; color: var(--text-40); }

.ds-loading, .ds-error {
    padding: var(--space-5);
    text-align: center;
    color: var(--text-40);
}

.ds-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-4);
    height: calc(100vh - 180px);
    min-height: 500px;
}

.ds-sidebar {
    overflow-y: auto;
    padding-right: var(--space-3);
    border-right: 1px solid var(--text-05);
}

.ds-case-info {
    margin-bottom: var(--space-4);
}

.ds-case-info h3 {
    font-size: 1rem;
    color: var(--text-90);
    margin-bottom: var(--space-1);
}

.ds-case-info p {
    font-size: 0.8125rem;
    color: var(--text-50);
    line-height: 1.5;
}

.ds-group-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--space-2);
}

.ds-mini-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 16px;
}

.ds-mini-key {
    width: 32px;
    font-size: 0.5625rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-40);
    text-align: right;
}

.ds-mini-track {
    flex: 1;
    height: 8px;
    background: var(--bg-10);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.ds-norm-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.25);
    pointer-events: none;
    z-index: 1;
}

.ds-mini-fill {
    height: 100%;
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

.ds-mini-score {
    width: 20px;
    font-size: 0.5625rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-30);
    text-align: right;
}

.ds-norm-label {
    font-size: 0.625rem;
    color: var(--text-30);
    margin-bottom: var(--space-2);
    padding: 0.15rem 0.4rem;
    background: rgba(255,255,255,0.04);
    border-radius: 3px;
    text-align: center;
}

.ds-chat-area {
    display: flex;
    flex-direction: column;
}

.ds-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--text-05);
    margin-bottom: var(--space-3);
    font-size: 0.875rem;
    color: var(--text-60);
}

.ds-end-btn {
    padding: 0.375rem 0.75rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

.ds-end-btn:disabled { opacity: 0.5; }

.ds-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    min-height: 0;
}

.ds-msg {
    padding: var(--space-2) var(--space-3);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 85%;
}

.ds-msg-practitioner {
    background: rgba(230,57,70,0.1);
    align-self: flex-end;
    color: var(--text-80);
}

.ds-msg-client {
    background: var(--bg-20);
    align-self: flex-start;
    color: var(--text-70);
}

.ds-msg-system {
    align-self: center;
    text-align: center;
    color: var(--text-40);
    font-style: italic;
    font-size: 0.8125rem;
    max-width: 100%;
}

.ds-typing {
    color: var(--text-30);
    font-style: italic;
}

.ds-input-area {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--text-05);
    margin-top: var(--space-2);
}

.ds-input {
    flex: 1;
    background: var(--bg-10);
    color: var(--text-80);
    border: 1px solid var(--text-10);
    border-radius: 8px;
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
}

.ds-send-btn {
    padding: 0.5rem 1rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    align-self: flex-end;
}

.ds-feedback-card {
    background: var(--bg-20);
    border: 1px solid var(--text-10);
    border-radius: 10px;
    padding: var(--space-4);
    margin-top: var(--space-3);
    align-self: center;
    max-width: 100%;
    width: 100%;
}

.ds-feedback-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e63946;
    margin-bottom: var(--space-2);
}

.ds-feedback-text {
    font-size: 0.875rem;
    color: var(--text-70);
    line-height: 1.6;
}

.ds-feedback-patterns {
    margin-top: var(--space-3);
    font-size: 0.8125rem;
    color: var(--text-50);
}

.ds-feedback-patterns ul {
    margin: var(--space-1) 0 0 var(--space-4);
    line-height: 1.6;
}

.ds-restart-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-20);
    color: var(--text-60);
    border: 1px solid var(--text-10);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .ds-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .ds-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--text-05);
        padding-bottom: var(--space-3);
        max-height: 200px;
    }
}

/* ============================================================
   FLASHCARDS
   ============================================================ */

.fc-dashboard {
    max-width: 640px;
}

.fc-stats-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.fc-stat {
    flex: 1;
    background: var(--bg-20);
    border-radius: 10px;
    padding: var(--space-4);
    text-align: center;
}

.fc-stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-90);
}

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

.fc-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.fc-cat-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-20);
    border: 1px solid var(--text-05);
    border-radius: 6px;
    color: var(--text-50);
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.fc-cat-btn:hover { border-color: var(--text-20); }
.fc-cat-btn.active { border-color: #e63946; color: #e63946; }

.fc-start-btn {
    width: 100%;
    padding: 0.75rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.fc-empty {
    text-align: center;
    color: var(--text-30);
    padding: var(--space-5);
}

.fc-review {
    max-width: 560px;
    margin: 0 auto;
}

.fc-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    font-size: 0.75rem;
    color: var(--text-40);
}

.fc-progress { font-family: 'JetBrains Mono', monospace; }
.fc-box-label { background: var(--bg-20); padding: 2px 8px; border-radius: 4px; }
.fc-diff-label { color: var(--text-30); }

.fc-quit-btn {
    background: none;
    border: 1px solid var(--text-10);
    color: var(--text-40);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.fc-card {
    background: var(--bg-20);
    border: 1px solid var(--text-10);
    border-radius: 12px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}

.fc-card:hover { border-color: var(--text-20); }
.fc-card:focus { border-color: #e63946; }
.fc-card:focus-visible { outline: 2px solid var(--wm-red, #C4302B); outline-offset: 2px; }

.fc-card-inner {
    padding: var(--space-5);
    width: 100%;
}

.fc-card-category {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-30);
    margin-bottom: var(--space-3);
}

.fc-card-content {
    font-size: 1rem;
    color: var(--text-80);
    line-height: 1.6;
}

.fc-card-content b {
    color: #e63946;
}

.fc-card-content ul {
    margin: var(--space-2) 0 0 var(--space-4);
}

.fc-card-hint {
    margin-top: var(--space-4);
    font-size: 0.75rem;
    color: var(--text-20);
    text-align: center;
}

.fc-card-flipped {
    border-color: #14b8a6;
}

.fc-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.fc-action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.fc-wrong {
    background: rgba(230,57,70,0.15);
    color: #e63946;
}

.fc-right {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.fc-complete {
    text-align: center;
    padding: var(--space-8) 0;
}

.fc-complete h2 {
    margin-bottom: var(--space-2);
}

.fc-complete p {
    color: var(--text-50);
    margin-bottom: var(--space-4);
}

.fc-restart-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-20);
    color: var(--text-60);
    border: 1px solid var(--text-10);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */

.an-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.an-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
}

.an-ov-card {
    background: var(--bg-20);
    border-radius: 10px;
    padding: var(--space-4);
    text-align: center;
}

.an-ov-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-90);
}

.an-ov-label {
    font-size: 0.6875rem;
    color: var(--text-40);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.an-section {
    background: var(--bg-20);
    border-radius: 10px;
    padding: var(--space-4);
}

.an-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-40);
    margin-bottom: var(--space-3);
}

.an-empty {
    color: var(--text-30);
    text-align: center;
    padding: var(--space-3);
}

.an-modules {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.an-mod-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.an-mod-info {
    flex: 0 0 200px;
}

.an-mod-title {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-80);
}

.an-mod-detail {
    font-size: 0.6875rem;
    color: var(--text-40);
}

.an-mod-bar-track {
    flex: 1;
    height: 12px;
    background: var(--bg-10);
    border-radius: 3px;
    overflow: hidden;
}

.an-mod-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s;
}

.an-mod-pct {
    width: 36px;
    text-align: right;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-50);
}

/* Quiz chart */
.an-quiz-chart {
    padding: var(--space-2) 0;
}

.an-chart-area {
    position: relative;
    height: 200px;
    border-bottom: 1px solid var(--text-10);
}

.an-chart-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--text-05);
}

.an-chart-line span {
    position: absolute;
    left: -4px;
    top: -8px;
    font-size: 0.5625rem;
    color: var(--text-20);
    transform: translateX(-100%);
}

.an-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100%;
    padding: 0 var(--space-2);
}

.an-chart-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.an-chart-bar {
    width: 80%;
    border-radius: 3px 3px 0 0;
    transition: height 0.4s;
}

.an-chart-bar-label {
    font-size: 0.5625rem;
    color: var(--text-30);
    margin-top: 4px;
}

/* Time chart */
.an-time-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.an-time-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.an-time-label {
    flex: 0 0 140px;
    font-size: 0.75rem;
    color: var(--text-60);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.an-time-track {
    flex: 1;
    height: 10px;
    background: var(--bg-10);
    border-radius: 3px;
    overflow: hidden;
}

.an-time-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s;
}

.an-time-val {
    width: 40px;
    text-align: right;
    font-size: 0.6875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-40);
}

/* SRS boxes */
.an-srs-boxes {
    display: flex;
    gap: var(--space-2);
    height: 140px;
    align-items: flex-end;
}

.an-srs-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.an-srs-box-fill {
    width: 80%;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.4s;
}

.an-srs-box-count {
    font-size: 0.6875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-60);
    margin-top: 4px;
}

.an-srs-box-label {
    font-size: 0.5625rem;
    color: var(--text-30);
}

.an-srs-total {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-40);
    margin-top: var(--space-2);
}

.an-activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.an-activity-item {
    font-size: 0.8125rem;
    color: var(--text-60);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-10);
    border-radius: 6px;
}

.an-loading, .an-error {
    text-align: center;
    padding: var(--space-5);
    color: var(--text-40);
}

@media (max-width: 768px) {
    .an-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .an-mod-info {
        flex: 0 0 120px;
    }
    .an-time-label {
        flex: 0 0 80px;
    }
}

/* --- Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
