/*
 * READ Landscapes — Component Styles
 * Buttons, inputs, cards, phase tracker, notifications.
 * Extracted from read-design-system.html
 */

/* ── BUTTONS ──────────────────────────────── */

.btn-primary {
    display: inline-block;
    background: var(--terra);
    color: var(--text-primary);
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: 0.5px solid var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

.btn-ghost {
    display: inline-block;
    background: transparent;
    color: var(--terra-text);
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: 0.5px solid var(--terra-text);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.btn-ghost:hover {
    background: rgba(212,113,90,0.08);
    text-decoration: none;
}

.btn-sm {
    font-size: 12px;
    padding: 7px 14px;
}

.btn-lg {
    font-size: 15px;
    padding: 13px 28px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ── FORM INPUTS ──────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    background: var(--bg-input);
    border: 0.5px solid var(--border-tan);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: var(--f-body);
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--terra-text);
}

.form-input-error {
    border-color: var(--terra-text);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--terra-text);
    margin-top: 5px;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A7F74' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── CARDS ────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-sm {
    padding: 1rem 1.25rem;
}

/* ── DOCUMENT DOWNLOAD CARD ──────────────── */

.doc-card {
    background: var(--bg-input);
    border: 0.5px solid var(--border-mid);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    width: 34px;
    height: 42px;
    background: var(--terra);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.06em;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.doc-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.doc-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--terra-text);
    white-space: nowrap;
    flex-shrink: 0;
    border: 0.5px solid var(--terra-text);
    border-radius: 5px;
    padding: 5px 10px;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background 0.15s;
}

.doc-action:hover {
    background: rgba(212,113,90,0.08);
    text-decoration: none;
}

/* ── UPLOAD ZONE ──────────────────────────── */

.upload-zone {
    border: 1.5px dashed var(--border-tan);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    background: var(--bg-input);
}

.upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-modal);
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.upload-main {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── PHASE TRACKER ────────────────────────── */

.phase-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.phase-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.phase-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    right: -50%;
    height: 1px;
    background: var(--border-mid);
    z-index: 0;
}

.phase-step.done::after {
    background: var(--green-text);
}

.phase-step.active::after {
    background: linear-gradient(to right, var(--terra-text) 0%, var(--border-mid) 100%);
}

.phase-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    z-index: 1;
    position: relative;
}

.phase-dot.done {
    background: var(--green);
    border: 0.5px solid var(--green-text);
    color: #a8c88c;
}

.phase-dot.active {
    background: var(--terra);
    border: 1.5px solid var(--terra-text);
    color: #f5f0eb;
}

.phase-dot.next {
    background: var(--bg-modal);
    border: 0.5px solid var(--border-mid);
    color: var(--text-muted);
}

.phase-dot.locked {
    background: var(--bg-input);
    border: 0.5px dashed var(--border-mid);
    color: var(--text-muted);
}

.phase-name {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    margin-top: 7px;
    line-height: 1.3;
}

.phase-name.done   { color: var(--green-text); }
.phase-name.active { color: var(--terra-text); }
.phase-name.next   { color: var(--text-muted); }
.phase-name.locked { color: var(--bg-modal); }

/* Vertical phase tracker (mobile) */
@media (max-width: 640px) {
    .phase-track {
        flex-direction: column;
        gap: 0;
    }

    .phase-step {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
    }

    .phase-step:not(:last-child)::after {
        top: 24px;
        left: 12px;
        right: auto;
        bottom: -8px;
        width: 1px;
        height: calc(100% - 16px);
    }

    .phase-name {
        margin-top: 0;
        text-align: left;
        font-size: 12px;
    }
}

/* ── NOTIFICATION PILL ────────────────────── */

.notif {
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-left: 2.5px solid var(--terra-text);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--terra-text);
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-text {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.5;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── FLASH MESSAGES ───────────────────────── */

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 1rem;
}

.flash-success {
    background: rgba(122,154,100,0.12);
    border: 0.5px solid rgba(122,154,100,0.3);
    color: var(--green-text);
}

.flash-error {
    background: rgba(212,113,90,0.12);
    border: 0.5px solid rgba(212,113,90,0.3);
    color: var(--terra-text);
}

.flash-info {
    background: rgba(213,186,151,0.1);
    border: 0.5px solid rgba(213,186,151,0.2);
    color: var(--text-secondary);
}

/* ── TABLE ────────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 0.5px solid var(--border-mid);
}

.table td {
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--border);
    color: var(--text-body);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.table td a {
    color: var(--terra-text);
}

/* ── BADGES ───────────────────────────────── */

.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-green {
    background: rgba(122,154,100,0.18);
    color: var(--green-text);
    border: 0.5px solid rgba(122,154,100,0.3);
}

.badge-terra {
    background: rgba(212,113,90,0.15);
    color: var(--terra-text);
    border: 0.5px solid rgba(212,113,90,0.3);
}

.badge-muted {
    background: rgba(138,127,116,0.12);
    color: var(--text-muted);
    border: 0.5px solid rgba(138,127,116,0.2);
}

/* ── STAT CARDS ───────────────────────────── */

