/* loxley — Forest Dawn. Organic luxury: mist, sunlight, living green. */
:root {
  --bg: #060d09;
  --sheet: rgba(26, 40, 30, 0.60);
  --well: rgba(3, 9, 6, 0.44);
  --line: rgba(210, 235, 210, 0.10);
  --hairline: rgba(210, 235, 210, 0.07);
  --txt: #f4f7f2;
  --dim: #9aa79b;
  --faint: #5f6f60;
  --acc: #63d977;
  --acc-soft: rgba(99, 217, 119, 0.14);
  --sun: #ffd98a;
  --sun-deep: #f0b95c;
  --sun-ink: #2b1f08;
  --blue: #0a84ff;
  --err: #ff453a;
  --radius: 28px;
  --spring: cubic-bezier(0.32, 0.72, 0.28, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Inter, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
::selection { background: rgba(48, 209, 88, 0.35); }

/* forest dawn — layered living background */
.bg {
  position: fixed; inset: -4%; z-index: -2; pointer-events: none;
  background:
    /* sun through canopy — warm light from above */
    radial-gradient(560px 380px at 50% -10%, rgba(255, 217, 138, 0.16), transparent 65%),
    /* canopy blobs — deep moss */
    radial-gradient(620px 460px at 8% 4%, rgba(47, 122, 74, 0.22), transparent 62%),
    radial-gradient(680px 500px at 96% 10%, rgba(28, 84, 58, 0.20), transparent 62%),
    /* undergrowth glow */
    radial-gradient(760px 520px at 50% 112%, rgba(63, 160, 96, 0.12), transparent 60%),
    /* forest floor depth */
    linear-gradient(180deg, #0a1510 0%, #060d09 42%, #030705 100%);
  /* static backdrop: the animated background used to force every blurred card
     above it to re-composite every frame. Parallax still nudges it via JS. */
}
@keyframes forestDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, -22px, 0) scale(1.05); }
}
/* drifting mist bands */
.bg::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 130px at 22% 34%, rgba(200, 225, 200, 0.055), transparent 70%),
    radial-gradient(860px 150px at 78% 58%, rgba(200, 225, 200, 0.045), transparent 70%),
    radial-gradient(640px 120px at 45% 80%, rgba(180, 215, 180, 0.04), transparent 70%);
  filter: blur(6px);
  /* static: animated layers beneath backdrop-filter cards force re-blur each frame */
}
@keyframes mistDrift {
  from { transform: translate3d(-3%, 1%, 0); }
  to { transform: translate3d(3%, -2%, 0); }
}
.wrap {
  max-width: 420px; margin: 0 auto; padding: 20px 16px 72px;
  position: relative;
  animation: rise 0.55s var(--spring) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- header ---------- */
.brand { display: flex; align-items: center; gap: 12px; margin: 6px 2px 20px; }
.logo {
  width: 42px; height: 42px; border-radius: 13px; flex: none; object-fit: cover;
  box-shadow: 0 6px 22px rgba(48, 209, 88, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-text h1 {
  margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
}
.sub { color: var(--dim); margin: 1px 0 0; font-size: 12.5px; letter-spacing: 0.1px; }
.badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px;
  padding: 7px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); color: var(--dim);
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.badge.on {
  color: var(--acc); border-color: rgba(48, 209, 88, 0.45);
  background: var(--acc-soft);
  box-shadow: 0 0 18px rgba(48, 209, 88, 0.18);
}
/* shielded-balance chip in the header: visible in private mode, tap to jump to the panel */
.shield-chip {
  font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  color: #e8d5ff; border: 1px solid rgba(167, 139, 250, 0.5);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(167, 139, 250, 0.12));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
  transition: transform 0.15s, box-shadow 0.2s;
  white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis;
}
.shield-chip:active { transform: scale(0.96); }

/* ---------- frosted sheet ---------- */
.card {
  background: linear-gradient(180deg, rgba(46, 46, 52, 0.62), rgba(22, 22, 26, 0.62));
  /* 18px blur is the sweet spot: still frosted, ~40% cheaper to composite than 28px */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.card h2 { margin: 2px 0 14px; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }

/* ---------- iOS segmented control ---------- */
.tabs {
  position: relative; display: flex;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 15px; padding: 3px; margin-bottom: 16px;
}
.tabs::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(33.3333% - 2px); border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.3s var(--spring);
}
.tabs.send-active::before { transform: translateX(100%); }
.tabs.token-active::before { transform: translateX(200%); }
/* 4-tab layout when the Stats tab is visible again */
.tabs.has-stats::before { width: calc(25% - 2px); }
.tabs.has-stats.stats-active::before { transform: translateX(200%); }
.tabs.has-stats.token-active::before { transform: translateX(300%); }
/* mode caption under the tabs */
.mode-caption {
  margin: -8px 2px 14px; font-size: 12.5px; color: var(--dim);
  display: flex; align-items: center; gap: 6px;
}
/* ---------- per-mode theming: swap = forest gold, send = privacy violet ---------- */
#swap-card[data-mode="send"] {
  --sun: #d9cfff;
  --sun-deep: #a78bfa;
  --sun-ink: #221647;
  --acc: #a78bfa;
  --acc-soft: rgba(167, 139, 250, 0.14);
}
#swap-card[data-mode="send"]::after {
  background: linear-gradient(90deg, transparent, rgba(217, 207, 255, 0.35) 30%, rgba(167, 139, 250, 0.35) 70%, transparent);
}
#swap-card[data-mode="send"] button.primary {
  box-shadow: 0 8px 26px rgba(167, 139, 250, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
#swap-card[data-mode="send"] button.primary:active {
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.25);
}
#swap-card[data-mode="send"] button:focus-visible,
#swap-card[data-mode="send"] input:focus-visible {
  outline-color: rgba(167, 139, 250, 0.7);
}
#swap-card[data-mode="send"] .mode-caption { color: #bfaef7; }
.tabs .tab {
  position: relative; z-index: 1; flex: 1;
  padding: 9px 0; border: none; background: transparent;
  color: var(--dim); font-size: 14.5px; font-weight: 600; letter-spacing: 0.1px;
  border-radius: 12px; cursor: pointer;
  transition: color 0.25s;
}
.tabs .tab.active { color: #fff; }

/* ---------- amount wells ---------- */
.panel {
  background: var(--well);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px; padding: 14px 16px; margin-bottom: 4px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s;
}
.panel:focus-within { border-color: rgba(48, 209, 88, 0.35); }
.panel-head {
  font-size: 12px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.panel-head em { font-style: normal; color: var(--acc); text-transform: none; letter-spacing: 0; }
.panel-body { display: flex; gap: 10px; align-items: center; }
.panel-body input {
  flex: 1; min-width: 0; background: transparent; border: none;
  color: var(--txt); font-size: 38px; font-weight: 600; letter-spacing: -1px;
  padding: 2px 0; font-variant-numeric: tabular-nums;
}
.panel-body input:focus { outline: none; }
.panel-body input::placeholder { color: #3a3a3f; }
.panel-sub {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--dim); margin-top: 6px;
}
#send-est { color: var(--acc); font-weight: 600; }

/* flip — rounded square sitting on top of the panel gap, like the NEAR widget */
.flip-row { display: flex; justify-content: center; margin: -10px 0; position: relative; z-index: 1; }
.flip {
  width: 40px; height: 40px; border-radius: 13px; padding: 0;
  background: rgba(60, 60, 66, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12); color: var(--txt);
  font-size: 17px; cursor: pointer;
  box-shadow: 0 0 0 5px #141417, 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.45s var(--spring), border-color 0.2s, box-shadow 0.25s;
}
.flip:hover {
  border-color: rgba(48, 209, 88, 0.6);
  box-shadow: 0 0 0 5px #141417, 0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(48, 209, 88, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.flip:active { transform: scale(0.9); }
.flip.rotated { transform: rotate(180deg); }
.flip.rotated:active { transform: rotate(180deg) scale(0.9); }

/* quick preset pairs */
.quick-pairs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.quick-pairs:empty { display: none; }
.qpair {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--txt); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  animation: chipIn 0.3s ease backwards;
}
.qpair:nth-child(2) { animation-delay: 0.05s; }
.qpair:nth-child(3) { animation-delay: 0.1s; }
.qpair:nth-child(4) { animation-delay: 0.15s; }
.qpair:hover { border-color: rgba(48, 209, 88, 0.45); background: rgba(48, 209, 88, 0.08); }
.qpair:active { transform: scale(0.95); }
.qpair .ticon-wrap { position: relative; width: 20px; height: 20px; }
.qpair .ticon { width: 20px; height: 20px; font-size: 9px; }
.qpair .cbadge { width: 11px; height: 11px; font-size: 6px; right: -3px; bottom: -3px; border-width: 1px; }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }

/* estimate loading shimmer + update tick */
#est-out.loading {
  color: transparent !important;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 1.1s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
#est-out.tick { animation: tickIn 0.25s ease; }
@keyframes tickIn { from { opacity: 0.35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* optimistic estimate: slightly dimmed until the live quote confirms it */
#est-out.stale { opacity: 0.55; }

/* panel + card entrance */
.panel, .ratebox { animation: panelIn 0.28s ease backwards; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ratebox-body-wrap { transition: opacity 0.2s ease; }

/* press feedback */
button.primary:active { transform: scale(0.985); }
button.primary { transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease; }
.tab { transition: color 0.2s ease, background 0.25s ease; }

/* rate box — widget-style quote card */
.ratebox {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); overflow: hidden;
}
#ratebox-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: none; border: none; color: var(--txt);
  padding: 12px 14px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
}
.rate-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.pill {
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
#ratebox-head .chev { color: var(--faint); font-size: 11px; transition: transform 0.2s; }
#ratebox-head.open .chev { transform: rotate(180deg); }
.rate-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-top: 1px solid var(--hairline); font-size: 13.5px;
}
.rate-row span { color: var(--dim); }
.rate-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
#rate-impact.bad { color: var(--err); }

/* send-panel extras */
.sub-right { display: flex; align-items: center; gap: 8px; }
#in-usd { font-variant-numeric: tabular-nums; }
.maxbtn {
  background: rgba(48, 209, 88, 0.12); border: 1px solid rgba(48, 209, 88, 0.35);
  color: var(--acc); font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.maxbtn:active { transform: scale(0.95); }

/* numbered deposit steps — widget deposit-mode style */
.dsteps { list-style: none; margin: 0 0 4px; padding: 0; counter-reset: step; }
.dsteps > li { position: relative; padding: 2px 0 8px 36px; margin-bottom: 10px; font-size: 14.5px; }
.dsteps > li:last-child { margin-bottom: 0; }
.dsteps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px; width: 25px; height: 25px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--dim);
  display: flex; align-items: center; justify-content: center;
}
.dsteps .field { margin-top: 8px; }
.dsteps .addrbox { margin-top: 10px; }

.powered { text-align: center; color: var(--faint); font-size: 12px; margin: 14px 0 0; }

/* token pill */
.token-btn {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px;
  padding: 8px 13px 8px 8px; color: var(--txt);
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px;
  cursor: pointer; max-width: 172px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.2s, transform 0.15s var(--spring);
}
.token-btn:hover { background: rgba(255, 255, 255, 0.13); }
.token-btn:active { transform: scale(0.96); }
.token-btn .chev { color: var(--faint); font-size: 11px; }
#from-sym, #to-sym, #send-sym { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticon {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #3a3a40, #1d1d21);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--acc);
}

