.traders__calculator {
    margin: 30px auto 0 auto;
    color: #1c2733;
    line-height: 1.4;
}

[v-cloak] {
    display: none;
}

/* Панель контролов */

.traders__calculator-controls {
    display: flex;
    gap: 16px;
    padding: 30px;
    background-color: #fff;
    border-radius: 5px;
    margin-bottom: 15px;
}

.traders__calculator-select {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border: 1px solid #d9dfe5;
    border-radius: 8px;
    background-color: #fff;
}

.traders__calculator-select--lot {
    padding-top: 5px;
    padding-bottom: 5px;
    padding-inline-start: 12px;
    padding-inline-end: 12px;
}

.traders__calculator-select_trigger {
    cursor: pointer;
    padding: 5px 12px;
}

.traders__calculator-select_trigger:focus {
    outline: none;
}

.traders__calculator-select_trigger:focus-visible {
    outline: 2px solid #1c2733;
    outline-offset: 2px;
}

.traders__calculator-select_label {
    display: block;
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1;
    color: #7d8b98;
}

.traders__calculator-select_value {
    display: block;
    padding-inline-end: 28px;
    font-weight: 500;
    color: #1c2733;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.traders__calculator-select_arrow {
    position: absolute;
    top: 50%;
    inset-inline-end: 12px;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    background: url('../img/dropdown-icon.svg') no-repeat center / contain;
    transition: transform 0.15s ease;
    pointer-events: none;
}

.traders__calculator-select_trigger.active .traders__calculator-select_arrow {
    transform: rotate(180deg);
}

.traders__calculator-select_dropdown {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: calc(100% + 4px);
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 10;
    max-height: 265px;
    background-color: #fff;
    border: 1px solid #d9dfe5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(28, 39, 51, .12);
    overflow: hidden;
}

/* Флекс-колонка нужна для того, чтобы инструменты в дропдауне (traders__calculator2/js/index.js,
   symbol_match_ranks) можно было переупорядочивать через CSS order без пересоздания DOM-узлов */
.traders__calculator-select_options {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

/* Поле поиска по инструментам */

.traders__calculator-select_search {
    flex: 0 0 auto;
    padding: 12px;
}

.traders__calculator-select_search-input {
    display: block;
    width: 100%;
    height: 32px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-inline-start: 30px;
    padding-inline-end: 7px;
    border: 1px solid #e8e9eb;
    border-radius: 8px;
    background-color: #f3f5f6;
    background-image: url(../img/search-icon.svg);
    background-repeat: no-repeat;
    background-position: 8px center;
    font-size: 14px;
    color: #757575;
    box-shadow: none;
    outline: none;
}

.traders__calculator-select_search-input:focus {
    background-color: #fff;
    border: 1px solid #e8e9eb;
}

.traders__calculator-select_search-input::placeholder {
    color: #757575;
}

.traders__calculator-select_empty {
    padding: 11px 20px;
    font-size: 14px;
    color: #7d8b98;
}

.traders__calculator-select_option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color .15s ease;
}

.traders__calculator-select_option-logo {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
}

.traders__calculator-select_option-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.traders__calculator-select_option.active {
    background-color: #f3f5f6;
}

/* Клавиатурный курсор (aria-activedescendant) — отдельно от .active ("выбрано"),
   чтобы при навигации стрелками было видно, где курсор, а не только что выбрано */
.traders__calculator-select_option--highlighted {
    background-color: #f5f7f8;
}

.traders__calculator-select--symbol .traders__calculator-select_option {
    padding: 5px 20px;
}

.traders__calculator-select_lot {
    position: relative;
}

.traders__calculator-select_input {
    display: block;
    width: 100%;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-inline-end: 22px;
    padding-inline-start: 0;
    border: none;
    outline: none;
    background-color: transparent;
    color: #1c2733;
    font-size: 16px;
    height: auto;
    box-shadow: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.traders__calculator-select_input::-webkit-outer-spin-button,
.traders__calculator-select_input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.traders__calculator-select_input:focus {
    background-color: #fff;
}

.traders__calculator-select_lot-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 14px;
    inset-inline-end: 2px;
    top: -11px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background-color: #f4f5f5;
    cursor: pointer;
    transition: background-color .15s ease;
}

.traders__calculator-select_lot-btn--decrease {
    transform: rotate(180deg);
    top: 5px;
}

.traders__calculator-select_lot-btn::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 65%;
    background-image: url(../img/arrow-top-icon.svg);
}

.traders__calculator-select_lot-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.traders__calculator-select_lot-btn:focus {
    outline: none;
}

.traders__calculator-select_lot-btn:focus-visible {
    outline: 2px solid #1c2733;
    outline-offset: 2px;
}

.traders__calculator-table_wrap {
    font-size: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.traders__calculator-table_wrap::-webkit-scrollbar {
    display: none;
}

.traders__calculator-table {
    min-width: 760px;
    background-color: #fff;
    font-size: 14px;
}

.traders__calculator-row {
    display: flex;
}

.traders__calculator-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 0 180px;
    gap: 2px;
    padding: 28px 20px;
    border-bottom: 1px solid #f3f5f6;
    border-inline-end: 1px solid #f3f5f6;
    background-color: #fff;
    color: #787f86;
    transition: background-color 0.15s ease;
}

