:root {
  --bg: #0B1622;
  --bg-2: #0D1B2A;
  --card: #16222F;
  --card-2: #1A2735;
  --teal: #4FA3DB;
  --teal-2: #5FB0E3;
  --blue: #4FA3DB;
  --red: #E33;
  --green: #2C5A41;
  --text: #F4F7FA;
  --muted: #8A99AB;
  --line: rgba(138,153,171,0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.18);
  --ring: 0 0 0 3px rgba(79,163,219,0.18);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* Денежная типографика — выровненные по разрядам цифры (финтех-стандарт). */
.bal-sum, .bal-op-a, .acc-total, .acc-net, .c-bal, .cc-amt, .tx-amt, .own-receipt, .ex-result, .topbar .c-bal { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-2) 0%, var(--bg) 60%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; color: inherit; }

/* ---- Brand ---- */
.brand { font-weight: 800; font-size: 28px; letter-spacing: -0.5px; }
.brand.small { font-size: 18px; }
.brand-mark { color: var(--text); }
.brand-pay { color: var(--red); }

/* ---- Login ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 24px; padding: 36px 28px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: var(--shadow);
}
.login .brand { font-size: 40px; margin-bottom: 6px; }
.login-sub { color: var(--muted); margin: 0 0 26px; line-height: 1.5; }
.tg-slot { display: grid; place-items: center; min-height: 50px; }
.login-hint { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ---- App shell ---- */
.app {
  max-width: 540px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(96px + var(--safe-b));
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* keep text selectable only inside real inputs */
input, textarea, select { -webkit-user-select: text; user-select: text; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: rgba(11,22,34,0.85);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar { justify-content: space-between; }
.topbar .brand { margin-right: auto; }
.topbar .brand.hidden { display: none; }
.icon-btn {
  background: var(--card); border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: 10px; font-size: 18px; color: var(--text);
  display: grid; place-items: center;
}
.period {
  background: transparent; border: none; color: var(--text);
  font-weight: 600; font-size: 15px; padding: 6px 8px; min-width: 110px;
}
.view { padding: 16px; }
.view-title { font-size: 20px; margin: 4px 0 16px; }

/* ---- Monefy wheel ---- */
.chart-wrap { position: relative; width: clamp(300px, 92vw, 360px); aspect-ratio: 1; margin: 40px auto 10px; }
.donut { position: absolute; left: 23%; top: 23%; width: 54%; height: 54%; transform: rotate(-90deg); }
.chart-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 32%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px;
  pointer-events: none; overflow: hidden;
}
.cc-exp { font-size: 12px; font-weight: 700; color: #ff8b8b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cc-inc { font-size: 12px; font-weight: 700; color: var(--teal); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.c-bal { font-size: 21px; font-weight: 800; letter-spacing: -0.5px; margin: 1px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cc-cur { font-size: 10px; color: var(--muted); }
.chart-center.preview .cc-ic { font-size: 30px; line-height: 1; }
.cc-name { font-size: 12px; font-weight: 700; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-amt { font-size: 17px; font-weight: 800; }
.cc-pct { font-size: 10px; color: var(--muted); }

/* ring of category icons */
.cat-ring { position: absolute; inset: 0; }
.ring-ic {
  position: absolute; transform: translate(-50%, -50%);
  width: 66px; height: 66px; flex: none; padding: 0; line-height: 1;
  border-radius: 50%; border: 1px solid; display: grid; place-items: center;
  font-size: 28px; transition: transform .12s ease;
}
.ring-ic.is-zero { opacity: 0.38; }
.ring-ic:active { transform: translate(-50%, -50%) scale(0.9); }
@media (max-width: 380px) { .ring-ic { width: 56px; height: 56px; font-size: 24px; } }

/* Header period control */
.hdr-period { display: flex; align-items: center; gap: 4px; }
.icon-btn.sm { width: 30px; height: 30px; font-size: 16px; }
.period-chip {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; min-width: 96px;
}
.popover {
  position: fixed; top: 56px; right: max(12px, calc(50vw - 258px)); z-index: 40;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 180px;
}
.popover button { background: transparent; color: var(--text); text-align: left; padding: 11px 14px; border-radius: 8px; font-size: 14px; }
.popover button.active { background: rgba(79,163,219,0.14); color: var(--teal); font-weight: 700; }

/* Chart toggle + caption */
.chart-toggle { display: flex; gap: 8px; margin: 14px 0 6px; }
.chart-toggle .seg-btn { padding: 9px; border-radius: 12px; }
#ct-expense.active { border-color: var(--red); background: rgba(227,51,51,0.12); }
#ct-income.active { border-color: var(--teal); background: rgba(79,163,219,0.12); }
.chart-caption { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 12px; }

/* Recent operations on home */
.recent { margin-top: 22px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; font-weight: 700; }
.link { background: transparent; color: var(--teal); font-weight: 700; font-size: 13px; }

/* ---- Legend ---- */
.legend { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.legend-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px;
}
.legend-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; flex: none; }
.legend-name { flex: 1; font-weight: 600; }
.legend-pct { color: var(--muted); font-size: 12px; }
.legend-val { font-weight: 700; }

/* ---- Transactions list ---- */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-day-head { color: var(--muted); font-size: 12px; margin: 14px 4px 2px; }
.tx-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.tx-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-cat { font-weight: 600; }
.tx-note { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 700; white-space: nowrap; }
.tx-amt.income { color: var(--teal); }
.tx-amt.expense { color: #ff8080; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

/* ---- Cards / settings ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-head { font-weight: 700; margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.select, .input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 11px 12px; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.select:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); }
.input::placeholder { color: rgba(138,153,171,.65); }
.input.color { padding: 4px; height: 44px; }

.rates-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.rate-row { display: flex; align-items: center; gap: 8px; }
.rate-row .rate-eq { white-space: nowrap; font-weight: 700; font-size: 13px; min-width: 78px; }
.rate-row .rate-base { color: var(--muted); font-size: 13px; min-width: 42px; }
.rate-row .input { flex: 1; min-width: 0; }
.rate-row .del { background: transparent; color: var(--muted); width: 32px; font-size: 18px; }
.rate-row .del-spacer { width: 32px; }
.rate-add { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.rate-add .input { flex: 1; min-width: 0; }
.rate-add .rate-eq { font-weight: 700; }
.rate-add .rate-base { color: var(--muted); font-size: 13px; }

.cat-tabs, .seg { display: flex; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.chip.active { color: var(--text); border-color: var(--teal); background: rgba(79,163,219,0.1); }
.cat-manage { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cat-manage .row { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--bg-2); border-radius: 10px; }
.cat-manage .row .del { margin-left: auto; background: transparent; color: var(--muted); font-size: 18px; }

/* ---- Buttons ---- */
.btn { padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; transition: transform .08s ease, filter .15s ease, box-shadow .15s ease; }
.btn.full { width: 100%; }
.btn:active { transform: translateY(1px) scale(.992); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-teal { background: var(--teal); color: #04223a; box-shadow: 0 6px 16px rgba(79,163,219,.22); }
.btn-teal:active { filter: brightness(.97); }
.btn-blue { background: var(--blue); color: #04223a; }
.btn-ghost { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:active { filter: brightness(1.12); }
.btn-ghost.danger { color: #ff8b8b; }
.danger { color: #ff8b8b; }

/* ---- Promo ---- */
.promo-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.promo {
  border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(79,163,219,0.16), rgba(79,163,219,0.12));
  border: 1px solid rgba(79,163,219,0.3);
}
.promo h3 { margin: 0 0 6px; font-size: 16px; }
.promo p { margin: 0 0 12px; color: #cfe0ea; font-size: 14px; line-height: 1.45; }
.promo a {
  display: inline-block; background: var(--teal); color: #04223a; font-weight: 700;
  padding: 9px 16px; border-radius: 10px; text-decoration: none; font-size: 14px;
}

/* ---- Accounts ---- */
.accounts-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.acc-sym { width: 46px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: .5px; background: rgba(79,163,219,0.12); color: var(--teal); flex: none; }
.acc-main { flex: 1; min-width: 0; }
.acc-code { font-weight: 700; }
.acc-vals { text-align: right; }
.acc-net { font-weight: 800; font-size: 16px; }
.acc-net.pos { color: var(--teal); } .acc-net.neg { color: #ff8b8b; }
.total-card { display: flex; justify-content: space-between; align-items: center; }
.acc-total { font-size: 20px; font-weight: 800; color: var(--teal); }

/* ---- Category editor ---- */
.cat-editor { border-top: 1px solid var(--line); padding-top: 12px; }
.picker-label { margin: 10px 0 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px,1fr)); gap: 6px; max-height: 120px; overflow-y: auto; }
.emoji { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 0; font-size: 18px; }
.emoji.sel { border-color: var(--teal); background: rgba(79,163,219,0.14); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.swatch.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.editor-actions { display: flex; gap: 8px; margin-top: 14px; }
.editor-actions .grow { flex: 1; }
.cat-manage .row .nm { flex: 1; }
.cat-manage .row .edit { background: transparent; color: var(--muted); font-size: 16px; }

/* ---- Action bar (income left, expense right) ---- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: calc(12px + var(--safe-b)); z-index: 24;
  max-width: 540px; margin: 0 auto; display: flex; gap: 10px; padding: 8px 16px;
}
.act { flex: 1; padding: 15px; border-radius: 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow); }
.act span { font-size: 20px; }
.act-income { background: var(--teal); color: #04223a; }
.act-expense { background: var(--red); color: #fff; }

/* ---- (legacy fab, unused) ---- */
.fab { display: none; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  max-width: 540px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4,1fr);
  background: rgba(13,27,42,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.nav-item {
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0 8px;
  transition: color .15s ease;
}
.nav-item span { font-size: 19px; }
.nav-item svg { width: 22px; height: 22px; display: block; }
.nav-item.active { color: var(--teal); }

/* ---- Skeleton loaders & micro-motion ---- */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 37%, rgba(255,255,255,.04) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
.skel-row { height: 62px; margin-bottom: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.ic { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.18em; flex: none; }
.pop { display: inline-block; animation: pop .26s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Sheet ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 12px; overflow-y: auto;
}
.sheet {
  width: 100%; max-width: 460px; background: var(--card);
  border-radius: 20px; padding: 12px 18px 18px;
  max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow); animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-grab { width: 44px; height: 4px; background: var(--line); border-radius: 999px; margin: 4px auto 14px; }
.sheet-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.sheet-title.income { color: var(--teal); }
.sheet-title.expense { color: #ff8b8b; }
.seg-btn {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  padding: 10px; border-radius: 12px; font-weight: 700;
}
.seg-btn.active { color: var(--text); }
#seg-expense.active { border-color: var(--red); background: rgba(227,51,51,0.12); }
#seg-income.active { border-color: var(--teal); background: rgba(79,163,219,0.12); }

.amount-row { display: flex; gap: 10px; margin: 12px 0; }
.amount-input {
  flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 12px 14px; font-size: 24px; font-weight: 800; text-align: right;
}
.cur-select {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 0 10px; font-size: 15px; font-weight: 700; min-width: 76px;
}
/* выбор валюты — чипы (вместо выпадающего списка) */
.cur-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cur-chip { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .05s; }
.cur-chip.active { color: var(--text); border-color: var(--teal); background: rgba(79,163,219,.14); }
.cur-chip:active { transform: scale(.95); }
.ex-swap-row { display: flex; justify-content: center; margin: 10px 0 2px; }
.ex-swap { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line); color: var(--teal); font-size: 18px; cursor: pointer; transition: transform .15s, border-color .15s; }
.ex-swap:hover { border-color: var(--teal); }
.ex-swap:active { transform: rotate(180deg); }
.field { margin-bottom: 14px; }
.field > label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { min-width: 0; }
.field-row .grow { flex: 1; }
@media (max-width: 440px) {
  .field-row { flex-direction: column; gap: 0; }
  .field-row .field { width: 100%; }
}
.cat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px,1fr)); gap: 8px; }
.cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 4px;
  font-size: 11px; color: var(--muted); text-align: center;
}
.cat-cell .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.cat-cell.sel { border-color: var(--teal); color: var(--text); background: rgba(79,163,219,0.1); }
.cat-cell .nm { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions #sheet-delete { flex: 0 0 auto; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: calc(150px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 12px; z-index: 80; font-size: 14px; box-shadow: var(--shadow);
}

@media (min-width: 560px) {
  .fab { left: auto; right: calc(50% - 270px + 16px); transform: none; }
}

/* ===== Platform zones ===== */
.zbody { padding: 16px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.hint { color: var(--muted); font-size: 11px; text-align: center; margin-top: 10px; }

.bigcard { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 10px; cursor: pointer; }
.bigcard:hover { border-color: var(--teal); }
.bic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; }
.bttl { font-weight: 700; font-size: 15px; }
.bd { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: auto; background: rgba(79,163,219,.16); color: var(--teal); }

.sect { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 18px 2px 8px; display: flex; justify-content: space-between; align-items: center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips .chip { flex: none; }

/* slider — one slide per view, auto + manual swipe */
.sect-link { font-weight: 600; color: var(--teal); text-transform: none; letter-spacing: 0; cursor: pointer; }
.rates.clickable { cursor: pointer; }
.rates.clickable:hover { border-color: var(--teal); }
.slider { display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.slider::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; scroll-snap-align: center; border-radius: 16px; padding: 16px; }
.slide.ex { background: linear-gradient(135deg, rgba(79,163,219,.18), rgba(79,163,219,.12)); border: 1px solid rgba(79,163,219,.35); }
.slide.b3 { background: var(--card); border: 1px solid var(--line); }
.slide .st { font-weight: 700; font-size: 14px; }
.slide .sd { color: #cfe0ea; font-size: 12px; margin: 5px 0 12px; }
.slide a { display: inline-block; background: var(--teal); color: #04223a; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.dots { display: flex; gap: 5px; justify-content: center; margin-top: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--teal); }

/* my rates */
.rates { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.rrow { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.rrow:last-child { border-bottom: none; }
.rrow b { font-weight: 800; }
.rmeta { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* services grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px; cursor: pointer; position: relative; }
.tile:hover { border-color: var(--blue); }
.tile.off { cursor: default; }
.tic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 9px; }
.tttl { font-weight: 700; font-size: 13.5px; }
.td { color: var(--muted); font-size: 11px; margin-top: 2px; }
.soon { position: absolute; top: 9px; right: 9px; font-size: 9px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.live { position: absolute; top: 9px; right: 9px; font-size: 9px; font-weight: 700; color: var(--teal); background: rgba(79,163,219,.14); border-radius: 999px; padding: 2px 7px; }

/* apple form */
.steps { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 10px; font-size: 12.5px; align-items: flex-start; }
.step b { background: var(--teal); color: #04223a; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; margin-top: 1px; }
.amt-row { display: flex; gap: 10px; }
.amt-row .input { flex: 1; }
.cur { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 0 14px; font-weight: 700; display: grid; place-items: center; }
.segbtn { flex: 1; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 12px; padding: 11px; font-weight: 700; cursor: pointer; }
.segbtn.active { color: var(--text); border-color: var(--teal); background: rgba(79,163,219,.12); }
.pay-box { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.pay-box b { font-size: 18px; color: var(--teal); }
.info { background: rgba(79,163,219,.1); border: 1px solid rgba(79,163,219,.3); border-radius: 14px; padding: 11px 13px; font-size: 12px; color: #cfe0ea; margin-top: 14px; line-height: 1.5; }

/* dynamic service form — tidy spacing & controls */
.svc-field { margin-bottom: 16px; }
.svc-field > label { margin: 0 0 8px; }
.req { color: #ff8b8b; }
.seg-opt { flex: 1; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s, transform .05s; }
.seg-opt.active { color: var(--text); border-color: var(--teal); background: rgba(79,163,219,.12); }
.seg-opt:active { transform: scale(.97); }
/* выбор тарифа/срока — аккуратная сетка-карточки (финтех-стиль) */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid .seg-opt { padding: 14px 8px; border-radius: 14px; font-size: 14px; }
.choice-grid .seg-opt.active { box-shadow: var(--ring); }
/* витрина «Нейросети» — карточки провайдеров */
.nh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nh-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px; cursor: pointer; position: relative; transition: border-color .15s, transform .05s; }
.nh-card:active { transform: scale(.97); }
.nh-card:not(.off):hover { border-color: var(--teal); }
.nh-card.off { opacity: .55; }
.nh-logo-wrap { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.nh-logo { max-width: 48px; max-height: 48px; object-fit: contain; }
.nh-badge { width: 48px; height: 48px; align-items: center; justify-content: center; font-size: 28px; background: var(--bg-2); border-radius: 12px; }
.nh-name { font-weight: 700; font-size: 15px; color: var(--text); }
.nh-sub { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }
.nh-soon { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700; color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 2px 7px; }
.svc-static { display: inline-block; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px; }

/* orders */
.ord { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px; margin-bottom: 9px; }
.oic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: rgba(79,163,219,.14); color: var(--teal); flex: none; }
.om { flex: 1; min-width: 0; }
.onm { font-weight: 700; font-size: 14px; }
.os { color: var(--muted); font-size: 11px; margin-top: 2px; }
.pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p-pay { background: rgba(224,194,79,.18); color: #E0C24F; }
.p-wait { background: rgba(79,163,219,.16); color: var(--blue); }
.p-done { background: rgba(79,163,219,.16); color: var(--teal); }
.p-cancel { background: rgba(227,51,51,.16); color: #ff8b8b; }

/* collapsible «Как это работает» */
.howto { padding-top: 0; padding-bottom: 0; }
.howto > .howto-sum { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 14px 0; }
.howto > .howto-sum::-webkit-details-marker { display: none; }
.howto-chev { color: var(--muted); transition: transform .2s; }
.howto[open] .howto-chev { transform: rotate(180deg); }
.howto-body { padding-bottom: 14px; }

/* topup modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 200; padding: 0; }
.modal-card { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
@media (min-width: 520px) { .modal-back { align-items: center; } .modal-card { border-radius: 20px; } }

/* order type tags */
.otag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.otag.topup { background: rgba(79,163,219,.16); color: var(--teal); }
.otag.exch { background: rgba(224,194,79,.18); color: #E0C24F; }
.otag.svc { background: rgba(138,153,171,.16); color: var(--muted); }

/* wallet (кошелёк) */
.bal-item { margin-bottom: 10px; }
.bal-item .bal-row { margin-bottom: 0; }
.bal-item .howto { margin-top: 6px; margin-bottom: 0; }
.bal-info { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 4px 0; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wallet-actions .btn { width: 100%; margin: 0; }
.bal-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.bal-row[data-cur] { transition: border-color .15s; }
.bal-row[data-cur]:active { border-color: var(--teal); }
.bal-chev { color: var(--muted); font-size: 20px; flex: none; }
.bal-flag { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: rgba(79,163,219,.14); flex: none; }
.bal-mid { flex: 1; min-width: 0; }
.bal-cur { font-weight: 700; font-size: 13px; }
.bal-sum { font-size: 19px; font-weight: 800; margin-top: 2px; }
.bal-sum.is-zero { color: var(--muted); font-weight: 700; }
.btn-mini { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 700; border-radius: 10px; padding: 8px 12px; flex: none; }
.bal-op { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; margin-bottom: 7px; }
.bal-op-m { font-size: 13px; font-weight: 600; }
.bal-op-a { font-weight: 800; font-size: 14px; white-space: nowrap; }
.bal-op-a.pos { color: var(--teal); }
.bal-op-a.neg { color: #ff8b8b; }

/* profile */
.prof-head { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.prof-ava { width: 54px; height: 54px; border-radius: 50%; background: rgba(79,163,219,.18); color: var(--teal); display: grid; place-items: center; font-size: 22px; font-weight: 800; overflow: hidden; flex: none; }
.prof-ava img { width: 100%; height: 100%; object-fit: cover; }
.prof-name { font-weight: 800; font-size: 17px; }
.kyc-row { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 8px; font-size: 13px; }
.prof-item { width: 100%; display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; font-size: 14px; font-weight: 600; text-align: left; }
.prof-item .chev { color: var(--muted); font-size: 18px; }

/* admin */
.adm-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.adm-tabs .chip { flex: none; }
.adm-pane .card { margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.neg { color: #ff8b8b; }
