/* MahaTip on X (/x). Builds on style.css tokens: --brand, --surface, --border-color. */

.xt-hero {
    padding-top: 120px;
    padding-bottom: 40px;
}

.xt-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.xt-hero-lead {
    max-width: 640px;
}

.xt-main {
    padding-bottom: 80px;
    position: relative;
    z-index: 2;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.xt-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.xt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.xt-card-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.xt-sub-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.xt-subsection {
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.xt-muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.xt-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
}

/* ── Alert ─────────────────────────────────────────────────────────────── */

.xt-alert {
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.xt-alert-success {
    border-color: rgba(212, 255, 0, 0.35);
    background: rgba(212, 255, 0, 0.07);
}

.xt-alert-error {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
    color: #fecaca;
}

.xt-alert-info {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.07);
}

/* ── Steps ─────────────────────────────────────────────────────────────── */

.xt-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xt-step {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.75rem;
}

.xt-step:last-child {
    padding-bottom: 0;
}

/* the line joining one step's number to the next */
.xt-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

.xt-step[data-state="done"]:not(:last-child)::before {
    background: rgba(212, 255, 0, 0.35);
}

.xt-step-num {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.xt-step[data-state="active"] .xt-step-num {
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow);
}

.xt-step[data-state="done"] .xt-step-num {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
}

.xt-step[data-state="done"] .xt-step-num span {
    display: none;
}

.xt-step[data-state="done"] .xt-step-num::after {
    content: '';
    width: 12px;
    height: 7px;
    border-left: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(-45deg) translate(1px, -1px);
}

.xt-step-body {
    flex: 1;
    min-width: 0;
}

.xt-step-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 6px 0 0.25rem;
}

.xt-step-desc {
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}

.xt-step-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.6rem 0 0;
}

.xt-step[data-state="locked"] .xt-step-body {
    opacity: 0.45;
}

.xt-step[data-state="locked"] button,
.xt-step[data-state="locked"] input {
    pointer-events: none;
}

.xt-inline-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.xt-inline-form .form-control {
    flex: 1 1 220px;
    min-width: 0;
    font-size: 1rem !important;
    padding: 0.7rem 1.2rem !important;
}

.xt-otp-input {
    letter-spacing: 0.4em;
    font-family: 'Courier New', monospace;
    text-align: center;
    max-width: 240px;
}

.xt-link-row {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.6rem;
}

.xt-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.xt-link:hover {
    color: var(--text-primary);
}

.xt-done {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.xt-done-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.xt-done-main strong {
    overflow-wrap: anywhere;
}

.xt-done-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.xt-x-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #000;
}

.xt-x-profile {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.xt-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.xt-x-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.xt-x-handle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
}

.xt-x-handle:hover {
    color: var(--brand);
}

.xt-party {
    color: var(--brand);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.xt-btn-ghost-danger {
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: transparent;
}

.xt-btn-ghost-danger:hover {
    color: #fff;
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.5);
}

/* ── Balance ───────────────────────────────────────────────────────────── */

.xt-balances {
    display: grid;
    gap: 0.6rem;
}

.xt-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.xt-balance-token {
    font-weight: 600;
}

.xt-balance-amount {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.xt-balance-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.xt-copy-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
}

.xt-copy-box code {
    flex: 1;
    min-width: 0;
    color: var(--brand);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.xt-withdraw-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.xt-select,
.xt-input {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 14px !important;
}

.xt-select {
    flex: 0 0 120px;
    width: 120px;
}

.xt-select option {
    background: var(--surface);
}

.xt-amount-wrap {
    flex: 1 1 160px;
    position: relative;
    min-width: 0;
}

.xt-amount-wrap .xt-input {
    padding-right: 4rem;
}

.xt-max {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000;
    background: var(--brand);
}

#xt-wd-submit {
    margin-top: 0.9rem;
}

.xt-withdrawals {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.5rem;
}

.xt-withdrawals li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.xt-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.xt-chip-pending,
.xt-chip-processing {
    color: #fde68a;
    border-color: rgba(253, 230, 138, 0.35);
}

.xt-chip-sent {
    color: var(--brand);
    border-color: rgba(212, 255, 0, 0.35);
}

.xt-chip-failed {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}

/* ── Activity ──────────────────────────────────────────────────────────── */

.xt-activity {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xt-activity li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.xt-activity li:last-child {
    border-bottom: none;
}

.xt-act-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.xt-act-in .xt-act-icon {
    background: rgba(212, 255, 0, 0.1);
    color: var(--brand);
}

.xt-act-text {
    flex: 1;
    min-width: 0;
}

.xt-act-label {
    display: block;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.xt-act-time {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.xt-act-amount {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    white-space: nowrap;
}

.xt-act-in .xt-act-amount {
    color: var(--brand);
}

/* ── How to ────────────────────────────────────────────────────────────── */

.xt-howto {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.xt-howto li {
    margin-bottom: 0.6rem;
}

.xt-howto code,
.xt-step-note code {
    color: var(--brand);
    background: rgba(212, 255, 0, 0.08);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.xt-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    font-size: 0.85rem;
}

.xt-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Busy state ────────────────────────────────────────────────────────── */

.xt-page button[aria-busy="true"] {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 575.98px) {
    .xt-card {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .xt-select {
        flex: 1 1 100%;
        width: 100%;
    }
}
