:root {
  color-scheme: light dark;
  --bg: #0A0A0F;
  --card: #161B22;
  --elev: #1C2128;
  --border: rgba(255, 255, 255, 0.08);
  --text: #E6EDF3;
  --muted: #9DA5AE;
  --accent: #5B9CF6;
  --gain: #10B981;
  --loss: #EF4444;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-decoration: none;
  border-radius: 4px;
}
.brand:hover {
  text-decoration: underline;
}
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.order-number {
  -webkit-appearance: none;
  appearance: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 4px 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.order-number::after {
  content: "";
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16H8V7h11v14z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16H8V7h11v14z'/></svg>") center / contain no-repeat;
  opacity: 0.55;
  transition: opacity 120ms ease;
}
.order-number:hover {
  color: var(--text);
}
.order-number:hover::after {
  opacity: 0.9;
}
.order-number:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.order-number.copied {
  color: var(--gain);
}
.order-number.copied::after {
  opacity: 1;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2l-3.5-3.6L4 14l5 5 11-11-1.4-1.4z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 16.2l-3.5-3.6L4 14l5 5 11-11-1.4-1.4z'/></svg>") center / contain no-repeat;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60vh;
  color: var(--muted);
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

h1 { font-size: 22px; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; color: var(--muted); }
p { margin: 0 0 12px; line-height: 1.5; color: var(--text); }
small { color: var(--muted); }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 14px;
  font-family: inherit;
  margin-bottom: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
input:disabled, input.locked {
  /* Seller pre-filled this — keep the value readable but visually
     muted so the buyer recognises it as read-only at a glance. */
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #9aa1ad);
  cursor: not-allowed;
}

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
  font-family: inherit;
  min-height: 52px;
}
button:disabled { opacity: 0.5; cursor: progress; }
button.secondary {
  background: var(--elev);
  color: var(--text);
  border: 1px solid var(--border);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 14px;
  padding: 8px 0;
  min-height: 0;
  width: auto;
}

.line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.line:last-child { border-bottom: none; }
.line .name { color: var(--text); }
.line .price { color: var(--muted); font-variant-numeric: tabular-nums; }
.total { font-size: 22px; font-weight: 700; }

/* Vertical list of payment-method rows. Each row is a tappable
   card. When the seller pre-filled a handle for the method, the
   row embeds the "Send to X" panel inline so the buyer sees the
   destination at a glance — no separate panel to hunt for. */
.method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.method-row {
  position: relative;
  background: var(--elev);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  outline: none;
}
.method-row:hover { border-color: rgba(91, 156, 246, 0.45); }
.method-row:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 156, 246, 0.3);
}
.method-row:active { transform: scale(0.99); }
.method-row.active {
  background: rgba(91, 156, 246, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.method-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.method-row-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.method-row-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  color: transparent;
  background: transparent;
  flex: 0 0 22px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.method-row.active .method-row-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
/* The inline handle panel inside a method row drops its outer
   border (the row already has one) and tightens spacing so the
   row reads as a single unit. */
.method-row .method-row-handle.handle-panel-card {
  border: 0;
  background: transparent;
  margin-top: 10px;
  padding: 0;
}
.method-row .method-row-handle .handle-panel-tip {
  margin-top: 6px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.method-grid button {
  position: relative;
  background: var(--elev);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  padding: 16px 12px;
  min-height: 56px;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.method-grid button:hover {
  border-color: rgba(91, 156, 246, 0.45);
}
.method-grid button:active { transform: scale(0.98); }
.method-grid button.active {
  background: rgba(91, 156, 246, 0.12);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.method-grid button.active::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}

/* "More ways to pay" expander — clearly tappable. Themed as a
   compact secondary button so the buyer can spot it without it
   competing with the preferred payment cards above. */
.more-methods {
  margin: 4px 0 12px;
}
.more-methods-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px dashed rgba(91, 156, 246, 0.55);
  border-radius: 10px;
}
.more-methods-toggle:hover {
  background: rgba(91, 156, 246, 0.08);
  border-color: var(--accent);
}
.more-methods-text { line-height: 1; }
.more-methods-chevron {
  font-size: 12px;
  line-height: 1;
  color: var(--accent);
}
.more-methods-grid {
  margin-top: 10px;
}

.seller-note {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}
.seller-note strong {
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
}

.disclaimer {
  background: rgba(91, 156, 246, 0.08);
  border: 1px solid rgba(91, 156, 246, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* One-line subhead under the Payment step's h1. Replaces the older
   "First, ... Then, ..." paragraph; same role (sets expectations for
   the screen) without the wall-of-text feel. */
.payment-subhead {
  margin: 4px 0 18px;
  font-size: 14px;
  line-height: 1.5;
}

/* Single hoisted "how to pay" block under the Payment step's h1.
   Replaces the per-method tip that used to live inside every handle
   panel ("Use the exact destination above… tap I paid below.") — now
   the buyer reads the instructions once and the method rows below
   stay visually quiet. Soft accent so it reads as the screen's
   primary guidance, not a warning. */
.payment-instructions {
  margin: 8px 0 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(91, 156, 246, 0.06);
  border: 1px solid rgba(91, 156, 246, 0.25);
}
.payment-instructions-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.payment-instructions-fineprint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* "Important" safety note used on the high-risk steps (payment,
   in-person handoff, shipping address, package receipt). Sellers
   reported buyers were missing the older calm-tip styling — the
   uppercase eyebrow label read as decoration. This variant keeps
   the same warm tint (so it still reads as a tip, not an error)
   but bumps contrast, font size, and gives it a full border so it
   visibly separates from the surrounding card. Pulled into its own
   pattern (not reusing .disclaimer) because the disclaimer carries
   the brand/legal note above it; stacking two identical-looking
   blocks blurs both. */
.safety-note {
  display: block;
  margin: 14px 0 18px;
  padding: 14px 16px 14px 18px;
  border-radius: 12px;
  background: rgba(255, 196, 81, 0.10);
  border: 1px solid rgba(255, 196, 81, 0.35);
  border-left: 4px solid rgba(255, 196, 81, 0.85);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.safety-note-title {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(255, 210, 120, 1);
}
.safety-note-body {
  display: block;
  color: var(--text);
}

/* Expiry chip — rendered above the summary card while the order is in
   `awaitingBuyerInfo`. Calm by default (muted text, no border) so it
   reads as information, not a warning. Escalates to amber at <=48h
   and red at <=6h. Tone-matched to the dark theme tokens. */
.expiry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.expiry-chip-wrap {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}
.expiry-chip-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: currentColor;
}
.expiry-chip.warn {
  background: rgba(255, 196, 81, 0.10);
  color: rgba(255, 210, 120, 1);
}
.expiry-chip.urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
}
.expiry-chip-hint {
  display: block;
  max-width: 360px;
  margin: 6px auto 0;
  padding: 0 12px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .expiry-chip.urgent {
    animation: expiry-pulse 2.4s ease-in-out infinite;
  }
}
@keyframes expiry-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

.trust {
  max-width: 480px;
  margin: 24px auto;
  padding: 0 16px;
  text-align: center;
}
.trust p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.trust p:last-child { margin-bottom: 0; }
/* Link-expiry policy line. Surfaces the page TTL on every step (the
   footer is global, outside #root) so the buyer can see at a glance
   how long this view sticks around — no surprise when it 404s later.
   Quieter than the trust copy above it so it reads as fine-print
   policy, not a primary message. */
.trust-expiry {
  font-size: 11px;
  opacity: 0.85;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

/* Hero header — orients the buyer the moment the page opens. */
.hero {
  max-width: 480px;
  margin: 16px auto 0;
  padding: 0 16px;
  text-align: center;
}
.hero-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.hero-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

/* A7: honor-system banner pinned above the topbar. */
.honor-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(91, 156, 246, 0.12);
  border-bottom: 1px solid var(--border);
}
.honor-banner-text {
  margin: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.honor-banner-close {
  flex: 0 0 auto;
  /* Override the global `button { width: 100% }` rule — without this the
     button claims the banner's full width as its flex-basis and refuses
     to shrink, squeezing the message into a one-word-per-line column. */
  width: auto;
  padding: 6px 14px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.honor-banner-close:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

/* Legacy step pill — kept for any older render path. */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}
.step-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 10px;
}
.step-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Multi-pill stepper. Shows every step at once with checkmarks on
   done ones; done steps are tappable for read-only re-view. */
.stepper {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper .step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  min-height: 0;
  width: auto;
}
.stepper .step.done {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--text);
  cursor: pointer;
}
.stepper .step.done:hover {
  background: rgba(16, 185, 129, 0.2);
}
.stepper .step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.stepper .step.todo {
  opacity: 0.55;
}
.stepper .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
}
.stepper .step.done .step-num {
  background: #10B981;
  color: #fff;
}
.stepper .step.active .step-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.stepper .step-name { font-size: 12px; }

/* Read-only review modal for done steps. */
.step-review-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  padding: 16px;
}
.step-review {
  width: 100%; max-width: 480px;
  margin: 0;
  position: relative;
  max-height: 80vh; overflow-y: auto;
}
.step-review-close {
  position: absolute; top: 10px; right: 10px;
  font-size: 13px;
}
.step-review-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}
.step-review-foot { margin-top: 12px; }

