/* POLAR v2 — single stylesheet, Telegram-native layout, light/dark tokens. */
:root {
  --bg: #0b1020;
  --bg-elev: #11182c;
  --surface: #151d33;
  --surface-2: #1c2642;
  --line: rgba(255, 255, 255, .07);
  --text: #eef2ff;
  --muted: #8b95b4;
  --faint: #5d6788;
  --accent: #7be4d3;
  --accent-ink: #04211d;
  --accent-soft: rgba(123, 228, 211, .12);
  --ice: #7aa8ff;
  --ok: #4fd69c;
  --ok-soft: rgba(79, 214, 156, .14);
  --warn: #ffc261;
  --warn-soft: rgba(255, 194, 97, .14);
  --bad: #ff6b81;
  --bad-soft: rgba(255, 107, 129, .14);
  --scrim: rgba(3, 6, 15, .62);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --hero-a: #1b3aa8;
  --hero-b: #0f7f86;
  --hero-c: #3a1f8f;
  --radius: 20px;
  --radius-s: 14px;
  /* Full screen: the device notch plus Telegram's own buttons; both are 0 in the normal sheet mode. */
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f5fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --line: rgba(11, 18, 34, .07);
  --text: #0b1222;
  --muted: #5b6684;
  --faint: #98a1bb;
  --accent: #10a291;
  --accent-ink: #ffffff;
  --accent-soft: rgba(16, 162, 145, .1);
  --ice: #2f6bff;
  --ok: #12a46b;
  --ok-soft: rgba(18, 164, 107, .1);
  --warn: #c17700;
  --warn-soft: rgba(225, 145, 0, .12);
  --bad: #d92d4b;
  --bad-soft: rgba(217, 45, 75, .1);
  --scrim: rgba(11, 18, 34, .38);
  --shadow: 0 18px 50px rgba(20, 35, 80, .16);
  --hero-a: #2a5bff;
  --hero-b: #17b3a6;
  --hero-c: #6b45ff;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
svg.i { width: 22px; height: 22px; flex: none; }

/* ——— Shell ——— */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-top)) 16px calc(92px + var(--safe-bottom));
}
.topbar { display: flex; align-items: center; gap: 12px; height: 48px; margin-bottom: 14px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  color: #fff; font-weight: 700; font-size: 15px;
}
.topbar .hello { flex: 1; min-width: 0; }
.topbar .hello small { display: block; color: var(--muted); font-size: 12px; }
.topbar .hello strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--text);
  transition: transform .15s ease, background .15s;
}
.icon-btn:active { transform: scale(.92); }
/* Scanner sits one tap away on the home top bar: pay by SBP QR, send by POLAR ID, withdraw to an address. */
.icon-btn.scan-btn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px var(--accent-soft); }
.env-pill {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--warn); background: var(--warn-soft);
  padding: 4px 9px; border-radius: 99px;
}

/* ——— Balance hero ——— */
.hero {
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 20px 20px 18px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--hero-a) 0%, transparent 60%),
    radial-gradient(90% 120% at 100% 100%, var(--hero-b) 0%, transparent 55%),
    radial-gradient(80% 80% at 90% 0%, var(--hero-c) 0%, transparent 60%),
    #0d1534;
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1;
  background: url("../logo.svg") center / contain no-repeat;
  opacity: .08; transform: rotate(12deg); z-index: -1;
}
.hero-label { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .78; }
.hero-label button { color: inherit; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.hero-label button svg { width: 18px; height: 18px; }
.hero-amount { font-size: 42px; font-weight: 700; line-height: 1.1; margin: 4px 0 6px; letter-spacing: -.02em; }
.hero-amount small { font-size: 26px; opacity: .65; font-weight: 600; }
.hero-rub { position: relative; z-index: 1; font-size: 17px; font-weight: 600; opacity: .88; margin: -2px 0 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero-rub small { font-size: 12px; font-weight: 500; opacity: .7; }
.hero-sub { font-size: 13px; opacity: .72; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-sub span + span::before { content: "·"; margin-right: 8px; opacity: .6; }

/* ——— Quick actions ——— */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 26px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.action .bubble {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent);
  transition: transform .15s ease;
}
.action.primary .bubble { background: var(--accent); color: var(--accent-ink); }
.action:active .bubble { transform: scale(.9); }

/* ——— Sections & lists ——— */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-head h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.link { color: var(--accent); font-size: 14px; font-weight: 500; }
.list { background: var(--surface); border-radius: var(--radius); padding: 4px 0; margin-bottom: 24px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; text-align: left;
  transition: background .12s;
}
.row:active { background: var(--surface-2); }
.row + .row { box-shadow: inset 0 1px 0 var(--line); }
.row .body { flex: 1; min-width: 0; }
.row .body strong { display: block; font-weight: 600; font-size: 15.5px; }
.row .body small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: right; flex: none; }
.row .end strong { display: block; font-weight: 600; font-size: 15.5px; }
.row .end small { display: block; color: var(--muted); font-size: 13px; }
.row .chev { color: var(--faint); width: 18px; height: 18px; }
.positive { color: var(--ok); }

.coin { display: block; position: relative; width: 42px; height: 42px; flex: none; }
.coin > img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.coin .chain {
  position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid var(--surface); background: var(--surface);
}
.coin .chain img { width: 100%; height: 100%; display: block; border-radius: 50%; }
.coin.sm { width: 28px; height: 28px; }
.coin.sm .chain { width: 13px; height: 13px; border-width: 1.5px; }
.coin.lg { width: 64px; height: 64px; }
.coin.lg .chain { width: 24px; height: 24px; }

/* QR payments: POLAR's own pay mark (₽ in a scanner frame) on a glacier-to-violet disc; a turning arc while it pays. */
.coin.paycoin { display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: radial-gradient(120% 120% at 28% 18%, rgba(255, 255, 255, .38), transparent 46%), linear-gradient(145deg, #73ece3 0%, #5d8bff 52%, #8a60ff 100%);
  box-shadow: 0 6px 16px -6px rgba(93, 139, 255, .75), inset 0 0 0 1px rgba(255, 255, 255, .2); }
.coin.paycoin svg { width: 22px; height: 22px; stroke-width: 2.1; filter: drop-shadow(0 1px 1px rgba(3, 10, 40, .35)); }
.coin.lg.paycoin { box-shadow: 0 16px 36px -12px rgba(93, 139, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .22); }
.coin.lg.paycoin svg { width: 32px; height: 32px; }
.coin.paycoin.pending::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); animation: paycoin-spin 1.1s linear infinite; }
@keyframes paycoin-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .coin.paycoin.pending::after { animation: none; } }
.op-icon { position: relative; display: block; flex: none; width: 42px; height: 42px; }
.op-icon .dir {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--surface); display: grid; place-items: center; color: var(--muted);
}
.op-icon .dir svg { width: 11px; height: 11px; stroke-width: 2.6; }
.op-icon .dir.in { color: var(--ok); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.pending { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }

.empty { text-align: center; padding: 30px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--faint); }
.empty h3 { color: var(--text); margin: 10px 0 4px; font-size: 16px; }
.empty p { margin: 0; font-size: 14px; }

