/* ==========================================
   STORE CART + PURCHASE HISTORY
   ========================================== */

/* ---------- Cart tab badge ---------- */

.store-tab-cart {
  position: relative;
}

.store-tab-badge {
  display: inline-grid;
  place-items: center;

  min-width: 19px;
  height: 19px;
  padding: 0 5px;

  border-radius: 999px;

  background: #c084fc;
  color: #14051f;

  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
}

.store-tab-badge[hidden] {
  display: none;
}

.store-tab-badge.is-bumped {
  animation: cart-badge-bump .45s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes cart-badge-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* ---------- Toast ---------- */

.store-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;

  display: flex;
  align-items: center;
  gap: 12px;

  max-width: min(92vw, 380px);
  padding: 13px 18px 13px 14px;

  border: 1px solid rgba(192, 132, 252, .45);
  border-radius: 14px;

  background: linear-gradient(135deg, rgba(37, 11, 41, .97), rgba(30, 9, 32, .97));
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5);

  color: #fdeaff;

  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;

  transition: opacity .25s ease, transform .25s ease;
}

.store-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.store-toast-icon {
  display: grid;
  place-items: center;

  flex: 0 0 30px;
  width: 30px;
  height: 30px;

  border-radius: 50%;

  background: rgba(80, 223, 160, .16);
  color: #50dfa0;
}

.store-toast-icon svg {
  width: 15px;
  height: 15px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.store-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;

  min-width: 0;
}

.store-toast-text strong {
  font-size: 13.5px;
  font-weight: 800;
}

