/* Voucher entry belongs beside the current balance; history stays below both. */
#view-wallet .wallet-layout{grid-template-columns:minmax(240px,.9fr) minmax(0,1.1fr);align-items:stretch;gap:24px}
#view-wallet .wallet-balance{min-height:270px;margin:0}
.payment-panel.wallet-voucher-panel{padding:25px;margin:0;display:block;min-width:0;overflow:hidden}
.wallet-voucher-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.wallet-voucher-heading h2{font-size:20px;line-height:1.4}
.wallet-voucher-heading .soft-badge{flex-shrink:0;margin-top:3px}
.wallet-voucher-body{padding:0;margin-top:16px}
.wallet-voucher-gate{font-size:14px;line-height:1.8;background:#f1f5ea;border:1px solid #dce6d2;border-radius:9px;padding:11px 14px;color:#526d50;margin:17px 0 19px}
#wallet-voucher-form>label{display:block;font-size:15px;font-weight:550;color:#315342;margin:0 0 10px}
.wallet-voucher-entry{display:flex;gap:10px;align-items:stretch}
.wallet-voucher-entry input{min-width:0;flex:1;margin:0;font:16px/1.7 var(--mono,monospace);padding:11px 13px}
.wallet-voucher-entry .button{min-height:48px;padding:10px 19px;font-size:15px;white-space:nowrap}
#wallet-voucher-form button[type=submit]:disabled {
  background: #edf1eb;
  border-color: #d7e1d5;
  color: #536b59;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 1;
}
#wallet-voucher-form button[type=submit][aria-busy=true]:disabled {
  background: #dfeae0;
  border-color: #c7dacc;
  cursor: progress;
}
.wallet-voucher-body .small{font-size:13px;line-height:1.9;margin:12px 0 0}
.wallet-voucher-body .wallet-voucher-ratio{color:var(--ink)}
.wallet-voucher-message{font-size:14px;line-height:1.9;padding:12px 14px;border:1px solid #cdddc8;border-radius:8px;background:#f3f7ed;color:#3f6349;margin-top:18px;overflow-wrap:anywhere}
.wallet-voucher-message.error{background:#fff4ea;border-color:#e8d4bd;color:#8b593b}
.wallet-voucher-purchase {
  padding: 24px;
  border-color: #d9e5d9;
  background: linear-gradient(135deg, #f4f8f0, #fff 62%);
}
.wallet-purchase-heading h2 {
  margin: 0;
  color: #153b31;
  font-size: 20px;
  line-height: 1.4;
}
.wallet-purchase-heading p {
  margin: 5px 0 0;
  color: #4e685c;
  font-size: 14px;
  line-height: 1.65;
}
.wallet-purchase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}
.wallet-purchase-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #d8e5d8;
  border-radius: 12px;
  background: #fff;
  color: #163d31;
  text-decoration: none;
  transition: transform 160ms ease-out, border-color 160ms ease-out,
    background-color 160ms ease-out, box-shadow 160ms ease-out;
}
.wallet-purchase-link:focus-visible {
  outline: 2px solid #267454;
  outline-offset: 2px;
  border-color: #43805a;
}
.wallet-purchase-amount {
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}
.wallet-purchase-amount > span {
  margin-right: 3px;
  color: #4f7056;
  font-size: .66em;
  font-weight: 650;
}
.wallet-purchase-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #356649;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.wallet-purchase-arrow {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2e8;
  line-height: 1;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}
@media (hover: hover) {
  .wallet-purchase-link:hover {
    transform: translateY(-2px);
    border-color: #8fb39a;
    background: #f9fcf7;
    box-shadow: 0 5px 14px rgba(25, 72, 47, .09);
  }
  .wallet-purchase-link:hover .wallet-purchase-arrow {
    transform: translate(1px, -1px);
    background: #dcebdc;
  }
}
.wallet-purchase-link:active { transform: scale(.98); }
.wallet-voucher-history .panel-head{gap:18px;flex-wrap:wrap}
.wallet-voucher-history .panel-head p{font-size:14px;line-height:1.8}
#wallet-voucher-records table{min-width:600px}
#wallet-voucher-records .mono{white-space:normal;overflow-wrap:anywhere;max-width:260px}
#wallet-voucher-refresh{font-size:14px}
@media(max-width:900px){#view-wallet .wallet-layout{grid-template-columns:minmax(0,1fr);gap:18px}#view-wallet .wallet-balance{min-height:180px}}
@media(max-width:620px){.payment-panel.wallet-voucher-panel{padding:21px 18px}.wallet-voucher-entry{flex-direction:column;gap:10px}.wallet-voucher-entry input{width:100%}.wallet-voucher-entry .button{width:100%}.wallet-voucher-heading{gap:10px}.wallet-voucher-heading h2{font-size:19px}.wallet-voucher-gate{padding:11px 12px}.wallet-voucher-history .panel-head{align-items:flex-start}}
@media (max-width: 1100px) {
  .wallet-purchase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .wallet-voucher-purchase { padding: 20px 16px; }
  .wallet-purchase-grid { gap: 9px; margin-top: 14px; }
  .wallet-purchase-link { min-height: 64px; padding: 10px; }
  .wallet-purchase-arrow { width: 22px; height: 22px; }
}
@media (max-width: 380px) {
  .wallet-purchase-link { flex-direction: column; align-items: flex-start; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .wallet-purchase-link, .wallet-purchase-arrow { transition: none; }
  .wallet-purchase-link:hover, .wallet-purchase-link:active,
  .wallet-purchase-link:hover .wallet-purchase-arrow { transform: none; }
}
