/* ═══════════ DZ Finance — дизайн-система ═══════════ */
:root {
  --bg: #F3F0EA; --bg2: #EAE6DD; --card: #FFFFFF; --card2: #F6F3EE; --line: rgba(20,22,26,.08); --line2: rgba(20,22,26,.14);
  --text: #15171B; --muted: #6F737C; --faint: #A3A6AD;
  --gold: #A97B2C; --gold-l: #D6AE62; --gold-grad: linear-gradient(135deg,#F3DDA6 0%,#D6AE62 45%,#9C7432 100%);
  --inc: #0E9F63; --exp: #E5484D; --tr: #3B6FE0; --debt: #D98B00;
  --inc-bg: rgba(14,159,99,.1); --exp-bg: rgba(229,72,77,.1);
  --shadow: 0 1px 2px rgba(20,22,26,.04), 0 8px 24px rgba(20,22,26,.06);
  --shadow-lg: 0 24px 60px rgba(20,22,26,.18);
  --glass: rgba(255,255,255,.78);
  --r: 20px; --r-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, "SF Pro Display", "Inter", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A0B0E; --bg2: #0F1115; --card: #14171D; --card2: #1B1F27; --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.13);
  --text: #F2EFE8; --muted: #8C909A; --faint: #5D616B;
  --gold: #E0BD78; --gold-l: #E0BD78;
  --inc: #3DD68C; --exp: #FF6B6B; --tr: #7AA2FF; --debt: #F5A524;
  --inc-bg: rgba(61,214,140,.12); --exp-bg: rgba(255,107,107,.12);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --shadow-lg: 0 24px 80px rgba(0,0,0,.6);
  --glass: rgba(16,18,23,.78);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html.locked, html.locked body { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg.ic { width: 22px; height: 22px; flex: none; }
.inc { color: var(--inc); } .exp { color: var(--exp); } .neg { color: var(--exp); } .pos { color: var(--inc); }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 2px 12px; }
.hint.center, .center { text-align: center; }
.mt { margin-top: 14px; }
.masked { letter-spacing: 2px; opacity: .7; }
.link { color: var(--gold); font-weight: 600; font-size: 14px; }
::selection { background: rgba(214,174,98,.35); }

/* ——— Каркас ——— */
#app { display: block; }
.main { padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 96px); max-width: 760px; margin: 0 auto; }
.page.enter { animation: pageIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.side { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5,1fr);
  padding: 6px 8px calc(var(--sab) + 6px); background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; font-size: 10.5px; font-weight: 600; color: var(--faint); transition: color .2s; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--text); }
.tab.on svg { color: var(--gold); }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 250px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--bg2); z-index: 40; }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 26px; }
  .side-brand b { display: block; font-size: 17px; letter-spacing: .2px; } .side-brand small { color: var(--muted); font-size: 12px; }
  .side nav { display: flex; flex-direction: column; gap: 4px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
  .side-link:hover { background: var(--card); color: var(--text); }
  .side-link.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
  .side-link.on svg { color: var(--gold); }
  .side-actions { display: grid; gap: 8px; margin-top: 24px; }
  .side-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; color: var(--faint); font-size: 12px; padding: 8px; }
  .side-foot svg { width: 18px; height: 18px; }
  .main { margin-left: 250px; padding: 28px 40px 60px; max-width: 1040px; margin-right: auto; }
  @supports (margin-left: max(0px)) { .main { margin-left: max(250px, calc(50vw - 520px + 125px)); } }
  .fab { display: none !important; }
}