.stat-card {
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--f-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────── */
/*  PHASE SECTIONS — distinct color per phase      */
/* ─────────────────────────────────────────────── */
.phase-section {
    --phase-text: var(--phase-1-text);
    --phase-fill: var(--phase-1-fill);
    margin: 2rem 0 1rem;
    padding: 0.85rem 1rem 0.85rem 1.1rem;
    border-left: 5px solid var(--phase-fill);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: color-mix(in srgb, var(--phase-fill) 8%, transparent);
}

/* First phase section after card has less top margin */
.card > .phase-section:first-of-type,
.card > .section-label + .phase-section,
.card > div + .phase-section:nth-of-type(1) {
    margin-top: 1rem;
}

.phase-section[data-phase-color="2"] { --phase-text: var(--phase-2-text); --phase-fill: var(--phase-2-fill); }
.phase-section[data-phase-color="3"] { --phase-text: var(--phase-3-text); --phase-fill: var(--phase-3-fill); }
.phase-section[data-phase-color="4"] { --phase-text: var(--phase-4-text); --phase-fill: var(--phase-4-fill); }
.phase-section[data-phase-color="5"] { --phase-text: var(--phase-5-text); --phase-fill: var(--phase-5-fill); }

.phase-section .phase-label {
    font-family: var(--f-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--phase-text);
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.phase-section .phase-label::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--phase-fill);
    flex-shrink: 0;
}

.phase-section .phase-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 4px 0 0 19px; /* indent to line up under text, past the dot */
    text-transform: none;
}

/* ─────────────────────────────────────────────── */
/*  ADMIN STEP ROWS — colored by phase + status    */
/* ─────────────────────────────────────────────── */
.admin-step-row {
    --phase-fill: var(--text-muted);
    --phase-text: var(--text-muted);
    padding: 1rem 1rem 1rem 0.75rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--phase-fill);
    margin-bottom: 8px;
    background: var(--surface-2);
    transition: background 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.admin-step-row[data-phase-color="1"] { --phase-fill: var(--phase-1-fill); --phase-text: var(--phase-1-text); }
.admin-step-row[data-phase-color="2"] { --phase-fill: var(--phase-2-fill); --phase-text: var(--phase-2-text); }
.admin-step-row[data-phase-color="3"] { --phase-fill: var(--phase-3-fill); --phase-text: var(--phase-3-text); }
.admin-step-row[data-phase-color="4"] { --phase-fill: var(--phase-4-fill); --phase-text: var(--phase-4-text); }
.admin-step-row[data-phase-color="5"] { --phase-fill: var(--phase-5-fill); --phase-text: var(--phase-5-text); }

/* Status backgrounds — overlay the phase color border, tint the row */
.admin-step-row.status-locked      { opacity: 0.55; background: var(--surface-3); }
.admin-step-row.status-available   { background: color-mix(in srgb, var(--phase-fill) 5%, var(--surface-2)); }
.admin-step-row.status-in_progress { background: color-mix(in srgb, var(--terra)     12%, var(--surface-2)); border-left-style: dashed; }
.admin-step-row.status-complete    { background: color-mix(in srgb, var(--green)     10%, var(--surface-2)); }
.admin-step-row.status-complete .badge.badge-green { box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 25%, transparent); }

/* Drag-drop visuals */
.admin-step-row.dragging { opacity: 0.4; }
.admin-step-row.drop-target { outline: 2px dashed var(--terra-text); outline-offset: -2px; }
.admin-step-row .drag-handle:active { cursor: grabbing; }

/* Accordion chevron rotation when open */
.add-step-accordion[open] .accordion-chevron,
.project-settings[open]  .accordion-chevron {
    transform: rotate(90deg);
}

/* ─────────────────────────────────────────────── */
/*  EDUCATION CARD — parallel learning track       */
/* ─────────────────────────────────────────────── */
.education-card {
    border-left: 3px solid var(--phase-5-fill);
    background:
        linear-gradient(to right,
            color-mix(in srgb, var(--phase-5-fill) 6%, transparent),
            transparent 40%),
        var(--bg-card);
}
.education-card .section-label {
    color: var(--phase-5-text);
}

/* Compact lesson rows — click summary to expand inline body */
.lesson-row { transition: background 0.15s; }
.lesson-row[open] {
    background: color-mix(in srgb, var(--phase-5-fill) 5%, transparent);
}
.lesson-row[open] > .lesson-summary > .lesson-watch-cta {
    background: var(--phase-5-fill);
    color: #fff;
}
.lesson-row > summary::-webkit-details-marker { display: none; } /* Hide default marker */
.lesson-row > summary { outline: none; }
.lesson-row:not([data-locked="1"]) > summary:hover {
    background: color-mix(in srgb, var(--phase-5-fill) 4%, transparent);
}
.lesson-row[data-locked="1"] > summary { cursor: not-allowed; }

/* Step instruction line — stands out when it's a default (not custom description) */
.step-instruction { transition: color 0.15s; }

/* ─────────────────────────────────────────────── */
/*  DASHBOARD TABS — phases / education            */
/* ─────────────────────────────────────────────── */
.dashboard-tabs {
    margin-bottom: 1.25rem;
}
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    overflow-y: hidden; /* browsers default the other axis to auto when one is set — kills the phantom vertical scrollbar */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox: hide the horizontal scroll track */
}
.tab-bar::-webkit-scrollbar { display: none; } /* Chromium/Safari */
.tab-button {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; /* overlap tab-bar border so active underline sits flush */
    padding: 12px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.tab-button:hover {
    color: var(--text-body);
}
.tab-button.is-active {
    color: var(--text-primary);
    border-bottom-color: var(--terra-text);
}
.tab-button:focus-visible {
    outline: 2px solid var(--terra-text);
    outline-offset: 2px;
    border-radius: 4px;
}
.tab-count {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.tab-button.is-active .tab-count {
    background: color-mix(in srgb, var(--terra-text) 14%, transparent);
    color: var(--terra-text);
}
.tab-panel[hidden] { display: none; }

@media (max-width: 640px) {
    .tab-button { padding: 10px 14px; font-size: 13px; }
    .tab-count { display: none; }
}

/* ─────────────────────────────────────────────── */
/*  THEME TOGGLE — pill switch                     */
/* ─────────────────────────────────────────────── */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 56px;
    height: 26px;
    padding: 0 7px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    cursor: pointer;
    line-height: 1;
    font-size: 11px;
    color: var(--topbar-text-muted);
    transition: background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover {
    border-color: rgba(255,255,255,0.32);
    background: rgba(0,0,0,0.45);
}
.theme-toggle .theme-icon-dark,
.theme-toggle .theme-icon-light {
    z-index: 1;
    pointer-events: none;
    line-height: 1;
}
/* Sliding handle — dark mode = handle on moon side (right); light mode = handle on sun side (left) */
.theme-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F5F0EB; /* always light handle — visible on the dark toggle bg in either theme */
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transform: translateX(30px); /* default = dark, handle on right (moon side) */
    transition: transform 0.2s ease;
}
[data-theme="light"] .theme-toggle::after {
    transform: translateX(0); /* light, handle on left (sun side) */
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--terra-text);
    outline-offset: 2px;
}