/* "I paid" confirmation modal — opened when the buyer taps the
   primary CTA on the Payment step. Centered, compact, and reuses
   the .safety-note pattern inside so the dialog re-surfaces the
   exact same warning the buyer scrolled past at the top of the
   step. The whole point is to make the irreversible moment
   unmissable; the modal is mounted on document.body so the
   summary card and form sit behind a dimmed backdrop. */
.ipaid-confirm-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 16px;
  animation: ipaid-fade-in 0.18s ease-out;
}
.ipaid-confirm {
  width: 100%; max-width: 440px;
  margin: 0;
  padding: 22px 22px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.ipaid-confirm-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}
/* Calm body text inside the modal — no colored callout (the modal is
   the callout). Sits on a subtly elevated surface so it visually
   separates from the title and actions without competing with them. */
.ipaid-confirm-body {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.ipaid-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ipaid-confirm-actions button {
  width: 100%;
  margin: 0;
}
@keyframes ipaid-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Helpful inline hint, no left-bar emphasis (it isn't an error). */
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 12px;
}

/* Success card — subtle accent so the all-done screen feels different
   from the working states. */
.success-card {
  border-color: rgba(16, 185, 129, 0.4);
}

/* "Undo my I-paid claim" — a quiet but unmistakable secondary action.
   The previous ghost styling was too subtle and got missed. */
.undo-btn {
  font-size: 14px;
  font-weight: 500;
}

/* Back link at the top of step 2 — quiet, left-aligned.
   Retained for any legacy render paths; the live step 2 now uses
   the `.step-back-btn` button below the "I paid" CTA. */
.step-back {
  width: auto;
  padding: 6px 0;
  margin: -4px 0 8px;
  font-size: 13px;
  color: var(--accent);
  text-align: left;
}

/* "Edit your details" — clearer secondary button under the
   primary "I paid" submit. Honors the same min-height as primaries
   so it reads as a tappable action, not body text. */
.step-back-btn {
  margin-top: 12px;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Inline back-arrow glyph for the "Edit your details" button so the
   affordance reads unambiguously as "go back" rather than "next step"
   (the button sits directly under the primary "I paid" submit). */
.step-back-arrow {
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
}

/* Inline form error — visible the moment the server replies. */
.form-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  color: #FCA5A5;
  font-size: 14px;
  line-height: 1.45;
}

/* Optional buyer-payment note (Other method only). */
.other-note {
  margin: 0 0 14px;
}
.other-note label {
  margin-top: 6px;
}

/* Delivery-choice selectable cards — click to highlight, then tap
   Confirm to submit. Prevents accidental commit. */
.choice-card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice-card:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.choice-card:hover { border-color: rgba(91, 156, 246, 0.5); }
.choice-card.active {
  border-color: var(--accent);
  background: rgba(91, 156, 246, 0.12);
}
.choice-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}
.choice-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── #14: inline delivery selector on the Payment step ───────────────
   Shares the payment card with the method list, so the choice cards
   are tighter than the legacy full-screen picker. Reuses .choice-card
   for visual consistency — same border/active treatment, just denser
   spacing and a divider so it reads as its own little section. */
