/* Гарант — Mini App. Цвета акцента, кнопок и фона подставляются из /admin (applyTheme в app.js) */
:root {
  --primary: #2BAD72;
  --primary-rgb: 43, 173, 114;
  --btn: #1F9A63;
  --btn-dark: #0d4a30;
  --bg: #111111;

  --surface: #161616;
  --surface-2: #1c1c1c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-2: #c9c9c9;
  --muted: #8a8a8a;
  --danger: #f06a6a;
  --danger-rgb: 240, 106, 106;
  --warn: #f5c043;
  --star: #f5c518;

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 20px;
  --pad: 20px;
  --nav-h: 57px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* градиенты считаем от края рамки — иначе у кнопок по краю «светится» полоска повторённого градиента */
*, *::before, *::after { background-origin: border-box !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
b, strong { font-weight: 700; }

/* ---------- Иконки ---------- */
.i { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: currentColor; flex: none; }

/* ---------- Фон: свечение сверху + контуры букв из макета ---------- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-glow {
  position: absolute; left: -30%; top: -330px; width: 160%; height: 640px;
  background:
    radial-gradient(closest-side at 38% 52%, rgba(255, 255, 255, 0.10), transparent 60%),
    radial-gradient(closest-side at 38% 52%, rgba(var(--primary-rgb), 0.45), transparent 100%);
  filter: blur(20px);
  opacity: 0.85;
}
.bg-pattern { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: url("bg.svg") top center / 100% auto no-repeat; }

/* ---------- Каркас ---------- */
.shell {
  position: relative; z-index: 1;
  max-width: 28rem; margin: 0 auto;
  min-height: 100vh;
  padding: 18px var(--pad) calc(var(--nav-h) + 40px + var(--safe-bottom));
  animation: fade 0.22s ease-out;
}
.shell.with-dock { padding-bottom: calc(var(--nav-h) + 100px + var(--safe-bottom)); }
.shell.sub { padding-bottom: calc(28px + var(--safe-bottom)); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Шапка ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 32px; }
.user-chip {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
  padding: 6px 16px 6px 6px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.user-chip .name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 10.5rem; }
.user-chip .uname { font-size: 12.5px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 10.5rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: #f2f2f2; color: #1a1a1a; display: grid; place-items: center;
  font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar.xs { width: 30px; height: 30px; font-size: 12px; }
.brand { font-weight: 800; letter-spacing: 0.04em; font-size: 17px; white-space: nowrap; }
.brand img { height: 28px; width: auto; max-width: 150px; object-fit: contain; display: block; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 20px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.sub-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 22px; }
.sub-head h1 { margin: 0; font-size: 22px; font-weight: 800; }
.back {
  width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--glass); display: grid; place-items: center; font-size: 15px; flex: none;
}

/* ---------- Главная: баланс ---------- */
.label { color: var(--text-2); font-size: 14px; font-weight: 500; }
.balance { font-size: 26px; font-weight: 700; line-height: 1.15; margin: 2px 0 10px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--primary); background: rgba(var(--primary-rgb), 0.10);
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip .i { font-size: 13px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0 20px; }
.act { display: flex; flex-direction: column; gap: 8px; align-items: stretch; border: 0; padding: 0; background: none; text-align: center; }
.act .box {
  height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 19px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.act:active .box { transform: scale(0.97); }
.act.in .box {
  color: var(--primary);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.22), rgba(var(--primary-rgb), 0.10));
  border: 1px solid rgba(var(--primary-rgb), 0.28);
}
.act.out .box { color: #d6d6d6; background: rgba(255, 255, 255, 0.24); border: 1px solid rgba(255, 255, 255, 0.10); }
.act .cap { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: -1px; }

.ad {
  position: relative; display: block; overflow: hidden; width: 100%;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  min-height: 90px; padding: 0; margin-bottom: 24px; text-align: center; color: var(--muted);
}
.ad .ad-img { display: block; width: 100%; height: 96px; object-fit: cover; }
.ad .ad-ico { display: grid; place-items: center; height: 50px; color: rgba(var(--primary-rgb), 0.55); font-size: 26px; }
.ad .ad-ico img { max-height: 34px; max-width: 120px; }
.ad .ad-text { padding: 0 16px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ad.has-img .ad-text { padding-top: 12px; }
.ad-tag { position: absolute; top: 8px; right: 10px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.35); }

/* ---------- Кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  border: 1px solid transparent; text-align: center; text-decoration: none;
  color: #fff; font-weight: 700; font-size: 14px;
  padding: 11px 16px; border-radius: 14px; margin-top: 10px;
  background: var(--glass);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.985); }
.btn .i { font-size: 14px; }
.btn.primary {
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(100deg, var(--btn-dark) 0%, var(--btn) 100%);
  background-repeat: no-repeat;
  border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(var(--primary-rgb), 0.55);
}
.btn.big { padding: 12px 16px; font-size: 15px; border-radius: 16px; }
.btn.green-soft { background: rgba(var(--primary-rgb), 0.12); border-color: rgba(var(--primary-rgb), 0.16); }
.btn.gray { background: rgba(255, 255, 255, 0.26); border-color: rgba(255, 255, 255, 0.08); }
.btn.ghost { background: var(--glass); border-color: var(--line); }
.btn.red { background: rgba(var(--danger-rgb), 0.12); border-color: rgba(var(--danger-rgb), 0.18); color: var(--danger); }
.btn.link { background: transparent; color: var(--muted); font-weight: 500; margin-top: 4px; padding: 10px; }
.btn:disabled { opacity: 0.5; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.dock {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 19;
  width: calc(100% - 2 * var(--pad)); max-width: calc(28rem - 2 * var(--pad));
  bottom: calc(var(--nav-h) + 38px + var(--safe-bottom));
}
.dock .btn { margin: 0; }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; padding-bottom: 2px; }
.row:first-child { padding-top: 2px; }
.row .v { text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }
.row.tap { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.danger { color: var(--danger); }
.ok { color: var(--primary); }
.warn-text { color: var(--warn); }
.section-title { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin: 26px 4px 10px; }

/* ---------- Сегмент «Активные / История» ---------- */
.seg-pill { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.seg-pill button {
  border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 7px 13px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
}
.seg-pill button.active { color: var(--primary); background: rgba(var(--primary-rgb), 0.12); }

.seg { display: flex; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.seg button.active { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.seg button small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }

/* ---------- Формы ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--text-2); font-size: 13px; font-weight: 500; margin: 0 0 7px 2px; }
.input {
  width: 100%; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 14px; outline: none; font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.input::placeholder { color: #5f5f5f; }
.input:focus { border-color: rgba(var(--primary-rgb), 0.6); background: rgba(var(--primary-rgb), 0.04); }
textarea.input { resize: none; min-height: 88px; }
.input.big { font-size: 28px; font-weight: 800; text-align: center; padding: 16px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 7px 2px 0; line-height: 1.45; }
.err { color: var(--danger); font-size: 13px; margin: 8px 2px 0; min-height: 1em; }
.err:empty { margin: 0; min-height: 0; }

.methods { display: grid; gap: 8px; }
.method {
  display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
}
.method.active { border-color: rgba(var(--primary-rgb), 0.55); background: rgba(var(--primary-rgb), 0.08); }
.method .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--glass); display: grid; place-items: center; font-size: 18px; flex: none; }
.method .check { margin-left: auto; color: var(--primary); opacity: 0; }
.method.active .check { opacity: 1; }

.found { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: var(--r-sm); background: rgba(var(--primary-rgb), 0.08); border: 1px solid rgba(var(--primary-rgb), 0.18); margin-top: 8px; cursor: pointer; }

.found-meta { margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.star-one { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.star-one .i { color: var(--star); font-size: 11px; }

.addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all;
  background: rgba(255, 255, 255, 0.04); padding: 12px; border-radius: var(--r-sm); cursor: pointer; border: 1px dashed var(--line-2);
}

/* ---------- Сделки ---------- */
.deal { cursor: pointer; padding: 12px 14px; transition: background 0.15s; }
.deal:active { background: var(--surface-2); }
.deal-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.deal-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-sum { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); align-items: center; }
.deal-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--glass); color: var(--text-2); white-space: nowrap; }
.pill.created { background: rgba(245, 192, 67, 0.12); color: var(--warn); }
.pill.active, .pill.completed { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.pill.dispute, .pill.refunded { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); }

.empty { text-align: center; color: var(--text-2); padding: 52px 12px; font-weight: 600; font-size: 13.5px; }
.empty .e { font-size: 30px; color: rgba(255, 255, 255, 0.18); margin-bottom: 12px; }
.empty .sub { color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 6px; }

.op { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.op:last-child { border-bottom: 0; }
.op .t { font-size: 14px; font-weight: 600; }
.op .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.op .s .d { font-weight: 500; }
.op .s { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

/* ---------- Профиль ---------- */
.profile-top { text-align: center; padding-top: 4px; }
.ava-ring {
  position: relative; width: 94px; height: 94px; margin: 0 auto 24px; border-radius: 50%;
  padding: 3px; background: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12), 0 12px 40px -10px rgba(var(--primary-rgb), 0.6);
}
.ava-ring .avatar { width: 100%; height: 100%; font-size: 32px; border: 3px solid var(--bg); }
.rating-chip {
  position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: #1a1a1a; border: 1px solid rgba(var(--primary-rgb), 0.55); color: var(--text-2);
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; cursor: pointer;
}
.rating-chip .i { color: var(--star); font-size: 11px; }
.p-name { font-size: 20px; font-weight: 600; margin: 0; word-break: break-word; }
.p-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.channel-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  color: var(--muted); font-size: 13px; font-weight: 500; background: none; border: 0; padding: 4px 8px;
}
.channel-link.set { color: var(--primary); }
.channel-link .i { font-size: 13px; }

.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stat2 {
  border-radius: var(--r); padding: 14px 10px 10px; text-align: center;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.stat2 .ico { width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: rgba(255, 255, 255, 0.12); color: #e6e6e6; }
.stat2 .val { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-all; }
.stat2 .cap { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.10); color: var(--text-2); }
.stat2.green { background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.10), rgba(var(--primary-rgb), 0.03)); border-color: rgba(var(--primary-rgb), 0.16); }
.stat2.green .ico { background: rgba(var(--primary-rgb), 0.20); color: var(--primary); }
.stat2.green .val { color: var(--primary); }
.stat2.green .cap { background: rgba(var(--primary-rgb), 0.08); border-color: rgba(var(--primary-rgb), 0.35); color: var(--text); }
.reg { text-align: center; color: var(--muted); font-size: 13px; font-weight: 500; margin: 18px 0 6px; }

