/* ──────────────────────────────────────────────────────────────────────────
   Graphite + Violet/Cyan. Palette pulled from the BatTunnel shield logo:
   violet (#8b5cf6) on the left, cyan (#22d3ee) on the right, on near-black
   backgrounds. Designed for Telegram Mini App on mobile — no frameworks,
   system fonts, safe-area aware.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg-0: #0b0c10;
  --bg-1: #11131a;
  --bg-2: #161922;
  --bg-3: #1d2230;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #ecedf2;
  --text-muted: #9aa0b1;
  --text-dim: #6a7185;

  /* Brand accent — pulled directly from the BatTunnel shield logo:
     violet primary with a cyan secondary for highlights/gradients.
     The CSS var names stay `--amber*` to keep diff-noise low; semantically
     they're the brand accent slot. */
  --amber: #8b5cf6;          /* violet 500 — primary accent */
  --amber-soft: #a78bfa;     /* violet 400 — links, soft accents */
  --amber-glow: rgba(139, 92, 246, 0.22);
  --amber-deep: #5b21b6;     /* violet 800 — gradient terminator */
  --accent2: #22d3ee;        /* cyan 400 — secondary accent (logo's right half) */
  --accent2-deep: #0891b2;   /* cyan 600 */

  --ok: #34d399;
  --warn: #f97316;
  --bad: #ef4444;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 30px rgba(0, 0, 0, 0.45);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  /* Cool graphite with brand-tinted washes — violet at top echoing the
     left half of the logo, cyan at bottom-right echoing the right half.
     Subtle (single-digit alpha) so dark UI elements still read clearly. */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(80% 50% at 90% 100%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg-0);
  min-height: 100vh;
}

#app {
  max-width: 540px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#topbar[hidden] { display: none; }
/* The user card (avatar/name/ID) shows only on the home screen; sub-screens keep
   just the slim app bar (brand + bell + close) so the layout isn't top-heavy. */
#topbar.is-sub .userbar { display: none; }

#screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Screen host: a real flex column. We previously used `display: contents` so
   the wrapper would be invisible to layout, but iOS Safari/WKWebView
   pre-17.4 treats it as `display: none` for some children, hiding the whole
   page in Telegram. A regular flex column keeps every page's spacing
   identical to what #app would have given direct children. */
.screen,
.screen-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* ── Bottom tab bar ──────────────────────────────────────────────────────
   Persistent quick-nav for the dashboard. Fixed to the viewport bottom,
   centered to the same 540px column as #app. Shown only once the dashboard
   mounts (body.has-tabbar) — the auth/login screens never get it. z-index
   sits under the toast (50) and the connect sheet (1000) so both still
   layer above it. */
#tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  max-width: 540px;
  margin: 0 auto;
  padding: 7px 10px calc(var(--safe-bottom) + 7px);
  background: rgba(13, 14, 18, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  border-top: 1px solid var(--line-strong);
}
body.has-tabbar #tabbar { display: flex; }
/* While a text field is focused (keyboard up), hide the nav so the field isn't
   cramped between the keyboard and the bar, and reclaim its reserved space. */
body.kb-open #tabbar { display: none; }
body.has-tabbar.kb-open #app { padding-bottom: calc(var(--safe-bottom) + 8px); }
/* Reserve room so the last card / footer never hides under the fixed bar. */
body.has-tabbar #app { padding-bottom: calc(var(--safe-bottom) + 80px); }
/* Lift the bottom-anchored toast and the sticky support input above the bar. */
body.has-tabbar .toast { bottom: calc(var(--safe-bottom) + 92px); }
body.has-tabbar .chat-input { bottom: calc(var(--safe-bottom) + 64px); padding-bottom: 8px; }

.tabbar__btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-dim);
  transition: color 0.15s ease, transform 0.12s ease;
}
.tabbar__btn[hidden] { display: none; }
.tabbar__btn:active { transform: scale(0.93); }
.tabbar__ic { width: 25px; height: 25px; }
.tabbar__ic svg { width: 100%; height: 100%; display: block; }
.tabbar__lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.tabbar__btn.is-active { color: var(--amber-soft); }
.tabbar__btn.is-active .tabbar__ic { filter: drop-shadow(0 0 7px var(--amber-glow)); }

a { color: var(--amber-soft); text-decoration: none; }
a:active { opacity: 0.7; }

button {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}

input, select, textarea {
  font: inherit; color: inherit;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); }

.muted { color: var(--text-muted); font-size: 13.5px; }

/* ── Bootstrap (loading) ────────────────────────────────────────────────── */
.bootstrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-0);
  z-index: 100;
}
.bootstrap__spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--amber);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App bar / user bar ─────────────────────────────────────────────────── */
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px;
}
.appbar__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: 0.2px;
}
.brand-mark {
  display: block;
  width: 32px; height: 32px;
  border-radius: 9px;
  object-fit: cover;
  /* The bat logo has its own gradient/glow baked in — drop the previous
     amber tile background and instead give the image a subtle outer shadow
     so it lifts off the topbar like an app icon. */
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.brand-name { font-size: 16px; }
.appbar__actions { display: flex; align-items: center; gap: 8px; }
.appbar__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 22px; line-height: 1;
}
.appbar__close:active { background: var(--bg-3); }
.appbar__bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.appbar__bell:active { background: var(--bg-3); }
.appbar__bell-icon {
  /* Outlined bell SVG — uses currentColor so it inherits the violet accent.
     Matches the line-style of system icons; cleaner than the warm 🔔 emoji
     which clashed with the cool violet/cyan palette. */
  width: 18px; height: 18px;
  color: var(--amber);
  display: block;
}
.appbar__badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-0);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}
/* The HTML `hidden` attribute would normally hide via UA `display: none`, but
   our explicit `display: flex` above wins on specificity. Restate the rule
   with the [hidden] selector so the badge actually disappears at zero. */
.appbar__badge[hidden] { display: none; }

.userbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.userbar__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-weight: 600;
}
.userbar__main { flex: 1; min-width: 0; }
.userbar__name {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.userbar__id { color: var(--text-dim); font-size: 12.5px; }
.userbar__badge {
  font-size: 11.5px;
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

/* ── Subscription card ──────────────────────────────────────────────────── */
.subscription { display: flex; flex-direction: column; gap: 12px; }
.sub-head {
  display: flex; align-items: center; justify-content: space-between;
}
.sub-head__id { color: var(--text-dim); font-size: 12px; letter-spacing: 0.5px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
}
.pill__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}
.pill--ok { color: var(--ok); background: rgba(52, 211, 153, 0.10); }
.pill--off { color: var(--text-muted); background: rgba(255, 255, 255, 0.04); }
.pill--warn { color: var(--warn); background: rgba(249, 115, 22, 0.12); }

.sub-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.sub-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 76px;
  display: flex; flex-direction: column; justify-content: center;
}
.sub-cell--full { grid-column: 1 / -1; }
.sub-cell__label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.sub-cell__value { font-weight: 600; font-size: 15px; }
.sub-cell__value--big { font-size: 26px; line-height: 1; letter-spacing: -0.5px; }