.delivery-inline {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.delivery-inline h2,
.delivery-inline h3 {
  margin: 0 0 10px;
}
.delivery-inline .choice-card {
  padding: 12px;
  margin-bottom: 8px;
}
.delivery-inline .choice-card:last-of-type {
  margin-bottom: 0;
}
.delivery-inline .choice-title {
  font-size: 15px;
  margin-bottom: 2px;
}

/* Distinct, elegant delivery section on the Payment step. Replaces
   the earlier ".delivery-inline--secondary" treatment that styled
   delivery as a quiet follow-up — the new layout reads as its own
   labelled section (h2 heading + lead-in copy + choice cards + an
   optional inline ship-address form when "Ship to me" is picked) so
   the buyer can answer it without scanning past the payment list. */
.delivery-section {
  display: block;
  margin: 22px 0 18px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}
.delivery-section-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
}
.delivery-section-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.delivery-section .choice-card {
  padding: 14px;
  margin-bottom: 10px;
}
.delivery-section .choice-card:last-child {
  margin-bottom: 0;
}
.delivery-section .choice-title {
  font-size: 15px;
  margin-bottom: 2px;
}

/* Inline shipping-address form — expands directly under the "Ship to
   me" choice card on the Payment step. The connection to the choice
   above is reinforced by a left-side accent stripe and a soft
   elevated surface so the form clearly belongs to that pick. */
