:root {
    --color-bg: #f7f8fa;
    --color-surface: #ffffff;
    --color-text: #1c1f24;
    --color-muted: #5a6473;
    --color-border: #e1e4ea;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.05);
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

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

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1;
}

.brand-logo {
    display: block;
    height: 2.25rem;       /* ~36px — fits the header without crowding the nav */
    width: auto;
    max-width: 100%;
}

.primary-nav {
    flex: 1;
}

.primary-nav ul {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-nav a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.primary-nav a:hover { color: var(--color-text); }

/* ---------- Burger nav toggle (responsive) ---------- */

/* Default state: button hidden on wide screens (nav is inline). */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    padding: 0.5rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: auto;  /* push the burger to the right of the brand */
    color: inherit;
}
.nav-toggle:hover,
.site-header.nav-open .nav-toggle,
.admin-header.nav-open .nav-toggle {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.12);
}
.admin-header .nav-toggle:hover,
.admin-header.nav-open .nav-toggle {
    background: rgba(241, 245, 249, 0.08);
    border-color: rgba(241, 245, 249, 0.18);
}
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-text);
    transition: transform 0.22s ease, opacity 0.18s ease;
}
.admin-header .nav-toggle-bar { background: #f1f5f9; }

/* Animate to X when open. */
.site-header.nav-open  .nav-toggle-bar:nth-child(1),
.admin-header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px)  rotate(45deg); }
.site-header.nav-open  .nav-toggle-bar:nth-child(2),
.admin-header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.nav-open  .nav-toggle-bar:nth-child(3),
.admin-header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* On narrower screens, show the burger and collapse the inline nav into a
   slide-down panel that lives just under the header. The brand logo gets the
   whole first row so it stays prominent and readable; burger + user menu live
   on the second row. */
@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; margin-left: 0; }

    .site-header, .admin-header { position: relative; }

    .header-inner {
        flex-wrap: wrap;
        gap: 0.4rem 0.75rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    /* Row 1: brand gets the full width. */
    .brand,
    .brand-group {
        flex: 1 0 100%;
        order: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.4rem 0;
    }
    .brand-logo {
        height: 3rem;             /* bigger on mobile so it's the focal point of the row */
        margin: 0 auto;
    }

    /* Row 2: burger on the left, user menu / auth on the right. */
    .nav-toggle { order: 2; }
    .auth-nav   { order: 3; margin-left: auto; }
    .primary-nav { order: 4; }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex: 0;
        background: #ffffff;
        border-top: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.28s ease;
        z-index: 40;
    }
    .admin-header .primary-nav {
        background: #1f2937;
        border-color: rgba(241, 245, 249, 0.12);
    }

    .site-header.nav-open  .primary-nav,
    .admin-header.nav-open .primary-nav {
        max-height: 80vh;
        overflow: auto;
    }

    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem;
    }
    .primary-nav ul li { width: 100%; }
    .primary-nav ul li a {
        display: block;
        padding: 0.75rem 0.5rem;
        border-radius: 0.4rem;
        font-size: 1rem;
    }
    .primary-nav ul li a:hover { background: rgba(15, 23, 42, 0.04); }
    .admin-header .primary-nav ul li a:hover { background: rgba(241, 245, 249, 0.06); }

    /* The Upgrade chip looks awkward as a full-width row; make it pill-shaped inline. */
    .primary-nav a.nav-upgrade {
        display: inline-block;
        margin: 0.25rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-toggle-bar { transition: none; }
    .primary-nav    { transition: none; }
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-greeting {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.inline-form { display: inline; margin: 0; }

/* Main */
.site-main {
    flex: 1;
    padding: 2.5rem 1.5rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 1rem 0;
    color: var(--color-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-link {
    background: none;
    color: var(--color-primary);
    padding: 0.4rem 0.6rem;
}
.btn-link:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Inline variant: small padding so a "btn-link" can sit inline with surrounding
   text (e.g. the "Generate a strong one for me" link inside the password hint). */
.btn-link.btn-inline {
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.btn-block { width: 100%; }

/* Hero / home */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}
.hero h1 { font-size: 2.25rem; margin: 0 0 0.5rem; }
.lede { color: var(--color-muted); font-size: 1.05rem; margin-bottom: 1.5rem; }

.cta-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.features article {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.features h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.features p { margin: 0; color: var(--color-muted); font-size: 0.95rem; }

/* Auth card */
.auth-card {
    max-width: 420px;
    margin: 1rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.auth-card h1 { margin: 0 0 1.25rem; font-size: 1.5rem; }
.auth-alt {
    margin-top: 1.25rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
}
.auth-alt a { color: var(--color-primary); }

/* Forms */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.form-row label {
    font-size: 0.9rem;
    font-weight: 500;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="date"],
.form-row input[type="month"],
.form-row input[type="number"],
.form-row textarea {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}
.form-row textarea {
    width: 100%;
    resize: vertical;
    min-height: 5rem;
}
.form-row input:focus,
.form-row textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

.checkbox-row { flex-direction: row; align-items: center; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.95rem;
    cursor: pointer;
}

.hint { color: var(--color-muted); font-size: 0.8rem; }

.field-error {
    color: var(--color-danger);
    font-size: 0.85rem;
}

.validation-summary {
    color: var(--color-danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding-left: 1.1rem; }

.text-danger { color: var(--color-danger); }

/* Profile form */
.profile-form-wrap {
    max-width: 760px;
    margin: 0 auto;
}
.profile-form-header { margin-bottom: 1.5rem; }
.profile-form-header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }

.profile-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 0;
}
.form-section legend {
    font-weight: 600;
    padding: 0 0.4rem;
    color: var(--color-text);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 720px) {
    .grid-3 { grid-template-columns: 1fr; }
}

.family-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}
.family-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.family-row .form-row { margin-bottom: 0; }
.family-row .family-remove { white-space: nowrap; align-self: end; padding-bottom: 0.6rem; }
@media (max-width: 540px) {
    .family-row { grid-template-columns: 1fr; }
    .family-row .family-remove { justify-self: start; padding-left: 0; }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}
.dashboard-header h1 { margin: 0; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.card h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }

.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}
.kv dt { color: var(--color-muted); font-size: 0.85rem; }
.kv dd { margin: 0; font-weight: 500; }

.family-summary {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.muted { color: var(--color-muted); }

/* Onboarding step indicator */
.onboarding-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}
.onboarding-steps li {
    counter-increment: step;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
}
.onboarding-steps li::before {
    content: counter(step) ". ";
    font-variant-numeric: tabular-nums;
}
.onboarding-steps li.done {
    background: #eef9f0;
    border-color: #bfe5c6;
    color: var(--color-success);
}
.onboarding-steps li.current {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--color-primary);
    font-weight: 600;
}

/* Subject rows (4 cols on wide, stacked on narrow) */
.subject-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.subject-row .form-row { margin-bottom: 0; }
.subject-row .subject-expected { align-self: end; padding-bottom: 0.55rem; }
.subject-row .subject-remove { align-self: end; padding-bottom: 0.6rem; white-space: nowrap; }
@media (max-width: 640px) {
    .subject-row { grid-template-columns: 1fr; }
    .subject-row .subject-remove,
    .subject-row .subject-expected { justify-self: start; padding-left: 0; }
}

/* Education on dashboard */
.education-section { margin-top: 2rem; }
.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.education-header h2 { margin: 0; font-size: 1.1rem; }

.education-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.education-card { position: relative; }
.education-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.education-card-header h3 { margin: 0; font-size: 1rem; }
.education-card-header p { margin: 0.15rem 0 0; font-size: 0.9rem; }
.education-years {
    font-size: 0.85rem;
    color: var(--color-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.grade-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.grade-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--color-border);
}
.grade-list li:last-child { border-bottom: none; }
.subject-name { font-weight: 500; }

.grade-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.grade-achieved {
    background: #eef9f0;
    color: var(--color-success);
}
.grade-expected {
    background: #fef3c7;
    color: #92400e;
}

/* Multi-institution form */
.institution-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.institution-block legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 0.4rem;
}
.institution-number { font-weight: 600; }
.institution-remove {
    color: var(--color-muted);
    font-size: 0.85rem;
}
.institution-remove:hover { color: var(--color-danger); }

.subjects-area {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--color-border);
}
.subjects-area h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: var(--color-muted);
}
.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

