/* ─── Reset & Variables ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #0a2540;
    --navy-light: #0f3558;
    --navy-hover: #132f4f;
    --teal: #0fa89e;
    --teal-dim: rgba(15, 168, 158, 0.15);
    --gold: #d4a843;
    --gold-dim: rgba(212, 168, 67, 0.12);
    --coral: #e07a5f;
    --coral-dim: rgba(224, 122, 95, 0.12);
    --progress: #9333ea;
    --progress-dim: rgba(147, 51, 234, 0.08);
    --success: #16a34a;
    --success-dim: rgba(22, 163, 74, 0.1);
    --warning: #d97706;

    --page-bg: #f3f0ec;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(10, 37, 64, 0.06), 0 4px 16px rgba(10, 37, 64, 0.06);
    --card-shadow-hover: 0 2px 6px rgba(10, 37, 64, 0.08), 0 8px 28px rgba(10, 37, 64, 0.10);
    --card-radius: 14px;
    --card-radius-sm: 10px;

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --border: rgba(10, 37, 64, 0.08);

    --sidebar-width: 240px;
    --topbar-height: 0px;

    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-heading: 'Instrument Serif', Georgia, serif;
}

html { height: 100%; }
body {
    font-family: var(--font-body);
    background: var(--page-bg);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100%;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ─── Sidebar ─────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--teal), #0dbfb3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}
.brand-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: white;
}
.brand-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--teal);
    margin-top: 6px;
    padding-left: 40px;
}

/* Nav sections */
.sidebar-section {
    padding: 16px 0 4px;
}
.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    padding: 0 20px 8px;
}
.sidebar-nav {
    list-style: none;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    border-left: 3px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}
.sidebar-nav li a:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.04);
}
.sidebar-nav li a.active {
    color: white;
    background: rgba(15, 168, 158, 0.12);
    border-left-color: var(--teal);
}
.sidebar-nav li a i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}
.sidebar-nav li a.active i { opacity: 1; }

/* Study expandable items */
.sidebar-study {
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-study.expanded {
    background: rgba(255,255,255,0.03);
}
.sidebar-study-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px 9px 17px;
    cursor: pointer;
    transition: all 0.15s;
}
.sidebar-study-header:hover {
    background: rgba(255,255,255,0.04);
}
.sidebar-study.expanded .sidebar-study-header {
    background: rgba(255,255,255,0.04);
}
.sidebar-study-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    flex-shrink: 0;
}
.sidebar-study-dot.teal { background: var(--teal); }
.sidebar-study-dot.gold { background: var(--gold); }
.sidebar-study-dot.coral { background: var(--coral); }
.sidebar-study-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-study.expanded .sidebar-study-name,
.sidebar-study-header:hover .sidebar-study-name {
    color: rgba(255,255,255,0.85);
}
.sidebar-study-chevron {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.25);
    transition: transform 0.2s;
}
.sidebar-study.expanded .sidebar-study-chevron {
    transform: rotate(90deg);
    color: rgba(255,255,255,0.45);
}
.sidebar-study-status {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sidebar-study-status.done {
    background: var(--success-dim);
    color: var(--success);
}
.sidebar-study-status.open {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
}

.sidebar-study-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.sidebar-study.expanded .sidebar-study-sub {
    max-height: 280px;
}
.sidebar-study-sub a {
    display: block;
    padding: 6px 20px 6px 40px;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    transition: all 0.15s;
    cursor: pointer;
}
.sidebar-study-sub a:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.03);
}
.sidebar-study-sub a.active {
    color: white;
    background: rgba(255,255,255,0.05);
}

.nav-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(15, 168, 158, 0.2);
    color: var(--teal);
}
.nav-badge.coming {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--progress), #7c22d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}
.user-info {
    flex: 1;
    min-width: 0;
}
.user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-backlink {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    margin-top: 14px;
    transition: color 0.2s;
}
.sidebar-backlink:hover { color: rgba(255,255,255,0.55); }
.sidebar-backlink i { font-size: 0.6rem; }

