:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #0f1f1c;
  --muted: #64748b;
  --line: #e6ebe9;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #e6f4f2;
  --in: #15803d;
  --out: #b91c1c;
  --warn-bg: #fff7e6;
  --warn: #a16207;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 31, 28, .05), 0 4px 16px rgba(15, 31, 28, .06);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 12px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; color: var(--brand); cursor: pointer; display: grid; place-items: center; font-size: 14px;
}
.avatar:hover { background: var(--brand-soft); }
.greet { color: var(--muted); margin: 2px 0 14px; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.card h2 small { font-weight: 500; color: var(--muted); font-size: 13px; }

.hero { background: linear-gradient(145deg, #0f766e, #115e59 60%, #134e4a); color: #fff; padding: 22px 20px; }
.hero .label { opacity: .8; font-size: 14px; }
.hero .amount { font-size: 38px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero .upd { opacity: .7; font-size: 12px; }
.hero .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.hero .split div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 12px; }
.hero .split span { display: block; font-size: 12px; opacity: .8; }
.hero .split b { font-size: 17px; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 13px 18px; font-weight: 600; cursor: pointer; background: var(--brand-soft); color: var(--brand); text-decoration: none;
}
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: #fdecec; color: var(--out); }
.btn:disabled { opacity: .55; cursor: default; }
.upload-cta { margin-bottom: 6px; font-size: 16px; padding: 16px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ---------- goal ---------- */
.progress { height: 10px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; }
.row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }

/* ---------- categories ---------- */
.cat { margin-bottom: 10px; }
.cat .row { color: var(--text); font-size: 14px; }
.cat .bar { height: 8px; background: #f1f5f4; border-radius: 99px; margin-top: 5px; overflow: hidden; }
.cat .bar i { display: block; height: 100%; border-radius: 99px; }

/* ---------- months chart ---------- */
.months { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 130px; }
.months .m { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.months .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.months .bars i { width: 10px; border-radius: 4px 4px 0 0; display: block; min-height: 2px; }
.months span { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 17px; background: #f1f5f4; }
.list .main { flex: 1; min-width: 0; }
.list .t { font-weight: 600; font-size: 14px; }
.list .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.in { color: var(--in); } .amt.out { color: var(--text); }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.chip.new { background: var(--warn-bg); color: var(--warn); }
.chip.done { background: #e8f6ee; color: var(--in); }
.list li.click { cursor: pointer; }
.more { width: 100%; margin-top: 6px; }

.advice { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.advice p { margin: 0; white-space: pre-wrap; }
.advice .s { color: var(--muted); font-size: 12px; margin-top: 6px; }

.empty { color: var(--muted); text-align: center; padding: 12px 0; font-size: 14px; }
.note { color: var(--muted); font-size: 12px; text-align: center; margin: 20px 8px 0; line-height: 1.5; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth .card { width: min(400px, 100%); padding: 26px 22px; }
.auth .logo { justify-content: center; margin-bottom: 6px; font-size: 22px; }
.auth p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 13px; background: #fff; width: 100%; }
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.err { color: var(--out); font-size: 13px; min-height: 18px; }

/* ---------- bottom sheet ---------- */
.shade { position: fixed; inset: 0; background: rgba(15, 31, 28, .4); z-index: 40; animation: fade .15s; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 22px 22px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); z-index: 41; animation: up .2s ease-out;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #d7dedc; margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 18px; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 20px; box-shadow: none; background: var(--brand-soft); cursor: default; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; margin-bottom: 18px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-word; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.drop {
  border: 2px dashed #c9d6d3; border-radius: 16px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted);
  display: block; background: #fafcfb;
}
.drop:hover { border-color: var(--brand-2); }
.drop b { color: var(--brand); display: block; font-size: 16px; margin-bottom: 4px; }
.preview { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; margin: 0 auto; }
.viewer img { width: 100%; border-radius: 12px; }
.viewer iframe { width: 100%; height: 70vh; border: 0; border-radius: 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; }
#toast div { background: #0f1f1c; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: up .2s; }
#toast div.err { background: var(--out); }

.skeleton { height: 160px; border-radius: var(--radius); background: linear-gradient(90deg, #eceff0, #f6f8f8, #eceff0); background-size: 200% 100%; animation: sh 1.2s infinite; margin-bottom: 14px; }
@keyframes sh { to { background-position: -200% 0; } }

@media (min-width: 900px) {
  .wrap { max-width: 960px; }
  .grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
}

/* ---------- support ---------- */
.support-card .sup-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sup-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; }
.support-card .t { font-weight: 700; }
.support-card .s { color: var(--muted); font-size: 13px; }
.sup-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sup-btns .btn { padding: 12px 10px; white-space: nowrap; }
.badge { background: #ef4444; color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 2px 8px; }
.fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--brand); color: #fff; font-size: 24px; box-shadow: 0 8px 24px rgba(15, 118, 110, .35); cursor: pointer; z-index: 30;
}
.fab b { position: absolute; top: -2px; right: -2px; background: #ef4444; color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); }
.fab b[hidden] { display: none; }
.chat-sheet { display: flex; flex-direction: column; height: 88vh; padding-bottom: 0; }
.chat-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-top .s { color: var(--muted); font-size: 13px; }
.chat-sheet .chat-body { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 10px; }
.chat-sheet .msg { max-width: 82%; display: flex; flex-direction: column; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 12px; font-weight: 600; color: var(--brand); margin: 0 0 3px 4px; }
.msg .bubble { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; background: #f1f5f4; }
.msg.in .bubble { border-bottom-left-radius: 6px; }
.msg.out .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.msg .meta { font-size: 11px; color: var(--muted); margin: 3px 6px 0; }
.chat-empty { text-align: center; color: var(--muted); margin: auto; line-height: 1.7; font-size: 15px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; max-height: 120px; }
.chat-form .btn { padding: 12px 16px; }

/* ---------- verification ---------- */
.vchip { display: inline-block; background: #e8f6ee; color: var(--in); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.vchip[hidden] { display: none; }
.verify-card .vc-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.vc-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.verify-card .t { font-weight: 700; }
.verify-card .s { color: var(--muted); font-size: 13px; }
.verify-card p.s { margin: 0 0 12px; }
.verify-card.sch { border: 2px solid var(--brand-2); }

/* ---------- language switch ---------- */
.top-r { display: flex; align-items: center; gap: 10px; }
.lang-sw { display: inline-flex; background: var(--card); border-radius: 99px; padding: 3px; box-shadow: var(--shadow); }
.lang-sw button { border: 0; background: transparent; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang-sw button.on { background: var(--brand); color: #fff; }
.kv .lang-sw { box-shadow: none; background: #f1f5f4; }
.auth { position: relative; }
.auth-lang { position: absolute; top: 16px; right: 16px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; background: #e8eeec; padding: 4px; border-radius: 14px; margin-bottom: 14px; max-width: 360px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 11px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- payment cards (visual only, no balance) ---------- */
.c-teal { --c1: #0f766e; --c2: #134e4a; }
.c-indigo { --c1: #4f46e5; --c2: #312e81; }
.c-slate { --c1: #475569; --c2: #0f172a; }
.c-rose { --c1: #e11d48; --c2: #881337; }
.c-amber { --c1: #d97706; --c2: #78350f; }
.c-emerald { --c1: #059669; --c2: #064e3b; }
.c-violet { --c1: #7c3aed; --c2: #4c1d95; }
.c-sky { --c1: #0284c7; --c2: #0c4a6e; }
.cards-note { color: var(--muted); font-size: 13px; margin: -4px 0 14px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pcard-btn { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; border-radius: 16px; transition: transform .15s; }
.pcard-btn:hover { transform: translateY(-2px); }
.pcard {
  aspect-ratio: 1.586; border-radius: 16px; padding: 14px 16px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2)); display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 6px 18px rgba(15, 31, 28, .18);
}
.pcard::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -60px; top: -70px; background: rgba(255, 255, 255, .09); }
.pcard.big { margin-bottom: 14px; padding: 18px 20px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: relative; z-index: 1; }
.pc-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-kind { font-size: 18px; }
.pc-chip { width: 34px; height: 25px; border-radius: 6px; background: linear-gradient(135deg, #fde68a, #d4a017); opacity: .9; }
.pc-chip.none { visibility: hidden; }
.pc-num { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; font-size: 15px; opacity: .95; }
.pcard.big .pc-num { font-size: 18px; }
.pc-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; position: relative; z-index: 1; }
.pc-bottom span { display: block; font-size: 11px; opacity: .8; }
.pc-bottom b { font-size: 17px; font-variant-numeric: tabular-nums; }
.pc-cnt { font-size: 11px; opacity: .8; white-space: nowrap; }
.pcard-add {
  aspect-ratio: 1.586; border: 2px dashed #c9d6d3; border-radius: 16px; background: #fafcfb; color: var(--brand); font-weight: 600;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.pcard-add span { font-size: 28px; line-height: 1; }
.pcard-add:hover { border-color: var(--brand-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; background: var(--c1); }
.bar i[class^="c-"] { background: var(--c1); }
.mchip { color: var(--c1); font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stats div { background: #f4f7f6; border-radius: 12px; padding: 10px 12px; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.stats b.in { color: var(--in); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px; font-weight: 600; cursor: pointer; font-size: 13px; }
.seg button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -6px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); background: linear-gradient(135deg, var(--c1), var(--c2)); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 2.5px var(--text); }
.warn-box { background: var(--warn-bg); color: var(--warn); font-size: 12.5px; border-radius: 12px; padding: 9px 12px; margin-top: -4px; }
.input.l4 { font-family: ui-monospace, Menlo, monospace; letter-spacing: .3em; font-size: 17px; max-width: 160px; }

/* Официальный e-mail поддержки */
.support-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 22px 0 4px; font-size: 13px; color: var(--muted); }
.support-mail { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 600; text-decoration: none; transition: background .15s; }
.support-mail:hover { background: #d4ece8; }
.support-mail svg { flex: none; }
.kv .v .support-mail { margin: 0 8px 4px 0; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
