/* discordtag — checkout dialog. Uses the tokens from site.css. */
#co-overlay {
  --cm-text: var(--ink);
  position: fixed; inset: 0; z-index: 9999;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 16px; border: 0;
  background: transparent; color: var(--ink);
  display: none; align-items: center; justify-content: center;
  font-family: var(--body);
}
#co-overlay[open], #co-overlay.open { display: flex; }
#co-overlay::backdrop { background: rgba(21, 20, 42, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

#co-panel {
  position: relative;
  width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-l);
  box-shadow: 0 30px 80px -20px rgba(21, 20, 42, .45);
  padding: 28px 26px 24px;
}
@media (prefers-reduced-motion: no-preference) {
  #co-overlay[open] #co-panel { animation: co-in .28s cubic-bezier(.2, .9, .3, 1.1); }
}
@keyframes co-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

#co-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sunk); color: var(--ink); font-size: 1rem;
}
#co-close:hover { background: var(--line); }

/* Header: the name as a tag */
.co-header { margin-bottom: 22px; padding-right: 44px; }
.co-logo { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.co-logo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2BB673; }
.co-item-name {
  margin-top: 8px; font: 800 2.2rem/1.05 var(--display); letter-spacing: -.035em; overflow-wrap: anywhere;
}
.co-item-price {
  display: inline-block; margin-top: 12px;
  font: 700 1.05rem/1 var(--display); background: var(--tag); color: var(--tag-ink);
  padding: 8px 14px; border-radius: 6px 999px 999px 6px; font-variant-numeric: tabular-nums;
}

/* Progress */
.co-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.co-step { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.co-step-c {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--sunk); font: 800 .8rem/1 var(--display);
}
.co-step.active { color: var(--ink); }
.co-step.active .co-step-c { background: var(--iris); color: var(--on-iris); }
.co-step.done .co-step-c { background: var(--iris-soft); color: var(--iris); }
.co-step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line); }
.co-step-line.done { background: var(--iris); }
@media (max-width: 420px) { .co-step-l { display: none; } }


/* Fields */
.co-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.co-input {
  width: 100%; min-height: 50px; padding: 0 16px; border: 0; border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font: 500 1rem var(--body);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.co-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--iris); }
.co-check-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: .9rem; cursor: pointer; }
.co-check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--iris); flex: none; }
.co-err { display: none; margin-top: 8px; color: var(--danger); font-size: .85rem; font-weight: 600; }
.co-help { margin-top: 16px; color: var(--muted); font-size: .85rem; text-align: center; }
.co-help a { color: var(--iris); font-weight: 600; }

/* Buttons */
.co-btn, .co-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 1rem var(--body);
}
.co-btn { background: var(--iris); color: var(--on-iris); margin-top: 18px; }
.co-btn:hover:not(:disabled) { background: var(--iris-hover); }
.co-btn:disabled { background: var(--sunk); color: var(--muted); cursor: not-allowed; }
.co-btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.co-btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.co-btn-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; }
.co-btn-row .co-btn { margin-top: 0; }
.co-net-pill { font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .2); }

/* Coin picker */
.co-coins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.co-coin {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px 12px; border: 0; border-radius: var(--radius-m); cursor: pointer;
  background: var(--paper); color: var(--ink); font: 700 .9rem/1 var(--display);
  box-shadow: inset 0 0 0 1.5px transparent;
}
.co-coin svg { width: 30px; height: 30px; }
.co-coin:hover { box-shadow: inset 0 0 0 1.5px var(--line); }
.co-coin.active { box-shadow: inset 0 0 0 2px var(--iris); background: var(--iris-soft); }
.co-coin-badge {
  font: 600 .68rem/1 var(--body); color: var(--muted);
  padding: 4px 7px; border-radius: 999px; background: var(--surface);
}
.co-addr-label .co-coin-badge { background: var(--iris-soft); color: var(--iris); margin-left: 6px; }

/* Payment */
.co-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.co-qr-box { padding: 12px; background: #fff; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); }
.co-qr-box #co-qr { position: relative; width: 200px; height: 200px; }
.co-qr-box svg { display: block; width: 100%; height: 100%; }
.co-qr-badge { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 4px #fff; }
.co-qr-note { font-size: .82rem; color: var(--muted); }
.co-addr-label { font-weight: 600; font-size: .9rem; margin-bottom: 8px; display: flex; align-items: center; }
.co-addr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 14px; border-radius: var(--radius-s); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line);
}
.co-addr-text { flex: 1; min-width: 0; font: 500 .85rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-all; }
.co-copy {
  flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper); font: 600 .85rem var(--body);
}
.co-copy.ok { background: #2BB673; color: #fff; }
.co-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.co-amt-box { padding: 14px; border-radius: var(--radius-s); background: var(--paper); }
.co-amt-box-l { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.co-amt-val { font: 750 1.1rem/1.2 var(--display); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.co-amt-val.green { color: var(--ink); }
.co-timer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.co-timer-val { font: 750 1.1rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.co-timer-val.urgent { color: var(--danger); }

.co-status {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 14px; padding: 14px; border-radius: var(--radius-s); background: var(--iris-soft); font-size: .9rem;
}
.co-status-txt strong { display: block; margin-bottom: 2px; }
.co-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--iris); }
@media (prefers-reduced-motion: no-preference) { .co-status.waiting .co-dot, .co-status.detected .co-dot { animation: co-blink 1.4s infinite; } }
@keyframes co-blink { 50% { opacity: .3; } }
.co-status.detected { background: #FFF1CC; color: #1B1A33; }
.co-status.detected .co-dot { background: #E0A100; }
.co-status.error { background: #FCE3E8; color: #1B1A33; }
.co-status.error .co-dot { background: var(--danger); }

/* Done */
.co-confirmed-icon {
  width: 64px; height: 64px; margin: 4px auto 14px; display: grid; place-items: center;
  border-radius: 50%; background: #2BB673; color: #fff; font-size: 1.8rem; font-weight: 800;
}
.co-confirmed-title { text-align: center; font: 800 1.6rem/1.1 var(--display); letter-spacing: -.02em; }
.co-confirmed-sub { text-align: center; color: var(--muted); margin: 8px auto 18px; max-width: 36ch; }
.co-tx-box { padding: 16px; border-radius: var(--radius-s); background: var(--paper); font-size: .88rem; line-height: 1.7; overflow-wrap: anywhere; }
.co-tx-link { color: var(--iris); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }

/* Coin brand badges keep a hint of their network colour */
.badge-btc { color: #B86A00; } .badge-eth, .badge-erc { color: #4B62D1; } .badge-trc { color: #C2304A; }
.badge-bep, .badge-bnb { color: #A57A00; } .badge-sol { color: #7B35E0; } .badge-xrp { color: #0087B8; } .badge-ltc { color: #6B6B6B; }
:root[data-theme="dark"] .co-coin-badge { color: var(--muted); }
:root[data-theme="dark"] .co-status.detected, :root[data-theme="dark"] .co-status.error { color: #1B1A33; }

.co-btn svg { flex: none; }
