
/* MX styles */

.homepage-mh-followup {
    background: white;
    border-radius: 4px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 24px 26px 22px 26px;
}

    .homepage-mh-followup .mh-followup-heading {
        color: #005b82;
        font-size: 20px;
        font-weight: 700;
        margin: 0 0 4px 0;
    }

    .homepage-mh-followup .mh-followup-subtitle {
        color: #666;
        font-size: 16px;
        margin: 0 0 16px 0;
        line-height: 1.5;
    }

    .homepage-mh-followup .mh-followup-tiles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

@@media (max-width: 600px) {
    .homepage-mh-followup .mh-followup-tiles {
        grid-template-columns: 1fr;
    }
}

.crisis-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6d4c00;
    margin: 20px auto 24px auto;
    max-width: 760px;
    line-height: 1.5;
}

    .crisis-banner strong {
        color: #b26a00;
    }

    .crisis-banner svg {
        flex-shrink: 0;
        color: #b26a00;
    }

    .crisis-banner a {
        color: #6d4c00;
        font-weight: 700;
        text-decoration: underline;
    }

.homepage-mh-followup .mh-followup-crisis {
    margin: 14px 0 0 0;
    padding: 8px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    font-size: 15px;
    color: #6d4c00;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .homepage-mh-followup .mh-followup-crisis svg {
        flex-shrink: 0;
        color: #b26a00;
    }

    .homepage-mh-followup .mh-followup-crisis a {
        color: #6d4c00;
        font-weight: 700;
        text-decoration: underline;
    }

/* Triage page shell (light background, not the dark homepage teal) */
.triage-bg {
    background: #f5f8fa;
    min-height: 100vh;
    box-sizing: border-box;
    padding-bottom: 40px;
}

.triage-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 30px 20px 40px 20px;
}

.triage-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 36px 40px 30px 40px;
}

.triage-progress {
    font-size: 12px;
    color: #007a99;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.triage-progress-dots {
    display: inline-flex;
    gap: 4px;
}

.triage-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d5e7ec;
}

.triage-progress-dot.active {
    background: #007a99;
}

.triage-question-title {
    color: #333;
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 6px 0;
    line-height: 1.35;
}

.triage-question-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* Icon sizing (SVGs replace emoji) — kept small and monochrome */
.triage-chip .chip-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    color: #007a99;
}

.triage-chip.selected .chip-icon svg {
    color: #005b82;
}

.triage-tile .tile-icon svg {
    width: 30px;
    height: 30px;
    display: block;
    color: #007a99;
}

.triage-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 22px;
    background: white;
    border: 1.5px solid #d5e0e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
}

.triage-tile:hover {
    border-color: #007a99;
    background: #f4fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.triage-tile .tile-icon {
    font-size: 33px;
    margin-bottom: 12px;
    line-height: 1;
}

.triage-tile .tile-title {
    font-size: 18px;
    font-weight: 700;
    color: #005b82;
    margin: 0 0 4px 0;
}

.triage-tile .tile-desc {
    font-size: 16px;
    color: #666;
    line-height: 1.45;
}

.support-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 640px) {
    .support-card-grid {
        grid-template-columns: 1fr;
    }
}

.support-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 22px 20px 22px;
    background: white;
    border: 1.5px solid #d5e0e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    min-height: 152px;
}

.support-card:hover {
    border-color: #0091b6;
    background: #f7fcfd;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 91, 130, 0.08);
}

.support-card.selected {
    border-color: #005b82;
    background: #eaf6fa;
    box-shadow: 0 3px 10px rgba(0, 91, 130, 0.15);
}

.support-card .support-card-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eaf6fa;
    color: #0091b6;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.support-card.selected .support-card-icon {
    background: #005b82;
    color: white;
}

.support-card .support-card-icon svg {
    width: 24px;
    height: 24px;
}

.support-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2b33;
    margin: 0;
    line-height: 1.3;
}

