/* The new look of the wallet. Calm, flat, native: no blur, no glow, no gradients.
   Telegram's own colours (core.js → paintTheme) for background and text; the main button is the text colour inverted (no accent colour);
   every account has its own solid colour so you always know where you are. */
:root {
  --bg: #ffffff; --fg: #14161a; --hint: #7d828b; --sheet: #ffffff; --card: #f2f3f6; --line: rgba(20, 22, 26, .10);
  --pos: #1b9a58; --neg: #d23b32;
  --acc-all: #262a31; --acc-usd: #2c8863; --acc-card: #3b3f48; --acc-crypto: #3d6bcf;
  --stage: var(--acc-all);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --H: var(--app-h, 100vh);
  --sa-t: env(safe-area-inset-top, 0px); --sa-b: env(safe-area-inset-bottom, 0px);
}
:root[data-scheme="dark"] {
  --bg: #16171a; --fg: #f1f2f4; --hint: #8b9099; --sheet: #1c1d21; --card: #26272c; --line: rgba(255, 255, 255, .10);
  --pos: #4cc380; --neg: #ff6b62;
  --acc-all: #2a2e36; --acc-usd: #237a5b; --acc-card: #383c45; --acc-crypto: #3560c2;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.3 var(--font); color: var(--fg); background: var(--stage); -webkit-font-smoothing: antialiased; overscroll-behavior: none; transition: background-color .35s; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { display: block; }
.sel, input { -webkit-user-select: text; user-select: text; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--hint); }
[hidden] { display: none !important; }

#app { position: fixed; left: 0; right: 0; top: 0; height: var(--H); overflow: hidden; --q: 0; --r: 0; --hi: calc(var(--sa-t) + 58px); -webkit-user-select: none; user-select: none; background: var(--stage); transition: background-color .35s; }

