/* ---------- Токены ---------- */
/* Всегда тёмное фирменное оформление: глубокий синий, кольца, светлые пилюли-кнопки. */
:root {
  --bg: #070B19;
  --bg-2: #0B1430;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-solid: #111A33;
  --line: rgba(255, 255, 255, 0.11);
  --ink: #F1F4FF;
  --muted: #8F9BC2;
  --accent: #3D63FF;
  --accent-2: #6D8BFF;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(61, 99, 255, 0.16);
  --live: #3DDCAA;
  --warn: #F3B34C;
  --bad: #FF6B6B;
  --ring: rgba(141, 165, 255, 0.22);

  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --text: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --gutter: 16px;
  --tabbar: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(61, 99, 255, 0.28), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(61, 99, 255, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 16px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { flex: none; }

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(var(--tabbar) + var(--safe-b) + 28px);
}

.back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-weight: 500; margin: -4px 0 12px -6px; padding: 6px;
}
.back .ic { transform: scaleX(-1); }

/* ---------- Типографика ---------- */
.title {
  font: 700 28px/1.15 var(--display);
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}
.lead { color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.h2 { font: 600 15px/1.3 var(--text); color: var(--muted); margin: 0 0 10px; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.hint.center { text-align: center; }

/* ---------- Главная ---------- */
.home-head { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 4px; }
.balance { font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.brand { font: 500 15px/1 var(--display); letter-spacing: 0.04em; color: var(--muted); }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-gauge { position: relative; width: min(300px, 82vw); aspect-ratio: 1; }
.tunnel { width: 100%; height: 100%; display: block; }
.tunnel-ring { fill: none; stroke: var(--ring); stroke-width: 1.25; }
.tunnel-track { fill: none; stroke: var(--line); stroke-width: 10; }
.tunnel-arc { fill: none; stroke: var(--live); stroke-width: 10; stroke-linecap: round; }
.tunnel-soon .tunnel-arc { stroke: var(--warn); }
.tunnel-expired .tunnel-ring { stroke: var(--bad); opacity: 0.25 !important; }

@media (prefers-reduced-motion: no-preference) {
  .tunnel-arc { animation: arc-in 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes arc-in { from { stroke-dashoffset: var(--c); } }
}

.hero-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-num { font: 700 76px/1 var(--display); letter-spacing: -0.04em; }
.hero-unit { color: var(--muted); font-size: 15px; margin-top: 6px; }
.hero-status { margin: 10px 0 14px; font-weight: 500; }
.hero-status.state-soon { color: var(--warn); }
.hero-status.state-expired { color: var(--bad); }

.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fact {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; color: var(--ink);
}
.fact .ic { color: var(--muted); }
button.fact .ic { color: var(--accent); }

.actions { display: grid; gap: 10px; margin-top: 28px; }

/* ---------- Кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: var(--r-md);
  font-weight: 600; font-size: 16px; text-align: center; width: 100%;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary .btn-aside { margin-left: auto; font-weight: 500; opacity: .85; }
.btn-primary:has(.btn-aside) { justify-content: flex-start; }
.btn-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-quiet .ic { color: var(--accent); }

/* ---------- Списки ---------- */
.list {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; margin-top: 24px;
}
.row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; min-height: 60px;
}
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--accent-soft); }
.row-ic { color: var(--accent); display: flex; }
.row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 500; }
.row-sub { color: var(--muted); font-size: 14px; }
.row-trail { color: var(--muted); display: flex; }

/* ---------- Шаги ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.step:not(:last-child)::before {
  content: ''; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--line);
}
.step-n {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 14px/1 var(--display);
  border: 1.5px solid var(--line); color: var(--muted); background: var(--bg);
}
.step.now .step-n { border-color: var(--accent); color: var(--accent); }
.step.done .step-n { background: var(--live); border-color: var(--live); color: var(--accent-ink); }
.step-title { font: 600 17px/1.3 var(--text); margin: 5px 0 2px; }
.step.done .step-title { color: var(--muted); }
.step-text { color: var(--muted); margin: 0; font-size: 15px; }
.step-actions { display: grid; gap: 8px; margin-top: 14px; }

/* ---------- Блоки и ссылки ---------- */
.block { margin-bottom: 26px; }
.linkbox {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px dashed var(--ring);
  color: var(--accent);
}
.linkbox-url {
  flex: 1; min-width: 0; color: var(--ink); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-body .linkbox { margin-top: 12px; }

.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.platform {
  padding: 14px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); font-weight: 500;
}