/* ---------- fields ---------- */
.field { margin: 16px 0 4px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--dim); }
input, select {
  width: 100%; margin-top: 7px; padding: 13px 14px;
  background: var(--well); color: var(--txt);
  border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 14px; font-size: 15px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: rgba(48, 209, 88, 0.45); }
input::placeholder { color: #4a4a50; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2398989f' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.adv { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.adv summary {
  cursor: pointer; color: var(--faint); font-size: 13px; font-weight: 500;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint); transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.adv[open] summary::after { transform: rotate(-135deg); }
.row2 { display: flex; gap: 12px; margin-top: 10px; }
.row2 label { flex: 1; }

/* ---------- private row ---------- */
.privrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding: 12px 15px;
  background: rgba(48, 209, 88, 0.06);
  border: 1px solid rgba(48, 209, 88, 0.16); border-radius: 16px;
  transition: background 0.25s, border-color 0.25s;
}
.privrow:has(input:checked) {
  background: rgba(48, 209, 88, 0.11);
  border-color: rgba(48, 209, 88, 0.38);
  box-shadow: 0 0 24px rgba(48, 209, 88, 0.12);
}
.privrow .toggle { font-size: 14.5px; font-weight: 700; color: var(--txt); letter-spacing: -0.1px; }
.privrow .toggle .tgl { margin-top: 0; }
#priv-desc { text-align: right; }