/* ═════════════════════════════════════════════════════════════════ */
/*  CLIENT PORTAL — UX REDESIGN COMPONENTS (v0.19)                    */
/*  See _archives/v0.18.3-* for pre-redesign baseline.                */
/* ═════════════════════════════════════════════════════════════════ */

/* ── EYEBROW + CHIP ───────────────────────────── */
.eyebrow {
    font: 700 10px/1.4 var(--f-mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.eyebrow--terra { color: var(--terra-text); }
.eyebrow--green { color: var(--green-text); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    font: 600 10px/1 var(--f-mono);
    letter-spacing: 0.13em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 5px;
    border: 1px solid var(--border-mid); color: var(--text-muted);
    white-space: nowrap;
}

/* ── BADGES (semantic aliases, BEM-style) ────────────
   The existing .badge / .badge-terra / .badge-green / .badge-muted classes
   stay. We add semantic names for the redesign so views read intent. */
.badge--action  { background: rgba(212,113,90,0.15); color: var(--terra-text);     border: 0.5px solid rgba(212,113,90,0.32); }
.badge--new     { background: rgba(212,162,88,0.14); color: var(--attention-text); border: 0.5px solid rgba(212,162,88,0.32); }
.badge--stalled { background: rgba(184,72,46,0.18);  color: #d98b6a;               border: 0.5px solid rgba(184,72,46,0.34); }
.badge--done    { background: rgba(122,154,100,0.16); color: var(--green-text);    border: 0.5px solid rgba(122,154,100,0.32); }
.badge--locked  { background: rgba(138,127,116,0.13); color: var(--text-muted);    border: 0.5px solid rgba(138,127,116,0.24); }
.badge--learn   { background: rgba(107,58,110,0.18);  color: var(--phase-5-text);  border: 0.5px solid rgba(107,58,110,0.34); }
.badge {
    /* monospace + caps so all semantic variants render the same regardless of theme */
    font-family: var(--f-mono);
    line-height: 1.4;
}

/* ── HERO-NEXT — "Do this next" CTA card ──────── */
.hero-next {
    position: relative;
    background: linear-gradient(180deg, rgba(185,72,46,0.14), rgba(185,72,46,0.045));
    border: 1px solid rgba(212,113,90,0.34);
    border-left: 4px solid var(--terra);
    border-radius: var(--radius-lg);
    padding: 22px 22px 20px;
    margin-bottom: 1.25rem;
}
.hero-next__top {
    display: flex; justify-content: space-between; gap: 12px;
    align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px;
}
.hero-next__eyebrow {
    font: 700 10px/1.4 var(--f-mono);
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--terra-text);
}
.hero-next__title {
    font: 700 21px/1.25 var(--f-display);
    color: var(--text-primary);
    margin: 8px 0 6px;
    letter-spacing: -0.005em;
}
.hero-next__desc {
    font-size: 13px; color: var(--text-body); line-height: 1.55;
    margin: 0 0 12px;
}
.hero-next__acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hero-next--clear {
    background: linear-gradient(180deg, rgba(122,154,100,0.10), rgba(122,154,100,0.03));
    border-color: rgba(122,154,100,0.30);
    border-left-color: var(--green);
}
.hero-next--clear .hero-next__eyebrow { color: var(--green-text); }
.hero-next__check {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--green); border: 1px solid var(--green-text);
    display: grid; place-items: center; color: #cfe0bc;
    font: 700 17px var(--f-mono); flex: none;
}

/* ── PHASE STEPPER — strip, not a card ─────────── */
.phase-stepper {
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 16px 4px;
    margin-bottom: 1.25rem;
    container-type: inline-size;
}
.phase-stepper__steps { display: flex; gap: 0; }
.phase-stepper__step {
    flex: 1; position: relative; display: flex; flex-direction: column;
    align-items: center; text-align: center; gap: 9px; padding: 0 6px;
}
.phase-stepper__step:not(:last-child)::after {
    content: ""; position: absolute; top: 15px; left: 50%; right: -50%;
    height: 2px; background: var(--border-mid);
}
.phase-stepper__step.is-done::after { background: var(--green); }
.phase-stepper__step.is-active::after {
    background: linear-gradient(90deg, var(--terra-text), var(--border-mid));
}
.phase-stepper__dot {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    font: 700 12px var(--f-mono); z-index: 1; position: relative; flex: none;
}
.phase-stepper__dot.is-done    { background: var(--green); border: 1px solid var(--green-text); color: #cfe0bc; }
.phase-stepper__dot.is-active  { background: var(--terra); border: 2px solid var(--terra-text); color: #fff; }
.phase-stepper__dot.is-upcoming{ background: var(--surface-2); border: 1px solid var(--border-mid); color: var(--text-muted); }
.phase-stepper__dot.is-locked  { background: var(--surface-3); border: 1px dashed var(--border-mid); color: var(--text-muted); }
.phase-stepper__name {
    font: 600 13px/1.3 var(--f-body); color: var(--text-muted);
}
.phase-stepper__step.is-done   .phase-stepper__name { color: var(--green-text); }
.phase-stepper__step.is-active .phase-stepper__name { color: var(--terra-text); }
.phase-stepper__caption {
    margin-top: 14px; text-align: center;
    font-size: 12px; color: var(--text-muted);
}
.phase-stepper__rail {
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-size: 12.5px; color: var(--text-muted);
}
.phase-stepper__rail::before {
    content: ""; width: 9px; height: 9px; border-radius: 50%;
    background: var(--phase-5-fill); flex: none;
}
.phase-stepper__rail strong { color: var(--text-body); }

/* Vertical layout when the stepper container is narrow (mobile) */
@container (max-width: 560px) {
    .phase-stepper__steps { flex-direction: column; gap: 0; }
    .phase-stepper__step {
        flex-direction: row; align-items: center; text-align: left;
        gap: 13px; padding: 8px 0;
    }
    .phase-stepper__step:not(:last-child)::after {
        top: 32px; left: 15px; right: auto; bottom: -8px;
        width: 2px; height: auto;
    }
    .phase-stepper__name { font-size: 14px; }
}

/* ── ALSO WAITING — secondary attention, no card ── */
.also-waiting {
    margin-top: 14px;
    margin-bottom: 1.25rem;
}
.also-waiting__header {
    font: 600 12.5px/1.4 var(--f-body);
    color: var(--text-muted);
    margin-bottom: 0;
}
.attention-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-top: 1px solid var(--border);
    text-decoration: none;
}
.attention-row:first-of-type { border-top: 0; }
.attention-row__text { flex: 1; font-size: 13px; color: var(--text-body); min-width: 0; }
.attention-row__context {
    display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px;
}
.attention-row__go {
    color: var(--terra-text); font-weight: 600; flex: none;
    white-space: nowrap;
}
a.attention-row:hover .attention-row__text { color: var(--text-primary); }

/* ── CHECKLIST ROW (the spine pattern) ─────────── */
.checklist-row {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 0; border-top: 1px solid var(--border);
}
.checklist-row:first-of-type { border-top: 0; }
.checklist-row__status {
    flex: none; width: 20px; text-align: center;
    font: 700 14px var(--f-mono); margin-top: 1px;
}
.checklist-row__status.is-done   { color: var(--green-text); }
.checklist-row__status.is-active { color: var(--terra-text); }
.checklist-row__status.is-upcoming,
.checklist-row__status.is-locked { color: var(--text-muted); }
.checklist-row__type {
    flex: none; width: 20px; text-align: center; margin-top: 1px;
    font-size: 14px; line-height: 1; opacity: 0.85;
}
.checklist-row__body { flex: 1; min-width: 0; }
.checklist-row__title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 14px; color: var(--text-primary); font-weight: 600; line-height: 1.4;
}
.checklist-row__title a {
    color: inherit; text-decoration: none;
}
.checklist-row__title a:hover { text-decoration: underline; }
.checklist-row__sub {
    font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.45;
}
.checklist-row__action {
    margin-left: auto; flex: none; align-self: center; white-space: nowrap;
    font: 600 12px var(--f-body); color: var(--terra-text);
    text-decoration: none;
}
.checklist-row__action:hover { text-decoration: underline; }
.checklist-row__action.is-disabled { color: var(--text-muted); cursor: default; }
.checklist-row__action.is-disabled:hover { text-decoration: none; }

.checklist-row.is-highlighted {
    animation: row-pulse 1.6s ease-out forwards;
}
@keyframes row-pulse {
    0%   { background: rgba(185,72,46,0.28); }
    40%  { background: rgba(185,72,46,0.18); }
    100% { background: transparent; }
}
.checklist-row.is-done .checklist-row__title {
    color: var(--text-muted); text-decoration: line-through; font-weight: 500;
}
.checklist-row.is-locked { opacity: 0.55; }
.checklist-row.is-locked .checklist-row__title { color: var(--text-muted); font-weight: 500; }
.checklist-row.is-hot {
    background: linear-gradient(90deg, rgba(185,72,46,0.10), transparent 70%);
    margin: 0 -10px; padding-left: 10px; padding-right: 10px;
    border-radius: 6px; border-top-color: transparent;
}

/* ── PHASE GROUP HEADER + COLLAPSED ───────────── */
.phase-group-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 0 6px; margin-top: 8px;
}
.phase-group-header:first-child { margin-top: 0; padding-top: 4px; }
.phase-group-header__dot {
    width: 9px; height: 9px; border-radius: 50%; flex: none;
    background: var(--text-muted);
}
.phase-group-header__name {
    font: 700 11.5px var(--f-mono); letter-spacing: 0.17em;
    text-transform: uppercase; color: var(--text-body);
}
.phase-group-header__count {
    font-size: 11.5px; color: var(--text-muted); margin-left: auto;
    white-space: nowrap;
}
.phase-group-header--done   .phase-group-header__dot { background: var(--green); }
.phase-group-header--done   .phase-group-header__name { color: var(--green-text); }
.phase-group-header--active .phase-group-header__dot { background: var(--terra); }
.phase-group-header--active .phase-group-header__name { color: var(--terra-text); }
.phase-group-header--upcoming .phase-group-header__name { color: var(--text-muted); }
.phase-collapsed {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 0; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}
.phase-collapsed__cta { margin-left: auto; color: var(--text-muted); }