.btn-add-institution {
    align-self: flex-start;
}

/* Form inputs: cover <select> too */
.form-row select {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}
.form-row select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

/* Achievements form rows */
.achievement-list, .skill-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.5rem 0 1rem;
}
.achievement-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    grid-template-areas:
        "title  year remove"
        "desc   desc desc";
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    align-items: end;
}
.achievement-row .form-row { margin-bottom: 0; }
.achievement-row .form-row:nth-child(1) { grid-area: title; }
.achievement-row .form-row:nth-child(2) { grid-area: year; }
.achievement-row .achievement-desc { grid-area: desc; }
.achievement-row .achievement-remove {
    align-self: end;
    padding-bottom: 0.55rem;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .achievement-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "year"
            "desc"
            "remove";
    }
    .achievement-row .achievement-remove { justify-self: start; padding-left: 0; }
}

.skill-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    align-items: end;
}
.skill-row .form-row { margin-bottom: 0; }
.skill-row .skill-remove {
    align-self: end;
    padding-bottom: 0.55rem;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .skill-row { grid-template-columns: 1fr; }
    .skill-row .skill-remove { justify-self: start; padding-left: 0; }
}

/* Achievements + Skills on dashboard */
.achievements-section { margin-top: 2rem; }

.achievement-summary {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.achievement-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.achievement-line strong { flex: 0 0 auto; }
.achievement-line .muted { font-size: 0.85rem; }
.achievement-desc { margin: 0.15rem 0 0; font-size: 0.9rem; }

.skill-chips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.85rem;
}
.chip-name { font-weight: 500; }
.chip-level {
    font-size: 0.75rem;
    color: var(--color-muted);
    padding: 0 0.4rem;
    border-left: 1px solid var(--color-border);
}

/* ---------- Assessment / question engine ---------- */

.assessment-promo { margin-top: 2rem; }
.assessment-promo .education-header { margin-bottom: 1rem; }
.assessment-promo .education-header > div { flex: 1; }
.assessment-promo .education-header h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.assessment-promo .education-header .muted { font-size: 0.9rem; }

/* Progress bar (used in assessment index, dashboard promo, per-question) */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 200ms ease;
}

.assessment-overall { margin: 1rem 0 1.5rem; }
.progress-text {
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.trait-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Trait grid (assessment index) */
.trait-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.trait-card { display: flex; flex-direction: column; gap: 0.6rem; }
.trait-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}
.trait-card-header h2 {
    margin: 0;
    font-size: 1rem;
}
.trait-count { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.trait-desc { margin: 0; font-size: 0.9rem; }
.trait-progress { margin-top: 0.25rem; }
.trait-avg { margin: 0; font-size: 0.85rem; }
.trait-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

/* Question page */
.question-progress { margin-bottom: 1.5rem; }
.question-progress .progress-text {
    font-size: 0.85rem;
}

.question-form .form-section {
    padding: 1.5rem;
}
.question-block .question-text {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.4;
}

.question-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    resize: vertical;
    min-height: 7rem;
}
.question-form textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

/* 1-5 scale */
.scale-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 1rem 0 0.4rem;
}
.scale-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: var(--radius);
    padding: 0.9rem 0;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.scale-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.scale-option:hover { border-color: var(--color-primary); }