.sub-progress {
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.sub-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-soft) 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub-empty { color: var(--text-muted); }
.sub-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* «Обходы» metered-traffic block on the subscription card (SVG-iconed). */
.obhody {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.obhody__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.obhody__ic { width: 18px; height: 18px; color: var(--amber-soft); display: inline-flex; }
.obhody__ic svg { width: 100%; height: 100%; }
.obhody__title { font-size: 13px; font-weight: 600; }
.obhody__note { font-size: 13px; color: var(--amber-soft); }
.obhody__meter { height: 8px; background: var(--bg-1); border-radius: 999px; overflow: hidden; }
.obhody__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber) 0%, var(--accent2) 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.obhody__fill--over { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }
.obhody__stat { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.5px; }
.obhody__used { font-weight: 600; }
.obhody__left { color: var(--text-dim); }
.obhody__left--over { color: #f87171; }
.obhody__buyhint { margin-top: 12px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-dim); }
.obhody__packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.obhody-pack {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: inherit; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.obhody-pack:active { transform: scale(0.97); }
.obhody-pack:hover { border-color: var(--amber); }
.obhody-pack__ic { width: 16px; height: 16px; color: var(--amber-soft); display: inline-flex; }
.obhody-pack__ic svg { width: 100%; height: 100%; }
.obhody-pack__gb { font-size: 13px; font-weight: 700; }
.obhody-pack__price { font-size: 11.5px; color: var(--text-dim); }

/* Ultra upsell banner inside the обходы card — violet-glow "featured" strip shown
   above the buy-more packs to non-Ultra subscribers (economy framing). */
.obhody-upsell {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  margin-top: 12px; padding: 11px 12px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(34, 211, 238, 0.10) 100%);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12) inset, 0 10px 26px rgba(139, 92, 246, 0.14);
  color: inherit; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.obhody-upsell:hover { border-color: var(--amber-soft); box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.22) inset, 0 14px 32px rgba(139, 92, 246, 0.22); }
