/* /salary: секции под панелью — заголовки секций и шкалы грейдов и направлений.
   Токены — 01_hero.css, появление шкал — 05_motion.css */

.sv-sec {
    margin-top: 120px;
}

.sv-sec-head {
    margin-bottom: 32px;
}

.sv-sec-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.sv-h2 {
    color: var(--text-color);
    font-size: 44px;
    font-weight: var(--fw-semibold);
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

/* ---------- Шкала: точка — медиана, полоса — вилка p25–p75; ось общая для обеих колонок ---------- */

.sv-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sv-plot {
    min-width: 0;
    padding: 28px 32px 24px;
}

.sv-plot + .sv-plot {
    border-left: 1px solid var(--sv-line);
}

.sv-plot-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    min-height: 26px;
}

.sv-plot-head h3 {
    color: var(--text-color);
    font-size: var(--fs-18);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-18);
    letter-spacing: var(--ls-18);
    white-space: nowrap;
}

.sv-plot-head .sv-label {
    text-align: right;
}

.sv-plot-body {
    --name: 104px;
    --val: 76px;
    position: relative;
    margin-top: 40px;
}

.sv-row {
    display: grid;
    grid-template-columns: var(--name) minmax(0, 1fr) var(--val);
    align-items: center;
    gap: 12px;
    height: 36px;
}

.sv-plot-tall .sv-row:not(.sv-axis) {
    height: 60px;
}

.sv-row-name {
    color: var(--text-muted);
    font-size: var(--fs-16);
    letter-spacing: var(--ls-16);
    white-space: nowrap;
}

.sv-row-val {
    color: var(--text-color);
    font-size: var(--fs-16);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-16);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Вертикальные линии сетки — по делениям оси (--grid ставит шаблон) */
.sv-track {
    position: relative;
    height: 100%;
    background: var(--grid);
}

.sv-range {
    position: absolute;
    top: 50%;
    height: 8px;
    margin-top: -4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color) 24%, transparent);
}

.sv-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 3px var(--surface-primary);
}

.sv-row.sv-on .sv-row-name {
    color: var(--text-color);
    font-weight: var(--fw-semibold);
}

.sv-row.sv-on .sv-range {
    background: color-mix(in srgb, var(--sv-my) 26%, transparent);
}

.sv-row.sv-on .sv-dot {
    background: var(--sv-my);
}

.sv-axis {
    height: 28px;
}

.sv-axis .sv-track {
    background: none;
}

.sv-axis em {
    position: absolute;
    top: 8px;
    color: var(--text-muted);
    font-size: var(--fs-12);
    font-style: normal;
    transform: translateX(-50%);
}

.sv-axis em:first-child {
    transform: none;
}

.sv-axis em:last-child {
    transform: translateX(-100%);
}

/* Пунктир «ты»: --x (0–1) ставит board.js по своей зарплате */
.sv-me {
    position: absolute;
    top: -8px;
    bottom: 28px;
    left: calc(var(--name) + 12px + (100% - var(--name) - var(--val) - 24px) * var(--x, 0));
    width: 1px;
    background: repeating-linear-gradient(to bottom, var(--sv-my) 0 4px, transparent 4px 8px) no-repeat 0 0 / 1px 100%;
    pointer-events: none;
}

.sv-me span {
    position: absolute;
    top: -22px;
    left: 0;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--sv-my);
    color: #fff;
    font-size: var(--fs-12);
    font-weight: var(--fw-medium);
    line-height: 18px;
    white-space: nowrap;
    transform: translateX(-50%);
}

.sv-method {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
    text-align: center;
}

@media (max-width: 1279px) {
    .sv-sec {
        margin-top: 72px;
    }

    .sv-sec-head {
        margin-bottom: 20px;
    }

    /* Кнопка раздела — под карточками: шапка растворяется в колонке раздела */
    .sv-sec:has(> .sv-sec-head-row) {
        display: flex;
        flex-direction: column;
    }

    .sv-sec-head-row {
        display: contents;
    }

    .sv-sec-head-row > div {
        margin-bottom: 20px;
    }

    .sv-sec-head-row > .btn {
        order: 1;
        margin-top: 12px;
    }

    .sv-h2 {
        font-size: 30px;
    }

    .sv-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .sv-plot {
        padding: 20px 20px 16px;
    }

    .sv-plot + .sv-plot {
        border-top: 1px solid var(--sv-line);
        border-left: 0;
    }

    .sv-plot-head {
        flex-direction: column;
        gap: 4px;
    }

    .sv-plot-head .sv-label {
        text-align: left;
    }

    .sv-plot-body {
        --name: 92px;
        --val: 68px;
    }

    .sv-plot-tall .sv-row:not(.sv-axis) {
        height: 36px;
    }

    .sv-row-name,
    .sv-row-val {
        font-size: var(--fs-14);
    }

    .sv-method {
        text-align: left;
    }
}