.store-toast-text span {
  color: #e879f9;
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- Cart ---------- */

.cart-section {
  margin-top: 46px;
}

.cart-panel {
  padding: 26px;

  border: 1px solid rgba(192, 132, 252, .2);
  border-radius: 20px;

  background:
    linear-gradient(180deg, rgba(192, 132, 252, .06), rgba(22, 10, 38, .5) 40%),
    #250b29;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 20px;
}

.cart-head h2 {
  margin: 6px 0 0;

  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.6px;
}

.cart-count {
  padding: 7px 13px;

  border: 1px solid rgba(192, 132, 252, .35);
  border-radius: 999px;

  background: rgba(192, 132, 252, .1);
  color: #e879f9;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.cart-empty {
  padding: 30px 10px;

  border: 1px dashed rgba(202, 148, 211, .2);
  border-radius: 14px;

  color: var(--muted);
  text-align: center;

  font-size: 13.5px;
}

.cart-body {
  display: grid;
  gap: 10px;

  margin-bottom: 20px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 12px 14px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: rgba(20, 4, 20, .4);
}

.cart-row-info {
  flex: 1;
  min-width: 0;
}

.cart-row-name {
  display: block;

  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.cart-row-price {
  display: block;
  margin-top: 3px;

  color: var(--muted);
  font-size: 12px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty button {
  display: grid;
  place-items: center;

  width: 30px;
  height: 30px;
  padding: 0;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: rgba(192, 132, 252, .08);
  color: #fbcfe8;

  cursor: pointer;

  font-size: 16px;
  font-weight: 800;
  line-height: 1;

  transition: background .2s ease;
}

.cart-qty button:hover {
  background: rgba(192, 132, 252, .2);
}

/*
 * The stepper's + and - are real SVGs now, not the old text glyphs.
 * Without this rule they have no width or height and render at the
 * SVG default (300x150), which is what made the buttons look iconless.
 */
.cart-qty button svg {
  width: 14px;
  height: 14px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-qty span {
  min-width: 22px;
  text-align: center;

  font-size: 14px;
  font-weight: 800;
}

.cart-remove {
  display: grid;
  place-items: center;

  width: 30px;
  height: 30px;
  padding: 0;

  border: 1px solid rgba(255, 114, 126, .3);
  border-radius: 9px;

  background: rgba(255, 114, 126, .08);
  color: #ff8f99;

  cursor: pointer;

  transition: background .2s ease;
}

.cart-remove:hover {
  background: rgba(255, 114, 126, .2);
}

.cart-remove svg {
  width: 14px;
  height: 14px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.cart-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-buy,
.cart-remove {
  display: grid;
  place-items: center;

  width: 32px;
  height: 32px;
  padding: 0;

  border-radius: 9px;

  cursor: pointer;

  transition: background .2s ease, border-color .2s ease;
}

.cart-buy {
  border: 1px solid rgba(80, 223, 160, .3);
  background: rgba(80, 223, 160, .08);
  color: #50dfa0;
}

.cart-buy:hover {
  background: rgba(80, 223, 160, .2);
  border-color: rgba(80, 223, 160, .5);
}

.cart-buy svg,
.cart-remove svg {
  width: 15px;
  height: 15px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-remove {
  border: 1px solid rgba(255, 114, 126, .3);
  background: rgba(255, 114, 126, .08);
  color: #ff8f99;
}

.cart-remove:hover {
  background: rgba(255, 114, 126, .2);
  border-color: rgba(255, 114, 126, .5);
}

/* ---------- Payment picker ---------- */

.pay-picker {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.pay-picker legend {
  padding: 0 0 11px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.pay-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

/* GCash is the only method, so it gets the whole row rather than a
   one-cell strip stranded in a wide grid. */
.pay-option-single .pay-option-face {
  max-width: 320px;
}

.pay-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-option-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 50px;
  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: rgba(20, 4, 20, .4);
  color: var(--muted);

  font-size: 13px;
  font-weight: 800;

  cursor: pointer;

  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.pay-option-face svg {
  width: 17px;
  height: 17px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* State: hover */
.pay-option:hover .pay-option-face {
  border-color: rgba(192, 132, 252, .4);
  color: #fbcfe8;
}

/* State: selected (checked) */
.pay-option input:checked + .pay-option-face {
  border-color: #c084fc;
  background: rgba(192, 132, 252, .12);
  color: #fbcfe8;
  box-shadow: 0 0 0 3px rgba(192, 132, 252, .12);
}

/* State: focus */
.pay-option input:focus-visible + .pay-option-face {
  outline: 2px solid #c084fc;
  outline-offset: 2px;
}

/* ---------- Payment instructions ---------- */

.pay-instructions {
  margin-top: 16px;
  padding: 16px;

  border: 1px solid rgba(192, 132, 252, .22);
  border-radius: 14px;

  background: rgba(192, 132, 252, .05);
}

/*
 * The QR sits beside the number and the steps. Stacking them left the cart
 * showing two full width boxes that read as empty; side by side it reads
 * as one instruction with a scannable code attached.
 */
.pay-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 18px;
}

.pay-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  margin: 0;
  padding: 12px;

  border: 1px solid rgba(192, 132, 252, .3);
  border-radius: 14px;

  background: #fff;
}

.pay-qr[hidden] {
  display: none;
}

.pay-qr img {
  display: block;

  width: 168px;
  height: 168px;

  border-radius: 6px;

  object-fit: contain;
}

.pay-qr figcaption {
  color: #32053d;

  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.pay-side {
  min-width: 0;
}

.pay-instructions-head {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 12px;

  color: #fbcfe8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
}

.pay-instructions-head svg {
  width: 17px;
  height: 17px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pay-steps {
  margin: 0 0 14px;
  padding-left: 20px;

  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.pay-steps b {
  color: #fbcfe8;
  font-weight: 800;
}

/*
 * Replaces the reference box that used to sit here. The code does not
 * exist until checkout, so this says so instead of showing a fake one.
 */
.pay-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;

  margin: 14px 0 0;
  padding: 11px 13px;

  border: 1px dashed rgba(192, 132, 252, .35);
  border-radius: 11px;

  background: rgba(192, 132, 252, .06);

  color: #fbcfe8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.pay-note svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pay-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 9px;
}

.pay-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.pay-detail-label svg {
  width: 15px;
  height: 15px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pay-copy {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  padding: 9px 13px;

  border: 1px solid rgba(192, 132, 252, .35);
  border-radius: 10px;

  background: rgba(20, 4, 20, .55);
  color: #e879f9;

  cursor: pointer;

  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .6px;

  transition: background .2s ease, border-color .2s ease;
}

.pay-copy svg {
  width: 14px;
  height: 14px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;

  opacity: .75;
}

.pay-copy:hover:not(:disabled) {
  background: rgba(192, 132, 252, .16);
  border-color: rgba(192, 132, 252, .6);
}

.pay-copy:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.pay-warning {
  margin: 14px 0 0;
  padding-top: 12px;

  border-top: 1px dashed rgba(202, 148, 211, .2);

  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------- Receipt ---------- */

.receipt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  overflow-y: auto;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 20px;

  background: rgba(14, 2, 15, .78);
  backdrop-filter: blur(7px);

  animation: receipt-fade .22s ease;
}

.receipt-backdrop[hidden] {
  display: none;
}

@keyframes receipt-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.receipt {
  width: min(100%, 440px);

  /*
   * Hard guarantee against horizontal overflow: the card can never be
   * wider than the backdrop holding it. This is the backstop for any
   * value that slips past the per-field rules below.
   */
  max-width: 100%;

  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overflow-x: hidden;

  padding: 26px;

  border: 1px solid rgba(192, 132, 252, .32);
  border-radius: 20px;

  background: linear-gradient(180deg, rgba(192, 132, 252, .08), rgba(37, 11, 41, .98) 38%), #250b29;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);

  animation: receipt-rise .28s cubic-bezier(.2, .9, .3, 1);
}

@keyframes receipt-rise {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.receipt-top {
  display: flex;
  align-items: center;
  gap: 13px;

  min-width: 0;
}

.receipt-mark {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 9px;

  border-radius: 12px;

  background: rgba(80, 223, 160, .14);
  color: #50dfa0;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-top h2 {
  margin: 4px 0 0;
  min-width: 0;

  overflow-wrap: anywhere;

  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.5px;
}

.receipt-close {
  display: grid;
  place-items: center;

  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: transparent;
  color: var(--muted);

  cursor: pointer;

  transition: color .2s ease, border-color .2s ease;
}

.receipt-close svg {
  width: 15px;
  height: 15px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.receipt-close:hover {
  color: #ff8f99;
  border-color: rgba(255, 114, 126, .4);
}

.receipt-sub {
  margin: 14px 0 0;

  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.receipt-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;

  margin-top: 16px;
  padding: 14px 16px;

  border: 1px dashed rgba(192, 132, 252, .45);
  border-radius: 13px;

  background: rgba(192, 132, 252, .07);
}

.receipt-ref span {
  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.receipt-ref strong {
  color: #e879f9;

  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1.4px;

  /* A long code must be allowed to shrink, or the row pushes the card
     wider than the screen. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 11px;

  margin: 16px 0 0;
}

.receipt-field {
  padding: 11px 13px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: rgba(20, 4, 20, .4);

  /*
   * Grid and flex items default to min-width:auto, which refuses to go
   * narrower than the longest word inside. One unbroken value (a
   * Discord mention, a long reference) was therefore able to push the
   * track - and the whole receipt - past the edge of the screen.
   */
  min-width: 0;
}

.receipt-field dt {
  display: flex;
  align-items: center;
  gap: 7px;

  margin: 0;
  min-width: 0;

  color: var(--muted);

  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.receipt-field dt svg {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;

  fill: none;
  stroke: #c084fc;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-field dd {
  margin: 6px 0 0;
  min-width: 0;

  color: var(--text, #fdeaff);

  font-size: 13.5px;
  font-weight: 800;

  /* overflow-wrap:anywhere also breaks inside a long unbreakable run,
     which word-break:break-word did not reliably do. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.receipt-items {
  display: grid;
  gap: 7px;

  margin-top: 16px;
}

.receipt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  /* A grid item, so it needs the shrink guard like .receipt-field. */
  min-width: 0;

  padding: 10px 13px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: rgba(20, 4, 20, .3);

  color: #fbcfe8;
  font-size: 13px;
  font-weight: 700;
}

/* Both halves of the row can shrink, so a long item name wraps
   instead of widening the receipt. */
.receipt-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-item > span:last-child {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.receipt-item em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.receipt-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;

  margin-top: 16px;
  padding-top: 15px;

  border-top: 1px solid var(--border);
}

.receipt-total span {
  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.receipt-total strong {
  color: #e879f9;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -1px;

  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-foot {
  margin: 14px 0 0;

  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}

.receipt-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 20px;

  border: 1px solid transparent;
  border-radius: 11px;

  background: linear-gradient(135deg, #ec4899, #be185d);
  color: #fff;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;

  text-decoration: none;

  box-shadow: 0 10px 26px rgba(190, 24, 93, .32);

  transition: transform .2s ease, filter .2s ease;
}

.receipt-pay[hidden] {
  display: none;
}

.receipt-pay svg {
  width: 17px;
  height: 17px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-pay:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

body.has-receipt {
  overflow: hidden;
}

/* ---------- Footer / checkout ---------- */

.cart-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.cart-field {
  flex: 1 1 0;
  min-width: 0;
}

.cart-field span {
  display: block;
  margin-bottom: 7px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.cart-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: rgba(20, 4, 20, .5);
  color: var(--text, #fdeaff);

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;

  transition: border-color .2s ease, box-shadow .2s ease;
}

.cart-field input:focus {
  outline: none;

  border-color: #c084fc;
  box-shadow: 0 0 0 3px rgba(192, 132, 252, .16);
}

.cart-total {
  display: flex;
  flex-direction: column;
  gap: 4px;

  min-width: 92px;
}

.cart-total span {
  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.cart-total strong {
  color: #fbcfe8;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.8px;
  line-height: 1;
}

.cart-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 46px;
  padding: 0 26px;

  border: 1px solid transparent;
  border-radius: 11px;

  background: linear-gradient(135deg, #c084fc, #a855f7);
  color: #14051f;

  cursor: pointer;

  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;

  box-shadow: 0 10px 26px rgba(168, 85, 247, .3);

  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.cart-checkout svg {
  width: 16px;
  height: 16px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-checkout:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.cart-checkout:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.cart-clear {
  min-height: 46px;
  padding: 0 16px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: transparent;
  color: var(--muted);

  cursor: pointer;

  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;

  transition: color .2s ease, border-color .2s ease;
}

.cart-clear:hover {
  color: #ff8f99;
  border-color: rgba(255, 114, 126, .4);
}

.cart-note {
  margin: 16px 0 0;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cart-note.is-ok {
  color: #50dfa0;
}

.cart-note.is-error {
  color: #ff8f99;
}

/* ---------- Purchase history ---------- */

.history-section {
  margin-top: 54px;
}

.history-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  min-height: 38px;
  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: rgba(20, 4, 20, .4);
  color: var(--muted);

  cursor: pointer;

  font-family: inherit;
  font-size: 12px;
  font-weight: 700;

  transition: color .2s ease, border-color .2s ease;
}

.history-refresh:hover {
  color: #fbcfe8;
  border-color: rgba(192, 132, 252, .4);
}

.history-refresh svg {
  width: 15px;
  height: 15px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.history-empty {
  grid-column: 1 / -1;

  padding: 34px 12px;

  border: 1px dashed rgba(202, 148, 211, .2);
  border-radius: 16px;

  color: var(--muted);
  text-align: center;

  font-size: 13.5px;
}

.purchase {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 15px;

  border: 1px solid var(--border);
  border-radius: 16px;

  background: rgba(20, 4, 20, .4);

  transition: transform .25s ease, border-color .25s ease;
}

.purchase:hover {
  transform: translateY(-3px);
  border-color: rgba(192, 132, 252, .4);
}

/* The Minecraft head of the buyer */

.purchase-head {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;

  border-radius: 10px;
  overflow: hidden;

  border: 1px solid rgba(192, 132, 252, .35);
  background: #160a26;
}

.purchase-head img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.purchase-info {
  flex: 1;
  min-width: 0;
}

.purchase-name {
  display: block;

  color: var(--text, #fdeaff);

  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-items {
  display: block;
  margin-top: 4px;

  color: #e879f9;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

.purchase-meta {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 7px;

  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.purchase-dot {
  opacity: .5;
}

.purchase-status {
  padding: 3px 8px;

  border-radius: 999px;

  background: rgba(192, 132, 252, .1);
  color: #e879f9;

  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.purchase-status.done {
  background: rgba(80, 223, 160, .12);
  color: #50dfa0;
}

.purchase-method {
  color: #e879f9;
  font-weight: 700;
}

/* ---------- Light theme ---------- */

body.light-theme .store-toast {
  background: linear-gradient(135deg, #fff, #fdf4ff);
  color: #160a26;
  box-shadow: 0 18px 46px rgba(95, 15, 110, .22);
}

body.light-theme .store-toast-text span {
  color: #7e22ce;
}

body.light-theme .receipt {
  background: linear-gradient(180deg, rgba(192, 132, 252, .08), #fff 38%), #fff;
  box-shadow: 0 30px 70px rgba(95, 15, 110, .25);
}

body.light-theme .receipt-field,
body.light-theme .receipt-item,
body.light-theme .pay-option-face,
body.light-theme .pay-copy {
  background: rgba(255, 255, 255, .9);
}

body.light-theme .receipt-field dd,
body.light-theme .receipt-ref strong,
body.light-theme .receipt-total strong {
  color: #7e22ce;
}

body.light-theme .receipt-ref {
  background: rgba(192, 132, 252, .1);
}

body.light-theme .pay-instructions {
  background: rgba(192, 132, 252, .08);
}

body.light-theme .cart-panel {
  background:
    linear-gradient(180deg, rgba(192, 132, 252, .06), rgba(255, 255, 255, .92) 42%),
    #fff;
}

body.light-theme .cart-row,
body.light-theme .purchase,
body.light-theme .history-refresh {
  background: rgba(255, 255, 255, .82);
}

body.light-theme .cart-field input {
  background: #fff;
}

body.light-theme .cart-total strong,
body.light-theme .purchase-name {
  color: #7e22ce;
}

body.light-theme .purchase-head {
  border-color: rgba(168, 85, 247, .3);
}

/* ---------- Responsive ---------- */

/*
 * Tablet: the QR still fits beside the details, but everything inside the
 * cart gets tighter before the phone breakpoint is reached.
 */
@media (max-width: 900px) {
  .cart-panel {
    padding: 22px 18px;
  }

  .pay-qr img {
    width: 140px;
    height: 140px;
  }

  .receipt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .cart-panel {
    padding: 16px 13px;
    border-radius: 16px;
  }

  .cart-section {
    margin-top: 30px;
  }

  .cart-head {
    margin-bottom: 14px;
  }

  .cart-head h2 {
    font-size: 18px;
  }

  /* Everything in the cart steps down a size on a phone. The desktop
     spacing made the panel taller than the screen it had to fit in. */
  .cart-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
  }

  .cart-body {
    gap: 8px;
    margin-bottom: 15px;
  }

  .cart-total {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cart-total strong {
    font-size: 21px;
  }

  .cart-checkout,
  .cart-clear {
    width: 100%;
    min-height: 44px;
  }

  /* The qty stepper and the two action icons would crowd a narrow row. */
  .cart-row {
    flex-wrap: wrap;
    gap: 9px;

    padding: 11px 12px;
  }

  .cart-row-info {
    flex: 1 1 100%;
  }

  .cart-row-name {
    font-size: 13px;
  }

  .cart-row-price {
    font-size: 11.5px;
  }

  .cart-row-actions {
    margin-left: auto;
    gap: 7px;
  }

  .cart-qty {
    gap: 6px;
  }

  .cart-qty button,
  .cart-buy,
  .cart-remove {
    /* Compact by request, but never under the WCAG 2.5.8 target of 24px. */
    width: 30px;
    height: 30px;
  }

  .cart-qty span {
    min-width: 18px;
    font-size: 13px;
  }

  .pay-picker {
    margin-top: 16px;
  }

  .pay-options {
    grid-template-columns: 1fr;
  }

  .pay-option-face {
    min-height: 46px;
  }

  /* Side by side does not fit a phone: the QR goes above the details. */
  .pay-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }

  .pay-instructions {
    margin-top: 13px;
    padding: 13px;
  }

  .pay-qr {
    padding: 10px;
  }

  .pay-qr img {
    width: 132px;
    height: 132px;
  }

  .pay-side {
    width: 100%;
  }

  .pay-steps {
    margin-bottom: 11px;
    font-size: 12px;
    line-height: 1.65;
  }

  .pay-detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .pay-copy {
    width: 100%;
    min-height: 42px;
    justify-content: space-between;
  }

  .pay-note,
  .pay-warning {
    font-size: 11.5px;
  }

  .receipt {
    padding: 18px 15px;
    border-radius: 16px;
  }

  /* One column: two side by side fields wrap their own text. */
  .receipt-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .receipt-ref {
    padding: 12px 13px;
  }

  .receipt-ref strong {
    font-size: 16px;
  }

  .receipt-total strong {
    font-size: 22px;
  }

  .receipt-mark {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  .receipt-top h2 {
    font-size: 17px;
  }

  .receipt-pay {
    min-height: 44px;
  }

  .history-section {
    margin-top: 36px;
  }

  .history-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .store-toast {
    left: 14px;
    right: 14px;
    bottom: 14px;

    max-width: none;
    padding: 11px 14px 11px 11px;

    transform: translate(0, 18px);
  }

  .store-toast.is-visible {
    transform: translate(0, 0);
  }
}

/* Small phones: the last of the padding. */
@media (max-width: 380px) {
  .cart-panel {
    padding: 14px 11px;
  }

  .pay-qr img {
    width: 118px;
    height: 118px;
  }

  .cart-qty button,
  .cart-buy,
  .cart-remove {
    width: 28px;
    height: 28px;
  }
}