.hiv-result-flow-title {
    max-inline-size: 42rem;
    margin: 0 auto 1.75rem;
    color: #202e40;
    text-align: center;
    text-wrap: balance;
    font-size: clamp(1.3rem, 2.25vw, 1.85rem);
    font-weight: 700;
    line-height: 1.45;
}

.hiv-result-flow {
    display: grid;
    gap: 1rem;
    color: #243244;
    font-size: .975rem;
    line-height: 1.65;
}

.hiv-result-flow__panel {
    min-width: 0;
    background: var(--result-surface);
    border: 1px solid var(--result-border);
    border-radius: .875rem;
    overflow: hidden;
    overflow-wrap: break-word;
}

.hiv-result-flow__panel--reactive {
    --result-surface: #fff8f7;
    --result-header: #ffe4df;
    --result-border: #efcdc7;
    --result-ink: #95252d;
}

.hiv-result-flow__panel--non-reactive {
    --result-surface: #f6faf3;
    --result-header: #e4f3d9;
    --result-border: #d2e5c8;
    --result-ink: #265c30;
}

.hiv-result-flow__panel--invalid {
    --result-surface: #f4faff;
    --result-header: #ddedf9;
    --result-border: #c9dfee;
    --result-ink: #205782;
}

.hiv-result-flow__panel h4 {
    margin: 0;
    padding: 1rem .75rem;
    background: var(--result-header);
    color: var(--result-ink);
    border-bottom: 1px solid var(--result-border);
    text-align: center;
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    font-weight: 700;
    line-height: 1.4;
}

.hiv-result-flow__panel h4 span {
    display: block;
    margin-top: .15rem;
    font-size: .85rem;
    font-weight: 600;
}

.hiv-result-flow__body {
    padding: clamp(.9rem, 1.6vw, 1.35rem);
    text-align: center;
}

.hiv-result-flow__body p {
    margin: 0 0 .7rem;
}

.hiv-result-flow__branches,
.hiv-result-flow__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    position: relative;
    padding-top: 1.25rem;
}

.hiv-result-flow__branches::before,
.hiv-result-flow__options::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: .625rem;
    border-left: 2px solid var(--result-ink);
}

.hiv-result-flow__branches::after,
.hiv-result-flow__options::after {
    content: "";
    position: absolute;
    top: .625rem;
    left: calc(25% - .1875rem);
    right: calc(25% - .1875rem);
    border-top: 2px solid var(--result-ink);
}

.hiv-result-flow__branches > div::before,
.hiv-result-flow__options > li::before,
.hiv-result-flow__next::before {
    content: "";
    display: block;
    width: .625rem;
    height: .8rem;
    margin: 0 auto .45rem;
    background: var(--result-ink);
    clip-path: polygon(40% 0, 60% 0, 60% 60%, 100% 60%, 50% 100%, 0 60%, 40% 60%);
}

.hiv-result-flow__branches > div::before,
.hiv-result-flow__options > li::before {
    margin-top: -.625rem;
}

.hiv-result-flow__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .375rem;
    margin: 0;
    padding-inline: 0;
    list-style: none;
    text-align: center;
    font-size: .875rem;
    line-height: 1.5;
}

.hiv-result-flow__options::after {
    left: calc((100% - .75rem) / 6);
    right: calc((100% - .75rem) / 6);
}

.hiv-result-flow__note {
    margin: 1rem 0 0;
    padding: .85rem;
    background: #fff;
    border: 1px solid var(--result-border);
    border-radius: .625rem;
    text-align: start;
    font-size: .9rem;
}

.hiv-result-flow__note p:last-child {
    margin-bottom: 0;
}

.hiv-result-flow__medications {
    margin: 0 0 .65rem;
    padding-inline-start: 1.2rem;
}

.hiv-result-flow__medications li + li {
    margin-top: .35rem;
}

.hiv-result-flow__body .hiv-result-flow__retest {
    margin: .75rem 0 0;
    text-align: start;
    font-size: .9rem;
}

.hiv-result-flow__repeat {
    padding: .55rem;
    background: #ffede3;
    color: #803e23;
    border-radius: .5rem;
    font-weight: 600;
}

.hiv-result-flow__steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

@media (min-width: 576px) and (max-width: 991.98px), (min-width: 1400px) {
    .hiv-result-flow__steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @supports (grid-template-rows: subgrid) {
        .hiv-result-flow__steps {
            row-gap: 0;
        }

        .hiv-result-flow__steps > div,
        .hiv-result-flow__confirmation,
        .hiv-result-flow__prevention {
            display: grid;
            grid-template-rows: subgrid;
        }

        .hiv-result-flow__steps > div {
            grid-row: span 3;
        }

        .hiv-result-flow__confirmation,
        .hiv-result-flow__prevention {
            grid-row: span 2;
        }

        .hiv-result-flow__confirmation::before {
            height: auto;
            margin: 0 auto -1.425rem;
            clip-path: polygon(40% 0, 60% 0, 60% calc(100% - .4rem), 100% calc(100% - .4rem), 50% 100%, 0 calc(100% - .4rem), 40% calc(100% - .4rem));
        }

        .hiv-result-flow__confirmation > span {
            padding-top: 1.875rem;
        }
    }
}

@media (min-width: 992px) {
    .hiv-result-flow {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    }
}
