/* Сообщение о неподтверждённом входе.
   API принимает только подписанный Telegram initData; если подписи нет
   (кабинет открыт вне Telegram) — показываем причину, а не пустой экран. */
.auth-error {
  margin: 12px 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fdeef0;
  border: 1px solid #f7d4d9;
  color: #a8112a;
}
.auth-error__title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.auth-error__text  { font-size: 13.5px; line-height: 1.4; }

/* ===== Design tokens ===== */
:root {
  --bg: #faf7f4;
  --ink: #16232e;
  --orange: #ff5a06;
  --brand-grad: linear-gradient(135deg, #ff7f06, #ff1200);
  --card: #fff;
  --card-border: #efe7e0;
  --divider: #f4ece5;
  --muted: #7a8893;
  --muted-2: #94a3ad;
  --muted-3: #a5b0b9;
  --green: #15a06a;
  --green-ink: #157a52;
  --green-bg: #eef7f1;
  --green-border: #d4ebdd;
  --warn-ink: #c47a10;
  --danger: #d83a1e;
  --danger-bg: #fff5f3;
  --danger-border: #ffd3cb;
  --peach-bg: #fff1e8;
  --peach-border: #ffe2cf;
  --radius: 14px;
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: #eee; font-family: var(--font); color: var(--ink); }

/* ===== Phone frame ===== */
.app {
  width: 390px;
  /* Ровно в размер экрана (но не выше макета 780px):
     футер прилипает к нижнему краю, при переполнении экран скроллится */
  height: min(780px, 100dvh);
  margin: 0 auto;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 40px 90px -45px rgba(20, 50, 70, .45);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== Top bar ===== */
.topbar {
  flex-shrink: 0;
  background: var(--bg);
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
  border-bottom: 1px solid #f0e9e3;
}
.topbar__user { flex: 1; min-width: 0; }
.topbar__name {
  font-weight: 800; font-size: 16px; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__handle { font-size: 12px; font-weight: 600; color: var(--muted-2); }

/* ===== Avatar ===== */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}
.avatar--sm { width: 40px; height: 40px; }
.avatar--lg { width: 74px; height: 74px; margin: 0 auto; }
.avatar--xl { width: 88px; height: 88px; box-shadow: 0 14px 30px -16px rgba(20, 50, 70, .5); }
.avatar__initial { font-size: 16px; font-weight: 800; color: #fff; }
.avatar__initial--lg { font-size: 30px; }
.avatar__initial--xl { font-size: 36px; }
.gradient-brand { background: var(--brand-grad); }

/* ===== Buttons ===== */
.tap { transition: transform .14s, background .2s, border-color .2s, color .2s; }
.tap:active { transform: scale(.98); }

.icon-btn {
  border: 1px solid #ece3db; background: var(--card);
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.pagehead .icon-btn,
.screen__topnav .icon-btn { width: 40px; height: 40px; border-radius: 13px; }

.btn {
  width: 100%; border: none; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: 15.5px;
  padding: 16px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.btn--primary { background: var(--orange); color: #fff; }
.btn--gradient { background: var(--brand-grad); color: #fff; box-shadow: 0 16px 34px -18px rgba(255, 90, 6, .7); }
.btn--ghost {
  border: 1px solid var(--card-border); background: var(--card); color: var(--ink);
  font-size: 14.5px; padding: 14px; border-radius: var(--radius); gap: 8px;
  margin-top: 10px;
}
.btn--soft {
  border: 1px solid var(--peach-border); background: var(--peach-bg); color: var(--orange);
  font-size: 13.5px; font-weight: 800; padding: 12px; border-radius: 13px; gap: 8px;
  text-decoration: none; margin-top: 16px;
}
.btn--dashed {
  margin-top: 12px; border: 1.5px dashed #ffd9bf; background: var(--card); color: var(--orange);
  font-size: 14px; padding: 13px; gap: 8px;
}
.btn--danger {
  border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger);
  font-size: 14.5px; padding: 14px; border-radius: var(--radius); gap: 8px;
}
.btn--danger-soft {
  border: 1px solid var(--danger-border); background: var(--danger-bg); color: var(--danger);
  font-size: 14px; padding: 13px; border-radius: var(--radius);
}

/* ===== Screens & transitions ===== */
.screen {
  position: absolute; top: 73px; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--bg);
  transition: transform .42s cubic-bezier(.4, 0, .2, 1), opacity .32s;
  transform: translateX(100%); opacity: 0; pointer-events: none; z-index: 1;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
/* Активный экран — в потоке, задаёт высоту .app и скроллится при переполнении */
.screen.is-active { position: relative; top: 0; flex: 1 1 auto; min-height: 0; transform: translateX(0); opacity: 1; pointer-events: auto; z-index: 5; }
.screen--sites { transform: translateX(-22%); z-index: 2; }
.screen--sites.is-active { transform: translateX(0); }

.screen__head { padding: 22px 18px 16px; }
.screen__head--tight { padding: 20px 18px 4px; }
.screen__topnav { padding: 16px 18px 0; }
.screen__foot { padding: 18px; margin-top: auto; }
.screen__foot--form { padding: 22px 18px 24px; }
.screen__foot--stack { display: flex; flex-direction: column; gap: 10px; }

.title { font-size: 24px; font-weight: 800; letter-spacing: -.7px; margin: 0; }
.title--sm { font-size: 22px; letter-spacing: -.6px; }
.subtitle { font-size: 13.5px; color: var(--muted); font-weight: 500; margin: 7px 0 0; }
.lead { margin: 0; font-size: 13.8px; line-height: 1.6; color: #5a6b78; font-weight: 500; }
.lead--top { margin-top: 14px; }
.section-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 11px 2px; }
.section-label--strong { font-weight: 800; letter-spacing: .3px; margin-bottom: 13px; }

.pad { padding: 0 18px; }
.pad--top { padding-top: 18px; }
.pad--top-sm { padding-top: 12px; }
.pad--btm { padding-bottom: 24px; }

/* ===== Page header (with back) ===== */
.pagehead { display: flex; align-items: center; gap: 12px; padding: 16px 18px 4px; }
.pagehead__text { min-width: 0; }
.pagehead__eyebrow { font-size: 12px; font-weight: 700; color: var(--muted-2); }
.pagehead__title {
  font-size: 18px; font-weight: 800; letter-spacing: -.4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pagehead__title--plain { white-space: normal; }
.pagehead__sub { font-size: 12px; font-weight: 600; color: var(--muted-2); }

/* ===== Generic list & rows ===== */
.list { padding: 0 18px; display: flex; flex-direction: column; gap: 11px; }

.row {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 18px;
  padding: 15px 16px; display: flex; align-items: center; gap: 13px;
  transition: border-color .2s;
}
.row:hover { border-color: #ffd9bf; }
.row__fav {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
}
.row__body { flex: 1; min-width: 0; }
.row__name {
  font-size: 15px; font-weight: 800; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__status { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.row__status-text { font-size: 12px; font-weight: 700; }

.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot--warn { background: #f0a020; }

.open-btn {
  flex-shrink: 0; border: 1px solid var(--peach-border); background: var(--card);
  color: var(--orange); font-family: var(--font); font-weight: 800; font-size: 13px;
  padding: 9px 15px; border-radius: 11px; cursor: pointer;
  transition: background .2s, color .2s;
}
.open-btn:hover { background: var(--orange); color: #fff; }

/* ===== Forms ===== */
.form { padding: 14px 18px 0; display: flex; flex-direction: column; gap: 14px; }
.form--pad { padding: 22px 18px 0; }
.field { display: block; }
.field__label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--muted);
  margin-bottom: 7px; padding-left: 2px;
}
.input {
  width: 100%; font-family: var(--font); font-size: 15px; font-weight: 600;
  color: var(--ink); padding: 14px 16px; border: 1px solid var(--card-border);
  border-radius: var(--radius); background: var(--card); outline: none;
  transition: border-color .2s, background .2s;
}
.input:focus { border-color: var(--orange); background: var(--card); }
.input--mono {
  width: 100%; resize: none; font-family: var(--mono); font-size: 13px;
  font-weight: 600; line-height: 1.5; padding: 13px 15px; border-radius: var(--radius);
}
.input--tall {
  resize: none; font-size: 14px; font-weight: 500; line-height: 1.55;
  padding: 15px 16px; border-radius: 18px;
}

.fineprint { margin: 2px 2px 0; font-size: 11.5px; line-height: 1.5; color: var(--muted-3); font-weight: 500; }
.fineprint--center { text-align: center; margin: 14px 0 0; }
.fineprint--muted { color: var(--muted-2); margin: 10px 2px 0; line-height: 1.55; }

/* ===== Screen sub-state wrappers (transparent to flex layout) ===== */
.state-wrap { display: contents; }

/* ===== Success ===== */
.success__body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 28px;
}
.success__icon {
  width: 84px; height: 84px; border-radius: 50%; background: var(--peach-bg);
  display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
}
.success__title { font-size: 23px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 12px; }
.success__text { font-size: 14.5px; line-height: 1.6; color: #6a7b88; font-weight: 500; margin: 0; max-width: 280px; }

/* ===== Info card ===== */
.infocard { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; overflow: hidden; }
.inforow { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--divider); }
.inforow--plain { padding: 15px 18px; }
.inforow--last { border-bottom: none; }
.inforow__emoji { font-size: 15px; }
.inforow__key { flex: 1; font-size: 13px; font-weight: 600; color: var(--muted); }
.inforow__key--wide { font-size: 13.5px; }
.inforow__val { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.inforow__val--num { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.badge-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.badge-inline--warn { color: var(--warn-ink); }

/* ===== Banner / note ===== */
.banner { display: flex; align-items: center; gap: 9px; border-radius: 13px; padding: 12px 15px; }
.banner--ok { background: var(--green-bg); border: 1px solid var(--green-border); }
.banner__check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.banner__text { font-size: 13.5px; font-weight: 800; color: var(--green-ink); }

.note { display: flex; gap: 10px; border-radius: var(--radius); padding: 13px 15px; }
.note--plain { align-items: center; gap: 11px; background: var(--green-bg); border: 1px solid var(--green-border); border-radius: 16px; padding: 15px 16px; }
.note--ok { background: var(--green-bg); border: 1px solid var(--green-border); }
.note--warn { background: var(--peach-bg); border: 1px solid var(--peach-border); border-radius: 16px; padding: 14px 15px; }
.note__ic { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.note__ic--green { width: 34px; height: 34px; border-radius: 10px; background: #eef6f2; }
.note__ic--check { width: 22px; height: 22px; border-radius: 50%; background: var(--green); }
.note__ic--orange { width: 26px; height: 26px; border-radius: 8px; background: var(--orange); }
.note__text { margin: 0; font-size: 12.8px; line-height: 1.5; color: #5a6b78; font-weight: 600; }
.note__text--green { font-size: 12.5px; color: #3f7a5e; }
.note__text--brown { font-size: 12.5px; color: #9a6a47; }

/* ===== Code embed ===== */
.codehead { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; padding-left: 2px; }
.codehead--plain { margin-bottom: 9px; }
.codehead__emoji { font-size: 14px; }
.codehead__key { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.codehead__count { font-size: 11.5px; font-weight: 700; color: #b6c0c8; font-variant-numeric: tabular-nums; }
.codehead__ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.codehead__ic--violet { background: #f1edfb; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--peach-border);
  background: var(--peach-bg); color: var(--orange); font-family: var(--font);
  font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: 9px; cursor: pointer;
}
.codebox { background: var(--ink); border-radius: var(--radius); padding: 14px 15px; }
.codebox__code { display: block; font-family: var(--mono); font-size: 11px; line-height: 1.6; color: #cdd8e0; word-break: break-all; }
.tok-tag { color: #6b8294; }
.tok-attr { color: #7fd1ff; }
.tok-str { color: #9be0a8; }
.tok-val { color: #ffc08a; }

/* ===== Action grid ===== */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  border: 1px solid var(--card-border); background: var(--card); border-radius: var(--radius);
  padding: 14px; display: flex; align-items: center; gap: 9px; cursor: pointer;
  text-align: left; min-width: 0; font-family: var(--font); color: var(--ink);
  transition: border-color .2s, transform .14s;
}
.action:hover { border-color: #ffd9bf; }
.action--wide { grid-column: 1 / -1; }
.action--danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.action__ic { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.action__label {
  font-size: 13.5px; font-weight: 700; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== Tariff card ===== */
.tariff-card { position: relative; overflow: hidden; border-radius: 20px; padding: 22px; box-shadow: 0 20px 44px -24px rgba(255, 90, 6, .6); }
.tariff-card__blob { position: absolute; top: -34px; right: -26px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.tariff-card__body { position: relative; }
.tariff-card__label { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.tariff-card__name { font-size: 23px; font-weight: 800; letter-spacing: -.5px; color: #fff; margin-top: 4px; }
.tariff-card__pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; background: rgba(255, 255, 255, .18); border-radius: 100px; padding: 6px 13px; }
.tariff-card__pill span { font-size: 12.5px; font-weight: 700; color: #fff; }

/* ===== Plan cards ===== */
.plan-list { display: flex; flex-direction: column; gap: 12px; }
.plan-card {
  position: relative; overflow: hidden; width: 100%; text-align: left;
  border: 1px solid var(--card-border); background: var(--card); border-radius: 18px;
  padding: 18px 18px 18px 22px; cursor: pointer; font-family: var(--font);
  transition: border-color .2s, transform .14s;
}
.plan-card:hover { border-color: #ffd9bf; }
.plan-card--popular { box-shadow: 0 16px 40px -26px rgba(99, 102, 241, .5); }
.plan-card__bar { position: absolute; top: 0; left: 0; bottom: 0; width: 5px; }
.plan-card__flag {
  position: absolute; top: 14px; right: 14px; background: var(--peach-bg); color: var(--orange);
  font-size: 10px; font-weight: 800; letter-spacing: .4px; padding: 4px 9px; border-radius: 100px;
}
.plan-card__name { font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.plan-card__price { display: flex; align-items: baseline; gap: 5px; margin-top: 7px; }
.plan-card__amount { font-size: 27px; font-weight: 800; letter-spacing: -.8px; color: var(--ink); }
.plan-card__per { font-size: 13px; font-weight: 600; color: var(--muted-2); }
.plan-card__req { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 12.5px; font-weight: 700; color: #5a6b78; }
.plan-card__chevron { position: absolute; right: 16px; bottom: 16px; }

/* ===== Feature card ===== */
.feature-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 18px; }
.feature-list { display: flex; flex-direction: column; gap: 11px; }
.feature { display: flex; align-items: center; gap: 10px; }
.feature__check {
  flex-shrink: 0; width: 21px; height: 21px; border-radius: 7px; background: var(--peach-bg);
  display: flex; align-items: center; justify-content: center;
}
.feature__text { font-size: 13.8px; font-weight: 600; color: var(--ink); }
.feature-card__desc { margin: 15px 0 0; padding-top: 15px; border-top: 1px solid var(--divider); font-size: 13px; line-height: 1.55; color: #6a7b88; font-weight: 500; }

/* ===== Billing options ===== */
.bill-list { display: flex; flex-direction: column; gap: 10px; }
.bill {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--card-border); background: var(--card); border-radius: 15px;
  padding: 14px 16px; cursor: pointer; font-family: var(--font); text-align: left;
  transition: border-color .2s, transform .14s;
}
.bill:hover { border-color: #ffd9bf; }
.bill--discount { border-color: var(--green-border); background: #f6fbf8; }
.bill__period { font-size: 14.5px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.bill__save { font-size: 11.5px; font-weight: 700; color: var(--green); margin-top: 3px; }
.bill__right { text-align: right; flex-shrink: 0; }
.bill__price { font-size: 17px; font-weight: 800; letter-spacing: -.4px; }
.bill__price small { font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.bill__was { font-size: 11.5px; font-weight: 600; color: #b6c0c8; text-decoration: line-through; margin-top: 1px; }

/* ===== Profile ===== */
.profile-greeting { padding: 24px 18px 0; text-align: center; }
.profile-greeting__hello { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 16px; }
.profile-greeting__name { font-size: 23px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }

.menu-list { display: flex; flex-direction: column; gap: 11px; }
.menu-item {
  width: 100%; border: 1px solid var(--card-border); background: var(--card); border-radius: 16px;
  padding: 15px 16px; display: flex; align-items: center; gap: 13px; cursor: pointer; text-align: left;
  transition: border-color .2s;
}
.menu-item:hover { border-color: #ffd9bf; }
.menu-item__ic { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.menu-item__ic--orange { background: var(--peach-bg); }
.menu-item__ic--green { background: #eef6f2; }
.menu-item__body { flex: 1; }
.menu-item__title { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.menu-item__sub { display: block; font-size: 12px; font-weight: 600; color: var(--muted-2); margin-top: 2px; }
.chevron { flex-shrink: 0; }

/* ===== Invite ===== */
.invite { background: var(--peach-bg); border: 1px solid var(--peach-border); border-radius: 18px; padding: 16px; }
.invite__head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.invite__ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--orange); display: flex; align-items: center; justify-content: center; }
.invite__title { font-size: 13px; font-weight: 800; color: #c2470a; letter-spacing: -.2px; }
.invite__text { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: #9a6a47; font-weight: 600; }
.invite__row { display: flex; align-items: center; gap: 9px; }
.invite__link {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--orange); background: var(--card); border: 1px solid #ffd9bf; border-radius: 11px;
  padding: 11px 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-inline {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: none;
  background: var(--orange); color: #fff; font-family: var(--font); font-size: 12.5px;
  font-weight: 800; padding: 11px 13px; border-radius: 11px; cursor: pointer; white-space: nowrap;
}

/* ===== Operator detail ===== */
.op-avatar { padding: 22px 18px 0; text-align: center; display: flex; justify-content: center; }
.op-avatar__btn { position: relative; display: inline-block; border: none; background: none; padding: 0; cursor: pointer; transition: transform .14s; }
.op-avatar__btn:active { transform: scale(.96); }
.op-avatar__edit {
  position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px -4px rgba(20, 50, 70, .3); cursor: pointer;
}
.op-avatar__edit-ic { display: flex; }
.op-avatar__remove {
  position: absolute; left: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; padding: 0;
  background: #fff; border: 1px solid var(--danger-border); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px -4px rgba(20, 50, 70, .3); cursor: pointer;
}
.op-avatar__hint { font-size: 11.5px; font-weight: 600; color: var(--muted-2); margin: 11px 0 0; text-align: center; }
.op-name { text-align: center; padding: 14px 18px 2px; font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.op-status { display: flex; justify-content: center; padding: 8px 18px 0; }
.status-toggle {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 100px;
  padding: 7px 14px; cursor: pointer; font-family: var(--font);
  border: 1px solid #e7e0d9; background: #f4f1ee;
}
.status-toggle__dot { width: 8px; height: 8px; border-radius: 50%; background: #b6c0c8; }
.status-toggle__text { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.status-toggle.is-online { border-color: var(--green-border); background: var(--green-bg); }
.status-toggle.is-online .status-toggle__dot { background: var(--green); }
.status-toggle.is-online .status-toggle__text { color: var(--green-ink); }

/* ===== Operator / integration list rows ===== */
.nav-row {
  border: 1px solid var(--card-border); background: var(--card); border-radius: 16px;
  padding: 13px 14px; display: flex; align-items: center; gap: 13px; cursor: pointer;
  text-align: left; font-family: var(--font); color: var(--ink); transition: border-color .2s;
}
.nav-row:hover { border-color: #ffd9bf; }
.nav-row__avatar { position: relative; flex-shrink: 0; }
.nav-row__circle { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; object-fit: cover; }
.nav-row__badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; letter-spacing: -.2px;
}
.nav-row__presence { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; }
.nav-row__body { flex: 1; min-width: 0; }
.nav-row__name {
  font-size: 15px; font-weight: 800; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-row__sub { font-size: 12.5px; font-weight: 600; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-row__status { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.nav-row__status-text { font-size: 12px; font-weight: 700; }
.nav-row__num { flex-shrink: 0; font-size: 18px; font-weight: 800; color: #dce3e8; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* ===== Quick replies ===== */
.quick-list { display: flex; flex-direction: column; gap: 12px; }
.quick { position: relative; background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 15px 16px; }
.quick__head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.quick__num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--peach-bg);
  color: var(--orange); font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.quick__tag { flex: 1; font-size: 11px; font-weight: 800; letter-spacing: .4px; color: #b6c0c8; }
.quick__del {
  flex-shrink: 0; border: 1px solid var(--danger-border); background: var(--danger-bg);
  width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.quick__fields { display: flex; flex-direction: column; gap: 9px; }
.quick__field { display: flex; align-items: center; gap: 9px; }
.quick__field--top { align-items: flex-start; }
.quick__key { flex-shrink: 0; font-size: 11px; font-weight: 800; color: var(--muted-2); width: 54px; }
.quick__key--top { padding-top: 11px; }
.quick__input {
  flex: 1; min-width: 0; font-family: var(--font); font-size: 14px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--bg); outline: none; transition: border-color .2s, background .2s;
}
.quick__input:focus { border-color: var(--orange); background: #fff; }
.quick__input--q { font-weight: 700; }
.quick__input--a { resize: none; font-weight: 500; line-height: 1.45; }

/* ===== Integration detail ===== */
.integ-head { display: flex; align-items: center; gap: 14px; }
.integ-head__badge {
  flex-shrink: 0; width: 58px; height: 58px; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; font-size: 17px; font-weight: 800; color: #fff;
  box-shadow: 0 12px 26px -16px rgba(20, 50, 70, .5);
}
.integ-head__text { min-width: 0; }
.integ-head__name { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.integ-head__status {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; border-radius: 100px;
  padding: 4px 11px; font-size: 11.5px; font-weight: 800;
  background: #f4f1ee; border: 1px solid #e7e0d9; color: var(--muted);
}
.integ-head__status .dot { width: 7px; height: 7px; background: #b6c0c8; }
.integ-head__status.is-connected { background: var(--green-bg); border-color: var(--green-border); color: var(--green-ink); }
.integ-head__status.is-connected .dot { background: var(--green); }

.step-list { display: flex; flex-direction: column; gap: 13px; }
.step { display: flex; align-items: flex-start; gap: 11px; }
.step__num {
  flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%; background: var(--peach-bg);
  color: var(--orange); font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step__text { font-size: 13.5px; line-height: 1.45; font-weight: 600; color: var(--ink); padding-top: 1px; }

/* ===== AI explainer ===== */
.explainer { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 17px; }
.explainer__head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.explainer__ic { flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px; background: var(--peach-bg); display: flex; align-items: center; justify-content: center; }
.explainer__title { font-size: 13px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; }
.explainer__text { margin: 0; font-size: 13px; line-height: 1.6; color: #5a6b78; font-weight: 500; }
.explainer__text--top { margin-top: 11px; }

/* ===== SEO ===== */
.level-badge { display: inline-flex; align-items: center; margin-bottom: 12px; border-radius: 100px; padding: 5px 13px; font-size: 11.5px; font-weight: 800; border: 1px solid transparent; }
.level-badge--high { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.level-badge--mid { background: #fff8ec; border-color: #ffe6b8; color: #c2780a; }
.level-badge--low { background: var(--green-bg); border-color: var(--green-border); color: #15805a; }
.seo-item__title { font-size: 24px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
.seo-row__level { display: inline-flex; align-items: center; margin-top: 5px; border-radius: 100px; padding: 3px 10px; border: 1px solid transparent; }
.seo-row__level-text { font-size: 11px; font-weight: 800; }
.seo-row__level--high { background: var(--danger-bg); border-color: var(--danger-border); }
.seo-row__level--high .seo-row__level-text { color: var(--danger); }
.seo-row__level--mid { background: #fff8ec; border-color: #ffe6b8; }
.seo-row__level--mid .seo-row__level-text { color: #c2780a; }
.seo-row__level--low { background: var(--green-bg); border-color: var(--green-border); }
.seo-row__level--low .seo-row__level-text { color: #15805a; }

.tip-list { display: flex; flex-direction: column; gap: 14px; }
.tip { display: flex; align-items: flex-start; gap: 11px; }
.tip__check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--green-bg); display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.tip__text { flex: 1; font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--ink); }

/* ===== Toast ===== */
.toast {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--green);
  box-shadow: 0 18px 38px -16px rgba(21, 122, 82, .6);
}
.toast__ic {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
}
.toast__text { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; }

.toast-enter-active, .toast-leave-active { transition: opacity .28s ease, transform .28s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translate(-50%, 14px); }

/* ===== Payment confirmation ===== */
.pay-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 4px 16px; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--divider); }
.pay-row:last-child { border-bottom: none; }
.pay-row__key { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.pay-row__val { font-size: 14px; font-weight: 700; color: var(--ink); }
.pay-row--total .pay-row__key { color: var(--ink); font-weight: 800; }
.pay-row__total { font-size: 19px; font-weight: 800; color: var(--orange); letter-spacing: -.4px; }

/* ===== Consent checkbox ===== */
.consent { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.consent__box { position: absolute; opacity: 0; width: 0; height: 0; }
.consent__mark {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px;
  border: 1.6px solid #d9d0c8; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.consent__mark svg { opacity: 0; transition: opacity .15s; }
.consent__box:checked + .consent__mark { border-color: var(--orange); background: var(--peach-bg); }
.consent__box:checked + .consent__mark svg { opacity: 1; }
.consent__box:focus-visible + .consent__mark { box-shadow: 0 0 0 3px rgba(255, 90, 6, .2); }
.consent__text { font-size: 13px; line-height: 1.5; font-weight: 600; color: #5a6b78; }
.consent__text a { color: var(--orange); text-decoration: none; }
.consent__text b { color: var(--ink); font-weight: 800; }

.btn:disabled, .btn--disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

/* ===== Referral ===== */
.ref-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; color: #fff; box-shadow: 0 20px 40px -22px rgba(255, 90, 6, .7); }
.ref-hero__blob { position: absolute; right: -34px; top: -34px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.ref-hero__body { position: relative; }
.ref-hero__label { font-size: 12.5px; font-weight: 700; opacity: .88; }
.ref-hero__reward { font-size: 42px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.05; margin-top: 2px; }
.ref-hero__desc { font-size: 13px; font-weight: 600; opacity: .92; margin-top: 6px; max-width: 250px; line-height: 1.45; }

.ref-stats { display: flex; gap: 10px; }
.ref-stat { flex: 1; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 14px 8px; text-align: center; }
.ref-stat__num { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.ref-stat__key { font-size: 11.5px; font-weight: 700; color: var(--muted-2); margin-top: 3px; }

[hidden] { display: none !important; }

/* ===== Preloader ===== */
.preloader {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.preloader__spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3.5px solid var(--peach-border);
  border-top-color: var(--orange);
  animation: preloader-spin .7s linear infinite;
}
.preloader__brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.4px;
  color: var(--orange);
}
@keyframes preloader-spin {
  to { transform: rotate(360deg); }
}
/* Плавное исчезновение по окончании загрузки */
.preloader-leave-active { transition: opacity .35s ease; }
.preloader-leave-to { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .preloader__spinner { animation-duration: 1.4s; }
}