/* ---------- buttons ---------- */
button { font-family: inherit; transition: transform 0.15s var(--spring), filter 0.2s, opacity 0.2s; }
button.primary {
  width: 100%; margin-top: 16px; padding: 16px;
  background: #f5f5f7; color: #000;
  border: none; border-radius: 17px;
  font-size: 16.5px; font-weight: 700; letter-spacing: -0.2px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
button.primary:hover:not(:disabled) { filter: brightness(1.04); }
button.primary:active:not(:disabled) { transform: scale(0.975); }
button.primary:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
button:not(.primary):not(.flip):not(.token-btn):not(.tab):not(#modal-close):not(#ratebox-head):not(.maxbtn):not(.icon-btn):not(.hist-row):not(.qpair) {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  color: var(--txt);
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s var(--spring), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
button:not(.primary):not(.flip):not(.token-btn):not(.tab):not(#modal-close):not(#ratebox-head):not(.maxbtn):not(.icon-btn):not(.hist-row):not(.qpair):hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 22px rgba(0, 0, 0, 0.32);
}
button:not(.primary):not(.flip):not(.token-btn):not(.tab):not(#modal-close):not(#ratebox-head):not(.maxbtn):not(.icon-btn):not(.hist-row):not(.qpair):active { transform: translateY(0) scale(0.97); }
.btnrow { display: flex; gap: 10px; margin-top: 6px; }
.btnrow button { flex: 1; }
.btnrow .primary { margin-top: 0; flex: 1.6; }

/* balance line under YOU SEND */
.bal { color: var(--acc); font-weight: 600; margin-right: 8px; }
.bal:empty { display: none; }

/* header icon button + history dropdown */
.icon-btn {
  margin-left: 8px; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { border-color: rgba(48, 209, 88, 0.45); }
.icon-btn:active { transform: scale(0.92); }
.history-panel {
  position: absolute; top: 78px; right: 16px; z-index: 60;
  width: min(320px, calc(100vw - 24px));
  max-height: 320px; overflow-y: auto;
  background: rgba(28, 28, 32, 0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 6px;
  animation: panelIn 0.2s ease;
}
.hist-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--txt); cursor: pointer;
  font-size: 13.5px; text-align: left;
  transition: background 0.15s ease;
}
.hist-row:hover { background: rgba(255, 255, 255, 0.06); }
.hist-row:active { transform: scale(0.99); }
.hist-pair { font-weight: 700; flex: none; }
.hist-amt { color: var(--dim); flex: 1; text-align: right; }
.hist-time { color: var(--dim); font-size: 12px; flex: none; }
.hist-empty { padding: 18px 14px; color: var(--dim); font-size: 13.5px; text-align: center; }

/* 7d price sparkline */
.spark { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.spark:empty { display: none; }
.spark svg { display: block; opacity: 0.95; }
.spark-chg { font-size: 11px; font-weight: 700; }
.spark-chg.up { color: #30d158; }
.spark-chg.dn { color: #ff453a; }
.spark-load {
  width: 64px; height: 20px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

/* ondo toggle in token picker */
.ondo-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 4px 4px; font-size: 13px; color: var(--dim);
  cursor: pointer; user-select: none;
}
.ondo-row input { accent-color: #30d158; width: 15px; height: 15px; cursor: pointer; }
.ondo-row em { font-style: normal; opacity: 0.65; font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.dim { color: var(--dim); } .small { font-size: 13px; }
.err { color: var(--err); font-size: 13.5px; min-height: 1.3em; margin: 8px 2px 0; }
.notice {
  background: rgba(255, 214, 10, 0.07); border: 1px solid rgba(255, 214, 10, 0.25);
  color: #ffd60a; border-radius: 15px; padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* ---------- review sheet ---------- */
.kv { margin: 0 0 12px; }
.kv > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--hairline);
}
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--dim); font-size: 13.5px; }
.kv dd { margin: 0; text-align: right; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
#r-out { color: var(--acc); }

/* ---------- deposit ---------- */
.addrbox {
  display: flex; gap: 8px; align-items: center;
  background: var(--well); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px; padding: 12px; margin: 10px 0;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}
.addrbox code {
  flex: 1; word-break: break-all; font-size: 13px; line-height: 1.6;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--txt);
}
.qr {
  display: block; margin: 14px auto; width: 184px; height: 184px;
  background: #fff; border-radius: 18px; padding: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

/* ---------- status ---------- */
.steps { list-style: none; padding: 0; margin: 2px 0 14px; }
.steps li {
  padding: 11px 0 11px 34px; position: relative;
  color: var(--faint); font-size: 14.5px; font-weight: 500;
  border-bottom: 1px solid var(--hairline);
  transition: color 0.3s;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: ""; position: absolute; left: 4px; top: 15px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid #3a3a3f; transition: all 0.3s;
}
.steps li.done { color: var(--txt); }
.steps li.done::before { border-color: var(--acc); background: var(--acc); box-shadow: 0 0 10px rgba(48, 209, 88, 0.5); }
.steps li.now { color: #fff; font-weight: 700; }
.steps li.now::before {
  border-color: var(--blue); background: transparent;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(10, 132, 255, 0); }
}
.steps li.bad { color: var(--err); }
.steps li.bad::before { border-color: var(--err); background: var(--err); }

/* ---------- iOS switch ---------- */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.tgl {
  width: 51px; height: 31px; border-radius: 16px; flex: none;
  background: rgba(120, 120, 128, 0.32); position: relative;
  transition: background 0.25s var(--spring);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.tgl::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--spring);
}
.toggle input:checked + .tgl { background: var(--acc); }
.toggle input:checked + .tgl::after { transform: translateX(20px); }
.toggle input:disabled + .tgl { opacity: 0.35; }

/* ---------- token sheet ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein 0.22s ease both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 560px) { .modal { align-items: center; } }
.modal-box {
  width: 100%; max-width: 430px; max-height: 76vh;
  background: rgba(32, 32, 36, 0.92);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px 24px 0 0;
  padding: 10px 16px 20px; display: flex; flex-direction: column;
  box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.6);
  animation: sheetup 0.32s var(--spring) both;
}
@keyframes sheetup {
  from { opacity: 0.6; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}
@media (min-width: 560px) { .modal-box { border-radius: 24px; } }
.modal-box::before {
  content: ""; display: block; width: 38px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.25); margin: 2px auto 12px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
#modal-close {
  background: rgba(255, 255, 255, 0.08); border: none; color: var(--dim);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
}
#token-search { margin-bottom: 8px; border-radius: 13px; }
#token-list { overflow-y: auto; }
.token-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; border-radius: 14px; padding: 11px 8px;
  color: var(--txt); cursor: pointer; text-align: left; font-size: 15px;
  transition: background 0.15s;
}
.token-row:hover { background: rgba(255, 255, 255, 0.05); }
.token-row:active { transform: scale(0.99); }
.token-row .ticon { width: 38px; height: 38px; font-size: 15px; }
.token-row .tmeta { flex: 1; min-width: 0; }
.token-row .tmeta b { display: block; font-weight: 600; letter-spacing: -0.1px; }
.token-row .tmeta span {
  color: var(--dim); font-size: 11.5px; display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.token-row .hood-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px; color: var(--acc);
  background: var(--acc-soft); border-radius: 7px; padding: 4px 8px;
}

/* ---------- footer ---------- */
footer { padding: 4px 6px; }
footer p { margin: 7px 0; }
.f-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 20px; margin: 20px 0 6px; text-align: left; }
.f-logo { display: flex; align-items: center; gap: 9px; margin: 0 0 4px; }
.f-logo img { border-radius: 7px; }
.f-logo b { font-size: 16px; color: #fff; }
.f-brand p { font-size: 13px; }
.f-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin: 2px 0 10px; }
.f-col a { display: block; color: var(--dim); text-decoration: none; font-size: 13.5px; margin: 9px 0; }
.f-col a:hover { color: var(--sun); }
.f-fee { margin-top: 14px; }
.risk { font-size: 11.5px; color: var(--faint); }
.f-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 14px; padding: 12px 2px 6px; font-size: 12px; color: var(--faint); }
.social { text-align: left; margin-top: 12px; }
.x-link { display: inline-flex; align-items: center; gap: 8px; color: var(--sun); text-decoration: none; font-weight: 600; font-size: 14px; }
.x-link:hover { opacity: 0.85; }
.x-link:active { opacity: 0.7; }
@media (max-width: 640px) {
  .f-grid { grid-template-columns: 1fr 1fr; gap: 18px 14px; }
  .f-brand { grid-column: 1 / -1; }
  .f-bottom { flex-direction: column; text-align: center; }
}
/* ---------- legal pages ---------- */
.legal { max-width: 740px; margin: 0 auto; padding: 28px 18px 70px; }
.legal .back { display: inline-block; margin-bottom: 18px; font-size: 14px; }
.legal h1 { font-size: 26px; margin: 0 0 6px; }
.legal .updated { color: var(--faint); font-size: 13px; margin-bottom: 20px; }
.legal h2 { font-size: 17px; margin: 26px 0 8px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.65; color: var(--dim); }
.legal ul { padding-left: 20px; }
.legal a { color: var(--sun); }
a { color: var(--blue); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- token icons with chain badges ---------- */
.ticon-slot { display: inline-flex; flex: none; }
.ticon-wrap { position: relative; display: inline-flex; flex: none; }
.ticon { overflow: hidden; padding: 0; }
.ticon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticon b {
  font-size: 12px; font-weight: 800; color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.token-row .ticon b { font-size: 14px; }
.cbadge {
  position: absolute; right: -4px; bottom: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cc, #8e8e93); color: #fff;
  font-size: 8.5px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #17171b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.cbadge-img { background: #17171b; overflow: hidden; padding: 0; }
.cbadge-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.token-row .cbadge { width: 17px; height: 17px; font-size: 9px; }

/* ---------- wallet connect ---------- */
.wallet-btn {
  margin-left: 8px; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); color: var(--txt);
  font-size: 13px; font-weight: 700; letter-spacing: 0.1px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s, transform 0.2s var(--spring);
}
.wallet-btn:hover { background: rgba(255, 255, 255, 0.11); }
.wallet-btn:active { transform: scale(0.94); }
.wallet-btn .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc); box-shadow: 0 0 9px var(--acc);
  animation: pulse 2s ease-in-out infinite;
}
.wallet-btn.connected {
  border-color: rgba(48, 209, 88, 0.45);
  background: var(--acc-soft);
}

/* ---------- divider ---------- */
.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 6px; color: var(--faint);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* ---------- private aura ---------- */
.card.priv-on {
  border-color: rgba(48, 209, 88, 0.35);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 55px rgba(48, 209, 88, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* ---------- gradient wordmark ---------- */
.brand-text h1 {
  background: linear-gradient(180deg, #ffffff 25%, #a9f5c3 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ============================================================
   UI POLISH PASS — quiet luxury refinements
   ============================================================ */

/* vignette over the forest */
.bg::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 38%, transparent 50%, rgba(2, 6, 4, 0.55) 100%);
}
/* organic film grain — whispers over everything */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 120; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  .bg, .bg::before, .motes i { animation: none !important; }
}

/* Touch devices: trade GPU-heavy glassmorphism for solid surfaces.
   Stacked backdrop-filter blurs over animated mist/motes/grain drop frames
   on phone GPUs — this keeps the look, drops the jank. Desktop untouched. */
@media (hover: none), (pointer: coarse) {
  * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .bg, .bg::before { animation: none !important; }
  .motes { display: none !important; }
  body::after { display: none !important; } /* film grain */
  .ticker-track { animation: none !important; }
  .ticker { overflow-x: auto; scrollbar-width: none; }
  .ticker::-webkit-scrollbar { display: none; }
  .card.priv-on::before { animation: none !important; opacity: 0 !important; }
  .card { background: rgba(12, 19, 15, 0.97); }
  .brand { background: rgba(5, 7, 6, 0.96); }
  .modal { background: rgba(0, 0, 0, 0.72); }
  .modal-box { background: rgb(28, 30, 28); }
  .history-panel { background: rgb(28, 28, 32); }
  .notice { background: rgba(60, 50, 10, 0.35); }
}

/* sticky frosted header — app feel */
.brand {
  position: sticky; top: 0; z-index: 45;
  margin: 0 -16px 20px; padding: 12px 18px;
  background: rgba(6, 6, 8, 0.62);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand .logo { width: 36px; height: 36px; border-radius: 11px; }
/* keep the header's right-side controls inside the bar at any width:
   the tagline yields, buttons never shrink or wrap */
.brand-text { flex: 1; min-width: 0; }
.brand-text .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .badge, .brand .icon-btn, .brand .wallet-btn { flex: none; }
@media (max-width: 560px) { .brand-text .sub { display: none; } }
.brand-text h1 { font-size: 18px; }

/* primary CTA — sheen sweep + deeper press physics */
button.primary {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #e9e9ee 100%);
  box-shadow:
    0 12px 32px rgba(255, 255, 255, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
button.primary::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.65) 50%, transparent 58%);
  transform: translateX(-130%);
  pointer-events: none;
}
button.primary:hover:not(:disabled)::after {
  transform: translateX(130%);
  transition: transform 0.8s ease;
}
button.primary:active:not(:disabled) { transform: scale(0.97); filter: brightness(0.97); }

/* panels — focus glow ring, deeper well */
.panel {
  transition: border-color 0.25s, box-shadow 0.25s;
}
.panel:focus-within {
  border-color: rgba(48, 209, 88, 0.5);
  box-shadow:
    inset 0 2px 14px rgba(0, 0, 0, 0.4),
    0 0 0 4px rgba(48, 209, 88, 0.07),
    0 0 26px rgba(48, 209, 88, 0.08);
}
.panel-body input {
  font-weight: 700;
  caret-color: var(--acc);
}
.panel-body input:not(:placeholder-shown) {
  text-shadow: 0 0 32px rgba(255, 255, 255, 0.14);
}

/* hero numerals for the live quote */
#est-out {
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
}
#ratebox-head {
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
}
#ratebox-head b { font-weight: 700; }

/* review / deposit / status cards slide up like sheets */
#review-card:not(.hidden), #deposit-card:not(.hidden), #status-card:not(.hidden) {
  animation: sheetup 0.38s var(--spring) both;
}
#r-out {
  font-size: 17px;
  text-shadow: 0 0 22px rgba(48, 209, 88, 0.35);
}

