/* Главный экран и нижнее меню — по макету Figma (Главная, 63:1915). Остальные экраны пока без оформления. */
:root {
  color-scheme: dark;
  --bg: #1c1c1e;
  --card: #2c2c2e;
  --ink: #f5f8f5;
  --muted: #9a9c9a;
  --lilac: #2c2c2e;
  --soft: #3a3a3c;
  --purple: #0c75ff;
  --deep: #d4d8d4;
  --green: #34c38f;
  --red: #ff6b6b;
  --line: #3a3a3c;
  --on-accent: #f5f8f5;
  --font-text: 'Stapel', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Magistral', 'Stapel', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font-text); font-size: 14px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
p, h1, h2 { margin: 0; }
img { display: block; }
#app { max-width: 520px; margin: 0 auto; }

/* Верхний блок на всю ширину: шапка, баланс и быстрые действия лежат на лавандовой подложке */
.top-block { background: var(--lilac); border-radius: 0 0 32px 32px; padding: calc(env(safe-area-inset-top) + 8px) 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.top-block .tile.t-soft { background: var(--bg); }

/* Шапка */
.hdr { display: flex; align-items: center; gap: 12px; height: 64px; }
.avatar { width: 42px; height: 42px; border-radius: 0; background: var(--card) center / cover no-repeat; color: var(--deep); display: grid; place-items: center; font-size: 15px; flex: none; overflow: hidden; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpolygon%20points%3D%22100.00%2C50.00%2099.97%2C65.36%2099.89%2C70.26%2099.75%2C73.81%2099.56%2C76.68%2099.31%2C79.12%2099.01%2C81.26%2098.64%2C83.17%2098.22%2C84.89%2097.74%2C86.46%2097.20%2C87.89%2096.60%2C89.21%2095.94%2C90.43%2095.20%2C91.54%2094.40%2C92.58%2093.53%2C93.53%2092.58%2C94.40%2091.54%2C95.20%2090.43%2C95.94%2089.21%2C96.60%2087.89%2C97.20%2086.46%2C97.74%2084.89%2C98.22%2083.17%2C98.64%2081.26%2C99.01%2079.12%2C99.31%2076.68%2C99.56%2073.81%2C99.75%2070.26%2C99.89%2065.36%2C99.97%2050.00%2C100.00%2034.64%2C99.97%2029.74%2C99.89%2026.19%2C99.75%2023.32%2C99.56%2020.88%2C99.31%2018.74%2C99.01%2016.83%2C98.64%2015.11%2C98.22%2013.54%2C97.74%2012.11%2C97.20%2010.79%2C96.60%209.57%2C95.94%208.46%2C95.20%207.42%2C94.40%206.47%2C93.53%205.60%2C92.58%204.80%2C91.54%204.06%2C90.43%203.40%2C89.21%202.80%2C87.89%202.26%2C86.46%201.78%2C84.89%201.36%2C83.17%200.99%2C81.26%200.69%2C79.12%200.44%2C76.68%200.25%2C73.81%200.11%2C70.26%200.03%2C65.36%200.00%2C50.00%200.03%2C34.64%200.11%2C29.74%200.25%2C26.19%200.44%2C23.32%200.69%2C20.88%200.99%2C18.74%201.36%2C16.83%201.78%2C15.11%202.26%2C13.54%202.80%2C12.11%203.40%2C10.79%204.06%2C9.57%204.80%2C8.46%205.60%2C7.42%206.47%2C6.47%207.42%2C5.60%208.46%2C4.80%209.57%2C4.06%2010.79%2C3.40%2012.11%2C2.80%2013.54%2C2.26%2015.11%2C1.78%2016.83%2C1.36%2018.74%2C0.99%2020.88%2C0.69%2023.32%2C0.44%2026.19%2C0.25%2029.74%2C0.11%2034.64%2C0.03%2050.00%2C0.00%2065.36%2C0.03%2070.26%2C0.11%2073.81%2C0.25%2076.68%2C0.44%2079.12%2C0.69%2081.26%2C0.99%2083.17%2C1.36%2084.89%2C1.78%2086.46%2C2.26%2087.89%2C2.80%2089.21%2C3.40%2090.43%2C4.06%2091.54%2C4.80%2092.58%2C5.60%2093.53%2C6.47%2094.40%2C7.42%2095.20%2C8.46%2095.94%2C9.57%2096.60%2C10.79%2097.20%2C12.11%2097.74%2C13.54%2098.22%2C15.11%2098.64%2C16.83%2099.01%2C18.74%2099.31%2C20.88%2099.56%2C23.32%2099.75%2C26.19%2099.89%2C29.74%2099.97%2C34.64%22%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpolygon%20points%3D%22100.00%2C50.00%2099.97%2C65.36%2099.89%2C70.26%2099.75%2C73.81%2099.56%2C76.68%2099.31%2C79.12%2099.01%2C81.26%2098.64%2C83.17%2098.22%2C84.89%2097.74%2C86.46%2097.20%2C87.89%2096.60%2C89.21%2095.94%2C90.43%2095.20%2C91.54%2094.40%2C92.58%2093.53%2C93.53%2092.58%2C94.40%2091.54%2C95.20%2090.43%2C95.94%2089.21%2C96.60%2087.89%2C97.20%2086.46%2C97.74%2084.89%2C98.22%2083.17%2C98.64%2081.26%2C99.01%2079.12%2C99.31%2076.68%2C99.56%2073.81%2C99.75%2070.26%2C99.89%2065.36%2C99.97%2050.00%2C100.00%2034.64%2C99.97%2029.74%2C99.89%2026.19%2C99.75%2023.32%2C99.56%2020.88%2C99.31%2018.74%2C99.01%2016.83%2C98.64%2015.11%2C98.22%2013.54%2C97.74%2012.11%2C97.20%2010.79%2C96.60%209.57%2C95.94%208.46%2C95.20%207.42%2C94.40%206.47%2C93.53%205.60%2C92.58%204.80%2C91.54%204.06%2C90.43%203.40%2C89.21%202.80%2C87.89%202.26%2C86.46%201.78%2C84.89%201.36%2C83.17%200.99%2C81.26%200.69%2C79.12%200.44%2C76.68%200.25%2C73.81%200.11%2C70.26%200.03%2C65.36%200.00%2C50.00%200.03%2C34.64%200.11%2C29.74%200.25%2C26.19%200.44%2C23.32%200.69%2C20.88%200.99%2C18.74%201.36%2C16.83%201.78%2C15.11%202.26%2C13.54%202.80%2C12.11%203.40%2C10.79%204.06%2C9.57%204.80%2C8.46%205.60%2C7.42%206.47%2C6.47%207.42%2C5.60%208.46%2C4.80%209.57%2C4.06%2010.79%2C3.40%2012.11%2C2.80%2013.54%2C2.26%2015.11%2C1.78%2016.83%2C1.36%2018.74%2C0.99%2020.88%2C0.69%2023.32%2C0.44%2026.19%2C0.25%2029.74%2C0.11%2034.64%2C0.03%2050.00%2C0.00%2065.36%2C0.03%2070.26%2C0.11%2073.81%2C0.25%2076.68%2C0.44%2079.12%2C0.69%2081.26%2C0.99%2083.17%2C1.36%2084.89%2C1.78%2086.46%2C2.26%2087.89%2C2.80%2089.21%2C3.40%2090.43%2C4.06%2091.54%2C4.80%2092.58%2C5.60%2093.53%2C6.47%2094.40%2C7.42%2095.20%2C8.46%2095.94%2C9.57%2096.60%2C10.79%2097.20%2C12.11%2097.74%2C13.54%2098.22%2C15.11%2098.64%2C16.83%2099.01%2C18.74%2099.31%2C20.88%2099.56%2C23.32%2099.75%2C26.19%2099.89%2C29.74%2099.97%2C34.64%22%2F%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat; }
.avatar.photo { color: transparent; }
.greet { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.greet small { font-size: 11px; line-height: 1.4; color: var(--muted); }
.greet b { font-weight: 400; font-size: 25px; line-height: normal; }
.round { width: 42px; height: 42px; border-radius: 100px; background: var(--card); display: grid; place-items: center; flex: none; }

/* Содержание */
.home { display: flex; flex-direction: column; gap: 20px; padding: 20px 22px 24px; }
.panel { background: var(--card); border-radius: 24px; padding: 16px; }
.balance { padding: 6px 0 4px; display: flex; flex-direction: column; gap: 7px; }
.balance .top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; line-height: 1.4; color: var(--deep); }
.balance .top button { display: grid; place-items: center; }
.balance .sum { font-size: 35px; font-weight: 600; line-height: normal; }
.balance .note { font-size: 11px; line-height: 1.4; color: var(--deep); }

.quick { display: flex; gap: 8px; }
.quick button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12px; font-weight: 500; line-height: 1.4; }
.tile { border-radius: 100px; display: grid; place-items: center; flex: none; }
.quick .tile { width: 52px; height: 52px; }
.t-soft { background: var(--soft); } .t-green { background: rgba(52,195,143,.16); } .t-blue { background: rgba(12,117,255,.18); } .t-orange { background: rgba(240,169,90,.16); }

.head { display: flex; align-items: center; justify-content: space-between; line-height: 1.4; }
.head h2 { font-size: 18px; font-weight: 400; }
.head button { font-size: 13px; font-weight: 500; color: var(--purple); }
.sect { display: flex; flex-direction: column; gap: 10px; }

.acc { display: flex; align-items: center; gap: 12px; width: 100%; }
.acc + hr { border: 0; border-top: 1px solid var(--line); margin: 13px 0; }
.panel .acc:not(:first-child) { margin-top: 0; }
.thumb { width: 52px; height: 36px; border-radius: 8px; background: var(--lilac); color: var(--deep); font-size: 10px; font-weight: 700; line-height: 1.4; display: grid; place-items: center; flex: none; }
.ico44 { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.acc .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc .txt small { font-size: 11px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .txt b { font-size: 19px; font-weight: 600; line-height: 1.4; white-space: nowrap; }

.acc .txt b.name { font-size: 16px; font-weight: 500; }
.acc .amt { font-size: 15px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.spend { display: flex; flex-direction: column; gap: 9px; }
.spend .row1 { display: flex; justify-content: space-between; align-items: flex-start; line-height: 1.4; }
.spend .row1 b { font-size: 13px; font-weight: 500; }
.spend .row1 span { font-size: 14px; }
.segs { display: flex; gap: 4px; height: 7px; }
.segs i { display: block; height: 7px; border-radius: 4px; min-width: 6px; }
.spend small { font-size: 11px; line-height: 1.4; color: var(--muted); }

.ops { display: flex; flex-direction: column; gap: 5px; }
.op { display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%; }
.op .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.op .txt span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op .txt small { font-size: 11px; color: var(--muted); }
.op .amt { font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.op .amt.pos { color: var(--green); }
.empty { color: var(--muted); font-size: 13px; line-height: 1.4; padding: 6px 0; }
.extra { display: flex; flex-direction: column; gap: 10px; }
.extra .line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.4; }
.extra .line b { font-weight: 500; }
.extra .line small { display: block; font-size: 11px; color: var(--muted); }
.extra .bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.extra .bar i { display: block; height: 100%; background: var(--purple); border-radius: 3px; }
.extra .bar i.over { background: var(--red); }

/* Нижнее меню */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 520px; margin: 0 auto; background: var(--card); border-top: 1px solid var(--line); display: flex; gap: 3px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
.nav button { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 10px; line-height: 1.4; color: var(--muted); }
.nav .pill { width: 52px; height: 30px; border-radius: 100px; display: grid; place-items: center; }
.nav .ico { width: 21px; height: 21px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.nav button.on { color: var(--purple); font-weight: 600; }
.nav button.on .pill { background: var(--soft); }

/* Окно выбора и подсказки (рабочий минимум) */
#backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 19; opacity: 0; transition: opacity .32s ease; }
#backdrop.open { opacity: 1; }
#sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 520px; margin: 0 auto; max-height: 86vh; overflow: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 22px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .32s cubic-bezier(.22, .9, .3, 1); will-change: transform; }
#sheet.open { transform: translateY(0); }
#toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #3a3a3c; color: var(--ink); box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(245, 248, 245, .08); padding: 11px 18px; border-radius: 14px; font-size: 13px; z-index: 30; max-width: 86%; text-align: center; }

/* Шторка подписки */
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 18px; }
.sh-top { display: flex; align-items: center; gap: 12px; }
.sh-name { display: flex; flex-direction: column; gap: 1px; }
.sh-name small { font-size: 11px; color: var(--muted); }
.sh-name b { font-size: 18px; font-weight: 500; }
.sh-sum { font-size: 35px; font-weight: 600; line-height: 1.2; margin: 18px 0 14px; }
.sh-info { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sh-info span { color: var(--muted); }
.sh-info b { font-weight: 500; }
.sh-title { font-size: 20px; font-weight: 500; margin-bottom: 16px; }
.sh-field { display: block; background: var(--bg); border-radius: 16px; padding: 12px 16px; }
.sh-field small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sh-field input { width: 100%; border: 0; background: none; font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); outline: none; padding: 0; }
.sh-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.sh-btns button { min-height: 50px; border-radius: 16px; font-size: 15px; font-weight: 500; text-align: center; }
.b-main { background: var(--purple); color: var(--on-accent); }
.b-soft { background: var(--soft); color: var(--purple); }

/* Счета и карты (Figma 63:1812) */
.title-row { display: flex; align-items: center; gap: 12px; height: 64px; padding: calc(env(safe-area-inset-top) + 0px) 22px 0; }
.title-row h1 { flex: 1; font-size: 24px; font-weight: 400; line-height: normal; }
.round40 { width: 40px; height: 40px; border-radius: 100px; background: var(--card); display: grid; place-items: center; flex: none; }
.acc-page { display: flex; flex-direction: column; gap: 20px; padding: 12px 22px 24px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.flt { padding: 9px 13px; border-radius: 100px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.flt.on { background: var(--purple); color: var(--on-accent); }
.total { display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.total small { font-size: 13px; color: var(--muted); }
.total b { font-size: 29px; font-weight: 600; }
.sect10 { display: flex; flex-direction: column; gap: 10px; }
.sect12 { display: flex; flex-direction: column; gap: 12px; }
.sect12 h2 { font-size: 18px; font-weight: 400; line-height: 1.4; }
.card-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 194px; padding: 22px; border-radius: 24px; background: var(--lilac); color: var(--deep); overflow: hidden; text-align: left; }
.card-art.cash { background: #1f3a30; color: #7be0b8; }
.card-art.credit_card { background: #3a2d1f; color: #f0b97a; }
.card-art .orbit { position: absolute; max-width: none; pointer-events: none; }
.card-art .o1 { left: 205px; top: -68px; width: 260px; height: 260px; }
.card-art .o2 { left: 240px; top: -33px; width: 190px; height: 190px; }
.ca-top { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; line-height: 1.4; }
.ca-top b { font-size: 22px; font-weight: 700; }
.ca-top span { font-size: 11px; font-weight: 500; }
.ca-data { position: relative; display: flex; flex-direction: column; gap: 7px; width: 100%; }
.ca-sum { font-size: 29px; font-weight: 600; line-height: 1.4; color: var(--ink); white-space: nowrap; }
.ca-bottom { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.ca-bottom span { font-size: 14px; font-weight: 500; line-height: 1.4; white-space: pre; }
.ca-bottom b { font-size: 21px; font-weight: 800; }
.ca-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.ca-status .ok { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.ca-status .ok i { width: 6px; height: 6px; border-radius: 3px; background: var(--green); display: block; }
.panel18 { display: flex; flex-direction: column; gap: 18px; background: var(--card); border-radius: 24px; padding: 18px; }
.grow { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }
.grow + .grow { border-top: 1px solid var(--line); padding-top: 18px; }
.g-top { display: flex; align-items: center; gap: 12px; }
.g-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.g-name b { font-size: 15px; font-weight: 600; }
.g-name small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-mid b { font-size: 25px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.rate { padding: 5px 9px; border-radius: 100px; background: rgba(52,195,143,.16); color: var(--green); font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.rate.blue { background: rgba(12,117,255,.18); color: #6aa5ff; }
.g-bot { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4; color: var(--muted); }
.g-bot b { font-weight: 600; color: var(--green); }
.add-acc { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 54px; border-radius: 16px; background: var(--soft); color: var(--purple); font-size: 15px; font-weight: 600; text-align: center; }
.info { display: flex; align-items: flex-start; gap: 8px; }
.info img { flex: none; }
.info p { flex: 1; font-size: 11px; line-height: 1.4; color: var(--muted); }
.a-empty { font-size: 13px; line-height: 1.4; color: var(--muted); }
.sh-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border-top: 1px solid var(--line); }
.sh-row:first-of-type { border-top: 0; }
.sh-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sh-txt b { font-size: 15px; font-weight: 500; }
.sh-txt small { font-size: 11px; color: var(--muted); }
.g-bot b.dark { color: var(--ink); }

/* Вкладка «Платежи»: сканер QR */
.scan-page { display: flex; flex-direction: column; gap: 16px; padding: 12px 22px 24px; }
.cam-stage { position: relative; height: min(58vh, 460px); min-height: 320px; border-radius: 28px; overflow: hidden; background: #0f0f10; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 50%; top: 46%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.cam-frame .c { position: absolute; width: 34px; height: 34px; border: 0 solid var(--on-accent); }
.cam-frame .tl { left: 0; top: 0; border-width: 3px 0 0 3px; border-top-left-radius: 16px; }
.cam-frame .tr { right: 0; top: 0; border-width: 3px 3px 0 0; border-top-right-radius: 16px; }
.cam-frame .bl { left: 0; bottom: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 16px; }
.cam-frame .br { right: 0; bottom: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 16px; }
.cam-frame .scanline { position: absolute; left: 8%; right: 8%; height: 2px; border-radius: 1px; background: linear-gradient(90deg, transparent, #6aa5ff, transparent); animation: scan 2.2s ease-in-out infinite alternate; }
@keyframes scan { from { top: 8%; } to { top: 92%; } }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: var(--on-accent); font-size: 13px; line-height: 1.4; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); padding: 0 24px; }
.cam-stage.off { background: var(--lilac); }
.cam-off { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; text-align: center; color: var(--deep); }
.cam-off p { font-size: 14px; line-height: 1.45; }
.cam-off .b-soft { min-height: 48px; padding: 0 22px; border-radius: 16px; font-size: 15px; font-weight: 500; }
.cam-off .b-main { background: var(--purple); color: var(--on-accent); min-height: 48px; padding: 0 22px; border-radius: 16px; font-size: 15px; font-weight: 500; }
.round40.on { background: var(--lilac); }
.scan-actions { display: flex; flex-direction: column; gap: 10px; }
.sa { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--card); border-radius: 20px; text-align: left; }
.sa-ic { width: 44px; height: 44px; border-radius: 15px; background: var(--soft); display: grid; place-items: center; flex: none; }
.sa-t { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sa-t b { font-size: 15px; font-weight: 500; }
.sa-t small { font-size: 11px; color: var(--muted); }
.scan-note { font-size: 11px; line-height: 1.4; color: var(--muted); }

/* История операций (Figma 63:1314) */
.t-red { background: rgba(255,107,107,.16); }
.h-page { display: flex; flex-direction: column; gap: 20px; padding: 12px 22px 24px; }
.h-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 14px; background: var(--card); border-radius: 16px; }
.h-search img { flex: none; }
.h-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--ink); padding: 0; }
.h-search input::placeholder { color: var(--muted); }
.filters.tight { gap: 7px; }
.h-panel { display: flex; flex-direction: column; gap: 16px; background: var(--card); border-radius: 24px; padding: 18px; }
.h-period { display: flex; align-items: center; justify-content: space-between; }
.h-period b { font-size: 15px; font-weight: 600; line-height: 1.4; }
.h-period button { display: grid; place-items: center; }
.h-totals { display: flex; gap: 20px; }
.h-totals > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.h-totals small { font-size: 11px; line-height: 1.4; color: var(--muted); }
.h-totals b { font-size: 23px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.h-totals b.pos { color: var(--green); }
.h-totals .bar { display: block; height: 5px; border-radius: 3px; }
.h-totals .bar.out { background: var(--lilac); }
.h-totals .bar.in { background: #2a5a49; }
.h-list { display: flex; flex-direction: column; gap: 13px; }
.h-day { display: flex; flex-direction: column; gap: 4px; }
.h-day > p { font-size: 12px; line-height: 1.4; color: var(--muted); }
.h-op { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; text-align: left; }
.h-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.h-txt span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-amt { font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.h-amt.pos { color: var(--green); }
.round40.on { background: var(--lilac); }
.f-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 0; border-top: 1px solid var(--line); text-align: left; }
.f-row:first-of-type { border-top: 0; }
.f-l { flex: 1; font-size: 14px; color: var(--muted); }
.f-row b { font-size: 14px; font-weight: 500; max-width: 55%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-row.sel .sh-txt b { color: var(--purple); }

/* Переходы между экранами: прежний экран плавно гаснет, новый выезжает, блоки появляются по очереди */
@keyframes out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }
@keyframes in-left { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-right { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes in-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#app.out { animation: out .13s ease-in both; pointer-events: none; }
#app.in-left, #app.in-forward { animation: in-left .38s cubic-bezier(.22, .9, .3, 1) both; }
#app.in-right, #app.in-back { animation: in-right .38s cubic-bezier(.22, .9, .3, 1) both; }
#app.in-fade { animation: in-fade .34s cubic-bezier(.22, .9, .3, 1) both; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page, .ch-page) > * { animation: rise .46s cubic-bezier(.22, .9, .3, 1) both; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page) > :nth-child(2) { animation-delay: .04s; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page) > :nth-child(3) { animation-delay: .08s; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page) > :nth-child(4) { animation-delay: .12s; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page) > :nth-child(5) { animation-delay: .16s; }
#app[class*="in-"] :is(.hm-page, .acc-page, .ad-page, .sb-page, .h-page) > :nth-child(n+6) { animation-delay: .2s; }
/* Нажатия и нижнее меню */
button { transition: transform .14s ease, background-color .18s ease, opacity .18s ease; }
button:active { transform: scale(.97); }
.nav .pill { transition: background-color .22s ease; }
.nav button { transition: color .2s ease, transform .14s ease; }
@media (prefers-reduced-motion: reduce) {
  #app, #app * { animation: none !important; }
  button { transition: none; }
}
html, body { overflow-x: hidden; }

/* Помощь: чат с ИИ-помощником (Figma 63:1099) */
body.chat { padding-bottom: 0; }
.ch-page { min-height: 100dvh; display: flex; flex-direction: column; }
.ch-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 11px; height: 72px; padding: env(safe-area-inset-top) 22px 0; box-sizing: content-box; background: var(--bg); }
.ch-back { display: grid; place-items: center; flex: none; }
.ch-av { position: relative; width: 44px; height: 44px; border-radius: 100px; background: var(--lilac); color: var(--deep); display: grid; place-items: center; flex: none; }
.ch-av b { font-size: 16px; font-weight: 400; }
.ch-av .dot { position: absolute; left: 33px; top: 33px; }
.ch-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.ch-name b { font-size: 16px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-name small { font-size: 11px; color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-menu { display: grid; place-items: center; flex: none; width: 32px; height: 32px; }
.ch-strip { display: flex; align-items: center; gap: 8px; padding: 10px 22px; background: var(--soft); font-size: 11px; line-height: 1.4; color: var(--deep); }
.ch-log { flex: 1; display: flex; flex-direction: column; gap: 13px; padding: 18px 22px; }
.ch-log .day { text-align: center; font-size: 11px; line-height: 1.4; color: var(--muted); }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bub { max-width: 84%; padding: 15px; display: flex; flex-direction: column; gap: 7px; background: var(--card); border-radius: 18px 18px 18px 5px; }
.msg.me .bub { background: var(--lilac); border-radius: 18px 18px 5px 18px; }
.bub p { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.bub .meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 10px; line-height: 1.4; color: var(--muted); }
.msg.me .bub .meta { color: var(--deep); }
.bub.card { width: 310px; max-width: 100%; border-radius: 18px; gap: 12px; }
.cd-top { display: flex; align-items: center; gap: 10px; }
.cd-ic { width: 38px; height: 38px; border-radius: 100px; background: var(--soft); display: grid; place-items: center; flex: none; }
.cd-t { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.cd-t b { font-size: 13px; font-weight: 600; }
.cd-t small { font-size: 11px; color: var(--muted); }
.cd-btn { height: 38px; border-radius: 10px; background: var(--soft); color: var(--purple); font-size: 12px; font-weight: 600; text-align: center; }
.typing { display: flex; align-items: center; gap: 7px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.typing img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ch-comp { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 12px; padding: 12px 18px calc(10px + env(safe-area-inset-bottom)); background: var(--card); }
.ch-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.ch-chips::-webkit-scrollbar { display: none; }
.ch-chip { flex: none; padding: 9px 13px; border-radius: 100px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.ch-comp .row { display: flex; align-items: center; gap: 12px; }
.ch-comp .attach { display: grid; place-items: center; flex: none; }
.ch-comp .field { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0 16px; border-radius: 100px; background: var(--bg); }
.ch-comp .field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 13px; color: var(--ink); padding: 0; }
.ch-comp .field input::placeholder { color: var(--muted); }
.ch-comp .mic { display: grid; place-items: center; flex: none; }
.sendb { width: 40px; height: 40px; border-radius: 100px; background: var(--soft); display: grid; place-items: center; flex: none; transition: background .15s; }
.sendb.on { background: var(--purple); }
.sendb.on img { filter: brightness(0) invert(1); }

/* Попап подтверждения и новые шторки */
.pop-back { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s ease; }
.pop-back.open { opacity: 1; }
.pop { width: 100%; max-width: 340px; background: var(--card); border-radius: 24px; padding: 22px; transform: scale(.94); transition: transform .24s cubic-bezier(.22, .9, .3, 1); }
.pop-back.open .pop { transform: scale(1); }
.pop h3 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.35; }
.pop p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.pop-btns { display: flex; gap: 8px; margin-top: 20px; }
.pop-btns button { flex: 1; min-height: 48px; border-radius: 14px; font-size: 15px; font-weight: 500; text-align: center; }
.pop-cancel { background: var(--soft); color: var(--purple); }
.pop-ok { background: var(--purple); color: var(--on-accent); }
.pop-ok.danger { background: var(--red); }
.b-danger { background: rgba(255,107,107,.16); color: var(--red); }
.sh-sum.pos { color: var(--green); }
.sh-gap { height: 10px; }
.av-btn { display: grid; place-items: center; flex: none; }
#sheet .avatar { width: 48px; height: 48px; }
#sheet .avatar { background-color: var(--lilac); }

/* Шторки быстрого внесения */
.sh-sub { margin: -10px 0 14px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.sh-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-top: 1px solid var(--line); text-align: left; }
.sh-opt:first-of-type { border-top: 0; }
.sh-amount { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; font-size: 35px; font-weight: 600; line-height: 1.2; }
.sh-amount input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--ink); padding: 0; }
.sh-amount input::placeholder { color: #58585a; }
.sh-amount span { color: var(--muted); }
.sh-lab { margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; max-height: 128px; overflow-y: auto; }
.cc { padding: 9px 13px; border-radius: 100px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
.cc.on { background: var(--purple); color: var(--on-accent); }
.sh-field { display: block; background: var(--bg); border-radius: 16px; padding: 12px 16px; margin-top: 8px; text-align: left; }
.sh-field.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; width: 100%; }
.sh-field.pick small { width: 100%; }
.sh-field.pick b { flex: 1; font-size: 16px; font-weight: 500; }
.b-soft { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Подписки */
.sb-page { display: flex; flex-direction: column; gap: 16px; padding: 12px 22px 24px; }
.sb-card { display: flex; flex-direction: column; gap: 3px; padding: 20px; border-radius: 24px; background: var(--lilac); line-height: 1.4; }
.sb-card small { font-size: 12px; color: #b8bbb8; }
.sb-big { font-size: 35px; font-weight: 600; letter-spacing: -.5px; }
.sb-two { display: flex; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(245,248,245,.12); }
.sb-two > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-two b { font-size: 19px; font-weight: 600; }
.sb-h { margin: 6px 0 -4px; font-size: 18px; font-weight: 400; line-height: 1.4; }
.sb-list { display: flex; flex-direction: column; background: var(--card); border-radius: 24px; padding: 6px 16px; }
.sb-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; text-align: left; }
.sb-row + .sb-row { border-top: 1px solid var(--line); }
.sb-row.off { opacity: .6; }
.sb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sb-txt b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-txt small.soon { color: #f0a95a; font-weight: 500; }
.sb-txt small.bad { color: var(--red); font-weight: 500; }
.sb-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; line-height: 1.4; }
.sb-amt b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.sb-amt small { font-size: 11px; color: var(--muted); }
.sb-paid { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--card); }
.sb-paid span { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sb-paid b { font-size: 14px; font-weight: 500; }
.sb-paid small { font-size: 11px; color: var(--muted); }
.sb-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 22px; border-radius: 24px; background: var(--card); text-align: center; }
.sb-empty p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.sb-empty .b-main { align-self: stretch; margin-top: 6px; min-height: 50px; border-radius: 16px; font-size: 15px; font-weight: 500; text-align: center; }
.sh-year { margin: -6px 0 10px; font-size: 12px; color: var(--muted); }
.sh-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sh-links button { padding: 9px 13px; border-radius: 100px; background: var(--soft); color: var(--purple); font-size: 12px; font-weight: 500; line-height: 1.4; }
.sh-links button.dng { background: rgba(255,107,107,.16); color: var(--red); }

/* Карточка счёта */
.ad-page { display: flex; flex-direction: column; gap: 16px; padding: 12px 22px 24px; }
.ad-bal { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ad-bal > div { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.ad-bal small { font-size: 12px; color: var(--muted); }
.ad-bal b { font-size: 29px; font-weight: 600; white-space: nowrap; }
.ad-badge { padding: 6px 12px; border-radius: 100px; background: rgba(52,195,143,.16); color: var(--green); font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.ad-badge.warm { background: rgba(240,169,90,.16); color: #f0a95a; }
.ad-panel { display: flex; flex-direction: column; background: var(--card); border-radius: 24px; padding: 6px 18px; }
.ad-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; font-size: 14px; line-height: 1.4; }
.ad-row + .ad-row { border-top: 1px solid var(--line); }
.ad-row span { color: var(--muted); }
.ad-row b { font-weight: 500; text-align: right; }
.ad-limit { display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 24px; padding: 18px; }
.ad-lim-sum { display: flex; align-items: baseline; gap: 8px; }
.ad-lim-sum b { font-size: 25px; font-weight: 600; }
.ad-lim-sum span { font-size: 12px; color: var(--muted); }
.ad-track { height: 7px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.ad-track i { display: block; height: 100%; border-radius: 4px; background: var(--purple); }
.ad-track i.over { background: var(--red); }
.sec-line { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.sec-line .sb-h { margin: 0; }
.ad-ops { display: flex; flex-direction: column; background: var(--card); border-radius: 24px; padding: 4px 16px; }
.ad-ops .h-op + .h-op { border-top: 1px solid var(--line); }
.ad-archive { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 20px; background: var(--card); text-align: left; }
.ad-archive .sh-txt b { color: var(--red); }
.sh-row.dng .sh-txt b { color: var(--red); }

.card-art.deposit { background: #1f3a30; color: #7be0b8; }
.card-art.loan { background: rgba(12,117,255,.22); color: #8fbaff; }

/* Доход под суммой на главной и главная кнопка в чате */
.inc { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(245,248,245,.12); text-align: left; }
.inc .ir { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.inc small { font-size: 12px; line-height: 1.4; color: var(--deep); }
.inc b { font-size: 16px; font-weight: 600; white-space: nowrap; }
.ch-chip.main { background: var(--purple); color: var(--on-accent); box-shadow: none; }

/* Админка */
.tg { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 18px; background: var(--card); text-align: left; }
.tg + .tg { margin-top: 8px; }
.sb-row .tg { padding: 0; background: none; width: auto; margin: 0; }
.tg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.tg-t b { font-size: 14px; font-weight: 500; }
.tg-t small { font-size: 11px; color: var(--muted); }
/* Тумблер: синяя дорожка, светлый квадрат со скруглением */
.tg .sw { width: 48px; height: 28px; border-radius: 10px; background: #58585a; position: relative; flex: none; transition: background .15s; }
.tg .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 8px; background: var(--on-accent); transition: transform .15s; }
.tg.on .sw { background: var(--purple); }
.tg.on .sw::after { transform: translateX(20px); }
.tg.off { opacity: .5; }
#sheet .tg { background: var(--bg); }
.ad-pill { padding: 5px 10px; border-radius: 100px; background: rgba(52,195,143,.16); color: var(--green); font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.ad-pill.bad { background: rgba(255,107,107,.16); color: var(--red); }
.ad-pill.mute { background: var(--soft); color: var(--muted); }
.ad-stat { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.ad-stat b { font-size: 14px; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #58585a; flex: none; }
.dot.ok { background: var(--green); } .dot.warn { background: #e0a53a; } .dot.bad { background: var(--red); }
.sb-form { display: flex; flex-direction: column; gap: 8px; }
.sb-form .sh-field { background: var(--card); margin: 0; }
.sb-mid { font-size: 18px; font-weight: 500; }
.b-main.wide, .b-soft.wide { width: 100%; min-height: 50px; border-radius: 16px; font-size: 15px; font-weight: 500; text-align: center; }
.b-main.wide { background: var(--purple); color: var(--on-accent); }
.b-soft.wide { background: var(--soft); color: var(--purple); }
.sb-card.plain { background: var(--card); gap: 10px; }
.sb-card.plain .step { margin: 0; font-size: 13px; line-height: 1.45; }
.ad-prev { margin: 0 4px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.pd-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.pd-row input { width: 56px; height: 44px; border: 0; border-radius: 14px; background: var(--bg); text-align: center; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); outline: none; }
.pd-l { font-size: 13px; color: var(--muted); }
.pd-row .cat-chips { margin: 0; flex: 1; }
.pd-x { display: grid; place-items: center; width: 36px; height: 36px; }
.sh-links.col { flex-direction: column; align-items: stretch; }
.sh-links.col button { text-align: center; border-radius: 14px; padding: 12px; font-size: 13px; }
.sh-links-add { margin: 8px 0 0; padding: 10px 0; color: var(--purple); font-size: 13px; font-weight: 500; text-align: left; }
.ad-cat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; line-height: 1.4; }
.ad-cat b { font-size: 15px; font-weight: 500; }
.ad-cat small { font-size: 11px; color: var(--muted); }
.fd-list { display: flex; flex-direction: column; }
.fd-item { padding: 12px 0; border-top: 1px solid var(--line); }
.fd-item:first-child { border-top: 0; }
.fd-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fd-top b { font-size: 14px; font-weight: 500; }
.fd-top small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fd-item p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); white-space: pre-wrap; }
.fd-st { display: block; margin-top: 4px; font-size: 11px; color: var(--red); }

/* Админка: панели переключателей, строки категорий, цифры заработка */
.tg-list { display: flex; flex-direction: column; background: var(--card); border-radius: 24px; padding: 2px 18px; }
.tg-list .tg { background: none; border-radius: 0; padding: 14px 0; margin: 0; }
.tg-list .tg + .tg { border-top: 1px solid var(--line); }
.cat-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.cat-line + .cat-line { border-top: 1px solid var(--line); }
.cat-line.off .ad-cat b { color: var(--muted); }
.cat-line .tg { width: auto; padding: 0; background: none; margin: 0; flex: none; }
.ad-two { display: flex; gap: 20px; }
.ad-two > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.ad-two small { font-size: 12px; color: var(--muted); }
.ad-two b { font-size: 19px; font-weight: 600; white-space: nowrap; }
.ad-two b.pos { color: var(--green); }
.sb-card.plain .ad-two + .ad-two { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.ad-sum { font-size: 15px; font-weight: 600; white-space: nowrap; color: var(--green); }
.sb-page > .sb-form, .sb-page > .cat-chips, .sb-page > .tg-list { margin: 0; }

.md-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; margin-top: 8px; }
.ai-body { display: flex; flex-direction: column; gap: 16px; }

/* Тексты сообщений бота */
.sh-field textarea { width: 100%; border: 0; background: none; outline: none; resize: vertical; font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink); padding: 0; min-height: 120px; }
.tgm { display: flex; }
.tgm-b { max-width: 100%; padding: 12px 14px; border-radius: 16px 16px 16px 5px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 1.45; word-break: break-word; }
.ph-box { display: flex; flex-direction: column; gap: 10px; }
.ph-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; background: var(--soft); }
.ph-btns { display: flex; gap: 8px; }
.ph-btns button { flex: 1; min-height: 46px; border-radius: 14px; font-size: 14px; font-weight: 500; text-align: center; }
.ad-tags { display: flex; gap: 6px; align-items: center; }

/* Чат: шапка и поле ввода неподвижны, прокручивается только переписка */
body.chat { overflow: hidden; }
.ch-page { height: 100dvh; min-height: 0; overflow: hidden; }
.ch-head { position: relative; flex: none; }
.ch-strip { flex: none; }
.ch-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ch-comp { position: relative; flex: none; }

/* Установка на экран, фото помощника */
.ins-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.ins-steps p { margin: 0; font-size: 14px; line-height: 1.45; }
.ch-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 100px; }
.ch-av .dot { z-index: 2; }

/* Вход по коду */
#denied .code-in { display: block; width: 100%; max-width: 260px; margin: 12px auto 0; height: 52px; border: 0; border-radius: 16px; background: var(--card); text-align: center; font: inherit; font-size: 22px; letter-spacing: 6px; color: var(--ink); outline: none; }
#denied .code-btn { display: block; width: 100%; max-width: 260px; margin: 10px auto 0; height: 50px; border-radius: 16px; background: var(--purple); color: var(--on-accent); font-size: 15px; font-weight: 500; text-align: center; }
#denied h1 { font-size: 24px; font-weight: 500; margin-bottom: 6px; }
#denied { color: var(--ink); }
.code-big { text-align: center; font-size: 34px; letter-spacing: 8px; font-weight: 600; padding: 18px; }
#denied p { margin: 8px 22px 0; font-size: 13px; line-height: 1.45; color: var(--muted); } #denied .code-big { color: var(--ink); }

/* Зарплата */
.yr { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.yr button { width: 36px; height: 36px; border-radius: 12px; background: var(--card); font-size: 22px; line-height: 1; text-align: center; color: var(--ink); display: grid; place-items: center; padding-bottom: 2px; }
.yr b { display: grid; place-items: center; height: 36px; padding: 0 16px; border-radius: 12px; background: var(--purple); color: var(--on-accent); font-family: var(--font-head); font-size: 15px; font-weight: 500; }
.yr > span { width: 36px; height: 36px; }
.sal-year { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sal-year small { font-size: 12px; color: var(--muted); }
.sal-year b { font-size: 22px; font-weight: 600; }
.sal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sal-m { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--card); text-align: center; line-height: 1.3; }
.sal-m small { font-size: 11px; color: var(--muted); }
.sal-m b { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sal-m.zero b { color: var(--muted); font-weight: 400; }
.sal-m.on { background: var(--purple); }
.sal-m.on small, .sal-m.on b { color: var(--on-accent); }
.sal-info { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 20px; background: var(--card); text-align: left; }
.sb-two b.warn { color: #f0a95a; }
.sb-card .sb-two + .sb-two { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(245,248,245,.12); }

.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-pair .add-acc { font-size: 14px; padding: 0 8px; }

/* Проверка чека */
.btn-pair button { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 16px; font-size: 15px; font-weight: 600; text-align: center; line-height: 1.2; }
.btn-pair .b-main:disabled { opacity: .6; }
.rc-items { display: flex; flex-direction: column; background: var(--card); border-radius: 24px; padding: 6px 18px; }
.rc-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 0; font-size: 14px; line-height: 1.4; }
.rc-item + .rc-item { border-top: 1px solid var(--line); }
.rc-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-item b { font-weight: 600; white-space: nowrap; }
.rc-fields { display: flex; flex-direction: column; gap: 10px; }
.rc-fields .sh-field { background: var(--card); margin-top: 0; border-radius: 18px; }

/* Шрифты: заголовки, цифры и кнопки действий — Magistral, остальной текст — Stapel */
.title-row h1, #denied h1, h1, h2, h3, .head h2, .sb-h, .sect12 h2, .pop h3, .sh-title, .greet b, .sh-name b,
.b-main, .b-soft, .b-danger, .add-acc, .code-btn, .pop-btns button, .sh-btns button, .btn-pair button,
.balance .sum, .acc .amt, .acc .txt b, .op .amt, .h-amt, .h-totals b, .sb-big, .sb-mid, .sb-two b, .sb-amt b, .sb-card b, .ad-bal b, .ad-sum, .ad-lim-sum b, .ad-two b, .ca-sum, .ca-bottom b, .ca-top b, .g-mid b, .total b, .sh-amount, .sh-sum, .sal-year b, .code-big, .rc-item b, .ad-row b { font-family: var(--font-head); }
.code-in, input, textarea { font-family: var(--font-text); }
/* Крупные суммы и цифры — Medium, а не Bold */
.balance .sum, .sb-big, .sh-amount, .sh-sum, .ca-sum, .ad-bal b, .total b, .code-big { font-weight: 500; }

/* Тёмная палитра: подложки на плашках цвета --card должны отличаться от неё */
.thumb { background: var(--soft); color: var(--deep); }
.top-block .round, .top-block .avatar, .round40, .ch-back + .round40 { background: var(--soft); }
.top-block .avatar, .avatar { color: var(--ink); }
.panel .round40, .round40 { background: var(--card); }
.top-block .round40 { background: var(--soft); }
.card-art .orbit, .acc-art .orbit { opacity: .12; mix-blend-mode: screen; }

/* ───── Главный экран ───── */
.hm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 22px 0; height: 60px; }
.hm-top .av-btn { flex: none; }
.hm-search { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 16px; background: var(--card); color: var(--muted); font-size: 14px; }
.hm-round { width: 44px; height: 44px; border-radius: 16px; background: var(--card); display: grid; place-items: center; flex: none; }
.hm-page { display: flex; flex-direction: column; gap: 14px; padding: 18px 0 28px; }
.hm-h { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.hm-h.in { padding: 0; }
.hm-title { display: flex; align-items: center; gap: 6px; }
.hm-title h2, .hm-panel h2, .hm-h h2 { font-size: 26px; font-weight: 400; line-height: 1.2; margin: 0; }
.hm-panel h2, .hm-h.in h2 { font-size: 22px; }
.hm-h-r { display: flex; gap: 18px; }
.hm-h-r button { display: grid; place-items: center; }
.hm-link { font-size: 15px; font-weight: 500; color: var(--purple); }
.hm-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 22px; scroll-snap-type: x proximity; scroll-padding-left: 22px; scrollbar-width: none; }
.hm-scroll::-webkit-scrollbar { display: none; }
.hm-scroll.in { padding: 0; }
.hm-scroll > * { scroll-snap-align: start; flex: none; }
.hm-qcol { width: 76px; display: flex; flex-direction: column; gap: 10px; }
.hm-qcol button { flex: 1; border-radius: 22px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 500; text-align: center; }
.hm-card { position: relative; overflow: hidden; width: 164px; min-height: 214px; border-radius: 22px; background: var(--card); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; text-align: left; }
.hm-card.main { background: var(--purple); color: var(--on-accent); --pat: rgba(255, 255, 255, .24); }
.hm-card.main small { color: rgba(245, 248, 245, .78); }
.hm-card.add { --pat: transparent; align-items: center; justify-content: center; background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.hm-card .thumb { align-self: flex-start; }
.hm-card .ico44 { align-self: flex-start; }
.hm-card-b { display: flex; flex-direction: column; gap: 4px; }
.hm-card-b b { font-size: 20px; font-weight: 500; line-height: 1.2; }
.hm-card.main .hm-card-b b { font-size: 20px; }
.hm-card small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.thumb.warm { background: rgba(240, 169, 90, .16); color: #f0a95a; }
.thumb.cool { background: rgba(12, 117, 255, .18); color: #6aa5ff; }
.hm-banner { position: relative; margin: 0 22px; padding: 16px 44px 16px 18px; border-radius: 22px; background: var(--card); display: flex; align-items: center; gap: 12px; }
.hm-banner-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-banner-t small { font-size: 12px; color: var(--muted); }
.hm-banner-t b { font-size: 16px; font-weight: 500; }
.hm-banner-t span { font-size: 13px; color: var(--muted); }
.hm-cta { height: 40px; padding: 0 18px; border-radius: 14px; background: var(--purple); color: var(--on-accent); font-size: 14px; font-weight: 500; flex: none; }
.hm-x { position: absolute; top: 6px; right: 10px; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px; }
.hm-panel { margin: 0 14px; padding: 18px 16px; border-radius: 26px; background: var(--card); display: flex; flex-direction: column; gap: 14px; }
.hm-note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.hm-listrow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); font-size: 15px; width: 100%; }
.hm-field { display: flex; gap: 10px; }
.hm-input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border-radius: 16px; background: var(--soft); color: var(--muted); font-size: 15px; display: flex; align-items: center; }
.hm-go { width: 60px; height: 52px; border-radius: 16px; background: var(--purple); display: grid; place-items: center; flex: none; }
.hm-go img { filter: brightness(0) invert(1); }
.hm-tile { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12px; line-height: 1.25; }
.hm-ico { width: 72px; height: 72px; border-radius: 22px; background: var(--soft); display: grid; place-items: center; }
.hm-stat { width: 152px; min-height: 150px; border-radius: 20px; background: var(--soft); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; text-align: left; }
.hm-stat .hm-ico, .hm-stat .ico44 { margin-bottom: auto; width: 44px; height: 44px; border-radius: 15px; background: var(--card); }
.hm-stat .hm-ico { background: var(--card); }
.hm-stat .ico44 { background: var(--card); }
.hm-stat b { font-size: 20px; font-weight: 500; }
.hm-stat small { font-size: 13px; color: var(--muted); line-height: 1.3; }
.hm-stat small.dim { font-size: 12px; opacity: .8; }
.hm-ops { display: flex; flex-direction: column; }
.hm-op { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; text-align: left; }
.hm-op + .hm-op { border-top: 1px solid var(--line); }
.hm-op .ico44 { background: var(--soft); border-radius: 50%; }
.hm-op-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-op-t span { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-op-t small { font-size: 12px; color: var(--muted); }
.hm-op-a { font-size: 16px; font-weight: 500; white-space: nowrap; }
.hm-op-a.pos { color: var(--green); }
.hm-pill { align-self: center; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 18px; background: var(--card); font-size: 14px; font-weight: 500; color: var(--purple); }
.hm-card .ico44, .hm-card .thumb { background-clip: padding-box; }
.hm-card .ico44 { background: var(--soft); }
.hm-card .thumb { background: var(--soft); color: var(--deep); }
.hm-card .thumb.warm { background: rgba(240, 169, 90, .16); color: #f0a95a; }
.hm-card .thumb.cool { background: rgba(12, 117, 255, .18); color: #6aa5ff; }
.hm-card.main { padding-top: 18px; }
/* Шрифт Magistral: заголовки блоков, суммы */
.hm-title h2, .hm-panel h2, .hm-h h2, .hm-card-b b, .hm-stat b, .hm-op-a, .hm-banner-t b, .hm-cta, .hm-link, .hm-pill, .hm-card.add, .hm-qcol button { font-family: var(--font-head); }
body.hm-on { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.hm-qrow { display: flex; gap: 8px; padding: 0 22px; }
.hm-qrow button { flex: 1; height: 54px; border-radius: 18px; background: var(--card); display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 6px; min-width: 0; font-family: var(--font-head); font-size: 14px; font-weight: 500; }
.hm-qrow img { width: 22px; height: 22px; flex: none; }

/* Узоры на карточках: два кольца в правом верхнем углу, цвет зависит от типа счёта */
.hm-card::before, .hm-card::after { content: ''; position: absolute; border-radius: 50%; border: 1.5px solid var(--pat, rgba(245, 248, 245, .09)); pointer-events: none; }
.hm-card::before { width: 176px; height: 176px; right: -74px; top: -84px; }
.hm-card::after { width: 118px; height: 118px; right: -44px; top: -54px; }
.hm-card > * { position: relative; z-index: 1; }
.hm-card.k-cash, .hm-card.k-credit_card { --pat: rgba(240, 169, 90, .3); }
.hm-card.k-deposit { --pat: rgba(52, 195, 143, .3); }
.hm-card.k-loan { --pat: rgba(106, 165, 255, .3); }
.hm-card.add::before, .hm-card.add::after { display: none; }
.hm-card-b b { white-space: nowrap; }

.hm-brand { display: flex; align-items: center; justify-content: space-between; }
.hm-brand b { font-family: var(--font-head); font-size: 17px; font-weight: 500; letter-spacing: .2px; }
.hm-brand small { font-size: 11px; padding: 3px 9px; border-radius: 100px; background: rgba(255, 255, 255, .2); color: var(--on-accent); }
.hm-card.main .hm-card-b small { color: rgba(245, 248, 245, .82); }

/* Широкая карточка общего заработка над «Кошельком» */
.hm-card.wide { width: calc(100% - 44px); margin: 0 22px; min-height: 176px; flex: none; }
.hm-card.wide .hm-card-b b { font-size: 30px; }
.hm-card.wide::before { width: 230px; height: 230px; right: -80px; top: -100px; }
.hm-card.wide::after { width: 150px; height: 150px; right: -40px; top: -60px; }

/* Цвета банков на карточках счетов */
.hm-card.bank { background: var(--bk); color: var(--on); }
.hm-card.bank small, .hm-card.bank .hm-card-b small { color: var(--on); opacity: .8; }
.hm-card.bank .thumb, .hm-card.bank .ico44 { background: var(--chip); color: var(--on); }
.card-art.bank { background: var(--bk); color: var(--on); }
.card-art.bank * { color: var(--on); }
.card-art.bank .orbit { opacity: .16; }

.sect10 .head { justify-content: flex-end; }

.card-art .ca-debt { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; opacity: .85; }
.card-art.bank .ca-debt { color: var(--on); }

/* Карточка кредитной карты: ровные отступы */
.ad-page { gap: 20px; }
.ad-limit { gap: 14px; padding: 20px; }
.ad-limit .hero-split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ad-limit .hero-split b { font-size: 16px; font-weight: 500; }
.ad-limit .link { color: var(--purple); font-size: 14px; font-weight: 500; }
.ad-lim-debt { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.ad-lim-debt b { color: var(--ink); font-weight: 500; font-family: var(--font-head); }
.card-art .ca-debt { margin-top: 8px; margin-bottom: 4px; }

/* Переключатель-сегмент: компактная тёмная подложка, светлая плашка скользит к выбранному пункту */
.filters.seg { position: relative; flex-wrap: nowrap; gap: 0; padding: 3px; border-radius: 14px; background: var(--card); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 4); border-radius: 11px; background: var(--on-accent); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .42s cubic-bezier(.22, .9, .3, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.filters.seg .flt { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; padding: 8px 2px; border-radius: 11px; background: transparent !important; color: var(--ink); font-size: 12.5px; font-weight: 500; text-align: center; white-space: nowrap; transition: color .3s ease; }
.filters.seg .flt.on { color: #1c1c1e; }
/* Смена содержимого под переключателем */
.acc-list { display: flex; flex-direction: column; gap: 16px; }
.acc-list.swap-out { opacity: 0; transform: translateX(calc(var(--dx, 0px) * -1)); transition: opacity .15s ease, transform .15s ease; }
@keyframes swap-in { from { opacity: 0; transform: translateX(var(--dx, 0px)); } to { opacity: 1; transform: none; } }
.acc-list.swap-in > * { animation: swap-in .46s cubic-bezier(.22, .9, .3, 1) both; }
.acc-list.swap-in > :nth-child(2) { animation-delay: .05s; }
.acc-list.swap-in > :nth-child(3) { animation-delay: .1s; }
.acc-list.swap-in > :nth-child(n+4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { .seg-thumb, .acc-list.swap-out { transition: none; } .acc-list.swap-in > * { animation: none; } }

.hm-owner { align-self: flex-start; font-family: var(--font-head); font-size: 17px; font-weight: 500; line-height: 1.2; }

/* Профиль */
.pf-page { gap: 18px; }
.pf-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 24px; background: var(--card); }
.pf-av .avatar { width: 64px; height: 64px; font-size: 24px; }
.pf-who { display: flex; flex-direction: column; gap: 3px; }
.pf-who b { font-family: var(--font-head); font-size: 24px; font-weight: 500; }
.pf-who small { font-size: 13px; color: var(--muted); }
.pf-group { display: flex; flex-direction: column; gap: 10px; }
.pf-group .sb-h { margin: 0; }

/* Экран входа по коду */
#denied { min-height: 100vh; display: grid; place-items: center; padding: 28px 22px; }
.dn { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.dn-ico { width: 64px; height: 64px; border-radius: 22px; background: var(--card); display: grid; place-items: center; margin-bottom: 4px; }
#denied .dn h1 { font-size: 26px; font-weight: 500; margin: 0; }
#denied .dn-sub { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.dn-code { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 2px; }
.dn-cell { width: 44px; height: 56px; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); text-align: center; font-family: var(--font-head); font-size: 24px; font-weight: 500; outline: none; padding: 0; caret-color: var(--purple); transition: box-shadow .18s ease, background-color .18s ease; }
.dn-cell:focus { box-shadow: 0 0 0 2px var(--purple); }
.dn-dash { width: 12px; text-align: center; color: var(--muted); font-size: 22px; }
.dn-code.bad .dn-cell { box-shadow: 0 0 0 2px var(--red); animation: dn-shake .38s ease; }
@keyframes dn-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
#denied .dn-msg { margin: 0; min-height: 18px; font-size: 13px; color: var(--red); }
.dn-btn { width: 100%; height: 54px; border-radius: 18px; background: var(--purple); color: var(--on-accent); font-family: var(--font-head); font-size: 16px; font-weight: 500; text-align: center; transition: opacity .2s ease, transform .14s ease; }
.dn-btn:disabled { opacity: .35; }
#denied .dn-foot { margin: 6px 0 0; font-size: 11px; line-height: 1.45; color: var(--muted); opacity: .75; }

/* Плашка года: одна кнопка у правого края, выбор года в шторке */
.yr-pill { height: 36px; padding: 0 18px; border-radius: 12px; background: var(--purple); color: var(--on-accent); font-family: var(--font-head); font-size: 15px; font-weight: 500; display: grid; place-items: center; margin-right: 0; }

/* Четыре кнопки под «Кошельком» (у тех, у кого есть зарплата): в один ряд, значок над подписью */
.hm-qrow.four { gap: 6px; }
.hm-qrow.four button { flex-direction: column; gap: 5px; height: 64px; padding: 0 2px; font-size: 12px; }

/* Сводная карточка «Общий долг» на вкладке «Долги» */
.card-art.debt-total { cursor: default; }
.card-art.debt-total .ca-debt { margin: 0; font-size: 12.5px; line-height: 1.4; }
.card-art.debt-total .ca-data { gap: 4px; }