/* ── SIDEBAR CARDS (used in education.php, journey.php) ── */
.sidebar-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
}
.sidebar-card + .sidebar-card { margin-top: 14px; }
.sidebar-card--link {
    transition: background 0.15s, border-color 0.15s;
}
.sidebar-card--link:hover {
    background: var(--surface-2);
    border-color: var(--border-mid);
    text-decoration: none;
}
.sidebar-card__label {
    font: 700 10px var(--f-mono); letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.sidebar-card__bignum {
    font-family: var(--f-accent); font-style: italic; font-weight: 700;
    font-size: 32px; line-height: 1; color: var(--text-primary);
    letter-spacing: -0.01em;
}
.sidebar-card__between {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

/* ── QUIET RAIL (dashboard right column) ───────── */
.rail-quiet {
    display: flex; flex-direction: column;
    border-left: 1px solid var(--border);
    padding-left: 24px;
}
@media (max-width: 899px) {
    .rail-quiet {
        border-left: none; padding-left: 0;
        border-top: 1px solid var(--border); padding-top: 16px;
    }
}
.rail-item {
    padding: 18px 0;
    border-top: 1px solid var(--border);
}
.rail-item:first-child { border-top: none; padding-top: 2px; }
.rail-item__label {
    font: 700 10px var(--f-mono); letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.rail-item__bignum {
    font-family: var(--f-accent); font-style: italic; font-weight: 700;
    font-size: 32px; line-height: 1; color: var(--text-primary);
    letter-spacing: -0.01em;
}
.rail-item__between {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.rail-item--link {
    display: block; text-decoration: none; color: inherit;
    transition: opacity 0.15s;
}
.rail-item--link:hover { opacity: 0.8; text-decoration: none; }

/* progress bar shared between dashboard, sidebar, journey */
.pbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.pbar--terra  > i { background: var(--terra); }
.pbar--purple > i { background: var(--phase-5-fill); }
.pbar--lg { height: 11px; border-radius: 6px; }
.pbar--lg > i { border-radius: 6px; }

/* ── APP SHELL — left rail (desktop) + bottom tab bar (mobile) ── */
.app-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}
.app-rail {
    background: var(--bg-nav); border-right: 1px solid var(--border-mid);
    display: flex; flex-direction: column;
    padding: 18px 14px;
    position: sticky; top: 0; height: 100vh;
}
.app-rail__logo { margin-bottom: 24px; padding: 0 6px; }
/* Logo: uncapped height so it fills the sidebar properly. */
.app-rail__logo img { max-width: 160px; max-height: 64px; width: auto; height: auto; display: block; }
.app-rail__nav { display: flex; flex-direction: column; gap: 2px; }
.app-rail__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 7px;
    /* Rail stays dark in both themes — pin text to topbar tokens, never theme tokens. */
    color: var(--topbar-text); text-decoration: none;
    font: 600 14px var(--f-body); position: relative;
    transition: background 0.15s, color 0.15s;
}
.app-rail__item:hover {
    background: rgba(255,255,255,0.06); color: var(--topbar-text-strong);
}
.app-rail__item.is-active {
    background: rgba(255,255,255,0.09); color: var(--topbar-text-strong);
}
.app-rail__item.is-active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 2px; background: var(--terra);
}
.app-rail__icon { font-size: 16px; width: 20px; text-align: center; flex: none; }
.app-rail__label { flex: 1; min-width: 0; }
.app-rail__count {
    background: var(--attention-fill); color: #fff;
    font: 700 10px var(--f-mono); letter-spacing: 0.06em;
    padding: 2px 7px; border-radius: 999px; min-width: 20px;
    text-align: center; flex: none;
}
/* Border uses a fixed rgba so it stays visible on the always-dark rail. */
.app-rail__bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.13); }
.app-rail__bottom .app-rail__item { font-size: 13px; padding: 8px 12px; }
.app-rail__bottom .app-rail__user {
    font-size: 12px; color: var(--topbar-text-muted);
    padding: 4px 12px 6px;
}

