/* ═══════════════════════════════════════════════════════
   BOOKING WIZARD — Healthcare appointment booking
   ═══════════════════════════════════════════════════════ */

:root {
    --bk-primary: #0f172a;
    --bk-accent: #2563eb;
    --bk-success: #16a34a;
    --bk-border: #e2e8f0;
    --bk-bg: #f8fafc;
    --bk-bg-alt: #f1f5f9;
    --bk-text: #1e293b;
    --bk-secondary: #64748b;
    --bk-radius: 12px;
    --bk-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.booking {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    font-family: var(--bk-font);
    color: var(--bk-text);
}

/* ── Progress steps ─────────────────────────── */

.booking-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.booking-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: var(--bk-border);
    z-index: 0;
}

.booking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1;
    cursor: default;
}

.booking-step.is-done {
    cursor: pointer;
}

.booking-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    border: 2px solid var(--bk-border);
    color: var(--bk-secondary);
    transition: all 0.2s ease;
}

.booking-step.is-active .booking-step-num {
    background: var(--bk-accent);
    border-color: var(--bk-accent);
    color: #fff;
}

.booking-step.is-done .booking-step-num {
    background: var(--bk-success);
    border-color: var(--bk-success);
    color: #fff;
}

.booking-step-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--bk-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: none;
}

.booking-step.is-active .booking-step-label {
    display: block;
    color: var(--bk-accent);
    font-weight: 700;
}

/* ── Cards ──────────────────────────────────── */

.booking-card {
    background: #fff;
    border-radius: var(--bk-radius);
    padding: 28px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.booking-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--bk-primary);
}

.booking-hint {
    font-size: 13px;
    color: var(--bk-secondary);
    margin: 0 0 20px;
}
.booking-hint--accent {
    color: var(--bk-accent, #2563eb);
    font-weight: 500;
    margin-top: -12px;
}

/* ── Option grid (specialty, doctor) ───────── */

.booking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.booking-grid--doctors {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.booking-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border: 2px solid var(--bk-border);
    border-radius: var(--bk-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.booking-option:hover {
    border-color: var(--bk-accent);
    background: #f0f4ff;
}

.booking-option.is-selected {
    border-color: var(--bk-accent);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--bk-accent);
}

.booking-option-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bk-accent);
}

.booking-option-icon svg {
    width: 28px;
    height: 28px;
}

.booking-option-name {
    font-size: 14px;
    font-weight: 600;
}

.booking-option-sub {
    font-size: 12px;
    color: var(--bk-secondary);
    line-height: 1.3;
}

/* ── Doctor avatar ──────────────────────────── */

.booking-doctor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bk-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bk-secondary);
}

.booking-doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booking-doctor-avatar svg {
    width: 28px;
    height: 28px;
}

/* ── Calendar ───────────────────────────────── */

.booking-calendar {
    margin-bottom: 24px;
}

.booking-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.booking-cal-title {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

.booking-cal-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--bk-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.booking-cal-nav:hover {
    border-color: var(--bk-accent);
    color: var(--bk-accent);
}

.booking-cal-day-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--bk-secondary);
    text-align: center;
    padding: 4px 0;
}

.booking-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.booking-cal-day {
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: var(--bk-text);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.booking-cal-day:hover:not(:disabled) {
    background: var(--bk-accent);
    color: #fff;
}

.booking-cal-day.is-past,
.booking-cal-day.is-unavailable {
    color: var(--bk-secondary);
    opacity: 0.35;
    cursor: default;
}

.booking-cal-day.is-selected {
    background: var(--bk-accent);
    color: #fff;
    font-weight: 700;
}

.cal-day.is-disabled {
    opacity: 0.3;
}

/* ── Time slots ─────────────────────────────── */

.booking-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.booking-slot {
    padding: 12px 8px;
    border: 2px solid var(--bk-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease;
}

.booking-slot:hover:not(:disabled) {
    border-color: var(--bk-accent);
}

.booking-slot.is-selected {
    border-color: var(--bk-accent);
    background: var(--bk-accent);
    color: #fff;
}

.booking-slot.is-unavailable {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ── Patient form ───────────────────────────── */

.booking-form {
    margin-bottom: 16px;
}

.booking-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.booking-field {
    position: relative;
    margin-bottom: 16px;
}

.booking-field input {
    width: 100%;
    padding: 16px 0 8px;
    border: none;
    border-bottom: 1px solid var(--bk-border);
    font-size: 15px;
    background: transparent;
    outline: none;
    color: var(--bk-text);
    font-family: var(--bk-font);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.booking-field input:focus {
    border-bottom-color: var(--bk-accent);
}

.booking-field label {
    position: absolute;
    left: 0;
    top: 16px;
    font-size: 15px;
    color: var(--bk-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
}

.booking-field input:focus + label,
.booking-field input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bk-accent);
}

.booking-logged-in {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.booking-summary-mini {
    font-size: 13px;
    color: var(--bk-secondary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bk-border);
}

/* ── Actions ────────────────────────────────── */

.booking-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--bk-secondary);
    line-height: 1.5;
    margin: 16px 0;
    cursor: pointer;
}

.booking-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--bk-accent);
}

.booking-consent a {
    color: var(--bk-accent);
    font-weight: 600;
}

.booking-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .booking-actions--sticky {
        position: sticky;
        bottom: 0;
        background: var(--bk-bg, #f8fafc);
        padding: 12px 0;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
        border-top: 1px solid var(--bk-border, #e2e8f0);
        z-index: 10;
    }
}

.booking-btn {
    padding: 12px 28px;
    border: 1px solid var(--bk-border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--bk-font);
    color: var(--bk-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.booking-btn:hover {
    border-color: var(--bk-primary);
}

.booking-btn--primary {
    background: var(--bk-accent);
    border-color: var(--bk-accent);
    color: #fff;
}

.booking-btn--primary:hover {
    background: #1d4ed8;
}
.booking-btn--primary:disabled,
.booking-btn--primary.is-loading {
    opacity: .6;
    cursor: wait;
}

.booking-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Loading ────────────────────────────────── */

.booking-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.booking-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bk-border);
    border-top-color: var(--bk-accent);
    border-radius: 50%;
    animation: bk-spin 0.8s linear infinite;
}

@keyframes bk-spin {
    to { transform: rotate(360deg); }
}

.booking-empty {
    text-align: center;
    color: var(--bk-secondary);
    padding: 24px 0;
    font-size: 14px;
}

/* ── Toast (booking feedback) ───────────────── */

.booking-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    z-index: 500;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    max-width: calc(100% - 32px);
    text-align: center;
}
.booking-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Form fields (welcome wizard, simple forms) ── */

