.page {
  max-width: 1100px; /* was 900px */
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.page-head { margin: 8px 0 16px; }
.page-title { font-size: 28px; margin: 0; }
.page-subtitle { margin: 6px 0 0; opacity: 0.75; }

.wallet-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
}

.wallet-balance .label { opacity: 0.7; font-size: 14px; }
.wallet-balance .value { font-size: 34px; font-weight: 700; margin-top: 6px; }
.wallet-balance .hint { opacity: 0.65; font-size: 13px; margin-top: 4px; }

.wallet-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-note { margin-top: 12px; font-size: 13px; opacity: 0.75; }

.section-title { font-size: 18px; margin: 0 0 10px; }

.tx-list { display: flex; flex-direction: column; gap: 10px; }
.tx-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px;
}
.tx-left { display: flex; flex-direction: column; gap: 4px; }
.tx-type { font-weight: 650; }
.tx-meta { font-size: 13px; opacity: 0.75; }
.tx-amount { font-weight: 700; }

.hidden { display: none !important; }
.empty-state {
  opacity: 0.7;
  padding: 10px 0;
}

/* Inline messages (replaces alert()) */
.wallet-msg{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
  font-size: 14px;
}
.wallet-msg.success{
  border-color: rgba(0,128,0,0.25);
  background: rgba(0,128,0,0.06);
}
.wallet-msg.error{
  border-color: rgba(180,0,0,0.25);
  background: rgba(180,0,0,0.06);
}

/* Inline request form */
.credit-form{
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}
.credit-label{
  display: block;
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 8px;
}
.credit-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.credit-input{
  flex: 1 1 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.14);
}

.wallet-status {
  margin-top: 12px;
  font-size: 14px;
  color: #555;
}

.wallet-status.pending {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff3cd;
  color: #856404;
  font-weight: 500;
}

.wallet-status.success {
  color: #0a7a2f;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border-radius: 12px;
  background: #fafafa;
  margin-bottom: 10px;
}

.tx-amount {
  font-weight: 600;
}

.tx-status {
  font-weight: 500;
  color: #888;
}


.tx-type {
  font-weight: 600;
}

.tx-type:contains("Credit applied") {
  color: #0a7a2f;
}

.tx-meta {
  font-size: 13px;
  color: #666;
}

.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 12px;
}

.tx-type {
  font-weight: 600;
  text-transform: capitalize;
}

.tx-meta {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

.tx-amount {
  font-weight: 700;
}

.tx-amount.credit {
  color: #1a9b3f;
}

.tx-amount.debit {
  color: #c0392b;
}

/* Pending credit requests */
.tx-item .tx-status {
  color: #b45309; /* amber text */
}

.tx-item:has(.tx-status) .tx-amount.credit {
  color: #d97706; /* orange for pending */
}


/* Credit request container */
.credit-request-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 16px;
  background: #fafafa;
}

/* Amount input */
.credit-request-box input[type="number"],
.credit-request-box input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 12px 14px;
  font-size: 16px; /* 🔥 prevents mobile zoom */
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  outline: none;
}

/* Buttons */
.credit-request-box button {
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}

/* Mobile layout */
@media (max-width: 600px) {
  .credit-request-box {
    flex-direction: column;
    align-items: stretch;
  }

  .credit-request-box button {
    width: 100%;
  }
}

.tx-status {
  font-size: 13px;
  opacity: 0.7;
}

/* Redeem code input */
#redeemCodeInput {
  text-transform: uppercase;
}

.ad-tx {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tx-item .ad-tx {
  margin-top: 6px;
}

.tx-item .ad-business {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.ad-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.ad-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-title {
  font-size: 13px;
  font-weight: 600;
}

.ad-link {
  font-size: 12px;
  color: #777;
  text-decoration: none;
}

.ad-tx {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-thumb.expanded {
  width: 120px;
  height: 120px;
  z-index: 2;
}

.ad-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-business {
  font-size: 12px;
  font-weight: 600;
  color: #222;
}

.ad-title {
  font-size: 13px;
  font-weight: 500;
}

.ad-link {
  font-size: 12px;
  color: #777;
  text-decoration: none;
}

/* Wallet invoice button */
.invoice-pill{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  margin-left: 6px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.invoice-pill:hover{
  background: #eef2f7;
  border-color: #d1d5db;
}

/* Wallet invoice button */
.invoice-pill{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  margin-left: 6px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.invoice-pill:hover{
  background: #eef2f7;
  border-color: #d1d5db;
}