.support-card-desc {
    font-size: 13px;
    color: #55707a;
    margin: 0;
    line-height: 1.5;
}

.support-fallback {
    display: flex;
    justify-content: center;
    padding: 6px 0 4px 0;
}

.support-fallback-link {
    background: none;
    border: 0;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    color: #55707a;
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}

    .support-fallback-link strong {
        color: #005b82;
        font-weight: 600;
        margin-left: 4px;
    }

    .support-fallback-link:hover {
        background: #eaf6fa;
        color: #1a2b33;
    }

    .support-fallback-link.selected {
        background: #eaf6fa;
        color: #005b82;
    }

        .support-fallback-link.selected strong {
            text-decoration: underline;
        }

.triage-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: white;
    border: 1.5px solid #d5e0e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: #333;
    text-align: left;
    min-height: 62px;
    font-family: inherit;
    line-height: 1.35;
}

    .triage-chip:hover {
        border-color: #007a99;
        background: #f4fafc;
    }

    .triage-chip.selected {
        border-color: #007a99;
        background: #e0f2f7;
        color: #005b82;
        font-weight: 600;
        box-shadow: 0 0 0 3px rgba(0, 122, 153, 0.12);
    }

    .triage-chip .chip-icon {
        font-size: 22px;
        line-height: 1;
        flex-shrink: 0;
    }

.triage-chip.support-chip {
    align-items: flex-start;
    padding: 14px 18px;
    min-height: 68px;
}

.triage-chip.support-chip .chip-icon {
    margin-top: 2px;
}

.triage-chip.support-chip .chip-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.triage-chip.support-chip .chip-label {
    font-weight: 600;
    color: #005b82;
    font-size: 15px;
}

.triage-chip.support-chip .chip-sub {
    font-size: 12.5px;
    color: #556;
    font-weight: 400;
    line-height: 1.35;
}

.triage-chip.support-chip.selected .chip-sub {
    color: #375e70;
}
/* When only 3 support cards are visible (one filtered out by
        mhEligibleSupportKeys — unusual state), let the 3rd card span
        both columns for a cleaner "orphan" look. With 4 cards this
        selector doesn't match so the natural 2x2 layout takes over. */
.triage-chip.support-chip:nth-child(3):last-child {
    grid-column: 1 / -1;
}

.mh-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer actions row inside the triage card */
.triage-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.triage-back {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 0;
}

    .triage-back:hover {
        color: #007a99;
    }

.triage-skip {
    background: none;
    border: none;
    color: #007a99;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 0;
}

.triage-next {
    padding: 12px 28px;
    background-color: #007a99;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.triage-next:hover {
    background-color: #005b82;
}

.triage-next:disabled {
    background-color: #b8c5cb;
    cursor: not-allowed;
}
/* Summary banner rendered on top of #page-search-results when
           the user arrived via the triage wizard. */
.triage-summary-banner {
    background: #e0f2f7;
    border: 1px solid #b2dfdb;
    border-left: 4px solid #007a99;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    font-size: 13px;
    color: #005b82;
    flex-wrap: wrap;
}

    .triage-summary-banner .summary-title {
        font-size: 12px;
        font-weight: 700;
        color: #007a99;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        margin-bottom: 6px;
    }

    .triage-summary-banner .summary-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .triage-summary-banner .summary-chip svg {
        width: 12px;
        height: 12px;
        vertical-align: -2px;
        margin-right: 3px;
        color: #007a99;
    }

    .triage-summary-banner .summary-chip {
        background: white;
        border: 1px solid #b2dfdb;
        color: #005b82;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
    }

    .triage-summary-banner .summary-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .triage-summary-banner .summary-btn {
        padding: 6px 14px;
        background: white;
        color: #007a99;
        border: 1px solid #007a99;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 12px;
        font-family: inherit;
    }

        .triage-summary-banner .summary-btn:hover {
            background: #f0f8fa;
        }

