.health-explorer {
    width: 100%;
    padding: 8px 0 72px;
}

.health-explorer__page {
    display: flex;
    flex-direction: column;
}

.health-explorer-search {
    width: 100%;
    max-width: 900px;
    margin-top: 24px;
}

.health-explorer-search__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.health-explorer-search__field {
    position: relative;
    min-width: 0;
}

.health-explorer-search__icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    color: var(--color-focus);
    font-size: 24px;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.health-explorer-search__input {
    width: 100%;
    min-height: 42px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-max);
    background: var(--color-bg-0);
    color: var(--color-text);
    font-size: var(--text-sm);
    outline: none;
    box-shadow: var(--shadow-box);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.health-explorer-search__input::placeholder {
    color: var(--color-n0);
}

.health-explorer-search__input:focus {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 4px rgba(21, 87, 228, .08);
}

.health-explorer-search__button {
    min-height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-max);
    background: var(--gradient-b);
    color: var(--color-text-bright);
    font-size: var(--text-sm);
    font-weight: var(--weight-md);
    cursor: pointer;
}

.health-explorer-search__button:hover {
    opacity: .88;
}

.health-explorer-search__button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

.health-explorer-search__types {
    margin-top: 10px;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-search-results,
.health-explorer-candidates {
    display: grid;
    gap: 10px;
}

.health-explorer-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--color-border-soft);
    border-radius: 16px;
    background: var(--color-bg-0);
}

.health-explorer-search-result__content {
    min-width: 0;
}

.health-explorer-search-result__type {
    display: block;
    margin-bottom: 3px;
    font-size: var(--text-xxs);
    font-weight: var(--weight-md);
}

.health-explorer-search-result__type--symptom { color: var(--color-b4); }
.health-explorer-search-result__type--factor { color: var(--color-o3); }
.health-explorer-search-result__type--marker { color: var(--color-lb3); }
.health-explorer-search-result__type--condition { color: var(--color-g4); }

.health-explorer-search-result__title {
    margin: 0;
    color: var(--color-text-title);
    font-size: var(--text-sm);
    line-height: 1.3;
    font-weight: var(--weight-md);
}

.health-explorer-search-result__meta {
    margin-top: 4px;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-search-result__add,
.health-explorer-search-result__selected {
    flex: 0 0 auto;
    font-size: var(--text-xs);
}

.health-explorer-search-result__add {
    color: var(--color-focus);
    font-weight: var(--weight-md);
}

.health-explorer-search-result__add:hover {
    text-decoration: underline;
}

.health-explorer-search-result__selected {
    color: var(--color-muted);
}

.health-explorer-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
}

.health-explorer-evidence {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.health-explorer-evidence-column {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--color-border-soft);
    border-radius: 18px;
    background: var(--color-bg-0);
}

.health-explorer-evidence-column__header {
    min-height: 58px;
    margin-bottom: 8px;
}

.health-explorer-evidence-column__title {
    margin: 0;
    color: var(--color-text-title);
    font-size: var(--text-sm);
    font-weight: var(--weight-md);
}

.health-explorer-evidence-column__description {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.35;
}

.health-explorer-evidence-column__items {
    display: grid;
    gap: 8px;
}

.health-explorer-evidence-column__empty {
    padding: 12px;
    border: 1px dashed var(--color-border-medium);
    border-radius: 12px;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-candidate-nav__inner {
    position: sticky;
    top: 118px;
    padding: 18px;
    border: 1px solid var(--color-border-soft);
    border-radius: 18px;
    background: var(--color-bg-0);
    box-shadow: var(--shadow-box);
}

.health-explorer-candidate-nav__kicker,
.health-explorer-condition__kicker,
.health-explorer-condition__recommendations-kicker {
    color: var(--color-focus);
    font-size: var(--text-xxs);
    font-weight: var(--weight-md);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.health-explorer-candidate-nav__title {
    margin: 6px 0 0;
    color: var(--color-text-title);
    font-size: var(--text-md);
    line-height: 1.3;
    font-weight: var(--weight-md);
}

.health-explorer-candidate-nav__description {
    margin: 7px 0 14px;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.health-explorer-candidate-nav__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: explorer-candidates;
}

.health-explorer-candidate-nav__item {
    margin: 0;
    counter-increment: explorer-candidates;
}

.health-explorer-candidate-nav__link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    padding: 8px 6px;
    border-radius: 9px;
    color: var(--color-text);
    text-decoration: none;
}

.health-explorer-candidate-nav__link::before {
    content: counter(explorer-candidates) '.';
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-candidate-nav__link:hover {
    background: var(--color-grey2);
}

.health-explorer-candidate-nav__name {
    min-width: 0;
    font-size: var(--text-xs);
    font-weight: var(--weight-md);
}

.health-explorer-candidate-nav__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: var(--radius-max);
    background: rgba(21, 87, 228, .08);
    color: var(--color-focus);
    font-size: var(--text-xs);
    font-weight: var(--weight-md);
}

.health-explorer-candidate-nav__empty,
.health-explorer-empty {
    color: var(--color-muted);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.health-explorer-condition {
    scroll-margin-top: 120px;
    overflow: hidden;
    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    background: var(--color-bg-0);
    box-shadow: 0 10px 28px rgba(16, 24, 40, .035);
}

.health-explorer-condition__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    background: var(--color-grey2);
    border-bottom: 1px solid var(--color-border-soft);
}

.health-explorer-condition__title {
    margin: 5px 0 0;
    color: var(--color-text-title);
    font-size: var(--text-lg);
    line-height: 1.25;
    font-weight: var(--weight-md);
}

.health-explorer-condition__title-link,
.health-explorer-condition-match__name {
    color: inherit;
    text-decoration: none;
}

.health-explorer-condition__title-link:hover,
.health-explorer-condition-match__name:hover {
    color: var(--color-focus);
}

.health-explorer-condition__status {
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-condition__count {
    flex: 0 0 auto;
    text-align: right;
}

.health-explorer-condition__count strong {
    display: block;
    color: var(--color-text-title);
    font-size: var(--title-sm);
    line-height: 1;
    font-weight: var(--weight-md);
}

.health-explorer-condition__count span {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: var(--text-xxs);
}

.health-explorer-condition__matches {
    padding: 0 22px;
}

.health-explorer-condition-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-border-soft);
}

