.coinseller-center {
    overflow: hidden auto;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
}

.balance-card,
.sub-seller-card,
.search-card,
.recent-card {
    padding: 16px;
}

.balance-head,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.balance-label,
.section-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.15;
}

.balance-subtitle,
.section-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.round-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.round-action.small {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
}

.round-action svg {
    width: 24px;
    height: 24px;
}

.round-action.small svg {
    width: 20px;
    height: 20px;
}

.round-action path,
.round-action circle {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.balance-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: #23272d;
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
}

.balance-value strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.coin-icon,
.input-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe179 0%, #ffb62d 52%, #f49b20 100%);
    color: #fff;
    font-size: 19px;
    font-weight: 950;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(195, 117, 12, 0.24);
}

.search-card,
.sub-seller-card,
.recent-card {
    display: grid;
    gap: 14px;
}

.search-form,
.history-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 102px;
    gap: 10px;
}

.search-form input,
.history-search-form input,
.coin-input-shell {
    min-width: 0;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(251, 249, 255, 0.9);
}

.search-form input,
.history-search-form input {
    width: 100%;
    padding: 0 14px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.search-form input::placeholder,
.history-search-form input::placeholder,
.coin-input-shell input::placeholder {
    color: #b5b0bd;
}

.search-form button,
.history-search-form button,
.recharge-form button,
.load-more {
    min-height: 52px;
    border-radius: 8px;
    background: var(--button);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.history-clear-button {
    background: var(--primary-soft) !important;
    color: var(--primary-deep) !important;
}

.form-status {
    min-height: 42px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(249, 241, 255, 0.72);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.form-status.success {
    background: rgba(49, 198, 168, 0.12);
    color: var(--success);
}

.form-status.warning {
    background: rgba(217, 93, 114, 0.1);
    color: var(--danger);
}

.target-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 12px;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.target-card[hidden] {
    display: none;
}

.sub-seller-card[hidden] {
    display: none;
}

.target-avatar,
.record-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-deep);
    font-weight: 950;
}

.target-avatar {
    width: 52px;
    height: 52px;
    font-size: 21px;
}

.target-avatar img,
.record-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.target-main {
    min-width: 0;
}

.target-name {
    margin-top: 6px;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.target-meta {
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.target-coin-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.target-coin-action .coin-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 20px;
}

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

.quick-amount {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 900;
}

.quick-amount.is-active {
    border-color: var(--primary-deep);
    background: var(--primary-deep);
    color: #fff;
}

.recharge-form {
    display: grid;
    gap: 12px;
}

.recharge-sheet {
    max-height: 78vh;
    max-height: 78dvh;
}

.recharge-sheet-body {
    display: grid;
    gap: 14px;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
}

.recharge-target {
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recharge-sheet-body p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
}

.coin-input-shell {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    padding: 0 14px;
}

.input-coin {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 17px;
}

.coin-input-shell input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 20px;
    font-weight: 950;
}

.recharge-form button {
    width: 100%;
    min-height: 56px;
    border-radius: 28px;
}

.recharge-form button:disabled {
    background: var(--button-disabled);
    color: var(--muted);
}

.text-link {
    min-height: 34px;
}

.record-list {
    display: grid;
    gap: 10px;
}

.sub-seller-list {
    display: grid;
    gap: 10px;
}

.sub-seller-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

.sub-seller-main {
    min-width: 0;
}

.sub-seller-balance {
    margin-top: 5px;
    overflow: hidden;
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-seller-transfer {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--button);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.sub-seller-transfer:disabled {
    background: var(--button-disabled);
    color: var(--muted);
}

.record-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

.record-avatar {
    width: 42px;
    height: 42px;
    font-size: 17px;
}

.record-main {
    min-width: 0;
}

.record-title {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-meta-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: 5px;
    min-width: 0;
}

.record-meta {
    overflow: hidden;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-transfer {
    flex: 0 0 auto;
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.record-side {
    display: grid;
    justify-items: end;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.record-side strong {
    color: var(--primary-deep);
    font-size: 15px;
    font-weight: 950;
    white-space: nowrap;
}

.record-side.is-income strong {
    color: var(--success);
}

.history-sheet {
    max-height: 86vh;
    max-height: 86dvh;
}

.history-body {
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 18px;
    -webkit-overflow-scrolling: touch;
}

.history-search-form {
    grid-template-columns: minmax(0, 1fr) 86px 76px;
}

.history-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 8px;
    background: var(--primary-soft);
}

.history-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 900;
}

.history-tab.is-active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 8px 18px rgba(98, 72, 155, 0.08);
}

.history-records {
    max-height: 360px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.load-more {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.help-content {
    display: grid;
    gap: 10px;
    padding: 16px 18px 22px;
}

.sub-seller-form {
    display: grid;
    gap: 12px;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
}

.sub-seller-form p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.sub-seller-form input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(251, 249, 255, 0.9);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.sub-seller-form input::placeholder {
    color: #b5b0bd;
}

.sub-seller-form button {
    width: 100%;
    min-height: 56px;
    border-radius: 28px;
    background: var(--button);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.sub-seller-form button:disabled {
    background: var(--button-disabled);
    color: var(--muted);
}

.help-content h3,
.help-content p {
    margin: 0;
}

.help-content h3 {
    color: var(--text);
    font-size: 17px;
    font-weight: 950;
}

.help-content p {
    margin-top: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
}

.help-content span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

body.modal-open .coinseller-center {
    overflow: hidden;
}

[dir='rtl'] .record-side {
    justify-items: start;
}

[dir='rtl'] .history-search-form {
    direction: rtl;
}

@media (max-width: 360px) {
    .balance-value {
        font-size: 30px;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) 88px;
    }

    .history-search-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .sub-seller-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .sub-seller-transfer {
        grid-column: 2;
        justify-self: start;
    }
}