/* ——— Общие элементы ——— */
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--card); color: var(--text); box-shadow: var(--shadow); transition: transform .12s, background .2s; flex: none; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 12px; box-shadow: none; background: var(--card2); }
.icon-btn.xs { width: 30px; height: 30px; border-radius: 10px; box-shadow: none; background: var(--card2); }
.icon-btn.xs svg { width: 17px; height: 17px; }
.icon-btn.accent { background: var(--text); color: var(--bg); }
.icon-btn.on { background: var(--gold); color: #111; }
.icon-btn.danger { color: var(--exp); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 16px; font-weight: 650; font-size: 15.5px; transition: transform .12s, opacity .2s; position: relative; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.lg { height: 58px; font-size: 17px; }
.btn.xs { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; margin-left: 6px; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.danger { background: var(--exp); color: #fff; }
.btn.danger-ghost { background: var(--exp-bg); color: var(--exp); }
.btn.link { background: none; color: var(--gold); height: 44px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.card.inner { box-shadow: none; background: var(--card2); }
.pad { padding: 18px; } .pad-s { padding: 6px 14px; }
.list { padding: 4px 0; overflow: hidden; }
.sec { margin-top: 26px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 4px 10px; }
.sec-head h2 { font-size: 19px; margin: 0; letter-spacing: -.2px; }
.sec .sec-head { margin-top: 0; }
.sec-head a { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.sec-head a svg { width: 16px; height: 16px; }
.phead { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 12px; }
.phead h1 { font-size: 28px; letter-spacing: -.6px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead-r { display: flex; gap: 8px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 12px; font-size: 14px; }
.banner svg { color: var(--gold); width: 20px; } .banner span { flex: 1; }
.text-in.area { height: 180px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; resize: vertical; }
.banner.install { align-items: flex-start; }
.onb-move { width: 100%; text-align: left; margin-bottom: 14px; }
.onb-move b { display: block; }
.banner.install b { display: block; }
.banner.demo { background: linear-gradient(90deg, rgba(214,174,98,.18), rgba(214,174,98,.06)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.inc { background: var(--inc); } .dot.exp { background: var(--exp); }

/* ——— Главная ——— */
.home-top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mono { flex: none; filter: drop-shadow(0 4px 12px rgba(0,0,0,.18)); }
.mono.ghost { filter: none; }
.hello { font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.date { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 8px; }
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 22px 20px 16px; color: #F4EFE4;
  background: radial-gradient(120% 90% at 100% 0%, rgba(214,174,98,.30) 0%, rgba(214,174,98,0) 55%), radial-gradient(80% 80% at 0% 100%, rgba(61,214,140,.10), transparent 60%), linear-gradient(160deg, #1A1D24 0%, #0E1014 70%);
  box-shadow: 0 20px 50px rgba(10,11,14,.35), inset 0 0 0 1px rgba(224,189,120,.18); isolation: isolate; }
.hero-glow { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.06) 45%, transparent 60%); background-size: 250% 100%; animation: sheen 6s ease-in-out infinite; z-index: -1; }
@keyframes sheen { 0%,100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.hero-mark { position: absolute; right: -28px; bottom: -36px; opacity: .08; z-index: -1; transform: rotate(-8deg); }
.hero-mark .mono rect:first-child { fill: none; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-label { font-size: 13px; letter-spacing: .4px; text-transform: uppercase; color: rgba(244,239,228,.62); font-weight: 600; }
.hero-cur { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: #F3DDA6; }
.hero-total { font-family: var(--font-num); font-size: 42px; font-weight: 700; letter-spacing: -1.4px; margin: 8px 0 2px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-dec { font-size: .55em; opacity: .65; letter-spacing: 0; }
.m-sym { font-size: .46em; margin-left: .3em; color: #E0BD78; letter-spacing: 0; font-weight: 600; }
.hero-sub { color: rgba(244,239,228,.6); font-size: 13.5px; min-height: 19px; }
.hero-sub a { color: #F3DDA6; }
.hero-month { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.hm { padding: 11px 12px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 4px; }
.hm-l { font-size: 12px; color: rgba(244,239,228,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-l em { font-style: normal; font-size: 11px; font-weight: 700; }
.hm-l em.up { color: #FF8A8A; } .hm-l em.down { color: #5BE3A0; }
.hm b { font-family: var(--font-num); font-size: 17px; font-variant-numeric: tabular-nums; }
.hm b.inc { color: #5BE3A0; } .hm b.exp { color: #FF8A8A; }
.main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 12px; }
.big-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border-radius: 22px; font-size: 18px; font-weight: 700; letter-spacing: -.2px; color: #fff; transition: transform .12s, filter .2s; position: relative; overflow: hidden; }
.big-btn:active { transform: scale(.97); filter: brightness(.95); }
.big-btn.inc { background: linear-gradient(135deg, #2FD08A, #0E9F63); box-shadow: 0 10px 24px rgba(14,159,99,.28); color: #fff; }
.big-btn.exp { background: linear-gradient(135deg, #FF7A7A, #E5484D); box-shadow: 0 10px 24px rgba(229,72,77,.28); color: #fff; }
.big-btn.ghost { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.big-btn.sm { height: 50px; font-size: 15.5px; border-radius: 16px; gap: 8px; }
.big-btn.sm svg { width: 20px; height: 20px; }
.bb-ic { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.22); }
.bb-ic svg { width: 20px; height: 20px; stroke-width: 2.4; }
.quick { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.quick > * { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 16px; transition: background .15s; }
.quick > *:active { background: var(--card); }
.quick span { width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--text); }
.quick span.inc { color: var(--inc); } .quick span.exp { color: var(--exp); }
.quick.four { margin: 14px 0 4px; }
.wallet-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
.wallet-rail::-webkit-scrollbar, .rail::-webkit-scrollbar, .chips.scroll::-webkit-scrollbar { display: none; }
.wcard { scroll-snap-align: start; flex: none; width: 160px; min-height: 116px; border-radius: 20px; padding: 13px 14px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .12s; }
.wcard::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); pointer-events: none; }
.wcard:active { transform: scale(.97); }
.wc-top { display: flex; justify-content: space-between; align-items: center; }
.wc-cur { font-size: 11px; font-weight: 700; color: var(--muted); }
.wc-name { margin-top: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 12px; }
.wc-bal { font-family: var(--font-num); font-size: 18px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wc-bal.neg { color: var(--exp); }
.wcard.add { align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; background: transparent; box-shadow: none; border: 1.5px dashed var(--line2); }
.cur-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cchip { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }

/* ——— Плитки и строки ——— */
.wtile, .ctile { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 21px; line-height: 1;
  background: color-mix(in srgb, var(--c) 17%, transparent); color: var(--c); }
.wtile svg { width: 22px; height: 22px; }
.wtile.sm, .ctile.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 17px; }
.wtile.sm svg { width: 18px; height: 18px; }
.wtile.lg, .ctile.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; }
.ctile.add { --c: #8C909A; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 17px; background: var(--card2); color: var(--gold); }
.avatar.lent { background: var(--inc-bg); color: var(--inc); } .avatar.borrowed { background: var(--exp-bg); color: var(--exp); }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; text-align: left; position: relative; transition: background .15s; min-height: 62px; }
.tx:active, a.tx:hover, button.tx:hover { background: var(--card2); }
.list > .tx + .tx::before, .list > .wrow-wrap + .wrow-wrap::before, .list > .menu-item + .menu-item::before { content: ""; position: absolute; left: 70px; right: 0; top: 0; height: 1px; background: var(--line); }
.wrow-wrap { display: flex; align-items: center; position: relative; }
.reorder { display: flex; flex-direction: column; gap: 4px; padding-left: 10px; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-family: var(--font-num); font-weight: 700; font-size: 15.5px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; }
.tx-amt small { font-family: var(--font); font-weight: 500; font-size: 11.5px; color: var(--muted); }
.tx-amt.tr { color: var(--text); } .tx-amt.tr small { color: var(--inc); font-weight: 600; font-size: 12.5px; font-family: var(--font-num); }
.tx-amt.adj { color: var(--muted); }
.day { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; padding: 6px 6px 8px; font-size: 13px; font-weight: 650; color: var(--muted); }
.day-head span:first-letter { text-transform: uppercase; }
.day-head .pos { color: var(--inc); }
.empty { text-align: center; padding: 28px 20px; color: var(--muted); }
.empty-ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; display: grid; place-items: center; background: var(--card2); color: var(--gold); }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 0 12px; font-size: 13.5px; }
.catbar, .budget { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; text-align: left; }
.catbar + .catbar, .budget + .budget { border-top: 1px solid var(--line); }
.cb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.cb-top > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-top small { color: var(--muted); font-weight: 500; }
.cb-top b { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-foot { font-size: 12px; color: var(--muted); }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--card2); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.thin { height: 4px; margin-top: 4px; } .bar.thin i { background: var(--inc); }
.bar.big { height: 10px; margin: 12px 0 6px; }
.bar.big em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; border-radius: 2px; }
.budget .bar i { background: var(--inc); }
.budget.warn .bar i { background: #F5A524; }
.budget.over .bar i, .bar.over i { background: var(--exp); }
.budget.over .cb-foot { color: var(--exp); font-weight: 600; }
.pct { width: 40px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ——— Фильтры ——— */
.search { position: relative; margin-bottom: 10px; }
.search span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search span svg { width: 19px; height: 19px; }
.search input { width: 100%; height: 46px; border-radius: 15px; border: 0; background: var(--card); box-shadow: var(--shadow); padding: 0 14px 0 42px; font-size: 16px; outline: none; }
.chips { display: flex; gap: 8px; margin-bottom: 10px; }
.chips.scroll { overflow-x: auto; margin: 0 -16px 10px; padding: 2px 16px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; position: relative; }
.chip svg { width: 17px; height: 17px; }
.chip.on { background: var(--text); color: var(--bg); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.sel { width: 100%; height: 44px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow); padding: 0 34px 0 12px; font-size: 15px; font-weight: 500; appearance: none; -webkit-appearance: none; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; text-overflow: ellipsis; }
.filters > .sel:only-child { grid-column: 1 / -1; }
.date-in { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; color: var(--muted); }
.date-in input { border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 15px; color: var(--text); }
.month-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.month-nav .icon-btn.sm { background: var(--card); box-shadow: var(--shadow); }
.mn-label { flex: 1; text-align: center; font-weight: 700; font-size: 16px; display: flex; flex-direction: column; }
.mn-label small { font-weight: 500; color: var(--muted); font-size: 12px; min-height: 15px; }
.sum-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 6px; margin-bottom: 16px; text-align: center; }
.sum-strip span { display: block; font-size: 12px; color: var(--muted); }
.sum-strip b { font-family: var(--font-num); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.more-btn { margin-bottom: 20px; }
.fab { position: fixed; right: 18px; bottom: calc(var(--sab) + 84px); width: 58px; height: 58px; border-radius: 20px; background: var(--text); color: var(--bg); display: grid; place-items: center; box-shadow: var(--shadow-lg); z-index: 45; transition: transform .12s; }
.fab:active { transform: scale(.92); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
.seg { display: flex; padding: 3px; border-radius: 14px; background: var(--card2); gap: 2px; }
.seg button { flex: 1; height: 34px; border-radius: 11px; font-size: 14px; font-weight: 650; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; padding: 0 8px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
:root[data-theme="dark"] .seg button.on { background: #2A2F3A; }
.page > .seg { background: var(--card); box-shadow: var(--shadow); }
.page > .seg button.on { background: var(--card2); }

/* ——— Кошельки ——— */
.total-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 8px; }
.total-card > span { color: var(--muted); font-size: 13px; display: block; }
.total-card > b { display: block; font-family: var(--font-num); font-size: 30px; letter-spacing: -.8px; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.total-card > b small { font-size: 15px; color: var(--muted); letter-spacing: 0; font-weight: 600; }
.total-card .m-sym { color: var(--gold); }
.total-card .cchip { background: var(--card2); box-shadow: none; }
.arch { margin-top: 18px; } .arch summary { color: var(--muted); font-weight: 600; padding: 8px 4px; cursor: pointer; }
.wallet-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 18px; background: var(--card); box-shadow: var(--shadow); }
.wallet-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 65%); pointer-events: none; }
.wh-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; position: relative; }
.wh-bal { font-family: var(--font-num); font-size: 38px; font-weight: 700; letter-spacing: -1.2px; margin-top: 14px; font-variant-numeric: tabular-nums; position: relative; }
.wh-bal .m-sym { color: var(--gold); }
.wh-sub, .wh-month { color: var(--muted); font-size: 13.5px; position: relative; }
.wh-month { margin-top: 10px; }
.wallet-hero.debt .bar i { background: var(--c); }

/* ——— Аналитика ——— */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 13px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font-family: var(--font-num); font-size: 19px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { font-size: 12px; color: var(--muted); }
.duo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.duo > :only-child { grid-column: 1 / -1; }
.chart-card { padding: 16px; margin-bottom: 12px; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cc-head h3 { margin: 0; font-size: 16px; }
.cc-head .seg { flex: 1; max-width: 320px; }
.legend { font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend .dot { margin-left: 8px; margin-right: 4px; }
.chart { min-height: 120px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart-svg .b-inc { fill: var(--inc); animation: grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d); transform-box: fill-box; transform-origin: bottom; }
.chart-svg .b-exp { fill: var(--exp); animation: grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d); transform-box: fill-box; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-svg .hit { fill: transparent; cursor: pointer; }
.chart-svg .hit.sel { fill: var(--text); fill-opacity: .06; }
.chart-svg .area-line { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 3000; animation: draw 1.4s ease both; }
@keyframes draw { from { stroke-dashoffset: 3000; } to { stroke-dashoffset: 0; } }
.chart-svg .area-dot { fill: var(--gold); stroke: var(--card); stroke-width: 3; }
.chart-tip { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); padding: 10px 2px 0; min-height: 30px; }
.chart-tip b { color: var(--text); width: 100%; }
.chart-tip span { font-family: var(--font-num); font-weight: 600; }
.donut-wrap { display: grid; place-items: center; padding: 6px 0 12px; }
.donut { position: relative; }
.donut svg { display: block; animation: spinIn .9s cubic-bezier(.2,.8,.2,1); }
@keyframes spinIn { from { transform: rotate(-60deg) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.donut-track { stroke: var(--card2); }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.dc-top { font-family: var(--font-num); font-weight: 700; font-size: 18px; letter-spacing: -.3px; line-height: 1.15; }
.dc-bot { font-size: 12px; color: var(--muted); }
.cat-list .catbar { padding: 9px 0; }
.wstat { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.wstat + .wstat { border-top: 1px solid var(--line); }
.ws-v { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--font-num); font-size: 13.5px; }

/* ——— Меню ——— */
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; position: relative; min-height: 58px; transition: background .15s; }
.menu-item:active, .menu-item:hover { background: var(--card2); }
.mi-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--card2); color: var(--gold); flex: none; }
.mi-ic svg { width: 20px; height: 20px; }
.mi-chev { color: var(--faint); width: 18px; height: 18px; }
.menu-item.danger .mi-ic, .menu-item.danger .tx-title { color: var(--exp); }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; color: #F4EFE4; background: linear-gradient(150deg, #1A1D24, #0E1014); box-shadow: 0 14px 40px rgba(10,11,14,.3), inset 0 0 0 1px rgba(224,189,120,.18); }
.profile-card div { flex: 1; } .profile-card b { display: block; font-size: 17px; } .profile-card small { color: rgba(244,239,228,.6); }
.about { display: flex; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; margin: 26px 0 8px; text-align: left; }

/* ——— Курсы ——— */
.rate-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; position: relative; }
.rate-row + .rate-row { border-top: 1px solid var(--line); }
.flag { font-size: 26px; width: 34px; text-align: center; }
.rate-in { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rate-in input { width: 92px; height: 38px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card2); text-align: right; padding: 0 10px; font-family: var(--font-num); font-weight: 700; font-size: 16px; color: var(--text); outline: none; }
.rate-in input:focus { border-color: var(--gold); }
.badge { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: rgba(214,174,98,.18); color: var(--gold); vertical-align: 1px; margin-left: 4px; }
.xs-sp { width: 30px; flex: none; }
.conv-row { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.conv-row .sel { box-shadow: none; background-color: var(--card2); }
.conv-eq { display: grid; place-items: center; color: var(--muted); height: 30px; }
.conv-out { display: flex; align-items: center; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--card2); font-family: var(--font-num); font-weight: 700; font-size: 20px; overflow: hidden; white-space: nowrap; }
.conv .text-in { font-family: var(--font-num); font-weight: 700; font-size: 20px; }

/* ——— Формы ——— */
.form { display: flex; flex-direction: column; gap: 14px; }
.fl { display: flex; flex-direction: column; gap: 7px; }
.fl > span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.text-in { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); padding: 0 14px; font-size: 16px; outline: none; transition: border-color .2s; }
.text-in:focus { border-color: var(--gold); }
.form .sel { box-shadow: none; background-color: var(--card2); border: 1px solid var(--line2); height: 48px; }
.money-in { position: relative; display: block; }
.money-in em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-weight: 600; }
.money-in .text-in { padding-right: 56px; font-family: var(--font-num); font-weight: 600; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-weight: 550; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.switch:checked { background: var(--inc); }
.switch:checked::after { transform: translateX(20px); }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.color { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); transition: transform .15s; }
.color.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); transform: scale(.92); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px,1fr)); gap: 6px; max-height: 196px; overflow-y: auto; padding: 2px; }
.emoji-grid button { height: 44px; border-radius: 12px; font-size: 22px; background: var(--card2); transition: transform .1s; }
.emoji-grid button.on { background: rgba(214,174,98,.25); box-shadow: inset 0 0 0 2px var(--gold); }
.wallet-preview { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--card2); }
.wallet-preview b { display: block; font-size: 17px; } .wallet-preview small { color: var(--muted); }
.ok-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--inc-bg); color: var(--inc); font-weight: 600; margin-bottom: 12px; }
.steps { padding-left: 0; list-style: none; counter-reset: s; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; display: flex; flex-direction: column; gap: 3px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-grad); color: #1A1406; font-weight: 800; }
.steps span { color: var(--muted); font-size: 14px; } .steps svg { width: 17px; height: 17px; vertical-align: -3px; color: var(--tr); }
.backup-state { display: flex; gap: 12px; align-items: center; }
.backup-state > svg { width: 40px; height: 40px; color: var(--inc); padding: 8px; border-radius: 13px; background: var(--inc-bg); }
.backup-state b { display: block; } .backup-state small { color: var(--muted); }

/* ——— Шторки ——— */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5,6,8,.5); opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - var(--sat) - 10px); background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .42s cubic-bezier(.2,.9,.2,1); display: flex; flex-direction: column; padding-bottom: var(--sab); overscroll-behavior: contain; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .sheet { transition-duration: .28s; transition-timing-function: cubic-bezier(.4,0,1,1); }
.sheet-grab { display: flex; justify-content: center; padding: 8px 0 2px; flex: none; }
.sheet-grab span { width: 38px; height: 5px; border-radius: 99px; background: var(--line2); }
.sheet-body { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.sheet-body > .pad { padding-top: 4px; padding-bottom: 22px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 4px 14px 10px; flex: none; }
.sheet-head h3 { flex: 1; margin: 0; text-align: center; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-side { width: 36px; flex: none; }
.ks-head .seg { flex: 1; }
.type-seg.t-expense button.on { color: var(--exp); } .type-seg.t-income button.on { color: var(--inc); } .type-seg.t-transfer button.on { color: var(--tr); } .type-seg.t-debt button.on { color: var(--debt); }
.ks-sheet .sheet { height: min(100dvh - var(--sat) - 10px, 860px); }
.ks { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ks-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 0 16px 10px; overscroll-behavior: contain; }
.ks-pad { flex: none; padding: 8px 12px 10px; background: var(--bg2); border-top: 1px solid var(--line); }
.keypad { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.key { height: 50px; border-radius: 14px; background: var(--card); font-family: var(--font-num); font-size: 23px; font-weight: 600; box-shadow: 0 1px 0 rgba(0,0,0,.05); transition: transform .08s, background .1s; display: grid; place-items: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.key:active { transform: scale(.94); background: var(--card2); }
.key.op { background: transparent; box-shadow: none; color: var(--gold); font-size: 25px; }
.key.fn svg { width: 26px; height: 26px; }
.save-btn { width: 100%; height: 54px; margin-top: 8px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 700; font-size: 17px; transition: transform .1s; touch-action: manipulation; background: var(--text); }
.save-btn svg { width: 22px; height: 22px; stroke-width: 2.4; }
.save-btn:active { transform: scale(.98); }
.save-btn.t-expense { background: linear-gradient(135deg,#FF7A7A,#E5484D); }
.save-btn.t-income { background: linear-gradient(135deg,#2FD08A,#0E9F63); }
.save-btn.t-transfer { background: linear-gradient(135deg,#7AA2FF,#3B6FE0); }
.save-btn.t-debt { background: linear-gradient(135deg,#F7B84B,#D98B00); }
.save-btn.t-adj { background: var(--text); color: var(--bg); }
.amount-box { text-align: center; padding: 4px 16px 8px; flex: none; }
.amt-expr { color: var(--muted); font-size: 14px; font-family: var(--font-num); min-height: 20px; }
.amt-val { display: flex; justify-content: center; align-items: baseline; gap: 4px; font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
.amt-sign { font-size: 30px; opacity: .8; }
.amt-num { font-size: 50px; letter-spacing: -1.6px; line-height: 1.1; max-width: 76vw; overflow: hidden; text-overflow: ellipsis; }
.amt-num.ph { opacity: .3; }
.amt-sym { font-size: 22px; color: var(--muted); margin-left: 4px; }
.amount-box.t-expense .amt-val { color: var(--exp); } .amount-box.t-income .amt-val { color: var(--inc); } .amount-box.t-debt .amt-val { color: var(--debt); }
.adj-diff { font-weight: 600; font-size: 14px; margin-top: 4px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 12px 2px 8px; }
.rail { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; scroll-padding: 0 16px; }
.wchip { flex: none; display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 7px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); text-align: left; border: 2px solid transparent; transition: border-color .15s; }
.wchip b { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.wchip small { color: var(--muted); font-size: 12px; font-family: var(--font-num); white-space: nowrap; }
.wchip.on { border-color: var(--c); }
.cat-rail { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 80px; gap: 6px 4px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px; border-radius: 16px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15; transition: background .15s; }
.cat span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 26px; }
.cat .ctile { width: 48px; height: 48px; border-radius: 16px; font-size: 23px; transition: transform .15s, box-shadow .15s; }
.cat.on { color: var(--text); background: var(--card); box-shadow: var(--shadow); }
.cat.on .ctile { box-shadow: 0 0 0 2.5px var(--c); transform: scale(1.04); }
.meta-row { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 16px; }
.note-in { width: 100%; height: 46px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow); padding: 0 14px; font-size: 16px; outline: none; }
.text-in[data-s="person"] { background: var(--card); border: 0; box-shadow: var(--shadow); }
.inline-field { display: flex; align-items: center; gap: 8px; margin-top: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); font-size: 14px; }
.inline-field input { flex: 1; border: 0; background: none; text-align: right; font-size: 16px; color: var(--text); outline: none; min-width: 0; }
.tr-field { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 8px; padding: 9px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color .15s; gap: 10px; }
.tr-field.on { border-color: var(--gold); }
.tr-field .lbl { font-size: 13px; color: var(--muted); font-weight: 600; text-align: left; }
.tr-field .val { font-family: var(--font-num); font-size: 23px; font-weight: 700; letter-spacing: -.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-field.rate .val { font-size: 18px; letter-spacing: 0; }
.tr-swap { display: flex; justify-content: center; margin: 10px 0 -4px; }
.tr-swap .icon-btn { transform: rotate(90deg); }
.rate-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 8px 4px 0; }
.check { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); padding: 10px 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
@media (max-height: 700px) {
  .key { height: 44px; font-size: 21px; } .save-btn { height: 48px; margin-top: 6px; } .amt-num { font-size: 42px; }
  .cat .ctile { width: 42px; height: 42px; } .field-label { margin-top: 8px; }
}
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 28px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .32s cubic-bezier(.2,.9,.2,1), opacity .25s; padding-bottom: 0; max-height: min(880px, 100dvh - 48px); }
  .sheet-wrap.open .sheet { opacity: 1; }
  .ks-sheet .sheet { height: min(820px, 100dvh - 48px); }
  .ks-pad { border-radius: 0 0 28px 28px; }
  .sheet-grab { visibility: hidden; height: 10px; padding: 0; }
}
/* Диалог */
.dialog .sheet { max-width: 380px; border-radius: 26px; margin: 0 14px calc(var(--sab) + 14px); }
.dialog .sheet-grab { display: none; }
.dlg { padding: 24px 20px 18px; text-align: center; }
.dlg-ic { width: 52px; height: 52px; border-radius: 17px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--card2); color: var(--gold); }
.dlg-ic.danger { background: var(--exp-bg); color: var(--exp); }
.dlg h3 { margin: 0 0 6px; font-size: 18px; } .dlg p { margin: 0; color: var(--muted); font-size: 14.5px; }
.dlg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

/* ——— Тосты ——— */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--sab) + 90px); display: flex; justify-content: center; z-index: 300; pointer-events: none; padding: 0 14px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; padding: 12px 12px 12px 18px; border-radius: 18px; background: #1C1F26; color: #F2EFE8; box-shadow: 0 16px 40px rgba(0,0,0,.35); font-size: 14px; font-weight: 550;
  transform: translateY(20px) scale(.96); opacity: 0; transition: transform .35s cubic-bezier(.2,.9,.2,1.2), opacity .25s; }
:root[data-theme="dark"] .toast { background: #2A2E37; }
.toast.show { transform: none; opacity: 1; }
.toast.warn { background: #4A2A12; }
.toast-msg { flex: 1; }
.toast-act { color: #F3DDA6; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.08); white-space: nowrap; }
@media (min-width: 900px) { #toast-root { bottom: 28px; padding-left: 250px; } }

/* ——— Онбординг ——— */
.onb { min-height: 100dvh; display: flex; justify-content: center; padding: calc(var(--sat) + 30px) 18px calc(var(--sab) + 30px);
  background: radial-gradient(80% 50% at 50% 0%, rgba(214,174,98,.22), transparent 70%), var(--bg); }
.onb-in { width: 100%; max-width: 460px; text-align: center; }
.onb-logo { display: grid; place-items: center; margin: 10px 0 14px; }
.mono.float { animation: float 5s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(156,116,50,.35)); }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.onb h1 { font-size: 34px; letter-spacing: -1px; margin: 0; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root:not([data-theme="dark"]) .onb h1 { background: linear-gradient(135deg,#7A5820,#B88A3A); -webkit-background-clip: text; background-clip: text; }
.onb-sub { color: var(--muted); margin: 8px 0 22px; line-height: 1.5; }
.onb-card { text-align: left; margin-bottom: 14px; }
.onb-card h3 { margin: 0; }
.onb-w { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.onb-w .money-in { width: 150px; }
.onb-card .fl { margin-top: 12px; }

/* ——— Блокировка ——— */
.lock { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: grid; place-items: center; transition: opacity .3s; }
.lock.out { opacity: 0; }
.lock-in { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin { display: flex; flex-direction: column; align-items: center; padding: 10px 20px 24px; }
.pin h3 { margin: 6px 0 0; font-size: 20px; }
.pin-dots { display: flex; gap: 16px; margin: 16px 0 26px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line2); transition: background .15s, border-color .15s; }
.pin-dots span.on { background: var(--gold); border-color: var(--gold); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px 22px; }
.pin-keys button { width: 74px; height: 74px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-family: var(--font-num); font-size: 28px; font-weight: 600; display: grid; place-items: center; touch-action: manipulation; }
.pin-keys button:active { background: var(--card2); transform: scale(.95); }
.pin .link { margin-top: 18px; }

/* ——— Анимации ——— */
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
#splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #0A0B0E; transition: opacity .45s; }
#splash.out { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (hover: hover) { .wcard:hover, .chip:hover { filter: brightness(1.03); } .key:hover { background: var(--card2); } }