/* ─── Main Content Area ─────────────────────── */
.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page header */
.page-header {
    padding: 28px 32px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.page-title-group h1 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.page-actions {
    display: flex;
    gap: 10px;
}

/* Tab bar */
.tab-bar {
    padding: 0 32px;
    margin-top: 20px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}
.tab-bar button {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.tab-bar button:hover {
    color: var(--text-secondary);
}
.tab-bar button.active {
    color: var(--navy);
    border-bottom-color: var(--teal);
}

/* Page body */
.page-body {
    padding: 24px 32px 32px;
    flex: 1;
}

/* ─── Shared Button Styles ─────────────────────── */
.btn-primary-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: var(--teal);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary-app:hover { background: #0dbfb3; }

.btn-outline-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline-app:hover {
    border-color: rgba(10,37,64,0.15);
    background: #fafafa;
}

/* ─── Card Components ─────────────────────── */
.card-app {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.card-app:hover {
    box-shadow: var(--card-shadow-hover);
}
.card-app.clickable:hover {
    transform: translateY(-2px);
    cursor: pointer;
}
.card-header-app {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.card-header-app h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--navy);
}
.card-body-app {
    padding: 22px;
}

/* ─── Stat Cards Row ─────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--card-radius-sm);
    box-shadow: var(--card-shadow);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--navy);
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 4px;
}
.stat-card.accent-teal .stat-value { color: var(--teal); }
.stat-card.accent-gold .stat-value { color: var(--gold); }
.stat-card.accent-coral .stat-value { color: var(--coral); }
.stat-card.accent-purple .stat-value { color: var(--progress); }

/* ─── Study Cards (Home) ─────────────────────── */
.studies-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.study-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.25s;
    cursor: pointer;
    position: relative;
}
.study-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}
.study-accent { height: 4px; }
.study-accent.teal { background: var(--teal); }
.study-accent.gold { background: var(--gold); }
.study-accent.coral { background: var(--coral); }

.study-card-inner {
    padding: 24px;
}
.study-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.study-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}
.study-icon-box.teal { background: var(--teal); }
.study-icon-box.gold { background: var(--gold); }
.study-icon-box.coral { background: var(--coral); }

.study-status-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.study-status-badge.available {
    background: var(--teal-dim);
    color: var(--teal);
}
.study-status-badge.completed {
    background: var(--success-dim);
    color: var(--success);
}
.study-status-badge.in-progress {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}
.study-status-badge.coming-soon {
    background: rgba(138,138,154,0.1);
    color: var(--text-muted);
}

.study-card.coming-soon {
    opacity: 0.65;
    cursor: default;
}
.study-card.coming-soon:hover {
    transform: none;
    box-shadow: var(--card-shadow);
}
.study-accent.muted { background: var(--text-muted); }

.study-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.25;
}
.study-card .study-tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 16px;
}
.study-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.study-card-meta i {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-right: 3px;
}
.study-card-action {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.study-btn {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}
.study-btn.teal { color: var(--teal); }
.study-btn.gold { color: var(--gold); }
.study-btn.coral { color: var(--coral); }
.study-card:hover .study-btn { gap: 10px; }

/* ─── Two-Column Layout ─────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
.two-col-wide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

/* ─── Archetype Result Cards (My Archetypes) ─────── */
.archetype-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.archetype-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.25s;
}
.archetype-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}
.archetype-accent { height: 4px; }
.archetype-card-body { padding: 24px; }
.archetype-study-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.archetype-study-label.teal { color: var(--teal); }
.archetype-study-label.gold { color: var(--gold); }
.archetype-study-label.coral { color: var(--coral); }

.archetype-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.archetype-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}
.archetype-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--navy);
    line-height: 1.2;
}
.archetype-category {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.archetype-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.score-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.score-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    width: 90px;
    flex-shrink: 0;
}
.score-bar-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.score-bar-fill.teal { background: var(--teal); }
.score-bar-fill.gold { background: var(--gold); }
.score-bar-fill.coral { background: var(--coral); }
.score-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--navy);
    width: 28px;
    text-align: right;
}

.archetype-card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
}
.archetype-date {
    color: var(--text-muted);
}
.archetype-actions {
    display: flex;
    gap: 12px;
}
.archetype-actions a {
    color: var(--text-muted);
    transition: color 0.15s;
    font-size: 0.75rem;
}
.archetype-actions a:hover { color: var(--teal); }