.app-content {
    min-width: 0;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 28px 80px;
}

/* Mobile top bar + bottom tab bar */
.app-topbar-mini { display: none; }
.app-tabbar { display: none; }

@media (max-width: 899px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-rail { display: none; }
    .app-content { padding: 16px 14px 96px; }

    .app-topbar-mini {
        display: flex; align-items: center; gap: 12px;
        padding: 12px 14px;
        background: var(--bg-nav);
        border-bottom: 1px solid var(--border-mid);
        position: sticky; top: 0; z-index: 50;
    }
    .app-topbar-mini__logo img { max-width: 110px; max-height: 30px; display: block; }
    .app-topbar-mini__spacer { flex: 1; }
    .app-topbar-mini__pill {
        background: rgba(212,162,88,0.18); color: var(--attention-text);
        border: 1px solid rgba(212,162,88,0.32);
        font: 700 10px var(--f-mono); letter-spacing: 0.1em;
        padding: 4px 10px; border-radius: 999px;
        text-decoration: none;
    }

    .app-tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0;
        background: var(--bg-nav); border-top: 1px solid var(--border-mid);
        z-index: 50; padding-bottom: env(safe-area-inset-bottom);
    }
    .app-tabbar__item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px; padding: 9px 4px; min-height: 56px;
        color: var(--text-muted); text-decoration: none;
        font: 600 10px var(--f-body); position: relative;
    }
    .app-tabbar__item.is-active { color: var(--terra-text); }
    .app-tabbar__item.is-active::before {
        content: ""; position: absolute; top: 0; left: 18%; right: 18%;
        height: 2px; background: var(--terra); border-radius: 2px;
    }
    .app-tabbar__icon { font-size: 18px; line-height: 1; }
    .app-tabbar__dot {
        position: absolute; top: 6px; right: 30%;
        width: 7px; height: 7px; border-radius: 50%;
        background: var(--attention-text); border: 1px solid var(--bg-nav);
    }
}