/* ---------- Тарифы ---------- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 5px;
}
.seg-item {
  min-height: 42px; border-radius: var(--r-sm); text-align: center;
  font: 600 16px/1 var(--display);
}
.seg-item.on { background: var(--accent); color: var(--accent-ink); }

.periods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line);
}
.period.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.period-name { font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; color: var(--live); }
.period-price { font: 700 20px/1.3 var(--display); letter-spacing: -0.02em; margin-top: 6px; }
.period-per { color: var(--muted); font-size: 13px; }

.paybar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
}
.paybar-sum { display: flex; flex-direction: column; flex: none; }
.paybar-total { font: 700 22px/1.1 var(--display); letter-spacing: -0.02em; }
.paybar-old { color: var(--muted); font-size: 14px; text-decoration: line-through; }
.paybar-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.balance-big { display: flex; flex-direction: column; gap: 4px; }
.balance-num { font: 700 32px/1.1 var(--display); letter-spacing: -0.02em; }
.hist-sum.plus { color: var(--live); }
.fatal .btn { margin-top: 16px; }
.paybar .btn { flex: 1; }

/* ---------- Профиль ---------- */
.me { display: flex; align-items: center; gap: 14px; margin: 4px 0 26px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font: 700 22px/1 var(--display);
}
.me-text { display: flex; flex-direction: column; }
.me-name { font: 700 20px/1.2 var(--display); }
.me-id { color: var(--muted); font-size: 14px; }
.me-text { flex: 1; min-width: 0; }
.me-copy { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.h2-gap { margin-top: 26px; }
.block-gap { margin-top: 26px; }
.linkbox-two { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.linkbox-cap { color: var(--muted); font-size: 13px; }
.link-quiet { display: block; margin: 28px auto 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-align: center; }

.cardline {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.cardline .ic { color: var(--accent); }

.toggle {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  position: relative;
}
.toggle-text { flex: 1; display: flex; flex-direction: column; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.toggle input:checked + .switch { background: var(--live); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.history { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.hist { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.hist + .hist { border-top: 1px solid var(--line); }
.hist-main { flex: 1; display: flex; flex-direction: column; }
.hist-sum { font-weight: 600; white-space: nowrap; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 26px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 4px 0 0; font: 700 22px/1.2 var(--display); }

.emailform { display: grid; gap: 8px; margin-top: 12px; }
.emailform input {
  min-height: 50px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
}

/* ---------- FAQ ---------- */
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px; font-weight: 500;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font: 500 20px/1 var(--display); }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0; padding: 0 16px 16px; color: var(--muted); }

/* ---------- Служебное ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 500; max-width: calc(100% - 32px); z-index: 20;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.boot-ring { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .boot-ring { animation: spin .9s linear infinite; } @keyframes spin { to { transform: rotate(1turn); } } }
.boot-name { font: 500 15px/1 var(--display); color: var(--muted); }
.fatal { max-width: 420px; margin: 20vh auto 0; padding: 0 var(--gutter); }
.fatal h1 { font: 700 22px/1.2 var(--display); }
.fatal p { color: var(--muted); }
.seg-item { white-space: nowrap; min-width: 0; }
.seg-sm .seg-item { font-size: 14px; }

/* ---------- Админка ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.admin-head .title { margin-bottom: 0; }
.muted { color: var(--muted); font-weight: 400; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.card + .hint, .kpis + .card { margin-top: 10px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-num { font: 700 20px/1.15 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpis-3 .kpi-num { font-size: 18px; }
.kpi-main { background: var(--accent-soft); border-color: transparent; }
.bars-wrap { margin-bottom: 4px; }
.bars { width: 100%; height: 110px; display: block; }
.bars .bar { fill: var(--accent); opacity: .55; }
.bars .bar-now { fill: var(--accent); }
.bars .bar-zero { fill: var(--line); }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.meter-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.meter-row > span:first-child { color: var(--muted); }
.meter-row > span:last-child { text-align: right; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 2px 0 8px; }
.meter span { display: block; height: 100%; background: var(--live); border-radius: 99px; }
.meter .meter-warn { background: var(--warn); }
.meter .meter-bad { background: var(--bad); }
.nodes { display: grid; gap: 10px; margin-top: 10px; }
.node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.node-head { display: flex; align-items: center; gap: 8px; }
.node-state { margin-left: auto; font-size: 13px; color: var(--live); font-weight: 500; }
.node-state.bad { color: var(--bad); }
.node-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.node-msg { color: var(--bad); font-size: 13px; margin-top: 4px; }
.node-actions, .row-actions, .quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.dot-bad { background: var(--bad); }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip:active { background: var(--accent-soft); }
.chip[disabled] { opacity: .6; }
.chip-bad { color: var(--bad); }
.chip-xs { padding: 2px 8px; font-size: 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); vertical-align: 1px; }
.pill-ok { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live); }
.pill-info { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill-bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.banner { border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 18px; font-size: 14px; font-weight: 500; }
.banner-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--ink); }
.banner-bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--ink); }
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input, .field input, .field textarea, .field select {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px;
}
.searchbar input { flex: 1; }
.field textarea { resize: vertical; }
.searchbar input:focus, .field :is(input, textarea, select):focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.btn-sm { min-height: 44px; padding: 0 16px; width: auto; flex: none; }
.list-gap { margin-top: 10px; }
.list .row-static { cursor: default; }
.list .row-static:active { background: none; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pager .btn { width: auto; flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.grid2 .btn { min-height: 46px; font-size: 15px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-top: 12px; display: grid; gap: 12px; }
.sheet-title { font: 600 16px/1.3 var(--text); margin: 0; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-actions .btn:only-child { grid-column: 1 / -1; }
.actions-top { margin: 0 0 6px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.settings { display: grid; gap: 14px; }
.setting { display: grid; gap: 8px; justify-items: start; }
.setting .field { width: 100%; }
.settings .toggle { padding: 0; background: none; border: 0; }
.btn-bad { background: var(--bad); color: #fff; }
.btn-bad-quiet { background: var(--surface); color: var(--bad); border: 1px solid var(--line); }
.danger { margin-top: 34px; }
.hist-click { cursor: pointer; }
.hist-click:active { background: var(--accent-soft); }
.chat { display: grid; gap: 8px; margin: 14px 0; }
.msg { max-width: 85%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 12px; white-space: pre-wrap; }
.msg-me { justify-self: end; background: var(--accent-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg-at { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.skeleton { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 30px 0; }
.skeleton .boot-ring { width: 22px; height: 22px; border-width: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; }
.me-id a { color: var(--accent); }

/* ---------- Покупка (в стиле карточек) ---------- */
.welcome-title { font-size: 30px; }
.devcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 16px 14px; margin-bottom: 12px; }
.devcard-head { display: flex; align-items: center; gap: 14px; }
.devnum { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 20px/1 var(--display); }
.devtext { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.devtext .row-title { font-weight: 600; font-size: 17px; }
.stepper { display: flex; gap: 6px; }
.step-btn { display: grid; place-items: center; padding: 0; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 22px/1 var(--text); }
.step-btn:active { background: var(--accent-soft); }
.step-btn[disabled] { opacity: .35; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 14px 0 4px; background: transparent; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
.slider::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); }
.devhint { color: var(--muted); font-size: 13px; margin: 0; }
.period-wide { grid-column: 1 / -1; }
.star { color: var(--accent); font-size: 17px; margin-left: auto; }
.period-name { width: 100%; }
.paybtn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; min-height: 60px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 17px/1.2 var(--text); }
.paybtn:active { transform: scale(.99); }
.paybtn[disabled] { opacity: .7; justify-content: center; }
.paybtn-sum { font-weight: 700; white-space: nowrap; }
.paybtn-sum s { opacity: .55; font-weight: 500; margin-left: 6px; }
.trialcard { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); margin: 0 0 22px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--live))); color: var(--accent-ink); }
.trialcard > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trialcard-big { font: 700 20px/1.2 var(--display); }
.trialcard-sub { font-size: 14px; opacity: .85; }
.trialcard-btn { width: auto; min-height: 46px; padding: 0 18px; background: var(--accent-ink); color: var(--accent); border-radius: 999px; font-size: 15px; }
.h2.or { text-align: center; margin: 0 0 12px; font-weight: 500; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(5, 10, 25, .45); animation: fade .2s; }
.paysheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 520px; margin: 0 auto; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: rise .25s ease-out; display: grid; gap: 10px; }
.paysheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.paysheet-head h2 { font: 700 22px/1.2 var(--display); margin: 0; }
.paysheet-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 22px; line-height: 1; flex: none; }
.paysheet-box { background: var(--bg); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; font-size: 15px; }
.paysheet-box > div + div { border-top: 1px solid var(--line); padding-top: 8px; }
.paysheet-method { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.paysheet-ic { width: 40px; height: 30px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; }
.paybtn-confirm { justify-content: center; margin-top: 4px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.title, .h2, .row-title, .me-name { overflow-wrap: break-word; hyphens: auto; }
.seg-item { overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================
   Оформление 2: кольца, пилюли, плавающая навигация, мастер настройки
   ===================================================================== */
.center { text-align: center; }
.screen { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 20px); }
.btn-quiet, .list, .faq, .history, .card, .kpi, .node, .devcard, .period, .paybar, .cardline, .toggle, .linkbox, .stats div, .sheet, .platform, .msg {
  background: var(--surface); border-color: var(--line);
}
.btn-primary { background: var(--accent); }
.row:active, .chip:active { background: var(--accent-soft); }
.searchbar input, .field input, .field textarea, .field select, .emailform input { background: var(--surface-solid); }
.paysheet { background: var(--surface-solid); }
.paysheet-box, .paysheet-x, .step-btn, .chip { background: rgba(255, 255, 255, 0.06); }
#toast { background: #F1F4FF; color: #0B1020; }

/* Кольца */
.orbit { position: relative; display: grid; place-items: center; margin: 0 auto; aspect-ratio: 1; }
.orbit-lg { width: min(330px, 78vw, 42dvh); }
.orbit-md { width: min(260px, 66vw, 34dvh); }
.orbit-sm { width: min(170px, 46vw, 24dvh); }
.orbit-ring { position: absolute; border-radius: 50%; border: 1px solid var(--ring); }
.orbit-ring.r1 { inset: 0; opacity: .55; }
.orbit-ring.r2 { inset: 15%; opacity: .8; }
.orbit-ring.r3 { inset: 30%; background: radial-gradient(circle, rgba(61, 99, 255, 0.22), transparent 70%); border-color: rgba(141, 165, 255, 0.35); }
.orbit-core { position: relative; color: #fff; display: grid; place-items: center; filter: drop-shadow(0 6px 24px rgba(61, 99, 255, .55)); }
.orbit-core .ic { stroke-width: 1.4; }
.orbit-soon .orbit-ring.r3 { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.orbit-expired .orbit-core { color: #B9C2E0; filter: none; }
.orbit-expired .orbit-ring.r3 { background: none; }
.orbit-progress .orbit-ring.r2 { border: 2px solid transparent; border-top-color: var(--accent-2); border-right-color: var(--accent-2); opacity: 1; }
.orbit-done .orbit-ring.r3 { border-color: var(--live); background: radial-gradient(circle, rgba(61, 220, 170, 0.2), transparent 70%); }
.orbit-done .orbit-core { color: var(--live); }
@media (prefers-reduced-motion: no-preference) {
  .orbit-ring.r1 { animation: breathe 6s ease-in-out infinite; }
  .orbit-progress .orbit-ring.r2 { animation: spin 2.4s linear infinite; }
  @keyframes breathe { 50% { transform: scale(1.04); opacity: .3; } }
}

/* Главная */
.screen[data-screen="home"] { display: flex; flex-direction: column; min-height: 100dvh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-brand { display: inline-flex; align-items: center; gap: 8px; font: 600 16px/1 var(--display); letter-spacing: .01em; }
.topbar-brand .logo { color: var(--accent-2); }
.balance { font-size: 13px; color: var(--ink); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.home-hero { flex: 1; display: grid; place-items: center; min-height: 0; padding: 12px 0; }
.subline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 16px; }
.subline-main { min-width: 0; }
.subline-date { font: 600 20px/1.25 var(--text); }
.subline-meta { font-size: 14px; margin-top: 2px; color: var(--live); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subline-meta.state-soon { color: var(--warn); }
.subline-meta.state-expired { color: var(--muted); }
.subline-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.subline-chip .ic { color: var(--muted); }
.subline-chip-bad { color: var(--muted); }

.cta-stack { display: grid; gap: 10px; }
.cta { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px; border-radius: 999px;
  font: 600 16px/1.2 var(--text); transition: transform .08s ease, opacity .15s ease; }
.cta:active { transform: scale(.985); }
.cta[disabled] { opacity: .6; }
.cta-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cta-aside { margin-left: auto; font-weight: 500; white-space: nowrap; display: inline-flex; }
.cta-primary { background: linear-gradient(135deg, var(--accent), #5B7BFF); color: #fff; box-shadow: 0 10px 30px -10px rgba(61, 99, 255, .7); }
.cta-light { background: #F4F6FF; color: #0B1020; }
.cta-light .cta-aside { color: #8A93B0; }
.cta-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.cta-center { justify-content: center; text-align: center; }

.home-new { text-align: center; margin-bottom: 18px; }
.home-new .title { font-size: 24px; margin-top: 10px; }
.home-new .lead { margin: 0 auto; }

/* Мастер настройки */
.screen[data-screen="setup"] { display: flex; flex-direction: column; min-height: 100dvh; }
.wiz { flex: 1; display: flex; flex-direction: column; text-align: center; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.wiz-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 4px; }
.wiz-back .ic { transform: scaleX(-1); }
.wiz-dots { display: flex; gap: 6px; }
.wiz-dots span { width: 22px; height: 4px; border-radius: 99px; background: var(--line); }
.wiz-dots span.on { background: var(--accent-2); }
.wiz-title { font: 700 26px/1.2 var(--display); letter-spacing: -0.02em; margin: 8px 0 8px; }
.wiz-text { color: var(--muted); margin: 0 auto; max-width: 22em; font-size: 15px; }
.wiz-art { flex: 1; display: grid; place-items: center; padding: 18px 0; min-height: 0; }
.wiz-link { display: block; margin: 14px auto 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-align: center; }

/* Покупка: кнопка оплаты всегда видна */
.paybtn { position: sticky; bottom: calc(var(--tabbar) + var(--safe-b) + 6px); z-index: 5;
  background: linear-gradient(135deg, var(--accent), #5B7BFF); box-shadow: 0 10px 30px -8px rgba(61, 99, 255, .75); }
.paybtn > span:first-child { white-space: nowrap; }
.paysheet .paybtn { position: static; }
.trialcard { background: linear-gradient(135deg, #3D63FF, #2BB58C); }
.trialcard-btn { background: #fff; color: #2440C8; }
.period-per { white-space: normal; }
@media (max-width: 380px) {
  .periods { gap: 8px; }
  .period { padding: 12px; }
  .period-price { font-size: 18px; }
  .paybtn { padding: 0 18px; font-size: 16px; }
  .devhint { font-size: 12px; }
}

/* Плавающая навигация (телефон) */
.tabbar {
  position: fixed; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); z-index: 10;
  width: calc(100% - 24px); max-width: 456px;
  padding: 6px; border-radius: 24px;
  background: rgba(14, 22, 46, 0.78); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.tabbar-brand, .tabbar-foot { display: none; }
.tabbar-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.tab { display: grid; place-items: center; height: 52px; border-radius: 18px; color: var(--muted); }
.tab .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tab.on { background: linear-gradient(135deg, var(--accent), #5B7BFF); color: #fff; box-shadow: 0 6px 18px -6px rgba(61, 99, 255, .8); }
.tab:not(.on):active { background: var(--surface); }
#toast { bottom: calc(var(--tabbar) + var(--safe-b) + 12px); }
.boot-logo { color: var(--accent-2); }
@media (prefers-reduced-motion: no-preference) { .boot-logo { animation: breathe 1.6s ease-in-out infinite; } }

/* Низкие экраны: всё помещается без прокрутки */
@media (max-height: 680px) {
  .subline-date { font-size: 18px; }
  .cta { min-height: 52px; }
  .wiz-title { font-size: 22px; }
}

/* Компьютер: боковое меню и большая панель, как веб-кабинет */
@media (min-width: 900px) {
  body { background: #04060E; }
  .tabbar {
    left: 0; top: 0; bottom: 0; transform: none; width: 240px; max-width: none;
    display: flex; flex-direction: column; padding: 26px 20px; border-radius: 0;
    background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabbar-brand { display: flex; align-items: center; gap: 10px; font: 600 22px/1 var(--display); letter-spacing: -.01em; }
  .tabbar-brand .logo { color: var(--accent-2); }
  .tabbar-tabs { grid-auto-flow: row; grid-auto-rows: auto; gap: 6px; margin: auto 0; }
  .tab { display: flex; justify-content: flex-start; gap: 12px; height: 48px; padding: 0 14px; border-radius: 14px; color: var(--ink); font-weight: 600; font-size: 15px; }
  .tab .tab-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .tab:not(.on):hover { background: var(--surface); }
  .tabbar-foot { display: block; color: var(--muted); font-size: 13px; }
  .screen, .screen[data-screen="home"], .screen[data-screen="setup"] {
    margin: 12px 12px 12px 252px; max-width: none; min-height: calc(100dvh - 24px);
    border-radius: 28px; border: 1px solid var(--line);
    padding: 40px max(28px, calc((100vw - 264px - 480px) / 2)) 40px;
    background:
      radial-gradient(90% 70% at 50% 0%, rgba(61, 99, 255, 0.3), transparent 60%),
      radial-gradient(70% 60% at 100% 100%, rgba(61, 99, 255, 0.14), transparent 60%),
      #081027;
  }
  .paybtn { bottom: 16px; }
  .topbar { display: none; }
  #toast { bottom: 28px; }
}

/* Кольца — только украшение: не перехватывают нажатия и не наезжают на кнопки */
.orbit, .orbit * { pointer-events: none; }
.cta-stack { position: relative; z-index: 2; }
.wiz-art, .home-hero { flex: 1 0 auto; min-height: auto; }
.wiz-link, .subline, .topbar, .wiz-top { position: relative; z-index: 2; }

/* Инструкция «Смена региона App Store» */
.rgsheet { max-height: 92dvh; overflow-y: auto; gap: 12px; }
.rg-note { background: rgba(61, 220, 170, 0.1); border: 1px solid rgba(61, 220, 170, 0.25); border-radius: var(--r-md); padding: 12px 14px; font-size: 15px; }
.rg-phone { position: relative; height: 290px; margin: 0 auto; width: min(260px, 100%); border-radius: 30px; border: 6px solid #1B2238;
  background: #F2F2F7; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.rg-scene { position: absolute; inset: 0; padding: 14px 10px; color: #111; opacity: 0; transform: translateX(14px); transition: opacity .45s ease, transform .45s ease; font: 400 13px/1.3 -apple-system, 'SF Pro Text', system-ui, sans-serif; }
.rg-scene.on { opacity: 1; transform: none; }
.rg-head { font-weight: 700; font-size: 20px; margin: 4px 6px 10px; }
.rg-card { background: #fff; border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.rg-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; min-height: 38px; }
.rg-row + .rg-row { border-top: 1px solid #E5E5EA; }
.rg-row .ic { color: #C7C7CC; }
.rg-aside { display: inline-flex; align-items: center; gap: 4px; color: #8E8E93; }
.rg-aside .ic { color: #C7C7CC; }
.rg-row.hl .rg-aside .ic[viewBox] path[d^="M5 12"] { stroke: #0A84FF; }
.rg-me { justify-content: flex-start; gap: 10px; }
.rg-me > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.rg-me small, .rg-app small { color: #8E8E93; font-size: 11px; }
.rg-ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #9AA4B8, #C9CFDB); flex: none; }
.rg-field .rg-aside { color: #111; }
.rg-app { display: flex; align-items: center; gap: 10px; padding: 12px; position: relative; }
.rg-app > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.rg-appicon { width: 46px; height: 46px; border-radius: 11px; background: linear-gradient(135deg, #1E1E2E, #3B3B5C); flex: none; }
.rg-get { background: #E9E9EF; color: #0A84FF; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; }
.rg-tap { position: absolute; right: 22%; top: 50%; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%;
  border: 6px solid rgba(61, 99, 255, .85); opacity: 0; }
.rg-tap-get { right: 10px; }
.rg-scene.on .rg-tap { animation: rg-tap 2.8s ease-out infinite; }
@keyframes rg-tap { 0%, 30% { opacity: 0; transform: scale(1.6); } 45% { opacity: 1; transform: scale(1); } 60% { opacity: 1; transform: scale(.85); } 80%, 100% { opacity: 0; transform: scale(1); } }
.rg-scene.on .rg-row.hl, .rg-scene.on .rg-app { animation: rg-hl 2.8s ease-out infinite; }
@keyframes rg-hl { 0%, 50% { background: #fff; } 60%, 75% { background: #E5E5EA; } 100% { background: #fff; } }
.rg-caps { text-align: center; min-height: 64px; position: relative; }
.rg-progress { display: flex; justify-content: center; gap: 5px; margin-bottom: 8px; }
.rg-progress span { width: 18px; height: 3px; border-radius: 99px; background: var(--line); transition: background .3s; }
.rg-progress span.on { background: var(--accent-2); }
.rg-cap { display: none; margin: 0; font-size: 15px; }
.rg-cap.on { display: block; }
.rg-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .rg-scene { transition: none; } .rg-scene.on .rg-tap { animation: none; opacity: 1; } }
.rg-scene { text-align: left; }
.rgsheet { text-align: left; }
.rgsheet .paysheet-head h2 { font-size: 22px; }
.rg-video { display: block; width: min(300px, 100%); aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 22px; background: #070B19; object-fit: cover; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
@media (max-height: 760px) { .rg-video { width: min(230px, 70%); } }
.rg-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.rg-steps { color: var(--ink); }
.rg-steps li { padding-left: 2px; }
details.rg-more summary { cursor: pointer; color: var(--muted); }
.rgsheet .paybtn { position: static; }
.rgsheet .rg-go { width: 100%; margin-top: 4px; }

/* Другое устройство: QR и список загрузок */
.qr-box { margin-top: 14px; display: grid; justify-items: center; }
.qr-svg { width: min(240px, 72vw); height: auto; border-radius: 16px; background: #fff; }
.devlist { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.devrow { display: flex; align-items: stretch; }
.devrow + .devrow { border-top: 1px solid var(--line); }
.devrow-main { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 16px; color: var(--ink); font: inherit; font-weight: 500; text-align: left; }
.devrow-main svg { color: var(--muted); flex: none; }
.devrow-help { flex: none; padding: 0 16px; border-left: 1px solid var(--line); color: #8FA8FF; font: inherit; font-size: 14px; }
.inline-link { color: #8FA8FF; font: inherit; padding: 0; text-decoration: underline; }

/* Веб-кабинет: экран входа */
.cab-login { text-align: center; display: grid; justify-items: center; gap: 6px; margin-top: 16vh; }
.cab-login .boot-logo { color: var(--accent); margin-bottom: 10px; }
.cab-login .btn { width: 100%; max-width: 320px; }

/* Маленькие телефоны (360×640 и ниже): экраны помещаются без прокрутки */
@media (max-height: 700px) and (max-width: 420px) {
  .screen { padding-top: 12px; }
  .title { font-size: 24px; margin: 0 0 10px; }
  .lead { font-size: 14px; margin-bottom: 14px; }
  .screen[data-screen="plans"] .lead, .screen[data-screen="support"] .lead { display: none; }
  .back { margin-bottom: 4px; }
  .faq-item summary { padding: 11px 14px; font-size: 15px; }
  .faq-item p { padding: 0 14px 12px; font-size: 14px; }
  .list-gap, .block-gap { margin-top: 12px; }
  .row { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
  .devcard { padding: 12px 14px 10px; margin-bottom: 8px; }
  .devnum { width: 40px; height: 40px; font-size: 18px; }
  .period { padding: 10px 12px; }
  .period-price { font-size: 18px; margin-top: 2px; }
  .periods { gap: 8px; }
  .paybtn { min-height: 52px; margin-top: 10px; }
}