/* Match-band section headers ("Best matches" etc.) rendered
           between doctor cards on the search-results page. */
.mh-band-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px 0;
    padding: 0 4px;
}

    .mh-band-header .band-title {
        font-size: 13px;
        font-weight: 700;
        color: #005b82;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mh-band-header .band-count {
        color: #888;
        font-size: 12px;
        font-weight: 500;
    }

    .mh-band-header .band-line {
        flex: 1;
        height: 1px;
        background: #e0e0e0;
    }

    .mh-band-header.best .band-title {
        color: #2e7d32;
    }
/* Sub-area specialist chip — dark-green fill, matching Sub area Matrix 2 */
.why-chip.spec {
    background: #2E7D32;
    color: #fff;
    border-color: #2E7D32;
}
/* Sub-area "also treats" chip — light-green fill */
.why-chip.also {
    background: #C8E6C9;
    color: #1B5E20;
    border-color: #B7DDBB;
}

.mh-band-header.alt .band-title {
    color: #888;
}

/* "Why matched" chips shown inside each doctor card when the
           patient came from the triage flow. */
.why-matched-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px 0;
}

.why-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 2px 8px;
}

    .why-chip.warn {
        color: #8a6500;
        background: #fff8e6;
        border-color: #ffd98a;
    }

/* "I know who I want to see" secondary text on Q0 */
.triage-alt-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #007a99;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    background: none;
    border: none;
    width: 100%;
    padding: 8px 0;
}

/* Chip / tile grid for triage answers */
.triage-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
/* Step 1 (whoFor): force an even 2x2 layout for the 4 fixed options.
           Collapses to a single column on very narrow screens. */
.triage-chip-grid--whofor {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 520px) {
    .triage-chip-grid--whofor {
        grid-template-columns: 1fr;
    }
}
/* Age-band badge shown beside the numeric age input on Step 1. */
.age-band-badge {
    display: none;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    vertical-align: middle;
    transition: background-color 0.15s, color 0.15s;
}

    .age-band-badge.is-visible {
        display: inline-flex;
    }

    .age-band-badge[data-band="error"] {
        background: #fce4ec;
        color: #c2185b;
    }

    .age-band-badge[data-band="child"] {
        background: #e0f2f1;
        color: #00796b;
    }

    .age-band-badge[data-band="teen"] {
        background: #ede7f6;
        color: #5e35b1;
    }

    .age-band-badge[data-band="adult"] {
        background: #e8f5e9;
        color: #2e7d32;
    }

/* ---- Step 2 concern sub-panel (expandable breakdown) ---- */
/* A concern group chip + its inline sub-panel occupies a full row of
           the grid so the panel visually attaches to its parent. */
.concern-block {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

    .concern-block .triage-chip {
        border-radius: 6px;
    }

    .concern-block.has-sub .triage-chip.selected {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom-color: transparent;
    }

.concern-subpanel {
    display: none;
    background: #f4f8fa;
    border: 1.5px solid #0091b6;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    padding: 12px 16px 14px 16px;
    margin-top: -1px;
}

.concern-block.has-sub .concern-subpanel {
    display: block;
}

.concern-subpanel-title {
    font-size: 12px;
    font-weight: 600;
    color: #4a6874;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0 0 8px 0;
}

    .concern-subpanel-title .optional-hint {
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
        color: #6c8592;
        margin-left: 6px;
    }

.sub-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1.5px solid #d5e0e5;
    border-radius: 999px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    line-height: 1.2;
}

    .sub-chip:hover {
        border-color: #0091b6;
        background: #eaf6fa;
    }

    .sub-chip.selected {
        background: #005b82;
        border-color: #005b82;
        color: white;
    }

    .sub-chip .sub-check {
        width: 14px;
        height: 14px;
        border-radius: 3px;
        border: 1.5px solid #b0c3cc;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        line-height: 1;
        background: white;
        color: transparent;
    }

    .sub-chip.selected .sub-check {
        background: white;
        border-color: white;
        color: #005b82;
    }