/* ── PORTAL MEMBER ROWS (client-edit "Portal access" section) ─── */
.member-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 0; border-top: 1px solid var(--border);
}
.member-row:first-of-type { border-top: none; }
.member-row__info { flex: 1; min-width: 0; font-size: 13px; color: var(--text-body); }
.member-row__email { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── TWO-COLUMN DASHBOARD GRID ─────────────────── */
.dash-cols {
    display: grid; grid-template-columns: 1.62fr 1fr;
    gap: 16px; align-items: start;
}
@media (max-width: 899px) {
    .dash-cols { grid-template-columns: 1fr; }
}
.dash-stack { display: flex; flex-direction: column; gap: 14px; }

/* Welcome heading */
.client-welcome { margin-bottom: 1rem; }
.client-welcome h1 {
    font: 600 22px/1.3 var(--f-display);
    color: var(--text-primary); letter-spacing: -0.005em;
    margin: 0 0 4px;
}
.client-welcome p {
    font-family: var(--f-accent); font-style: italic;
    color: var(--text-body); font-size: 16px; line-height: 1.4;
    margin: 0;
}

/* ═════════════════════════════════════════════════════════════════ */
/*  STEP DETAIL — PHASE 2 COMPONENTS                                  */
/* ═════════════════════════════════════════════════════════════════ */

/* ── BREADCRUMB ─────────────────────────────────── */
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted);
    margin-bottom: 1rem; flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-muted); text-decoration: none;
    transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--terra-text); }
.breadcrumb__sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumb__current { color: var(--text-body); font-weight: 600; }

/* ── STEP HEADER ────────────────────────────────── */
.step-header { margin-bottom: 1rem; }
.step-header__top {
    display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
    margin-bottom: 8px;
}
.step-header__icon { font-size: 26px; line-height: 1; flex: none; }
.step-header__title {
    flex: 1; min-width: 0;
    font: 700 23px/1.25 var(--f-display);
    color: var(--text-primary); letter-spacing: -0.01em;
    margin: 0;
}
.step-header__title.is-done { text-decoration: line-through; color: var(--text-muted); }
.step-header__sub {
    font-family: var(--f-accent); font-style: italic;
    color: var(--text-body); font-size: 16px; line-height: 1.45;
    margin: 0;
}
.step-header__meta {
    margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}

/* ── DOC ROW (download card) ────────────────────── */
.doc-row {
    display: flex; align-items: center; gap: 13px;
    background: var(--surface-3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.doc-row + .doc-row { margin-top: 8px; }
.doc-row:hover { background: var(--surface-2); border-color: var(--border-mid); }
.doc-row__icon {
    flex: none; width: 36px; height: 44px; border-radius: 4px;
    background: var(--terra); display: grid; place-items: center;
    font: 700 10px var(--f-mono); color: #fff; letter-spacing: 0.05em;
}
.doc-row__info { flex: 1; min-width: 0; }
.doc-row__name {
    font-size: 13.5px; font-weight: 600; color: var(--text-primary);
    margin: 0 0 2px; word-break: break-word;
}
.doc-row__meta { font-size: 11.5px; color: var(--text-muted); }
.doc-row__action {
    flex: none; font: 600 11.5px var(--f-body); color: var(--terra-text);
    border: 1px solid var(--terra-text); border-radius: 5px;
    padding: 6px 12px; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.doc-row:hover .doc-row__action {
    background: var(--terra); color: #fff; border-color: var(--terra);
}

/* ── TASK BOX (terracotta-tinted "Do this" callout) ── */
.task-box {
    background: linear-gradient(180deg, rgba(185,72,46,0.11), transparent 80%);
    border: 1px solid rgba(212,113,90,0.27);
    border-radius: var(--radius); padding: 15px 18px;
}
.task-box__label {
    font: 700 10px var(--f-mono); letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--terra-text);
    margin-bottom: 8px;
}
.task-box ol, .task-box ul {
    margin: 0 0 0 18px; padding: 0;
    font-size: 13.5px; color: var(--text-body); line-height: 1.85;
}
.task-box li { margin-bottom: 4px; }
.task-box li:last-child { margin-bottom: 0; }
.task-box p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-body); line-height: 1.55; }

/* ── NEXT BOX (green "what happens next" callout) ── */
.next-box {
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 3px solid var(--green-text);
    border-radius: var(--radius); padding: 14px 16px;
}
.next-box__label {
    font: 700 10px var(--f-mono); letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--green-text);
    margin-bottom: 8px;
}
.next-box ul {
    margin: 0 0 0 16px; padding: 0;
    font-size: 12.5px; color: var(--text-body); line-height: 1.85;
}
.next-box li { margin-bottom: 4px; }

/* ── PHOTO TIPS card ────────────────────────────── */
.photo-tips {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; text-align: left;
}
.photo-tips__label {
    font: 700 10px var(--f-mono); letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 9px; display: flex; align-items: center; gap: 8px;
}
.photo-tips ul {
    margin: 0 0 0 16px; padding: 0;
    font-size: 12.5px; color: var(--text-body); line-height: 1.85;
}

/* ── UPLOAD FLOW (4 states; .is-active toggles which is visible) ── */
.upload-flow { /* no base styling — pure container */ }
.upload-flow__state { display: none; }
.upload-flow__state.is-active { display: block; }

