/* Страница вывода v2 */
.wd {
    --wd-bg: #141722;
    --wd-card: #1b1f2c;
    --wd-input: #10131c;
    --wd-chip: #252b3d;
    --wd-chip-hover: #2f3750;
    --wd-line: rgba(255, 255, 255, .07);
    --wd-text: #ffffff;
    --wd-muted: #8a93ab;
    --wd-accent: #367cff;
    --wd-win: #22c55e;
    color: var(--wd-text);
    margin: 6px 0 30px;
}

body.bw-light .wd {
    --wd-bg: #eef2f9;
    --wd-card: #ffffff;
    --wd-input: #f3f6fb;
    --wd-chip: #e4eaf5;
    --wd-chip-hover: #d5def0;
    --wd-line: rgba(20, 35, 70, .09);
    --wd-text: #1b2233;
    --wd-muted: #75809a;
}

.wd *,
.wd *::before,
.wd *::after {
    box-sizing: border-box;
}

.wd button,
.wd input,
.wd select {
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.wd-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 900;
}

.wd-title small {
    display: block;
    margin-top: 2px;
    color: var(--wd-muted);
    font-size: 11px;
    font-weight: 700;
}

.wd-title__ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(140deg, #4b8bff, #1f5fe0);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(54, 124, 255, .35);
}

.wd-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 8px 14px;
    border: 1px solid var(--wd-line);
    border-radius: 13px;
    background: var(--wd-card);
}

.wd-balance > span {
    color: var(--wd-muted);
    font-size: 11px;
    font-weight: 800;
}

.wd-balance b {
    font-size: 17px;
    font-weight: 900;
    white-space: nowrap;
}

/* Лимит с бонуса по рангу */
.wd-limit {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(54, 124, 255, .25);
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(54, 124, 255, .14), rgba(54, 124, 255, .04));
}

.wd-limit img {
    flex: none;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.wd-limit b {
    display: block;
    font-size: 14px;
    font-weight: 900;
}

.wd-limit span {
    display: block;
    margin-top: 2px;
    color: var(--wd-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.wd-limit a {
    color: #66a4ff;
    text-decoration: underline;
}

/* Сетка: форма + итог */
.wd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    align-items: start;
}

.wd-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.wd-card {
    padding: 18px;
    border: 1px solid var(--wd-line);
    border-radius: 18px;
    background: var(--wd-card);
}

.wd-card--form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: opacity .25s;
}

.wd-card--form.is-locked {
    opacity: .55;
}

.wd-card--form.is-locked .wd-chips button {
    pointer-events: none;
}

.wd-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 900;
}

.wd-card--form .wd-step {
    margin-bottom: 0;
}

.wd-step span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--wd-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.wd-pick-hint {
    padding: 12px;
    border: 1px dashed var(--wd-line);
    border-radius: 12px;
    color: var(--wd-muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* Способы вывода */
.wd-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wd-method {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 14px 8px 12px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: var(--wd-input);
    color: var(--wd-text);
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .12s;
}

.wd-method:hover {
    background: var(--wd-chip);
}

.wd-method:active {
    transform: scale(.97);
}

.wd-method.active {
    border-color: var(--wd-accent);
    background: rgba(54, 124, 255, .12);
    box-shadow: 0 8px 22px rgba(54, 124, 255, .18);
}

.wd-method.active::after {
    content: "\f00c";
    position: absolute;
    top: 7px;
    left: 7px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--wd-accent);
    color: #fff;
    font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free";
    font-size: 9px;
    font-weight: 900;
}

.wd-method__ico {
    position: relative;
    display: grid;
    place-items: center;
    height: 34px;
}

.wd-method__ico img {
    max-width: 52px;
    max-height: 32px;
    object-fit: contain;
}

.wd-method__ico svg {
    width: 45px;
    height: 28px;
}

.wd-bolt {
    position: absolute;
    top: -8px;
    right: -14px;
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #2f66ff;
    box-shadow: 0 2px 8px rgba(47, 102, 255, .45);
}

.wd-bolt svg {
    width: 9px !important;
    height: 13px !important;
}

.wd-method__name {
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.wd-method__meta {
    color: var(--wd-muted);
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* Поля */
.wd-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wd-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    color: var(--wd-muted);
    font-size: 12px;
    font-weight: 800;
}

.wd-label span {
    font-weight: 700;
}

.wd-label b {
    color: var(--wd-text);
}

.wd-input {
    position: relative;
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--wd-line);
    border-radius: 12px;
    background: var(--wd-input);
    transition: border-color .2s, box-shadow .2s;
}

.wd-input:focus-within {
    border-color: var(--wd-accent);
    box-shadow: 0 0 0 3px rgba(54, 124, 255, .15);
}

.wd-input.is-warn {
    border-color: rgba(245, 158, 11, .7);
}

.wd-input input,
.wd-input select {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--wd-text);
    font-size: 16px;
    font-weight: 700;
    -webkit-appearance: none;
    appearance: none;
}