.health-explorer-condition-match:last-child {
    border-bottom: 0;
}

.health-explorer-condition-match__type {
    display: block;
    margin-bottom: 4px;
    font-size: var(--text-xxs);
    font-weight: var(--weight-md);
}

.health-explorer-condition-match__type--symptom { color: var(--color-b4); }
.health-explorer-condition-match__type--factor { color: var(--color-o3); }
.health-explorer-condition-match__type--marker { color: var(--color-lb3); }
.health-explorer-condition-match__type--condition { color: var(--color-g4); }

.health-explorer-condition-match__name {
    display: inline-block;
    color: var(--color-text-title);
    font-size: var(--text-sm);
    font-weight: var(--weight-md);
}

.health-explorer-condition-match__note {
    max-width: 720px;
    margin: 5px 0 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
}

.health-explorer-condition-match__contribution {
    color: var(--color-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.health-explorer-condition__recommendations {
    padding: 20px 22px;
    border-top: 1px solid var(--color-border-soft);
    background: var(--color-grey2);
}

.health-explorer-condition__recommendations-header {
    margin-bottom: 12px;
}

.health-explorer-condition__recommendations-title {
    margin: 5px 0 4px;
    color: var(--color-text-title);
    font-size: var(--text-md);
    font-weight: var(--weight-md);
}

.health-explorer-condition__recommendations-description {
    margin: 0;
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.health-explorer-condition__recommendations-list {
    display: grid;
    gap: 8px;
}

.health-explorer-marker-recommendation {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    background: var(--color-bg-0);
    color: inherit;
    text-decoration: none;
}

.health-explorer-marker-recommendation:hover {
    border-color: var(--color-border-medium);
}

.health-explorer-marker-recommendation__name {
    display: block;
    color: var(--color-text-title);
    font-size: var(--text-sm);
    font-weight: var(--weight-md);
}

.health-explorer-marker-recommendation__direction,
.health-explorer-marker-recommendation__note {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.health-explorer-marker-recommendation__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.health-explorer-marker-recommendation__required {
    padding: 5px 8px;
    border-radius: var(--radius-max);
    background: #e8f7ee;
    color: var(--color-g4);
    font-size: var(--text-xxs);
    font-weight: var(--weight-md);
}

.health-explorer-marker-recommendation__arrow {
    color: var(--color-focus);
}

.health-explorer-condition__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 22px;
    border-top: 1px solid var(--color-border-soft);
}

.health-explorer-condition__details,
.health-explorer-condition__back {
    font-size: var(--text-xs);
    text-decoration: none;
}

.health-explorer-condition__details {
    color: var(--color-focus);
    font-weight: var(--weight-md);
}

.health-explorer-condition__back {
    color: var(--color-muted);
}

.health-explorer-condition__details:hover,
.health-explorer-condition__back:hover {
    text-decoration: underline;
}

@media (max-width: 1050px) {
    .health-explorer-overview {
        grid-template-columns: 1fr;
    }

    .health-explorer-candidate-nav__inner {
        position: static;
    }

    .health-explorer-candidate-nav__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .health-explorer-evidence {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .health-explorer-search__row {
        grid-template-columns: 1fr;
    }

    .health-explorer-search__button {
        width: 100%;
    }

    .health-explorer-evidence,
    .health-explorer-candidate-nav__list {
        grid-template-columns: 1fr;
    }

    .health-explorer-evidence-column__header {
        min-height: 0;
    }

    .health-explorer-condition__header,
    .health-explorer-condition__footer,
    .health-explorer-marker-recommendation {
        flex-direction: column;
        align-items: flex-start;
    }

    .health-explorer-condition__count {
        text-align: left;
    }

    .health-explorer-condition-match {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .health-explorer-condition-match__contribution {
        white-space: normal;
    }
}