/* status timeline — connecting rail */
.steps li::after {
  content: ""; position: absolute; left: 10px; top: 36px; bottom: -4px;
  width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08);
  transition: background 0.3s;
}
.steps li:last-child::after { display: none; }
.steps li.done::after { background: rgba(48, 209, 88, 0.45); }

/* private aura — breathing glow. Opacity-only animation: animating box-shadow
   here would repaint the blurred card every frame. The ::before layer pulses
   on the compositor instead. */
.card.priv-on { position: relative; }
.card.priv-on::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  box-shadow: 0 0 85px rgba(48, 209, 88, 0.17);
  opacity: 0; animation: auraFade 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes auraFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* thin elegant scrollbars */
#token-list::-webkit-scrollbar, .history-panel::-webkit-scrollbar { width: 8px; }
#token-list::-webkit-scrollbar-thumb, .history-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14); border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
#token-list::-webkit-scrollbar-track, .history-panel::-webkit-scrollbar-track { background: transparent; }

/* token rows — springier press */
.token-row { transition: background 0.15s, transform 0.15s var(--spring); }
.token-row:active { transform: scale(0.98); }

/* quick chips — subtle top light */
.qpair {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* keyboard focus visibility */
:focus-visible {
  outline: 2px solid rgba(48, 209, 88, 0.75);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ============================================================
   BUTTON SYSTEM — every button gets depth, light and physics
   ============================================================ */

/* token pills — glassy with green hover glow */
.token-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s var(--spring), background 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.token-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.08));
  border-color: rgba(48, 209, 88, 0.45);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 20px rgba(48, 209, 88, 0.14);
}
.token-btn:active { transform: translateY(0) scale(0.95); }
.token-btn .chev { transition: transform 0.2s var(--spring); }
.token-btn:hover .chev { transform: translateY(2px); }

