/*
 * tf-shop.css - THE CLUE MARKETPLACE (tenderfoot/js/tf-shop.js).
 *
 * Every rule starts at .tf-shop, and the colours are declared on .tf-shop itself, so this file
 * needs nobody's :root and styles nothing outside the Marketplace. The material is the main
 * game's DOM dialogs (index.html .ud-sheet, .ud-btn, .ud-drawer, .ud-pop): lit plum-and-indigo
 * stone, a thin gold hairline, a warm highlight along the top edge, Palatino titles in gold,
 * Trebuchet body text in parchment, lavender for the quieter lines, candy-pink buttons with dark
 * text, mint for good news. No glass, no blur, no flat white cards: the one pale surface is the
 * invoice, which is paper.
 *
 * A few rules reach outside .tf-shop, and only through the shop's own classes, which tf-shop.js
 * puts on <html> and <body> and takes off again:
 *   body.tf-shop-open        the page does not scroll behind the Marketplace
 *   html.tf-shop-printing,   (print only) the invoice is the only thing on the paper: the page's
 *   body.tf-shop-printing    own height, overflow, background and backdrop (body::before) let go
 *
 * Sizes: laid out for 1280 x 720 and up; COMPACT under 420 px of height (a phone held sideways,
 * down to about 640 x 320: the five bundles become rows and fit one screen); NARROW under 560 px
 * of width. Every control is at least 44 px. prefers-reduced-motion stills everything.
 * Keyframe names cannot be scoped, so they all start tfs-.
 */

/* ---------------------------------------------------------------------------
   The overlay, its tokens, and the resets that keep the page's own CSS out
   --------------------------------------------------------------------------- */
.tf-shop {
  --tfs-pink: #FF8FC7;
  --tfs-pink-hi: #FFC3E2;
  --tfs-pink-lo: #E077AF;
  --tfs-lavender: #C9A8F5;
  --tfs-mint: #7FE0D6;
  --tfs-gold: #F5C242;
  --tfs-gold-hi: #FFF3C4;
  --tfs-gold-lo: #B7791F;
  --tfs-parchment: #FBF3E7;
  --tfs-obsidian: #14121A;
  --tfs-ink: #0B0814;
  --tfs-plum: #3A2B58;
  --tfs-plum-hi: #5C4380;
  --tfs-stone-top: #4A3568;
  --tfs-stone-mid: #2A1F42;
  --tfs-stone-low: #1B1430;
  --tfs-muted: #B3A4D6;
  --tfs-bad: #FF8FA3;
  --tfs-hairline: rgba(245, 194, 66, 0.42);
  --tfs-rule: rgba(201, 168, 245, 0.22);
  --tfs-well: rgba(12, 9, 20, 0.45);
  --tfs-font: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --tfs-title: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --tfs-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 40%, rgba(36, 26, 61, 0.74) 0%, rgba(11, 8, 20, 0.92) 72%);
  color: var(--tfs-parchment);
  font-family: var(--tfs-font);
  font-size: 14px;
  font-weight: normal;
  line-height: 1.45;
  text-align: left;
  letter-spacing: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  animation: tfs-fade 160ms ease-out both;
}
.tf-shop[hidden],
.tf-shop [hidden] { display: none !important; }
.tf-shop *,
.tf-shop *::before,
.tf-shop *::after { box-sizing: border-box; }
.tf-shop h2,
.tf-shop h3,
.tf-shop h4,
.tf-shop p,
.tf-shop dl,
.tf-shop dt,
.tf-shop dd,
.tf-shop ul,
.tf-shop ol,
.tf-shop li,
.tf-shop figure { margin: 0; padding: 0; }
.tf-shop ul,
.tf-shop ol { list-style: none; }
.tf-shop button { font: inherit; color: inherit; margin: 0; text-transform: none; }
.tf-shop svg { overflow: visible; }
.tf-shop .tfs-ico { display: block; }
.tf-shop .tfs-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.tf-shop .tfs-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.tf-shop-open { overflow: hidden; }

/* ---------------------------------------------------------------------------
   The panel: one centred slab of lit stone
   --------------------------------------------------------------------------- */
.tf-shop .tfs-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 980px;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--tfs-hairline);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--tfs-stone-top) 0%, var(--tfs-stone-mid) 58%, var(--tfs-stone-low) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 168, 0.34),
    inset 0 0 0 1px rgba(155, 127, 201, 0.10),
    0 0 0 1px rgba(20, 18, 26, 0.9),
    0 30px 80px rgba(0, 0, 0, 0.65);
  outline: none;
  animation: tfs-rise 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* THE PROTOTYPE BANNER: always on, every step, in the game's "read this" gold. */
.tf-shop .tfs-proto {
  flex: 0 0 auto;
  padding: 6px 16px;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  color: #F7DA9A;
  background: repeating-linear-gradient(135deg, rgba(245, 194, 66, 0.17) 0 12px, rgba(245, 194, 66, 0.07) 12px 24px);
  border-bottom: 1px solid rgba(245, 194, 66, 0.5);
}
.tf-shop .tfs-proto strong {
  margin-right: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tfs-gold);
}

.tf-shop .tfs-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------------------------------------------------------------------------
   The header: name, blurb, balance, Invoices, close
   --------------------------------------------------------------------------- */
.tf-shop .tfs-head {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 18px 12px 20px;
  border-bottom: 1px solid var(--tfs-rule);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}
