/* /salary/<профессия>: медиана, «мы учли» и три плитки (макет Figma 1504:338). Подсказка «?» — в 03_trend_answers.css. */

.sp-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 847px;
    margin: 64px auto 0;
}

.sp-median {
    display: flex;
    align-items: stretch;
    gap: 24px;
}

.sp-median-figure {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    white-space: nowrap;
}

.sp-median-label {
    padding-left: 12px;
    color: var(--text-color);
    font-size: var(--fs-16);
    line-height: 1;
    letter-spacing: var(--ls-16);
}

.sp-median-label span {
    color: var(--text-muted);
}

.sp-median-value {
    color: var(--text-color);
    font-size: 80px;
    font-weight: var(--fw-semibold);
    line-height: 0.75;
    letter-spacing: var(--ls-40);
}

/* Четыре растущих столбика и стрелка поверх — декоративная иллюстрация роста */
.sp-median-art {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 4px;
    height: 100px;
}

.sp-median-art i {
    width: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--accent-color) 0%, rgba(77, 178, 136, 0) 100%);
}

.sp-median-art i:nth-child(1) { height: 43%; opacity: 0.4; }
.sp-median-art i:nth-child(2) { height: 64%; opacity: 0.6; }
.sp-median-art i:nth-child(3) { height: 79%; opacity: 0.85; }
.sp-median-art i:nth-child(4) { height: 100%; }

/* Стрелка по диагонали поверх столбиков, целиком внутри иллюстрации */
.sp-median-art img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 175px;
    height: auto;
    transform: translate(-50%, -50%) rotate(156.46deg);
    pointer-events: none;
}

/* «Мы учли»: числа и подписи двумя ровными колонками */
.sp-sample {
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: baseline;
    gap: 10px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}

.sp-sample li {
    display: contents;
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: 20.72px;
    letter-spacing: var(--ls-14);
}

.sp-sample b {
    justify-self: end;
    color: var(--text-color);
    font-size: var(--fs-16);
    font-weight: var(--fw-medium);
    line-height: 1.3;
}

.sp-sample .sp-sample-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    color: var(--text-color);
    font-size: var(--fs-16);
}

/* ---------- Три плитки ---------- */

.sp-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    max-width: 1000px;
    margin: 48px auto 0;
}

.sp-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 24px;
    background: var(--surface-primary);
    text-align: center;
}

/* «?» висит справа от подписи и не сдвигает её с центра */
.sp-kpi-label {
    position: relative;
    color: var(--text-color);
    font-size: var(--fs-16);
    line-height: 20.72px;
    letter-spacing: var(--ls-16);
}

.sp-kpi-sub {
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: 16px;
    letter-spacing: var(--ls-14);
}

.sp-kpi-label .cv-mode-help-icon {
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    margin: -10px 0 0;
}

/* Ширина тултипа фиксирована, как на /cv-check: иначе у правого края он сжимается в узкую колонку */
.sp-landing .cv-mode-tooltip {
    width: 280px;
    box-sizing: border-box;
}

.sp-kpi-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-color);
    font-size: var(--fs-32);
    font-weight: var(--fw-semibold);
    line-height: 39px;
    letter-spacing: var(--ls-32);
    white-space: nowrap;
}

/* Стрелка изменения: вниз-вправо красная, вверх-вправо зелёная (маска, цвет — currentColor) */
.sp-change {
    width: 12px;
    height: 19px;
    background: currentColor;
    -webkit-mask: url("/static/icons/salary/change.svg") no-repeat center / contain;
    mask: url("/static/icons/salary/change.svg") no-repeat center / contain;
}

.sp-change.sp-up {
    transform: scaleY(-1);
}

@media (max-width: 1279px) {
    /* Hero — одна карточка: медиана и столбики на одной линии снизу, под чертой «мы учли» тремя колонками */
    .sp-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: 32px;
        padding: 20px 16px;
        border-radius: 20px;
        background: var(--surface-primary);
    }

    .sp-median {
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
    }

    .sp-median-figure {
        gap: 12px;
    }

    .sp-median-label {
        padding-left: 0;
        font-size: var(--fs-14);
    }

    .sp-median-value {
        font-size: 40px;
    }

    .sp-median-art {
        height: 48px;
        gap: 3px;
    }

    .sp-median-art i {
        width: 18px;
        border-radius: 6px;
    }

    .sp-median-art img {
        width: 82px;
    }

    .sp-sample {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        gap: 12px;
        padding-top: 16px;
        border-top: 1px solid var(--filter-divider);
        white-space: normal;
    }

    .sp-sample li {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: var(--fs-12);
        line-height: var(--lh-12);
    }

    .sp-sample b {
        justify-self: auto;
        font-size: var(--fs-20);
        font-weight: var(--fw-semibold);
        line-height: var(--lh-20);
    }

    .sp-sample .sp-sample-head {
        flex-direction: row;
        padding-bottom: 0;
        font-size: var(--fs-14);
        line-height: var(--lh-14);
    }

    /* Плитки — строками: подпись слева, цифра справа */
    .sp-kpis {
        grid-template-columns: 1fr;
        margin-top: 4px;
    }

    .sp-kpi {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label value"
            "sub value";
        align-items: center;
        column-gap: 12px;
        padding: 16px;
        border-radius: 20px;
        text-align: left;
    }

    .sp-kpi-label { grid-area: label; }
    .sp-kpi-sub { grid-area: sub; }

    .sp-kpi-value {
        grid-area: value;
        margin-top: 0;
        font-size: var(--fs-24);
        line-height: 1.2;
    }

    .sp-landing .cv-mode-tooltip {
        width: min(280px, calc(100vw - 32px));
    }

    /* Подпись слева — «?» обычным элементом сразу за текстом */
    .sp-kpi-label .cv-mode-help-icon {
        position: static;
        margin: -2px 0 0 4px;
        vertical-align: middle;
    }
}