.wd-input input::placeholder {
    color: var(--wd-muted);
    font-weight: 600;
    opacity: .8;
}

.wd-input input:disabled {
    background: transparent;
    cursor: not-allowed;
}

.wd-input select option {
    background: var(--wd-card);
    color: var(--wd-text);
}

.wd-input--select i {
    color: var(--wd-muted);
    font-size: 12px;
    pointer-events: none;
}

.wd-input--big {
    height: 60px;
}

.wd-input--big input {
    font-size: 24px;
    font-weight: 900;
}

.wd-input__unit {
    color: var(--wd-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 900;
}

.wd-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.wd-chips button {
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--wd-chip);
    color: var(--wd-text);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.wd-chips button:hover {
    background: var(--wd-chip-hover);
}

/* Итог */
.wd-side {
    position: sticky;
    top: 96px;
}

.wd-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wd-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--wd-muted);
    font-size: 13px;
    font-weight: 700;
}

.wd-sum-row b {
    color: var(--wd-text);
    font-weight: 900;
}

.wd-sum-total {
    margin: 4px 0;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(34, 197, 94, .05));
    border: 1px solid rgba(34, 197, 94, .25);
}

.wd-sum-total > span {
    display: block;
    color: var(--wd-muted);
    font-size: 12px;
    font-weight: 800;
}

.wd-sum-total b {
    display: block;
    margin-top: 2px;
    color: var(--wd-win);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.wd-btn {
    position: relative;
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #4d8dff 0%, #2563eb 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(54, 124, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    cursor: pointer;
    transition: transform .12s, filter .2s;
}

.wd-btn:hover {
    filter: brightness(1.08);
}

.wd-btn:active {
    transform: scale(.985);
}

.wd-btn:disabled {
    filter: saturate(.4) brightness(.75);
    box-shadow: none;
    cursor: default;
}

.wd-btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wdSpin .7s linear infinite;
}

@keyframes wdSpin {
    to { transform: rotate(360deg); }
}

.wd-note {
    color: var(--wd-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.wd-note i {
    color: var(--wd-win);
}

/* История */
.wd-history {
    margin-top: 22px;
}

.wd-history__head {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 900;
}

.wd-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wd-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--wd-line);
    border-radius: 14px;
    background: var(--wd-card);
}

.wd-item__ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--wd-input);
}

.wd-item__ico img {
    max-width: 30px;
    max-height: 26px;
    object-fit: contain;
}

.wd-item__ico svg {
    width: 30px;
    height: 19px;
}

.wd-item__main {
    min-width: 0;
}