.page-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 4px 14px; }
.day { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 6px 8px; text-transform: uppercase; letter-spacing: .04em; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; margin: 0 -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text);
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }
.chip .coin { width: 22px; height: 22px; }
.chip .coin .chain { width: 11px; height: 11px; border-width: 1.5px; right: -3px; bottom: -3px; }
.chip small { color: var(--muted); font-size: 12px; }

.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--surface-2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.segmented button { flex: 1; padding: 7px 10px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }

.profile-card { text-align: center; padding: 18px 16px 20px; background: var(--surface); border-radius: var(--radius); margin-bottom: 18px; }
.profile-card .avatar { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.profile-card h2 { margin: 0; font-size: 20px; }
.profile-card p { margin: 2px 0 12px; color: var(--muted); }
.id-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font: 13px ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); }
.id-chip svg { width: 16px; height: 16px; color: var(--accent); }
.row .lead { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.row .lead svg { width: 19px; height: 19px; }
.foot-note { text-align: center; color: var(--faint); font-size: 12px; margin: 8px 0 0; }

/* ——— Tab bar ——— */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-bottom));
  width: min(448px, calc(100% - 32px));
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  z-index: 10;
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 16px; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .15s, background .15s; }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ——— Bottom sheet ——— */
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; z-index: 20; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 21;
  width: min(480px, 100%); max-height: calc(100dvh - 24px - var(--safe-top));
  display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow);
  transform: translate(-50%, 100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1);
}
.sheet-open .scrim { opacity: 1; }
.sheet-open .sheet { transform: translate(-50%, 0); }
.grabber { width: 38px; height: 5px; border-radius: 99px; background: var(--faint); opacity: .5; margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px 20px; flex: none; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 18px; letter-spacing: -.01em; }
.sheet-head .icon-btn { width: 34px; height: 34px; background: var(--surface-2); }
.sheet-head .icon-btn svg { width: 18px; height: 18px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 12px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 10px 16px calc(14px + var(--safe-bottom)); flex: none; }
.sheet .list { background: var(--surface); }
:root[data-theme="light"] .sheet { background: var(--bg); }