.tf-shop .tfs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 260px;
  min-width: 0;
}
.tf-shop .tfs-headcoin { flex: 0 0 auto; width: 44px; height: 44px; }
.tf-shop .tfs-titles { min-width: 0; }
.tf-shop .tfs-title {
  font-family: var(--tfs-title);
  font-size: 26px;
  font-weight: bold;
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--tfs-gold);
}
/* The engraved-gold ramp of the game's titles (TF.title), where the browser can paint text with a gradient. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tf-shop .tfs-goldtext {
    background: linear-gradient(180deg, var(--tfs-gold-hi) 15%, var(--tfs-gold) 55%, var(--tfs-gold-lo) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7));
  }
}
.tf-shop .tfs-blurb { margin-top: 3px; font-size: 13px; color: var(--tfs-lavender); }

.tf-shop .tfs-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tf-shop .tfs-balance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 13px 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(245, 194, 66, 0.5);
  background: var(--tfs-well);
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  color: var(--tfs-parchment);
}
.tf-shop .tfs-balcoin { flex: 0 0 auto; width: 24px; height: 24px; }
.tf-shop .tfs-balance.is-bumped { animation: tfs-bump 650ms ease-out; }

.tf-shop .tfs-need {
  flex: 1 1 100%;
  padding: 7px 12px;
  border-left: 3px solid var(--tfs-pink);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 143, 199, 0.1);
  font-size: 13px;
  color: #FFD9EC;
}
.tf-shop .tfs-need.is-met {
  border-left-color: var(--tfs-mint);
  background: rgba(127, 224, 214, 0.1);
  color: #CFF7F2;
}

/* ---------------------------------------------------------------------------
   Buttons: the game's pink primary, a lavender-rimmed ghost, quiet links
   --------------------------------------------------------------------------- */
.tf-shop .tfs-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--tfs-font);
  font-size: 14px;
  font-weight: bold;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.tf-shop .tfs-btn:focus { outline: none; }
.tf-shop .tfs-btn:focus-visible { outline: 2px solid var(--tfs-mint); outline-offset: 2px; }
.tf-shop .tfs-btn:disabled { cursor: not-allowed; }

.tf-shop .tfs-btn--primary {
  color: var(--tfs-obsidian);
  background: linear-gradient(180deg, var(--tfs-pink-hi) 0%, var(--tfs-pink) 45%, var(--tfs-pink-lo) 100%);
  border: 2px solid var(--tfs-gold);
  box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.65), 0 3px 0 rgba(0, 0, 0, 0.28);
}
.tf-shop .tfs-btn--primary:hover { filter: brightness(1.08); }
.tf-shop .tfs-btn--primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.5), 0 1px 0 rgba(0, 0, 0, 0.28); }
.tf-shop .tfs-btn--primary:disabled {
  color: #8E7FB0;
  background: linear-gradient(180deg, #5A4E72 0%, #4A4060 55%, #3A3250 100%);
  border-color: #4A4060;
  box-shadow: none;
  filter: none;
  transform: none;
}
.tf-shop .tfs-btn--ghost {
  color: var(--tfs-parchment);
  background: rgba(12, 9, 20, 0.3);
  border: 2px solid var(--tfs-lavender);
}
.tf-shop .tfs-btn--ghost:hover { border-color: var(--tfs-gold); }
.tf-shop .tfs-btn--ghost:disabled { opacity: 0.45; }
.tf-shop .tfs-link {
  justify-content: flex-start;
  padding: 0 8px 0 4px;
  font-size: 13px;
  color: var(--tfs-lavender);
}
.tf-shop .tfs-link:hover { color: var(--tfs-parchment); }
.tf-shop .tfs-link:disabled { opacity: 0.45; }
.tf-shop .tfs-chev { font-size: 22px; line-height: 1; margin-top: -2px; }

.tf-shop .tfs-tab {
  padding: 0 14px;
  border: 1px solid rgba(201, 168, 245, 0.45);
  background: rgba(12, 9, 20, 0.35);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--tfs-parchment);
}
.tf-shop .tfs-tab:hover { border-color: var(--tfs-gold); }
.tf-shop .tfs-tab.is-current { border-color: var(--tfs-gold); color: var(--tfs-gold); box-shadow: inset 0 -3px 0 var(--tfs-gold); }
.tf-shop .tfs-tab:disabled { opacity: 0.45; }
.tf-shop .tfs-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--tfs-mint);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  color: var(--tfs-obsidian);
}
/* The round purple disc every screen of the game closes with (TF.arrowDisc's material). */
.tf-shop .tfs-x {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--tfs-lavender);
  background: var(--tfs-plum);
  color: #E6D8FF;
}
.tf-shop .tfs-x:hover { background: var(--tfs-plum-hi); }
.tf-shop .tfs-x:disabled { opacity: 0.4; }
.tf-shop .tfs-x .tfs-ico { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   The body: the one part that scrolls
   --------------------------------------------------------------------------- */
.tf-shop .tfs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 245, 0.45) transparent;
}
.tf-shop .tfs-body::-webkit-scrollbar { width: 10px; }
.tf-shop .tfs-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 6px;
  background: rgba(201, 168, 245, 0.35);
  background-clip: padding-box;
}
.tf-shop .tfs-view { animation: tfs-fade 180ms ease-out both; }

.tf-shop .tfs-h {
  font-family: var(--tfs-title);
  font-size: 20px;
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--tfs-parchment);
  outline: none;
}
/* The small-caps section label with its short gold rule (TF.sectionLabel). */
.tf-shop .tfs-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--tfs-font);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tfs-gold);
}
.tf-shop .tfs-label::after {
  content: '';
  flex: 0 0 auto;
  width: 44px;
  height: 2px;
  background: var(--tfs-gold);
  opacity: 0.7;
}
.tf-shop .tfs-sub { margin-top: 5px; font-size: 13px; color: var(--tfs-lavender); }
.tf-shop .tfs-small { font-size: 12px; line-height: 1.5; color: var(--tfs-muted); }
.tf-shop .tfs-foot { margin-top: 18px; font-size: 12px; text-align: center; color: var(--tfs-muted); }
.tf-shop .tfs-viewtop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  margin: -6px 0 10px -4px;
}
.tf-shop .tfs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tf-shop .tfs-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--tfs-bad);
  border-radius: 0 6px 6px 0;
  background: rgba(176, 104, 142, 0.2);
  font-size: 13px;
  color: #FFD9E9;
}
.tf-shop .tfs-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 194, 66, 0.6);
  background: rgba(245, 194, 66, 0.1);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tfs-gold);
}