.wd-item__main b {
    display: block;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.wd-item__main span {
    display: block;
    overflow: hidden;
    color: var(--wd-muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wd-item__date {
    color: var(--wd-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.wd-item__status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 110px;
}

.wd-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 900;
    white-space: nowrap;
}

.wd-badge--paid { background: rgba(34, 197, 94, .15); color: #22c55e; }
.wd-badge--cancel { background: rgba(239, 68, 68, .14); color: #ff6b6b; }
.wd-badge--work { background: rgba(255, 149, 0, .15); color: #ff9500; }
.wd-badge--wait { background: rgba(255, 184, 77, .15); color: #ffb84d; }
.wd-badge--new { background: rgba(54, 124, 255, .15); color: #66a4ff; }

.wd-cancel {
    height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(239, 68, 68, .45);
    border-radius: 10px;
    background: transparent;
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.wd-cancel:hover {
    background: rgba(239, 68, 68, .12);
}

.wd-reason {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(54, 124, 255, .14);
    color: #66a4ff;
    font-size: 14px;
    cursor: pointer;
}

.wd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px;
    border: 1px dashed var(--wd-line);
    border-radius: 14px;
    color: var(--wd-muted);
    font-size: 13px;
    font-weight: 700;
}

.wd-empty i {
    font-size: 22px;
}

/* Окно причины отмены */
.wd-modal {
    position: fixed;
    inset: 0;
    z-index: 10300;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wd-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 16, .7);
    backdrop-filter: blur(4px);
}

.wd-modal__box {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: #1b1f2c;
    color: #fff;
    animation: wdPop .2s ease;
}

body.bw-light .wd-modal__box {
    border-color: rgba(20, 35, 70, .09);
    background: #fff;
    color: #1b2233;
}

.wd-modal__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 900;
}

.wd-modal__head i {
    color: #66a4ff;
}

.wd-modal__head button {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: rgba(138, 147, 171, .18);
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.wd-modal__text {
    margin-bottom: 14px;
    padding: 14px;
    border-left: 4px solid #367cff;
    border-radius: 10px;
    background: rgba(54, 124, 255, .08);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
    white-space: pre-line;
}

@keyframes wdPop {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* Адаптив */
@media (max-width: 991px) {
    .wd-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wd-side {
        position: static;
    }
}

@media (max-width: 640px) {
    .wd {
        margin-top: 0;
    }

    .wd-head {
        margin-bottom: 12px;
    }

    .wd-title {
        font-size: 18px;
    }

    .wd-title small {
        display: none;
    }

    .wd-title__ico {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .wd-balance {
        padding: 6px 11px;
    }

    .wd-balance b {
        font-size: 15px;
    }

    .wd-card {
        padding: 14px;
        border-radius: 16px;
    }

    .wd-methods {
        gap: 8px;
    }

    .wd-method {
        padding: 12px 4px 10px;
    }

    .wd-method__name {
        font-size: 12px;
    }

    .wd-method__meta {
        font-size: 9.5px;
    }

    .wd-item {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        grid-template-areas:
            "ico main status"
            "ico date status";
        row-gap: 2px;
        column-gap: 10px;
        padding: 11px 12px;
    }

    .wd-item__ico {
        grid-area: ico;
        width: 40px;
        height: 40px;
    }

    .wd-item__main {
        grid-area: main;
    }

    .wd-item__date {
        grid-area: date;
        font-size: 11px;
    }

    .wd-item__status {
        grid-area: status;
        min-width: 0;
    }
}

@media (max-width: 360px) {
    .wd-methods {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.wd-sum-total b,
.wd-balance b {
    font-family: inherit;
}

.wd-sum-total b span,
.wd-balance b span {
    display: inline;
    color: inherit;
    font: inherit;
}

.wd-sum-total b,
.wd-balance b,
.wd-item__main b,
.wd-method__meta {
    font-variant-numeric: tabular-nums;
}
/* Плашка про автовыплаты */
.wd-fast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(54, 124, 255, .3);
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(54, 124, 255, .16), rgba(54, 124, 255, .05));
    color: var(--wd-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.wd-fast i {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2f66ff;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(47, 102, 255, .45);
}

.wd-fast b {
    color: #66a4ff;
    font-weight: 900;
}
/* ---------- Окно «Вывод отменён» (v2: лежит в body) ---------- */
.wd-modal {
    position: fixed;
    inset: 0;
    z-index: 10300;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wd-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 16, .62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: wdFade .2s ease;
}

@keyframes wdFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wd-modal__box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    background: #1b1f2c;
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    font-family: inherit;
    animation: wdPop .22s ease;
}

body.bw-light .wd-modal__box {
    border-color: rgba(20, 35, 70, .09);
    background: #fff;
    color: #1b2233;
}

.wd-modal__grab {
    display: none;
}

.wd-modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 900;
}

.wd-modal__ico {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(239, 68, 68, .16);
    color: #ff6b6b;
    font-size: 15px;
}

.wd-modal__head button {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(138, 147, 171, .18);
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.wd-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.wd-modal__meta span {
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(138, 147, 171, .14);
    color: #8a93ab;
    font-size: 12px;
    font-weight: 800;
}

.wd-modal__meta span.is-sum {
    background: rgba(54, 124, 255, .16);
    color: #66a4ff;
}

.wd-modal__label {
    margin-bottom: 6px;
    color: #8a93ab;
    font-size: 12px;
    font-weight: 800;
}

.wd-modal__text {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 0;
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    background: rgba(239, 68, 68, .09);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
}

.wd-modal__hint {
    margin-bottom: 16px;
    color: #8a93ab;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

/* пока окно открыто — прячем нижнее меню и кнопку поддержки, чтобы не перекрывали */
body.wd-modal-open .bw-bottom-dock,
body.wd-modal-open div[class^="_widget_"],
body.wd-modal-open div[class*=" _widget_"] {
    display: none !important;
}

body.wd-modal-open {
    overflow: hidden;
}

/* Телефон — шторка снизу */
@media (max-width: 640px) {
    .wd-modal {
        align-items: flex-end;
        padding: 0;
    }

    .wd-modal__box {
        max-width: 100%;
        max-height: 85vh;
        padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
        border-width: 1px 0 0;
        border-radius: 22px 22px 0 0;
        animation: wdSheet .28s cubic-bezier(.22, 1, .36, 1);
    }

    .wd-modal__grab {
        display: block;
        width: 42px;
        height: 5px;
        margin: 0 auto 12px;
        border-radius: 999px;
        background: rgba(138, 147, 171, .4);
    }

    .wd-modal__box .wd-btn {
        height: 54px;
    }
}

@keyframes wdSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.wd-modal__head .wd-modal__ico i {
    color: inherit;
}