/* flip hover glow lives in the consolidated .flip block above */

/* MAX — brighter on hover */
.maxbtn { transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s; }
.maxbtn:hover { background: rgba(48, 209, 88, 0.22); box-shadow: 0 0 16px rgba(48, 209, 88, 0.3); }
.maxbtn:active { transform: scale(0.92); }

/* quick chips — lift on hover */
.qpair:hover { transform: translateY(-1px); }

/* wallet button — glow when connected */
.wallet-btn.connected:hover {
  box-shadow: 0 0 20px rgba(48, 209, 88, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* copy buttons in the deposit card — compact pills */
.addrbox button {
  padding: 9px 15px; font-size: 13px; border-radius: 999px; flex: none;
}

/* segmented tabs — press feedback */
.tabs .tab:active { transform: scale(0.96); }

/* iOS switch — glow when on */
.toggle input:checked + .tgl {
  box-shadow: 0 0 18px rgba(48, 209, 88, 0.45), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* review-sheet buttons — Back / Copy link pairing */
#review-card .btnrow button:not(.primary) { padding: 14px 10px; font-size: 14px; }

/* recipient address row — input + "Use wallet" shortcut */
.addr-row { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.addr-row input { flex: 1; min-width: 0; margin-top: 0 !important; }
.use-wallet {
  flex: none; padding: 0 14px !important;
  font-size: 13px !important; font-weight: 700 !important;
  color: #30d158 !important;
  background: rgba(48, 209, 88, 0.1) !important;
  border: 1px solid rgba(48, 209, 88, 0.35) !important;
  border-radius: 999px !important;
  white-space: nowrap;
}
.use-wallet:hover {
  background: rgba(48, 209, 88, 0.18) !important;
  border-color: rgba(48, 209, 88, 0.6) !important;
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.25);
  transform: translateY(-1px);
}
.use-wallet:active { transform: scale(0.95); }

/* ================= NATURE THEME — forest dawn ================= */
::selection { background: rgba(99, 217, 119, 0.35); }

/* fireflies / pollen drifting up through the light */
.motes { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.motes i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 232, 170, 0.95) 0%, rgba(255, 232, 170, 0) 70%);
  /* glow via box-shadow, not filter: blur() — per-element filters force software
     rendering and jank the whole page on every frame */
  box-shadow: 0 0 6px 1px rgba(255, 232, 170, 0.45);
  opacity: 0;
  animation: moteRise linear infinite;
  will-change: transform, opacity;
}
@keyframes moteRise {
  0% { transform: translate3d(0, 14vh, 0) scale(0.8); opacity: 0; }
  14% { opacity: var(--mo, 0.7); }
  78% { opacity: var(--mo, 0.7); }
  100% { transform: translate3d(var(--sway, 5vw), -112vh, 0) scale(1.1); opacity: 0; }
}
.motes i:nth-child(1) { left: 6%;  top: 92%; width: 5px; height: 5px; animation-duration: 21s; animation-delay: -6s;  --sway: 7vw;  --mo: 0.8; }
.motes i:nth-child(2) { left: 22%; top: 96%; width: 3px; height: 3px; animation-duration: 27s; animation-delay: -14s; --sway: -5vw; --mo: 0.55; }
.motes i:nth-child(3) { left: 41%; top: 90%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -2s;  --sway: 6vw;  --mo: 0.7; }
.motes i:nth-child(4) { left: 58%; top: 94%; width: 6px; height: 6px; animation-duration: 24s; animation-delay: -11s; --sway: -7vw; --mo: 0.85; }
.motes i:nth-child(5) { left: 73%; top: 91%; width: 3px; height: 3px; animation-duration: 30s; animation-delay: -20s; --sway: 5vw;  --mo: 0.5; }
.motes i:nth-child(6) { left: 88%; top: 95%; width: 4px; height: 4px; animation-duration: 22s; animation-delay: -9s;  --sway: -6vw; --mo: 0.75; }
.motes i:nth-child(7) { left: 33%; top: 98%; width: 3px; height: 3px; animation-duration: 26s; animation-delay: -17s; --sway: 8vw;  --mo: 0.6; }
.motes i:nth-child(8) { left: 66%; top: 89%; width: 5px; height: 5px; animation-duration: 19s; animation-delay: -4s;  --sway: -4vw; --mo: 0.7; }

/* sunlight primary — the new hero button */
button.primary {
  background: linear-gradient(180deg, #ffedb8 0%, #ffd98a 52%, #f2ba5e 100%);
  color: var(--sun-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
  box-shadow:
    0 14px 38px rgba(240, 185, 92, 0.30),
    0 3px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(122, 72, 10, 0.28);
}
button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.045);
  box-shadow:
    0 18px 46px rgba(240, 185, 92, 0.38),
    0 3px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(122, 72, 10, 0.28);
}
button.primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.97);
}