.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--glass); color: var(--text-2); font-size: 15px; flex: none; }
.menu-item .mi-t { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.menu-item .mi-v { color: var(--muted); font-size: 13px; white-space: nowrap; }
.menu-item .chev { color: #4d4d4d; font-size: 12px; }

/* ---------- Отзывы ---------- */
.stars { display: inline-flex; gap: 2px; color: var(--star); font-size: 12px; }
.stars .off { color: #3a3a3a; }
.rate-pick { display: flex; justify-content: center; gap: 10px; margin: 6px 0 18px; }
.rate-pick button { border: 0; background: none; font-size: 32px; color: #333; padding: 2px; transition: transform 0.1s, color 0.1s; }
.rate-pick button.on { color: var(--star); }
.rate-pick button:active { transform: scale(0.9); }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review-top { display: flex; align-items: center; gap: 10px; }
.review-top .who { flex: 1; min-width: 0; }
.review-top .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-top .who span { font-size: 12px; color: var(--muted); }
.review p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.rating-big { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rating-big .num { font-size: 40px; font-weight: 800; line-height: 1; }
.rating-big .stars { font-size: 16px; }

/* ---------- FAQ ---------- */
.faq-intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.faq-intro h2 { margin: 0 0 6px; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.faq-intro h2 .i { color: var(--primary); font-size: 18px; }
.faq-intro p { margin: 0; color: var(--text-2); font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.faq-intro + .btn { margin: 0 0 14px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
.qa summary { padding: 16px 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 10px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: ""; width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.18s ease; flex: none; }
.qa[open] summary::before { transform: rotate(90deg); }
.qa[open] summary { color: var(--primary); }
.qa .a { padding: 0 14px 16px 32px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; white-space: pre-line; }

/* ---------- Нижнее меню ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(20px + var(--safe-bottom)); width: calc(100% - 2 * var(--pad)); max-width: calc(28rem - 2 * var(--pad));
  display: flex; gap: 6px; padding: 5px; height: var(--nav-h);
  background: rgba(22, 22, 22, 0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.nav button {
  flex: 1; border: 1px solid transparent; background: transparent; color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px; font-weight: 700; padding: 4px 2px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav button .i { font-size: 16px; }
.nav button.active { color: #fff; background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.09); }

/* ---------- Шторка ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fadein 0.2s; }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto;
  max-width: 28rem; margin: 0 auto;
  background: #171717; border-radius: 24px 24px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 10px var(--pad) calc(22px + var(--safe-bottom));
  animation: up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-body::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); margin: 0 auto 16px; }
.sheet-body h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; }
@keyframes up { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, calc(-100% - 40px)); z-index: 60;
  opacity: 0; visibility: hidden;
  background: #232323; border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0s linear 0.28s; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease, visibility 0s; }

.splash { min-height: 70vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.08); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 76px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }


/* =========================================================
   Формы пополнения / вывода, поиск, сделка (доп. макеты)
   ========================================================= */
.back-row { display: flex; align-items: center; gap: 12px; margin: -8px 0 20px; min-height: 48px; }
.back-row h1 { margin: 0; font-size: 22px; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back.round { border-radius: 50%; width: 40px; height: 40px; background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); }
.cp-head { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; max-width: 55%; }
.cp-txt { text-align: right; min-width: 0; }
.cp-txt b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-txt span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.cp-txt .i { color: var(--star); font-size: 11px; }
.cp-head .avatar { border: 2px solid rgba(255, 255, 255, 0.12); }

.form-card { background: rgba(28, 28, 28, 0.92); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 20px 20px; }
.fc-ico { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 18px; color: var(--primary); background: rgba(var(--primary-rgb), 0.16); }
.fc-title { margin: 0; text-align: center; font-size: 19px; font-weight: 700; }
.fc-sub { margin: 6px auto 20px; text-align: center; color: var(--text-2); font-size: 13.5px; font-weight: 500; max-width: 17rem; line-height: 1.45; }
.lbl { display: block; font-size: 14px; font-weight: 700; margin: 0 0 8px 2px; }
.avail { text-align: center; color: var(--text-2); font-weight: 600; font-size: 14px; margin: -8px 0 20px; }
.avail b { color: var(--text); }
.form-card .hint { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input.center { text-align: center; }
.big-ph { padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.03); font-size: 16px; }

.note { margin-top: 14px; padding: 14px; border-radius: var(--r-sm); background: rgba(var(--primary-rgb), 0.10); border: 1px solid rgba(var(--primary-rgb), 0.22); font-size: 13px; font-weight: 500; color: var(--text-2); line-height: 1.45; }
.note.warn { background: rgba(245, 192, 67, 0.08); border-color: rgba(245, 192, 67, 0.2); color: #e9d39a; }
.note-calc { margin-top: 6px; color: var(--primary); font-weight: 700; }

.btn.dark { background: #141414; border-color: var(--line); }
.btn.sm { width: auto; padding: 9px 14px; margin: 0; font-size: 13px; border-radius: 12px; }
.btn-pair { display: flex; gap: 12px; }
.btn-pair .btn { flex: 1; margin-top: 0; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.btn .avatar { width: 24px; height: 24px; font-size: 11px; }

.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw .input.center { padding-left: 46px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; font-size: 15px; }
.link-row { display: flex; justify-content: space-between; align-items: center; margin: 7px 2px 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.link-row button { border: 0; background: none; padding: 2px 0; color: var(--primary); font-weight: 600; font-size: 12.5px; }
.secret-missing { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-sm); background: rgba(245, 192, 67, 0.07); border: 1px solid rgba(245, 192, 67, 0.18); font-size: 14px; }
.secret-missing > .i { color: var(--warn); font-size: 16px; }
.secret-missing > div { flex: 1; min-width: 0; }

/* выпадающий список */
.dd { position: relative; }
.dd-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2);
}
.dd.unset .dd-btn { border-color: rgba(var(--primary-rgb), 0.75); }
.dd.open .dd-btn { border-color: rgba(var(--primary-rgb), 0.9); }
.dd-ph { color: #7a7a7a; font-weight: 500; flex: 1; }
.dd-chev { margin-left: auto; color: var(--muted); font-size: 12px; transition: transform 0.18s; }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-btn > .i, .dd-item > .i { color: var(--muted); font-size: 13px; }
.dd-t { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dd-t small { color: var(--muted); font-weight: 500; font-size: 12px; }
.dd-list {
  display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: #1d1d1d; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 4px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.9); animation: fadein 0.15s;
}
.dd.open .dd-list { display: block; }
.dd-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; border-radius: 8px; background: none; text-align: left; font-weight: 600; font-size: 13.5px; }
.dd-item:hover, .dd-item.on { background: rgba(255, 255, 255, 0.06); }
.dd-none { padding: 12px; color: var(--muted); font-size: 14px; }

/* поиск контрагента */
.search-card { background: rgba(28, 28, 28, 0.6); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
.search-bar { display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 48px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; font-weight: 600; text-align: center; }
.search-bar input::placeholder { color: #8d8d8d; font-weight: 500; text-align: left; }
.search-bar .sb-l { color: var(--warn); font-size: 18px; }
.search-bar .sb-r { color: var(--muted); font-size: 17px; }
#sr:not(:empty) { margin-top: 8px; }
.sr-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid transparent; background: none; text-align: left; }
.sr-row.on { background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); }
.sr-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-g, .pill-y { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-g { color: var(--primary); background: rgba(var(--primary-rgb), 0.16); }
.pill-y { color: var(--star); background: rgba(245, 197, 24, 0.12); }
.pill-y .i { font-size: 11px; }
.sr-msg { display: grid; place-items: center; min-height: 60px; color: var(--muted); font-size: 14px; text-align: center; padding: 8px; }
.spinner.sm { width: 22px; height: 22px; border-width: 2px; }

/* форма сделки */
.role-seg { display: flex; gap: 6px; padding: 5px; margin: 18px 0 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-2); }
.role-seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 9px 6px; background: none; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.role-seg button.active { background: rgba(var(--primary-rgb), 0.14); color: var(--primary); }
.cond-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.35); margin-bottom: 12px; }
.cond-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255, 255, 255, 0.24); font-weight: 700; font-size: 14px; }
.cond-head .i { color: rgba(255, 255, 255, 0.6); font-size: 16px; }
.cond-card textarea { display: block; width: 100%; min-height: 140px; resize: none; border: 0; outline: none; background: none; padding: 14px; font-size: 15px; }
.cond-card textarea::placeholder { color: #6d6d6d; }
.cond-body { padding: 14px; color: var(--text-2); font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.counter { text-align: right; color: var(--muted); font-size: 12px; margin: -6px 4px 0; }

/* карточка сделки */
.stepper { display: flex; justify-content: space-between; position: relative; margin: 0 0 18px; padding: 0 4px; }
.stepper::before { content: ""; position: absolute; left: 30px; right: 30px; top: 15px; height: 2px; background: var(--line-2); }
.step { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.step .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: #1b1b1b; border: 1px solid var(--line-2); color: #5d5d5d; }
.step .st { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.step.done .dot { background: var(--primary); border-color: var(--primary); color: #0b2a1c; }
.step.done .st { color: var(--text-2); }
.step.cur .dot { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), 0.12); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12); }
.step.cur .st { color: var(--primary); }
.deal-hero { text-align: center; padding: 18px 16px; margin-bottom: 12px; border-radius: var(--r); background: rgba(28, 28, 28, 0.8); border: 1px solid var(--line); }
.deal-hero-sum { font-size: 26px; font-weight: 700; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.banner { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); margin: 14px 0 4px; font-size: 13px; color: var(--text-2); line-height: 1.45; font-weight: 500; }
.banner > .i { font-size: 18px; margin-top: 1px; }
.banner b { display: block; font-size: 14.5px; color: var(--text); margin-bottom: 2px; }
.banner.ok { background: rgba(var(--primary-rgb), 0.10); border: 1px solid rgba(var(--primary-rgb), 0.24); }
.banner.ok > .i { color: var(--primary); }
.banner.wait { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); }
.banner.wait > .i { color: var(--warn); }
.banner.warn { background: rgba(245, 192, 67, 0.08); border: 1px solid rgba(245, 192, 67, 0.22); }
.banner.warn > .i { color: var(--warn); }
.banner.bad { background: rgba(var(--danger-rgb), 0.08); border: 1px solid rgba(var(--danger-rgb), 0.22); }
.banner.bad > .i { color: var(--danger); }
.banner.gray { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.offer { margin-top: 14px; padding: 18px; border-radius: var(--r); text-align: center; background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.04)); border: 1px solid rgba(var(--primary-rgb), 0.3); }
.offer-top { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary); font-size: 14px; }
.offer-txt { margin-top: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; font-weight: 500; }

/* «ждут вашего действия» */
.todo { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid rgba(245, 192, 67, 0.22); background: rgba(245, 192, 67, 0.07); color: #f1d98f; font-weight: 600; font-size: 13.5px; text-align: left; }
.todo span { flex: 1; }
.deal.my-turn { border-color: rgba(var(--primary-rgb), 0.4); background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.07), var(--surface)); }
.pill.act { box-shadow: 0 0 0 1px currentColor inset; }
.deal-top .avatar { margin-right: 2px; }
.deal-top .deal-title { flex: 1; min-width: 0; }
.nav button { position: relative; }
.nav .badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #07170f; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; }


/* =========================================================
   Админка
   ========================================================= */
.hdr-r { display: flex; align-items: center; gap: 12px; }
.admin-btn { position: relative; width: 40px; height: 40px; border-radius: 13px; border: 1px solid rgba(var(--primary-rgb), 0.3); background: rgba(var(--primary-rgb), 0.12); color: var(--primary); display: grid; place-items: center; font-size: 16px; }
.admin-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.a-cnt { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; margin-left: 6px; }
/* все 5 вкладок помещаются в ширину — листать не нужно */
.a-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.a-tabs button { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 11px; padding: 7px 2px 6px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-tabs button .i { font-size: 15px; }
.a-tabs button .a-cnt { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
.a-tabs button.active { background: rgba(var(--primary-rgb), 0.14); border-color: rgba(var(--primary-rgb), 0.3); color: var(--primary); }
.a-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 12px; }
.a-seg.two { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.a-seg button { min-width: 0; display: flex; align-items: center; justify-content: center; border: 0; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 4px; border-radius: 10px; white-space: nowrap; }
.a-seg button.active { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.a-seg .a-cnt { min-width: 16px; height: 16px; font-size: 9.5px; margin-left: 4px; padding: 0 4px; }
.mi-ico.hot { background: rgba(var(--primary-rgb), 0.16); color: var(--primary); }

.a-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-grid.three { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.a-stat { padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.a-stat .a-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: var(--text-2); font-size: 14px; margin-bottom: 10px; }
.a-stat .a-val { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-stat .a-lbl { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.a-stat .a-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.a-stat.green { background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.10), rgba(var(--primary-rgb), 0.03)); border-color: rgba(var(--primary-rgb), 0.2); }
.a-stat.green .a-ico { background: rgba(var(--primary-rgb), 0.2); color: var(--primary); }
.a-stat.green .a-val { color: var(--primary); }
.a-mini { text-align: center; padding: 10px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); min-width: 0; }
.a-mini b { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; }
.a-mini b .i { color: var(--star); font-size: 11px; }
.a-mini span { font-size: 11px; color: var(--muted); }

.req { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.req-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.req-top b { font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-sum { font-weight: 800; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.req-done { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.req .btn.link { margin-top: 2px; padding: 8px; font-size: 13px; }
.a-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); cursor: pointer; margin-bottom: 6px; }
.a-user > span:not(.avatar) { flex: 1; min-width: 0; }
.a-user b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-user small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-user > .i { color: #555; font-size: 11px; }
.a-role { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: 8px 2px 5px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.kv:last-of-type { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); flex: none; }
.kv > span:last-child { text-align: right; min-width: 0; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; cursor: pointer; }
.mono .i { color: var(--muted); font-size: 11px; }
.a-quote { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.a-quote span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; white-space: normal; }
.a-quote.bad { background: rgba(var(--danger-rgb), 0.08); }
.a-quote.bad span { color: var(--danger); }
.a-uhead { display: flex; align-items: center; gap: 12px; }
.a-uhead > div { flex: 1; min-width: 0; }
.a-uhead b { display: block; font-size: 16px; }
.a-uhead small { color: var(--muted); font-size: 12.5px; }
.a-uhead small .i { font-size: 11px; }
.search-bar.sm { height: 48px; border-radius: 14px; padding: 0 14px; }
.search-bar.sm input { text-align: left; font-weight: 500; }
.menu-item.set .mi-v { max-width: 52%; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.25); flex: none; }
.color-row { display: flex; gap: 10px; }
.color-row input[type=color] { width: 52px; height: 48px; border: 1px solid var(--line-2); border-radius: 12px; background: none; padding: 4px; }
.btn:disabled { pointer-events: none; }

@media (max-width: 360px) {
  :root { --pad: 16px; }
  .balance { font-size: 27px; }
  .stat2 .val { font-size: 22px; }
  .seg-pill button { padding: 7px 10px; }
  .form-card { padding: 20px 16px 18px; }
  .step .st { font-size: 10px; }
  .pill-g, .pill-y { padding: 4px 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
