/* ─────────────────────────────────────────────────────────────────────────
   A small shop that sells a few similar things.

   Everything here is built around that. No search, no filters, no category
   tree: with a handful of products those make a shop look empty rather than
   organised. Instead the catalogue is one page, the photos are large, and the
   path to paid is four screens.

   No external fonts, no CDN, no trackers. The whole file is served from this
   box, which is what lets the content security policy stay 'self' only.
   ───────────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────────
   [hidden] MUST WIN. This is not a tidy-up, it is a bug fix.

   The UA stylesheet gives [hidden] display:none, but ANY explicit display
   rule beats it, and .pop-backdrop below sets display:grid. So the discount
   popup could never be closed: app.js set pop.hidden = true, the attribute
   landed, and the element stayed on screen because the grid rule outranked
   it. Every button on the page was behind that backdrop, which is why the
   whole site read as broken rather than just the popup.

   Declared first and with !important so no later display rule can take the
   close button away again.
   ───────────────────────────────────────────────────────────────────────── */
[hidden] {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   THE PALETTE

   Three of them. The shop wears whichever one is named on <html data-theme>
   in web/render.js, so switching the entire look is one word in one file.

   The old palette was slate-blue with a teal accent, which is the default
   dark dashboard look every developer tool ships with. It read as generic
   because it IS generic. These three are each committed to something.

     ember   warm near-black, brass and amber. Boutique, expensive, calm.
             Warmth makes product photos look appetising rather than clinical.
     citrus  true black with electric lime. Streetwear, loud, young.
     slate   the original cold teal, kept so nothing is lost.

   Only colour tokens live in each theme. Radius, shadow, width and easing
   are shared below, so the three cannot drift apart structurally.
   ───────────────────────────────────────────────────────────────────────── */

:root,
:root[data-theme='ember'] {
  --bg: #0f0b09;
  --bg-soft: #17110d;
  --card: #1e1711;
  --card-hover: #271d15;
  --line: #3a2c20;
  --text: #f7efe6;
  --muted: #c0ab96;
  --dim: #8a7968;
  --brand: #f0b357;
  --brand-deep: #d8963a;
  --brand-ink: #241705;
  --warn: #e8a33d;
  --bad: #e5736b;
  --good: #7fc08a;
}

:root[data-theme='citrus'] {
  --bg: #07080a;
  --bg-soft: #0e1014;
  --card: #14171c;
  --card-hover: #1b1f26;
  --line: #262b34;
  --text: #f2f5f8;
  --muted: #9aa5b4;
  --dim: #6b7585;
  --brand: #c3f53c;
  --brand-deep: #a5d81f;
  --brand-ink: #10180a;
  --warn: #f5c93c;
  --bad: #ff7a6b;
  --good: #5fd98a;
}

:root[data-theme='slate'] {
  --bg: #0b0c0f;
  --bg-soft: #12141a;
  --card: #161922;
  --card-hover: #1c2029;
  --line: #252a36;
  --text: #eef1f7;
  --muted: #9aa3b4;
  --dim: #6b7385;
  --brand: #5eead4;
  --brand-deep: #2dd4bf;
  --brand-ink: #04211d;
  --warn: #fbbf24;
  --bad: #f87171;
  --good: #4ade80;
}

/* Shared across every theme. */
:root {
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* A light theme for anyone whose device asks for one. The shop should not
   burn someone's eyes at 8am because we preferred dark. */
@media (prefers-color-scheme: light) {
  :root,
  :root[data-theme='ember'],
  :root[data-theme='citrus'],
  :root[data-theme='slate'] {
    --bg: #f7f8fa;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-hover: #fbfcfe;
    --line: #e4e8ef;
    --text: #10131a;
    --muted: #5b6474;
    --dim: #858da0;
    --brand: #0d9488;
    --brand-deep: #0f766e;
    --brand-ink: #ffffff;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── header ─────────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
.brand {
  font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.brand span { color: var(--brand); }

.nav-link { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }

.bag-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); padding: 9px 15px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.bag-btn:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.bag-count {
  background: var(--brand); color: var(--brand-ink);
  min-width: 21px; height: 21px; border-radius: 999px;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 800; padding: 0 6px;
}
.bag-btn.bump { animation: bump 0.45s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ── hero ───────────────────────────────────────────────────────────── */
.hero { padding: 68px 0 44px; text-align: center; }
.hero h1 {
  margin: 0 0 14px; font-size: clamp(30px, 6vw, 48px);
  line-height: 1.1; letter-spacing: -0.03em; font-weight: 800;
}
.hero p { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 17px; }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 26px;
}
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px;
  font-size: 13.5px; color: var(--muted); font-weight: 500;
}

/* ── product grid ───────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 40px 0 18px;
}
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.section-head .count { color: var(--dim); font-size: 14px; }

.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
/* With only a few products, a 4-up grid leaves them stranded. Cap the columns
   so three items still look like a considered range and not a gap. */
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: rise 0.5s var(--ease) both;
}
.card:hover {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: var(--shadow); text-decoration: none;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5) { animation-delay: 0.24s; }
.card:nth-child(6) { animation-delay: 0.3s; }

.card-img {
  aspect-ratio: 4 / 3; background: var(--bg-soft);
  display: grid; place-items: center; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card-img img { transform: scale(1.05); }
.card-img .placeholder { color: var(--dim); font-size: 40px; }

.card-body { padding: 16px 17px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-name { font-weight: 650; font-size: 16.5px; letter-spacing: -0.01em; color: var(--text); }
.card-blurb { color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.price { font-weight: 750; font-size: 18px; letter-spacing: -0.02em; }

.stock { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.stock.in { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.stock.low { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.stock.out { color: var(--dim); background: color-mix(in srgb, var(--dim) 14%, transparent); }

/* ── buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink);
  border: 1px solid transparent; border-radius: 11px;
  padding: 13px 22px; font-size: 15.5px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn[disabled], .btn.is-disabled {
  background: var(--card); color: var(--dim); border-color: var(--line);
  cursor: not-allowed; transform: none; filter: none;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.wide { width: 100%; }
.btn.sm { padding: 9px 15px; font-size: 14px; border-radius: 9px; }

/* ── product page ───────────────────────────────────────────────────── */
.product { display: grid; gap: 34px; padding: 34px 0 20px; }
@media (min-width: 820px) { .product { grid-template-columns: 1.05fr 1fr; align-items: start; } }
.product-media {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft);
  aspect-ratio: 4 / 3; display: grid; place-items: center;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { margin: 0 0 8px; font-size: clamp(25px, 4vw, 34px); letter-spacing: -0.025em; }
.product .price-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 20px; }
.product .price-row .price { font-size: 27px; }
.desc { color: var(--muted); line-height: 1.7; }
.desc b, .desc strong { color: var(--text); }

.qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  background: var(--card);
}
.qty button {
  background: none; border: 0; color: var(--text); font-size: 19px;
  width: 42px; height: 46px; cursor: pointer; font-family: inherit;
  transition: background 0.15s var(--ease);
}
.qty button:hover { background: var(--card-hover); }
.qty input {
  width: 46px; height: 46px; text-align: center; background: none;
  border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--text); font: inherit; font-weight: 650;
}
.buy-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.buy-row .btn { flex: 1; min-width: 180px; }

/* ── bag & checkout ─────────────────────────────────────────────────── */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
}
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -0.015em; }

.line {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: 0; }
.line-img {
  width: 62px; height: 62px; border-radius: 11px; overflow: hidden;
  background: var(--bg-soft); flex: none; display: grid; place-items: center;
}
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-weight: 600; font-size: 15.5px; }
.line-meta { color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.line-price { font-weight: 700; white-space: nowrap; }

.totals { margin-top: 6px; }
.totals .row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; color: var(--muted); font-size: 15px;
}
.totals .row.grand {
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px;
  color: var(--text); font-size: 19px; font-weight: 750;
}
.totals .row.save { color: var(--good); }

.steps { display: flex; gap: 8px; margin: 26px 0 22px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 74px; text-align: center;
  font-size: 12.5px; font-weight: 600; color: var(--dim);
  padding-top: 11px; border-top: 2px solid var(--line);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.step.done { color: var(--muted); border-top-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.step.now { color: var(--brand); border-top-color: var(--brand); }

label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 7px; }
.hint { color: var(--dim); font-size: 13px; font-weight: 400; margin-top: 6px; }
input[type=text], input[type=number], textarea, select {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 14px; font: inherit;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.field + .field { margin-top: 16px; }
textarea { min-height: 92px; resize: vertical; }

.choice {
  display: flex; gap: 13px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; cursor: pointer; background: var(--bg-soft);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.choice:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.choice + .choice { margin-top: 11px; }
.choice input { margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.choice-main { flex: 1; }
.choice-name { font-weight: 640; }
.choice-desc { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.choice-price { font-weight: 700; white-space: nowrap; }
.choice:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--bg-soft));
}

/* ── payment ────────────────────────────────────────────────────────── */
.pay-grid { display: grid; gap: 24px; }
@media (min-width: 780px) { .pay-grid { grid-template-columns: 300px 1fr; align-items: start; } }
.qr {
  background: #fff; padding: 16px; border-radius: var(--radius-lg);
  display: grid; place-items: center;
}
.qr img { width: 100%; max-width: 268px; }
.copybox {
  display: flex; gap: 9px; align-items: stretch; margin-top: 9px;
}
.copybox code {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 11px; padding: 13px 14px;
  font: 13.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all; color: var(--text);
}
.copy-btn {
  flex: none; background: var(--card); border: 1px solid var(--line);
  color: var(--text); border-radius: 11px; padding: 0 15px;
  cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.copy-btn:hover { border-color: var(--brand); }
.copy-btn.done { color: var(--good); border-color: var(--good); }

.pay-status {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 17px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 14.5px; margin-top: 18px;
}
.pulse {
  width: 10px; height: 10px; border-radius: 999px; flex: none;
  background: var(--warn); animation: pulse 1.7s ease-in-out infinite;
}
.pulse.paid { background: var(--good); animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

/* ── notices ────────────────────────────────────────────────────────── */
.notice {
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 14.5px; line-height: 1.55; margin-bottom: 18px;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.notice.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--bg-soft)); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--bg-soft)); }
.notice.good { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: color-mix(in srgb, var(--good) 8%, var(--bg-soft)); }

/* ── the discount popup ─────────────────────────────────────────────── */
.pop-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2, 4, 8, 0.62);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fade 0.25s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pop {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-width: 400px; width: 100%; padding: 30px 28px 26px;
  text-align: center; position: relative;
  animation: pop 0.4s var(--ease);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.pop h3 { margin: 0 0 9px; font-size: 22px; letter-spacing: -0.02em; }
.pop p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.pop .code {
  display: inline-block; font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.09em; background: var(--bg-soft);
  border: 1px dashed var(--brand); color: var(--brand);
  padding: 14px 22px; border-radius: 11px; margin-bottom: 20px;
}
.pop-close {
  position: absolute; top: 11px; right: 13px;
  background: none; border: 0; color: var(--dim);
  font-size: 25px; line-height: 1; cursor: pointer; padding: 5px;
}
.pop-close:hover { color: var(--text); }

/* ── toast ──────────────────────────────────────────────────────────── */
.toast-host { position: fixed; left: 0; right: 0; bottom: 22px; z-index: 95; display: grid; justify-items: center; gap: 9px; pointer-events: none; }
.toast {
  background: var(--card); border: 1px solid var(--brand); color: var(--text);
  padding: 12px 19px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: toast 0.35s var(--ease);
}
@keyframes toast { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── reviews ────────────────────────────────────────────────────────── */
.review { padding: 15px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.stars { color: var(--warn); letter-spacing: 2px; font-size: 14px; }
.review-text { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.review-who { margin-top: 5px; color: var(--dim); font-size: 12.5px; }

/* ── footer ─────────────────────────────────────────────────────────── */
.site-foot {
  margin-top: 70px; border-top: 1px solid var(--line);
  padding: 34px 0 46px; color: var(--dim); font-size: 14px;
}
.site-foot .wrap { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: var(--muted); }
.site-foot .spacer { margin-left: auto; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 14px; }

/* Anyone who has asked their device to calm down gets a still page. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   THE PAGES A WEBSITE NEEDS THAT A BOT DID NOT

   In Telegram the chat is the account: the order history, the referral
   screen and support are all just messages. On a website none of that
   exists, so three pages have to carry it. Everything below reuses the
   palette and the .line row above rather than inventing a second look.
   ───────────────────────────────────────────────────────────────────────── */

/* Your orders. The .line row, made clickable. */
a.order-line {
  text-decoration: none;
  color: inherit;
  transition: background var(--ease), border-color var(--ease);
}
a.order-line:hover {
  background: var(--card-hover);
  border-color: var(--brand-deep);
}
a.order-line .line-img {
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--bg-soft);
}
a.order-line .line-meta code {
  color: var(--text);
}

/* The referral ladder. Reached rungs read as done, the rest as waiting, so
   there is always a visible next step instead of an abstract balance. */
.ladder {
  list-style: none;
  margin: 12px 0 24px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ladder li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
}
.ladder li.done {
  border-color: var(--brand-deep);
  background: var(--card-hover);
  color: var(--text);
}
.ladder li b {
  color: var(--text);
}
.ladder .tick {
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
}

/* Support. A conversation, so it should look like one: the customer on one
   side, the shop on the other, rather than a flat log. */
.thread {
  display: grid;
  gap: 10px;
  margin: 16px 0 24px;
}
.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.msg-who {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}
.msg-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.msg.from-you {
  justify-self: end;
  border-color: var(--brand-deep);
  background: var(--card-hover);
}
.msg.from-shop {
  justify-self: start;
}

@media (max-width: 520px) {
  .msg { max-width: 100%; }
}

/* The support box, and any other long-form field these pages add. */
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  margin: 6px 0 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 120px;
}
textarea:focus {
  outline: none;
  border-color: var(--brand-deep);
}
label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   MOBILE. MEASURED, NOT EYEBALLED.

   Most shoppers arrive on a phone, so these were found by rendering the
   real pages at 320, 360, 390 and 768 and measuring, rather than by
   looking at the layout and deciding it seemed fine.

   Three real faults came out of it:

   1. HORIZONTAL OVERFLOW AT 320px. .site-head .wrap is a single flex row
      with a fixed 64px height and no wrapping. Brand + three nav links +
      the bag button do not fit on an iPhone SE, so the page scrolled
      sideways by 3px and the bag button hung off the right edge. The
      toast host then measured 3px over too, because right:0 resolves
      against the scroll width, so that was a symptom and not a second bug.

   2. TAP TARGETS AROUND 22px TALL. Every nav and footer link. Apple and
      Google both say roughly 44px; 22px is a mis-tap, and a mis-tap on a
      buy button is a lost sale.

   3. The same applied to the brand and the back link.

   The header fix is not "make it smaller", it is to stop asking a 320px
   bar to hold five things. On a phone the header carries the shop name
   and the bag, which is what someone actually needs while shopping, and
   the nav lives in the footer where it already was anyway.
   ───────────────────────────────────────────────────────────────────────── */

/* Belt and braces against sideways scroll. One stray wide element should
   degrade to a clipped element, never to a page that slides. */
html, body { max-width: 100%; overflow-x: hidden; }

/* THE HEADER. Nav links out of the bar below 560px. They are all present in
   the footer, so nothing becomes unreachable. */
@media (max-width: 560px) {
  .site-head .wrap { gap: 10px; }
  .site-head .nav-link { display: none; }
}

/* Let it wrap rather than overflow if a long shop name ever meets a narrow
   screen. height becomes a floor instead of a fixed value. */
.site-head .wrap {
  flex-wrap: wrap;
  height: auto;
  min-height: 64px;
  row-gap: 0;
}

/* The bag button must never be the thing that gets squeezed off the edge. */
.bag-btn { flex: 0 0 auto; margin-left: auto; }
.brand { min-width: 0; overflow-wrap: anywhere; }

/* TOUCH TARGETS. Scoped to pointer:coarse so a mouse keeps the tighter,
   better-looking desktop density. This is the whole reason it is a media
   query and not a blanket rule. */
@media (pointer: coarse) {
  .nav-link,
  .site-foot a,
  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .nav-link { padding: 0 2px; }

  /* Footer links sit in a row; give them room without stretching the bar. */
  .site-foot .wrap { row-gap: 2px; }

  /* Links inside prose cannot be 44px tall without breaking the line, but
     they can be comfortably thicker than 17px. */
  p a, .hint a, .line-meta a { padding: 6px 0; display: inline-block; }

  /* Anything that looks like a button genuinely must clear 44. */
  .btn, .copy-btn, .qty button, button[type='submit'] { min-height: 44px; }

  /* Inputs too: a 30px field is a fiddly tap and iOS zooms a <16px field,
     which then leaves the page scrolled sideways. 16px prevents the zoom. */
  input, select, textarea { min-height: 44px; font-size: 16px; }
  textarea { min-height: 120px; }
}

/* The popup has to fit a 320px screen with the close button reachable. */
@media (max-width: 380px) {
  .pop { padding: 26px 18px 20px; }
  .pop .code { font-size: 20px; overflow-wrap: anywhere; }
}

/* Long unbroken strings are the other classic phone overflow: a crypto
   address, an order code, a referral link. They must wrap, not push. */
.copybox { flex-wrap: wrap; }
.copybox code { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
code { overflow-wrap: anywhere; }

/* ─────────────────────────────────────────────────────────────────────────
   UTILITIES, BECAUSE THE CSP FORBIDS INLINE STYLES

   The Content-Security-Policy on every response is style-src 'self' with no
   'unsafe-inline'. That blocks style="..." attributes, which means the 49
   inline styles this markup used to carry were NEVER APPLIED in any browser.
   Headings fell back to default sizes and spacing collapsed, which is a good
   part of why the shop looked unstyled rather than designed.

   The fix is these classes, not 'unsafe-inline' in the policy. A shop that
   takes crypto payments should not loosen its CSP to save a few keystrokes,
   and inline styles in server-rendered HTML were a smell regardless.

   Named for the spacing scale rather than the pixel value, so the rhythm can
   be retuned in one place instead of across three files.
   ───────────────────────────────────────────────────────────────────────── */
.mt-s  { margin-top: 11px; }
.mt-m  { margin-top: 17px; }
.mt-l  { margin-top: 22px; }
.mt-xl { margin-top: 30px; }
.mb-xs { margin: 0 0 5px; }
.mb-s  { margin: 0 0 8px; }
.mb-m  { margin: 0 0 15px; }
.mb-l  { margin: 0 0 22px; }
.m0    { margin: 0; }

/* The section heading this markup kept hand-rolling. One class, so every
   section on the site finally agrees on its own type scale. */
.lede {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
.sub {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.t-strong { color: var(--text); }
.t-muted  { color: var(--muted); }
.t-bad    { color: var(--bad); }
.t-dim-normal { font-weight: 400; color: var(--dim); }
.small    { font-size: 15px; }
.pre      { white-space: pre-wrap; }
.center   { text-align: center; }
.full     { max-width: 100%; }
.narrow   { max-width: 420px; margin-inline: auto; }
.glyph    { font-size: 60px; line-height: 1; }
.row-inline { display: flex; gap: 9px; align-items: center; }
.quote { padding-left: 14px; border-left: 2px solid var(--line); }

@media (max-width: 420px) {
  .lede { font-size: 23px; }
  .glyph { font-size: 48px; }
}

/* Referenced by the markup but never defined, so they rendered as nothing.
   .dim is the quietest text tier, below .t-muted; .full is the opt-in
   full-bleed for a page that sets wide. */
.dim { color: var(--dim); }

/* ── branding: logo, seasonal banner, home picture (web/branding.js) ── */
/* Logo and name side by side on one line, centred, never stacked. A very long
   name is cut with an ellipsis rather than pushing the Bag button off-screen. */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.brand-logo { height: 34px; width: auto; max-width: 180px; object-fit: contain; flex: none; }
.brand .brand-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.announce { font-size: 0.95rem; }
.announce .wrap { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 9px 44px 9px 16px; text-align: center; }
.announce-text { font-weight: 640; color: inherit; text-decoration: none; }
a.announce-text:hover { text-decoration: underline; }
.announce-code { display: inline-flex; align-items: center; gap: 8px; }
.announce-code code { font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); }
.announce-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 4px 8px; border: 0; background: none; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: 0.8; }
.announce-x:hover { opacity: 1; }
.announce.is-closed { display: none; }
.announce-brand { background: var(--brand); color: var(--brand-ink); }
.announce-sale { background: #b3261e; color: #fff; }
.announce-calm { background: var(--bg-soft); color: var(--text); border-bottom: 1px solid var(--line); }
.announce-calm .announce-code code { background: var(--card); }
.announce-dark { background: #121417; color: #f3f4f6; }
.hero-pic { margin: 16px 0 8px; }
.hero-pic img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; border-radius: var(--radius-lg); }
@media (max-width: 520px) {
  .brand-logo { height: 28px; max-width: 120px; }
  .announce .wrap { padding-right: 40px; }
}

/* ── the order summary on the payment step (web/checkoutReview.js) ── */
/* Followed by the payment form, not by another .panel, so it needs its own gap. */
.order-review { margin-bottom: 16px; }
.order-review .rv-sec { padding: 12px 0; border-top: 1px solid var(--line); }
.order-review h2 + .rv-sec { border-top: 0; padding-top: 4px; }
.order-review .rv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.order-review .rv-head h3 { margin: 0; font-size: 0.95rem; font-weight: 640; color: var(--muted); }
.order-review .rv-head a { font-size: 0.9rem; }
.order-review p { margin: 0; }
.rv-lines { list-style: none; margin: 0; padding: 0; }
.rv-line { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.rv-thumb { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg-soft); }
.rv-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rv-price { white-space: nowrap; font-weight: 600; }
.rv-addr { white-space: pre-line; overflow-wrap: anywhere; }