/* ---------------------------------------------------------------------------
   BUNDLES: the stalls
   --------------------------------------------------------------------------- */
.tf-shop .tfs-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 14px;
  margin-top: 20px;
}
.tf-shop .tfs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 164px;
  max-width: 220px;
  padding: 16px 12px 12px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 245, 0.3);
  background: linear-gradient(180deg, rgba(107, 78, 150, 0.55) 0%, rgba(74, 53, 104, 0.62) 50%, rgba(42, 31, 66, 0.72) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.tf-shop .tfs-card:hover,
.tf-shop .tfs-card:focus-within { transform: translateY(-2px); border-color: rgba(245, 194, 66, 0.75); }
.tf-shop .tfs-card.is-featured {
  border-color: rgba(245, 194, 66, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.26), 0 0 22px rgba(245, 194, 66, 0.16), 0 8px 18px rgba(0, 0, 0, 0.28);
}
.tf-shop .tfs-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--tfs-obsidian);
  background: linear-gradient(180deg, var(--tfs-gold-hi), var(--tfs-gold));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.tf-shop .tfs-badge--popular { background: linear-gradient(180deg, var(--tfs-pink-hi), var(--tfs-pink)); }
.tf-shop .tfs-badge--value { background: linear-gradient(180deg, #CFFFF9, var(--tfs-mint)); }
.tf-shop .tfs-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 78px;
}
.tf-shop .tfs-art-svg { display: block; width: auto; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; }
.tf-shop .tfs-art-svg--dim { height: 76px; filter: grayscale(0.75) brightness(0.8); }
.tf-shop .tfs-twinkle { transform-box: fill-box; transform-origin: center; }
.tf-shop .tfs-card:hover .tfs-twinkle,
.tf-shop .tfs-card:focus-within .tfs-twinkle { animation: tfs-twinkle 1.4s ease-in-out infinite; }
.tf-shop .tfs-card-words { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tf-shop .tfs-card-name {
  font-family: var(--tfs-title);
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
  color: var(--tfs-gold);
}
.tf-shop .tfs-card-count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 6px;
  font-size: 13px;
}
.tf-shop .tfs-card-count strong { font-size: 20px; }
.tf-shop .tfs-free {
  padding: 1px 7px;
  border: 1px solid rgba(127, 224, 214, 0.55);
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  color: var(--tfs-mint);
}
.tf-shop .tfs-card-buy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 4px;
}
.tf-shop .tfs-price { font-size: 18px; font-weight: bold; }
.tf-shop .tfs-buy { width: 100%; }
.tf-shop .tfs-buy-price { display: none; font-weight: normal; }
/* COMING SOON (F05, 2026-09-25): every bundle on show, none for sale until the server says the stalls are open. */
.tf-shop .tfs-soonline { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--tfs-parchment); }
.tf-shop .tfs-card.is-soon:hover,
.tf-shop .tfs-card.is-soon:focus-within { transform: none; }
.tf-shop .tfs-card.is-soon .tfs-art-svg { filter: saturate(0.75) brightness(0.92); }
.tf-shop .tfs-card.is-soon .tfs-price { color: var(--tfs-muted); }
.tf-shop .tfs-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px dashed rgba(245, 194, 66, 0.6);
  border-radius: 999px;
  background: rgba(245, 194, 66, 0.08);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tfs-gold);
}

/* ---------------------------------------------------------------------------
   CHECKOUT: the order, and three ways to pay
   --------------------------------------------------------------------------- */
.tf-shop .tfs-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.tf-shop .tfs-summary {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(245, 194, 66, 0.3);
  background: var(--tfs-well);
  box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.12);
}
.tf-shop .tfs-summary-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(201, 168, 245, 0.3);
}
.tf-shop .tfs-art--small { flex: 0 0 auto; width: 72px; height: 54px; }
.tf-shop .tfs-summary-name { font-family: var(--tfs-title); font-size: 17px; font-weight: bold; color: var(--tfs-gold); }
.tf-shop .tfs-summary-total { font-size: 13px; font-weight: bold; color: var(--tfs-mint); }
.tf-shop .tfs-lines { display: flex; flex-direction: column; }
.tf-shop .tfs-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
}
.tf-shop .tfs-line dt { flex: 0 0 auto; color: var(--tfs-lavender); }
.tf-shop .tfs-line dd { font-weight: bold; text-align: right; }
.tf-shop .tfs-line--tax dd { max-width: 74%; font-size: 12px; font-weight: normal; color: var(--tfs-muted); }
.tf-shop .tfs-line--total {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid rgba(245, 194, 66, 0.4);
  font-size: 16px;
}
.tf-shop .tfs-line--total dt,
.tf-shop .tfs-line--total dd { color: var(--tfs-gold); font-weight: bold; }