/* ─── Position Map Teaser ─────────────────────── */
.map-teaser {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--card-radius);
    padding: 32px;
    color: white;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}
.map-teaser-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(15, 168, 158, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--teal);
    flex-shrink: 0;
}
.map-teaser-text h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: white;
    margin-bottom: 4px;
}
.map-teaser-text p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 12px;
}
.map-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
}
.map-progress-fill {
    height: 100%;
    background: var(--teal);
    border-radius: 3px;
    transition: width 0.6s ease;
}
.map-progress-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

/* ─── Findings Cards ─────────────────────── */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}
.finding-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}
.finding-value {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 6px;
}
.finding-value.teal { color: var(--teal); }
.finding-value.gold { color: var(--gold); }
.finding-value.coral { color: var(--coral); }
.finding-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}
.finding-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ─── Activity Feed ─────────────────────── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-dot.teal { background: var(--teal); }
.activity-dot.gold { background: var(--gold); }
.activity-dot.purple { background: var(--progress); }
.activity-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.activity-text strong { color: var(--navy); font-weight: 600; }
.activity-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Empty States ─────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: var(--progress-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--progress);
}
.empty-state h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--navy);
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 340px;
    margin: 0 auto 18px;
}

/* ─── View & Tab Management ─────────────────────── */
.view { display: none; }
.view.active { display: block; }
.study-tab { display: none; }
.study-tab.active { display: block; }

/* ─── Archetype Detail View ─────────────────────── */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: none;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.detail-back:hover { color: var(--navy); background: var(--border); }
.detail-back i { font-size: 0.65rem; }

.detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}
.detail-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}
.detail-hero-text h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 6px;
}
.detail-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.badge-category {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.badge-category:hover {
    filter: brightness(0.92);
    box-shadow: 0 0 0 2px currentColor;
}
.badge-category::after {
    content: '\f059';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 0.55rem;
    margin-left: 5px;
    opacity: 0.5;
}

/* Archetype Family Overlay */
.family-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,37,64,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.family-overlay.open {
    opacity: 1;
    visibility: visible;
}
.family-panel {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: 0 16px 48px rgba(10,37,64,0.2);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.25s;
}
.family-overlay.open .family-panel {
    transform: translateY(0);
}
.family-panel-header {
    padding: 24px 28px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.family-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(10,37,64,0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    flex-shrink: 0;
}
.family-panel-close:hover {
    background: rgba(10,37,64,0.1);
    color: var(--text-primary);
}
.family-panel-body {
    padding: 20px 28px 28px;
}
.family-panel-body p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.family-panel-body p:last-child { margin-bottom: 0; }
.family-members {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.family-members h5 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.family-member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.family-member-chip {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.family-member-chip.current {
    font-weight: 700;
    border-width: 2px;
}

/* ─── Glossary Term Tooltips ─────────────────────── */
.term {
    border-bottom: 1px dashed currentColor;
    cursor: help;
    position: relative;
    opacity: 0.9;
}
.term:hover {
    opacity: 1;
}
.term-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 14px 16px;
    background: var(--navy);
    color: rgba(255,255,255,0.92);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: normal;
    text-transform: none;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(10,37,64,0.3);
}
.term-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--navy);
}
.term:hover .term-tip {
    display: block;
}
.term-tip strong {
    display: block;
    color: white;
    font-size: 0.78rem;
    margin-bottom: 4px;
}
/* Right-align tips near right edge */
.term-tip.tip-left {
    left: 0;
    transform: none;
}
.term-tip.tip-left::after {
    left: 20px;
    transform: none;
}
.term-tip.tip-right {
    left: auto;
    right: 0;
    transform: none;
}
.term-tip.tip-right::after {
    left: auto;
    right: 20px;
    transform: none;
}

.badge-vi {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(10,37,64,0.04);
    cursor: help;
    position: relative;
}
.badge-vi:hover::after,
.vi-tag:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px 12px;
    background: var(--navy);
    color: white;
    border-radius: 6px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(10,37,64,0.2);
}
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}
.detail-main { display: flex; flex-direction: column; gap: 20px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 24px; }