.ship-address-inline {
  margin: -4px 0 12px;
  padding: 14px 14px 16px;
  border-radius: 12px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  animation: ship-address-fade-in 0.18s ease-out;
}
.ship-address-inline-sub {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
/* Confirmation banner shown after the buyer picks "Use suggested" in
   the verify modal. Stays above the address fields until the buyer
   edits anything or moves on. Tuned to read as a success/info note,
   not an alarm — green-tinted, soft border, calm copy. */
.ship-address-updated {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(56, 176, 0, 0.10);
  border: 1px solid rgba(56, 176, 0, 0.38);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  animation: ship-address-fade-in 0.18s ease-out;
}
.ship-address-inline-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ship-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ship-field-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin: 0;
}
.ship-field input,
.ship-field select {
  margin: 0;
}
/* Native <select> styling — make sure the dropdown chevron is
   visible on iOS/Android. The platform supplies the chevron natively
   when -webkit-appearance is left at its default, but our global
   form-reset zeroed it; restore it here so the country/region
   dropdowns read unmistakably as dropdowns on every platform. */
.ship-field select {
  -webkit-appearance: menulist;
  appearance: menulist;
  background-image: linear-gradient(
    45deg,
    transparent 50%,
    var(--muted) 50%
  ), linear-gradient(
    135deg,
    var(--muted) 50%,
    transparent 50%
  );
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
@keyframes ship-address-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Google Places Autocomplete list under the street input. It sits
   in the page flow and pushes the fields below it down. It used to
   float over them, so tapping the City or ZIP field while it was open
   picked whichever suggestion covered that spot. */
.ship-autocomplete-wrap {
  position: relative;
}
.ship-autocomplete-list {
  position: static;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
/* Row class is owned by the reusable AddressAutocomplete widget
   (web/order/address-autocomplete.js → `row.className = "ac-suggestion"`).
   Style by that class so every form that drops the widget in picks
   up the same dropdown look without re-stating styles per form. */
.ac-suggestion {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.ac-suggestion:last-child {
  border-bottom: 0;
}
.ac-suggestion:hover,
.ac-suggestion:focus-visible {
  background: rgba(91, 156, 246, 0.10);
  outline: none;
}
/* Dismiss row at the TOP of the autocomplete dropdown so the buyer
   has a visible "I don't want any of these" affordance without
   having to find the right input gesture (blur on mobile is fiddly)
   or scroll past every suggestion to find it. Visually distinct
   from suggestion rows — muted, smaller, no hover tint — so it
   never looks like a pickable address. */
.ac-dismiss-row {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--elev);
}
.ac-dismiss-row:hover,
.ac-dismiss-row:focus-visible {
  color: var(--text);
  outline: none;
}

/* Searchable-select (combobox) widget — used by the country and the
   state/region fields on the ship-address form. Mirrors the address-
   autocomplete dropdown styles so country / region / street all feel
   like the same kind of picker. */
.ss-wrap {
  position: relative;
}
.ss-listbox {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.ss-option {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.ss-option:last-child {
  border-bottom: 0;
}
.ss-option:hover,
.ss-option--active {
  background: rgba(91, 156, 246, 0.14);
}
.ss-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Address verification modal. Opens on "I paid" when Google's
   Address Validation returns a non-confirmed verdict. Mirrors the
   ".ipaid-confirm" pattern (full-screen backdrop, centered card)
   so the two modal experiences feel like one family. */
.verify-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 16px;
  animation: ipaid-fade-in 0.18s ease-out;
}
.verify-modal {
  position: relative;
  width: 100%; max-width: 460px;
  margin: 0;
  padding: 22px 22px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
/* Corner × dismiss. Sized to clear the 44pt minimum tap target with a
   transparent hit area; the visible glyph stays compact so it doesn't
   compete with the title for attention. */
.verify-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.verify-modal-close:hover,
.verify-modal-close:focus-visible {
  color: var(--text);
  background: var(--elev);
  outline: none;
}
.verify-modal-title {
  margin: 0 24px 8px 0; /* leave space for the corner close button */
  font-size: 18px;
  color: var(--text);
}
.verify-modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
}
.verify-modal-addresses {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.verify-modal-address {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.verify-modal-address--recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.verify-modal-address-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 6px;
}
.verify-modal-address--recommended .verify-modal-address-title {
  color: var(--accent);
}
.verify-modal-address-line {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.verify-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verify-modal-actions button {
  width: 100%;
  margin: 0;
}

/* Legacy "secondary" variant retained for back-compat — older render
   paths (and a few tests) still reference it. Mirrors the new
   .delivery-section visuals so the screen looks consistent if either
   selector wins. */
.delivery-inline--secondary {
  margin: 18px 0 18px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
.delivery-inline--secondary h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1px;
  margin: 0 0 10px;
}

/* Transient "Finishing up…" card while we auto-finalize the buyer's
   delivery pick at `paid`. Centered, calm, matches .loading. */
.finalizing-card {
  text-align: center;
}
.finalizing-card .spinner {
  margin: 6px auto 14px;
}

/* ── Order summary line: compact thumb + name/qty + price ─────────
   Replaces the prior tap-to-expand row so the layout stays calm
   even with 100s of cards. The thumbnail is the only clickable
   element — it opens a lightbox over the whole page. */
.line-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.line-card:last-child { border-bottom: none; }

.line-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--elev);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.1s, box-shadow 0.15s;
}
.line-thumb:hover { box-shadow: 0 0 0 2px var(--accent); }
.line-thumb:focus { box-shadow: 0 0 0 2px var(--accent); }
.line-thumb:active { transform: scale(0.96); }
.line-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.line-thumb-fallback {
  cursor: default;
  font-size: 22px;
  color: var(--muted);
}
.line-thumb-fallback:hover { box-shadow: none; }

.line-mid {
  flex: 1;
  min-width: 0;
}
/* Holds the optional NEW badge alongside the card name on a single
   line. The name still truncates with ellipsis when the row is tight;
   the badge stays a fixed pill on the left. */
.line-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.line-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
/* Small accent pill on cards the seller added after the buyer's
   first view of the order. Quiet but clearly distinct — tonal accent
   fill, uppercase, tabular so multiple badges line up. */
.line-new-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(91, 156, 246, 0.18);
  border: 1px solid rgba(91, 156, 246, 0.55);
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1;
  text-transform: uppercase;
}
.line-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.line-price {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.line-toggle {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  min-height: 44px;
}
.line-show-more {
  margin: 12px 0;
}
.line-search {
  margin: 4px 0 10px;
}
.line-search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--elev);
  color: var(--text);
  min-height: 44px;
}
.line-search-input::placeholder { color: var(--muted); }
.line-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.line-empty {
  text-align: center;
  padding: 16px 0 8px;
}

/* ── Lightbox overlay for full-size card preview ──────────────── */
.image-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  z-index: 1000;
  animation: lightbox-fade 0.14s ease-out;
}
@keyframes lightbox-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.image-lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.image-lightbox-caption {
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 90%;
}
.image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  min-height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
body.lightbox-open { overflow: hidden; }