.booking-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--bk-text, #1e293b);
    margin-bottom: 6px;
}
.booking-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bk-border, #d1d5db);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--bk-text, #1e293b);
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
}
.booking-input:focus {
    outline: none;
    border-color: var(--bk-accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.booking-input::placeholder { color: #94a3b8; }

/* ── Confirmation ───────────────────────────── */

.booking-card--success {
    text-align: center;
}

.booking-success-icon {
    margin-bottom: 16px;
}

.booking-success-icon svg {
    width: 56px;
    height: 56px;
}

.booking-confirmation {
    text-align: left;
    margin: 24px 0;
    padding: 16px;
    background: var(--bk-bg);
    border-radius: 8px;
}

.booking-confirmation-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.booking-confirmation-row:not(:last-child) {
    border-bottom: 1px solid var(--bk-border);
}

.booking-confirmation-row span {
    color: var(--bk-secondary);
}

/* ── Responsive ─────────────────────────────── */

@media (max-width: 640px) {
    .booking-steps {
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 8px;
    }

    .booking-step-label {
        display: none;
    }

    .booking-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .booking-form-row {
        grid-template-columns: 1fr;
    }

    .booking-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .booking-card {
        padding: 20px 16px;
    }
}

/* ═══════════════════════════════════════════════════════
   LANGUAGE SWITCHER — Healthcare layout
   ═══════════════════════════════════════════════════════ */

/* hc-lang-btn removed — layout now uses ld-lang-btn from landing CSS */

.hc-lang-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.hc-lang-overlay.is-open { opacity: 1; visibility: visible; }

.hc-lang-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--hc-surface);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px 32px;
    z-index: 201;
    transform: translateY(100%);
    transition: transform .25s ease;
    pointer-events: none;
    visibility: hidden;
}
.hc-lang-panel.is-open { transform: translateY(0); pointer-events: auto; visibility: visible; }

.hc-lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--hc-border);
    text-decoration: none;
    color: var(--hc-text);
    font-size: 15px;
    transition: color .15s;
}
.hc-lang-item:last-child { border-bottom: none; }
.hc-lang-item.is-active { color: var(--hc-accent); font-weight: 600; }