.detail-section {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.detail-section-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.detail-section-header i {
    font-size: 0.8rem;
    opacity: 0.5;
}
.detail-section-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--navy);
}
.detail-section-body {
    padding: 22px;
}
.detail-section-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 14px;
}
.detail-section-body p:last-child { margin-bottom: 0; }

/* Dimension cards inside detail */
.dim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.dim-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius-sm);
}
.dim-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.dim-position {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 3px;
}
.dim-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}
.dim-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    position: relative;
    margin-bottom: 4px;
}
.dim-marker {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.dim-ends {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Action items */
.action-list { display: flex; flex-direction: column; gap: 0; }
.action-row {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.action-row:last-child { border-bottom: none; }
.action-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    color: white;
    flex-shrink: 0;
    margin-top: 1px;
}
.action-row h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}
.action-row p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0;
}

/* Adjacent archetype links */
.adjacent-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius-sm);
    transition: all 0.15s;
    cursor: pointer;
    margin-bottom: 8px;
}
.adjacent-link:last-child { margin-bottom: 0; }
.adjacent-link:hover { border-color: var(--teal); background: rgba(15,168,158,0.02); }
.adjacent-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.adjacent-link h5 {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1px;
}
.adjacent-link .adj-relation {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cross-study cards */
.cross-study {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--card-radius-sm);
    margin-bottom: 10px;
}
.cross-study:last-child { margin-bottom: 0; }
.cross-study-label {
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.cross-study p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 8px;
}
.cross-study-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cross-study-link {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s;
    cursor: pointer;
}
.cross-study-link:hover { border-color: var(--teal); color: var(--teal); }

/* VI range bar */
.vi-range-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    position: relative;
    margin: 12px 0 6px;
}
.vi-range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 5px;
}
.vi-range-ends {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Sibling list */
.sibling-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}
.sibling-item:hover { background: rgba(15,168,158,0.04); }
.sibling-item.current {
    background: rgba(15,168,158,0.06);
    font-weight: 600;
    color: var(--navy);
}
.sibling-item i { font-size: 0.55rem; opacity: 0.4; }
.sibling-item .vi-tag {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    cursor: help;
    position: relative;
}

@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .dim-grid { grid-template-columns: 1fr; }
}