/* State C — sending — dim the thumbnail grid + show "sending..." line */
.upload-flow__progress-wrap {
    height: 4px; background: var(--border-mid);
    border-radius: 2px; overflow: hidden; margin: 12px 0 6px;
}
.upload-flow__progress-bar {
    display: block; height: 100%; width: 0%; background: var(--terra);
    border-radius: 2px; transition: width 0.15s ease;
}
.upload-flow__sending-meta {
    font-size: 12px; color: var(--text-muted); margin-top: 6px; text-align: center;
}

/* State D — done — green check + warm sentence */
.upload-flow__done {
    text-align: center; padding: 12px 0 4px;
}
.upload-flow__done-check {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--green); border: 1px solid var(--green-text);
    display: grid; place-items: center; color: #cfe0bc;
    font: 700 24px var(--f-mono); margin: 0 auto 14px;
}
.upload-flow__done-title {
    font: 700 22px/1.3 var(--f-display);
    color: var(--text-primary); letter-spacing: -0.005em;
    margin: 0 0 6px;
}
.upload-flow__done-summary {
    font-size: 14px; color: var(--text-body); line-height: 1.55;
    max-width: 440px; margin: 0 auto;
}
.upload-flow__done-acts {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
    margin-top: 18px;
}

/* Thumbnail tile updates — reorder arrows + per-file status mark */
.upload-thumbs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); margin-top: 10px; }
.upload-thumb {
    position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
    background: var(--surface-2); border: 0.5px solid var(--border);
}
.upload-thumb__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb__fallback {
    display: flex; align-items: center; justify-content: center;
    height: 100%; font-size: 11px; padding: 6px; text-align: center;
    color: var(--text-muted); word-break: break-word;
}
.upload-thumb__remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 11px;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    font-size: 11px; cursor: pointer; line-height: 1; padding: 0;
}
.upload-thumb__order {
    position: absolute; bottom: 4px; left: 4px; right: 4px;
    display: flex; gap: 4px; justify-content: space-between;
}
.upload-thumb__order-btn {
    width: 22px; height: 22px; border-radius: 11px;
    background: rgba(0,0,0,0.55); color: #fff; border: none;
    font: 700 11px var(--f-mono); cursor: pointer; line-height: 1; padding: 0;
}
.upload-thumb__order-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.upload-thumb__status {
    position: absolute; top: 4px; left: 4px;
    background: rgba(0,0,0,0.6); color: #fff;
    font: 700 10px var(--f-mono); padding: 2px 6px; border-radius: 4px;
}
.upload-thumb__status.is-pending { color: #cfe0bc; }
.upload-thumb__status.is-done    { color: var(--green-text); }

/* "+ Add another page" placeholder tile */
.upload-thumb--add {
    border: 1.5px dashed var(--border-mid); background: transparent;
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 11px; color: var(--text-muted);
    cursor: pointer; padding: 6px;
    transition: border-color 0.15s, color 0.15s;
}
.upload-thumb--add:hover { border-color: var(--terra-text); color: var(--terra-text); }

/* When state C is active, dim the thumbs */
.upload-flow__state[data-state="sending"] .upload-thumbs {
    opacity: 0.55; pointer-events: none;
}

/* ═════════════════════════════════════════════════════════════════ */
/*  JOURNEY — full project timeline (Phase 3)                         */
/* ═════════════════════════════════════════════════════════════════ */
.timeline { padding: 4px 0; }
.timeline__node {
    position: relative;
    padding: 0 0 4px 32px;
    border-left: 2px solid var(--border-mid);
    margin-left: 14px;
}
.timeline__node:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}
.timeline__node.is-done   { border-left-color: var(--green); }
.timeline__node.is-active { border-left-color: var(--terra); }
.timeline__mark {
    position: absolute;
    left: -15px; top: -2px;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
    font: 700 11px var(--f-mono);
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    color: var(--text-muted);
}
.timeline__mark.is-done {
    background: var(--green);
    border-color: var(--green-text);
    color: #cfe0bc;
}
.timeline__mark.is-active {
    background: var(--terra);
    border: 2px solid var(--terra-text);
    color: #fff;
}
.timeline__mark.is-edu {
    background: #3a2e44;
    border-color: var(--phase-5-fill);
    color: #c9aedb;
}

.timeline__phase-row {
    display: flex; justify-content: space-between;
    align-items: baseline; flex-wrap: wrap; gap: 8px;
}
.timeline__phase-name {
    font: 700 13px var(--f-mono);
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--text-primary);
}
.timeline__node.is-upcoming .timeline__phase-name { color: var(--text-muted); }
.timeline__phase-status {
    font-size: 12px; color: var(--text-muted); white-space: nowrap;
}
.timeline__phase-meta {
    font-size: 12.5px; color: var(--text-muted); margin-top: 3px;
}

.timeline__body { padding: 9px 0 20px; }
.timeline__node:last-child .timeline__body { padding-bottom: 4px; }

.timeline__sub {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text-body);
    padding: 9px 0; border-top: 1px solid var(--border);
}
.timeline__sub:first-child { border-top: 0; }
.timeline__sub.is-dim { color: var(--text-muted); }
.timeline__sub-icon {
    flex: none; width: 18px; text-align: center;
    font: 700 12px var(--f-mono);
}
.timeline__sub-icon.is-done   { color: var(--green-text); }
.timeline__sub-icon.is-active { color: var(--terra-text); }
.timeline__sub-icon.is-upcoming { color: var(--text-muted); }
.timeline__sub-text { flex: 1; min-width: 0; }
.timeline__sub-text strong { color: var(--text-primary); }
.timeline__sub-link {
    margin-left: auto; flex: none; white-space: nowrap;
    color: var(--terra-text);
    font: 600 12px var(--f-body);
    text-decoration: none;
}
.timeline__sub-link:hover { text-decoration: underline; }