.tf-shop .tfs-methods { display: flex; flex-direction: column; gap: 8px; }
.tf-shop .tfs-minor {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tfs-gold);
}
/* The game's glass menu row (TF.menuRow): an accent strip that widens on hover, and a chevron. */
.tf-shop .tfs-method {
  --tfs-accent: var(--tfs-gold);
  --tfs-accent-soft: rgba(245, 194, 66, 0.3);
  position: relative;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 6px 42px 6px 18px;
  text-align: left;
  border: 1px solid var(--tfs-accent-soft);
  background: rgba(11, 8, 20, 0.62);
  box-shadow: inset 4px 0 0 var(--tfs-accent);
  color: var(--tfs-parchment);
}
.tf-shop .tfs-method--pink { --tfs-accent: var(--tfs-pink); --tfs-accent-soft: rgba(255, 143, 199, 0.32); }
.tf-shop .tfs-method--gold { --tfs-accent: var(--tfs-gold); --tfs-accent-soft: rgba(245, 194, 66, 0.32); }
.tf-shop .tfs-method--lavender { --tfs-accent: var(--tfs-lavender); --tfs-accent-soft: rgba(201, 168, 245, 0.32); }
.tf-shop .tfs-method:hover,
.tf-shop .tfs-method:focus-visible {
  border-color: var(--tfs-accent);
  background: rgba(11, 8, 20, 0.82);
  box-shadow: inset 8px 0 0 var(--tfs-accent);
}
.tf-shop .tfs-method-ico { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; }
.tf-shop .tfs-method-ico .tfs-ico--card { width: 38px; height: 27px; }
.tf-shop .tfs-method-words { display: flex; flex-direction: column; min-width: 0; }
.tf-shop .tfs-method-title { font-family: var(--tfs-title); font-size: 17px; font-weight: bold; color: var(--tfs-accent); }
.tf-shop .tfs-method-sub { font-size: 12px; font-weight: normal; color: var(--tfs-muted); }
.tf-shop .tfs-method-chev {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-54%);
  font-size: 28px;
  font-weight: bold;
  color: var(--tfs-accent);
  transition: right 140ms ease;
}
.tf-shop .tfs-method:hover .tfs-method-chev { right: 10px; }

.tf-shop .tfs-wglyph {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.tf-shop .tfs-wglyph img { display: block; width: 100%; height: 100%; }
.tf-shop .tfs-wglyph.is-missing {
  border: 2px solid var(--tfs-gold);
  background: var(--tfs-plum);
  font-family: var(--tfs-title);
  font-weight: bold;
  color: var(--tfs-gold);
}
.tf-shop .tfs-wglyph--big { width: 64px; height: 64px; font-size: 26px; }

/* ---------------------------------------------------------------------------
   CARD: the page a payment provider would show, with a test card and no fields at all
   --------------------------------------------------------------------------- */
.tf-shop .tfs-hosted {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 245, 0.32);
  background: rgba(12, 9, 20, 0.42);
}
.tf-shop .tfs-hosted-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--tfs-rule);
  background: rgba(255, 255, 255, 0.04);
  color: var(--tfs-mint);
}
.tf-shop .tfs-hosted-bar .tfs-ico--lock { width: 16px; height: 16px; flex: 0 0 auto; }
.tf-shop .tfs-hosted-bar .tfs-h {
  font-family: var(--tfs-font);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tfs-mint);
}
.tf-shop .tfs-hosted-bar .tfs-pill { margin-left: auto; }
.tf-shop .tfs-cols--hosted { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); padding: 16px; }
.tf-shop .tfs-payto { font-size: 12px; color: var(--tfs-muted); }
.tf-shop .tfs-amount {
  margin: 2px 0 4px;
  font-family: var(--tfs-title);
  font-size: 34px;
  font-weight: bold;
  line-height: 1.1;
}
.tf-shop .tfs-item { font-size: 13px; color: var(--tfs-lavender); }
.tf-shop .tfs-field-label {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tfs-muted);
}
.tf-shop .tfs-hosted-pay .tfs-field-label:first-child { margin-top: 0; }
.tf-shop .tfs-receipt { font-size: 12px; color: var(--tfs-parchment); overflow-wrap: anywhere; }
.tf-shop .tfs-note {
  margin-top: 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--tfs-mint);
  border-radius: 0 6px 6px 0;
  background: rgba(127, 224, 214, 0.08);
  font-size: 12px;
  color: #CFF7F2;
}
.tf-shop .tfs-testcard {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(245, 194, 66, 0.55);
  background: rgba(245, 194, 66, 0.06);
  font-size: 14px;
}
.tf-shop .tfs-testcard .tfs-ico--card { flex: 0 0 auto; width: 40px; height: 28px; }
.tf-shop .tfs-testcard-text { display: block; line-height: 1.7; }
.tf-shop .tfs-testcard-text strong { letter-spacing: 0.04em; white-space: nowrap; }
.tf-shop .tfs-testcard-text .tfs-pill { vertical-align: 1px; }
.tf-shop .tfs-pay { width: 100%; min-height: 52px; margin-top: 14px; font-size: 17px; }
.tf-shop .tfs-pay.is-busy:disabled {
  color: var(--tfs-obsidian);
  background: linear-gradient(180deg, var(--tfs-pink-hi) 0%, var(--tfs-pink) 45%, var(--tfs-pink-lo) 100%);
  border-color: var(--tfs-gold);
  opacity: 0.9;
  cursor: progress;
}
.tf-shop .tfs-hosted-foot { padding: 0 16px 14px; }
.tf-shop .tfs-spin {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(20, 18, 26, 0.25);
  border-top-color: var(--tfs-obsidian);
  animation: tfs-spin 0.9s linear infinite;
}

/* ---------------------------------------------------------------------------
   WALLET: a window inside the panel. It covers the header and the body, never the banner.
   --------------------------------------------------------------------------- */