/* ---------- one scroll: the coloured stage sticks to the top, the white sheet scrolls up over it in a single motion ---------- */
.page { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.page::-webkit-scrollbar { display: none; }

/* ---------- stage: what you have ---------- */
.stage { position: sticky; top: 0; padding: var(--hi) 0 18px; color: #fff; z-index: 0; }
/* the top bar stays put; the sheet slides under it */
.bar { position: absolute; left: 0; right: 0; top: 0; height: var(--hi); padding: var(--sa-t) 18px 0; display: flex; align-items: center; justify-content: space-between; background: var(--stage); transition: background-color .35s; color: #fff; z-index: 4; }
.ava, .icn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; border: 0; display: grid; place-items: center; overflow: hidden; padding: 0; font-weight: 600; font-size: 17px; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.icn svg { width: 22px; height: 22px; }
#app.flowing .mini { opacity: 1; }
.mini { position: absolute; left: 76px; right: 76px; top: var(--sa-t); height: 58px; line-height: 58px; text-align: center; font-weight: 600; font-size: 17px; opacity: calc(var(--r) * 2.5 - .5); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* --q: sheet low → middle (the amount shrinks to a compact line), --r: middle → top (the amount leaves, the title takes its place in the bar) */
.hero { padding: 0 18px; margin-top: 14px; opacity: calc(1 - var(--r) * 8); }
.hero .lbl { font-size: 14px; line-height: 18px; opacity: .8; }
/* the Visa account puts its card under the amount instead of beside it */
.card .row .t { white-space: normal; }
.amount { display: block; background: none; border: 0; padding: 0; margin: 2px 0 0; color: #fff; font-weight: 700; font-size: 44px; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; text-align: left; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount .dec { font-size: .6em; opacity: .62; font-weight: 600; }
.amount .unit { font-size: .55em; opacity: .7; margin-left: 5px; font-weight: 600; }
.hero .sub { color: #fff; font-size: 15px; opacity: .8; margin-top: 4px; min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the four main actions sit on the stage, under the amount */
.quick { display: flex; justify-content: space-between; padding: 0 22px; margin-top: 16px; opacity: calc(1 - var(--q) * 1.4); }
.quick:empty { display: none; }
.qa { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; padding: 0; font-size: 13px; font-weight: 500; min-width: 0; }
.qa i { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.qa i svg { width: 24px; height: 24px; }
.qa span { white-space: nowrap; }
.qa:active i { background: rgba(255, 255, 255, .3); }
.cardslot { height: 104px; margin-top: 14px; padding: 0 18px; display: flex; justify-content: center; opacity: calc(1 - var(--q) * 1.4); pointer-events: none; }
.cardslot:empty { display: none; }
.cface { height: 100%; aspect-ratio: 1.586; max-width: 100%; border-radius: 14px; padding: 12px 14px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); position: relative; }
.cface.d-orbit { background: #4a5163; } .cface.d-night { background: #15171c; } .cface.d-sunset { background: #a65a3a; } .cface.d-mint { background: #2b7765; }
.cface .ct { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.cface .ct small { font-weight: 600; opacity: .7; font-size: 11px; letter-spacing: .12em; }
.cface .cp { font-size: 17px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.cface .cb { display: flex; justify-content: space-between; font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .04em; gap: 8px; }
.cface .cb span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cface.frozen { filter: grayscale(1); opacity: .75; }
.cface .frz { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-weight: 700; font-size: 13px; background: rgba(0, 0, 0, .35); padding: 4px 0; }

/* ---------- sheet: what you do ---------- */
.sheet { position: relative; z-index: 1; min-height: calc(var(--H) - var(--hi)); background: var(--sheet); border-radius: 22px 22px 0 0; box-shadow: 0 -1px 0 rgba(255, 255, 255, .06); }
.grab { position: absolute; left: 0; right: 0; top: 0; height: 26px; display: grid; place-items: center; cursor: grab; z-index: 3; }
.grab i { width: 38px; height: 5px; border-radius: 3px; background: var(--line); display: block; filter: brightness(.9); }
:root[data-scheme="light"] .grab i { background: rgba(20, 22, 26, .18); }
:root[data-scheme="dark"] .grab i { background: rgba(255, 255, 255, .22); }
.chips { display: flex; gap: 8px; padding: 0 18px; height: 36px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; opacity: calc(1 - var(--r) * 3); }
#app.is-high .chips { pointer-events: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 15px; border-radius: 17px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; font-size: 15px; scroll-snap-align: start; }
.chip.on { background: #fff; color: #1b1d22; }
.scroll { padding: 26px 16px calc(var(--sa-b) + 32px); }

/* command bar and actions */
.cmd { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; border: 0; border-radius: 16px; background: var(--card); padding: 0 14px; color: var(--hint); font-size: 16px; text-align: left; margin-top: 2px; }
/* services: small tiles in one row */
.svc { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; touch-action: pan-x pan-y; }
.svc::-webkit-scrollbar { display: none; }
.sv { flex: 1 0 132px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 12px; border: 0; border-radius: 16px; background: var(--card); color: var(--fg); text-align: left; }
.sv .si { width: 34px; height: 34px; border-radius: 11px; color: #fff; display: grid; place-items: center; margin-bottom: 8px; }
.sv .si svg { width: 19px; height: 19px; }
.sv b { font-size: 14px; font-weight: 500; color: var(--hint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv .svv { font-size: 16px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv i { font-style: normal; font-size: 12.5px; color: var(--hint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv:active { opacity: .75; }
.cmd svg { width: 20px; height: 20px; flex: none; }
.cmd span { flex: 1; }
.cmd .scanbtn { width: 38px; height: 38px; border-radius: 12px; background: var(--sheet); display: grid; place-items: center; color: var(--fg); }
/* P2P: a card of its own, not a grey bar that looks switched off */
/* P2P screens (v2/p2p.js): the same lists, fields and buttons as everywhere else; only status words get a colour */
.p2st.pos { color: var(--pos); } .p2st.neg { color: var(--neg); } .p2st.warn { color: #b98300; } .p2st.muted { color: var(--hint); }
:root[data-scheme="dark"] .p2st.warn { color: #e0b23c; }
.p2st.pill { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 12px; background: var(--card); font-size: 14px; font-weight: 600; }
.tabs.p2tabs button { flex: 1; justify-content: center; padding: 0 10px; }
.p2lim { justify-content: center; margin-top: 4px; }
.p2timer { font-size: 34px; font-weight: 700; text-align: center; margin-top: 16px; }
.card .row .go { color: var(--hint); flex: none; } .card .row .go svg { width: 8px; height: 14px; }
.p2f { display: block; margin-top: 12px; } .p2f > span { display: block; color: var(--hint); font-size: 13px; margin: 0 2px 2px; }
.p2f .field { margin-top: 4px; }
.p2split { display: flex; gap: 10px; } .p2split > * { flex: 1; min-width: 0; }
.p2m { padding: 10px 12px 12px; margin-bottom: 8px; } .p2m .field { background: var(--sheet); height: 50px; }
.p2area { height: auto; padding: 12px 16px; } .p2area textarea { width: 100%; height: 96px; border: 0; background: none; outline: 0; resize: none; font: inherit; font-size: 17px; color: var(--fg); }
/* the game (v2/game.js) */
.tabs.gtabs button { flex: 1; justify-content: center; padding: 0 8px; }
.gwrap { position: relative; display: grid; place-items: center; padding: 14px 0 10px; }
.gcoin { width: min(58vw, 230px); aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--fg); color: var(--sheet); display: grid; place-items: center; transition: transform .08s; touch-action: manipulation; }
.gcoin svg { width: 52%; height: 52%; }
.gcoin.hit { transform: scale(.955); }
.gcoin.off { opacity: .35; }
.gcoin.boost { background: var(--acc-usd); color: #fff; }
.gdrop { position: absolute; height: 34px; padding: 0 14px; border-radius: 17px; border: 0; background: var(--acc-usd); color: #fff; font-weight: 700; font-size: 14px; animation: pop .3s; }
.genergy, .gboost { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--hint); }
.gboost { color: var(--fg); margin-top: 6px; }
.gbar { flex: 1; height: 8px; border-radius: 4px; background: var(--card); overflow: hidden; }
.gbar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--fg); transition: width .25s; }
.gboost .gbar i { background: var(--acc-usd); }
.btn.gsm { width: auto; height: 36px; padding: 0 14px; margin: 0; font-size: 14px; border-radius: 12px; flex: none; }
.card .btn.gsm.sec { background: var(--sheet); }
.glv { display: flex; gap: 3px; margin-top: 6px; } .glv i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); } .glv i.on { background: var(--fg); }
.gstep { width: 28px; height: 28px; border-radius: 14px; background: var(--sheet); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; color: var(--hint); }
.gstep svg { width: 14px; height: 14px; }
.gstep.now { background: var(--fg); color: var(--sheet); } .gstep.done { color: var(--pos); }
.gfloat { position: fixed; z-index: 90; transform: translate(-50%, -50%); font-weight: 700; font-size: 22px; color: #fff; mix-blend-mode: difference; pointer-events: none; animation: gfl .8s ease-out forwards; }
.gfloat.crit { color: var(--acc-usd); font-size: 22px; }
@keyframes gfl { to { transform: translate(-50%, -90px); opacity: 0; } }
/* «Свой кошелёк» (v2/safe.js) */
.pindots { display: flex; justify-content: center; gap: 16px; margin: 26px 0 6px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--hint); transition: background .12s, border-color .12s; }
.pindots i.on { background: var(--fg); border-color: var(--fg); }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; cursor: pointer; transition: filter .25s; }
.words span { background: var(--card); border-radius: 12px; padding: 10px 12px; font-weight: 600; -webkit-user-select: text; user-select: text; }
.words i { font-style: normal; color: var(--hint); font-weight: 500; display: inline-block; min-width: 26px; }
.words.blur { filter: blur(7px); }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.wgrid label { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 12px; padding: 0 10px; height: 44px; border: 1.5px solid transparent; }
.wgrid label.bad { border-color: var(--neg); }
.wgrid i { font-style: normal; color: var(--hint); font-size: 13px; min-width: 18px; }
.wgrid input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 16px; color: var(--fg); }
.nfts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nft { border: 0; background: var(--card); border-radius: 16px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nft .im, .nftbig { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sheet); display: grid; place-items: center; color: var(--hint); }
.nft .im img, .nftbig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nft b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 6px; } .nft span { color: var(--hint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nftbig { border-radius: 20px; margin-top: 6px; background: var(--card); }
.tcic { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: var(--card); display: inline-grid; place-items: center; flex: none; }
.card .row .tcic { width: 40px; height: 40px; border-radius: 12px; }
.p2p { display: flex; align-items: center; gap: 13px; width: 100%; margin-top: 6px; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--card); color: var(--fg); text-align: left; }
.p2p .pi { width: 46px; height: 46px; border-radius: 14px; background: var(--acc-usd); color: #fff; display: grid; place-items: center; flex: none; }
.p2p .pi svg { width: 24px; height: 24px; }
.p2p .pm { display: flex; flex-direction: column; min-width: 0; }
.p2p .pt { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.p2p .ps { font-size: 14px; color: var(--hint); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2p .pr { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; flex: none; font-variant-numeric: tabular-nums; }
.p2p .pr b { font-size: 16px; font-weight: 600; } .p2p .pr i { font-style: normal; font-size: 12px; color: var(--hint); }
.p2p .go { color: var(--hint); flex: none; }
.p2p .pr + .go { margin-left: 2px; } .p2p .pm + .go { margin-left: auto; }
.p2p .go svg { width: 8px; height: 14px; }
.p2p:active { opacity: .75; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.acts.three { grid-template-columns: repeat(3, 1fr); }
.act { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; border-radius: 16px; border: 0; background: var(--card); font-weight: 600; font-size: 16px; text-align: left; }
.acts.three .act { flex-direction: column; justify-content: center; gap: 4px; height: 66px; font-size: 14px; padding: 0 6px; }
.act svg { width: 22px; height: 22px; flex: none; }
.act:active, .row:active, .cmd:active { opacity: .7; }
.act:disabled { opacity: .45; }

.sec { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 4px; font-weight: 700; font-size: 18px; }
.sec small { color: var(--hint); font-weight: 500; font-size: 14px; }
.recent { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 2px; scrollbar-width: none; margin-top: 8px; touch-action: pan-x pan-y; }
.recent::-webkit-scrollbar { display: none; }
.rc { flex: none; width: 58px; text-align: center; background: none; border: 0; padding: 0; }
.rc .av { width: 48px; height: 48px; margin: 0 auto 5px; }
.rc .nm { font-size: 12px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 18px; width: 40px; height: 40px; flex: none; }
.av.plus { background: var(--card); color: var(--fg); }
.av.xl { width: 84px; height: 84px; font-size: 34px; margin: 0 auto 10px; }
.bigic { width: 84px; height: 84px; border-radius: 50%; background: var(--card); display: grid; place-items: center; margin: 22px auto 10px; }
.bigic svg { width: 40px; height: 40px; }
.av svg { width: 22px; height: 22px; }

/* the one smart card */
.next { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 14px; border-radius: 16px; border: 0; background: var(--card); text-align: left; }
.next .nt { font-weight: 600; } .next .ns { color: var(--hint); font-size: 14px; margin-top: 2px; }
.next .ni { width: 40px; height: 40px; border-radius: 12px; background: var(--sheet); display: grid; place-items: center; flex: none; }
.next .ni svg { width: 22px; height: 22px; }
.next .go { margin-left: auto; color: var(--hint); flex: none; }
.next .go svg { width: 8px; height: 14px; }
.next.warn .ni { background: rgba(214, 160, 40, .2); color: #b98300; }

/* rows */
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 0; border: 0; background: none; text-align: left; }
.row .main { min-width: 0; flex: 1; }
.row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--hint); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; }
.row .end .t { white-space: nowrap; }
.coin { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; color: #fff; font-size: 20px; font-weight: 700; flex: none; }
.coin.sm { width: 28px; height: 28px; font-size: 14px; }
.coin svg.full { width: 100%; height: 100%; }
.txi { width: 40px; height: 40px; border-radius: 50%; background: var(--card); display: grid; place-items: center; flex: none; }
.txi svg { width: 20px; height: 20px; }
.empty { text-align: center; color: var(--hint); padding: 28px 12px; font-size: 15px; }
.empty b { display: block; color: var(--fg); font-size: 17px; margin-bottom: 4px; }
.day { margin: 16px 2px 2px; font-size: 13px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hf { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.hf::-webkit-scrollbar { display: none; }
.hf button { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; border: 0; background: var(--card); font-size: 14px; font-weight: 500; }
.hf button.on { background: var(--fg); color: var(--sheet); }
.find { display: flex; align-items: center; gap: 8px; height: 40px; border-radius: 12px; background: var(--card); padding: 0 12px; margin-top: 8px; color: var(--hint); }
.find svg { width: 18px; height: 18px; flex: none; }
.find input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; font-size: 16px; }
.sw { position: relative; overflow: hidden; }
.sw .swact { position: absolute; right: 0; top: 6px; bottom: 6px; width: 88px; border: 0; border-radius: 14px; background: var(--fg); color: var(--sheet); font-weight: 600; font-size: 14px; }
.sw .row { position: relative; background: var(--sheet); transition: transform .2s; }
.skel { height: 14px; border-radius: 7px; background: var(--card); animation: pulse 1.2s ease-in-out infinite; }
.stage .skel { background: rgba(255, 255, 255, .22); }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- flow: one task at a time, inside the sheet ---------- */
.flow { position: absolute; left: 0; right: 0; top: var(--hi); bottom: 0; background: var(--sheet); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateX(104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); z-index: 5; }
.flow.on { transform: none; }
.fh { display: flex; align-items: center; height: 56px; padding: 6px 8px 0; flex: none; }
.fh h2 { flex: 1; margin: 0; text-align: center; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; }
.fh button svg { width: 22px; height: 22px; }
.fh .sp { width: 44px; }
.fb { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(var(--sa-b) + 18px); display: flex; flex-direction: column; animation: fin .22s ease; touch-action: pan-y; }
@keyframes fin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fb .grow { flex: 1; }
.fb h3 { margin: 16px 2px 6px; font-size: 13px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card { background: var(--card); border-radius: 16px; padding: 4px 14px; }
.card .row { min-height: 50px; border-bottom: 1px solid var(--line); border-radius: 0; }
.card .row:last-child { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--hint); flex: none; } .kv .v { text-align: right; overflow-wrap: anywhere; }
/* the main button is the text colour turned inside out: white with black text in the dark theme, black with white text in the light one */
.btn { display: block; width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--fg); color: var(--sheet); font-weight: 600; font-size: 17px; margin-top: 12px; }
.btn.sec { background: var(--card); color: var(--fg); }
.btn:disabled { opacity: .4; }
.btn:active:not(:disabled) { opacity: .85; }
.field { display: flex; align-items: center; gap: 8px; height: 56px; border-radius: 16px; background: var(--card); padding: 0 8px 0 16px; margin-top: 8px; }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; font-size: 17px; }
.field button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--sheet); display: grid; place-items: center; flex: none; }
.field button svg { width: 20px; height: 20px; }
.hint { color: var(--hint); font-size: 14px; margin: 8px 2px; }
.hint.neg { color: var(--neg); }
.center { text-align: center; }
.title { font-size: 26px; font-weight: 700; margin: 14px 0 4px; letter-spacing: -.01em; }
.sub { color: var(--hint); }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--fg); animation: sp .8s linear infinite; margin: 36px auto 16px; }
@keyframes sp { to { transform: rotate(360deg); } }
.done { width: 84px; height: 84px; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; margin: 28px auto 10px; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.done svg { width: 44px; height: 44px; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .15s ease forwards; }
.done.bad { background: var(--neg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* amount screen */
.big { font-size: 46px; font-weight: 700; text-align: center; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; min-height: 56px; overflow: hidden; white-space: nowrap; }
.big.s1 { font-size: 38px; } .big.s2 { font-size: 30px; }
.conv { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 4px auto 0; border: 0; background: none; color: var(--hint); font-size: 15px; padding: 4px 10px; }
.conv svg { width: 14px; height: 14px; }
.cselect { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--card); border-radius: 18px; padding: 4px 12px 4px 4px; font-weight: 600; margin: 8px auto 0; }
.cselect svg { width: 10px; height: 7px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pad button { height: 54px; border: 0; border-radius: 14px; background: var(--card); font-size: 24px; font-weight: 500; }
.pad button:active { opacity: .6; }
.pad button svg { width: 26px; height: 26px; margin: 0 auto; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* slide to confirm */
.slide { position: relative; height: 60px; border-radius: 30px; background: var(--card); overflow: hidden; touch-action: none; margin-top: 12px; }
.slide .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--fg); opacity: .12; }
.slide .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; color: var(--hint); padding: 0 64px; text-align: center; }
.slide .knob { position: absolute; left: 4px; top: 4px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--fg); color: var(--sheet); display: grid; place-items: center; touch-action: none; }
.slide .knob svg { width: 24px; height: 24px; }
.slide.ok .knob { transition: transform .2s; }

/* receive */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 6px; border-radius: 20px; border: 0; background: var(--card); font-weight: 600; font-size: 15px; }
.tabs button.on { background: var(--fg); color: var(--sheet); }
.tabs.net button { padding: 0 14px; height: 34px; font-size: 14px; }
.qr { width: 208px; height: 208px; background: #fff; border-radius: 18px; padding: 12px; margin: 14px auto; display: grid; place-items: center; }
.qr img, .qr canvas { width: 100%; height: 100%; display: block; }
.addr { background: var(--card); border-radius: 16px; padding: 12px 14px; word-break: break-all; font-size: 15px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* swap */
.sbox { background: var(--card); border-radius: 18px; padding: 12px 14px; }
.sbox .l { display: flex; justify-content: space-between; color: var(--hint); font-size: 13px; }
.sbox .r { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.sbox .v { font-size: 30px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbox .v.muted { font-weight: 600; }
.flip { display: grid; place-items: center; width: 38px; height: 38px; margin: -10px auto; position: relative; z-index: 1; border-radius: 50%; border: 4px solid var(--sheet); background: var(--card); }
.flip svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: inherit; }

/* toast, hint */
#toast { position: fixed; left: 50%; bottom: calc(var(--sa-b) + 26px); transform: translate(-50%, 20px); background: var(--fg); color: var(--sheet); padding: 11px 18px; border-radius: 22px; font-size: 15px; opacity: 0; pointer-events: none; transition: .22s; max-width: 88vw; text-align: center; z-index: 50; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.tip { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; padding: 16px 16px calc(var(--sa-b) + 16px); animation: fin .25s; }
.tip .box { width: 100%; background: var(--sheet); border-radius: 22px; padding: 20px; }
.tip .step { font-size: 13px; color: var(--hint); font-weight: 600; }
.tip h4 { margin: 6px 0 4px; font-size: 21px; }
.tip p { margin: 0 0 6px; color: var(--hint); }
.tip .dots { display: flex; gap: 6px; margin: 14px 0 0; } .tip .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .tip .dots i.on { background: var(--fg); }
.offline { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(214, 160, 40, .16); font-size: 14px; }
.promo { display: block; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 0; background: var(--card); text-align: left; }
.promo b { display: block; } .promo span { color: var(--hint); font-size: 14px; }
.toggle { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; border: 0; transition: background .2s; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on { background: var(--pos); } .toggle.on::after { transform: translateX(18px); }
/* first-run stories: a flat full-screen deck, no effects */
.stories { position: absolute; inset: 0; z-index: 45; background: var(--acc-all); color: #fff; display: flex; flex-direction: column; padding: calc(var(--sa-t) + 12px) 18px calc(var(--sa-b) + 22px); touch-action: manipulation; animation: fin .25s; }
.st-bars { display: flex; gap: 4px; } .st-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; } .st-bar i { display: block; height: 100%; width: 0; background: #fff; }
.st-top { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-top: 8px; font-size: 17px; }
.st-top .x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; } .st-top .x svg { width: 20px; height: 20px; }
.st-slide { display: none; flex: 1; flex-direction: column; justify-content: center; text-align: center; gap: 14px; } .st-slide.on { display: flex; animation: fin .25s; }
.st-art { min-height: 150px; display: flex; align-items: center; justify-content: center; }
.st-slide h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.01em; } .st-slide p { margin: 0 auto; max-width: 320px; font-size: 17px; opacity: .8; }
.st-hint { margin-top: 18px; font-size: 14px; opacity: .55; } .st-cta { margin: 22px auto 0; max-width: 320px; background: #fff; color: #1b1d22; }
.stcoins { display: grid; grid-template-columns: repeat(3, 56px); gap: 12px; } .stcoins .coin { width: 56px; height: 56px; font-size: 28px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