/* ─── Quick-Start Banner ─────────────────────── */
.quick-start {
    background: linear-gradient(135deg, rgba(147,51,234,0.06), rgba(15,168,158,0.06));
    border: 1px solid rgba(147,51,234,0.1);
    border-radius: var(--card-radius);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.quick-start-text {
    display: flex;
    align-items: center;
    gap: 14px;
}
.quick-start-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--progress-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--progress);
}
.quick-start h4 {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 2px;
}
.quick-start p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Responsive ─────────────────────── */
@media (max-width: 1024px) {
    .studies-row, .archetype-results, .findings-grid { grid-template-columns: 1fr 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Sidebar Search ─────────────────────── */
.sidebar-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.sidebar-search-input:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}
.sidebar-search-input i {
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
}
.sidebar-search-input span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    flex: 1;
}
.sidebar-search-input kbd {
    font-size: 0.58rem;
    font-family: var(--font-body);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ─── Q&A Search View ─────────────────────── */
.qa-container {
    max-width: 780px;
    margin: 0 auto;
}
.qa-search-box {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}
.qa-input-area {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
}
.qa-input-area textarea {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.5;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    color: var(--text-primary);
    background: transparent;
}
.qa-input-area textarea::placeholder {
    color: var(--text-muted);
}
.qa-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--teal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.qa-send-btn:hover {
    background: #0dbfb3;
    transform: scale(1.05);
}
.qa-filters {
    display: flex;
    gap: 6px;
    padding: 0 24px 16px;
    flex-wrap: wrap;
}
.qa-filter {
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.qa-filter:hover {
    border-color: var(--teal);
    color: var(--teal);
}
.qa-filter.active {
    background: var(--teal-dim);
    border-color: var(--teal);
    color: var(--teal);
}

/* Q&A Results */
.qa-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.qa-message {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.qa-message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 0;
}
.qa-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}
.qa-avatar.user {
    background: linear-gradient(135deg, var(--progress), #7c22d4);
}
.qa-avatar.ai {
    background: linear-gradient(135deg, var(--teal), #0dbfb3);
}
.qa-sender {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy);
}
.qa-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-left: auto;
}
.qa-message-body {
    padding: 12px 24px 20px;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
}
.qa-message-body p { margin-bottom: 10px; }
.qa-message-body p:last-child { margin-bottom: 0; }

/* Source citations */
.qa-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px 16px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 14px;
}
.qa-source {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.qa-source:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-dim);
}
.qa-source i {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* Suggested questions */
.qa-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}
.qa-suggestion {
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: var(--card-radius-sm);
    box-shadow: var(--card-shadow);
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.qa-suggestion:hover {
    border-color: var(--teal);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}
.qa-suggestion i {
    color: var(--teal);
    font-size: 0.72rem;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Findings tabs */
.findings-tab { display: none; }
.findings-tab.active { display: block; }

/* Share buttons row */
.share-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.share-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-dim);
}
.share-btn.linkedin { color: #0077b5; }
.share-btn.linkedin:hover { border-color: #0077b5; background: rgba(0,119,181,0.06); }
.share-btn.twitter { color: var(--text-primary); }
.share-btn.twitter:hover { border-color: var(--text-primary); background: rgba(0,0,0,0.04); }
.share-btn.pdf { color: var(--coral); }
.share-btn.pdf:hover { border-color: var(--coral); background: var(--coral-dim); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .studies-row, .archetype-results, .findings-grid, .two-col, .two-col-wide {
        grid-template-columns: 1fr;
    }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .page-header { padding: 20px 16px 0; }
    .page-body { padding: 16px; }
    .tab-bar { padding: 0 16px; overflow-x: auto; }
    .qa-suggestions { grid-template-columns: 1fr; }
}

/* ─── Home view tabs ─────────────────────────── */
.home-tab { display: none; }
.home-tab.active { display: block; }
.about-study-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.about-study-row:last-child { border-bottom: none; }
.about-study-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* ─── Home tab section containers ─────────────────────────── */
.home-tab .section { padding: 80px 40px; }
.home-tab .section-white { background: white; }
.home-tab .section-warm { background: var(--page-bg); }
.home-tab .section-navy { background: var(--navy); color: white; }

/* ─── Home tab section header ─────────────────────────── */
.home-tab .section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.home-tab .section-header .eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--progress);
    margin-bottom: 12px;
}
.home-tab .section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 14px;
}
.home-tab .section-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── Home tab study cards ─────────────────────────── */
.home-tab .studies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}
.home-tab .study-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.home-tab .study-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}
.home-tab .study-card-accent { height: 4px; width: 100%; }
.home-tab .study-card-accent.teal { background: var(--teal); }
.home-tab .study-card-accent.gold { background: var(--gold); }
.home-tab .study-card-accent.coral { background: var(--coral); }
.home-tab .study-card-body { padding: 28px 28px 24px; flex: 1; display: flex; flex-direction: column; }
.home-tab .study-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
}
.home-tab .study-label.teal { color: var(--teal); }
.home-tab .study-label.gold { color: var(--gold); }
.home-tab .study-label.coral { color: var(--coral); }
.home-tab .study-label .study-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
}
.home-tab .study-icon.teal { background: var(--teal); }
.home-tab .study-icon.gold { background: var(--gold); }
.home-tab .study-icon.coral { background: var(--coral); }
.home-tab .study-card h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 10px;
    color: var(--navy);
}
.home-tab .study-card .study-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 20px;
    flex: 1;
}
.home-tab .study-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.home-tab .study-meta i { margin-right: 4px; opacity: 0.6; }
.home-tab .btn-study {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}
.home-tab .btn-study.teal { background: var(--teal); }
.home-tab .btn-study.teal:hover { background: #0dbfb3; box-shadow: 0 4px 16px rgba(15,168,158,0.25); }
.home-tab .btn-study.gold { background: var(--gold); }
.home-tab .btn-study.gold:hover { background: #ddb34e; box-shadow: 0 4px 16px rgba(212,168,67,0.25); }
.home-tab .btn-study.coral { background: var(--coral); }
.home-tab .btn-study.coral:hover { background: #e88d74; box-shadow: 0 4px 16px rgba(224,122,95,0.25); }

/* ─── Home tab trust strip ─────────────────────────── */
.home-tab .trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.home-tab .trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.home-tab .trust-item i { color: var(--teal); font-size: 0.85rem; }

/* ─── Home tab steps (How It Works) ─────────────────────────── */
.home-tab .steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}
.home-tab .step-card {
    text-align: center;
    position: relative;
}
.home-tab .step-number {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    background: var(--progress-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--progress);
}
.home-tab .step-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--navy);
}
.home-tab .step-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.home-tab .step-connector {
    position: absolute;
    top: 22px;
    left: calc(50% + 30px);
    width: calc(100% - 60px);
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border-light) 0, var(--border-light) 4px, transparent 4px, transparent 8px);
}