.traders__calculator-row .traders__calculator-cell:last-child {
    border-inline-end: none;
}

.traders__calculator-cell_number {
    direction: ltr;
    unicode-bidi: isolate;
}

.traders__calculator-row:last-child .traders__calculator-cell {
    border-bottom: none;
}

/* Первая колонка липкая: при горизонтальном скролле остается на месте
   и перекрывает остальные колонки (фон ячеек непрозрачный) */
.traders__calculator-cell--label {
    position: sticky;
    flex: 0 0 200px;
    inset-inline-start: 0;
    z-index: 1;
    background-color: #f7f8f9;
    color: #383f46;
    font-weight: 700;
}

.traders__calculator-row--head .traders__calculator-cell--head {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 40px;
    padding-bottom: 40px;
}

.traders__calculator-account_name {
    font-family: Inter, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #040404;
}

.traders__calculator-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: 700;
    font-family: Inter, sans-serif;
    color: #383f46;
}

.traders__calculator-badge--standard {
    background-color: #eed7bc;
}

.traders__calculator-badge--ecn {
    background-color: #e1ecf5;
}

.traders__calculator-badge--zero {
    background-color: #def3ea;
}

/* Статичный скелетон: виден до маунта Vue, удаляется в mounted() */

.traders__calculator-skeleton_line {
    display: block;
    width: 90px;
    max-width: 100%;
    height: 14px;
    border-radius: 4px;
    background-color: #e8edf1;
    background-image: linear-gradient(90deg, #e8edf1 25%, #f4f7f9 50%, #e8edf1 75%);
    background-size: 200% 100%;
    animation: traders__calculator-shimmer 1.2s ease-in-out infinite;
}

.traders__calculator-skeleton_line--label {
    width: 60px;
    height: 11px;
    margin-bottom: 8px;
}

.traders__calculator-skeleton_line--short {
    width: 60px;
}

.traders__calculator-skeleton .traders__calculator-cell {
    gap: 6px;
}

@keyframes traders__calculator-shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .traders__calculator-skeleton_line {
        animation: none;
    }
}

@media (hover: hover) and (pointer: fine) {
    .traders__calculator-select_option:hover {
        background-color: #f5f7f8;
    }

    .traders__calculator-select_lot-btn:hover:not(:disabled),
    .traders__calculator-row:not(.traders__calculator-row--head):hover .traders__calculator-cell {
        background-color: #f9f9fa;
    }
}

@media (max-width: 1199px) {

    .traders__calculator-controls {
        padding: 20px 15px;
    }

    .traders__calculator-select_trigger {
        padding: 5px 10px;
    }

    .traders__calculator-select--lot {
        padding-inline-start: 10px;
        padding-inline-end: 10px;
    }

    .traders__calculator-select_value {
        padding-inline-end: 15px;
        font-size: 14px;
    }

    .traders__calculator-select_input {
        font-size: 14px;
    }

    .traders__calculator-select_arrow {
        inset-inline-end: 5px;
    }

    .traders__calculator-select_lot-btn {
        inset-inline-end: -1px;
    }

    .traders__calculator-account_name {
        font-size: 28px;
    }

    .traders__calculator-badge {
        width: 45px;
        height: 45px;
    }

    .traders__calculator-row--head .traders__calculator-cell--head {
        padding-top: 35px;
        padding-bottom: 35px;
    }
}

@media (max-width: 991px) {
    .traders__calculator-controls {
        flex-direction: column;
        padding: 16px;
    }

    .traders__calculator-table {
        min-width: 660px;
    }

    .traders__calculator-cell {
        flex-basis: 160px;
        padding: 15px;
    }

    .traders__calculator-cell--label {
        flex-basis: 155px;
    }

    .traders__calculator-row--head .traders__calculator-cell--head {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .traders__calculator-account_name {
        font-size: 22px;
    }

    .traders__calculator-badge {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 767px) {
    .traders__calculator {
        margin-top: 20px;
    }

    .traders__calculator-select_lot-btn {
        top: -15px;
    }

    .traders__calculator-select_lot-btn--decrease {
        top: 3px;
    }

    .traders__calculator-select_search-input {
        height: 40px;
    }

    .traders__calculator-table {
        font-size: 12px;
    }

    .traders__calculator-cell {
        flex-basis: 180px;
    }

    .traders__calculator-cell--label {
        flex-basis: 125px;
        padding: 10px;
    }

    .traders__calculator-badge {
        width: 28px;
        height: 28px;
    }

    .traders__calculator-account_name {
        font-size: 20px;
    }
}

@media (max-width: 520px) {
    .traders__calculator .container {
        padding: 0 !important;
    }

    .traders__calculator-controls {
        padding: 30px 16px;
    }
}

.rtl .traders__calculator-select_search-input {
    padding: 12px 44px 12px 16px;
    background-position: right 16px center;
}