/* moss-glass secondary buttons */
button.secondary {
  background: linear-gradient(180deg, rgba(205, 238, 205, 0.11), rgba(205, 238, 205, 0.03));
  border: 1px solid rgba(205, 238, 205, 0.16);
  box-shadow: inset 0 1px 0 rgba(220, 245, 220, 0.08), 0 6px 18px rgba(0, 0, 0, 0.28);
}
button.secondary:hover:not(:disabled) {
  border-color: rgba(255, 217, 138, 0.38);
  color: var(--sun);
  box-shadow: inset 0 1px 0 rgba(220, 245, 220, 0.10), 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 18px rgba(255, 217, 138, 0.12);
}

/* sunrise focus — panels wake up warm */
.panel:focus-within {
  border-color: rgba(255, 217, 138, 0.38);
  box-shadow:
    0 0 0 3px rgba(255, 217, 138, 0.10),
    0 0 28px rgba(255, 217, 138, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

/* moss sheet — the card grows out of the forest */
.card {
  background: linear-gradient(180deg, rgba(36, 58, 42, 0.60), rgba(11, 21, 14, 0.66));
  border: 1px solid rgba(215, 238, 215, 0.12);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(63, 160, 96, 0.06),
    inset 0 1px 0 rgba(225, 245, 225, 0.09);
}

/* dawn wordmark */
.brand-text h1 {
  background: linear-gradient(100deg, #ffe9ad 5%, #c4ecC6 52%, #63d977 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand .logo {
  box-shadow: 0 6px 22px rgba(240, 185, 92, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* forest-tinted sticky header */
.brand {
  background: rgba(6, 13, 9, 0.60);
  border-bottom: 1px solid rgba(215, 238, 215, 0.07);
}

/* token pills glow like leaves in sun */
.token-pill:hover { box-shadow: 0 0 0 1px rgba(99, 217, 119, 0.4), 0 0 20px rgba(99, 217, 119, 0.22), 0 4px 14px rgba(0,0,0,.3); }

/* review CTA inherits the sunlight */
.review-cta { border-radius: 20px; }

/* softer, more organic geometry everywhere */
.panel, .quote-box, .history-card, .status-card { border-radius: 22px; }
input, select, textarea { border-radius: 16px; }

/* ================= REAL NATURE PHOTO BACKGROUND ================= */
.bg {
  background:
    linear-gradient(180deg, rgba(4, 10, 6, 0.68) 0%, rgba(4, 10, 6, 0.30) 28%, rgba(4, 10, 6, 0.46) 62%, rgba(3, 6, 4, 0.92) 100%),
    radial-gradient(560px 380px at 50% -10%, rgba(255, 217, 138, 0.12), transparent 65%),
    url("forest-bg.jpg");
  background-size: cover, cover, cover;
  background-position: center 32%, center, center 32%;
}

/* ================= POPULAR PAIRS ================= */
.quick-label {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 2px 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase; color: var(--faint);
}
.quick-label .qdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 10px var(--sun);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ================= RABBY-STYLE WALLET ================= */
.ident { width: 22px; height: 22px; border-radius: 7px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.wallet-btn .cdot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--acc); box-shadow: 0 0 9px var(--acc);
  animation: pulse 2s ease-in-out infinite;
}

/* connect sheet */
.wmodal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(2, 6, 4, 0.62);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.22s ease;
}
.wmodal.open { opacity: 1; }
.wsheet {
  width: 100%; max-width: 430px;
  background: linear-gradient(180deg, rgba(40, 64, 46, 0.94), rgba(12, 22, 15, 0.96));
  border: 1px solid rgba(215, 238, 215, 0.15); border-bottom: none;
  border-radius: 26px 26px 0 0; padding: 10px 20px 30px;
  box-shadow: 0 -18px 70px rgba(0, 0, 0, 0.55);
  transform: translateY(36px); transition: transform 0.3s var(--spring);
}
.wmodal.open .wsheet { transform: none; }
@media (min-width: 540px) {
  .wmodal { align-items: center; padding: 20px; }
  .wsheet { border-radius: 26px; border-bottom: 1px solid rgba(215, 238, 215, 0.15); }
}
.wsheet h3 { margin: 10px 0 2px; font-size: 18px; letter-spacing: -0.2px; }
.sheet-handle { width: 42px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); margin: 2px auto 4px; }
.wopt {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px; margin-top: 9px; border-radius: 17px;
  background: rgba(205, 238, 205, 0.05);
  border: 1px solid rgba(205, 238, 205, 0.12);
  color: var(--txt); font-size: 15px; text-align: left; text-decoration: none;
  cursor: pointer; transition: background 0.18s, border-color 0.18s, transform 0.18s var(--spring);
  font-family: inherit;
}
.wopt:hover { background: rgba(205, 238, 205, 0.10); border-color: rgba(255, 217, 138, 0.38); transform: translateY(-1px); }
.wopt:active { transform: scale(0.98); }
.wopt-ic {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.wopt-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.wopt-name { font-weight: 700; }
.wopt-sub { font-size: 12px; color: var(--dim); font-weight: 500; }
.wopt-go { color: var(--faint); font-size: 17px; }

/* connected account menu */
.wmenu {
  position: fixed; z-index: 210; min-width: 258px;
  background: linear-gradient(180deg, rgba(40, 64, 46, 0.97), rgba(12, 22, 15, 0.98));
  border: 1px solid rgba(215, 238, 215, 0.15); border-radius: 19px; padding: 8px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.62);
  opacity: 0; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.2s var(--spring);
}
.wmenu.open { opacity: 1; transform: none; }
.wm-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 6px; }
.wm-head .ident { width: 36px; height: 36px; border-radius: 12px; }
.wm-id { display: flex; flex-direction: column; gap: 1px; }
.wm-id b { font-size: 14.5px; letter-spacing: 0.1px; }
.wm-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border-radius: 13px; background: none; border: none;
  color: var(--txt); font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; text-align: left;
  transition: background 0.15s ease;
}
.wm-row:hover { background: rgba(205, 238, 205, 0.09); }
.wm-row.danger { color: #ff8a80; }
.wm-row > span:first-child { width: 18px; text-align: center; }

/* ================= MORE INTERESTING ================= */
/* live price ticker */
.ticker {
  overflow: hidden; margin: 0 -16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: inline-flex; align-items: center; gap: 16px;
  white-space: nowrap; padding: 7px 0;
  animation: tick 38s linear infinite; will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.tk { font-size: 12px; color: var(--dim); letter-spacing: 0.2px; }
.tk b { color: var(--txt); font-weight: 700; margin-right: 5px; }
.tk-sep { color: var(--faint); font-size: 10px; }

/* leaves that burst when a quote locks */
.burst-leaf {
  position: fixed; z-index: 300; width: 11px; height: 14px;
  border-radius: 0 62% 0 62%; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* flip button spin is handled by the consolidated .flip block above */

/* fireflies turn green in private mode */
body.priv .motes i {
  background: radial-gradient(circle, rgba(150, 255, 180, 0.95) 0%, rgba(150, 255, 180, 0) 70%);
  animation-duration: 11s;
}

/* busy shimmer on the confirm CTA while the quote locks */
button.primary.busy { pointer-events: none; }
button.primary.busy::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  animation: busySweep 1.1s ease-in-out infinite;
}
@keyframes busySweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ---------- Stats tab ---------- */
#swap-card.stats-mode .form-only { display: none !important; }
#swap-card.token-mode .form-only { display: none !important; }
.stats-keyrow { display: flex; gap: 8px; margin: 2px 0 8px; }
.stats-keyrow input { flex: 1; }
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 4px; }
.scard { background: var(--well); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 12px 10px; text-align: center; }
.scard .n { font-size: 22px; font-weight: 800; color: #ffe9a8; letter-spacing: -0.3px; }
.scard .l { font-size: 11px; color: var(--dim); margin-top: 2px; }
.stats-h { font-size: 13px; font-weight: 700; color: #cfe0c9; margin: 16px 0 8px; letter-spacing: 0.2px; }
.sbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.sbar-label { width: 150px; flex: none; color: #cfe0c9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar-track { flex: 1; height: 9px; background: rgba(255,255,255,0.07); border-radius: 6px; overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #5da24f, #8fe388); }
.sbar-val { width: 36px; text-align: right; color: var(--dim); flex: none; }
.stats-days { display: flex; align-items: flex-end; gap: 5px; height: 100px; }
.sday { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sday .scol { width: 100%; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #8fe388, #3f7a37); }
.sday .sdl { font-size: 9.5px; color: var(--dim); }
.serr { font-size: 12.5px; color: #e8a0a0; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.serr b { color: #f0c0c0; }
@media (max-width: 560px) { .stats-cards { grid-template-columns: repeat(2, 1fr); } .sbar-label { width: 110px; } }

/* ---------- wallet logos ---------- */
.wlogo { width: 30px; height: 30px; border-radius: 9px; object-fit: contain; background: rgba(255,255,255,0.09); padding: 3px; flex: none; }
.wlogo.sm { width: 22px; height: 22px; border-radius: 50%; padding: 2px; }
/* ---------- status ---------- */
#status-line.warn { color: #f0c060; }
.refund-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(240, 192, 96, .07);
  border: 1px solid rgba(240, 192, 96, .28);
}
.refund-panel p { margin: 0 0 10px; font-size: .92em; line-height: 1.45; }
.refund-panel .kv { margin: 0; }
.refund-panel code { font-size: .85em; word-break: break-all; }
#deposit-health {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #f5cf7a;
  background: rgba(240, 192, 96, 0.10);
  border: 1px solid rgba(240, 192, 96, 0.35);
}

/* ============ UI polish + performance pass ============ */
/* gradient wordmark */
.brand-text h1 {
  background: linear-gradient(100deg, #fff 30%, var(--sun) 62%, var(--acc) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* card top-glow edge */
.card { position: relative; }
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius);
  background: linear-gradient(90deg, transparent, rgba(255, 217, 138, 0.35) 30%, rgba(99, 217, 119, 0.35) 70%, transparent);
  pointer-events: none;
}
/* richer primary button with shine sweep */
button.primary {
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-deep) 100%);
  color: var(--sun-ink); font-weight: 700; letter-spacing: -0.1px;
  box-shadow: 0 8px 26px rgba(240, 185, 92, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  position: relative; overflow: hidden;
}
button.primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
  transform: translateX(-110%); pointer-events: none;
}
button.primary:hover::before { transform: translateX(110%); transition: transform 0.7s ease; }
button.primary:active { transform: scale(0.98); box-shadow: 0 4px 14px rgba(240, 185, 92, 0.25); }
button.primary:disabled { opacity: 0.55; }
button.primary:disabled::before { display: none; }
/* focus visibility for keyboard users */
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid rgba(99, 217, 119, 0.7); outline-offset: 2px;
}
/* token modal entrance */
#token-modal { animation: modalIn 0.22s var(--spring) backwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
#token-search { position: sticky; top: 0; z-index: 2; }
/* review rows with dividers */
.kv > div { padding: 9px 2px; border-bottom: 1px solid var(--hairline); }
.kv > div:last-child { border-bottom: none; }
/* amount panels lift on focus */
.panel { transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--spring); }
.panel:focus-within {
  border-color: rgba(255, 217, 138, 0.4);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 217, 138, 0.08);
  transform: translateY(-1px);
}
/* skip painting offscreen heavy sections until needed */
#stats-dash, #history-panel { content-visibility: auto; contain-intrinsic-size: auto 300px; }
/* ticker runs on the compositor */
.ticker-track { will-change: transform; }
/* shielded balances panel (private v2) */
#shield-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(167, 139, 250, 0.05) 55%, rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.shield-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: #efe7ff;
}
.shield-head code { font-size: 11.5px; }
#shield-bals { margin-bottom: 10px; }
.shield-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  margin: 6px 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.shield-row b { font-size: 15px; }
.shield-row .dim { font-size: 12px; }
.shield-row .moss {
  padding: 7px 14px; font-size: 13px; font-weight: 700; border-radius: 10px;
  flex-shrink: 0;
}
#shield-panel .btnrow { gap: 8px; }
#shield-panel .btnrow .moss { flex: 1; padding: 8px 0; font-size: 13px; border-radius: 10px; }
.shield-flash { animation: shieldFlash 1.1s ease; }
@keyframes shieldFlash {
  0%, 100% { box-shadow: 0 0 24px rgba(139, 92, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
  30% { box-shadow: 0 0 42px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
}

/* ---------- tokenized-stocks promo banner ---------- */
.stocks-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 14px; padding: 10px 12px;
  background: linear-gradient(100deg, rgba(20, 48, 32, 0.72), rgba(12, 30, 20, 0.60));
  border: 1px solid rgba(99, 217, 119, 0.28);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sb-icon { flex: none; display: flex; }
.sb-text { flex: 1; font-size: 13px; color: var(--dim); line-height: 1.35; }
.sb-text b { color: var(--txt); font-weight: 700; }
.sb-btn {
  flex: none; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--sun), var(--sun-deep));
  color: var(--sun-ink); font-weight: 800; font-size: 13px;
}
.sb-btn:active { transform: scale(0.97); }
.sb-x {
  flex: none; border: 0; cursor: pointer; background: none;
  color: var(--faint); font-size: 14px; padding: 6px 4px; line-height: 1;
}
.sb-x:active { color: var(--txt); }
@media (max-width: 420px) {
  .sb-text { font-size: 12px; }
  .sb-btn { padding: 7px 10px; font-size: 12px; }
}

/* ---------- tokenized-stocks section in the token picker ---------- */
.stocks-head {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 2px 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase; color: var(--faint);
}
.stocks-head .qdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 10px var(--sun);
  animation: pulse 2.4s ease-in-out infinite;
}
.stocks-head .dim { letter-spacing: 0.4px; text-transform: none; font-weight: 400; }
.stocks-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.stock-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px; cursor: pointer;
  background: var(--well); border: 1px solid var(--line); border-radius: 14px;
  color: var(--txt); font-size: 12px; font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.stock-chip:active { border-color: var(--acc); background: var(--acc-soft); }