/* Tracking number link — same colour as text, underlined so it
   reads as a link without competing with the surrounding copy. */
.tracking-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}
.tracking-link:hover { text-decoration: underline; filter: brightness(1.1); }

/* Optional shipping address section on the buyer info step. Lives
   inside the same form as the contact fields; the toggle keeps the
   form short for buyers who'd rather add the address later. */
/* Optional shipping-address section. Treated as a proper sub-section
   of the contact form — divider, h2 heading, Add/Hide control on the
   right, helper line below. Matches the visual weight of section
   headings elsewhere in the buyer flow. */
.address-upfront {
  margin-top: 22px;
  padding-top: 18px;
  /* Visual breathing room before the "Next: payment" CTA — the
     compact form felt cramped with the button hugging the address
     block. 22px keeps the bottom margin in proportion with the top. */
  margin-bottom: 22px;
  border-top: 1px solid var(--border);
}
.address-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.address-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.address-title-optional {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.address-toggle {
  -webkit-appearance: none;
  appearance: none;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 120ms ease;
}
.address-toggle:hover { opacity: 0.85; }
.address-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.address-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.address-upfront-body {
  padding: 4px 0 0;
}

/* "Picked the wrong option?" footer on step-5 screens. */
.change-choice {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.change-choice .muted {
  margin-bottom: 12px;
}
.grace-inline {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

/* Waiting-for-confirmation card: countdown row + timeline. The
   countdown is the dominant signal during the grace window; the
   timeline gives the buyer a sense of place in the larger flow. */
.waiting-card { padding-bottom: 8px; }
.grace-countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--elev);
  border: 1px solid var(--border);
}
.grace-countdown-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.grace-countdown-value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
/* "Notify seller now" — tonal secondary CTA under the countdown.
   Earlier versions were too faint (8% accent fill, 14px text, 38px
   tall) and buyers missed them. Now a clearly filled tonal pill:
   meets the 44pt touch target, reads as an offered choice at a
   glance, but stays subordinate to the larger countdown above by
   using a tinted accent fill rather than the full solid accent
   reserved for primary actions. */
/* Selector includes `button` to outrank `button.ghost` (specificity
   0,0,1,1) in case the JS ever re-adds the ghost class — earlier
   regression where the button rendered as a faint muted-gray link
   because `button.ghost` was overriding every property below. */
button.notify-now-btn {
  display: block;
  width: 100%;
  margin: 16px 0 6px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(91, 156, 246, 0.18);
  border: 1.5px solid rgba(91, 156, 246, 0.7);
  border-radius: 12px;
  min-height: 48px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button.notify-now-btn:hover {
  background: rgba(91, 156, 246, 0.26);
  border-color: var(--accent);
}
button.notify-now-btn:active { transform: scale(0.99); }
button.notify-now-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.notify-now-btn:disabled { opacity: 0.5; cursor: progress; }
.timeline {
  list-style: none;
  padding: 0;
  margin: 18px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-step {
  position: relative;
  padding-left: 28px;
  min-height: 28px;
}
.timeline-step::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--border);
  box-shadow: 0 0 0 3px var(--card);
}
.timeline-step.done::before {
  background: var(--gain, #10B981);
}
.timeline-step.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--card),
    0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent);
}
.timeline-step::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 20px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}
.timeline-step:last-child::after { display: none; }
.timeline-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}
.timeline-step.upcoming .timeline-label { color: var(--muted); font-weight: 500; }
.timeline-caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Shipping-address review card on the awaitingShipment screen.
   The buyer entered the address either on step 1 or post-payment;
   surfacing it here (with an Edit affordance) is how they confirm
   the seller is shipping to the right place — address typos are
   the dominant cause of shipping failures so the affordance has to
   be obvious, not buried. Styled as a normal card so it blends in
   without screaming "warning". */
