/**
 * «Челка» города на калькуляторе
 */

.xchange_type_list,
.xchange_type_list .xtl_html_wrap,
.xchange_type_list .xtl_table_wrap,
.xchange_type_list .xtl_table_wrap_ins,
.exchange-calculator {
    overflow: visible !important;
}

.exchange-calculator {
    position: relative;
}

.calc-city-notch {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 30;
    transform: translate(-50%, -99%);
}

.calc-city-notch__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 7px;
    background: #2f3235;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    color: rgba(255, 255, 255, 0.92);
    font-family: "OpenRunde", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.calc-city-notch__tab:hover,
.calc-city-notch__tab:focus-visible,
.calc-city-notch.is-open .calc-city-notch__tab {
    background: #383c41;
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    outline: none;
}

.calc-city-notch__pin {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e92932;
    box-shadow: 0 0 0 2px rgba(233, 41, 50, 0.25);
    flex-shrink: 0;
}

.calc-city-notch__name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calc-city-notch__tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    z-index: 31;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: min(280px, 72vw);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.88);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.calc-city-notch__tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(18, 18, 20, 0.96);
}

.calc-city-notch__tab:hover + .calc-city-notch__tooltip,
.calc-city-notch__tab:focus-visible + .calc-city-notch__tooltip,
.calc-city-notch.is-open .calc-city-notch__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .calc-city-notch__tab {
        padding: 5px 12px 6px;
        font-size: 11px;
    }

    .calc-city-notch__name {
        max-width: 120px;
    }

    .calc-city-notch__tooltip {
        max-width: min(240px, 86vw);
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calc-city-notch__tab,
    .calc-city-notch__tooltip {
        transition: none;
    }
}
