/* === 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; }
}

/* ===== User payment receipt modal ===== */
.ppr-modal { display: none; position: fixed; inset: 0; z-index: 100000; }
.ppr-modal.open { display: block; }
.ppr-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(8px); }
.ppr-wrap { position: relative; z-index: 1; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ppr-card { position: relative; width: 100%; max-width: 400px; background: #14141c; border: 1px solid rgba(255,255,255,0.14); border-radius: 24px; padding: 0 22px 22px; text-align: center; overflow: hidden; box-shadow: 0 50px 110px -24px rgba(0,0,0,0.8); animation: ppr-pop 0.45s cubic-bezier(0.22,1,0.36,1); max-height: calc(100vh - 40px); overflow-y: auto; }
@keyframes ppr-pop { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: none; } }
.ppr-head { position: relative; margin: 0 -22px; padding: 16px 18px 58px; background: linear-gradient(135deg, #16b364, #0f7a45); display: flex; align-items: center; justify-content: space-between; overflow: hidden; }
.ppr-head::before { content: ''; position: absolute; top: -40px; right: -20px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,0.10); }
.ppr-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.ppr-logo { width: 24px; height: 24px; color: #fff; display: flex; align-items: center; justify-content: center; }
.ppr-logo svg { width: 19px; height: 19px; }
.ppr-word { font-size: 16px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.ppr-close { position: relative; z-index: 2; width: 32px; height: 32px; border: none; border-radius: 50%; background: rgba(255,255,255,0.22); color: #fff; font-size: 20px; cursor: pointer; }
.ppr-check { position: relative; z-index: 2; width: 64px; height: 64px; margin: -32px auto 12px; background: #14141c; border-radius: 50%; padding: 6px; }
.ppr-check svg { width: 100%; height: 100%; }
.ppr-c { stroke: #16b364; stroke-width: 2.5; stroke-dasharray: 166; stroke-dashoffset: 166; animation: ppr-stroke 0.6s ease forwards; }
.ppr-m { stroke: #16b364; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: ppr-stroke 0.4s ease 0.55s forwards; }
@keyframes ppr-stroke { to { stroke-dashoffset: 0; } }
.ppr-status { font-size: 15px; color: #9a9aa8; font-weight: 600; }
.ppr-amount { font-size: 38px; font-weight: 800; letter-spacing: -1px; color: #fff; margin: 4px 0 2px; }
.ppr-sub { font-size: 13px; color: #6a6a78; margin-bottom: 14px; }
.ppr-div { position: relative; height: 16px; margin: 4px -22px; }
.ppr-div i { position: absolute; top: 50%; left: 12px; right: 12px; height: 2px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, rgba(255,255,255,0.16) 0 6px, transparent 6px 12px); }
.ppr-div::before, .ppr-div::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: #0a0a0f; transform: translateY(-50%); }
.ppr-div::before { left: -9px; } .ppr-div::after { right: -9px; }
.ppr-rows { text-align: left; display: flex; flex-direction: column; gap: 11px; margin: 4px 0; }
.ppr-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.ppr-row span { color: #6a6a78; } .ppr-row b { color: #e8e8ef; font-weight: 600; text-align: right; word-break: break-word; }
.ppr-refbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0; text-align: left; }
.ppr-ref-k { font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: #6a6a78; }
.ppr-ref-v { font-family: 'SF Mono', ui-monospace, monospace; font-size: 15px; font-weight: 700; color: #e8e8ef; }
.ppr-qr { width: 76px; height: 76px; flex-shrink: 0; background: #fff; border-radius: 10px; padding: 4px; display: flex; align-items: center; justify-content: center; }
.ppr-qr img { width: 100%; height: 100%; border-radius: 4px; }
.ppr-qr-ph { width: 68px; height: 68px; border-radius: 6px; background: repeating-conic-gradient(#e6e6ee 0 25%, #fff 0 50%) 0 0/12px 12px; opacity: 0.5; }
.ppr-note { font-size: 11px; color: #6a6a78; margin: -2px 0 6px; }
@media (max-width: 480px) {
    .ppr-wrap { padding: 0; align-items: flex-end; }
    .ppr-card { max-width: 100%; max-height: 96vh; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
    .ppr-amount { font-size: 34px; }
}