.scale-option:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}
.scale-option:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}
.scale-number { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.question-actions {
    justify-content: space-between;
}
.question-actions-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Trait review */
.trait-review {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.review-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 500;
}
.review-text {
    margin: 0;
    white-space: pre-wrap;
    background: var(--color-bg);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.93rem;
}
.review-scale { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.scale-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Admin area ---------- */

.admin-body { background: #f3f4f7; }

.admin-header {
    background: #0f172a;
    color: #e6e9ef;
    border-bottom: 1px solid #1f2937;
}
.admin-header .brand,
.admin-header .primary-nav a { color: #e6e9ef; }
.admin-header .primary-nav a:hover { color: #ffffff; }
.admin-header .auth-greeting { color: #94a3b8; }
.admin-header .btn-link { color: #93c5fd; }
.admin-header .btn-link:hover { color: #bfdbfe; }

.brand-group { display: flex; align-items: center; gap: 0.6rem; }
.brand-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-flash {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.admin-page { display: flex; flex-direction: column; gap: 1rem; }
.admin-page .dashboard-header { margin-bottom: 0.5rem; }

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card { text-align: center; padding: 1.5rem 1rem; }
.stat-value { margin: 0; font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 1rem; font-weight: 400; }
.stat-label { margin: 0.25rem 0 0; font-size: 0.85rem; }

.admin-quick { margin-top: 1rem; }
.admin-quick .card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.admin-quick .card h3 { margin: 0; font-size: 1rem; }
.admin-quick .card p { margin: 0; font-size: 0.9rem; }

/* Admin payments statement */
.ps-statement-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ps-statement-filter .form-row { margin-bottom: 0; }
.ps-statement-filter .form-actions { margin: 0; display: flex; gap: 0.5rem; align-items: center; }
.section-subhead { font-size: 1.05rem; margin: 1.75rem 0 0.75rem; }

/* Admin tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.92rem;
}
.admin-table thead th {
    background: #f8fafc;
    text-align: left;
    padding: 0.7rem 0.85rem;
    font-weight: 600;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.admin-table .actions {
    text-align: right;
    white-space: nowrap;
}
.admin-table .actions .btn-link { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.admin-table .question-cell { max-width: 32rem; line-height: 1.4; }
.admin-table .row-inactive { background: #fafafa; color: var(--color-muted); }
.admin-table .row-inactive code { color: var(--color-muted); }

.key-cell {
    background: var(--color-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-active { background: #ecfdf5; color: #047857; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-admin { background: #eef2ff; color: #4338ca; }

.btn-danger.btn-link { color: var(--color-danger); }
.btn-danger.btn-link:hover { color: #b91c1c; }

.admin-filter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}
.admin-filter select {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
}

/* ---------- Trait scoring ---------- */

.score-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.score-badge.score-large {
    padding: 0.4rem 0.9rem;
    font-size: 1.05rem;
}

.score-strong   { background: #d1fae5; color: #065f46; }
.score-good     { background: #dbeafe; color: #1e40af; }
.score-moderate { background: #fef3c7; color: #92400e; }
.score-low      { background: #fee2e2; color: #991b1b; }

.trait-progress-text {
    margin: 0;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* Score breakdown card on the trait review page */
.score-breakdown-card { margin-bottom: 1.5rem; }
.score-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.score-breakdown-header h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.score-breakdown-header p { margin: 0; font-size: 0.9rem; }

.score-breakdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}
.score-breakdown-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    flex-wrap: wrap;
}

.score-help {
    margin-top: 1rem;
    padding: 0.6rem 0.85rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.score-help summary {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
}
.score-help ul {
    margin: 0.6rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* AI-score badging */
.trait-score-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}
.score-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 0.35rem;
    margin-right: 0.25rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.45);
    vertical-align: middle;
}
.score-ai { box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35); }

.ai-score-card {
    background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 100%);
    border-color: #c7d2fe;
}
.ai-score-card h2 .score-tag {
    background: #6366f1;
    color: #ffffff;
}
.ai-reasoning {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
}

/* ---------- Current affairs ---------- */

.current-affairs-prompt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
    margin-bottom: 2rem;
}
.current-affairs-prompt h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.current-affairs-prompt p { margin: 0; font-size: 0.9rem; }

.ca-category-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ca-question-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.ca-question-card {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, transform 60ms ease;
}
.ca-question-card:hover { border-color: var(--color-primary); }
.ca-question-card.picked {
    border-color: var(--color-primary);
    background: #eef2ff;
}
.ca-question-card .ca-question-check {
    margin-top: 0.25rem;
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.ca-question-body { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.ca-question-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
}

.ca-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.ca-counter { font-size: 0.9rem; }

.ca-decline-form {
    margin-top: 0.5rem;
    text-align: center;
}

.more-card {
    text-align: center;
    max-width: 540px;
    margin: 1rem auto;
    padding: 2rem;
}
.more-card h1 { margin: 0 0 0.5rem; }
.more-card .form-actions { justify-content: center; margin-top: 1rem; }
.more-card .small-note { margin-top: 0.5rem; font-size: 0.85rem; }

/* ---------- Cognitive profile ---------- */

.cognitive-section { margin-top: 2rem; }
.cognitive-section .score-tag {
    background: #6366f1;
    color: #ffffff;
}

.cognitive-card {
    background: linear-gradient(135deg, #fafafa 0%, #f5f3ff 100%);
    border-color: #ddd6fe;
}
.cognitive-card .small-note {
    margin: 0 0 1rem;
    font-size: 0.8rem;
}

.cognitive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.6rem;
}

.cognitive-dim {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 0.95rem;
    transition: border-color 120ms ease;
}
.cognitive-dim summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.95rem;
}
.cognitive-dim summary::-webkit-details-marker { display: none; }
.cognitive-dim summary::before {
    content: "▸";
    color: var(--color-muted);
    margin-right: 0.4rem;
    transition: transform 120ms ease;
    display: inline-block;
}
.cognitive-dim[open] summary::before { transform: rotate(90deg); }

.cognitive-name { font-weight: 600; flex: 1; }
.cognitive-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.9rem;
}

.cognitive-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.6rem 0 0.4rem;
}
.cognitive-bar-fill { height: 100%; border-radius: 999px; }
.cognitive-dim.score-strong   { border-left-color: #10b981; }
.cognitive-dim.score-good     { border-left-color: #3b82f6; }
.cognitive-dim.score-moderate { border-left-color: #f59e0b; }
.cognitive-dim.score-low      { border-left-color: #ef4444; }
.cognitive-dim.score-strong   .cognitive-bar-fill { background: #10b981; }
.cognitive-dim.score-good     .cognitive-bar-fill { background: #3b82f6; }
.cognitive-dim.score-moderate .cognitive-bar-fill { background: #f59e0b; }
.cognitive-dim.score-low      .cognitive-bar-fill { background: #ef4444; }

.cognitive-reasoning {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text);
}

/* Dashboard trait-score list */
.scores-section { margin-top: 2rem; }
.score-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.score-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.score-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
}
.score-row-head a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}
.score-row-head a:hover { color: var(--color-primary); }
.score-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.score-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 999px;
}
.score-strong .score-bar-fill   { background: #10b981; }
.score-good .score-bar-fill     { background: #3b82f6; }
.score-moderate .score-bar-fill { background: #f59e0b; }
.score-low .score-bar-fill      { background: #ef4444; }

/* ---------- Experience cards ---------- */
.experience-section { margin-top: 2rem; }
.experience-card .experience-block {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--color-border);
}
.experience-card .experience-block h4 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}
.experience-card .experience-block p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.93rem;
    line-height: 1.5;
}
.experience-type-pill {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.experience-card .form-row textarea { width: 100%; }

/* ---------- Profile completeness widget ---------- */

.completeness-card { margin-bottom: 1.5rem; }
.completeness-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.completeness-header h2 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.completeness-header p { margin: 0; font-size: 0.9rem; }

.completeness-pct-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
}

.completeness-missing-label {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}
.completeness-missing {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.4rem 1rem;
}
.completeness-missing li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0.55rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.completeness-missing a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}
.completeness-missing a:hover { text-decoration: underline; }
.completeness-missing .muted { font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.ai-cooldown-note {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    color: #92400e !important;
    font-weight: 500;
}

/* Signup consent block */
.consent-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin: 0.5rem 0 1rem;
    background: var(--color-bg);
}
.consent-row { margin-bottom: 0.6rem; align-items: flex-start; }
.consent-row:last-child { margin-bottom: 0; }
.consent-row .checkbox-label { align-items: flex-start; gap: 0.6rem; font-size: 0.88rem; line-height: 1.45; }
.consent-row .checkbox-label input { margin-top: 0.18rem; }
.consent-row a { color: var(--color-primary); }

/* ---------- Cognitive review page ---------- */

.cognitive-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.cognitive-improvements {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.75rem;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.cognitive-improvements strong { color: #047857; }

.review-summary-card {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fafafa 0%, #f5f3ff 100%);
    border-color: #ddd6fe;
}
.review-summary-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 640px) {
    .review-summary-grid { grid-template-columns: 1fr; }
}
.review-overall {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.review-overall-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
}
.review-overall-value {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    align-self: flex-start;
}
.review-strengths h3, .review-weakest h3 {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}
.review-strengths ul, .review-weakest ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.95rem;
}
.review-strengths li, .review-weakest li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.review-dimensions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-dim-card {
    border-left: 4px solid var(--color-border);
}
.review-dim-card.score-strong   { border-left-color: #10b981; }
.review-dim-card.score-good     { border-left-color: #3b82f6; }
.review-dim-card.score-moderate { border-left-color: #f59e0b; }
.review-dim-card.score-low      { border-left-color: #ef4444; }

.review-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.review-dim-header h2 { margin: 0; font-size: 1.15rem; }

.review-block {
    margin-top: 1rem;
}
.review-block h3 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}
.review-block p {
    margin: 0;
    line-height: 1.55;
}

.review-improvements {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    padding: 0.7rem 0.85rem;
    white-space: pre-wrap;
}

/* ---------- Daily-question feedback / history ---------- */

.current-affairs-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-history-link {
    text-align: right;
    margin: -1rem 0 1rem;
    font-size: 0.85rem;
}
.dashboard-history-link a { color: var(--color-primary); }

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.feedback-card {
    border-left: 4px solid var(--color-border);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.feedback-question {
    margin: 0.4rem 0 0;
    font-size: 1.02rem;
    line-height: 1.45;
    font-weight: 500;
}

.feedback-block { margin-top: 0.85rem; }
.feedback-block h4 {
    margin: 0 0 0.3rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    font-weight: 600;
}
.feedback-block p {
    margin: 0;
    line-height: 1.55;
    white-space: pre-wrap;
}

.feedback-answer p {
    padding: 0.6rem 0.8rem;
    background: var(--color-bg);
    border-radius: 4px;
    font-size: 0.95rem;
}

.feedback-praise p {
    padding: 0.55rem 0.8rem;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    color: #78350f;
    font-size: 0.93rem;
}

.feedback-comments p {
    padding: 0.55rem 0.8rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.93rem;
}

.feedback-suggestions p {
    padding: 0.55rem 0.8rem;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    color: #064e3b;
    font-size: 0.93rem;
}

/* Admin backfill banner */
.backfill-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.backfill-banner h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.backfill-banner p { margin: 0; font-size: 0.9rem; }

/* ---------- Interests (profile section + dashboard chips) ---------- */

.interest-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) 1.2fr 1.5fr auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.interest-row .form-row { margin-bottom: 0; }
.interest-row .interest-remove { white-space: nowrap; align-self: end; padding-bottom: 0.6rem; }
@media (max-width: 720px) {
    .interest-row { grid-template-columns: 1fr; }
    .interest-row .interest-remove { justify-self: start; padding-left: 0; }
}

.interest-chips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.interest-chip {
    align-items: baseline;
    padding: 0.2rem 0.55rem 0.2rem 0.5rem;
    gap: 0.35rem;
}
.interest-chip .chip-type {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}
.interest-chip .chip-level {
    font-style: italic;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interest-chip.interest-hobby    { border-color: #c7d2fe; }
.interest-chip.interest-hobby    .chip-type { background: #eef2ff; color: #4338ca; }
.interest-chip.interest-sport    { border-color: #bbf7d0; }
.interest-chip.interest-sport    .chip-type { background: #ecfdf5; color: #047857; }
.interest-chip.interest-interest { border-color: #fde68a; }
.interest-chip.interest-interest .chip-type { background: #fef3c7; color: #92400e; }
.interest-chip.interest-other    { border-color: var(--color-border); }
.interest-chip.interest-other    .chip-type { background: #f3f4f6; color: #4b5563; }

/* Daily-question history stats card (mirrors completeness card layout) */
.daily-history-card { margin-bottom: 1.5rem; }
.completeness-pct-divisor { font-size: 1rem; font-weight: 500; color: var(--color-muted); }

.daily-stats {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    font-size: 0.95rem;
}
.daily-stats li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.daily-stats strong {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}
.daily-stats .muted { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Personal Statement targets ---------- */

.ps-target-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ps-target-card {
    border-left: 4px solid var(--color-border);
}
.ps-target-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.ps-target-header h2 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.ps-target-header p { margin: 0; font-size: 0.9rem; }

.ps-acceptance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: right;
}
.ps-acceptance-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ps-acceptance-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}

.ps-notes { margin: 0.25rem 0 0.75rem; }

.ps-block { margin-top: 1rem; }
.ps-block h3 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    font-weight: 600;
}
.ps-block p {
    margin: 0;
    line-height: 1.55;
    white-space: pre-wrap;
}

.ps-acceptance-block p {
    background: #f1f5f9;
    padding: 0.6rem 0.85rem;
    border-radius: 4px;
    font-size: 0.93rem;
}

.ps-improvements p {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    padding: 0.7rem 0.85rem;
    border-radius: 4px;
    color: #064e3b;
    font-size: 0.93rem;
}

.ps-target-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

/* ---------- PS tabs ---------- */

.ps-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ps-tabs { margin-top: 1rem; }

.ps-tabs-strip {
    display: flex;
    gap: 0.4rem;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    margin-bottom: 1.2rem;
}

.ps-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid transparent;
    border-bottom: none;
    background: var(--color-bg);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    cursor: pointer;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.92rem;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
}
.ps-tab:hover { background: #eef2ff; }
.ps-tab.active {
    background: var(--color-surface);
    border-color: var(--color-border);
    border-bottom: 2px solid var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
}

.ps-tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-muted);
    flex: 0 0 auto;
}
.ps-tab.active .ps-tab-number {
    background: var(--color-primary);
    color: #fff;
}

.ps-tab-labels {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.ps-tab-uni { font-size: 0.92rem; }
.ps-tab-course { font-size: 0.72rem; }

.ps-tab-pct {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.ps-panel { display: none; }
.ps-panel.active { display: block; }
.ps-panel > .card { margin-bottom: 1rem; }

/* ---------- PS body ---------- */

.ps-ps-card {
    background: linear-gradient(135deg, #fafafa 0%, #eef2ff 100%);
    border-color: #c7d2fe;
}
.ps-ps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.ps-ps-header h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.ps-ps-header .small-note { margin: 0; }

.ps-statement-meta { margin-bottom: 0.6rem; }

.ps-statement-body {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    line-height: 1.65;
    white-space: pre-wrap;
    font-size: 0.97rem;
    color: var(--color-text);
    max-height: 70vh;
    overflow-y: auto;
    /* Lock the text to its natural casing and a single uniform font-size — no small-caps,
       no text transforms, no all-caps emphasis sneaking in. */
    text-transform: none;
    font-variant: normal;
    font-feature-settings: normal;
}
.ps-statement-body * {
    font-size: inherit !important;
    text-transform: none !important;
    font-variant: normal !important;
}

.ps-edit-form { margin: 0; }

.ps-statement-editable {
    display: block;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    resize: vertical;
    min-height: 22rem;
    font-family: inherit;
    box-sizing: border-box;
}

.ps-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.ps-edit-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.6rem;
}
.ps-changes-hint {
    display: inline-block;
    padding: 0.4rem 0.6rem;
    background: #f8fafc;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
}

.ps-changes-analysis {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
}
.ps-changes-analysis h4 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #854d0e;
}
.ps-changes-analysis p { margin: 0 0 0.3rem; }
.ps-changes-analysis p:last-child { margin-bottom: 0; }

.ps-archive {
    margin-top: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #ffffff;
}
.ps-archive > summary {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
    list-style: none;
}
.ps-archive > summary::-webkit-details-marker { display: none; }
.ps-archive > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.4rem;
    transition: transform 0.15s ease;
}
.ps-archive[open] > summary::before { transform: rotate(90deg); }

.ps-archive-list {
    list-style: none;
    margin: 0;
    padding: 0 0.9rem 0.6rem;
}
.ps-archive-list li {
    border-top: 1px solid var(--color-border);
    padding: 0.5rem 0;
}
.ps-archive-list li:first-child { border-top: 0; }

.ps-archive-entry > summary {
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    list-style: none;
}
.ps-archive-entry > summary::-webkit-details-marker { display: none; }
.ps-archive-version {
    font-weight: 600;
    color: var(--color-text);
}

.ps-archive-body {
    margin: 0.6rem 0 0;
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--color-text);
}

/* Dedicated revision-history page (PersonalStatement/Revisions). */
.ps-revisions-link { margin: 0.75rem 0 0; }
.ps-revisions-link a { font-weight: 600; }
.ps-revision .ps-revision-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ps-revision .ps-revision-head .badge { margin-left: 0.4rem; }
.ps-revision .form-actions { margin-top: 0.75rem; }

/* ============================================================
   Scroll-reveal animation (used by the landing page; works
   anywhere a .reveal element scrolls into view via the
   IntersectionObserver in site.js).
   ============================================================ */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children: each direct child gets a delay proportional to its index
   (set via --i by the observer in site.js) and the parent's --stagger. */
.reveal > * {
    transition-delay: calc(var(--i, 0) * var(--stagger, 0s));
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================================
   Landing page
   ============================================================ */

.landing {
    /* Allow full-bleed sections inside what would otherwise be padded by .site-main. */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -1.5rem;
}

.landing .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Hero --- */

.landing-hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    padding: 5rem 0 4rem;
}

.landing-hero-bg {
    position: absolute;
    inset: -10% -10% -10% -10%;
    z-index: -1;
    background:
        radial-gradient(60% 60% at 20% 30%, rgba(110, 231, 183, 0.45) 0%, transparent 60%),
        radial-gradient(50% 50% at 80% 20%, rgba(199, 210, 254, 0.55) 0%, transparent 60%),
        radial-gradient(60% 60% at 50% 100%, rgba(253, 230, 138, 0.45) 0%, transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    animation: hero-drift 22s ease-in-out infinite alternate;
    filter: blur(40px);
}

@keyframes hero-drift {
    from { transform: translate3d(0, 0, 0)       scale(1); }
    to   { transform: translate3d(-3%, 2%, 0)    scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-hero-bg { animation: none; }
}

.landing-hero-inner {
    text-align: center;
    max-width: 880px;
}

.landing-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #475569;
    font-weight: 600;
    margin: 0 0 1rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.landing-h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: #0f172a;
}
.grad-text {
    background: linear-gradient(90deg, #059669 0%, #4f46e5 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

.landing-lede {
    margin: 0 auto 1.75rem;
    max-width: 720px;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    line-height: 1.6;
    color: #334155;
}

.landing-cta-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.6rem;
}

.landing-microcopy {
    font-size: 0.85rem;
    margin: 0;
}

.landing-scroll-cue {
    position: absolute;
    bottom: 1.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 2.4rem;
    border: 2px solid rgba(15, 23, 42, 0.25);
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    padding-top: 0.4rem;
}
.landing-scroll-cue span {
    width: 4px;
    height: 8px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.45);
    animation: scroll-cue 1.8s ease-in-out infinite;
}
@keyframes scroll-cue {
    0%   { transform: translateY(0);    opacity: 1; }
    70%  { transform: translateY(0.8rem); opacity: 0; }
    71%  { transform: translateY(0);    opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .landing-scroll-cue span { animation: none; }
}

/* --- Hero illustration --- */

.hero-illu {
    width: clamp(160px, 22vw, 220px);
    margin: 0 auto 1.25rem;
    filter: drop-shadow(0 6px 20px rgba(15, 23, 42, 0.08));
    animation: hero-illu-float 6s ease-in-out infinite alternate;
}
.hero-illu svg { width: 100%; height: auto; display: block; }
@keyframes hero-illu-float {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-illu { animation: none; }
}

/* --- Generic landing section --- */

.landing-section {
    padding: 5rem 0;
}
.landing-section-tight { padding: 4rem 0; }
.landing-section-bg {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.landing-section-header {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    text-align: center;
}
.landing-h2 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #0f172a;
}
.landing-section-sub {
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.6;
    margin: 0;
}

/* --- VS grid (single-prompt vs StudentCore) --- */

.vs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}
.vs-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 1.5rem 1.4rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.vs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}
.vs-card-pale { background: #fafaf9; }
.vs-card-strong {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border-color: #6ee7b7;
}
.vs-card header { margin-bottom: 0.8rem; }
.vs-card h3 {
    margin: 0.4rem 0 0;
    font-size: 1.1rem;
    color: #0f172a;
}
.vs-card ul {
    margin: 0;
    padding-left: 1.2rem;
}
.vs-card li {
    margin: 0.55rem 0;
    color: #334155;
    line-height: 1.55;
}
.vs-tag {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.vs-tag-strong {
    color: #047857;
    background: rgba(16, 185, 129, 0.15);
}

/* --- Signal grid (twelve angles) --- */

.signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.signal-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.5rem 1.25rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.signal-card:hover {
    transform: translateY(-3px);
    border-color: #c7d2fe;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
}
.signal-num {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #94a3b8;
}
.signal-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: #0f172a;
    padding-right: 2rem;
}
.signal-card p {
    margin: 0;
    color: #475569;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* --- Flow steps --- */

.flow-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: flow;
    display: grid;
    gap: 1.25rem;
}
.flow-step {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.5rem 1.5rem 1.4rem 4.5rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.flow-step:hover { border-color: #6ee7b7; }
.flow-step-num {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #4f46e5 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.flow-step h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: #0f172a;
}
.flow-step p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

/* --- Comparison table --- */

.compare-table-wrap {
    overflow-x: auto;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.compare-table th, .compare-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
.compare-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.92rem;
    color: #0f172a;
    text-transform: none;
    letter-spacing: 0;
}
.compare-table th:nth-child(3) { background: #ecfdf5; color: #065f46; }
.compare-table td:nth-child(2) { color: #64748b; }
.compare-table td:nth-child(3) { font-weight: 500; color: #047857; }
.compare-table tbody tr:last-child td { border-bottom: 0; }

/* --- Stat grid (stakes section) --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: #6ee7b7;
}
.stat-num {
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #059669 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    line-height: 1.1;
    margin-bottom: 0.4rem;
}
.stat-label {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.4;
}

/* --- Chart cards (bar / line) --- */

.chart-card {
    padding: 1.5rem;
}
.chart-card-header { margin-bottom: 0.75rem; }
.chart-card-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: #0f172a;
}
.chart-card-header p { margin: 0; }

.growth-chart,
.line-chart {
    width: 100%;
    height: auto;
    display: block;
}
.chart-grid line {
    stroke: #e2e8f0;
    stroke-width: 1;
}
.chart-tick {
    font-size: 11px;
    fill: #94a3b8;
    font-family: inherit;
}
.chart-axis {
    font-size: 11px;
    fill: #475569;
    font-family: inherit;
}
.chart-legend {
    font-size: 12px;
    fill: #334155;
    font-family: inherit;
    font-weight: 500;
}

/* --- Two-col text + chart (top-uni-matters) --- */

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 800px) {
    .two-col { grid-template-columns: 1fr; }
}
.two-col-text h3 {
    margin: 1.25rem 0 0.4rem;
    font-size: 1.05rem;
    color: #0f172a;
}
.two-col-text h3:first-child { margin-top: 0; }
.two-col-text p {
    margin: 0 0 0.4rem;
    color: #334155;
    line-height: 1.6;
}
.two-col-chart { margin: 0; }

/* --- Dark "PS is the only place" section --- */

.landing-section-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    padding: 5rem 0;
}
.ps-only-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: center;
}
@media (max-width: 800px) {
    .ps-only-grid { grid-template-columns: 1fr; text-align: center; }
    .ps-only-icon  { margin: 0 auto; max-width: 160px; }
}
.ps-only-icon svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}
.ps-only-eyebrow {
    background: rgba(110, 231, 183, 0.18);
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.3);
}
.ps-only-h2 {
    color: #ffffff;
    margin-bottom: 1.25rem;
}
.ps-only-text p {
    color: #cbd5e1;
    line-height: 1.65;
    margin: 0 0 0.8rem;
    font-size: 1.02rem;
}
.ps-only-pull {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid #6ee7b7;
    background: rgba(110, 231, 183, 0.08);
    border-radius: 0 0.4rem 0.4rem 0;
    color: #f1f5f9;
    font-size: 1.05rem;
    line-height: 1.55;
}

/* --- Trust grid (data security section) --- */

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.1rem;
}
.trust-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.5rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.trust-card:hover {
    transform: translateY(-3px);
    border-color: #c7d2fe;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
}
.trust-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}
.trust-icon svg { width: 100%; height: 100%; }
.trust-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: #0f172a;
}
.trust-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
    font-size: 0.93rem;
}
.trust-footnote {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* --- Why 12 months (warm section) --- */

.landing-section-warm {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border-top: 1px solid #fde68a;
    border-bottom: 1px solid #fde68a;
}

.why-months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.why-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #fde68a;
    border-radius: 0.85rem;
    padding: 1.5rem 1.25rem 1.25rem 4rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.why-card:hover {
    transform: translateY(-3px);
    border-color: #f59e0b;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.12);
}
.why-num {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.why-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: #0f172a;
}
.why-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
    font-size: 0.95rem;
}

.why-cost-pull {
    background: linear-gradient(135deg, #ffffff 0%, #fef9c3 100%);
    border-color: #f59e0b;
    padding: 1.75rem 1.75rem;
    text-align: center;
}
.why-cost-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem 0.85rem;
    margin-bottom: 0.8rem;
}
.why-cost-price {
    font-size: clamp(2.5rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}
.why-cost-divider {
    font-size: 1.05rem;
    color: #78350f;
    font-weight: 500;
}
.why-cost-perday {
    font-size: 0.92rem;
    color: #78350f;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.why-cost-pull p {
    margin: 0 auto;
    max-width: 640px;
    color: #57534e;
    line-height: 1.65;
    font-size: 1.02rem;
}

/* --- Final CTA band --- */

.landing-cta-band {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    padding: 4.5rem 0;
    margin-bottom: -1.5rem;  /* sit flush with footer's top */
}
.landing-cta-inner {
    text-align: center;
    max-width: 760px;
}
.landing-cta-band h2 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.2;
    color: #ffffff;
}
.landing-cta-band h2 strong { color: #6ee7b7; }
.landing-cta-band p { color: #cbd5e1; }
.landing-cta-band .landing-cta-row { margin: 1.5rem 0 1rem; }
.landing-cta-band a { color: #6ee7b7; }
.landing-cta-band .btn-primary {
    background: #6ee7b7;
    color: #0f172a;
    border-color: #6ee7b7;
}
.landing-cta-band .btn-primary:hover {
    background: #34d399;
    border-color: #34d399;
}
.landing-cta-band .btn-secondary {
    background: transparent;
    color: #f1f5f9;
    border-color: rgba(241, 245, 249, 0.4);
}
.landing-cta-band .btn-secondary:hover {
    background: rgba(241, 245, 249, 0.08);
    border-color: rgba(241, 245, 249, 0.7);
}

/* ============================================================
   Top-nav user dropdown menu (auth-nav)
   ============================================================ */

.user-menu {
    position: relative;
}

.user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem 0.35rem 0.4rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    color: var(--color-text);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.user-menu-button:hover,
.user-menu.open .user-menu-button {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

.user-menu-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #059669 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.user-menu-name {
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}
.user-menu-caret {
    font-size: 0.7rem;
    color: var(--color-muted);
    transition: transform 0.15s ease;
}
.user-menu:hover .user-menu-caret,
.user-menu.open .user-menu-caret { transform: rotate(180deg); }

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 14rem;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 0.35rem;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 50;
}
.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown,
.user-menu.open .user-menu-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0.4rem;
    text-align: left;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.user-menu-item:hover,
.user-menu-item:focus {
    background: #f1f5f9;
    outline: none;
}
.user-menu-item-danger {
    color: #b91c1c;
}
.user-menu-item-danger:hover,
.user-menu-item-danger:focus {
    background: #fef2f2;
}
.user-menu-form { margin: 0; }
.user-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.35rem 0;
}

/* On the admin dark layout, the dropdown stays light; just tweak the button colour. */
.admin-body .user-menu-button { color: #f1f5f9; }
.admin-body .user-menu-button:hover,
.admin-body .user-menu.open .user-menu-button {
    background: rgba(241, 245, 249, 0.08);
    border-color: rgba(241, 245, 249, 0.18);
}

/* ---------- Billing / paywall ---------- */

.upgrade-banner {
    background: linear-gradient(90deg, #fde68a 0%, #fcd34d 100%);
    border-bottom: 1px solid #f59e0b;
    color: #78350f;
}
.upgrade-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    flex-wrap: wrap;
}

.primary-nav a.nav-upgrade {
    background: #f59e0b;
    color: #ffffff;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius);
}
.primary-nav a.nav-upgrade:hover { background: #d97706; }

/* Free-tier preview: the page renders normally but every interactive element inside
   <main> is visually muted and de-activated. Forms still can't POST — the
   [RequiresPaidAccess] filter rejects non-safe verbs server-side — so this is a
   cosmetic + accessibility hint, not the actual security boundary. */
.site-main.free-preview button,
.site-main.free-preview input,
.site-main.free-preview select,
.site-main.free-preview textarea {
    pointer-events: none;
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed;
}
.site-main.free-preview .btn,
.site-main.free-preview a.btn {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.7);
}
.site-main.free-preview form {
    position: relative;
}
.site-main.free-preview a:not(.btn) {
    pointer-events: none;
    color: #64748b;
    text-decoration: none;
}
.site-main.free-preview .card {
    background-color: #fafafa;
}

.free-preview-notice {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    color: #78350f;
}
.free-preview-notice a {
    color: #78350f;
    font-weight: 600;
    pointer-events: auto !important;
    text-decoration: underline !important;
}

.free-tier-note {
    border-color: #fde68a;
    background: #fefce8;
}

.trait-card-locked {
    opacity: 0.55;
    background: #f8fafc;
}
.trait-card-locked .trait-card-actions a:not([asp-controller="Billing"]) {
    pointer-events: none;
}

.ps-generate-locked {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ---------- Public pricing page ---------- */

.pricing-hero {
    text-align: center;
    padding: 2rem 1rem 1rem;
}
.pricing-hero h1 { margin-bottom: 0.4rem; }
.pricing-hero .lede {
    max-width: 640px;
    margin: 0 auto;
    color: var(--color-muted);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.pricing-card { display: flex; flex-direction: column; }
.pricing-card header { margin-bottom: 0.8rem; }
.pricing-card h3 {
    margin: 1rem 0 0.4rem;
    font-size: 1rem;
    color: var(--color-text);
}
.pricing-list {
    margin: 0 0 0.4rem 1.1rem;
    padding: 0;
}
.pricing-list li { margin: 0.35rem 0; }

.pricing-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}
.pricing-tag-paid {
    background: #d1fae5;
    color: #065f46;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.4rem 0;
}
.pricing-price-value {
    font-size: 2.6rem;
    font-weight: 700;
}
.pricing-price-unit { font-size: 0.95rem; }

.pricing-paid {
    border-color: #6ee7b7;
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}
.pricing-paid .pricing-price-value { color: #065f46; }

.pricing-cta {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.pricing-table-wrap { margin: 1rem 0; }
.pricing-table-wrap .billing-table th:nth-child(2),
.pricing-table-wrap .billing-table td:nth-child(2),
.pricing-table-wrap .billing-table th:nth-child(3),
.pricing-table-wrap .billing-table td:nth-child(3) {
    text-align: center;
    white-space: nowrap;
}

.pricing-faq { margin: 1rem 0 2rem; }
.pricing-faq h3 {
    margin: 1rem 0 0.3rem;
    font-size: 1rem;
}
.pricing-faq h3:first-of-type { margin-top: 0; }

.billing-hero {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 3fr;
    gap: 1.5rem;
    align-items: center;
}
/* Anything tablet-and-below: stack the price on top, give the pitch the full row
   width, and left-align so bullet lists don't read as awkwardly centred. */
@media (max-width: 800px) {
    .billing-hero {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 1rem;
    }
    .billing-hero .billing-price {
        max-width: 220px;
        margin: 0 auto;     /* centre the small price card while the pitch goes full-width */
        padding: 1rem 1.25rem;
    }
    .billing-hero .billing-pitch { width: 100%; }
}
.billing-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
}
.billing-price-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: #065f46;
}
.billing-price-unit { font-size: 0.95rem; }
.billing-pitch h2 { margin-top: 0; }
.billing-pitch ul { margin: 0 0 0.6rem 1.1rem; padding: 0; }
.billing-pitch ul li { margin: 0.2rem 0; }
.billing-paid {
    background: #ecfdf5;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid #a7f3d0;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    /* On narrow screens the table reflows / scrolls thanks to the .billing-table-scroll
       wrapper below; min-width here keeps the layout sensible on desktop too. */
    min-width: 100%;
}
.billing-table th, .billing-table td {
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 0.6rem;
    text-align: left;
    vertical-align: top;
}
.billing-table th {
    background: #f8fafc;
    font-weight: 600;
}
.billing-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;     /* small bleed so the scroll-shadow lines up with the card */
}

/* Admin tables: same idea. The wrapper is injected by site.js so the table's
   horizontal overflow stays inside its own area instead of pushing the entire
   admin page sideways on mobile. */
.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}
.admin-table-scroll .admin-table {
    margin: 0;
}
/* Page-level safety net: keep admin pages from ever overflowing horizontally
   even if some content elsewhere is too wide. */
.admin-page { overflow-x: hidden; }
@media (max-width: 800px) {
    .billing-table { min-width: 520px; }    /* let it overflow horizontally on mobile */
}

/* ---------- Payment success page ---------- */

.payment-success {
    max-width: 640px;
    margin: 2rem auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.payment-success-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.25rem;
    filter: drop-shadow(0 10px 25px rgba(5, 150, 105, 0.25));
    animation: payment-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.payment-success-icon svg { width: 100%; height: 100%; display: block; }
@keyframes payment-success-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .payment-success-icon { animation: none; }
}
.payment-success-headline {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #065f46;
    letter-spacing: -0.01em;
}
.payment-success-lede {
    margin: 0 auto 1.5rem;
    max-width: 480px;
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.55;
}
.payment-success-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 0.75rem;
    margin-bottom: 1.75rem;
}
.payment-success-badge-label {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #065f46;
    font-weight: 600;
}
.payment-success-badge-date {
    font-size: 1.3rem;
    font-weight: 700;
    color: #064e3b;
}
.payment-success-next {
    list-style: none;
    margin: 0 auto 2rem;
    padding: 0;
    max-width: 520px;
    text-align: left;
}
.payment-success-next li {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    color: #475569;
    line-height: 1.5;
    font-size: 0.95rem;
}
.payment-success-next strong { color: #0f172a; }
.payment-success-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.gift-access-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-color: #6ee7b7;
}
.gift-access-card h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.gift-access-card p  { margin: 0.2rem 0; }
.gift-access-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.name-lock-note {
    margin-top: -0.2rem;
    padding: 0.4rem 0.6rem;
    background: #fef9c3;
    border: 1px dashed #fde68a;
    border-radius: var(--radius);
}

.legal-doc h2 {
    margin-top: 1.6rem;
    font-size: 1.05rem;
}
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc ul { margin: 0.4rem 0 0.8rem 1.2rem; }

.footer-nav {
    display: inline-flex;
    gap: 1rem;
    margin-left: 1rem;
}
.footer-nav a {
    color: var(--color-muted);
    text-decoration: none;
}
.footer-nav a:hover { text-decoration: underline; }

/* ---------- Check-in card ---------- */

.check-in-card {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdf4 100%);
    border-color: #a7f3d0;
}
.check-in-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.check-in-header h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.check-in-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.7rem;
}
.check-in-form label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text);
}
.check-in-form textarea {
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}

.check-in-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.check-in-list > li {
    border-top: 1px solid var(--color-border);
    padding: 0.7rem 0;
}
.check-in-list > li:first-child { border-top: 0; }
.check-in-list p { margin: 0.2rem 0; }
.check-in-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

/* ---------- Radar charts ---------- */

.radar-card { margin-bottom: 1.5rem; }
.radar-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.radar-figure {
    margin: 0;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.radar-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.radar-svg {
    width: 100%;
    height: auto;
    /* The viewBox now has horizontal padding (~45% of size each side) so labels on
       the left/right axes don't clip. Bump max-width to keep the radar diameter
       readable inside that wider viewBox. */
    max-width: 520px;
}

.radar-grid {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 1;
    opacity: 0.7;
}
.radar-axis {
    stroke: var(--color-border);
    stroke-width: 1;
    opacity: 0.55;
}
.radar-label {
    font-size: 11px;
    fill: var(--color-text);
    font-weight: 500;
}
.radar-label-value {
    fill: var(--color-muted);
    font-weight: 400;
    font-size: 10px;
}

.radar-data {
    fill: rgba(99, 102, 241, 0.25);
    stroke: #6366f1;
    stroke-width: 2;
    stroke-linejoin: round;
}
.radar-strengths .radar-data {
    fill: rgba(16, 185, 129, 0.22);
    stroke: #10b981;
}
.radar-traits .radar-data {
    fill: rgba(99, 102, 241, 0.22);
    stroke: #6366f1;
}

/* ---------- Books ---------- */

.book-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.5fr auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.book-row .form-row { margin-bottom: 0; }
.book-row .book-remove { white-space: nowrap; align-self: end; padding-bottom: 0.6rem; }
@media (max-width: 720px) {
    .book-row { grid-template-columns: 1fr; }
    .book-row .book-remove { justify-self: start; padding-left: 0; }
}

.books-section { margin-top: 2rem; }
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}
.book-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.book-card-header h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.book-card-header p { margin: 0; font-size: 0.9rem; }

.book-notes-line { margin: 0.25rem 0 0.6rem; }

.book-summary {
    margin: 0.5rem 0;
    font-size: 0.93rem;
    line-height: 1.55;
}

.book-keywords {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.book-keyword-chip {
    padding: 0.1rem 0.55rem;
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: lowercase;
}

.book-insight {
    margin: 0.6rem 0;
    padding: 0.5rem 0.7rem;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #064e3b;
}

/* ============================================================
   Guide: PS examples carousel
   ============================================================ */
.ps-ex-carousel { position: relative; }
.ps-ex-track { min-height: 1px; }
.ps-ex-slide { display: none; }
.ps-ex-slide.active { display: block; animation: ps-ex-fade 0.18s ease-in; }
@keyframes ps-ex-fade { from { opacity: 0; } to { opacity: 1; } }
.ps-ex-slide-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.ps-ex-slide-head h2 { margin: 0 0 0.15rem; font-size: 1.15rem; }
.ps-ex-slide-head p { margin: 0; }
.ps-ex-wordcount {
    flex: none;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.ps-ex-statement {
    max-width: none;
}
.ps-ex-statement p {
    margin: 0 0 0.85rem;
    line-height: 1.65;
}
.ps-ex-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.ps-ex-counter { font-size: 0.9rem; white-space: nowrap; }
.ps-ex-footnote { margin-top: 1rem; }

/* ============================================================
   Guide: application timeline
   ============================================================ */
.timeline {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}
.timeline-step {
    position: relative;
    padding: 0 0 1.6rem 1.9rem;
    border-left: 2px solid var(--color-border);
}
.timeline-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -8px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-border);
}
.timeline-when {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
}
.timeline-title { margin: 0 0 0.35rem; font-size: 1.02rem; }
.timeline-content p { margin: 0; line-height: 1.6; }

/* ============================================================
   Top-nav dropdown ("PS Guide")
   Mirrors the user-menu pattern: CSS opens on hover/focus-within,
   JS toggles `.open` for tap/keyboard. Inside the mobile burger
   panel it expands inline instead of floating.
   ============================================================ */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    line-height: inherit;
    color: var(--color-muted);
}
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle { color: var(--color-text); }
.nav-dropdown-caret { font-size: 0.7rem; transition: transform 0.15s ease; }
.nav-dropdown:hover .nav-dropdown-caret,
.nav-dropdown:focus-within .nav-dropdown-caret,
.nav-dropdown.open .nav-dropdown-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    display: block;            /* override .primary-nav ul flex */
    min-width: 15rem;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}
.nav-dropdown-menu li { width: 100%; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 0.4rem;
    color: var(--color-text);
    font-size: 0.92rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: #f1f5f9; color: var(--color-text); }

@media (max-width: 900px) {
    .nav-dropdown { display: block; width: 100%; }
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
        border-radius: 0.4rem;
    }
    .nav-dropdown-toggle:hover { background: rgba(15, 23, 42, 0.04); }
    .nav-dropdown-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        min-width: 0;
        padding: 0 0 0.25rem 0.75rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }
    .nav-dropdown.open .nav-dropdown-menu { max-height: 22rem; }
}

/* ============================================================
   Shared CTA band on standalone content pages (guides, pricing,
   legal). Breaks out of the constrained .site-main container so
   the band spans full width, exactly like it does on the homepage.
   Inside .landing the 50% term equals 50vw, so the margins resolve
   to 0 and it stays put.
   ============================================================ */
.cta-band-standalone {
    margin-top: 3rem;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: -2.5rem; /* sit flush above the site footer (cancels .site-main bottom padding) */
}
