/* ─────────────────────────────────────────────────────────────
   Checkout theme. Brand colour comes from BRAND_COLOR (--brand).
   ───────────────────────────────────────────────────────────── */
:root {
  --brand: #2563EB;
  --brand-2: #4F46E5;

  --bg: #EEF2F9;
  --card: #FFFFFF;
  --text: #0B1324;
  --muted: #5B6779;
  --faint: #8A95A8;
  --line: #E4E9F2;
  --soft: #F6F8FC;

  --good: #0E9F6E;  --good-bg: #E3F8EF;
  --warn: #B45309;  --warn-bg: #FEF4DC;
  --bad:  #DC2626;  --bad-bg:  #FDECEC;
  --busy: #2563EB;  --busy-bg: #E7EFFF;

  --radius: 20px;
  --shadow: 0 1px 2px rgba(11, 27, 63, .04), 0 12px 32px -8px rgba(11, 27, 63, .12), 0 32px 64px -24px rgba(11, 27, 63, .12);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070D1C;
    --card: #0F1830;
    --text: #E8EDF7;
    --muted: #97A3BA;
    --faint: #6C7891;
    --line: #1E2A47;
    --soft: #0B1428;
    --good: #34D399; --good-bg: #0B2A22;
    --warn: #FBBF24; --warn-bg: #2E2208;
    --bad:  #F87171; --bad-bg:  #321214;
    --busy: #8AB4FF; --busy-bg: #12224A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Layout ───────────────────────────────────────────────── */
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
}

.side {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, color-mix(in srgb, var(--brand-2) 45%, transparent), transparent 60%),
    linear-gradient(160deg, #0B1B3F 0%, #0A1430 60%, #070D1C 100%);
}
.side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}
.side-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -140px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 60px rgba(255,255,255,.02), 0 0 0 120px rgba(255,255,255,.015);
}
.side-inner {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100vh;
  min-height: 560px;
  max-width: 460px;
  margin-left: auto;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

.side-copy { margin-top: auto; }
.side-title {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 30%, #BFD3FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.side-sub { margin: 0; color: #B6C3DD; max-width: 34ch; }

.trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.trust li { display: flex; gap: 14px; align-items: flex-start; }
.trust-ico {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
}
.trust-ico svg { width: 18px; height: 18px; fill: #9EC0FF; }
.trust strong { display: block; font-size: 14.5px; font-weight: 700; }
.trust small { display: block; color: #93A3C2; font-size: 13px; }

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px;
  color: #93A3C2;
}
.side-badge { display: inline-flex; align-items: center; gap: 6px; color: #C9D6F2; font-weight: 600; }
.side-nets { font-family: var(--mono); letter-spacing: .02em; }

.main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 56px 24px 40px;
}
.main-inner { width: 100%; max-width: 460px; }

/* Mobile: brand panel becomes a slim header */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side-inner { position: relative; height: auto; min-height: 0; max-width: none; margin: 0; padding: 18px 16px 64px; gap: 0; }
  .side-copy, .trust, .side-foot, .side-glow { display: none; }
  .brand-logo { width: 34px; height: 34px; border-radius: 10px; }
  .brand-name { font-size: 17px; }
  .main { padding: 0 16px 32px; margin-top: -48px; }
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  animation: rise .35s cubic-bezier(.2, .8, .2, 1) both;
}
@media (max-width: 480px) { .card { padding: 22px 18px; } }
@keyframes rise { from { transform: translateY(8px); } }

h1 { font-size: 24px; margin: 0 0 18px; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: 20px; margin: 14px 0 6px; letter-spacing: -0.02em; font-weight: 800; }

.banner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.banner .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Steps */
.steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--faint);
}
.steps li { display: flex; align-items: center; gap: 7px; }
.steps li + li::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  margin-right: 1px;
}
.steps span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--faint);
}
.steps li.on { color: var(--text); }
.steps li.on span { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.steps li.done span { background: color-mix(in srgb, var(--brand) 14%, var(--card)); border-color: transparent; color: var(--brand); font-size: 0; }
.steps li.done span::after { content: "✓"; font-size: 11px; }
.steps li.done + li::before { background: var(--brand); }
.steps li.done.on span { background: var(--good); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent); }

