/* Store-specific layer on top of vendor/theme.css, which owns the JeffNet
   tokens and both themes. Nothing here hardcodes a colour: every value is a
   token, so light and dark stay in step. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 16px 72px; }
.wrap.narrow { max-width: 640px; }
@media (min-width: 640px) { .wrap { padding: 32px 24px 80px; } }

h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 28px 0 8px; }
.hero p { margin: 0 0 28px; color: var(--muted); max-width: 60ch; }
.blurb { color: var(--muted); margin: 6px 0; }
.hint { color: var(--muted); font-weight: 400; font-size: 14px; }
.empty { color: var(--muted); }

/* Every interactive element keeps a visible ring. Never remove this. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible, pre:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- storefront ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius, 14px); padding: 20px; color: inherit; text-decoration: none;
  box-shadow: var(--shadow, none);
  transition: border-color .18s ease-out, transform .18s ease-out;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card h2 { margin: 10px 0 6px; font-size: 19px; }
.card ul, .bullets { margin: 12px 0; padding-left: 18px; color: var(--muted); }
.price {
  display: block; margin-top: 14px; font-size: 22px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.badge {
  display: inline-block; font-size: 12px; color: var(--accent-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.back { color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 16px; padding: 6px 0; }
.back:hover { color: var(--ink); }

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.form label { margin-top: 14px; font-weight: 600; font-size: 14px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }

input, select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; color: var(--ink); font: inherit; width: 100%;
  min-height: 44px;                     /* touch target */
}
textarea { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--faint); }

button { font: inherit; cursor: pointer; }
.buy {
  margin-top: 14px; background: var(--accent); border: 0; border-radius: 10px;
  padding: 14px 18px; color: #fff; font-weight: 700; min-height: 48px;
  transition: filter .15s ease-out;
}
.buy:hover { filter: brightness(1.08); }
.buy:active { filter: brightness(.94); }
.buy[disabled] { opacity: .5; cursor: not-allowed; }
.linkish {
  background: none; border: 0; color: var(--accent); text-decoration: underline;
  padding: 10px 4px; min-height: 44px;
}

/* Errors sit against the field they belong to, never only at the top. */
.error, .field-error { color: var(--danger); font-size: 14px; margin: 6px 0 0; }
.warn {
  background: var(--accent-soft); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 10px; padding: 12px; margin: 18px 0 8px; font-size: 14px;
}

/* ---- receipt: the command is the loudest thing on the page ---- */
.command { margin-top: 8px; }
.paste {
  background: var(--code-bg); border: 2px solid var(--accent);
  border-radius: 12px; padding: 16px; margin: 10px 0;
  font-family: var(--mono, ui-monospace, monospace); font-size: 15px; line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;                /* never a horizontal scrollbar on a phone */
  word-break: break-all;
  user-select: all;
}
.command .buy { width: 100%; }
/* The countdown must not reflow as digits change. */
.command .hint { font-variant-numeric: tabular-nums; display: inline-block; margin-top: 8px; }
details.help { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
details.help summary { cursor: pointer; color: var(--muted); padding: 8px 0; min-height: 44px; }
details.help .paste { border-width: 1px; border-color: var(--line); font-size: 14px; }

/* ---- admin ---- */
.adminbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.adminbar h1 { margin: 0; font-size: 24px; }
.adminbar .linkish { margin-left: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 12px 14px; min-height: 44px; font-weight: 600;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel > p { border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
#order-list p { font-variant-numeric: tabular-nums; font-size: 14px; }

@media (max-width: 380px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .paste { font-size: 14px; padding: 12px; }
}

/* ---------- purchase flow ---------- */

/* A stressed buyer needs to know where they are and what is left. */
.steps {
  display: flex; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.steps li { display: flex; align-items: center; gap: 7px; }
.steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--line); margin-right: 7px; }
.steps .n {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.steps [aria-current="step"] { color: var(--ink); font-weight: 600; }
.steps [aria-current="step"] .n { border-color: var(--accent); color: var(--accent); }
/* Not colour alone: completed steps also carry a tick. */
.steps .done { color: var(--ink); }
.steps .done .n { background: var(--ok); border-color: var(--ok); color: #04140d; }
.steps .done .n::after { content: "\2713"; }
.steps .done .n { font-size: 0; }
.steps .done .n::after { font-size: 13px; }

/* Price and action read as one decision, and stay reachable on a phone. */
.paybar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.paybar-price { display: flex; flex-direction: column; line-height: 1.25; }
.paybar-price strong { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--ink); }
.paybar .buy { flex: 1 1 220px; margin-top: 0; }
.reassure { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.receipt-head { margin-bottom: 18px; }
.receipt-head h1 { font-size: clamp(22px, 4.5vw, 30px); }
.ref { font-variant-numeric: tabular-nums; letter-spacing: .08em; color: var(--ink); }

/* Waiting states should look alive, not broken. */
.skeleton { color: var(--muted); }
.skeleton::after {
  content: ""; display: inline-block; width: 1.1em; text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; content: "…"; } }

/* Status banners: icon/word carries the meaning, colour only reinforces it. */
.status { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px; }
.status.paid { border-left: 3px solid var(--ok); }
.status.waiting { border-left: 3px solid var(--accent); }
.status.held { border-left: 3px solid var(--amber); }
.status strong { display: block; }
.status p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 380px) {
  .steps { font-size: 12px; gap: 6px; }
  .steps li + li::before { width: 8px; margin-right: 5px; }
  .paybar .buy { flex-basis: 100%; }
}