.obhody-upsell:active { transform: scale(0.99); }
.obhody-upsell__ic {
  flex: 0 0 auto; width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, var(--amber) 0%, var(--accent2) 100%);
  box-shadow: 0 6px 16px var(--amber-glow);
}
.obhody-upsell__ic svg { width: 17px; height: 17px; }
.obhody-upsell__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.obhody-upsell__title { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.obhody-upsell__tag { margin-left: 6px; font-size: 10px; font-weight: 600; color: var(--amber-soft); background: rgba(139, 92, 246, 0.16); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.obhody-upsell__sub { font-size: 12px; color: var(--text-muted); line-height: 1.25; }
.obhody-upsell__arrow { flex: 0 0 auto; color: var(--amber-soft); font-size: 18px; font-weight: 700; }

/* Happ setup memo — collapsible "⚙️ Настройка Happ" disclosure under the copy-link
   button. Collapsed by default; tap the summary row to expand. */
.setup-memo {
  margin-top: 12px;
  padding: 0;                      /* padding lives on the summary / body */
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-glow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;                /* clip summary tap-highlight to the rounded card */
}
.setup-memo > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.setup-memo > summary::-webkit-details-marker { display: none; }  /* Safari/iOS default triangle */
.setup-memo > summary::marker { content: ''; }
.setup-memo__ttl { min-width: 0; }
.setup-memo__chev {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform .2s ease;
}
.setup-memo[open] > summary .setup-memo__chev { transform: rotate(90deg); }
.setup-memo__body { padding: 0 14px 12px; }
.setup-memo b { color: var(--text); font-weight: 700; }
.setup-memo i { color: var(--amber-soft); font-style: normal; font-size: 12px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
  font-size: 14.5px;
}
.btn:active { transform: scale(0.985); }
.btn__glyph { font-weight: 400; opacity: 0.9; }
.btn--wide { width: 100%; }
.btn--sm { padding: 8px 12px; font-size: 13px; margin-top: 8px; }

.btn--primary {
  /* Brand gradient: violet → cyan, mirroring the logo. */
  background: linear-gradient(135deg, var(--amber) 0%, var(--accent2) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 22px var(--amber-glow);
}
.btn--primary:disabled { opacity: 0.5; box-shadow: none; }

.btn--ghost {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:active { background: var(--bg-3); }

.btn--danger {
  background: rgba(239, 68, 68, 0.10);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ── CTA block (продлить) ───────────────────────────────────────────────── */
.cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px;
  border-radius: var(--radius);
  font-weight: 600; font-size: 16px;
  cursor: pointer;
  border: 1px solid transparent;
}
.cta--primary {
  /* Hero CTA wears the full brand gradient — violet→cyan exactly like the
     logo's left-to-right color flow. White text reads cleanly across both
     ends; the saturated shadow lifts it visibly off the dark background. */
  background: linear-gradient(135deg, var(--amber) 0%, #7c3aed 45%, var(--accent2) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.cta__arrow {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ── Balance ────────────────────────────────────────────────────────────── */
.balance { display: flex; flex-direction: column; gap: 4px; }
.balance__label { color: var(--text-dim); font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; }
.balance__value { font-weight: 700; font-size: 30px; letter-spacing: -0.5px; }
.balance__cur { color: var(--text-muted); font-weight: 500; font-size: 16px; margin-left: 4px; }
.balance__hint { color: var(--text-dim); font-size: 12.5px; }

/* ── Tile grid ──────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
}
.tile:active { background: var(--bg-2); transform: scale(0.99); }
.tile__icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-size: 18px; font-weight: 600;
}
.tile__icon svg { width: 20px; height: 20px; display: block; }
.tile__label { font-size: 13.5px; color: var(--text); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 6px;
  padding-top: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}
.footer__row { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.footer__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.footer__warrant { color: var(--text-dim); }

/* ── Page heads ─────────────────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: center; gap: 10px; margin-top: 2px;
}
.page-head h1 { font-size: 19px; font-weight: 600; margin: 0; }
.back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.back:active { background: var(--bg-3); }

/* ── Tariffs ────────────────────────────────────────────────────────────── */
.tariffs { display: flex; flex-direction: column; gap: 10px; }
.tariff {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.tariff--featured {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.18) inset, 0 18px 50px rgba(139, 92, 246, 0.08);
}
.tariff__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.tariff__name { font-weight: 600; font-size: 16px; }
.tariff__meta { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.tariff__price { text-align: right; font-weight: 700; font-size: 22px; letter-spacing: -0.4px; }
.tariff__cur { color: var(--text-muted); font-size: 14px; margin-left: 4px; font-weight: 500; }
.tariff__desc { color: var(--text-muted); font-size: 13.5px; }
/* «Обходы» allowance feature lines under the tariff description (SVG icons). */
.tariff__feats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tariff__feat { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.tariff__feat-ic { flex: 0 0 auto; width: 16px; height: 16px; color: var(--amber-soft); display: inline-flex; }
.tariff__feat-ic svg { width: 16px; height: 16px; }
.tariff__feat-tx { line-height: 1.3; }

/* Package picker — «Базовый» / «Семейный» cards shown before the plan list. */
.tariff-cats { display: flex; flex-direction: column; gap: 10px; }
.tariff-cat {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: inherit; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.tariff-cat:active { transform: scale(0.99); }
.tariff-cat__icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--amber-glow);
  color: var(--amber);
}
.tariff-cat__icon svg { width: 24px; height: 24px; }
.tariff-cat__body { flex: 1 1 auto; min-width: 0; }
.tariff-cat__name { font-weight: 600; font-size: 16px; }
.tariff-cat__meta { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.tariff-cat__arrow { flex: none; color: var(--text-muted); font-size: 20px; line-height: 1; }

/* ── Checkout ───────────────────────────────────────────────────────────── */
.checkout { display: flex; flex-direction: column; gap: 12px; }
.checkout__row {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-muted);
}
.checkout__row strong { color: var(--text); }
.checkout__row--total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.checkout__providers { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
/* Device stepper on the Ultra checkout (− N +). */
.devstep { display: inline-flex; align-items: center; gap: 10px; }
.devstep__btn {
  width: 32px; height: 32px; border-radius: 10px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong);
}
.devstep__btn:active { background: var(--bg-3); }
.devstep__n { min-width: 24px; text-align: center; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.devstep__hint { font-size: 11.5px; color: var(--text-dim); margin-top: -2px; }
.checkout__row strong.checkout__save { color: #34d399; }
.checkout__promo {
  display: flex; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.checkout__promo input { background: transparent; border: 0; padding: 6px 8px; }
.checkout__promo input:focus { border: 0; }
.checkout__promo button { padding: 8px 12px; font-size: 13.5px; }

/* ── Locations ──────────────────────────────────────────────────────────── */
.locations { display: flex; flex-direction: column; gap: 8px; }
.location {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.location__title { font-weight: 600; }
.location__cities { color: var(--text-muted); font-size: 12.5px; }
.location__btn {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--amber-soft);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
}
.location__current { color: var(--ok); font-size: 12.5px; }

.account-picker {
  display: flex; flex-direction: column; gap: 8px;
}
.account-picker__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  cursor: pointer;
}
.account-picker__row.is-active {
  border-color: var(--amber);
  background: rgba(139, 92, 246, 0.05);
}
.account-picker__title { font-weight: 600; }
.account-picker__sub { color: var(--text-muted); font-size: 12.5px; }

/* ── Devices ────────────────────────────────────────────────────────────── */
.devices { display: flex; flex-direction: column; gap: 8px; }
.device {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.device__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2);
  color: var(--amber);
  font-size: 16px;
}
.device__main { flex: 1; min-width: 0; }
.device__name {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device__sub { color: var(--text-muted); font-size: 12.5px; }
.device__right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; flex: 0 0 auto;
}
.device__blocked-tag {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: lowercase;
}
.device__remove {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.device__remove:active { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.device.is-blocked .device__name { text-decoration: line-through; color: var(--text-muted); }
.device.is-online {
  border-color: rgba(52, 211, 153, 0.30);
}
.device.is-online .device__icon {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.40);
}
.device__online {
  color: var(--ok);
  font-size: 12.5px;
  margin-top: 4px;
}
.device__ip {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.device__seen {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.device__pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.device__pill--online {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.10);
}

/* ── Payments ───────────────────────────────────────────────────────────── */
.payments { display: flex; flex-direction: column; gap: 8px; }
.payment {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.payment__main { min-width: 0; }
.payment__title {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.payment__sub { color: var(--text-muted); font-size: 12.5px; }
.payment__right { text-align: right; }
.payment__amount { font-weight: 700; }
.payment__status { font-size: 12px; color: var(--text-muted); }
.payment__status--paid { color: var(--ok); }
.payment__status--failed { color: var(--bad); }
.payment__status--pending { color: var(--amber-soft); }

/* ── Referrals ──────────────────────────────────────────────────────────── */
.referrals { display: flex; flex-direction: column; gap: 14px; }
.referrals__count { text-align: center; }
.referrals__big { font-size: 44px; font-weight: 700; color: var(--amber); letter-spacing: -1px; }
.referrals__caption { color: var(--text-muted); font-size: 13px; }
.referrals__link { display: flex; gap: 8px; margin: 12px 0 10px; }
.referrals__link input { flex: 1; }

/* Money hero — gradient wallet card (revenue-share / withdrawal users). */
.ref-hero {
  border-radius: var(--radius); padding: 22px 18px 18px; text-align: center; color: #fff;
  background: linear-gradient(140deg, #7c3aed 0%, var(--amber) 42%, var(--accent2) 118%);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
.ref-hero__lbl { font-size: 12.5px; font-weight: 600; opacity: 0.92; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.ref-hero__ic { display: inline-flex; }
.ref-hero__ic svg { width: 15px; height: 15px; display: block; }
.ref-hero__amt { font-size: 46px; font-weight: 800; letter-spacing: -1.6px; margin: 6px 0 2px; line-height: 1.05; }
.ref-hero__cur { font-size: 26px; font-weight: 700; opacity: 0.85; }
.ref-hero__sub { font-size: 12.5px; opacity: 0.85; margin-bottom: 16px; }
.ref-hero__note { font-size: 13px; opacity: 0.92; margin-bottom: 14px; }
/* Translucent white button that reads cleanly on the gradient hero. */
.btn--light { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.30);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.btn--light:active { background: rgba(255, 255, 255, 0.24); }
/* Icon (SVG) inside a button, before its label (e.g. withdrawal method picker). */
.btn__ic { display: inline-flex; align-items: center; flex: none; }
.btn__ic svg { width: 18px; height: 18px; display: block; }

/* Metric grid — 2 columns (2 or 4 cells). */
.ref-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.ref-metric {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 14px; box-shadow: var(--shadow-card);
}
.ref-metric__n { font-size: 25px; font-weight: 800; letter-spacing: -0.8px; color: var(--text); }
.ref-metric__n.acc {
  background: linear-gradient(120deg, var(--amber-soft), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ref-metric__k { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Withdrawal history rows. */
.wd-list { display: flex; flex-direction: column; }
.wd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line); }
.wd-row:first-child { border-top: 0; }
.wd-row__l { min-width: 0; }
.wd-row__amt { font-weight: 700; font-size: 14.5px; }
.wd-row__meth { font-size: 11.5px; color: var(--text-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.wd-row__r { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wd-row__date { font-size: 11px; color: var(--text-dim); }
.wd-st { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.wd-st--paid { color: var(--ok); background: rgba(52, 211, 153, 0.10); }
.wd-st--proc { color: var(--amber-soft); background: rgba(139, 92, 246, 0.14); }
.wd-st--rej { color: #fca5a5; background: rgba(239, 68, 68, 0.12); }
.wd-st--neutral { color: var(--text-muted); background: rgba(154, 160, 177, 0.10); }

/* ── Invited people list ──────────────────────────────────────────────── */
.referrals-list { margin-top: 12px; }
.referrals-list__title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.invitee-list { display: flex; flex-direction: column; gap: 8px; }
.invitee {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg-2);
}
.invitee__info { min-width: 0; }
.invitee__name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invitee__date { font-size: 12px; margin-top: 2px; }
.invitee__badge {
  flex: none; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.invitee__badge--paid { color: var(--ok); background: rgba(52, 211, 153, 0.10); }
.invitee__badge--pending { color: var(--text-muted); background: rgba(154, 160, 177, 0.10); }

/* ── Promo ──────────────────────────────────────────────────────────────── */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { color: var(--text-muted); font-size: 12.5px; }
.promo-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
}
.promo-result--ok { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.05); }
.promo-result--bad { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.05); color: #fca5a5; }

/* ── Chat / support ─────────────────────────────────────────────────────── */
.chat {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 240px;
  padding-bottom: 8px;
}
.chat__msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}
.chat__msg--mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--amber) 0%, var(--accent2) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  border-color: transparent;
}
.chat__msg--admin { align-self: flex-start; }
.chat__time {
  font-size: 11px; color: var(--text-dim);
  margin-top: 3px; padding: 0 4px;
}
.chat__msg--mine + .chat__time { text-align: right; }
.chat__empty { color: var(--text-muted); text-align: center; padding: 18px 0; }
.chat-input {
  position: sticky; bottom: 0;
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-0);
  padding: 10px 0 calc(var(--safe-bottom) + 6px);
}
.chat-input input[type=text],
.chat-input input:not([type]) { flex: 1; }
.chat-input .btn { padding: 12px 16px; }
.chat-input__attach {
  flex: 0 0 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.chat-input__attach:hover { background: var(--bg-3); }
.chat-input__attach svg { width: 20px; height: 20px; display: block; }
.chat-input .chat-input__send { flex: 0 0 auto; height: 46px; padding: 0 18px; }
.chat-input__send svg { width: 20px; height: 20px; display: block; }

/* ── Support: full-height chat so the input pins to the bottom ───────────── */
/* Fill the whole viewport column (no magic numbers): #app → #screen → stage →
   .chat all flex-grow, so the input lands at the natural bottom above the tab bar
   instead of floating mid-screen after a short message list. */
/* DEFINITE height (not min-height) so the flex chain is bounded and .chat becomes a
   real internal scroll region — otherwise a long thread makes #app grow to content,
   the whole page scrolls, and the static input drops below the fold. */
body.support-mode #app { height: 100vh; height: 100dvh; }
body.support-mode #screen,
body.support-mode .screen-stage { flex: 1 1 auto; min-height: 0; }
body.support-mode .chat { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
body.support-mode .chat-input { position: static; bottom: auto; margin-top: 6px;
  padding: 10px 0 calc(var(--safe-bottom) + 6px); border-top: 1px solid var(--line); }

/* Round mascot avatar for «Ассистент Бэтти». */
.chat-av { border-radius: 50%; object-fit: cover; flex: none;
  background: #05060a; border: 1px solid rgba(139, 92, 246, 0.4); }

.chat-bannerhost:empty { display: none; }
.chat-banner { display: flex; gap: 10px; align-items: center; font-size: 12.5px;
  color: var(--text-muted); line-height: 1.35; padding: 9px 11px; margin-top: 2px;
  border-radius: 12px; background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.22); }
.chat-banner__txt { min-width: 0; }
.chat-banner__av { width: 30px; height: 30px; }

/* Empty state — mascot centered. The min-height:100% wrapper centers when there's
   room but grows + lets .chat scroll (no top/bottom clipping) when the keyboard
   shrinks the area — bulletproof across browsers (no reliance on `safe` alignment). */
.chat-emptywrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 12px 0; }
.chat-empty__av { width: 64px; height: 64px; }
.chat-empty__t { font-size: 14px; color: var(--text-muted); max-width: 240px; line-height: 1.5; }

/* AI (Бэтти) row: avatar + name + bubble. */
.chat-airow { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; max-width: 90%; }
.chat-airow__av { width: 32px; height: 32px; }
.chat-airow__col { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.chat-airow__name { font-size: 11px; font-weight: 600; color: var(--amber-soft); margin-bottom: 3px; padding-left: 2px; }
.chat-airow__col .chat__msg { max-width: 100%; }
.chat-airow__col .chat__time { padding-left: 2px; }
.chat__msg--ai { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-airow--typing { opacity: 0.75; }

/* System line (assignment / close notices). */
.chat__sys { text-align: center; font-size: 12px; color: var(--text-dim); margin: 8px 0; }
.chat__msg img.chat__photo,
.chat__msg video.chat__photo {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  margin: -2px -4px 6px;
  cursor: zoom-in;
}
.chat__msg video.chat__photo { width: 240px; cursor: default; background: #000; }
.chat__msg--mine img.chat__photo,
.chat__msg--mine video.chat__photo { box-shadow: 0 1px 3px rgba(0,0,0,0.25); }

/* ── Support attachment upload progress (video/photo) ────────────────────── */
.chat__msg--uploading { min-width: 190px; }
.chat__uplabel { font-weight: 700; }
.chat__upbar {
  height: 6px; border-radius: 4px; margin-top: 8px; overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}
.chat__upbar-fill {
  height: 100%; width: 0%; border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  transition: width 0.18s ease;
}
.chat__uppct { font-size: 12px; margin-top: 4px; opacity: 0.95; }
.chat__msg--processing .chat__upbar-fill {
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.35) 25%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0.35) 75%);
  background-size: 200% 100%;
  animation: chat-up-shimmer 1s linear infinite;
}
@keyframes chat-up-shimmer { to { background-position: -200% 0; } }

/* ── About ──────────────────────────────────────────────────────────────── */
.about h2 { margin: 0 0 8px 0; font-size: 18px; }
.about ul { padding-left: 18px; margin: 8px 0; color: var(--text-muted); }
.about li { margin: 4px 0; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%;
  bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(40px);
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 50;
  max-width: 80%;
  text-align: center;
}
.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Notifications ──────────────────────────────────────────────────────── */
.notifications { display: flex; flex-direction: column; gap: 8px; }
.notification {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.notification.is-unread {
  border-color: rgba(139, 92, 246, 0.30);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.05), var(--bg-1) 60%);
}
.notification__icon {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 10px;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber);
  font-size: 16px;
  border: 1px solid var(--line-strong);
}
.notification__main { flex: 1; min-width: 0; }
.notification__title {
  font-weight: 600; font-size: 14.5px;
}
.notification__body {
  color: var(--text-muted); font-size: 13px;
  margin-top: 2px;
  word-wrap: break-word;
}
.notification__time {
  color: var(--text-dim); font-size: 11.5px;
  margin-top: 4px;
}
.notification__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  margin-top: 6px; flex: 0 0 8px;
}
.page-head__action {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--amber-soft);
  font-size: 12.5px; font-weight: 500;
}
.page-head__action:active { background: var(--bg-3); }

/* ── Empty / placeholders ───────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}

/* ── Connect device (platform tiles) ────────────────────────────────────── */
.connect {
  margin-top: 4px;
  padding: 14px 14px 12px;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.05), transparent 60%), var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.connect__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.connect__reco {
  margin-bottom: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  background: var(--amber-glow);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 12px;
}
.connect__reco b { color: var(--text); font-weight: 700; }
.connect__tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.platform-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 16px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.platform-tile:active { background: var(--bg-3); transform: scale(0.98); }
.platform-tile__icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-size: 18px; font-weight: 600;
}
.platform-tile__icon svg {
  width: 20px; height: 20px;
  display: block;
  /* SVGs use fill="currentColor" so they inherit the amber color above. A
     subtle drop-shadow gives them parity with the rest of the amber accents
     in the app (the bell, brand mark) which sit on the same dark gradient. */
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.18));
}
.platform-tile__label { font-size: 13px; color: var(--text); font-weight: 500; }

/* ── Bottom sheet (connect wizard) ──────────────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  opacity: 0;
  transition: opacity 220ms ease;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.sheet-overlay.is-open { opacity: 1; }
.sheet {
  background: var(--bg-1);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 8px 18px calc(var(--safe-bottom) + 22px);
  transform: translateY(100%);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 88vh;
  overflow-y: auto;
}
.sheet-overlay.is-open .sheet { transform: translateY(0); }
.sheet__grab {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: 6px auto 14px;
}
.sheet__title {
  text-align: center;
  font-size: 17px; font-weight: 600;
  margin-bottom: 16px;
}
.sheet__step {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.sheet__stores { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.store-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.store-row:active { background: var(--bg-3); }
.store-row__icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex: 0 0 30px;
}
.store-row__label { flex: 1; font-size: 14px; color: var(--text); }
.store-row__arrow { color: var(--text-dim); font-size: 14px; }
.auto-setup {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 16px 16px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--accent2) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  border: 0; border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 12px;
}
.auto-setup:active { transform: scale(0.99); }
.auto-setup__icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  color: #fff;
}
.auto-setup__label { flex: 1; text-align: left; font-weight: 600; font-size: 15px; }
.auto-setup__arrow { font-weight: 600; }
.sheet__hint {
  margin: 6px 0 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 6px;
}
.sheet__actions .btn {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px;
}

/* ── Setup guide («Инструкция») ─────────────────────────────────────────── */
.guide-intro { color: var(--text-muted); font-size: 14px; margin: 2px 2px 14px; }
.guide-devices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-device {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 14px; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  color: var(--text); cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.guide-device:active { transform: scale(0.98); background: var(--bg-2); }
.guide-device__icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; background: var(--amber-glow); color: var(--amber-soft);
}
.guide-device__icon svg { width: 28px; height: 28px; }
.guide-device__name { font-size: 17px; font-weight: 700; }
.guide-device__sub { font-size: 12px; color: var(--text-dim); font-family: ui-monospace, SFMono-Regular, monospace; }

.guide-head { display: flex; align-items: center; gap: 12px; }
.guide-head__icon {
  width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--amber-glow); color: var(--amber-soft);
}
.guide-head__icon svg { width: 26px; height: 26px; }
.guide-head__name { font-size: 22px; font-weight: 800; line-height: 1.1; }
.guide-head__sub { font-size: 12px; color: var(--text-dim); font-family: ui-monospace, SFMono-Regular, monospace; margin-top: 2px; }

.guide-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.guide-step {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.guide-step.is-open { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-glow); }
.guide-step__head {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 15px 16px; background: none; border: 0; color: var(--text); cursor: pointer; text-align: left;
}
.guide-step__num {
  flex-basis: 100%; font-size: 11px; letter-spacing: 2px; color: var(--amber-soft);
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.guide-step__title { font-size: 16px; font-weight: 700; flex: 1; }
.guide-step__chev { color: var(--text-dim); transition: transform .2s; font-size: 18px; }
.guide-step.is-open .guide-step__chev { transform: rotate(180deg); }
.guide-step__body { display: none; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.guide-step.is-open .guide-step__body { display: block; }
.guide-step__text { color: var(--text-muted); font-size: 14px; line-height: 1.55; margin: 0 0 4px; }
.guide-dl {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; margin-top: 10px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--accent2) 100%);
  color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.guide-dl:active { transform: scale(0.99); }
.guide-dl__arrow { opacity: .85; }

/* ── Channel-bonus promo banner on the Тарифы screen ────────────────────── */
.bonus-banner {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(34, 211, 238, 0.10));
  border: 1px solid var(--amber); border-radius: var(--radius);
  color: var(--text); cursor: pointer; text-align: left;
  transition: transform .12s;
}
.bonus-banner:active { transform: scale(0.99); }
.bonus-banner__icon {
  width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--amber-glow); color: var(--amber-soft);
}
.bonus-banner__icon svg { width: 22px; height: 22px; }
.bonus-banner__text { flex: 1; min-width: 0; }
.bonus-banner__title { font-size: 15px; font-weight: 700; }
.bonus-banner__sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.bonus-banner__arrow { color: var(--amber-soft); font-size: 18px; flex: none; }
/* Survey banner: slightly warmer accent so it reads as a reward prompt. */
.survey-banner { background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(139, 92, 246, 0.10)); }

/* ── Service-quality survey (#/survey) ───────────────────────────────────── */
.survey-row {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.survey-row__label { font-size: 15px; font-weight: 700; color: var(--text); }
.survey-row__hint { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 10px; line-height: 1.35; }
.survey-stars { display: flex; gap: 6px; }
.survey-star {
  appearance: none; border: none; background: none; cursor: pointer;
  font-size: 32px; line-height: 1; color: var(--line-strong); padding: 2px 4px;
  transition: color .12s, transform .12s;
}
.survey-star:active { transform: scale(1.15); }
.survey-star.is-on { color: var(--amber-soft); }
.survey-done__emoji { font-size: 44px; text-align: center; margin-top: 6px; }
.survey-done__title { font-size: 18px; font-weight: 800; text-align: center; margin-top: 6px; color: var(--text); }
.survey-done__sub { font-size: 13.5px; color: var(--text-muted); text-align: center; margin-top: 6px; line-height: 1.4; }
/* Reassurance callout — soft "ok"/green tint so honest (incl. low) ratings feel safe */
.survey-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: var(--radius-sm); padding: 11px 13px; margin: 0 2px 16px;
}
.survey-note__icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.survey-note__text { font-size: 12.5px; color: var(--text); line-height: 1.42; }
.survey-note__text b { color: var(--ok); font-weight: 700; }

/* ── Outage report (#/report) ─────────────────────────────────────────────── */
.report-intro { color: var(--text-muted); font-size: 13.5px; margin: 2px 2px 16px; }
.report-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.report-chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.report-chip.is-active {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--text);
}
.report-text {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  min-height: 96px;
  margin-bottom: 16px;
}

/* ── Browser email auth screens (non-Telegram) ─────────────────────────── */
.auth { max-width: 720px; margin: 0 auto; padding: 24px 4px 60px; }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 20px; font-weight: 800; font-size: 19px; }
.auth__brand img { width: 34px; height: 34px; border-radius: 10px; }
.auth__brandtext { background: linear-gradient(135deg, var(--amber), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__card { padding: 22px 20px; }
.auth__title { font-size: 21px; margin: 0 0 6px; }
.auth__sub { margin: 0 0 14px; }
.auth__label { display: block; font-size: 13px; color: var(--text-muted); margin: 12px 0 6px; }
.auth__input {
  width: 100%; padding: 12px 13px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: 15px; outline: none; transition: border-color .15s;
}
.auth__input:focus { border-color: var(--amber); }
.auth__err { color: var(--bad); font-size: 13px; min-height: 16px; margin-top: 12px; }
.auth__links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; }
.auth__link { color: var(--amber-soft); cursor: pointer; }
.auth__link:hover { text-decoration: underline; }
.auth__consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.45; margin: 14px 0 2px; }
.auth__consent input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--amber); }

/* ════════════════════════════════════════════════════════════════════════
   Responsive — website (battunnel.com) only, scoped to `body.is-browser`
   (set by app.js when NOT running inside Telegram). The Telegram Mini App
   webview is intentionally left at the mobile-first base at EVERY width, so
   none of this touches the in-Telegram experience. These rules give the
   browser site a comfortable centered "app window" with desktop hover
   affordances, two-up tariff cards on wide screens, and tidy spacing on very
   small phones. No transform/backdrop-filter on #app — it would turn #app
   into the containing block for the fixed bootstrap loader.
   ════════════════════════════════════════════════════════════════════════ */

/* Desktop pointer affordances — the base UI only has :active (touch) states. */
@media (hover: hover) and (pointer: fine) {
  body.is-browser .tile:hover,
  body.is-browser .platform-tile:hover,
  body.is-browser .guide-device:hover { transform: translateY(-2px); border-color: var(--line-strong); }
  body.is-browser .location:hover,
  body.is-browser .device:hover,
  body.is-browser .tariff:hover,
  body.is-browser .store-row:hover,
  body.is-browser .account-picker__row:hover,
  body.is-browser .report-chip:hover { border-color: var(--line-strong); }
  body.is-browser .btn:not(:disabled):hover { filter: brightness(1.07); }
  body.is-browser .cta:hover,
  body.is-browser .bonus-banner:hover { filter: brightness(1.05); }
}

/* Tablet & desktop: present the SPA as a centered, framed window. body padding
   guarantees side gutters so the panel always reads as a window, even when the
   max-width isn't reached. */
@media (min-width: 600px) {
  body.is-browser { padding: 32px 20px; }
  body.is-browser #app {
    max-width: 600px;
    padding: 26px 26px 30px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.018);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 40px 90px rgba(0, 0, 0, 0.5);
  }
  body.is-browser .page-head h1 { font-size: 21px; }
  body.is-browser .tile { padding: 22px 12px; }

  /* Auth screens (login / register / reset): the wide dashboard frame around a
     narrow form reads as empty, so drop it and present a single centered card
     (brand + form), vertically centered like a standard login page. */
  /* ONE width source for both login and register so they are always identical.
     #app and .auth share the same cap; .auth fills #app. */
  body.is-browser.auth-mode #app {
    max-width: 720px;
    min-height: calc(100vh - 64px);
    justify-content: center;
    border: 0;
    background: none;
    box-shadow: none;
    padding: 0;
  }
  body.is-browser.auth-mode .auth { width: 100%; max-width: 720px; padding-top: 0; padding-bottom: 0; }
  /* Roomier card + fields on desktop so it doesn't read as a tiny form. */
  body.is-browser.auth-mode .auth__card { padding: 38px 44px; }
  body.is-browser.auth-mode .auth__title { font-size: 26px; }
  body.is-browser.auth-mode .auth__label { font-size: 14px; }
  body.is-browser.auth-mode .auth__input { padding: 15px 16px; font-size: 16px; }
  body.is-browser.auth-mode .auth .btn { padding: 15px 16px; font-size: 16px; }
}