/* Fixed amount block */
.due {
  margin: -4px 0 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background:
    radial-gradient(400px 120px at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent),
    var(--soft);
  border: 1px solid var(--line);
}
.due-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.fixed-amount { font-size: 38px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.fixed-for { margin: 0; color: var(--muted); font-size: 14px; }

.notice {
  display: flex;
  gap: 10px;
  background: var(--busy-bg);
  color: var(--busy);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 20px;
}
.notice::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 5v4.6l3.7 2.2-1 1.7L11 12.7V7h2Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 5v4.6l3.7 2.2-1 1.7L11 12.7V7h2Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Form ─────────────────────────────────────────────────── */
.field { display: block; border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.field > span, .field legend, .label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0;
  color: var(--text);
}
.field em { font-style: normal; font-weight: 500; color: var(--faint); }

input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 0 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); font-weight: 400; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A95A8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 34px;
  cursor: pointer;
}

.amount-row { display: flex; gap: 8px; }
.amount-row input { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; height: 56px; }
.amount-row select { width: 104px; flex: none; font-weight: 700; height: 56px; }

/* Coin options */
.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  background: var(--card);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.option:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--card));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}
.option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

.coin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  flex: none;
  background: linear-gradient(145deg, #3FC1A0, #1A9C7A);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), 0 4px 10px -4px rgba(26, 156, 122, .6);
}
.coin[data-coin="BTC"]  { background: linear-gradient(145deg, #F7A440, #E2780E); }
.coin[data-coin="ETH"]  { background: linear-gradient(145deg, #8A9BF0, #5865C9); }
.coin[data-coin="USDC"] { background: linear-gradient(145deg, #4A90E2, #2468C7); }
.coin[data-coin="TRX"]  { background: linear-gradient(145deg, #F05260, #C8202F); }
.coin[data-coin="BNB"]  { background: linear-gradient(145deg, #F5CD4B, #D9A90F); }

.option-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.option-text strong { font-weight: 700; font-size: 15px; }
.option-text small { color: var(--muted); font-size: 13px; }

.net-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.net-tag[data-net="tron"] { color: #D3263A; background: #FDECEE; border-color: #F8D2D7; }
.net-tag[data-net="bsc"]  { color: #A67C00; background: #FFF6D9; border-color: #F5E3A6; }
@media (prefers-color-scheme: dark) {
  .net-tag[data-net="tron"] { color: #FF8A96; background: #2E1217; border-color: #4A1C24; }
  .net-tag[data-net="bsc"]  { color: #F5CD4B; background: #2A230B; border-color: #44380F; }
}

.tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  transition: background-color .15s, border-color .15s;
}
.option:has(input:checked) .tick {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/13px no-repeat;
}

/* Buttons */
.btn {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #fff) 0%, var(--brand) 45%, var(--brand-2) 100%);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn:focus-visible, .copy:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

.error {
  color: var(--bad);
  background: var(--bad-bg);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 14px;
}

/* ── Payment view ─────────────────────────────────────────── */
.pay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.pay-ref { font-size: 13px; color: var(--muted); font-weight: 500; }
.fiat { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--busy-bg);
  color: var(--busy);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill[data-tone="wait"]::before, .pill[data-tone="busy"]::before { animation: pulse 1.6s ease-in-out infinite; }
.pill[data-tone="good"] { background: var(--good-bg); color: var(--good); }
.pill[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); }
.pill[data-tone="bad"]  { background: var(--bad-bg);  color: var(--bad); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

.send-box {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  color: #fff;
  background:
    radial-gradient(300px 140px at 100% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--brand) 85%, transparent);
}
.send-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.crypto-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.send-net { font-size: 13px; opacity: .85; font-weight: 500; }
.send-box .copy { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.25); color: #fff; }
.send-box .copy:hover { background: rgba(255,255,255,.26); }
.send-box .copy.done { color: #fff; background: rgba(16, 185, 129, .5); border-color: transparent; }

.qr-wrap { display: grid; justify-items: center; margin: 0 0 18px; }
.qr-frame {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px -14px rgba(11, 27, 63, .3);
}
.qr-frame::before, .qr-frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--brand);
  opacity: .9;
}
.qr-frame::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.qr-frame::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.qr-frame #qr { display: block; width: 220px; height: 220px; }
.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  border: 3px solid #fff;
  background: #fff;
}
.qr-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); font-weight: 500; }

.mono-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
}
.mono-row code {
  flex: 1;
  min-width: 0;
  font: 500 13px/1.45 var(--mono);
  word-break: break-all;
  color: var(--text);
}

.copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--brand);
  border-radius: 9px;
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.copy:hover { background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
.copy.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }

.memo .mono-row { border-color: var(--warn); background: var(--warn-bg); }
.memo p { color: var(--warn); margin: 6px 0 0; font-weight: 600; }

.progress {
  background: var(--busy-bg);
  color: var(--busy);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.timer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.timer strong { color: var(--text); font: 500 20px var(--mono); letter-spacing: -0.02em; }
.timer strong[data-urgent="1"] { color: var(--bad); }
.bar {
  height: 6px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0 18px;
}
.bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 1s linear;
}

.warn {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}
.warn li { position: relative; padding-left: 22px; }
.warn li::before {
  content: "!";
  position: absolute;
  left: 0;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--warn);
  background: var(--warn-bg);
}
.warn li:first-child { color: var(--text); font-weight: 700; }

/* Result */
.result { text-align: center; padding: 10px 0 2px; }
.result p { margin: 0 auto 20px; max-width: 36ch; }
.result-icon {
  width: 76px;
  height: 76px;
  margin: 4px auto 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  background: var(--busy-bg);
  color: var(--busy);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.result-icon[data-tone="good"] {
  background: var(--good);
  color: #fff;
  box-shadow: 0 0 0 10px var(--good-bg), 0 16px 32px -10px color-mix(in srgb, var(--good) 70%, transparent);
}
.result-icon[data-tone="warn"] { background: var(--warn-bg); color: var(--warn); }
.result-icon[data-tone="bad"]  { background: var(--bad-bg);  color: var(--bad); }
.result h2 { margin-top: 22px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

/* Loading */
.card.loading { display: grid; place-items: center; min-height: 220px; }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; margin-top: 18px; color: var(--faint); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ─────────────────────────────────────────────────────────────
   Admin
   ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #fff;
  background: linear-gradient(120deg, #0B1B3F, #0A1430 70%, color-mix(in srgb, var(--brand) 40%, #0A1430));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar .brand-logo { width: 34px; height: 34px; border-radius: 10px; }
.topbar .brand-name { font-size: 17px; }
.topbar .tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #C9D6F2;
}
.topbar .grow { flex: 1; }
.topbar .copy { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.topbar .copy:hover { background: rgba(255,255,255,.16); }

.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 48px; }
.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 18px 16px 40px; }
  .topbar-inner { padding: 12px 16px; }
}
.login-wrap { max-width: 420px; margin: 8vh auto 0; }
.login-wrap .card h1 { margin-bottom: 6px; }
.login-wrap .card > p { margin: 0 0 20px; }

.admin .card h1 { font-size: 20px; }
.admin .card h2 { margin: 0; font-size: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.good b { color: var(--good); }
.stat.wait b { color: var(--busy); }

.created {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  background: var(--good-bg);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.created .label { color: var(--good); }
.created .mono-row { background: var(--card); }
.created p { margin: 10px 0 0; }

.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.link-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin: 0 -14px;
  border-radius: 14px;
  border-top: 1px solid var(--line);
  transition: background .15s;
}
.link-row:first-child { border-top: 0; }
.link-row:hover { background: var(--soft); }
.link-main { min-width: 0; display: grid; gap: 3px; }
.link-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-top strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.link-actions { display: flex; gap: 6px; flex: none; }
.copy.danger { color: var(--bad); }
.copy.danger:hover { background: var(--bad-bg); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
@media (max-width: 520px) {
  .link-row { flex-direction: column; align-items: stretch; }
  .link-actions { justify-content: flex-end; }
}