.timeline__phase-collapsed {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; font-size: 13px; color: var(--text-muted);
}
.timeline__phase-collapsed-cta { margin-left: auto; color: var(--text-muted); }

/* Rail node — education / "running alongside" — purple-grey accent */
.timeline__node--edu {
    border-left-color: var(--phase-5-fill) !important;
}
.timeline__node--edu .timeline__phase-name { color: #c9aedb; }

/* ─── Cohort public landing page ────────────────────────────────────────── */

.cohort-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
}
.cohort-page__topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-mid);
    background: var(--bg-nav);
}
.cohort-page__signin {
    font-size: 13px; font-weight: 600;
    color: var(--text-muted); text-decoration: none;
}
.cohort-page__signin:hover { color: var(--terra-text); }
.cohort-page__main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.cohort-page__footer {
    text-align: center;
    padding: 1.25rem;
    border-top: 0.5px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.cohort-page__footer a { color: var(--terra-text); }

@media (max-width: 600px) {
    .cohort-page__topbar { padding: 12px 16px; }
    .cohort-page__main { padding: 1.5rem 1rem 3rem; }
    .cohort-page__signin { font-size: 12px; }
}

/* Hero */
.cohort-landing__hero { margin-bottom: 2rem; text-align: center; }
.cohort-landing__headline {
    font-family: var(--f-accent, 'Libre Baskerville', Georgia, serif);
    font-style: italic;
    font-size: 36px;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0 0 1rem;
}
@media (max-width: 600px) { .cohort-landing__headline { font-size: 26px; } }

/* Spots-remaining counter pill */
.cohort-spots {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
    border: 1.5px solid;
}
.cohort-spots strong { font-size: 19px; }
.cohort-spots__total { font-size: 13px; font-weight: 500; opacity: 0.75; }
.cohort-spots--open    { color: var(--green-text); background: rgba(122,154,100,0.12); border-color: rgba(122,154,100,0.45); }
.cohort-spots--low     { color: #b87c00;          background: rgba(184,124,0,0.12);  border-color: rgba(184,124,0,0.45); }
.cohort-spots--closed  { color: var(--terra-text); background: rgba(185,72,46,0.10); border-color: rgba(185,72,46,0.40); }

/* Video block */
.cohort-landing__video { margin: 0 0 2rem; }
.cohort-landing__videolink {
    text-align: center; margin: 0 0 2rem;
    font-size: 15px;
}
.cohort-landing__videolink a { color: var(--terra-text); font-weight: 700; text-decoration: none; }

/* Body / terms / closed message cards */
.cohort-landing__body, .cohort-landing__terms, .cohort-landing__closed {
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-body);
}
.cohort-landing__body h1, .cohort-landing__body h2, .cohort-landing__body h3,
.cohort-landing__terms h1, .cohort-landing__terms h2, .cohort-landing__terms h3,
.cohort-landing__closed h1, .cohort-landing__closed h2, .cohort-landing__closed h3 {
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.cohort-landing__body h1, .cohort-landing__terms h1, .cohort-landing__closed h1 { font-size: 22px; }
.cohort-landing__body h2, .cohort-landing__terms h2, .cohort-landing__closed h2 { font-size: 18px; }
.cohort-landing__body h3, .cohort-landing__terms h3, .cohort-landing__closed h3 { font-size: 16px; }
.cohort-landing__body p, .cohort-landing__terms p, .cohort-landing__closed p { margin: 0 0 0.85rem; }
.cohort-landing__body ul, .cohort-landing__terms ul, .cohort-landing__closed ul,
.cohort-landing__body ol, .cohort-landing__terms ol, .cohort-landing__closed ol {
    margin: 0 0 0.85rem; padding-left: 1.5rem;
}
.cohort-landing__body li, .cohort-landing__terms li, .cohort-landing__closed li { margin-bottom: 0.35rem; }
.cohort-landing__body a, .cohort-landing__terms a, .cohort-landing__closed a { color: var(--terra-text); }

.cohort-landing__terms { background: var(--surface-2); }
.cohort-landing__terms > h2:first-child {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Sign-up form card */
.cohort-landing__form {
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1rem;
}
.cohort-landing__form h2 {
    font-size: 20px;
    margin: 0 0 1.25rem;
    color: var(--text-primary);
}
@media (max-width: 600px) {
    .cohort-landing__body, .cohort-landing__terms, .cohort-landing__closed,
    .cohort-landing__form { padding: 1.25rem 1.25rem; }
}

/* "Check your email" interstitial */
.cohort-landing__interstitial {
    text-align: center;
    background: var(--bg-card);
    border: 0.5px solid var(--border-mid);
    border-radius: 12px;
    padding: 2.5rem 2rem 2rem;
}
@media (max-width: 600px) { .cohort-landing__interstitial { padding: 2rem 1.25rem 1.5rem; } }

/* ── Education course builder: Module sections (admin) ────────────────── */
.module-section {
    background: var(--surface-3);
    border: 0.5px solid var(--border-mid);
    border-left: 3px solid var(--phase-5-fill);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem 1rem;
    margin-bottom: 1rem;
}
.module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.85rem;
}
.module-header .module-toggle {
    flex: none;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: color-mix(in srgb, var(--phase-5-fill) 22%, transparent);
    color: var(--phase-5-text);
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}
.module-header .js-module-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--phase-5-text);
}
.module-header .js-module-name::placeholder { color: var(--text-muted); font-weight: 400; }
.module-header .remove-module {
    flex: none;
    font-size: 11px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}
.module-header .remove-module:hover { color: var(--terra-text); }
.module-section.collapsed .parts-container { display: none; }
.parts-container .add-part { margin-top: 0.25rem; }