.stock-chip .ticon { width: 34px; height: 34px; font-size: 12px; }
.stock-chip .cbadge { position: absolute; right: -5px; bottom: -5px; }

/* ================= Token tab + UI polish pass ================= */

/* tabs: 44px+ touch targets on all four tabs */
.tabs .tab {
  min-height: 44px; padding: 10px 0;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Token tab ---------- */
.tok-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.tok-emblem {
  width: 50px; height: 50px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 26px; color: #ffe9a8;
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.25), rgba(20, 60, 34, 0.5));
  border: 1px solid rgba(255, 217, 138, 0.30);
  box-shadow: 0 0 24px rgba(48, 209, 88, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tok-name { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.tok-sub { margin: 2px 0 0; }
.tok-buy { margin-top: 12px; }
.tok-buy:disabled { opacity: 0.5; cursor: default; }
.tok-buy:disabled::before { display: none; }
.tok-ca {
  background: var(--well); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin: 2px 0 4px;
}
.tok-ca code {
  display: block; font-size: 13.5px; line-height: 1.6;
  word-break: break-all; color: var(--txt);
}
.tok-ca-actions { display: flex; gap: 8px; margin-top: 10px; }
.tok-ca-actions button, .tok-ca-actions .tok-link {
  flex: 1; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.tok-ca-actions button {
  font-family: inherit;
  background: linear-gradient(180deg, rgba(255, 217, 138, 0.22), rgba(240, 185, 92, 0.12));
  border: 1px solid rgba(255, 217, 138, 0.35); color: #ffe9a8;
  transition: transform 0.15s var(--spring), filter 0.2s;
}
.tok-ca-actions button:hover { filter: brightness(1.1); }
.tok-ca-actions button:active { transform: scale(0.97); }
.tok-ca-actions .tok-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); color: var(--txt);
}
.tok-ca-actions .tok-link:hover { border-color: rgba(255, 217, 138, 0.4); }
.tier-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; margin-bottom: 8px;
  background: var(--well); border: 1px solid var(--line); border-radius: 14px;
  font-size: 14px;
}
.tier-row b { color: var(--txt); }
.tier-row .tier-fee { color: #ffe9a8; font-variant-numeric: tabular-nums; }
.tier-row.base { border-style: dashed; }

/* ---------- tap targets >= 44px ---------- */
.sb-x { min-width: 44px; min-height: 44px; }
.sb-btn { min-height: 44px; }
#modal-close { width: 44px; height: 44px; }
.icon-btn { width: 44px; height: 44px; }
.qpair { min-height: 44px; }
.stock-chip { min-height: 44px; }
.token-row { min-height: 56px; }
.maxbtn { min-height: 44px; padding: 4px 12px; font-size: 12px; }
.use-wallet { min-height: 44px; }

/* ---------- mobile layout safety ---------- */
html, body { overflow-x: clip; }
.wrap { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.modal-box { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 480px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .card { padding: 16px; }
}
/* stocks banner wraps instead of overflowing on narrow screens */
.stocks-banner { flex-wrap: wrap; }
.sb-text { flex: 1 1 180px; min-width: 0; }
/* iOS won't auto-zoom form fields at >= 16px */
input, select, textarea { font-size: 16px; }
#amount, #send-amount { font-size: 38px; } /* hero amount size kept */

/* ---------- desktop rhythm ---------- */
@media (min-width: 768px) {
  .wrap { max-width: 460px; padding-top: 28px; }
  .card { padding: 22px; }
}

/* ---------- hover + focus polish ---------- */
.qpair:hover { border-color: rgba(48, 209, 88, 0.4); background: rgba(48, 209, 88, 0.10); }
.stock-chip:hover { border-color: rgba(48, 209, 88, 0.4); background: rgba(48, 209, 88, 0.08); }
a:focus-visible {
  outline: 2px solid rgba(99, 217, 119, 0.7); outline-offset: 2px; border-radius: 6px;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}
