/*
 * Profile page UI fixes — 2026-04-23.
 * Scoped to profile.html; does not affect other pages.
 */

/* --- Referral link container: keep the copy button inside the box --- */

.ref-link-container {
    box-sizing: border-box;
    max-width: 100%;
}

.ref-link-container .ref-link-row {
    max-width: 100%;
    box-sizing: border-box;
}

/*
 * On narrow viewports the inline row layout can push [ COPY ] past the
 * rounded border (see client screenshot 421_2026-04-23). Stack the input
 * and the button vertically from <480px upwards so the button spans the
 * full inner width and never overflows.
 */
@media (max-width: 480px) {
    .ref-link-container .ref-link-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ref-link-container #ref-link {
        width: 100%;
    }
    .ref-link-container #ref-copy-btn {
        width: 100%;
        text-align: center;
    }
}

/* --- DH Wallet --- */

.dh-wallet-balance-card {
    border: 2px solid var(--border-dim);
    padding: 1.25rem;
    background: var(--bg-secondary);
}

.dh-wallet-balance-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.dh-balance-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.dh-balance-amount {
    font-family: 'Share Tech Mono', 'VT323', ui-monospace, monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.dh-balance-rub {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
    font-weight: 700;
}

.dh-wallet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dim);
}

.dh-stat-item {
    padding: 0.25rem 0;
}

.dh-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.15rem;
    font-weight: 700;
}

.dh-stat-value {
    font-family: 'Share Tech Mono', 'VT323', ui-monospace, monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .dh-wallet-balance-row {
        flex-direction: column;
        align-items: stretch;
    }
    .dh-wallet-balance-row > button {
        width: 100%;
    }
}

/* DH Modals (profile top-up) */

.dh-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
html.light-theme .dh-modal {
    background: rgba(0,0,0,0.55);
}

.dh-modal-content {
    background: var(--bg-primary);
    border: 2px solid var(--text-primary);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Share Tech Mono', 'VT323', ui-monospace, monospace;
    color: var(--text-primary);
}

.dh-info-box {
    border: 2px dashed var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dh-method-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    font-family: 'Share Tech Mono', 'VT323', monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.dh-method-btn:hover,
.dh-method-btn:focus-visible {
    background: var(--text-primary);
    color: var(--bg-primary);
    outline: none;
}

.dh-address-box {
    font-family: 'Share Tech Mono', 'VT323', ui-monospace, monospace;
    font-size: 0.75rem;
    word-break: break-all;
    padding: 0.75rem 0.85rem;
    border: 2px dashed var(--border-dim);
    background: var(--bg-secondary);
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.02em;
}
