/* Redex checkout in avec's palette (tokens copied from the site's own CSS) */
.pay-modal {
  --ink: var(--color-foreground, #171717);
  --muted: #6f6c66;
  --blue: var(--color-brand, #0050ff);
  --blue-hi: #3a78ff;
  --blue-deep: #0036b3;
  --blue-soft: #e3ebff;
  --serif: var(--font-gt-standard, ui-sans-serif, system-ui, sans-serif);
  --mono: var(--font-mono, ui-monospace, monospace);
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: var(--font-gt-standard, ui-sans-serif, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}
/* ================= CHECKOUT (pay.js) ================= */
.pay-lock, .pay-lock body { overflow: hidden; }
:where(.pay-modal) :where(button) { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
:where(.pay-modal) :where(button:disabled) { cursor: not-allowed; }
.pay-modal .btn:disabled { opacity: .45; transform: none; }
.mono { font-family: var(--mono); }
.pay-modal[hidden], .pay-steps[hidden], .wallet-menu[hidden], .pay-err[hidden], .fld-ok[hidden] { display: none; }

.pay-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px 16px; }
.pay-scrim { position: absolute; inset: 0; background: rgba(23,23,23,.32); backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s; }
.pay-card {
  position: relative; width: min(560px, 100%); max-height: min(780px, calc(100vh - 48px));
  display: flex; flex-direction: column; background: #fff; color: var(--ink);
  border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
  transform: translateY(14px) scale(.98); opacity: 0; transition: transform .32s var(--ease), opacity .22s;
}
.pay-modal.is-open .pay-scrim { opacity: 1; }
.pay-modal.is-open .pay-card { transform: none; opacity: 1; }

.pay-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.pay-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.pay-brand .mark { font-size: 18px; color: var(--ink); }
.pay-x { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.pay-x:hover { background: #f0f0f2; color: var(--ink); }
.pay-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }

.pay-steps { list-style: none; margin: 14px 18px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-steps li { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding-top: 9px; border-top: 2px solid #e6e6ea; transition: border-color .3s, color .3s; }
.pay-steps li span { font-family: var(--mono); font-size: 10.5px; }
.pay-steps li.is-done { border-color: var(--blue-hi); color: var(--ink); }
.pay-steps li.is-on { border-color: var(--blue); color: var(--ink); font-weight: 600; }

.pay-body { padding: 20px 18px 8px; overflow-y: auto; overscroll-behavior: contain; }
.pay-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.02em; line-height: 1.1; }
.pay-p { margin: 6px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.pay-foot { display: flex; align-items: center; gap: 12px; padding: 14px 18px 18px; border-top: 1px solid #eeeef1; }
.pay-foot .pay-hint, .pay-foot > span:empty { margin-left: auto; }
.pay-hint { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.pay-link { font-size: 13px; color: var(--blue); font-weight: 500; }
.pay-link:hover { text-decoration: underline; }
.pay-link:disabled { opacity: .4; text-decoration: none; }
.pay-err { margin: 12px 0 0; font-size: 13px; color: #c23b3b; }
.pill-ok { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--blue-soft); color: var(--blue-deep); }

/* wallets */
.w-dot { --c: #888; width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.w-dot-sm { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.w-list { display: grid; gap: 8px; }
.w-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px #e4e4e8; transition: box-shadow .2s, background-color .2s; text-align: left; }
.w-opt:hover:not(:disabled) { background: #eef3ff; box-shadow: inset 0 0 0 1px var(--blue-hi); }
.w-opt.is-on { box-shadow: inset 0 0 0 1.5px var(--blue); }
.w-opt.is-loading { background: #eef3ff; }
.w-name { font-weight: 600; font-size: 15px; }
.w-tag { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--muted); }
.w-tag.ok { color: var(--blue); }
.pay-conn { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #efeeea; margin-bottom: 14px; }
.pay-conn b { display: block; font-size: 14px; }
.pay-conn small { font-size: 12px; color: var(--muted); }
.pay-conn .pill-ok { margin-left: auto; }

/* fields */
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.fld em { font-style: normal; color: var(--muted); font-weight: 400; }
.fld input, .fld textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: #f6f6f8;
  border: 1px solid #e4e4e8; border-radius: 8px; padding: 9px 11px; outline: none; resize: vertical;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.fld input.mono { font-family: var(--mono); font-size: 12.5px; }
.fld input:focus, .fld textarea:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,80,255,.14); }
.fld-row { position: relative; }
.fld-row input { padding-right: 78px; }
.fld-ok { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 4px; background: var(--blue-soft); color: var(--blue-deep); }
.fld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.drop { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; border: 1px dashed #cfd3dc; cursor: pointer; margin-bottom: 4px; transition: border-color .2s, background-color .2s; min-width: 0; }
.drop:hover { border-color: var(--blue); background: #eef3ff; }
.drop .ic, .drop img { width: 40px; height: 40px; border-radius: 6px; flex: none; }
.drop .ic { padding: 11px; background: #eef1f6; color: var(--blue); }
.drop img { object-fit: cover; }
.drop[data-kind="banner"] img { width: 72px; }
.drop b { display: block; font-size: 13px; }
.drop small { font-size: 11.5px; color: var(--muted); }

/* destinations */
.d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.d-opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 11px; border-radius: 10px; text-align: left; box-shadow: inset 0 0 0 1px #e4e4e8; transition: box-shadow .2s, background-color .2s; }
.d-opt:hover { background: #eef3ff; }
.d-opt .ic { width: 18px; height: 18px; color: var(--muted); margin-bottom: 5px; }
.d-opt b { font-size: 13px; font-weight: 600; }
.d-opt small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.d-check { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #cfd3dc; }
.d-opt.is-on { background: #f3f7fe; box-shadow: inset 0 0 0 1.5px var(--blue); }
.d-opt.is-on .ic { color: var(--blue); }
.d-opt.is-on .d-check { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; box-shadow: none; }
.d-sub { margin-top: 14px; }
.d-sub > span { display: block; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
.pay-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-chip { font-size: 12.5px; padding: 6px 11px; border-radius: 20px; color: var(--ink); box-shadow: inset 0 0 0 1px #e0e0e5; }
.pay-chip:hover { box-shadow: inset 0 0 0 1px var(--blue-hi); }
.pay-chip.is-on { background: var(--ink); color: #fff; box-shadow: none; }

.alloc { margin: 18px 0 14px; padding: 14px; border-radius: 10px; background: #f6f6f8; }
.alloc-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.alloc-bar span, .alloc-sw { background: hsl(calc(216 + var(--i) * 28) 64% calc(48% + var(--i) * 4%)); transition: flex .25s var(--ease); }
.alloc-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(80px, 1.2fr) 74px; align-items: center; gap: 10px; padding: 6px 0; }
.alloc-sw { width: 10px; height: 10px; border-radius: 3px; }
.alloc-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alloc-full { font-size: 12px; color: var(--muted); }
.alloc-val { text-align: right; line-height: 1.15; }
.alloc-val b { display: block; font-size: 13px; font-weight: 500; }
.alloc-val small { font-size: 10.5px; color: var(--muted); }
.alloc-row input[type="range"] { width: 100%; accent-color: var(--blue); }
.alloc-even { margin-top: 6px; }

/* review */
.rv-token { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.rv-token b { display: block; font-size: 15px; }
.rv-token small { font-size: 12px; color: var(--muted); }
.rv-token .pay-link { margin-left: auto; }
.muted { color: var(--muted); font-weight: 400; }
.rv-logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; }
.rv-logo img { width: 100%; height: 100%; object-fit: cover; }
.rv-box { border-radius: 10px; box-shadow: inset 0 0 0 1px #e4e4e8; padding: 4px 14px; }
.rv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 13.5px; border-bottom: 1px solid #eeeef1; }
.rv-row > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rv-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.rv-row .ic { color: var(--blue); }
.rv-fee { color: var(--muted); }
.rv-total { display: flex; justify-content: space-between; align-items: flex-end; padding: 12px 0 10px; }
.rv-total > span { font-weight: 600; }
.rv-total small { display: flex; align-items: center; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rv-total small .live-dot { width: 6px; height: 6px; margin: 0 4px 0 6px; }
.rv-total b { font-size: 20px; font-weight: 500; }
.rv-from { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; padding: 10px 2px 0; }
.rv-from > span:first-child { color: var(--muted); flex: none; }
.rv-from > span:last-child { text-align: right; overflow-wrap: anywhere; }
.rv-status { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #f3f7fe; color: var(--blue-deep); font-size: 13.5px; font-weight: 500; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(47,111,208,.25); border-top-color: var(--blue); animation: pay-spin .8s linear infinite; flex: none; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
.btn-pay { min-width: 170px; }

/* done */
.done-hero { text-align: center; padding: 6px 0 4px; }
.done-hero .pay-p { margin-bottom: 18px; }
.done-check { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--blue); box-shadow: 0 0 0 8px var(--blue-soft); animation: pay-pop .5s var(--ease) both; }
.done-check svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: pay-draw .45s .2s var(--ease) forwards; }
@keyframes pay-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes pay-draw { to { stroke-dashoffset: 0; } }
.done-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eeeef1; }
.done-row:last-child { border-bottom: 0; }
.done-row > .ic { color: var(--blue); margin-top: 2px; }
.done-row > div { flex: 1; min-width: 0; }
.done-row b { display: block; font-size: 13.5px; }
.done-row b em { font-style: normal; font-weight: 400; color: var(--muted); font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.done-row small { font-size: 12px; color: var(--muted); }
.sig { display: inline-flex; gap: 10px; align-items: center; }

/* header wallet button */
.wallet-wrap { position: relative; }
.nav-cta .wallet-btn { display: inline-flex; }
.wallet-btn .ic { width: 14px; height: 14px; }
.wallet-btn.is-conn { gap: 7px; }
.wallet-btn.is-conn .mono { font-size: 12px; }
.wallet-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; background: #fff; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06); z-index: 60; }
.wallet-menu .wm-addr { font-size: 11.5px; color: var(--muted); padding: 7px 10px 8px; border-bottom: 1px solid #eee; margin-bottom: 4px; }
.wallet-menu button { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink); }
.wallet-menu button:hover { background: #f2f4f8; }

/* new feed row from your own payment */
.f-new { animation: pay-flash 2.4s var(--ease); }
@keyframes pay-flash { 0% { background: rgba(74,138,230,.35); } 100% { background: transparent; } }

@media (max-width: 560px) {
  .pay-modal { padding: 0; place-items: end center; }
  .pay-card { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .pay-steps li { font-size: 0; gap: 0; }
  .pay-steps li span { font-size: 11px; }
  .pay-h { font-size: 24px; }
  .d-grid { grid-template-columns: 1fr 1fr; }
  .fld-3 { grid-template-columns: 1fr; gap: 0; }
  .fld-2 { gap: 8px; }
  .alloc-row { grid-template-columns: 10px minmax(0, 1fr) 70px; }
  .alloc-row input[type="range"] { grid-column: 2 / -1; grid-row: 2; }
  .pay-foot .pay-hint { display: none; }
  .pay-foot .btn { margin-left: auto; }
  .wallet-btn:not(.is-conn) { padding: 0 10px; font-size: 0; gap: 0; }
  .wallet-btn:not(.is-conn) .ic { width: 16px; height: 16px; }
  .wallet-btn.is-conn .mono { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .pay-card, .pay-scrim { transition: none; }
  .done-check, .done-check svg, .f-new { animation: none; stroke-dashoffset: 0; }
}

/* real wallet + SOL logos */
.w-logo { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(0,0,0,.06); background: #fff; }
.w-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.w-logo.w-tile { background: #fff0f0; }
.w-logo.w-tile img { width: 62%; height: 62%; object-fit: contain; }
.w-logo-sm { width: 18px; height: 18px; border-radius: 5px; box-shadow: none; }
.w-opt { padding: 12px 14px; }
.w-opt:hover:not(:disabled) .w-logo { transform: scale(1.04); }
.w-logo { transition: transform .25s var(--ease); }
.w-tag { display: inline-flex; align-items: center; gap: 6px; }
.w-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.w-tag.ok { color: #15803d; }
.wallet-btn .w-logo-sm { width: 16px; height: 16px; border-radius: 4px; }
.sol-coin { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.sol-amt { display: inline-flex; align-items: center; gap: 6px; }
.sol-lg { width: 20px; height: 20px; }
.btn-pay .sol-coin { width: 16px; height: 16px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); border-radius: 50%; }
.rv-wallet { display: inline-flex; align-items: center; gap: 7px; }

/* ---- avec look ---- */
.pay-card { background: var(--color-background, #f7f6f4); border-radius: 24px; box-shadow: 0 32px 21px rgba(0,0,0,.05), 0 11px 9px rgba(0,0,0,.03), 0 2px 4px rgba(0,0,0,.02), 0 0 0 1px rgba(0,0,0,.06); }
.pay-head { padding: 20px 22px 0; }
.pay-brand { font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.pay-brand .mark { width: 22px; height: 22px; border-radius: 6px; background: url(/redex/icon-256.png) center / cover; }
.pay-steps { margin: 16px 22px 0; }
.pay-steps li { border-top-color: var(--color-surface, #e5e2dc); }
.pay-body { padding: 22px 22px 10px; }
.pay-h { font-weight: 500; font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.pay-p { color: #55524d; letter-spacing: -.01em; }
.pay-foot { padding: 16px 22px 20px; border-top-color: var(--color-surface, #e5e2dc); }
.pay-x:hover { background: var(--color-surface, #e5e2dc); }
.fld input, .fld textarea { background: #fff; border-color: var(--color-surface, #e5e2dc); border-radius: 12px; padding: 11px 13px; }
.w-opt, .d-opt { background: #fff; border-radius: 14px; }
.w-opt { box-shadow: inset 0 0 0 1px var(--color-surface, #e5e2dc); padding: 12px 14px; }
.rv-box, .rv-token, .pay-conn { background: #fff; border-radius: 14px; }
.drop { background: #fff; border-color: #d6d2ca; border-radius: 12px; }
.pay-chip { border-radius: 999px; }
.pay-modal .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 12px 16px; height: auto; border: 1px solid transparent;
  font-weight: 500; font-size: .9375rem; line-height: 1; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none; transition: transform .12s, background-color .2s;
}
.pay-modal .btn:active { transform: scale(.97); }
.pay-modal .btn-blue { background: var(--color-brand, #0050ff); border-color: var(--color-brand, #0050ff); color: #fff; }
.pay-modal .btn-blue:hover:not(:disabled) { background: #1f63ff; }
.pay-modal .ic { display: inline-flex; width: 16px; height: 16px; flex: none; }
.pay-modal .ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pay-modal .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent-green, #03ce4c); margin-right: 6px; }
.pay-modal .muted { color: var(--muted); }
.pay-modal input[type="range"] { accent-color: var(--color-brand, #0050ff); }
/* split colours = avec's accent set */
.alloc { background: #fff; border-radius: 14px; }
.alloc-bar span, .alloc-sw { --sw: var(--color-brand, #0050ff); background: var(--sw); }
.alloc-bar span[style*="--i:0"], .alloc-row[style*="--i:0"] .alloc-sw { --sw: var(--color-brand, #0050ff); }
.alloc-bar span[style*="--i:1"], .alloc-row[style*="--i:1"] .alloc-sw { --sw: var(--color-accent-sky, #36b7ff); }
.alloc-bar span[style*="--i:2"], .alloc-row[style*="--i:2"] .alloc-sw { --sw: var(--color-accent-green, #03ce4c); }
.alloc-bar span[style*="--i:3"], .alloc-row[style*="--i:3"] .alloc-sw { --sw: var(--color-accent-red, #f73c1d); }
.alloc-bar span[style*="--i:4"], .alloc-row[style*="--i:4"] .alloc-sw { --sw: var(--color-foreground, #171717); }
.alloc-bar span[style*="--i:5"], .alloc-row[style*="--i:5"] .alloc-sw { --sw: var(--color-brand, #0050ff); }
.alloc-bar span[style*="--i:6"], .alloc-row[style*="--i:6"] .alloc-sw { --sw: var(--color-accent-sky, #36b7ff); }
.alloc-bar span[style*="--i:7"], .alloc-row[style*="--i:7"] .alloc-sw { --sw: var(--color-accent-green, #03ce4c); }
.alloc-bar span[style*="--i:8"], .alloc-row[style*="--i:8"] .alloc-sw { --sw: var(--color-accent-red, #f73c1d); }
.d-opt { box-shadow: inset 0 0 0 1px var(--color-surface, #e5e2dc); }
.d-opt.is-on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--color-brand, #0050ff); }
.d-opt:hover, .w-opt:hover:not(:disabled), .drop:hover { background: #fbfaf8; }
.pay-chip { box-shadow: inset 0 0 0 1px var(--color-surface, #e5e2dc); background: #fff; }
.pay-chip.is-on { background: var(--color-foreground, #171717); color: #fff; }
.rv-box { box-shadow: inset 0 0 0 1px var(--color-surface, #e5e2dc); }
.rv-row, .done-row { border-bottom-color: #efede9; }
.rv-status { background: #fff; color: var(--color-brand, #0050ff); }
.drop .ic { background: var(--color-background, #f7f6f4); }
