/* === Phony Pay UI === */
.ph-pay-host { padding: 8px 0; }
.ph-pay-loading, .ph-pay-empty { padding: 30px; text-align: center; color: var(--text-muted); }

.ph-pay-form { display: flex; flex-direction: column; gap: 22px; }

.ph-pay-amount-block label,
.ph-pay-methods label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text); }

.ph-pay-amount-row {
    display: flex; align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 4px 16px;
    transition: border-color .2s;
}
.ph-pay-amount-row:focus-within { border-color: var(--primary, rgba(255,255,255,0.5)); }
.ph-pay-cur { font-size: 28px; font-weight: 700; color: var(--text-muted); margin-right: 8px; }
.ph-pay-amount-row input {
    flex: 1; background: transparent; border: 0; outline: 0;
    color: var(--text); font-size: 28px; font-weight: 700;
    padding: 14px 0; font-family: inherit;
}
.ph-pay-amount-hint, .ph-pay-fee-info {
    font-size: 12px; color: var(--text-muted); margin-top: 6px;
}
.ph-pay-fee-info { color: var(--text-muted); }

.ph-pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.ph-pay-chip {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 14px 8px;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.ph-pay-chip:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--rim-strong, rgba(255,255,255,0.2));
    transform: translateY(-2px);
}
.ph-pay-chip.selected {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.ph-pay-chip.disabled {
    opacity: .35; cursor: not-allowed; pointer-events: none;
    filter: grayscale(0.85);
    position: relative;
}
.ph-pay-chip.disabled:hover {
    transform: none; background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08);
}
.ph-pay-chip-off {
    margin-top: 4px;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255,160,160,0.85);
    font-weight: 600;
}
.ph-pay-chip-icon { font-size: 22px; line-height: 1; }
.ph-pay-chip-emoji { font-size: 22px; line-height: 1; }
.ph-pay-chip-img-wrap {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
}
.ph-pay-chip-img-wrap.big { width: 56px; height: 56px; }
.ph-pay-chip-img {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.ph-pay-chip-badge {
    position: absolute; right: -4px; bottom: -4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #0c0d12; padding: 1px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.ph-pay-chip-img-wrap.big .ph-pay-chip-badge { width: 22px; height: 22px; right: -4px; bottom: -4px; }

.ph-pay-coin-banner {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--rim-strong, rgba(255,255,255,0.14));
    border-radius: 12px;
}
.ph-pay-coin-banner-name { font-weight: 700; font-size: 16px; }
.ph-pay-coin-banner-net { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .8px; }

.ph-pay-chip-label { font-weight: 700; font-size: 14px; }
.ph-pay-chip-net { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; }

.ph-pay-submit { margin-top: 8px; }
.ph-pay-submit:disabled { opacity: .45; cursor: not-allowed; }

.ph-pay-history-link { text-align: center; margin-top: 8px; }
.ph-pay-history-link a { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.ph-pay-history-link a:hover { color: var(--text); }

/* === Invoice view === */
.ph-pay-invoice {
    display: flex; flex-direction: column; gap: 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 22px;
}

.ph-pay-invoice-header { display: flex; align-items: center; justify-content: space-between; }
.ph-pay-status {
    font-weight: 700; font-size: 16px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.06); color: var(--text-muted, #aaa);
    border: 1px solid var(--rim, rgba(255,255,255,0.14));
}
.ph-pay-status.credited { background: rgba(255,255,255,0.10); color: var(--text); border-color: var(--rim-strong); }
.ph-pay-status.rejected, .ph-pay-status.expired { background: rgba(245,179,179,0.10); color: var(--danger, #f5b3b3); border-color: rgba(245,179,179,0.3); }

.ph-pay-countdown {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 22px; font-weight: 700;
    color: var(--text);
    background: rgba(0,0,0,0.4); padding: 6px 12px; border-radius: 8px;
}
.ph-pay-countdown.expired { color: #ff6060; }

.ph-pay-qr-wrap { display: flex; justify-content: center; }
.ph-pay-qr {
    position: relative; padding: 14px; background: #fff; border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.ph-pay-qr img { width: 240px; height: 240px; display: block; }
.ph-pay-qr-logo {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 56px; height: 56px; border-radius: 14px;
    background: #fff; padding: 6px;
    box-shadow: 0 0 0 4px #fff, 0 4px 14px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
}
.ph-pay-qr-logo img { width: 100%; height: 100%; object-fit: contain; }

.ph-pay-amount-display { text-align: center; }
.ph-pay-crypto {
    font-size: 32px; font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--primary-2) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ph-pay-crypto span { font-size: 22px; opacity: .9; }
.ph-pay-network { color: var(--text-muted); font-size: 13px; margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

.ph-pay-detail-row {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: 10px; padding: 10px 14px;
    background: rgba(0,0,0,0.25); border-radius: 10px;
}
.ph-pay-detail-label { color: var(--text-muted); font-size: 13px; }
.ph-pay-detail-val {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px; word-break: break-all; color: var(--text);
}
.ph-pay-addr { font-size: 12px; }
.ph-pay-copy {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text); cursor: pointer;
    padding: 6px 10px; border-radius: 8px;
    transition: all .15s;
}
.ph-pay-copy:hover { background: rgba(255,255,255,0.12); }

.ph-pay-info-grid {
    display: flex; flex-direction: column; gap: 6px;
    padding: 12px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--rim, rgba(255,255,255,0.1)); border-radius: 10px; font-size: 13px;
}
.ph-pay-info-grid > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ph-pay-info-grid span { color: var(--text-muted); }
.ph-pay-info-grid b { color: var(--text); }

.ph-pay-warning {
    padding: 12px 16px; border-radius: 10px; font-size: 13px; line-height: 1.5;
    background: rgba(255,255,255,0.04); border: 1px solid var(--rim, rgba(255,255,255,0.14));
    color: var(--text-muted, #aaa);
}

.ph-pay-actions { display: flex; gap: 10px; }
.ph-pay-actions .btn { flex: 1; }

/* History */
.ph-pay-history-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ph-pay-history-header h4 { margin: 0; }
.ph-pay-history-list { display: flex; flex-direction: column; gap: 8px; }
.ph-pay-history-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 12px 14px;
}
.ph-pay-status-credited { border-color: rgba(80,220,140,0.3); }
.ph-pay-status-rejected, .ph-pay-status-expired { opacity: .65; }
.ph-pay-hi-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ph-pay-hi-amount { font-weight: 700; }
.ph-pay-hi-status { font-size: 12px; color: var(--text-muted); }
.ph-pay-hi-meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* Toast */
.ph-pay-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 80px);
    padding: 14px 22px; border-radius: 12px;
    background: rgba(20,20,30,0.95); color: var(--text);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    font-weight: 600;
    z-index: 99999;
    transition: transform .3s, opacity .3s;
    opacity: 0;
}
.ph-pay-toast.show { transform: translate(-50%, 0); opacity: 1; }
.ph-pay-toast.success { border-color: rgba(80,220,140,0.5); background: rgba(20,40,30,0.95); }
.ph-pay-toast.error { border-color: rgba(255,90,90,0.5); background: rgba(40,20,20,0.95); }

/* Mobile */
@media (max-width: 640px) {
    .ph-pay-grid { grid-template-columns: repeat(3, 1fr); }
    .ph-pay-qr img { width: 200px; height: 200px; }
    .ph-pay-detail-row { grid-template-columns: 1fr auto; }
    .ph-pay-detail-row .ph-pay-detail-label { grid-column: 1 / -1; margin-bottom: -4px; }
    .ph-pay-detail-row .ph-pay-detail-val { grid-column: 1; }
    .ph-pay-actions { flex-direction: column; }
}