/* Desktop: dropdown instead of bottom sheet */
@media (min-width: 768px) {
    .hc-lang-panel {
        position: fixed;
        bottom: auto;
        top: 56px;
        right: 16px;
        left: auto;
        width: 220px;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: transform .15s, opacity .15s, visibility .15s;
    }
    .hc-lang-panel.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

/* ══════════════════════════════════════════════════════════════
   LANDING PAGE (.ld-*)
   ═════════════════════════════════════════════════════════════= */

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

        :root {
            --ld-primary: #0f172a;
            --ld-accent: #2563eb;
            --ld-accent-hover: #1d4ed8;
            --ld-bg: #ffffff;
            --ld-bg-alt: #f0f4f8;
            --ld-text: #1e293b;
            --ld-secondary: #64748b;
            --ld-border: #e2e8f0;
            --ld-success: #16a34a;
            --ld-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            --ld-max: 1120px;
        }

        body { font-family: var(--ld-font); color: var(--ld-text); background: var(--ld-bg); }
        a { text-decoration: none; color: inherit; }

        /* ── Header ── */
        .ld-header {
            position: fixed; top: 0; left: 0; right: 0; z-index: 100;
            background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--ld-border);
        }
        .ld-header-inner {
            max-width: var(--ld-max); margin: 0 auto; padding: 0 24px;
            height: 64px; display: flex; align-items: center; justify-content: space-between;
        }
        .ld-logo { font-size: 20px; font-weight: 800; color: var(--ld-accent); display: flex; align-items: center; gap: 8px; }
        .ld-logo svg { width: 28px; height: 28px; }
        .ld-nav { display: flex; align-items: center; gap: 32px; }
        .ld-nav a:not(.ld-btn) { font-size: 14px; font-weight: 500; color: var(--ld-secondary); transition: color 0.15s; }
        .ld-nav a:not(.ld-btn):hover { color: var(--ld-accent); }
        .ld-btn {
            display: inline-flex; align-items: center; padding: 10px 24px;
            border-radius: 8px; font-size: 14px; font-weight: 600;
            transition: all 0.15s; cursor: pointer; border: none;
        }
        .ld-btn--primary { background: var(--ld-accent); color: #fff; }
        .ld-btn--primary:hover { background: var(--ld-accent-hover); }
        .ld-btn--outline { background: transparent; color: var(--ld-primary); border: 1.5px solid var(--ld-border); }
        .ld-btn--outline:hover { border-color: var(--ld-accent); color: var(--ld-accent); }

        /* ── Language switcher ── */
        /* ── Language switcher ── */
        .ld-lang-btn {
            display: flex; align-items: center; gap: 6px;
            background: none; border: none; cursor: pointer;
            font-size: 13px; font-weight: 500; color: var(--ld-secondary);
            padding: 8px; border-radius: 6px; transition: background 0.15s;
            text-transform: uppercase; min-width: 44px; min-height: 44px;
            justify-content: center;
        }
        .ld-lang-btn:hover { background: var(--ld-bg-alt); }

        .ld-lang-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.3);
            z-index: 400; opacity: 0; pointer-events: none;
            transition: opacity 0.2s ease;
        }
        .ld-lang-overlay.is-open { opacity: 1; pointer-events: auto; }

        .ld-lang-panel {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: #fff; border-radius: 16px 16px 0 0;
            padding: 20px 24px 32px; z-index: 401;
            transform: translateY(100%);
            transition: transform 0.3s ease;
            box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
            pointer-events: none; visibility: hidden;
        }
        .ld-lang-panel.is-open { transform: translateY(0); pointer-events: auto; visibility: visible; }

        .ld-lang-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 14px 0; border-bottom: 1px solid var(--ld-border);
            font-size: 15px; color: var(--ld-text); text-decoration: none;
            transition: color 0.1s;
        }
        .ld-lang-item:last-child { border-bottom: none; }
        .ld-lang-item:hover { color: var(--ld-accent); }

        @media (min-width: 769px) {
            .ld-lang-panel {
                position: fixed; bottom: auto; top: 64px; right: 16px;
                left: auto; width: 200px;
                border-radius: 8px; padding: 16px 20px 20px;
                transform: translateY(-10px); opacity: 0;
                transition: transform 0.2s ease, opacity 0.2s ease;
                pointer-events: none; visibility: hidden;
            }
            .ld-lang-panel.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; visibility: visible; }
        }

        /* ── Hero ── */
        .ld-hero {
            padding: 140px 24px 80px; text-align: center;
            background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
        }
        .ld-hero h1 {
            font-size: clamp(32px, 5vw, 56px); font-weight: 800;
            line-height: 1.1; max-width: 700px; margin: 0 auto 20px;
            color: var(--ld-primary);
        }
        .ld-hero h1 span { color: var(--ld-accent); }
        .ld-hero p {
            font-size: 18px; color: var(--ld-secondary); max-width: 520px;
            margin: 0 auto 32px; line-height: 1.6;
        }
        .ld-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

        /* ── Features ── */
        .ld-section { padding: 80px 24px; }
        .ld-section--alt { background: var(--ld-bg-alt); }
        .ld-section-inner { max-width: var(--ld-max); margin: 0 auto; }
        .ld-section h2 {
            font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 12px;
        }
        .ld-section .ld-subtitle {
            font-size: 16px; color: var(--ld-secondary); text-align: center;
            max-width: 480px; margin: 0 auto 48px;
        }

        .ld-features {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
        }
        .ld-feature {
            padding: 32px; border-radius: 12px; background: var(--ld-bg);
            border: 1px solid var(--ld-border);
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .ld-feature:hover {
            border-color: var(--ld-accent);
            box-shadow: 0 4px 16px rgba(37,99,235,0.08);
        }
        .ld-feature-icon {
            width: 48px; height: 48px; border-radius: 10px;
            background: #eff6ff; display: flex; align-items: center; justify-content: center;
            margin-bottom: 16px; color: var(--ld-accent);
        }
        .ld-feature-icon svg { width: 24px; height: 24px; }
        .ld-feature h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
        .ld-feature p { font-size: 14px; color: var(--ld-secondary); line-height: 1.6; }

        /* ── Doctor Hero Card (booking wizard) ── */
        .booking-hero-card {
            display: flex; align-items: flex-start; gap: 16px;
            padding: 20px 24px; margin: -4px auto 20px;
            max-width: 480px;
            background: var(--ld-bg-alt, #f8fafc);
            border: 1px solid var(--ld-border, #e2e8f0);
            border-radius: 2px;
            animation: heroFadeIn .35s ease-out;
        }
        @keyframes heroFadeIn {
            from { opacity: 0; transform: translateY(-8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .booking-hero-card__avatar {
            width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
            background: var(--bk-bg-alt); display: flex; align-items: center; justify-content: center;
            color: var(--bk-secondary);
        }
        .booking-hero-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
        .booking-hero-card__avatar svg { width: 32px; height: 32px; }
        .booking-hero-card__info { flex: 1; min-width: 0; padding-top: 2px; }
        .booking-hero-card__name { font-weight: 700; font-size: 16px; color: var(--ld-text, #0f172a); line-height: 1.3; }
        .booking-hero-card__specialty { font-size: 13px; color: var(--ld-accent, #2563eb); margin-top: 2px; }
        .booking-hero-card__clinic { font-size: 12px; color: var(--ld-muted, #94a3b8); margin-top: 1px; }
        .booking-hero-card__bio {
            font-size: 13px; color: var(--ld-secondary, #64748b); line-height: 1.5; margin-top: 8px;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
        }
        @media (max-width: 480px) {
            .booking-hero-card { padding: 16px; gap: 12px; }
            .booking-hero-card__avatar { width: 56px; height: 56px; }
            .booking-hero-card__avatar svg { width: 24px; height: 24px; }
            .booking-hero-card__name { font-size: 15px; }
            .booking-hero-card__bio { -webkit-line-clamp: 2; }
        }

        /* ── Trust strip ── */
        .ld-trust {
            display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
        }
        .ld-trust-card {
            display: flex; align-items: center; gap: 14px;
            padding: 16px 20px; background: var(--ld-bg);
            border: 1px solid var(--ld-border); border-radius: 2px;
            min-width: 220px;
        }
        .ld-trust-initials {
            width: 44px; height: 44px; border-radius: 2px;
            background: var(--ld-bg-alt); color: var(--ld-accent);
            display: flex; align-items: center; justify-content: center;
            font-size: 15px; font-weight: 700; flex-shrink: 0;
            letter-spacing: 1px;
        }
        .ld-trust-name { font-size: 14px; font-weight: 600; }
        .ld-trust-spec { font-size: 13px; color: var(--ld-accent); margin-top: 1px; }
        .ld-trust-city { font-size: 12px; color: var(--ld-secondary); margin-top: 1px; }

        /* ── Pricing ── */
        .ld-pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
        .ld-plan {
            padding: 32px; border-radius: 12px; background: var(--ld-bg);
            border: 1px solid var(--ld-border); text-align: center;
            display: flex; flex-direction: column;
        }
        .ld-plan--featured {
            border-color: var(--ld-accent); box-shadow: 0 4px 24px rgba(37,99,235,0.12);
            position: relative;
        }
        .ld-plan--featured::before {
            content: attr(data-label); position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
            background: var(--ld-accent); color: #fff; padding: 4px 16px; border-radius: 20px;
            font-size: 12px; font-weight: 600;
        }
        .ld-plan h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
        .ld-plan .ld-price {
            font-size: 40px; font-weight: 800; margin: 16px 0 4px; color: var(--ld-primary);
        }
        .ld-plan .ld-price span { font-size: 16px; font-weight: 400; color: var(--ld-secondary); }
        .ld-plan .ld-price-sub { font-size: 13px; color: var(--ld-secondary); margin-bottom: 24px; }
        .ld-plan ul {
            list-style: none; text-align: left; margin-bottom: 24px; flex: 1;
        }
        .ld-plan li {
            padding: 8px 0; font-size: 14px; color: var(--ld-text);
            border-bottom: 1px solid var(--ld-border);
            display: flex; align-items: center; gap: 8px;
        }
        .ld-plan li::before {
            content: '✓'; color: var(--ld-success); font-weight: 700; font-size: 14px;
        }
        .ld-plan .ld-btn { width: 100%; justify-content: center; }

        /* ── Pricing tabs ── */
        .ld-tab {
            flex: 1; padding: 8px 16px; border: none; border-radius: 6px;
            font-size: 14px; font-weight: 600; cursor: pointer;
            background: transparent; color: var(--ld-secondary); transition: all 0.15s;
        }
        .ld-tab.is-active { background: #fff; color: var(--ld-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

        /* ── Module list ── */
        .ld-module-list { display: flex; flex-direction: column; gap: 12px; }
        .ld-module {
            display: flex; align-items: center; justify-content: space-between;
            padding: 20px 24px; border: 1px solid var(--ld-border); border-radius: 12px;
            background: #fff; transition: border-color 0.15s;
        }
        .ld-module:hover { border-color: var(--ld-accent); background: #fafbff; cursor: pointer; text-decoration: none; }
        .ld-module-info { display: flex; align-items: center; gap: 16px; }
        .ld-module-icon {
            width: 40px; height: 40px; border-radius: 8px; background: #eff6ff;
            display: flex; align-items: center; justify-content: center; color: var(--ld-accent); flex-shrink: 0;
        }
        .ld-module-icon svg { width: 20px; height: 20px; }
        .ld-module-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
        .ld-module-desc { font-size: 13px; color: var(--ld-secondary); }
        .ld-module-price { font-size: 18px; font-weight: 700; color: var(--ld-primary); white-space: nowrap; }

        /* ── CTA ── */
        .ld-cta {
            text-align: center; padding: 80px 24px;
            background: var(--ld-primary); color: #fff;
        }
        .ld-cta h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
        .ld-cta p { font-size: 16px; color: #94a3b8; margin-bottom: 32px; }

        /* ── Cohort early-adopter banner — announcement card (centered, brand accent) ── */
        .ld-cohort {
            padding: 56px 24px;
            background: linear-gradient(135deg, var(--ld-primary) 0%, var(--ld-accent) 100%);
            color: #fff;
            text-align: center;
        }
        .ld-cohort__inner {
            max-width: 720px; margin: 0 auto;
            display: flex; flex-direction: column; gap: 16px; align-items: center;
        }
        .ld-cohort__icon {
            width: 56px; height: 56px;
            display: flex; align-items: center; justify-content: center;
            color: #fff;
            background: rgba(255,255,255,0.12);
            border: 1px solid rgba(255,255,255,0.24);
        }
        .ld-cohort__icon svg { width: 32px; height: 32px; }
        .ld-cohort__title {
            font-size: 24px; font-weight: 700;
            margin: 4px 0 0; color: #fff;
            letter-spacing: -0.01em;
        }
        .ld-cohort__text {
            font-size: 15px; color: rgba(255,255,255,0.92);
            line-height: 1.6; margin: 0;
            max-width: 560px;
        }
        @media (max-width: 600px) {
            .ld-cohort { padding: 40px 20px; }
            .ld-cohort__title { font-size: 20px; }
            .ld-cohort__text { font-size: 14px; }
        }

        /* ── Footer ── */
        .ld-footer {
            padding: 32px 24px; text-align: center;
            font-size: 13px; color: var(--ld-secondary);
            border-top: 1px solid var(--ld-border);
        }

        /* ── Sign in: icon on mobile, text on desktop ── */
        .ld-signin-text { display: inline; }
        .ld-signin-icon { display: none; }

        /* ── Floating CTA (visible when hero scrolls out) ── */
        .ld-fab {
            position: fixed; bottom: 24px; right: 24px; z-index: 100;
            background: var(--ld-accent); color: #fff;
            padding: 14px 28px; border-radius: 28px;
            font-size: 14px; font-weight: 700; text-decoration: none;
            box-shadow: 0 4px 16px rgba(37,99,235,0.3);
            transform: translateY(100px); opacity: 0;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
        .ld-fab.is-visible { transform: translateY(0); opacity: 1; }
        .ld-fab:hover { background: var(--ld-accent-hover); }

        /* ── Auto-hide header on scroll (mobile) ── */
        .ld-header { transition: transform 0.3s ease; }
        .ld-header.is-hidden { transform: translateY(-100%); }

        /* ── Responsive ── */
        @media (max-width: 768px) {
            .ld-features, .ld-pricing { grid-template-columns: 1fr; }
            .ld-nav { gap: 8px; }
            .ld-nav a:not(.ld-btn) { display: none; }
            .ld-nav .ld-btn--primary { display: none; } /* CTA moves to FAB */
            .ld-signin-text { display: none; }
            .ld-signin-icon { display: flex; }
            .ld-btn--outline.ld-btn--signin { padding: 8px; border: none; background: none; }
            .ld-fab { padding: 12px 24px; font-size: 13px; bottom: 16px; right: 16px; }
        }

/* ══════════════════════════════════════════════════════════════
   REGISTER PAGE (.hc-reg-*, .hc-toast)
   ═════════════════════════════════════════════════════════════= */

.hc-toast { position:fixed;bottom:24px;left:0;right:0;width:fit-content;margin:0 auto;background:#0f172a;color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;z-index:500;box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.hc-toast--error { background:#dc2626; }
.hc-reg-field { position:relative;margin-bottom:16px; }
.hc-reg-field input { width:100%;padding:14px 16px 14px;border:1px solid #e2e8f0;border-radius:8px;font-size:15px;background:#f8fafc;color:#1e293b;outline:none;transition:border-color 0.2s,background 0.2s;font-family:inherit;box-sizing:border-box; }
.hc-reg-field input:focus { border-color:#2563eb;background:#fff; }
.hc-reg-field label { position:absolute;left:16px;top:14px;font-size:15px;color:#94a3b8;pointer-events:none;transition:all 0.2s; }
.hc-reg-field input:focus + label, .hc-reg-field input:not(:placeholder-shown) + label { top:-8px;left:12px;font-size:11px;font-weight:600;color:#2563eb;background:#fff;padding:0 4px; }

/* ══════════════════════════════════════════════════════════════
   MODULE DETAIL PAGE (.mod-*)
   ═════════════════════════════════════════════════════════════= */

.mod-hero { text-align:center;padding:64px 16px 40px;max-width:640px;margin:0 auto; }
.mod-hero h1 { font-size:28px;font-weight:800;color:#0f172a;margin-bottom:12px; }
.mod-hero h1 span { color:#2563eb; }
.mod-hero p { font-size:16px;line-height:1.6;color:#475569;margin-bottom:24px; }
.mod-price-tag { display:inline-block;background:#eff6ff;color:#2563eb;font-size:20px;font-weight:700;padding:10px 28px;border-radius:12px;margin-bottom:32px; }
.mod-features { max-width:520px;margin:0 auto 48px;padding:0 16px; }
.mod-features h2 { font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8;margin-bottom:16px; }
.mod-feature { display:flex;align-items:flex-start;gap:12px;padding:14px 0;border-bottom:1px solid #f1f5f9; }
.mod-feature:last-child { border-bottom:none; }
.mod-feature svg { flex-shrink:0;width:20px;height:20px;color:#2563eb;margin-top:1px; }
.mod-feature span { font-size:15px;color:#1e293b;line-height:1.4; }
.mod-cta { text-align:center;padding:0 16px 80px; }
.mod-cta a { display:inline-block;background:#2563eb;color:#fff;font-size:16px;font-weight:600;padding:16px 40px;border-radius:10px;text-decoration:none;transition:background .15s,transform .1s;box-shadow:0 2px 8px rgba(37,99,235,.25); }
.mod-cta a:hover { background:#1d4ed8;transform:translateY(-1px); }
.mod-cta a:active { transform:translateY(0); }
.mod-cta p { margin-top:12px;font-size:13px;color:#94a3b8; }
.mod-back { display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#64748b;text-decoration:none;margin-top:20px;transition:color .15s; }
.mod-back:hover { color:#0f172a; }

@media (max-width: 480px) {
    .mod-hero { padding:40px 16px 24px; }
    .mod-hero h1 { font-size:22px; }
    .mod-hero p { font-size:14px; }
    .mod-price-tag { font-size:18px;padding:8px 20px; }
}

/* ══════════════════════════════════════════════════════════════
   UPGRADE PAGE (.plan-card, .gw-option, #stripeCard)
   ═════════════════════════════════════════════════════════════= */

.plan-card { flex:1;min-width:200px;border:2px solid var(--ld-border);border-radius:12px;padding:24px;cursor:pointer;transition:border-color .2s,box-shadow .2s;background:var(--ld-bg-alt);position:relative; }
.plan-card:hover { box-shadow:0 2px 12px rgba(0,0,0,.06); }
.plan-card.is-selected { border-color:var(--ld-accent);box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.plan-card ul { font-size:13px;color:var(--ld-secondary);line-height:2.2;list-style:none;padding:0;margin:0; }
.gw-option { display:flex;align-items:center;gap:10px;padding:12px 16px;border:1px solid var(--ld-border);border-radius:8px;cursor:pointer;font-size:14px;transition:border-color .15s;background:var(--ld-bg); }
.gw-option:has(input:checked), .gw-option.is-checked { border-color:var(--ld-accent);background:var(--ld-bg-alt); }
#stripeCard { padding:12px;border:1px solid var(--ld-border);border-radius:8px;background:var(--ld-bg);margin-bottom:16px;min-height:44px; }
#stripeCard.StripeElement--focus { border-color:var(--ld-accent); }
#stripeCard.StripeElement--invalid { border-color:#dc2626; }

/* ═══════════════════════════════════════════════════════
   LANDING PAGES — segmented (patients / doctors)
   Reusable lp-* classes for all public landing pages
   ═══════════════════════════════════════════════════════ */

.lp { max-width: 800px; margin: 0 auto; padding: 0 16px; }

.lp-hero {
    text-align: center;
    padding: 60px 0 40px;
}

.lp-hero h1 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--hc-primary, #0f172a);
}

.lp-hero p {
    font-size: 17px;
    color: var(--hc-secondary, #64748b);
    line-height: 1.6;
    max-width: 540px;
    margin: 0 auto 24px;
}

.lp-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid var(--hc-border, #e2e8f0);
    color: var(--hc-text, #1e293b);
    background: #fff;
    cursor: pointer;
    transition: all .15s;
}

.lp-btn:hover { background: #f8fafc; }

.lp-btn--primary {
    background: var(--hc-accent, #2563eb);
    color: #fff;
    border-color: var(--hc-accent, #2563eb);
}

.lp-btn--primary:hover { background: #1d4ed8; }

.lp-btn--ghost {
    background: transparent;
    border-color: var(--hc-border);
}

.lp-btn--lg { padding: 14px 32px; font-size: 16px; }

.lp-section {
    padding: 48px 0;
}

.lp-section--alt {
    background: #f8fafc;
    margin: 0 -16px;
    padding: 48px 16px;
    border-radius: 16px;
}

.lp-section h2 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.lp-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.lp-step {
    text-align: center;
    padding: 24px 16px;
}

.lp-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hc-accent, #2563eb);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.lp-step h3 { font-size: 16px; margin-bottom: 6px; }
.lp-step p { font-size: 14px; color: var(--hc-secondary); line-height: 1.5; }

.lp-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.lp-feature {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--hc-border, #e2e8f0);
    border-radius: 12px;
}

.lp-feature-icon {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--hc-accent, #2563eb);
    stroke-width: 2;
    margin-bottom: 12px;
}

.lp-feature h3 { font-size: 15px; margin-bottom: 6px; }
.lp-feature p { font-size: 13px; color: var(--hc-secondary); line-height: 1.5; }

.lp-cta {
    text-align: center;
    padding: 48px 16px;
}

.lp-cta p {
    font-size: 15px;
    color: var(--hc-secondary);
    max-width: 480px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .lp-hero { padding: 40px 0 24px; }
    .lp-hero h1 { font-size: 24px; }
    .lp-hero p { font-size: 15px; }
    .lp-steps { grid-template-columns: 1fr; gap: 16px; }
    .lp-features { grid-template-columns: 1fr; gap: 16px; }
    .lp-section h2 { font-size: 20px; }
    .lp-btn--lg { padding: 12px 24px; font-size: 15px; }
}

/* ── Booking success: profile CTA ── */

.booking-profile-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: var(--bk-bg-alt, #f1f5f9);
    border-radius: var(--bk-radius);
    border: 1px solid var(--bk-border);
}

.booking-profile-cta div {
    flex: 1;
}

.booking-profile-cta strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.booking-profile-cta span {
    font-size: 13px;
    color: var(--bk-secondary);
}

@media (max-width: 480px) {
    .booking-profile-cta {
        flex-direction: column;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════
   PATIENT PORTAL — /my-health
   ═══════════════════════════════════════════════════════ */

.portal {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    display: flex;
    gap: 24px;
}

/* ── Navigation ── */

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    position: sticky;
    top: 72px;
    align-self: flex-start;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hc-secondary, #64748b);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.portal-nav-item:hover {
    background: var(--hc-border, #e2e8f0);
    color: var(--hc-text, #1e293b);
}

.portal-nav-item.is-active {
    background: var(--hc-accent-light, #dbeafe);
    color: var(--hc-accent, #2563eb);
    font-weight: 600;
}

/* ── Content area ── */

.portal-content {
    flex: 1;
    min-width: 0;
}

.portal-greeting {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ── Profile completeness nudge ── */

.portal-nudge {
    background: #fff;
    border: 1px solid var(--hc-border, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}

.portal-nudge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.portal-nudge-header strong {
    font-size: 14px;
}

.portal-nudge-percent {
    font-size: 13px;
    font-weight: 700;
    color: var(--hc-accent, #2563eb);
}

.portal-nudge-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.portal-nudge-fill {
    height: 100%;
    background: var(--hc-accent, #2563eb);
    border-radius: 3px;
    transition: width .6s ease;
}

.portal-nudge-hint {
    font-size: 13px;
    color: var(--hc-secondary, #64748b);
    margin-bottom: 12px;
    line-height: 1.5;
}

.portal-subtitle {
    font-size: 14px;
    color: var(--hc-secondary);
    margin-bottom: 20px;
}

.portal-section {
    margin-bottom: 32px;
}

.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.portal-section-header h1,
.portal-section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* ── Appointment cards ── */

.portal-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-appt-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--hc-border, #e2e8f0);
    border-radius: 10px;
    transition: box-shadow .15s;
}

.portal-appt-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.portal-appt-card--detail {
    /* Upcoming appointment with expanded info (avatar, cancel button) */
}

.portal-appt-card--past {
    opacity: .7;
}

.portal-appt-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    padding: 8px;
    background: var(--hc-accent-light, #dbeafe);
    border-radius: 8px;
    line-height: 1.2;
}

.portal-appt-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--hc-accent, #2563eb);
}

.portal-appt-month {
    font-size: 11px;
    font-weight: 600;
    color: var(--hc-accent, #2563eb);
    text-transform: uppercase;
}

.portal-appt-year {
    font-size: 10px;
    color: var(--hc-secondary);
}

.portal-appt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-appt-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.portal-appt-detail {
    display: block;
    font-size: 13px;
    color: var(--hc-secondary);
}

.portal-appt-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--hc-secondary);
    margin-top: 2px;
}

.portal-appt-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-appt-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Pills / badges ── */

.portal-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.portal-pill--pending   { background: #fef3c7; color: #92400e; }
.portal-pill--confirmed { background: #dbeafe; color: #1e40af; }
.portal-pill--completed { background: #dcfce7; color: #166534; }
.portal-pill--cancelled { background: #fee2e2; color: #991b1b; }
.portal-pill--no_show   { background: #f3f4f6; color: #6b7280; }
.portal-pill--record    { background: #f1f5f9; color: #475569; }

/* ── Empty states ── */

.portal-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--hc-secondary);
}

.portal-empty svg {
    margin-bottom: 12px;
}

.portal-empty p {
    font-size: 14px;
    margin-bottom: 16px;
}

.portal-empty--sm {
    padding: 24px 16px;
}

/* ── Tabs ── */

.portal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--hc-border);
    margin-bottom: 20px;
}

.portal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hc-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}

.portal-tab:hover {
    color: var(--hc-text);
}

.portal-tab.is-active {
    color: var(--hc-accent);
    border-bottom-color: var(--hc-accent);
    font-weight: 600;
}

.portal-tab-badge {
    background: var(--hc-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

/* ── Medical records ── */

.portal-records-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-record-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--hc-border);
    border-radius: 8px;
}

.portal-record-card {
    background: #fff;
    border: 1px solid var(--hc-border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .15s;
}

.portal-record-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.portal-record-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background .1s;
}

.portal-record-header:hover {
    background: #f8fafc;
}

.portal-record-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-record-icon--consultation { background: #dbeafe; color: #2563eb; }
.portal-record-icon--prescription { background: #dcfce7; color: #16a34a; }
.portal-record-icon--lab_result   { background: #fef3c7; color: #d97706; }
.portal-record-icon--note         { background: #f1f5f9; color: #64748b; }
.portal-record-icon--document     { background: #ede9fe; color: #7c3aed; }

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

.portal-record-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.portal-record-info span {
    font-size: 13px;
    color: var(--hc-secondary);
}

.portal-record-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.portal-record-date {
    font-size: 12px;
    color: var(--hc-secondary);
}

.portal-record-chevron {
    flex-shrink: 0;
    transition: transform .2s;
}

.portal-record-card.is-open .portal-record-chevron {
    transform: rotate(180deg);
}

.portal-record-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--hc-border);
}

.portal-record-field {
    padding: 12px 0;
}

.portal-record-field + .portal-record-field {
    border-top: 1px solid #f1f5f9;
}

.portal-record-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--hc-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.portal-record-field p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ── Profile ── */

.portal-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--hc-border);
}

.portal-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.portal-profile-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.portal-profile-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 2px;
}

/* ── Form elements ── */

.portal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.portal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--hc-text);
}

.portal-input,
.portal-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--hc-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--hc-text);
    background: #fff;
    transition: border-color .15s;
}

select.portal-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.portal-input:focus,
.portal-textarea:focus {
    outline: none;
    border-color: var(--hc-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.portal-textarea {
    resize: vertical;
    min-height: 60px;
}

.portal-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.portal-saved-msg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #16a34a;
    font-weight: 500;
}

/* ── Buttons ── */

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--hc-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--hc-text);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.portal-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.portal-btn--primary {
    background: var(--hc-accent);
    color: #fff;
    border-color: var(--hc-accent);
}

.portal-btn--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.portal-btn--danger {
    color: #dc2626;
    border-color: #fecaca;
}

.portal-btn--danger:hover {
    background: #fef2f2;
}

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

.portal-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ── Links ── */

.portal-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--hc-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.portal-link--block {
    margin-top: 12px;
    display: inline-block;
}

/* ── Inline-style replacements ── */

.portal-icon-sm {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.portal-empty-icon {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: var(--hc-secondary);
    stroke-width: 1.5;
}

.portal-modal-desc {
    color: var(--hc-secondary);
    font-size: 14px;
    margin: 8px 0 16px;
}

.portal-profile-meta {
    color: var(--hc-secondary);
    font-size: 14px;
}

.portal-patient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.portal-patient-avatar img {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.portal-admin-hint {
    background: var(--hc-accent-light);
    border: 1px solid var(--hc-accent);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--hc-accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-pick-title {
    font-size: 20px;
    margin-bottom: 16px;
}

.portal-pick-search {
    margin-bottom: 12px;
}

.portal-pick-arrow {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--hc-secondary);
    stroke-width: 2;
    flex-shrink: 0;
}

.portal-pick-content {
    max-width: 600px;
    margin: 40px auto;
}

/* ═══════════════════════════════════════════════════════
   PORTAL BUTTON STATES — reusable across all public pages
   Pattern: idle → saving → ok/err → idle (1.5s auto-reset)
   Usage: x-data with state var + portal-btn-state class
   ═══════════════════════════════════════════════════════ */

.portal-btn-state {
    min-width: 100px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.portal-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: portalSpin .6s linear infinite;
}

@keyframes portalSpin { to { transform: rotate(360deg); } }

.portal-btn-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-btn-icon--ok { stroke: #fff; }
.portal-btn-icon--err { stroke: #fff; }

/* ── Avatar picker (portal profile) ── */

.pp-avatar-wrap {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.pp-avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: var(--hc-accent, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    transition: transform .15s;
}

.pp-avatar-wrap:hover .pp-avatar-badge {
    transform: scale(1.1);
}

.pp-picker {
    background: var(--hc-surface, #fff);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
    margin: 16px;
    animation: ppSlideUp .25s ease;
}

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

.pp-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hc-border, #e2e8f0);
}

.pp-picker-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.pp-picker-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--hc-secondary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.pp-picker-error {
    background: #fef2f2;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-bottom: 1px solid #fecaca;
}

.pp-picker-loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.pp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px;
}

.pp-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s, transform .15s;
    animation: ppTileIn .3s ease both;
}

@keyframes ppTileIn {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}

.pp-tile:hover {
    border-color: var(--hc-accent, #2563eb);
    transform: scale(1.03);
}

.pp-tile.is-current {
    border-color: var(--hc-accent, #2563eb);
}

.pp-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-tile-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--hc-accent, #2563eb);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 6px;
    border-radius: 4px;
}

.pp-tile-badge--doc {
    background: #f59e0b;
    display: flex;
    align-items: center;
    gap: 2px;
}

.pp-tile--upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f8fafc;
    border: 2px dashed var(--hc-border, #e2e8f0);
    border-radius: 10px;
}

.pp-tile--upload span {
    font-size: 11px;
    font-weight: 600;
    color: var(--hc-accent, #2563eb);
}

.pp-tile--upload:hover {
    background: var(--hc-accent-light, #dbeafe);
    border-color: var(--hc-accent, #2563eb);
}

.pp-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-picker-bulk {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pp-picker-count {
    background: var(--hc-accent, #2563eb);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.pp-tile-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.pp-tile-check.is-checked {
    background: var(--hc-accent, #2563eb);
    border-color: var(--hc-accent, #2563eb);
}

.pp-tile.is-selected {
    border-color: var(--hc-accent, #2563eb);
    box-shadow: 0 0 0 2px var(--hc-accent, #2563eb);
}

/* Hover actions (product gallery pattern adapted for portal) */
.pp-tile-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 1px;
    opacity: 0;
    transition: opacity .15s;
}

.pp-tile:hover .pp-tile-actions {
    opacity: 1;
}

.pp-tile-action {
    flex: 1;
    padding: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-tile-action--avatar {
    background: rgba(0, 0, 0, .75);
    color: #fff;
}

.pp-tile-action--remove {
    background: rgba(220, 38, 38, .85);
    color: #fff;
}

/* Touch devices: show actions on tap (no hover) */
@media (hover: none) {
    .pp-tile-actions {
        opacity: 1;
        background: linear-gradient(transparent, rgba(0,0,0,.4));
    }
}

.pp-confirm {
    padding: 16px 20px;
    border-top: 1px solid var(--hc-border, #e2e8f0);
    background: #fffbeb;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
}

.pp-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}

.pp-show-all {
    text-align: center;
    padding: 0 16px 16px;
}

.pp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--hc-secondary);
}

.pp-empty svg { margin-bottom: 12px; }
.pp-empty p { font-size: 14px; margin-bottom: 16px; }

/* ── Crop modal ── */

.pp-crop-modal {
    background: var(--hc-surface, #fff);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
    margin: 16px;
    overflow: hidden;
}

.pp-crop-zone {
    padding: 16px;
    background: #f1f5f9;
    max-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-crop-zone img {
    max-width: 100%;
    max-height: 300px;
}

.pp-crop-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--hc-border, #e2e8f0);
}

.pp-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--hc-border, #e2e8f0);
}

@media (max-width: 768px) {
    .pp-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 12px;
        gap: 6px;
    }
    .pp-picker {
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
    }
    /* Force overlay to align picker at bottom on mobile */
    .portal-overlay:has(.pp-picker),
    .portal-overlay:has(.pp-crop-modal) {
        align-items: flex-end;
    }
    .pp-picker-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: var(--hc-surface, #fff);
        z-index: 1;
    }
    .pp-picker-header h3 {
        font-size: 14px;
    }
    .pp-picker-toolbar {
        gap: 4px;
    }
    .pp-picker-bulk {
        flex-wrap: nowrap;
        gap: 4px;
    }
    .pp-picker-bulk .portal-btn--sm {
        padding: 5px 8px;
        font-size: 11px;
    }
    .pp-crop-modal {
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    .pp-crop-zone {
        max-height: 250px;
    }
}

/* ── Profile accordion sections ── */

.pp-section {
    border: 1px solid var(--hc-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
}

.pp-section.is-open {
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.pp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--hc-text, #1e293b);
    text-align: left;
    transition: background .1s;
}

.pp-section-header:hover {
    background: #f8fafc;
}

.pp-section-hint {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--hc-secondary, #64748b);
    margin-top: 2px;
}

.pp-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hc-accent, #2563eb);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 6px;
}

.pp-section-chevron {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--hc-secondary);
    stroke-width: 2;
    flex-shrink: 0;
    transition: transform .2s;
}

.pp-section.is-open .pp-section-chevron {
    transform: rotate(180deg);
}

.pp-section-body {
    padding: 0 16px 16px;
}

/* ── List items (allergy / medication rows) ── */

.pp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 8px;
}

.pp-item:last-of-type {
    border-bottom: none;
}

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

.pp-item-info strong {
    display: block;
    font-size: 14px;
}

.pp-item-meta {
    display: block;
    font-size: 12px;
    color: var(--hc-secondary);
}

.pp-item-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.pp-item-pill--mild     { background: #dcfce7; color: #166534; }
.pp-item-pill--moderate { background: #fef3c7; color: #92400e; }
.pp-item-pill--severe   { background: #fee2e2; color: #991b1b; }
.pp-item-pill--active   { background: #dcfce7; color: #166534; }
.pp-item-pill--inactive { background: #f3f4f6; color: #6b7280; }

.pp-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.pp-item-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--hc-border);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
}

.pp-item-btn:hover {
    background: #f8fafc;
}

.pp-item-btn--danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.pp-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--hc-accent, #2563eb);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.pp-add-btn:hover {
    text-decoration: underline;
}

.pp-inline-form {
    padding: 12px;
    margin-top: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--hc-border);
}

@media (max-width: 768px) {
    .pp-section-body {
        padding: 0 12px 12px;
    }
    .pp-inline-form {
        padding: 10px;
    }
    .pp-inline-form .portal-form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Pathological/surgical status pills ── */

.pp-item-pill--resolved { background: #dbeafe; color: #1e40af; }
.pp-item-pill--chronic  { background: #fef3c7; color: #92400e; }

/* ── Medical questionnaire (portal) ── */

.pp-quest-group {
    margin-bottom: 16px;
}

.pp-quest-group-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hc-secondary, #64748b);
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--hc-border, #e2e8f0);
}

.pp-quest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pp-quest-label {
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.pp-quest-radios {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.pp-quest-radio {
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid var(--hc-border, #e2e8f0);
    background: #fff;
    transition: background .1s, border-color .1s;
}

.pp-quest-radio:first-child { border-radius: 4px 0 0 4px; }
.pp-quest-radio:last-child  { border-radius: 0 4px 4px 0; }
.pp-quest-radio:not(:first-child) { border-left: 0; }

.pp-quest-radio input { position: absolute; opacity: 0; pointer-events: none; }

.pp-quest-radio.is-active {
    background: var(--hc-accent, #2563eb);
    border-color: var(--hc-accent, #2563eb);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 480px) {
    .pp-quest-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .pp-quest-radios {
        align-self: stretch;
    }
    .pp-quest-radio {
        flex: 1;
        text-align: center;
    }
}

/* ── Portal dictation button ── */

.pp-dictate-wrap {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.pp-dictate-wrap .portal-input,
.pp-dictate-wrap .portal-textarea { flex: 1; }

.pp-dictate-ctrl {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid var(--hc-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s;
}

.pp-dictate-ctrl:hover { border-color: var(--hc-text, #0f172a); }

.pp-dictate-ctrl.is-recording {
    border-color: #dc2626;
    animation: pp-dictate-pulse 1.2s ease-in-out infinite;
}

.pp-dictate-lang {
    width: 44px;
    height: 20px;
    border: none;
    border-bottom: 1px solid var(--hc-border, #e2e8f0);
    background: #f8fafc;
    font-size: 10px;
    text-align: center;
    text-align-last: center;
    color: var(--hc-secondary, #64748b);
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.pp-dictate-lang:focus { outline: none; color: var(--hc-text, #0f172a); }

.pp-dictate-btn {
    flex-shrink: 0;
    width: 44px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #fff;
    cursor: pointer;
    color: var(--hc-secondary, #64748b);
    transition: color .15s, background .15s;
}

.pp-dictate-btn:hover { color: var(--hc-text, #0f172a); }

.is-recording .pp-dictate-btn {
    color: #dc2626;
    background: #fef2f2;
}

.pp-dictate-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: none;
}

@keyframes pp-dictate-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ── Data rights section ── */

.portal-data-rights {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--hc-border, #e2e8f0);
}

.portal-data-rights h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.portal-data-rights-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ── Modal / overlay ── */

.portal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.portal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.portal-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    margin: 16px;
}

.portal-modal h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.portal-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .portal {
        flex-direction: column;
        gap: 0;
    }

    .portal-nav {
        flex-direction: row;
        overflow-x: auto;
        position: static;
        min-width: 0;
        gap: 0;
        margin-bottom: 20px;
        padding-bottom: 0;
        border-bottom: 1px solid var(--hc-border);
        scrollbar-width: none;
        justify-content: space-around;
    }

    .portal-nav::-webkit-scrollbar { display: none; }

    .portal-nav-item {
        padding: 10px 16px;
        font-size: 11px;
        white-space: nowrap;
        flex-direction: column;
        gap: 4px;
        align-items: center;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        border-radius: 0;
        min-width: 0;
    }

    .portal-nav-item.is-active {
        background: transparent;
        border-bottom-color: var(--hc-accent, #2563eb);
    }

    .portal-form-grid {
        grid-template-columns: 1fr;
    }

    .portal-appt-card {
        flex-wrap: wrap;
    }

    .portal-appt-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
    }

    .portal-record-header {
        flex-wrap: wrap;
    }

    .portal-record-meta {
        flex-direction: row;
        gap: 8px;
    }
}

/* ========================================================================
   HC Directory — public /booking (no slug)
   See: docs/product/decisions/booking-discovery.md
   ======================================================================== */

.hc-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.hc-directory__header {
    text-align: center;
    margin-bottom: 32px;
}

.hc-directory__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--hc-text, #0f172a);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.hc-directory__subtitle {
    font-size: 16px;
    color: var(--hc-muted, #64748b);
    margin: 0;
}

/* Filters bar */
.hc-directory__filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    background: var(--hc-surface-alt, #f8fafc);
    border: 1px solid var(--hc-border, #e2e8f0);
    padding: 16px;
    margin-bottom: 24px;
}

.hc-directory__filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hc-directory__filter label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hc-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hc-directory__filter select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--hc-border, #cbd5e1);
    background: #fff;
    font-size: 14px;
    color: var(--hc-text, #0f172a);
    cursor: pointer;
    border-radius: 0;
}

.hc-directory__filter select:focus {
    outline: 2px solid var(--hc-accent, #2563eb);
    outline-offset: -1px;
    border-color: transparent;
}

.hc-directory__near {
    height: 40px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--hc-border, #cbd5e1);
    color: var(--hc-text, #0f172a);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 120ms, border-color 120ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border-radius: 0;
    min-height: 40px;
}

.hc-directory__near svg { width: 16px; height: 16px; flex: 0 0 16px; }

.hc-directory__near:hover { background: var(--hc-surface-alt, #f1f5f9); }

.hc-directory__near[data-active="1"] {
    background: var(--hc-accent, #2563eb);
    border-color: var(--hc-accent, #2563eb);
    color: #fff;
}

.hc-directory__near.is-loading { opacity: 0.6; cursor: wait; }

/* Results count */
.hc-directory__count {
    font-size: 14px;
    color: var(--hc-muted, #64748b);
    margin: 0 0 16px;
}

/* Grid */
.hc-directory__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Card */
.hc-directory__card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--hc-border, #e2e8f0);
    text-decoration: none;
    color: inherit;
    transition: border-color 120ms, transform 120ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hc-directory__card:hover {
    border-color: var(--hc-accent, #2563eb);
    transform: translateY(-1px);
}

.hc-directory__card-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    background: var(--hc-surface-alt, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hc-directory__card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hc-directory__card-avatar svg {
    width: 32px;
    height: 32px;
    color: var(--hc-muted, #94a3b8);
}

.hc-directory__card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.hc-directory__card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--hc-text, #0f172a);
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hc-directory__card-specialty {
    font-size: 14px;
    color: var(--hc-accent, #2563eb);
    margin: 0 0 4px;
    font-weight: 500;
}

.hc-directory__card-title {
    font-size: 13px;
    color: var(--hc-muted, #64748b);
    margin: 0 0 8px;
}

.hc-directory__card-locations {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hc-directory__card-locations li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--hc-muted, #64748b);
}

.hc-directory__card-locations svg {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    color: var(--hc-muted, #94a3b8);
}

.hc-directory__card-distance {
    font-style: normal;
    color: var(--hc-accent, #2563eb);
    font-weight: 500;
    margin-left: 4px;
}

.hc-directory__card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-accent, #2563eb);
}

.hc-directory__card-cta svg { width: 14px; height: 14px; }

/* Empty state */
.hc-directory__empty {
    text-align: center;
    padding: 64px 16px;
    color: var(--hc-muted, #64748b);
}

.hc-directory__empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--hc-muted, #94a3b8);
}

.hc-directory__empty h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--hc-text, #0f172a);
    margin: 0 0 8px;
}

.hc-directory__empty p {
    font-size: 14px;
    margin: 0 0 16px;
}

.hc-directory__reset {
    display: inline-block;
    padding: 10px 20px;
    background: var(--hc-accent, #2563eb);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hc-directory__reset:hover { background: var(--hc-accent-hover, #1d4ed8); }

/* Responsive */
@media (max-width: 720px) {
    .hc-directory__filters {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .hc-directory__near {
        grid-column: span 2;
        justify-content: center;
    }
    .hc-directory__card {
        gap: 12px;
        padding: 12px;
    }
    .hc-directory__card-avatar {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }
    .hc-directory__card-avatar svg { width: 24px; height: 24px; }
}

/* ========================================================================
   Clinic public page (cp-*)
   ======================================================================== */

/* Logo: object-fit:contain (logo, never crop) — see feedback_logo_no_crop */
.cp-clinic-logo {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 16px;
}