.address-review-title {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 600;
}
.address-review-line {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.address-review-edit {
  margin-top: 12px;
  padding: 8px 0;
  color: var(--accent);
  font-weight: 600;
  text-align: left;
}
/* Side-by-side Cancel + Save row inside the address form when opened
   in edit mode. Both buttons share the row equally so neither reads
   as the lesser action — pre-fix Cancel was a small centered ghost
   link under a full-width Save and the visual hierarchy implied Save
   was the only real option. */
.address-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.address-edit-actions button {
  flex: 1 1 0;
  /* Override the default `button { width: 100% }` rule so the two
     buttons split the row rather than stack at full width. */
  width: auto;
}
/* Override the legacy single-button style — when rendered inside the
   side-by-side actions row the Cancel button needs the same height
   and padding as Save, not the tucked-link styling that used to make
   it look like a "back" affordance. */
.address-edit-actions .address-cancel {
  margin-top: 0;
  padding: 12px 16px;
  text-align: center;
}

/* "This page closes soon — save what you need" notice on terminal
   cards. Quiet by design: it's a heads-up, not an error, so it
   shouldn't compete with the headline above it. The earlier light
   fallback (#F5F5F7) was unreadable on the dark theme — pale-gray
   text on a near-white block. Now we tint from the same dark
   surface palette as `.card` so the notice always meets contrast
   on this page (which is dark-only). */
.link-ttl-notice {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

/* Compact "what happened when" footer on terminal cards. */
.history-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.history-title {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
}
.history-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
  gap: 10px;
}
.history-label { color: var(--text); }
.history-ts {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Payment-handle panel — appears under the method grid when the
   seller pre-filled a destination handle for the chosen method.
   Compact one-line layout: destination + Copy on a single row, with
   a small "Send $X.XX" helper line below. Custom multi-line details
   wrap to their own line via .handle-panel-handle--multiline. */
.handle-panel { margin-top: 14px; }
.handle-panel-card {
  border: 1px solid var(--accent);
  background: rgba(91, 156, 246, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.handle-panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* min-width:0 on the handle child means long handles ellipsis-truncate
     instead of pushing the Copy button off the row. */
}
.handle-panel-handle {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  user-select: all;
  line-height: 1.3;
}
/* Seller-defined Custom method: details can be multi-line (bank
   routing + account on separate lines, a wallet address spread
   across two rows, etc.). Preserve line breaks; stack above the
   Copy button rather than fight for the same row. */
.handle-panel-handle--multiline {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  font-size: 14px;
}
.handle-panel-card:has(.handle-panel-handle--multiline) .handle-panel-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.handle-panel-amount {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.handle-copy {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}
.handle-deep-link {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  min-width: 120px;
}
.handle-deep-link:hover { filter: brightness(1.1); }
.handle-panel-tip { font-size: 12px; line-height: 1.4; }

/* Optional file-upload card — payment proof (Rec #6) and shipping
   label (Rec #5). Sits inside another .card; visually distinct so
   the buyer reads it as "extra, optional" rather than a required
   form. */
.upload-card {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.upload-title {
  font-size: 13px;
  letter-spacing: 0.4px;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 4px;
}
.upload-blurb { font-size: 13px; line-height: 1.4; margin: 0 0 10px; }
.upload-btn { width: auto; padding: 8px 16px; font-size: 13px; }
.upload-skip { font-size: 12px; margin-top: 8px; }

/* "Attached" chip — visible confirmation that something's been
   uploaded, with a thumbnail preview and Replace / Remove buttons.
   Replaces the previous bare "Uploaded ✓" button-text-flash that
   buyers missed. */
.upload-attached {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  margin: 4px 0 10px;
}
.upload-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--elev);
  flex-shrink: 0;
}
.upload-thumb-badge {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.upload-attached-meta {
  flex: 1;
  min-width: 0;
}
.upload-attached-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}
/* Compact, in-line action buttons under an attached file. Pre-fix
   these inherited the base button styling (52px tall, 17px font,
   full-width), which dominated the upload card and looked clunky.
   Now they sit as small secondary affordances next to the chip. */
.upload-actions button {
  width: auto;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
}
.upload-actions button.secondary {
  background: var(--elev);
  color: var(--text);
  border: 1px solid var(--border);
}
.upload-actions button.secondary:hover {
  border-color: rgba(91, 156, 246, 0.45);
}
/* Destructive variant — same tonal weight as the Replace button but
   tinted with the loss/red token so the buyer can spot it as the
   "delete this" action. Border stays muted; the color does the work. */
.upload-remove {
  background: transparent;
  color: var(--loss);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.upload-remove:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.6);
}
.upload-remove:disabled {
  opacity: 0.5;
}

/* #20 — "order updated" banner. Non-blocking; sits above #root until
   the buyer dismisses it. Earlier version used a hazard-yellow palette
   that clashed badly with the dark page (light-on-dark contrast was
   jarring and read as an error). Now themed from the same card/elev/
   accent tokens as the rest of the page so it reads as a calm heads-up
   that still pulls the eye via the left accent stripe. */
.order-edited-banner {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 40px 14px 16px;
  margin: 12px auto;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-edited-banner strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.order-edited-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.order-edited-banner .banner-ack {
  align-self: flex-start;
  margin-top: 8px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(91, 156, 246, 0.45);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  width: auto;
  transition: background 0.15s, border-color 0.15s;
}
.order-edited-banner .banner-ack:hover {
  background: rgba(91, 156, 246, 0.10);
  border-color: var(--accent);
}
.order-edited-banner .banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.order-edited-banner .banner-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
/* Pencil-icon + headline row, so the banner reads as a deliberate
   "the seller edited this" — not a generic system status pill. */
.order-edited-banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.order-edited-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(91, 156, 246, 0.15);
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}

/* Inline hint pinned right above a disabled "I paid" button so the
   buyer never has to "figure out" why the CTA stopped responding. The
   left accent stripe ties it visually to the top banner — the buyer
   should read them as two anchors of the same change, not unrelated
   notices. */
.edit-ack-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 10px;
  background: rgba(91, 156, 246, 0.08);
  border: 1px solid rgba(91, 156, 246, 0.25);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.edit-ack-hint-icon {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.45;
}
.edit-ack-hint-text {
  flex: 1;
  color: var(--muted);
}
.edit-ack-hint-link {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  min-height: 0;
  width: auto;
}
.edit-ack-hint-link:hover {
  color: var(--text);
}

/* "What your seller changed" modal. Reuses the .step-review chrome but
   re-centers it (the step-review parent uses align-items:flex-end as a
   bottom-sheet; the change-details modal feels more authoritative as a
   centered card the buyer has to deliberately close). */
.change-review-backdrop {
  align-items: center;
}
.change-review {
  padding-bottom: 8px;
}
.change-review-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 4px 0 16px;
}

/* Before → After row for total and shipping/fees. The pill on the
   right encodes the delta sign with color so a quick glance tells the
   buyer "the total went up by $3.50" without reading three numbers. */
.change-delta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.change-delta-emphasis {
  border-color: rgba(91, 156, 246, 0.45);
  background: rgba(91, 156, 246, 0.06);
}
.change-delta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.change-delta-values {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.change-delta-from {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
.change-delta-arrow {
  color: var(--muted);
}
.change-delta-to {
  color: var(--text);
}
.change-delta-emphasis .change-delta-to {
  font-size: 18px;
}
.change-delta-pill {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.change-delta-pill-up {
  background: rgba(255, 122, 122, 0.12);
  color: #ff9999;
  border: 1px solid rgba(255, 122, 122, 0.35);
}
.change-delta-pill-down {
  background: rgba(76, 200, 130, 0.12);
  color: #7be0a8;
  border: 1px solid rgba(76, 200, 130, 0.35);
}

/* Grouped sections: added / removed / qty / price. The title is a
   small-caps label; each row below is a thumbnail + name + sub-line.
   Color-coding the left stripe makes the kind of change scannable. */
.change-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 3px solid var(--border);
}
.change-group-added { border-left-color: #7be0a8; }
.change-group-removed { border-left-color: #ff9999; }
.change-group-qty { border-left-color: var(--accent); }
.change-group-price { border-left-color: var(--accent); }
.change-review-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.change-review-meta {
  padding: 12px 14px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.change-review-meta p { margin: 0; }

.change-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
.change-line-thumb {
  width: 40px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.change-line-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.change-line-thumb-fallback {
  font-size: 18px;
}
.change-group-removed .change-line-thumb img {
  filter: grayscale(1);
  opacity: 0.6;
}
.change-line-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.change-line-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.change-group-removed .change-line-name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
.change-line-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.change-line-from {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
.change-line-to {
  color: var(--text);
  font-weight: 500;
}
.change-line-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.change-group-removed .change-line-amount {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.change-review-cta {
  width: 100%;
  margin-top: 4px;
  align-self: stretch !important;
}

/* Collapse / expand affordance inside a change-group when the diff
   has more than CHANGE_GROUP_INITIAL_VISIBLE rows. Reads as a subtle
   link — not a primary button — so it doesn't fight the modal's CTA
   for attention. */
.change-group-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.change-group-toggle {
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 4px 0 0;
  margin: 0;
  width: auto;
  min-height: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.change-group-toggle:hover {
  color: var(--text);
}
.change-group-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* SEC review #6: fixed-height vertical spacers used by the waiting /
   delivery cards. Extracted from inline `style="height:Npx"` attributes
   so the page no longer needs `style-src 'unsafe-inline'` in its CSP.
   (All other styling on the page is set via the CSSOM `element.style`
   API, which CSP does not govern.) */
.vspace-12 { height: 12px; }
.vspace-14 { height: 14px; }