.btn {
  width: 100%; height: 54px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn + .btn { margin-top: 8px; }
.btn .spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ——— Forms ——— */
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 4px 8px; display: flex; justify-content: space-between; }
.field-label button { color: var(--accent); font-weight: 600; }
.amount-box { background: var(--surface); border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 18px; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s; }
.amount-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.amount-box.invalid { box-shadow: inset 0 0 0 1.5px var(--bad); }
.amount-line { display: flex; align-items: baseline; gap: 8px; }
.amount-line input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 36px; font-weight: 700; letter-spacing: -.02em; padding: 0; font-variant-numeric: tabular-nums; }
.amount-line input::placeholder { color: var(--faint); }
.amount-line .unit { font-size: 20px; font-weight: 600; color: var(--muted); }
.amount-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.amount-meta .err { color: var(--bad); }
.max-btn { padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.text-field { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--radius-s); padding: 0 6px 0 14px; margin-bottom: 10px; box-shadow: inset 0 0 0 1.5px transparent; }
.text-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.text-field.invalid { box-shadow: inset 0 0 0 1.5px var(--bad); }
.text-field input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; font-size: 15.5px; }
.text-field input.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; }
.text-field .icon-btn { width: 38px; height: 38px; background: var(--surface-2); color: var(--accent); }
.text-field .icon-btn svg { width: 18px; height: 18px; }
.hint { font-size: 13px; color: var(--muted); margin: -2px 4px 14px; }
.hint.err { color: var(--bad); }
.contacts { display: flex; gap: 14px; margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.contact { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); width: 58px; flex: none; }
.contact .avatar { width: 48px; height: 48px; font-size: 16px; }
.contact .avatar.b { background: linear-gradient(135deg, #8a4dff, #ff7ab6); }
.contact .avatar.c { background: linear-gradient(135deg, #ff9a3c, #ffcd4d); }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--text); font-size: 13.5px; margin-bottom: 14px; }
.callout svg { color: var(--warn); width: 20px; height: 20px; margin-top: 1px; }
.callout.info { background: var(--accent-soft); }
.callout.info svg { color: var(--accent); }
.callout.bad { background: var(--bad-soft); }
.callout.bad svg { color: var(--bad); }
.callout b { font-weight: 600; }

.kv { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 14px; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14.5px; }
.kv div + div { box-shadow: inset 0 1px 0 var(--line); }
.kv dt, .kv span:first-child { color: var(--muted); flex: none; }
.kv dd, .kv span:last-child { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv .mono { font: 13px ui-monospace, "SF Mono", Menlo, monospace; }
.kv .total { font-weight: 700; }

.summary { text-align: center; padding: 8px 0 18px; }
.summary .coin { margin: 0 auto 12px; }
.summary h2 { margin: 0; font-size: 32px; letter-spacing: -.02em; }
.summary p { margin: 4px 0 0; color: var(--muted); }
.summary .pill { margin-top: 10px; }

.success { text-align: center; padding: 26px 0 10px; }
.success .mark { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.success .mark.pending { background: var(--warn-soft); color: var(--warn); }
.success .mark svg { width: 40px; height: 40px; stroke-width: 2.4; }
.success h2 { margin: 0 0 6px; font-size: 24px; }
.success p { margin: 0 auto; color: var(--muted); max-width: 300px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.timeline { background: var(--surface); border-radius: var(--radius); padding: 14px 16px 4px; margin-bottom: 14px; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.step::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.step .dot svg { width: 12px; height: 12px; stroke-width: 3; }
.step.done .dot { background: var(--ok); color: #fff; }
.step.done::before { background: var(--ok); opacity: .5; }
.step.now .dot { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.step strong { display: block; font-size: 14.5px; font-weight: 600; }
.step small { color: var(--muted); font-size: 12.5px; }
.step:not(.done):not(.now) strong { color: var(--muted); font-weight: 500; }

.coin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.coin-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: var(--radius-s); background: var(--surface); font-weight: 600; font-size: 14px; }
.coin-tile small { color: var(--muted); font-weight: 500; font-size: 12px; }
.coin-tile:active { transform: scale(.97); }

.qr-card { background: #fff; border-radius: 22px; padding: 14px; width: 232px; margin: 4px auto 14px; position: relative; }
.qr-card canvas { display: block; width: 204px !important; height: 204px !important; }
.qr-card .qr-logo { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; border: 4px solid #fff; background: #fff; }
.address-box { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; text-align: center; }
.address-box small { color: var(--muted); font-size: 12.5px; }
.address-box code { display: block; margin: 6px 0 0; font: 14.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; color: var(--muted); }
.address-box code b { color: var(--text); font-weight: 700; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row .btn + .btn { margin-top: 0; }

/* ——— Toast ——— */
#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-top)); z-index: 40;
  transform: translate(-50%, -140%); opacity: 0;
  background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .9, .25, 1), opacity .3s;
  max-width: calc(100% - 32px); text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ——— Skeleton ——— */
.sk { background: var(--surface); border-radius: 14px; position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.2s infinite; transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 18px; margin: 16px 0; }
.w40 { width: 40%; } .w30 { width: 30%; }
.sk-card { height: 156px; border-radius: 26px; }
.sk-row { display: flex; justify-content: space-around; margin: 20px 0; }
.sk-circle { width: 56px; height: 56px; border-radius: 18px; }
.sk-item { height: 62px; margin-bottom: 6px; }

/* ——— Motion ——— */
.view > * { animation: rise .38s cubic-bezier(.2, .9, .25, 1) both; }
.view > *:nth-child(2) { animation-delay: .03s; }
.view > *:nth-child(3) { animation-delay: .06s; }
.view > *:nth-child(4) { animation-delay: .09s; }
.view > *:nth-child(5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 720px) {
  body { background: radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent), var(--bg); }
}

/* ——— Sign-in, PIN, connection error ——— */
.gate { min-height: calc(100dvh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 20px 8px; }
.gate h1 { margin: 10px 0 4px; font-size: 28px; letter-spacing: -.02em; }
.gate > p { margin: 0 0 22px; color: var(--muted); max-width: 320px; }
.gate .recovery-code { display: block; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); font-size: 15px; letter-spacing: .06em; word-break: break-all; max-width: 320px; user-select: all; -webkit-user-select: all; }
.gate .check-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--text); font-weight: 600; cursor: pointer; }
.gate .check-row input { width: 22px; height: 22px; accent-color: var(--accent); }
.gate .btn + .btn { margin-top: 8px; }
.gate .btn { max-width: 360px; }
.gate .callout { max-width: 360px; width: 100%; text-align: left; }
.gate-logo { width: 84px; height: 84px; border-radius: 26px; box-shadow: 0 16px 40px rgba(40, 90, 255, .35); }
.gate-icon { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.gate-icon svg { width: 32px; height: 32px; }
.login-code { background: var(--surface); border-radius: var(--radius); padding: 14px 24px; margin-bottom: 14px; display: grid; gap: 2px; }
.login-code small, .login-code span { color: var(--muted); font-size: 12.5px; }
.login-code strong { font-size: 30px; letter-spacing: .12em; }
a.btn { text-decoration: none; }
.hint.center { text-align: center; margin: 10px 0; min-height: 18px; }
.pin-dots { display: flex; gap: 14px; margin: 6px 0 4px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-2); transition: background .15s, transform .15s; }
.pin-dots span.on { background: var(--accent); transform: scale(1.1); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; margin: 8px 0 18px; }
.keypad button { height: 76px; border-radius: 50%; background: var(--surface); font-size: 28px; font-weight: 500; display: grid; place-items: center; }
.keypad button:active { background: var(--surface-2); transform: scale(.95); }
.keypad button svg { width: 26px; height: 26px; }
.spinner.big, .empty .spinner { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
.hero-label button.spinning svg { animation: spin .8s linear infinite; }
.hero-label button + button { margin-left: -4px; }
.callout.wide { width: 100%; text-align: left; }
img.avatar { object-fit: cover; padding: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; margin: 0 auto 10px; }
.chip svg.i { width: 16px; height: 16px; color: var(--muted); }

/* ═══════════ Northern Lights layer ═══════════
   Glass surfaces over a live aurora. Tokens below override the base palette. */
:root {
  --bg: #060b1c;
  --bg-elev: rgba(12, 19, 42, .9);
  --surface: rgba(24, 34, 66, .52);
  --surface-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08);
  --edge: linear-gradient(140deg, rgba(255,255,255,.22), rgba(255,255,255,.03) 40%, rgba(115,236,227,.18));
  --text: #f4f7ff;
  --muted: #9aa7c6;
  --faint: #5f6a8f;
  --accent: #73ece3;
  --accent-2: #5d8bff;
  --violet: #8a60ff;
  --accent-ink: #032824;
  --accent-soft: rgba(115, 236, 227, .12);
  --glow: 0 10px 40px rgba(115, 236, 227, .28);
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --blur: blur(18px) saturate(1.5);
}
:root[data-theme="light"] {
  --bg: #edf2fb;
  --bg-elev: rgba(255, 255, 255, .88);
  --surface: rgba(255, 255, 255, .68);
  --surface-2: rgba(20, 40, 90, .06);
  --line: rgba(20, 40, 90, .08);
  --edge: linear-gradient(140deg, rgba(255,255,255,.95), rgba(255,255,255,.3) 45%, rgba(16,162,145,.25));
  --text: #0a1226;
  --muted: #56617f;
  --faint: #98a1bb;
  --accent: #0ea493;
  --accent-2: #2f6bff;
  --violet: #6b45ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 164, 147, .1);
  --glow: 0 10px 34px rgba(14, 164, 147, .25);
  --shadow: 0 20px 50px rgba(30, 50, 110, .14);
}
html, body { background: var(--bg); }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
:root[data-theme="light"] #sky { opacity: .9; }
body { font-family: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; }

/* Glass recipe: translucent fill, backdrop blur, 1px gradient edge via mask. */
.list, .kv, .timeline, .amount-box, .text-field, .profile-card, .address-box, .coin-tile, .login-code,
.action .bubble, .icon-btn, .chip, .segmented, .keypad button, .callout, .btn.ghost, .tabbar, .sheet {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.list, .kv, .timeline, .amount-box, .profile-card, .address-box, .coin-tile, .login-code, .action .bubble, .keypad button { position: relative; }
.list::after, .kv::after, .timeline::after, .profile-card::after, .address-box::after, .coin-tile::after, .login-code::after,
.action .bubble::after, .keypad button::after, .sheet::after, .tabbar::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.list { border-radius: 22px; }

/* ——— Top bar ——— */
.topbar .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(115, 236, 227, .55); }
.env-pill { border: 1px solid currentColor; background: transparent; letter-spacing: .1em; font-size: 10px; }

/* ——— Hero card ——— */
.hero {
  min-height: 196px; padding: 20px 20px 18px; border-radius: 28px;
  background:
    radial-gradient(120% 120% at var(--mx, 0%) var(--my, 0%), rgba(255,255,255,.16), transparent 45%),
    radial-gradient(110% 90% at 0% 0%, #2547e0 0%, transparent 62%),
    radial-gradient(90% 110% at 100% 100%, #0aa7a8 0%, transparent 58%),
    radial-gradient(70% 80% at 85% 10%, #6a2ad0 0%, transparent 60%),
    #0b1438;
  box-shadow: 0 30px 70px -20px rgba(37, 71, 224, .55), 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.25);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .35s cubic-bezier(.2, .9, .25, 1);
  will-change: transform;
}
.hero::after { display: none; }
.hero::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: .35;
  background: repeating-linear-gradient(115deg, transparent 0 16px, rgba(255,255,255,.05) 16px 17px);
  -webkit-mask: linear-gradient(200deg, #000, transparent 70%); mask: linear-gradient(200deg, #000, transparent 70%);
}
.hero-sheen {
  position: absolute; inset: -40% auto -40% -60%; width: 45%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-18deg); animation: sheen 7s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.hero > :not(.hero-sheen):not(.orbit) { position: relative; z-index: 2; }
.hero-amount { font-size: 44px; text-shadow: 0 4px 30px rgba(0, 0, 0, .25); margin-top: 8px; }
.hero-brand { position: absolute !important; right: 20px; bottom: 16px; font-size: 11px; font-weight: 800; letter-spacing: .32em; opacity: .55; }
.hero-sub { padding-right: 70px; }

/* ——— Coin orbit ——— */
.orbit { position: absolute; width: 150px; height: 150px; --r: 75px; }
.orbit::before, .orbit::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
}
.orbit::before { inset: 0; }
.orbit::after { inset: 24%; border-style: dashed; border-color: rgba(255,255,255,.12); }
.orbit-core {
  position: absolute; inset: 34%; border-radius: 30%; display: grid; place-items: center;
  box-shadow: 0 0 40px rgba(120, 180, 255, .65), 0 0 0 6px rgba(255,255,255,.05);
  animation: breathe 4.5s ease-in-out infinite;
}
.orbit-core img { width: 100%; height: 100%; border-radius: 30%; }
@keyframes breathe { 50% { box-shadow: 0 0 60px rgba(115, 236, 227, .8), 0 0 0 10px rgba(255,255,255,.04); transform: scale(1.04); } }
.orbit-track { position: absolute; inset: 0; animation: spin 26s linear infinite; }
.orbit-track.t1 { inset: 24%; animation-duration: 18s; animation-direction: reverse; }
.orbit-pos { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.orbit-track.t0 .p0 { transform: rotate(20deg) translateY(-75px); }
.orbit-track.t0 .p1 { transform: rotate(200deg) translateY(-75px); }
.orbit-track.t1 .p0 { transform: rotate(110deg) translateY(-39px); }
.orbit-track.t1 .p1 { transform: rotate(290deg) translateY(-39px); }
.orbit-coin { position: absolute; width: 26px; height: 26px; margin: -13px; border-radius: 50%; animation: spin 26s linear infinite reverse; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.orbit-track.t1 .orbit-coin { width: 20px; height: 20px; margin: -10px; animation: spin 18s linear infinite; }
.orbit-coin img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.hero-orbit { right: -30px; top: -26px; opacity: .9; }

/* ——— Quick actions ——— */
.actions { margin: 22px 0 26px; }
.action { color: var(--muted); font-weight: 600; transition: color .2s; }
.action:hover { color: var(--text); }
.action .bubble { width: 60px; height: 60px; border-radius: 20px; color: var(--accent); }
.action .bubble svg { width: 24px; height: 24px; }
.action.primary { color: var(--text); }
.action.primary .bubble {
  background: linear-gradient(145deg, #9ff7ee, var(--accent) 45%, #3cc6d6); color: var(--accent-ink); box-shadow: var(--glow);
}
:root[data-theme="light"] .action.primary .bubble { background: linear-gradient(145deg, #2fd1bf, var(--accent) 50%, #0a8a9e); }
.action.primary .bubble::before {
  content: ""; position: absolute; inset: -6px; border-radius: 24px; border: 1.5px solid var(--accent); opacity: 0; animation: ping 3.2s ease-out 1.5s infinite;
}
@keyframes ping { 0% { transform: scale(.9); opacity: .55; } 70%, 100% { transform: scale(1.18); opacity: 0; } }

/* ——— Lists & rows ——— */
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.row { border-radius: 18px; }
.row + .row { box-shadow: none; }
.row + .row::before { content: ""; position: absolute; left: 68px; right: 16px; top: 0; height: 1px; background: var(--line); }
.row { position: relative; }
.row:hover { background: rgba(255,255,255,.03); }
.coin > img { box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.end strong.positive { text-shadow: 0 0 18px rgba(79, 214, 156, .35); }
.callout.info { border: 1px solid rgba(115, 236, 227, .18); }
.pill { backdrop-filter: none; }

/* ——— Tab bar ——— */
.tabbar { background: var(--bg-elev); border-radius: 24px; overflow: hidden; }
.tabbar button { position: relative; z-index: 1; }
.tabbar button[aria-current="page"] { background: transparent; }
.tab-ind {
  position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5);
  border-radius: 18px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(115, 236, 227, .25), 0 0 24px rgba(115, 236, 227, .12);
  transform: translateX(calc(var(--tab, 0) * 100%)); animation: tab-in .35s cubic-bezier(.2, .9, .25, 1);
}
@keyframes tab-in { from { opacity: 0; transform: translateX(calc(var(--tab, 0) * 100%)) scale(.85); } }
/* Scanner slot: an accent bubble instead of a plain icon, same label row as the tabs. */
.tabbar .tab-scan { color: var(--text); padding-top: 3px; }
.tab-scan-bubble { width: 32px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px var(--accent-soft); transition: transform .15s; }
.tabbar .tab-scan .tab-scan-bubble svg { width: 19px; height: 19px; }
.tabbar .tab-scan:active .tab-scan-bubble { transform: scale(.9); }

/* ——— Sheet ——— */
.sheet { background: var(--bg-elev); }
:root[data-theme="light"] .sheet { background: rgba(244, 247, 253, .92); }
.sheet::before {
  content: ""; position: absolute; left: 15%; right: 15%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7;
}
.btn { background: linear-gradient(145deg, #9ff7ee, var(--accent) 50%, #3cc6d6); box-shadow: var(--glow); letter-spacing: .01em; }
:root[data-theme="light"] .btn { background: linear-gradient(145deg, #2fd1bf, var(--accent) 50%, #0a8a9e); }
.btn.ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.btn[disabled] { box-shadow: none; }
.summary .coin.lg { filter: drop-shadow(0 10px 26px rgba(115, 236, 227, .25)); }
.summary h2 { font-size: 34px; }

/* ——— Success ——— */
.success .mark { position: relative; box-shadow: 0 0 0 10px rgba(79, 214, 156, .06), 0 0 50px rgba(79, 214, 156, .35); }
.success .mark.pending { box-shadow: 0 0 0 10px rgba(255, 194, 97, .06), 0 0 50px rgba(255, 194, 97, .3); }
.success .mark::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; animation: ring 1s ease-out .15s both; }
@keyframes ring { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.burst { position: absolute; inset: 50% auto auto 50%; }
.burst i {
  position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 2px; background: currentColor;
  transform: rotate(var(--a)) translateY(0) scale(.2); opacity: 0;
  animation: spark .9s cubic-bezier(.2, .9, .3, 1) calc(.18s + var(--d)) both;
}
.burst i:nth-child(3n) { background: var(--accent-2); }
.burst i:nth-child(3n+1) { background: var(--violet); border-radius: 50%; }
@keyframes spark { 30% { opacity: 1; } to { transform: rotate(var(--a)) translateY(-78px) scale(1) rotate(90deg); opacity: 0; } }

/* ——— Sign-in gate ——— */
.gate-orbit { position: relative; width: 210px; height: 210px; margin-bottom: 18px; }
.gate-orbit .orbit-track.t0 .p0 { transform: rotate(20deg) translateY(-105px); }
.gate-orbit .orbit-track.t0 .p1 { transform: rotate(200deg) translateY(-105px); }
.gate-orbit .orbit-track.t1 .p0 { transform: rotate(110deg) translateY(-55px); }
.gate-orbit .orbit-track.t1 .p1 { transform: rotate(290deg) translateY(-55px); }
.gate-orbit .orbit-coin { width: 38px; height: 38px; margin: -19px; }
.gate-orbit .orbit-track.t1 .orbit-coin { width: 28px; height: 28px; margin: -14px; }
:root[data-theme="light"] .orbit::before, :root[data-theme="light"] .orbit::after { border-color: rgba(20, 40, 90, .14); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .3em; color: var(--accent); }
.display { font-size: 34px !important; line-height: 1.08; margin: 10px 0 10px !important; }
.display span { background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 22px; }
.pills span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 600; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.pills svg { width: 15px; height: 15px; color: var(--accent); }
.gate-icon { box-shadow: 0 0 50px rgba(115, 236, 227, .3); }

/* ——— Intro ——— */
#intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(60% 50% at 50% 45%, #13246b, #050a1a 70%); transition: opacity .55s ease, transform .55s ease; }
#intro.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.intro-lockup { text-align: center; color: #f4f7ff; }
.intro-lockup img { width: 78px; height: 78px; border-radius: 25px; animation: intro-logo .9s cubic-bezier(.2, 1.3, .4, 1) both; box-shadow: 0 0 70px rgba(90, 150, 255, .7); }
.intro-word { margin-top: 18px; font-size: 30px; font-weight: 800; letter-spacing: .34em; padding-left: .34em; }
.intro-word span { display: inline-block; animation: intro-letter .6s cubic-bezier(.2, .9, .25, 1) calc(.25s + var(--i) * .06s) both; }
.intro-lockup small { display: block; margin-top: 10px; font-size: 10px; letter-spacing: .32em; color: #9aa7c6; animation: intro-letter .6s ease .6s both; }
@keyframes intro-logo { from { transform: scale(.3) rotate(-45deg); opacity: 0; } }
@keyframes intro-letter { from { transform: translateY(14px); opacity: 0; filter: blur(6px); } }

/* ——— Skeleton on glass ——— */
.sk { background: var(--surface); }

/* ═══════════ Design pass 2: layout fixes, tips, desktop, weak devices ═══════════ */
/* Orbit keeps to its own corner so it never rides over the eye/refresh buttons. */
.hero-orbit { right: -34px; top: -30px; transform: scale(.82); transform-origin: 100% 0; }
.hero-label { max-width: calc(100% - 96px); white-space: nowrap; }

/* Onboarding tips */
.tips { display: grid; gap: 8px; margin: -8px 0 24px; }
.tip { position: relative; display: flex; align-items: stretch; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.tip-body { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 4px 12px 14px; text-align: left; min-width: 0; }
.tip-body strong { display: block; font-size: 14.5px; }
.tip-body small { display: block; color: var(--muted); font-size: 12.5px; }
.tip .lead { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tip .lead svg { width: 20px; height: 20px; }
.tip-close { width: 44px; flex: none; display: grid; place-items: center; color: var(--faint); border-radius: 0 18px 18px 0; }
.tip-close svg { width: 16px; height: 16px; }
.tip-close:hover { color: var(--text); }

/* Wallet ID QR */
.qr-card { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08); }

/* Large text from profile settings reaches the whole v2 surface, not only the profile. */
:root.polar-large-text .hero-amount { font-size: 48px; }
:root.polar-large-text .action { font-size: 13.5px; }
:root.polar-large-text .row .end strong, :root.polar-large-text .row .body strong { font-size: 17px; }
:root.polar-large-text .row small, :root.polar-large-text .hint, :root.polar-large-text .callout { font-size: 14.5px; }
:root.polar-large-text .sheet-head h3 { font-size: 20px; }

/* Weak devices: keep the look, drop the expensive parts (live blur, sheen, orbit spin). */
.perf-low * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.perf-low .hero-sheen, .perf-low .action.primary .bubble::before { display: none; }
.perf-low .orbit-track, .perf-low .orbit-coin, .perf-low .orbit-core { animation: none; }
.perf-low .list, .perf-low .tip, .perf-low .kv, .perf-low .timeline, .perf-low .amount-box, .perf-low .text-field { background: color-mix(in srgb, var(--bg) 70%, #1c2748); }
:root.perf-low[data-theme="light"] .list, :root.perf-low[data-theme="light"] .tip { background: #fff; }
.profile-reduced-motion .hero-sheen, .profile-reduced-motion .orbit-track, .profile-reduced-motion .orbit-coin { animation: none; }

/* Sheet drag affordance */
.grabber, .sheet-head { touch-action: none; cursor: grab; }

/* Desktop: two columns instead of a stretched phone column. */
@media (min-width: 960px) {
  .app { max-width: 1040px; padding-inline: 32px; }
  .view:has(> .home-main) { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .home-main { position: sticky; top: 20px; }
  .home-side { padding-top: 2px; }
  .view > .callout { grid-column: 1 / -1; }
  .view:not(:has(> .home-main)) { max-width: 640px; margin: 0 auto; }
  .tabbar { width: 420px; }
}

/* ——— Gift checks and monthly insights ——— */
.check-card { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 18px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(120% 90% at 0 0, #2547e0, transparent 60%), radial-gradient(90% 100% at 100% 100%, #0aa7a8, transparent 60%), radial-gradient(70% 70% at 90% 0, #6a2ad0, transparent 60%), #0b1438;
  box-shadow: 0 24px 60px -18px rgba(37, 71, 224, .6), inset 0 1px 0 rgba(255, 255, 255, .25); }
.check-card::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 16px, rgba(255, 255, 255, .05) 16px 17px); }
.check-card > * { position: relative; }
.check-card[data-gift-theme="birthday"] { background:radial-gradient(circle at 8% 15%,#ffb55d 0,transparent 32%),radial-gradient(circle at 92% 85%,#ff6ea9 0,transparent 40%),linear-gradient(135deg,#6324c6,#a92c97); }
.check-card[data-gift-theme="thanks"] { background:radial-gradient(ellipse at 100% 0,#57c7b9,transparent 60%),linear-gradient(135deg,#075c68,#097c57); }
.check-card[data-gift-theme="celebration"] { background:radial-gradient(circle at 95% 5%,#ffc663,transparent 45%),linear-gradient(135deg,#773d09,#a15a07 55%,#67429d); }
.check-card[data-gift-theme="birthday"]::before,.check-card[data-gift-theme="celebration"]::before { background-image:radial-gradient(circle,rgba(255,255,255,.48) 1px,transparent 2px); background-size:21px 23px; transform:rotate(-12deg) scale(1.3); }
.gift-toggle { display:flex; gap:12px; align-items:center; min-height:48px; padding:10px 0; font-weight:600; }
.gift-toggle input { width:20px; height:20px; accent-color:var(--accent); }
.text-field textarea { width:100%; min-height:100px; padding:0; border:0; color:inherit; background:transparent; font:inherit; resize:vertical; outline:none; }
.ck-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .28em; opacity: .8; }
.ck-top img { width: 30px; height: 30px; border-radius: 10px; }
.ck-amount { font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin: 14px 0 2px; overflow-wrap: anywhere; }
.ck-note { font-size: 15px; opacity: .9; min-height: 1.4em; overflow-wrap: anywhere; }
.ck-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 12px; opacity: .75; }
.week-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 14px 16px 10px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 18px; }
.week-chart div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: 11px; color: var(--muted); }
.week-chart i { width: 100%; min-height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), rgba(93, 139, 255, .5)); }
.row .end .link { font-size: 12.5px; }
.goal { display: block; padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.goal-top { display: flex; align-items: center; gap: 12px; }
.goal-top .emoji { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); flex: none; }
.goal-top strong { display: block; font-size: 16px; } .goal-top small { color: var(--muted); font-size: 13px; }
.goal-top .end { margin-left: auto; text-align: right; flex: none; } .goal-top .end b { display: block; font-size: 15px; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.coin-rub { display: grid !important; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #2f6bff, #73ece3); color: #fff; font-weight: 800; font-size: 20px; }
.coin-rub.sm { width: 22px; height: 22px; font-size: 12px; }

/* No page zoom in the Mini App: no double-tap zoom, and inputs stay at 16px so iOS does not zoom on focus. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, select, textarea { font-size: max(16px, 1em); }

/* History header with the statement button */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head .chip { flex: none; }
.i.big { width: 40px; height: 40px; }

/* Local camera / photo decoder, independent of Telegram SDK support. */
.qr-scanner{box-sizing:border-box;width:min(94vw,480px);max-height:90dvh;overflow:auto;background:#101831;color:#edf4ff;border:1px solid #3b4d70;border-radius:26px;padding:22px;box-shadow:0 24px 100px #0009}.qr-scanner::backdrop{background:#030918cf;backdrop-filter:blur(8px)}.qr-scanner-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.qr-scanner h2{font-size:25px;margin:0}.qr-scanner-head button{border:0;border-radius:50%;width:40px;height:40px;background:#263552;color:inherit;font-size:28px}.qr-scanner p{font-size:14px;line-height:1.5;color:#b8c9e3}.qr-scanner video{display:block;width:100%;max-height:38dvh;object-fit:contain;border-radius:16px;background:#050b19}.qr-scanner video[hidden],.qr-scanner button[hidden]{display:none}.qr-scanner .btn{box-sizing:border-box;min-height:46px;width:100%;font:inherit;display:flex;align-items:center;justify-content:center;text-align:center;cursor:pointer;margin:8px 0}.qr-scanner-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px}.qr-scanner-buttons input{position:absolute;width:1px;height:1px;opacity:0}.qr-scanner label:focus-within{outline:2px solid #59e7e4;outline-offset:3px}.qr-scanner form{margin-top:18px;border-top:1px solid #35405a;padding-top:16px}.qr-scanner form label{font-size:13px;color:#b8c9e3}.qr-scanner textarea{box-sizing:border-box;width:100%;margin-top:8px;background:#0a1227;color:#edf4ff;border:1px solid #465370;border-radius:12px;padding:12px;font:inherit;resize:vertical}.qr-scanner-status{min-height:42px}@media(max-width:360px){.qr-scanner-buttons{grid-template-columns:1fr}.qr-scanner{padding:16px}}

#f-custody-notice[hidden]{display:none}
.qr-scanner{max-height:90vh;max-height:90dvh}.qr-scanner-shade{position:fixed;inset:0;background:#030918cf;z-index:10000}.qr-scanner-fallback{position:fixed;top:5vh;left:50%;transform:translateX(-50%);margin:0;z-index:10001}

/* Personal notification controls share the wallet's theme and touch sizes. */
.notice-settings { display:grid; gap:10px; }
.notice-settings .check-row { display:flex; align-items:center; gap:12px; padding:14px; border-radius:var(--radius-s); background:var(--surface); font-size:15px; line-height:1.45; cursor:pointer; }
.notice-settings .check-row input { flex:none; width:20px; height:20px; accent-color:var(--accent); }
.notice-settings .field-label { margin:10px 2px 0; }
.notice-settings .hint { margin:0 2px 8px; }
.notice-settings .text-field { margin:0; }
.text-field select { flex:1; min-width:0; width:100%; height:52px; border:0; outline:0; background:transparent; color:var(--text); font:inherit; font-size:15px; }
.text-field option { color:var(--text); background:var(--bg-elev); }
.notice-settings .btn-row .text-field { flex:1; }

/* Compact history: advanced tools are shown only on request. */
.history-head .page-title { flex: 1; }
.history-tools { padding: 16px; border: 1px solid var(--line); border-radius: 24px; margin: 12px 0 20px; background: var(--surface); }
.history-tools .btn-row { margin-top: 8px; }
.history-date { margin: 24px 0 8px; font-size: 13px; font-weight: 600; }
.history-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.op-icon .dir.out { color: var(--text); }
.coin.merchant-coin { overflow: hidden; border-radius: 50%; background: #fed208; }
.coin.merchant-coin img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.coin.bank-merchant { background: var(--surface-2); }
.merchant-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.merchant-fallback svg { width: 22px; height: 22px; }
.coin.merchant-coin img { position: relative; z-index: 1; }

/* Paid AML check report */
.aml-good { --c: var(--ok); } .aml-warn { --c: var(--warn); } .aml-bad { --c: var(--bad); }
.row .end strong.aml-good, .row .end strong.aml-warn, .row .end strong.aml-bad { color: var(--c); }
.aml-score { width: 148px; height: 148px; margin: 6px auto 10px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 3.6deg), var(--surface-2) 0); }
.aml-score > div { width: 116px; height: 116px; border-radius: 50%; background: var(--bg-elev, var(--surface)); display: grid; place-content: center; text-align: center; }
.aml-score b { font-size: 34px; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.aml-score span { font-size: 12px; color: var(--muted); }
.aml-level { text-align: center; font-weight: 700; color: var(--c); margin: 0 0 16px; }
.aml-addr { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; word-break: break-all; white-space: normal; }
.aml-bar { display: block; height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.aml-bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

/* ——— Support centre and chat (chat.mjs) ——— */
.support-btn { position: relative; }
.dot-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-title { margin: 18px 2px 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.support-hero, .support-subject { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.support-hero > svg.i, .support-subject > svg.i { width: 26px; height: 26px; flex: none; color: var(--accent); }
.support-hero div, .support-subject div { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.support-hero small, .support-subject small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.support-subject { margin-bottom: 10px; }
.btn.small { width: auto; height: 40px; padding: 0 14px; font-size: 13.5px; min-height: 0; flex: none; border-radius: 12px; }
.support-subject { flex-wrap: wrap; }
.support-subject > div { flex: 1 1 190px; }
.support-subject .btn.small { margin-left: auto; }
.chips.topics, .chips.quick { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0 0 6px; }
.chat-log { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 10px; }
.msg-day { text-align: center; margin: 10px 0 4px; }
.msg-day span { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.msg { max-width: 84%; padding: 9px 12px 7px; border-radius: 16px; background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 6px; animation: msg-in .18s ease-out; }
.msg.me { align-self: flex-end; background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(123, 228, 211, .22); border-bottom-left-radius: 16px; border-bottom-right-radius: 6px; }
.msg.ai { box-shadow: inset 0 0 0 1px var(--line); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.msg small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.msg.me small { text-align: right; }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.profile-reduced-motion .msg, .perf-low .msg { animation: none; }
.chat-compose textarea { min-height: 52px; max-height: 160px; resize: none; }

/* eSIM (esim.mjs): country flags in the list, the chosen package, the install QR. */
.row .lead.esim-lead { overflow: hidden; padding: 0; }
.esim-flag { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.esim-summary .esim-flag.big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 10px; }
.row[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.esim-about { margin: 12px 0; }
.esim-about summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.esim-qr { background: #fff; }
.esim-emoji { display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
.esim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.esim-tile { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line, transparent); color: inherit; font: inherit; text-align: center; cursor: pointer; }
.esim-tile strong { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.esim-tile small { font-size: 12px; color: var(--muted); }
.esim-flag.tile { width: 36px; height: 36px; border-radius: 50%; }
.esim-seg .chip { flex: 1; }
.esim-steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.esim-list .row .body small { white-space: normal; }
.sheet:has(#esim-q) { min-height: 86vh; }
/* eSIM: hero, my eSIM cards with data left, sticky search, letters, tags. */
.esim-hero { border-radius: 22px; padding: 18px; margin-bottom: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)); }
.esim-hero h2 { margin: 0 0 4px; font-size: 20px; }
.esim-hero p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.esim-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.esim-hero li { display: flex; align-items: center; gap: 10px; }
.esim-hero li .i { width: 18px; height: 18px; color: var(--accent); flex: none; }
.esim-cards { display: grid; gap: 8px; margin-bottom: 14px; }
.esim-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.esim-card .body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.esim-card small { color: var(--muted); font-size: 12.5px; }
.esim-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.esim-bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.esim-bar.low i { background: #e5a23a; }
.esim-left { margin-top: 10px; max-width: 260px; margin-inline: auto; display: grid; gap: 4px; }
.esim-left small { color: var(--muted); font-size: 13px; }
.esim-sticky { position: sticky; top: -4px; z-index: 2; background: var(--bg-elev); padding: 4px 0 2px; margin: 0 0 6px; }
.esim-letter { margin-top: 14px; }
.esim-tag { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.esim-tag.good { background: color-mix(in srgb, #2fbf71 22%, transparent); color: #2fbf71; }
.esim-list .row .end small { display: block; color: var(--muted); font-size: 12px; }
:root[data-theme="light"] .esim-sticky { background: var(--bg); }

/* ——— «Сервисы»: featured cards and colour tiles ——— */
.svc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-bottom: 8px; }
.svc > * { min-width: 0; }
.svc > * { animation: rise .4s cubic-bezier(.2, .9, .25, 1) both; }
.svc > :nth-child(2) { animation-delay: .04s; } .svc > :nth-child(3) { animation-delay: .08s; }
.svc > :nth-child(4) { animation-delay: .12s; } .svc > :nth-child(5) { animation-delay: .16s; } .svc > :nth-child(6) { animation-delay: .2s; }
.svc-head { padding: 6px 4px 0; }
.svc-head h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.svc-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.svc .section-head { margin-bottom: 10px; }

.svc-featured { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-featured.one { grid-template-columns: 1fr; }
.svc-card {
  position: relative; overflow: hidden; isolation: isolate; text-align: left;
  display: grid; align-content: end; gap: 3px; min-height: 168px; padding: 70px 16px 16px; border-radius: 24px; color: #fff;
  box-shadow: 0 14px 34px -14px var(--glow), inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .18s cubic-bezier(.2, .9, .25, 1), box-shadow .2s;
}
.svc-card.fx { --glow: rgba(40, 190, 175, .6); background: radial-gradient(120% 90% at 100% 0%, #6ff2dc 0%, transparent 55%), linear-gradient(150deg, #0fb5a4, #0b6f8f 60%, #1c3f9e); }
.svc-card.esim { --glow: rgba(110, 90, 255, .6); background: radial-gradient(120% 90% at 100% 0%, #b9a2ff 0%, transparent 55%), linear-gradient(150deg, #7a5cff, #4b3bd6 55%, #1f2a8f); }
.svc-card .svc-icon { position: absolute; top: 14px; left: 14px; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.svc-card .svc-icon svg { width: 23px; height: 23px; }
.svc-card strong { font-size: 16.5px; line-height: 1.2; letter-spacing: -.01em; }
.svc-card small { font-size: 12.5px; opacity: .82; }
.svc-featured.one .svc-card { min-height: 104px; padding: 16px 56px 16px 74px; align-content: center; }
.svc-featured.one .svc-card .svc-icon { top: 50%; transform: translateY(-50%); }
.svc-go { position: absolute; top: 16px; right: 14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.svc-go svg { width: 16px; height: 16px; }
.svc-featured.one .svc-go { top: 50%; transform: translateY(-50%); }
.svc-card-glow { position: absolute; z-index: -1; width: 160px; height: 160px; right: -50px; bottom: -70px; border-radius: 50%; background: rgba(255, 255, 255, .16); filter: blur(2px); animation: svc-float 7s ease-in-out infinite alternate; }
@keyframes svc-float { to { transform: translate(-18px, -10px) scale(1.08); } }
.svc-card:active { transform: scale(.97); }

.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.svc-tile {
  --c1: hsl(var(--h) 88% 64%); --c2: hsl(calc(var(--h) + 28) 78% 50%);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0;
  padding: 13px 12px 12px; border-radius: 20px; background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  transition: transform .18s cubic-bezier(.2, .9, .25, 1), box-shadow .2s;
}
.svc-tile::before { content: ""; position: absolute; inset: -40% -40% auto auto; width: 90px; height: 90px; border-radius: 50%; background: var(--c1); opacity: .1; filter: blur(18px); pointer-events: none; }
.svc-tile .svc-icon {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 10px; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: 0 8px 18px -8px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.svc-tile .svc-icon svg { width: 21px; height: 21px; }
.svc-tile strong { font-size: 13.5px; line-height: 1.2; letter-spacing: -.005em; max-width: 100%; overflow-wrap: anywhere; }
.svc-tile small { font-size: 11.5px; color: var(--muted); line-height: 1.25; max-width: 100%; }
.svc-tile:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c1) 45%, transparent); }
.svc-tile:active { transform: scale(.95); }
.svc-tile:active .svc-icon { transform: rotate(-6deg); transition: transform .15s; }

.svc-invite {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 22px; color: var(--text);
  background: linear-gradient(120deg, color-mix(in srgb, #ffb547 22%, var(--surface)), var(--surface) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffb547 30%, transparent);
}
.svc-invite .svc-icon { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; color: #3a2200; background: linear-gradient(145deg, #ffd36e, #ff9a3c); box-shadow: 0 8px 18px -8px #ff9a3c; }
.svc-invite .svc-icon svg { width: 22px; height: 22px; }
.svc-invite-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.svc-invite strong { font-size: 15px; }
.svc-invite small { color: var(--muted); font-size: 12.5px; }
.svc-invite > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.svc-invite:active { transform: scale(.98); }

.action.services .bubble { color: var(--accent); }
:root[data-theme="light"] .svc-tile { box-shadow: 0 1px 2px rgba(11, 18, 34, .04), inset 0 0 0 1px var(--line); }
:root[data-theme="light"] .svc-tile::before { opacity: .16; }
@media (min-width: 900px) { .svc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 350px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
:root.polar-large-text .svc-tile strong { font-size: 15px; } :root.polar-large-text .svc-tile small { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .svc > *, .svc-card-glow { animation: none; } }
.profile-reduced-motion .svc > *, .profile-reduced-motion .svc-card-glow, .perf-low .svc-card-glow { animation: none; }
.perf-low .svc-card .svc-icon { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ——— «Сервисы»: live numbers, badges, recent row, pinned home button ——— */
.svc-badge, .svc-new { position: absolute; top: 10px; right: 10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.svc-badge { background: var(--bad); color: #fff; box-shadow: 0 4px 12px -4px var(--bad); }
.svc-new { background: linear-gradient(135deg, #ffd36e, #ff9a3c); color: #3a2200; letter-spacing: .02em; }
.svc-new.on-card { top: 16px; right: 50px; background: rgba(255, 255, 255, .92); color: #2a1f6e; }
.svc-pin { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.svc-pin svg { width: 13px; height: 13px; }
.svc-badge ~ .svc-pin, .svc-new ~ .svc-pin { right: 38px; }
.svc-card .svc-pin { top: 16px; right: 50px; background: rgba(255, 255, 255, .2); color: #fff; }
.svc-invite { position: relative; }
.svc-invite .svc-pin { position: static; flex: none; }
.svc-bar { display: block; width: 100%; height: 4px; margin-top: 7px; border-radius: 2px; background: color-mix(in srgb, var(--c1) 18%, transparent); overflow: hidden; }
.svc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width .6s cubic-bezier(.2, .9, .25, 1); }
.svc-recent .section-head { margin-bottom: 8px; }
.svc-recent-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.svc-recent-row::-webkit-scrollbar { display: none; }
.svc-chip { --c1: hsl(var(--h) 88% 64%); --c2: hsl(calc(var(--h) + 28) 78% 50%); flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.svc-chip .svc-icon { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--c1), var(--c2)); }
.svc-chip .svc-icon svg { width: 16px; height: 16px; }
.svc-chip:active { transform: scale(.96); }
.svc-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -6px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.svc-hint svg { width: 14px; height: 14px; flex: none; }
.svc [data-svc] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.action.pinned .bubble { color: #fff; background: linear-gradient(145deg, hsl(var(--h) 88% 64%), hsl(calc(var(--h) + 28) 78% 50%)); box-shadow: 0 8px 20px -10px hsl(calc(var(--h) + 28) 78% 50%); }
.avatar-btn { flex: none; border-radius: 50%; }
.avatar-btn:active { transform: scale(.94); }