.tf-shop .tfs-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(11, 8, 20, 0.74);
  animation: tfs-fade 160ms ease-out both;
}
/* margin: auto rather than align-items: center, so a window taller than the screen scrolls from its top. */
.tf-shop .tfs-wallet {
  width: 100%;
  max-width: 470px;
  margin: auto;
  padding: 20px 22px 18px;
  border-radius: 14px;
  border: 1px solid rgba(245, 194, 66, 0.55);
  background: linear-gradient(180deg, var(--tfs-stone-top) 0%, var(--tfs-stone-mid) 60%, var(--tfs-stone-low) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 224, 168, 0.3), 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: tfs-rise 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tf-shop .tfs-wallet-top { display: flex; align-items: center; gap: 14px; }
.tf-shop .tfs-wallet-words { min-width: 0; }
.tf-shop .tfs-wallet-title { font-size: 22px; }
.tf-shop .tfs-sim { font-family: var(--tfs-font); font-size: 13px; font-weight: normal; color: var(--tfs-muted); }
.tf-shop .tfs-wallet-amount { margin-top: 2px; font-size: 16px; font-weight: bold; color: var(--tfs-gold); }
.tf-shop .tfs-wallet .tfs-actions { justify-content: flex-end; }
.tf-shop .tfs-steps { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 12px; }
.tf-shop .tfs-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  font-size: 14px;
  color: var(--tfs-muted);
}
.tf-shop .tfs-step-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(201, 168, 245, 0.4);
}
.tf-shop .tfs-step-mark .tfs-ico { width: 14px; height: 14px; }
.tf-shop .tfs-step.is-active { font-weight: bold; color: var(--tfs-parchment); }
.tf-shop .tfs-step.is-active .tfs-step-mark {
  border: 3px solid rgba(245, 194, 66, 0.25);
  border-top-color: var(--tfs-gold);
  animation: tfs-spin 0.9s linear infinite;
}
.tf-shop .tfs-step.is-done { color: var(--tfs-parchment); }
.tf-shop .tfs-step.is-done .tfs-step-mark {
  border: 0;
  background: var(--tfs-mint);
  color: var(--tfs-obsidian);
  animation: tfs-pop 260ms ease-out;
}
.tf-shop .tfs-step.is-failed { color: #FFD9E9; }
.tf-shop .tfs-step.is-failed .tfs-step-mark { border: 0; background: var(--tfs-bad); color: var(--tfs-obsidian); }
.tf-shop .tfs-hash {
  grid-column: 2;
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(201, 168, 245, 0.25);
  background: rgba(12, 9, 20, 0.55);
  font-family: var(--tfs-mono);
  font-size: 11px;
  font-weight: normal;
  line-height: 1.4;
  color: var(--tfs-lavender);
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ---------------------------------------------------------------------------
   SUCCESS: the celebration, the new balance, and the honest small print, big
   --------------------------------------------------------------------------- */
.tf-shop .tfs-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  text-align: center;
}
.tf-shop .tfs-success-words { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tf-shop .tfs-celebrate { position: relative; flex: 0 0 auto; width: 170px; height: 128px; }
.tf-shop .tfs-celebrate .tfs-art-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: tfs-pop-in 520ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.tf-shop .tfs-spark {
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  background: radial-gradient(circle, #FFFFFF 0%, #FFF1B0 40%, var(--tfs-gold) 100%);
  opacity: 0;
  animation: tfs-sparkle 1.5s ease-out 3 both;
}
.tf-shop .tfs-spark:nth-child(1) { left: 4%; top: 20%; animation-delay: 0.05s; }
.tf-shop .tfs-spark:nth-child(2) { left: 18%; top: 2%; width: 10px; height: 10px; animation-delay: 0.35s; }
.tf-shop .tfs-spark:nth-child(3) { left: 44%; top: -6%; width: 16px; height: 16px; animation-delay: 0.15s; }
.tf-shop .tfs-spark:nth-child(4) { left: 72%; top: 4%; width: 12px; height: 12px; animation-delay: 0.5s; }
.tf-shop .tfs-spark:nth-child(5) { left: 90%; top: 24%; width: 16px; height: 16px; animation-delay: 0.25s; }
.tf-shop .tfs-spark:nth-child(6) { left: 94%; top: 60%; width: 10px; height: 10px; animation-delay: 0.6s; }
.tf-shop .tfs-spark:nth-child(7) { left: 76%; top: 86%; animation-delay: 0.1s; }
.tf-shop .tfs-spark:nth-child(8) { left: 40%; top: 94%; width: 10px; height: 10px; animation-delay: 0.45s; }
.tf-shop .tfs-spark:nth-child(9) { left: 10%; top: 80%; width: 16px; height: 16px; animation-delay: 0.3s; }
.tf-shop .tfs-spark:nth-child(10) { left: -4%; top: 52%; width: 12px; height: 12px; animation-delay: 0.55s; }
.tf-shop .tfs-plus {
  font-size: 38px;
  letter-spacing: 0.04em;
  color: var(--tfs-gold);
  animation: tfs-pop-in 520ms cubic-bezier(0.2, 1.4, 0.4, 1) 120ms both;
}
.tf-shop .tfs-paid { font-size: 15px; font-style: italic; }
.tf-shop .tfs-newbal { font-size: 14px; font-weight: bold; color: var(--tfs-mint); }
.tf-shop .tfs-protonote {
  max-width: 540px;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid rgba(245, 194, 66, 0.7);
  background: rgba(245, 194, 66, 0.11);
  font-size: 14px;
}
.tf-shop .tfs-protonote strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--tfs-gold);
}
.tf-shop .tfs-met { font-size: 13px; color: var(--tfs-mint); }
.tf-shop .tfs-success .tfs-actions { justify-content: center; margin-top: 10px; }

/* ---------------------------------------------------------------------------
   INVOICES: the list
   --------------------------------------------------------------------------- */
.tf-shop .tfs-invlist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tf-shop .tfs-invrow {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  width: 100%;
  min-height: 58px;
  padding: 8px 14px 8px 18px;
  text-align: left;
  font-weight: normal;
  border: 1px solid rgba(201, 168, 245, 0.25);
  background: rgba(11, 8, 20, 0.55);
  box-shadow: inset 4px 0 0 var(--tfs-gold);
  color: var(--tfs-parchment);
}
.tf-shop .tfs-invrow:hover { border-color: var(--tfs-gold); background: rgba(11, 8, 20, 0.8); box-shadow: inset 8px 0 0 var(--tfs-gold); }
.tf-shop .tfs-invrow-main { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.tf-shop .tfs-invrow-num { font-family: var(--tfs-mono); font-size: 13px; font-weight: bold; color: var(--tfs-gold); }
.tf-shop .tfs-invrow-what { font-size: 13px; color: var(--tfs-lavender); }
.tf-shop .tfs-invrow-status {
  padding: 2px 8px;
  border: 1px solid rgba(127, 224, 214, 0.5);
  border-radius: 999px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--tfs-mint);
}
.tf-shop .tfs-invrow-side { display: flex; flex-direction: column; align-items: flex-end; }
.tf-shop .tfs-invrow-total { font-size: 15px; font-weight: bold; }
.tf-shop .tfs-invrow-date { font-size: 12px; color: var(--tfs-muted); }
.tf-shop .tfs-empty {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(201, 168, 245, 0.35);
  border-radius: 10px;
  text-align: center;
  color: var(--tfs-lavender);
}

/* ---------------------------------------------------------------------------
   THE INVOICE: paper, ink, a gold rule, and TEST MODE across it
   --------------------------------------------------------------------------- */
.tf-shop .tfs-invtools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px 0 12px -4px;
}
.tf-shop .tfs-invoice {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 30px 22px;
  border-radius: 6px;
  border: 1px solid #C9B79A;
  background: linear-gradient(180deg, #FFFAF0 0%, #FBF3E7 55%, #F3E6CE 100%);
  box-shadow: inset 0 0 0 4px #FBF3E7, inset 0 0 0 5px rgba(183, 121, 31, 0.55), 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: #2A1F42;
  break-inside: avoid;
}
.tf-shop .tfs-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-family: var(--tfs-title);
  font-size: 84px;
  font-weight: bold;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: rgba(110, 42, 92, 0.1);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.tf-shop .tfs-invoice > :not(.tfs-watermark) { position: relative; z-index: 1; }
.tf-shop .tfs-inv-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #B7791F;
}
.tf-shop .tfs-inv-seller p { font-size: 12px; color: #5C4A70; }
.tf-shop .tfs-inv-seller .tfs-inv-sellername { font-family: var(--tfs-title); font-size: 17px; font-weight: bold; color: #3A2B58; }
.tf-shop .tfs-inv-meta { text-align: right; }
.tf-shop .tfs-inv-title {
  font-size: 28px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6E2A5C;
}
.tf-shop .tfs-inv-facts {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 2px 12px;
  margin-top: 6px;
  font-size: 12px;
}
.tf-shop .tfs-fact { display: contents; }
.tf-shop .tfs-fact dt { text-align: left; color: #6B5A80; }
.tf-shop .tfs-fact dd { text-align: right; font-weight: bold; color: #2A1F42; overflow-wrap: anywhere; }
.tf-shop .tfs-inv-status dd { color: #1F7A70; letter-spacing: 0.04em; }
.tf-shop .tfs-inv-bill { margin-top: 14px; }
.tf-shop .tfs-inv-label {
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8A5A12;
}
.tf-shop .tfs-inv-strong { font-weight: bold; color: #2A1F42; overflow-wrap: anywhere; }
.tf-shop .tfs-inv-bill p { overflow-wrap: anywhere; }
.tf-shop .tfs-inv-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 13px; }
.tf-shop .tfs-inv-table th {
  padding: 6px 8px;
  border-bottom: 1px solid #C9B79A;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: #6B5A80;
}
.tf-shop .tfs-inv-table td { padding: 10px 8px; border-bottom: 1px solid rgba(201, 183, 154, 0.6); vertical-align: top; }
.tf-shop .tfs-inv-table .tfs-num { text-align: right; white-space: nowrap; }
.tf-shop .tfs-inv-detail { display: block; font-size: 12px; color: #6B5A80; }
/* No column gap here (the dd's padding makes the space), so the Total row's rule runs unbroken. */
.tf-shop .tfs-inv-totals {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 4px 0;
  margin-top: 12px;
}
.tf-shop .tfs-inv-totals .tfs-fact dd { padding-left: 28px; }
.tf-shop .tfs-inv-grand dt,
.tf-shop .tfs-inv-grand dd { padding-top: 6px; border-top: 2px solid #B7791F; font-size: 16px; font-weight: bold; color: #3A2B58; }
.tf-shop .tfs-inv-pay { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #C9B79A; }
.tf-shop .tfs-inv-pay .tfs-inv-facts { grid-template-columns: max-content minmax(0, 1fr); justify-content: start; gap: 3px 16px; }
.tf-shop .tfs-inv-pay .tfs-fact dd { text-align: left; }
.tf-shop .tfs-mono dd { font-family: var(--tfs-mono); font-size: 11px; font-weight: normal; word-break: break-all; }
.tf-shop .tfs-inv-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #C9B79A; font-size: 11px; color: #6B5A80; }
.tf-shop .tfs-inv-quip { margin-top: 4px; font-style: italic; color: #6E2A5C; }
.tf-shop .tfs-inv-legal { margin-top: 8px; font-size: 10px; letter-spacing: 0.04em; color: #6B5A80; }

.tf-shop .tfs-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  text-align: center;
}
.tf-shop .tfs-closed .tfs-btn { margin-top: 8px; }

/* ---------------------------------------------------------------------------
   NARROW: under 560 px wide (a phone upright, a split screen)
   --------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .tf-shop {
    padding: 8px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .tf-shop .tfs-panel { border-radius: 12px; }
  .tf-shop .tfs-head { padding: 10px 12px; }
  .tf-shop .tfs-headcoin { width: 36px; height: 36px; }
  .tf-shop .tfs-title { font-size: 21px; }
  .tf-shop .tfs-body { padding: 14px 12px 16px; }
  .tf-shop .tfs-cols,
  .tf-shop .tfs-cols--hosted { grid-template-columns: minmax(0, 1fr); }
  .tf-shop .tfs-card { flex-basis: 140px; }
  .tf-shop .tfs-invoice { padding: 18px 14px; }
  .tf-shop .tfs-inv-meta { text-align: left; }
  .tf-shop .tfs-inv-facts { justify-content: start; }
  .tf-shop .tfs-watermark { font-size: 54px; }
  .tf-shop .tfs-inv-table .tfs-unit { display: none; }
}

/* ---------------------------------------------------------------------------
   COMPACT: under 420 px tall (a phone held sideways). Everything tightens, the stalls become
   two columns of rows so all five fit one screen, and the two-part screens sit side by side.
   --------------------------------------------------------------------------- */
@media (max-height: 420px) {
  .tf-shop {
    padding: 6px 8px;
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .tf-shop .tfs-panel { border-radius: 10px; }
  .tf-shop .tfs-proto { padding: 3px 10px; font-size: 11px; }
  .tf-shop .tfs-proto strong { font-size: 10px; }
  .tf-shop .tfs-head { gap: 4px 10px; padding: 4px 8px 4px 12px; }
  .tf-shop .tfs-brand { flex: 1 1 0; gap: 8px; min-width: 150px; }
  .tf-shop .tfs-headcoin { width: 30px; height: 30px; }
  .tf-shop .tfs-title { font-size: 18px; }
  .tf-shop .tfs-blurb { margin-top: 1px; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
  .tf-shop .tfs-tools { gap: 6px; }
  .tf-shop .tfs-balance { min-height: 32px; padding: 3px 10px 3px 5px; font-size: 12px; }
  .tf-shop .tfs-balcoin { width: 20px; height: 20px; }
  .tf-shop .tfs-tab { padding: 0 10px; font-size: 12px; }
  .tf-shop .tfs-need { padding: 4px 10px; font-size: 12px; }
  .tf-shop .tfs-body { padding: 6px 12px 10px; }
  .tf-shop .tfs-sub { display: none; }
  .tf-shop .tfs-h { font-size: 17px; }
  .tf-shop .tfs-viewtop { margin: -4px 0 6px -4px; }
  .tf-shop .tfs-foot { margin-top: 8px; }
  .tf-shop .tfs-actions { margin-top: 8px; }

  .tf-shop .tfs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 6px;
    margin-top: 8px;
  }
  .tf-shop .tfs-card {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    max-width: none;
    padding: 5px 6px 5px 5px;
    text-align: left;
  }
  .tf-shop .tfs-card:hover,
  .tf-shop .tfs-card:focus-within { transform: none; }
  .tf-shop .tfs-badge { top: -7px; left: 10px; transform: none; padding: 1px 7px; font-size: 9px; }
  .tf-shop .tfs-art { flex: 0 0 auto; width: 52px; height: 39px; }
  .tf-shop .tfs-card-words { flex: 1 1 auto; align-items: flex-start; gap: 1px; min-width: 0; }
  .tf-shop .tfs-card-name { font-size: 13px; }
  .tf-shop .tfs-card-count { justify-content: flex-start; gap: 1px 5px; font-size: 12px; }
  .tf-shop .tfs-card-count strong { font-size: 14px; }
  .tf-shop .tfs-free { padding: 0 6px; font-size: 10px; }
  .tf-shop .tfs-card-buy { flex: 0 0 auto; width: auto; margin: 0; padding: 0; }
  .tf-shop .tfs-price { display: none; }
  /* "Buy" over its price: the narrowest a 44 px button can say both. */
  .tf-shop .tfs-buy {
    flex-direction: column;
    gap: 0;
    width: auto;
    min-width: 64px;
    padding: 2px 10px;
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
  }
  .tf-shop .tfs-buy-price { display: block; font-size: 11px; }
  .tf-shop .tfs-soonline { margin-top: 2px; font-size: 12px; }
  .tf-shop .tfs-soon { min-height: 30px; padding: 0 10px; font-size: 10px; }
  /* with no Buy button to carry it, a coming-soon card keeps its price above the pill */
  .tf-shop .tfs-card.is-soon .tfs-card-buy { align-items: center; gap: 2px; }
  .tf-shop .tfs-card.is-soon .tfs-price { display: block; font-size: 13px; }

  .tf-shop .tfs-cols,
  .tf-shop .tfs-cols--hosted { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .tf-shop .tfs-summary { padding: 8px 10px; }
  .tf-shop .tfs-summary-top { margin-bottom: 4px; padding-bottom: 6px; }
  .tf-shop .tfs-art--small { width: 52px; height: 39px; }
  .tf-shop .tfs-summary-name { font-size: 15px; }
  .tf-shop .tfs-line { padding: 2px 0; font-size: 12px; }
  .tf-shop .tfs-line--tax dd { font-size: 11px; }
  .tf-shop .tfs-line--total { padding-top: 5px; font-size: 14px; }
  .tf-shop .tfs-methods { gap: 6px; }
  .tf-shop .tfs-methods > .tfs-small { display: none; }
  .tf-shop .tfs-method { min-height: 44px; padding: 3px 34px 3px 14px; }
  .tf-shop .tfs-method-ico,
  .tf-shop .tfs-method .tfs-wglyph { width: 32px; height: 32px; }
  .tf-shop .tfs-method-title { font-size: 15px; }
  .tf-shop .tfs-method-sub { font-size: 11px; }

  .tf-shop .tfs-hosted-bar { padding: 6px 12px; }
  .tf-shop .tfs-cols--hosted { padding: 10px 12px; }
  .tf-shop .tfs-amount { font-size: 26px; }
  .tf-shop .tfs-field-label { margin: 8px 0 4px; }
  .tf-shop .tfs-note { margin-top: 8px; padding: 5px 10px; font-size: 11px; }
  .tf-shop .tfs-testcard { min-height: 46px; padding: 6px 10px; font-size: 13px; }
  .tf-shop .tfs-pay { min-height: 46px; margin-top: 8px; }
  .tf-shop .tfs-hosted-foot { display: none; }

  .tf-shop .tfs-layer { padding: 8px; }
  .tf-shop .tfs-wallet {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 2px 16px;
    max-width: 640px;
    padding: 12px 14px;
  }
  .tf-shop .tfs-wallet-top { flex-direction: column; align-items: flex-start; gap: 6px; grid-column: 1; grid-row: 1 / span 4; }
  .tf-shop .tfs-wallet > :not(.tfs-wallet-top) { grid-column: 2; }
  .tf-shop .tfs-wglyph--big { width: 44px; height: 44px; font-size: 20px; }
  .tf-shop .tfs-wallet-title { font-size: 19px; }
  .tf-shop .tfs-steps { gap: 5px; margin: 0 0 6px; }
  .tf-shop .tfs-step { font-size: 13px; }
  .tf-shop .tfs-wallet .tfs-actions { margin-top: 6px; }

  .tf-shop .tfs-success { flex-direction: row; justify-content: center; gap: 18px; text-align: left; }
  .tf-shop .tfs-success-words { align-items: flex-start; gap: 3px; }
  .tf-shop .tfs-celebrate { width: 130px; height: 98px; }
  .tf-shop .tfs-plus { font-size: 28px; }
  .tf-shop .tfs-paid { font-size: 13px; }
  .tf-shop .tfs-protonote { margin-top: 4px; padding: 6px 10px; font-size: 12px; }
  .tf-shop .tfs-protonote strong { font-size: 13px; }
  .tf-shop .tfs-success .tfs-actions { justify-content: flex-start; margin-top: 6px; }

  .tf-shop .tfs-invrow { min-height: 48px; padding: 5px 12px 5px 16px; }
  .tf-shop .tfs-invoice { padding: 14px 16px; }
  .tf-shop .tfs-watermark { font-size: 56px; }
}

/* A phone both short and narrow: back to one column. */
@media (max-height: 420px) and (max-width: 479px) {
  .tf-shop .tfs-cols,
  .tf-shop .tfs-cols--hosted { grid-template-columns: minmax(0, 1fr); }
  .tf-shop .tfs-grid { grid-template-columns: minmax(0, 1fr); }
  .tf-shop .tfs-wallet,
  .tf-shop .tfs-success { display: flex; flex-direction: column; }
}

/* ---------------------------------------------------------------------------
   Motion: every animation is decoration, and all of it stops for prefers-reduced-motion.
   The spinners stop turning and turn dotted; the words beside them still say what is happening.
   --------------------------------------------------------------------------- */
@keyframes tfs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tfs-rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes tfs-spin { to { transform: rotate(360deg); } }
@keyframes tfs-bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); box-shadow: 0 0 16px rgba(245, 194, 66, 0.55); }
  100% { transform: scale(1); }
}
@keyframes tfs-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes tfs-pop-in {
  0% { opacity: 0; transform: scale(0.6); }
  70% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tfs-sparkle {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  35% { opacity: 1; transform: scale(1) rotate(45deg); }
  100% { opacity: 0; transform: scale(0.2) rotate(90deg); }
}
@keyframes tfs-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.55); } }

@media (prefers-reduced-motion: reduce) {
  .tf-shop,
  .tf-shop *,
  .tf-shop *::before,
  .tf-shop *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tf-shop .tfs-spin,
  .tf-shop .tfs-step.is-active .tfs-step-mark { animation: none !important; border-style: dotted; }
  .tf-shop .tfs-spark { animation: none !important; opacity: 0.85; }
  .tf-shop .tfs-card:hover .tfs-twinkle,
  .tf-shop .tfs-card:focus-within .tfs-twinkle { animation: none !important; }
  .tf-shop .tfs-card:hover,
  .tf-shop .tfs-card:focus-within { transform: none; }
}

/* Windows high contrast: gradient text would vanish, so it goes back to plain text. */
@media (forced-colors: active) {
  .tf-shop .tfs-goldtext { background: none; -webkit-text-fill-color: currentColor; filter: none; }
  .tf-shop .tfs-btn { border: 1px solid ButtonText; }
}

/* ---------------------------------------------------------------------------
   PRINT: with an invoice on screen (tf-shop.js puts body.tf-shop-printing on), the invoice is
   the only thing on the paper, in black ink on white.
   --------------------------------------------------------------------------- */
@media print {
  html.tf-shop-printing,
  body.tf-shop-printing {
    height: auto !important;
    overflow: visible !important;
    background: #FFFFFF !important;
  }
  body.tf-shop-printing::before,
  body.tf-shop-printing::after,
  body.tf-shop-printing > :not(.tf-shop) { display: none !important; }
  body.tf-shop-printing .tf-shop {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    background: none !important;
    color: #000000 !important;
    animation: none !important;
  }
  body.tf-shop-printing .tf-shop .tfs-panel,
  body.tf-shop-printing .tf-shop .tfs-stage,
  body.tf-shop-printing .tf-shop .tfs-body,
  body.tf-shop-printing .tf-shop .tfs-view {
    display: block !important;
    position: static !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    animation: none !important;
  }
  body.tf-shop-printing .tf-shop .tfs-proto,
  body.tf-shop-printing .tf-shop .tfs-head,
  body.tf-shop-printing .tf-shop .tfs-layer,
  body.tf-shop-printing .tf-shop .tfs-noprint,
  body.tf-shop-printing .tf-shop .tfs-sr,
  body.tf-shop-printing .tf-shop .tfs-defs { display: none !important; }
  body.tf-shop-printing .tf-shop .tfs-invoice {
    max-width: none;
    margin: 0;
    border: 1px solid #777777;
    border-radius: 0;
    background: #FFFFFF !important;
    box-shadow: none;
    color: #000000;
  }
  body.tf-shop-printing .tf-shop .tfs-invoice * { color: #000000 !important; border-color: #777777 !important; }
  body.tf-shop-printing .tf-shop .tfs-watermark { color: rgba(0, 0, 0, 0.08) !important; }
}