/* ─── Home tab archetype preview ─────────────────────────── */
.home-tab .archetype-showcase {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.home-tab .archetype-text h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 16px;
}
.home-tab .archetype-text p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}
.home-tab .archetype-features { display: flex; flex-direction: column; gap: 14px; }
.home-tab .archetype-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.home-tab .archetype-feature i { color: var(--teal); margin-top: 3px; font-size: 0.75rem; }
.home-tab .archetype-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-tab .archetype-pill {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 14px rgba(10,37,64,0.08);
    transition: transform 0.3s;
}
.home-tab .archetype-pill:hover { transform: translateY(-2px); }
.home-tab .archetype-pill .pill-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: white;
}
.home-tab .archetype-pill h5 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--navy);
}
.home-tab .archetype-pill .pill-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
.home-tab .archetype-pill:nth-child(1) .pill-icon { background: var(--teal); }
.home-tab .archetype-pill:nth-child(2) .pill-icon { background: var(--gold); }
.home-tab .archetype-pill:nth-child(3) .pill-icon { background: var(--coral); }
.home-tab .archetype-pill:nth-child(4) .pill-icon { background: var(--progress); }

/* ─── Home tab dashboard preview ─────────────────────────── */
.home-tab .dashboard-preview {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.home-tab .dashboard-mockup {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.home-tab .dashboard-mockup-header {
    background: var(--navy);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.home-tab .mock-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.home-tab .mock-dot:first-child { background: #ff5f57; }
.home-tab .mock-dot:nth-child(2) { background: #febc2e; }
.home-tab .mock-dot:nth-child(3) { background: #28c840; }
.home-tab .mock-url {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    margin-left: 12px;
    font-family: monospace;
}
.home-tab .dashboard-mockup-body {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}
.home-tab .mock-result-card { border-radius: 10px; padding: 16px; border-top: 3px solid; }
.home-tab .mock-result-card:nth-child(1) { border-color: var(--teal); background: var(--teal-light); }
.home-tab .mock-result-card:nth-child(2) { border-color: var(--gold); background: var(--gold-light); }
.home-tab .mock-result-card:nth-child(3) { border-color: var(--coral); background: var(--coral-light); }
.home-tab .mock-study-name {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.home-tab .mock-archetype-name { font-family: var(--font-heading); font-size: 0.95rem; color: var(--navy); margin-bottom: 4px; }
.home-tab .mock-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(22,163,74,0.1);
    color: #16a34a;
}
.home-tab .dashboard-text h2 { font-family: var(--font-heading); font-size: 2.2rem; line-height: 1.2; margin-bottom: 16px; }
.home-tab .dashboard-text p { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }
.home-tab .dashboard-features { display: flex; flex-direction: column; gap: 12px; }
.home-tab .dashboard-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.home-tab .dashboard-feat .feat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--progress-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--progress);
    flex-shrink: 0;
}

/* ─── Home tab responsive ─────────────────────────── */
@media (max-width: 900px) {
    .home-tab .studies-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
    .home-tab .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .home-tab .step-connector { display: none; }
    .home-tab .archetype-showcase,
    .home-tab .dashboard-preview { grid-template-columns: 1fr; }
    .home-tab .section-header h2 { font-size: 1.8rem; }
}
@media (max-width: 600px) {
    .home-tab .section { padding: 56px 20px; }
    .home-tab .archetype-cards { grid-template-columns: 1fr; }
    .home-tab .dashboard-mockup-body { grid-template-columns: 1fr; }
}