/* ---- Step 3 reason sub-panel (expandable breakdown) ---- */
/* A reason group chip + its inline sub-panel occupies a full row of
           the grid so the panel visually attaches to its parent. */
.reason-block {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

    .reason-block .triage-chip {
        border-radius: 6px;
    }

    .reason-block.has-sub .triage-chip.selected {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom-color: transparent;
    }

.reason-subpanel {
    display: none;
    background: #f4f8fa;
    border: 1.5px solid #0091b6;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    padding: 12px 16px 14px 16px;
    margin-top: -1px;
}

.reason-block.has-sub .reason-subpanel {
    display: block;
}

.reason-subpanel-title {
    font-size: 12px;
    font-weight: 600;
    color: #4a6874;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0 0 8px 0;
}

    .reason-subpanel-title .optional-hint {
        font-weight: 400;
        text-transform: none;
        letter-spacing: 0;
        color: #6c8592;
        margin-left: 6px;
    }

.sub-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1.5px solid #d5e0e5;
    border-radius: 999px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    line-height: 1.2;
}

    .sub-chip:hover {
        border-color: #0091b6;
        background: #eaf6fa;
    }

    .sub-chip.selected {
        background: #005b82;
        border-color: #005b82;
        color: white;
    }

    .sub-chip .sub-check {
        width: 14px;
        height: 14px;
        border-radius: 3px;
        border: 1.5px solid #b0c3cc;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        line-height: 1;
        background: white;
        color: transparent;
    }

    .sub-chip.selected .sub-check {
        background: white;
        border-color: white;
        color: #005b82;
    }

.triage-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Sub-area specialist chip — dark-green fill, matching Sub area Matrix 2 */
.why-chip.spec {
    background: #2E7D32;
    color: #fff;
    border-color: #2E7D32;
}
/* Sub-area "also treats" chip — light-green fill */
.why-chip.also {
    background: #C8E6C9;
    color: #1B5E20;
    border-color: #B7DDBB;
}

.mh-band-header.alt .band-title {
    color: #888;
}

/* "Why matched" chips shown inside each doctor card when the
           patient came from the triage flow. */
.why-matched-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px 0;
}

.why-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 2px 8px;
}

    .why-chip.warn {
        color: #8a6500;
        background: #fff8e6;
        border-color: #ffd98a;
    }

/* "I know who I want to see" secondary text on Q0 */
.triage-alt-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #007a99;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    background: none;
    border: none;
    width: 100%;
    padding: 8px 0;
}
/* Summary banner rendered on top of #page-search-results when
           the user arrived via the triage wizard. */
.triage-summary-banner {
    background: #e0f2f7;
    border: 1px solid #b2dfdb;
    border-left: 4px solid #007a99;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    font-size: 14px;
    color: #005b82;
    flex-wrap: wrap;
}

    .triage-summary-banner .summary-title {
        font-size: 16px;
        font-weight: 700;
        color: #007a99;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        margin-bottom: 13px;
    }

    .triage-summary-banner .summary-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .triage-summary-banner .summary-chip svg {
        width: 14px;
        height: 14px;
        vertical-align: -2px;
        margin-right: 3px;
        color: #007a99;
    }

    .triage-summary-banner .summary-chip {
        background: white;
        border: 1px solid #b2dfdb;
        color: #005b82;
        padding: 4px 10px 2px 10px;
        border-radius: 12px;
        font-size: 12.5px;
        font-weight: 600;
    }

    .triage-summary-banner .summary-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .triage-summary-banner .summary-btn {
        padding: 6px 14px;
        background: white;
        color: #007a99;
        border: 1px solid #007a99;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        font-family: inherit;
    }

    .triage-summary-banner .summary-btn:hover {
        background: #f0f8fa;
    }