/* Wider desktops: a touch more width and two-up tariff cards. */
@media (min-width: 760px) {
  body.is-browser #app { max-width: 680px; }
  body.is-browser #tabbar { max-width: 680px; }
  body.is-browser .tariffs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
}

/* Small phones (browser): trim edge padding so dense rows never crowd the edge. */
@media (max-width: 360px) {
  body.is-browser #app { padding-left: 12px; padding-right: 12px; }
  body.is-browser .grid { gap: 8px; }
  body.is-browser .tile { padding: 16px 8px; }
}

/* ════════════ Rewards «Награды» (gamified, BatTunnel violet/cyan) ════════════ */
.rw { display: flex; flex-direction: column; gap: 14px; }
.rw-card, .rw-hero, .rw-daily {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.rw-hero {
  position: relative; overflow: hidden; padding: 22px 20px 18px; text-align: center;
  background:
    radial-gradient(120% 90% at 85% -25%, rgba(139,92,246,.22), transparent 60%),
    linear-gradient(180deg, rgba(139,92,246,.07), rgba(139,92,246,.01)), var(--bg-2);
  border-color: rgba(139,92,246,.35);
}
.rw-hero__label { font-size: 12px; letter-spacing: 2.5px; color: #a78bfa; font-weight: 700; }
.rw-hero__points { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0 16px; color: #fff; }
.rw-pills { display: flex; gap: 10px; justify-content: center; }
.rw-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 14px; }
.rw-pill__k { color: var(--text-muted); }
.rw-pill__v { color: #a78bfa; font-weight: 800; }
.rw-daily { display: flex; align-items: center; gap: 14px; padding: 16px; }
.rw-daily.is-active { border-color: rgba(139,92,246,.5);
  background: linear-gradient(180deg, rgba(139,92,246,.10), transparent 70%), var(--bg-2); }
.rw-daily__ic { font-size: 28px; width: 48px; height: 48px; flex: none; display: flex; align-items: center;
  justify-content: center; border-radius: 14px; background: rgba(139,92,246,.12); }
.rw-daily__txt { flex: 1; min-width: 0; }
.rw-daily__title { font-weight: 700; font-size: 16px; }
.rw-daily__sub { color: #a78bfa; font-size: 14px; font-weight: 600; margin-top: 1px; }
.rw-daily__got { color: #34d399; font-size: 22px; font-weight: 800; padding-right: 8px; }
button.btn.rw-claim { background: #8b5cf6; color: #ffffff; font-weight: 800; border: none;
  border-radius: 12px; padding: 12px 22px; box-shadow: 0 6px 18px rgba(139,92,246,.3); }
button.btn.rw-claim:active { transform: translateY(1px); }
.rw-card { padding: 4px 16px 8px; }
.rw-card__head { display: flex; align-items: center; gap: 10px; padding: 14px 0 8px; }
.rw-card__ic { font-size: 18px; width: 34px; height: 34px; flex: none; display: flex; align-items: center;
  justify-content: center; border-radius: 10px; background: rgba(255,255,255,.05); }
.rw-card__title { font-weight: 700; font-size: 17px; }
.rw-card__titlewrap { display: flex; flex-direction: column; }
.rw-card__sub { font-size: 12px; color: var(--text-dim); }
.rw-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.rw-row__info { flex: 1; min-width: 0; }
.rw-row__title { font-weight: 600; font-size: 15px; }
.rw-row__hint { color: var(--text-dim); font-size: 12px; margin-top: 1px; }
/* SVG icons (replace emoji) */
.rw-card__ic svg { width: 18px; height: 18px; color: var(--amber); }
.rw-daily__ic svg { width: 26px; height: 26px; color: var(--amber); }
.rw-pill__ic { display: inline-flex; align-items: center; }
.rw-pill__ic svg { width: 15px; height: 15px; color: var(--amber-soft); }
.rw-daily__got { display: inline-flex; align-items: center; justify-content: center; padding-right: 8px; }
.rw-daily__got svg { width: 24px; height: 24px; }
.rw-ic { display: inline-flex; align-items: center; }
.rw-ic svg { width: 14px; height: 14px; }
.rw-row__done, .rw-row__pend { display: inline-flex; align-items: center; gap: 5px; }
.rw-row__done svg, .rw-row__pend svg { width: 14px; height: 14px; }
.rw-row__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rw-row__pts { color: #a78bfa; font-size: 13px; font-weight: 600; margin-top: 2px; }
.rw-row__pts.is-dim { color: var(--text-dim); }
.rw-row__done { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.rw-row__pend { color: #a78bfa; font-size: 13px; white-space: nowrap; }
.rw-row__prog { color: var(--text-muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.rw-sep { height: 1px; background: var(--line); }
button.btn.rw-mini { background: rgba(139,92,246,.14); color: #a78bfa; border: 1px solid rgba(139,92,246,.4);
  border-radius: 10px; padding: 8px 16px; font-weight: 700; font-size: 14px; white-space: nowrap; }
button.btn.rw-buy { background: #8b5cf6; color: #ffffff; border: none; border-radius: 10px;
  padding: 8px 18px; font-weight: 800; white-space: nowrap; }
button.btn.rw-buy.is-off { background: rgba(255,255,255,.06); color: var(--text-dim); box-shadow: none; }
.rw-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.rw-bar__fill { height: 100%; background: linear-gradient(90deg, #8b5cf6, #22d3ee); border-radius: 3px; }
.rw-form { display: flex; gap: 8px; padding: 4px 0 10px; }
.rw-input { flex: 1; }
.rw-cal__wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.rw-cal__wdc { text-align: center; font-size: 11px; color: var(--text-dim); }
.rw-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-bottom: 8px; }
.rw-cal__cell { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 13px; color: var(--text-muted); background: rgba(255,255,255,.03); }
.rw-cal__cell.is-pad { background: none; }
.rw-cal__cell.is-on { background: #8b5cf6; color: #ffffff; font-weight: 800; }
.rw-cal__cell.is-today { outline: 2px solid #8b5cf6; outline-offset: -2px; color: #fff; }
.rw-cal__cell.is-on.is-today { color: #ffffff; }

/* ── User level / rank («Ранг стаи») ── */
.rw-level { display: block; width: 100%; text-align: left; margin-bottom: 16px; padding: 14px 14px 12px;
  border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.rw-level:active { transform: scale(.99); }
.rw-level__chev { color: var(--text-dim); font-size: 22px; line-height: 1; align-self: center; }
.rw-level__top { display: flex; align-items: center; gap: 12px; }
.rw-level__meta { flex: 1; min-width: 0; }
.rw-level__name { font-weight: 800; font-size: 17px; color: #fff; }
.rw-level__lvl { font-size: 12px; color: var(--text-muted); margin-top: 1px; letter-spacing: .3px; }
.rw-level__bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); margin-top: 12px; overflow: hidden; }
.rw-level__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8b5cf6, #22d3ee);
  transition: width .5s cubic-bezier(.2,.7,.2,1); }
.rw-level__next { font-size: 12px; color: var(--text-dim); margin-top: 7px; }

/* Rank badge (shield) — color escalates with tier; reused in hero + chips. */
.rw-rankbadge { width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.rw-rankbadge svg { width: 24px; height: 24px; }

/* Home / referrals compact chip */
button.rw-rankchip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
button.rw-rankchip:active { transform: scale(.99); }
.rw-rankchip .rw-rankbadge { width: 38px; height: 38px; border-radius: 11px; }
.rw-rankchip .rw-rankbadge svg { width: 21px; height: 21px; }
.rw-rankchip__txt { flex: 1; min-width: 0; }
.rw-rankchip__name { font-weight: 700; font-size: 15px; color: var(--text); }
.rw-rankchip__sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.rw-rankchip__arrow { color: var(--text-dim); font-size: 18px; }

/* Tier coloring — steel → violet → cyan, with a glow at the prestige cap. */
.rw-rank--l1 .rw-rankbadge { color: #9aa0b1; }
.rw-rank--l2 .rw-rankbadge { color: #a78bfa; border-color: rgba(167,139,250,.4); background: rgba(167,139,250,.10); }
.rw-rank--l3 .rw-rankbadge { color: #8b5cf6; border-color: rgba(139,92,246,.45); background: rgba(139,92,246,.12); }
.rw-rank--l4 .rw-rankbadge { color: #7c3aed; border-color: rgba(124,58,237,.5); background: rgba(124,58,237,.14); }
.rw-rank--l5 .rw-rankbadge { color: #22d3ee; border-color: rgba(34,211,238,.45);
  background: linear-gradient(135deg, rgba(139,92,246,.16), rgba(34,211,238,.16)); }
.rw-rank--l6 .rw-rankbadge { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); box-shadow: 0 0 14px rgba(139,92,246,.45); }
.rw-rank--l5.rw-rankchip, .rw-rank--l6.rw-rankchip,
.rw-rank--l5.rw-level, .rw-rank--l6.rw-level { border-color: rgba(139,92,246,.35); }

/* ── Rank chip in the userbar profile card ── */
.userbar__rank { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; max-width: 100%;
  padding: 2px 9px 2px 7px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.userbar__rank[hidden] { display: none; }
.userbar__rank:active { transform: scale(.97); }
.userbar__rank-ic { display: inline-flex; align-items: center; flex: none; }
.userbar__rank-ic svg { width: 14px; height: 14px; }
.userbar__rank-txt { font-size: 12px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbar__rank.rw-rank--l1 .userbar__rank-ic { color: #9aa0b1; }
.userbar__rank.rw-rank--l2 .userbar__rank-ic { color: #a78bfa; }
.userbar__rank.rw-rank--l3 .userbar__rank-ic { color: #8b5cf6; }
.userbar__rank.rw-rank--l4 .userbar__rank-ic { color: #7c3aed; }
.userbar__rank.rw-rank--l5 .userbar__rank-ic,
.userbar__rank.rw-rank--l6 .userbar__rank-ic { color: #22d3ee; }
.userbar__rank.rw-rank--l5, .userbar__rank.rw-rank--l6 { border-color: rgba(139,92,246,.4); }

/* ── «Все ранги» ladder screen ── */
.ranks-score { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.ranks-intro { color: var(--text-muted); font-size: 13.5px; padding: 0 2px; }
.ranks { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; }
.rank-row.is-locked { opacity: .58; }
.rank-row.is-current { border-color: rgba(139,92,246,.5);
  background: linear-gradient(180deg, rgba(139,92,246,.10), transparent 70%), var(--bg-2); }
.rank-row__info { flex: 1; min-width: 0; }
.rank-row__title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rank-row__cur { font-size: 10px; font-weight: 700; color: #a78bfa; text-transform: uppercase;
  letter-spacing: .5px; background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.4);
  padding: 1px 7px; border-radius: 999px; }
.rank-row__meta { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.rank-row__st { color: var(--text-dim); font-size: 15px; display: inline-flex; align-items: center; flex: none; }
.rank-row__st svg { width: 16px; height: 16px; }
.rank-row__st.is-on { color: #34d399; }
.rank-row__st.is-on svg { width: 18px; height: 18px; }

/* ── «Мои локации» — per-user feed layout (reorder / hide / pin) ───────────── */
.loc-status { min-height: 18px; font-size: 13px; color: var(--text-dim); margin: 2px 2px 8px; transition: color .15s; }
.loc-status--ok { color: var(--ok); }
.loc-status--err { color: var(--bad); }

.loc-list { display: flex; flex-direction: column; gap: 8px; }

.loc-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 10px;
  touch-action: pan-y;
}
.loc-row.is-dragging {
  background: var(--bg-3); border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(0,0,0,.5); opacity: .97;
}
.loc-row.is-hidden { opacity: .48; }
.loc-row.is-pinned { border-color: var(--amber-glow); }
.loc-row--fixed { background: var(--bg-1); border-style: dashed; }

.loc-drag {
  flex: none; width: 26px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.loc-drag:active { cursor: grabbing; }
.loc-drag svg { width: 18px; height: 18px; }
.loc-drag--empty { visibility: hidden; }

.loc-type {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; line-height: 1;
  background: rgba(139,92,246,.16); color: var(--amber-soft);
}
.loc-type--obhod { background: rgba(34,211,238,.16); color: var(--accent2); }
.loc-type--auto  { background: rgba(249,115,22,.16); color: #fbbf24; }
.loc-type--smart { background: rgba(52,211,153,.16); color: var(--ok); }

.loc-title { flex: 1 1 auto; min-width: 0; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loc-pin, .loc-eye {
  flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 9px; color: var(--text-dim); cursor: pointer; padding: 0;
}
.loc-pin svg, .loc-eye svg { width: 19px; height: 19px; }
.loc-pin:active, .loc-eye:active { background: var(--bg-3); }
.loc-pin.is-on { color: var(--amber); }
.loc-pin.is-on svg { fill: var(--amber); }
.loc-eye.is-off { color: var(--text-dim); }
.loc-pin--empty { flex: none; width: 34px; height: 34px; visibility: hidden; }

/* «Сервера»: two-line row main + обход limit sub-label + empty state */
.loc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.loc-main .loc-title { flex: none; }
.loc-sub { font-size: 11.5px; color: var(--accent2); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-empty { text-align: center; padding: 34px 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.loc-empty__ic { font-size: 34px; opacity: .9; }
.loc-empty__t { font-size: 16px; font-weight: 650; color: var(--text); }
.loc-empty__s { font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 300px; }
.loc-empty .btn { margin-top: 12px; max-width: 280px; }

/* «Серверы»: section headers (WiFi / Обходы) */
.loc-body { display: flex; flex-direction: column; gap: 8px; }
.loc-section-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 4px 2px; }
.loc-section-head__t { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); text-transform: uppercase; }
.loc-section-head__s { font-size: 11.5px; color: var(--text-dim); }
.loc-body .loc-list { display: flex; flex-direction: column; gap: 8px; }

/* «Серверы»: divider rows (WiFi / Обходы) — movable & hideable like any row */
.loc-row--div { background: var(--bg-1); border-style: dashed; }
.loc-title--div { color: var(--text-muted); font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
