/* www/panel/panel.css — веб-панель управления ботом.

   Оформление продолжает лендинг www/index.html: те же Inter, синий #2b6cb0,
   оранжевый #f6ad55, светлый фон #f7fafc с радиальными подсветками, карточки
   на белом с мягкими тенями и подъёмом по наведению. Человек, пришедший с
   сайта, попадает в тот же продукт, а не в чужую админку.

   Имена переменных остались от прежней тёмной темы (--frame, --surface, --fg…):
   на них завязаны инлайновые стили в panel.js, поэтому меняются ЗНАЧЕНИЯ, а не
   названия. Так смена темы не тянет за собой правку логики.

   Демо-сборка: данных с сервера нет, состояние живёт в panel.js. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/web/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* поверхности */
  --frame:     #f7fafc;
  --rail:      #ffffff;
  --surface:   #ffffff;
  --surface-2: #f7fafc;
  --track:     #e2e8f0;

  /* текст */
  --fg:   #1a202c;
  --fg-2: #4a5568;
  --fg-3: #718096;
  --fg-on-dark: #e2e8f0;

  /* линии */
  --line:   #edf2f7;
  --line-2: #cbd5e0;

  /* акцент — синий лендинга */
  --acc:       #2b6cb0;
  --acc-2:     #3182ce;
  --acc-deep:  #2c5282;
  --acc-soft:  #2c5282;
  --acc-light: #ebf8ff;
  --acc-ink:   #ffffff;
  --acc-wash:  rgba(43, 108, 176, 0.10);
  --acc-wash2: rgba(43, 108, 176, 0.06);
  --acc-grad:  linear-gradient(135deg, #3182ce, #2b6cb0);

  /* деньги — оранжевый лендинга */
  --money:      #dd6b20;
  --money-grad: linear-gradient(135deg, #f6ad55, #dd6b20);
  --money-wash: rgba(237, 137, 54, 0.12);

  /* семантика */
  --ok:        #2f855a;
  --ok-wash:   rgba(47, 133, 90, 0.10);
  --warn:      #dd6b20;
  --warn-wash: rgba(237, 137, 54, 0.12);
  --bad:       #c53030;
  --bad-wash:  rgba(197, 48, 48, 0.09);

  /* тёмная плашка — из блока цен на лендинге */
  --dark-grad: linear-gradient(135deg, #1a202c, #2d3748);

  --r: 12px;
  --r-s: 8px;
  --r-l: 20px;

  --sh-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --sh-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --sh-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --sh-acc: 0 20px 40px -10px rgba(43, 108, 176, 0.18);

  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Cascadia Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --side-w: 264px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ============ тёмная тема ============

   Тот же продукт, а не другой: акцент остаётся синим, деньги — оранжевыми,
   меняются только поверхности и глубина текста. Синий берём светлее (#63b3ed),
   потому что #2b6cb0 на тёмном фоне не дотягивает по контрасту.

   Тема ставится атрибутом data-theme на <html> (скрипт в <head>), поэтому
   здесь достаточно переопределить переменные — компоненты уже на них завязаны. */

:root[data-theme="dark"] {
  --frame:     #0f1521;
  --rail:      #151c2a;
  --surface:   #161e2d;
  --surface-2: #1b2333;
  --track:     #2d3748;

  --fg:   #edf2f7;
  --fg-2: #a0aec0;
  --fg-3: #718096;

  --line:   rgba(237, 242, 247, 0.09);
  --line-2: #3a465c;

  --acc:       #63b3ed;
  --acc-2:     #4299e1;
  --acc-deep:  #90cdf4;
  --acc-soft:  #bee3f8;
  --acc-light: rgba(99, 179, 237, 0.14);
  --acc-ink:   #0b1220;
  --acc-wash:  rgba(99, 179, 237, 0.16);
  --acc-wash2: rgba(99, 179, 237, 0.08);
  --acc-grad:  linear-gradient(135deg, #63b3ed, #3182ce);

  --money:      #f6ad55;
  --money-grad: linear-gradient(135deg, #f6ad55, #dd6b20);
  --money-wash: rgba(246, 173, 85, 0.14);

  --ok:        #68d391;
  --ok-wash:   rgba(104, 211, 145, 0.14);
  --warn:      #f6ad55;
  --warn-wash: rgba(246, 173, 85, 0.14);
  --bad:       #fc8181;
  --bad-wash:  rgba(252, 129, 129, 0.13);

  /* плашка должна быть СВЕТЛЕЕ страницы, иначе на тёмном фоне она исчезает */
  --dark-grad: linear-gradient(135deg, #1e2942, #26334c);

  --sh-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --sh-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --sh-acc: 0 20px 40px -12px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(at top right, rgba(56, 178, 172, 0.13) 0%, transparent 45%),
    radial-gradient(at bottom left, rgba(66, 153, 225, 0.15) 0%, transparent 45%);
}

/* поверхности, у которых цвет задан не переменной, а напрямую */
:root[data-theme="dark"] .top,
:root[data-theme="dark"] .tabs { background: rgba(21, 28, 42, 0.85); border-bottom-color: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .botsel,
:root[data-theme="dark"] .ib,
:root[data-theme="dark"] .btn-line,
:root[data-theme="dark"] .btn-bad,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .inp,
:root[data-theme="dark"] .segs,
:root[data-theme="dark"] .note,
:root[data-theme="dark"] .modal { background: var(--surface); }
:root[data-theme="dark"] .modal-scrim { background: rgba(5, 8, 14, 0.6); }
:root[data-theme="dark"] .row.on .row-mark { background: var(--surface-2); }
:root[data-theme="dark"] .nav-i.on .tail { background: var(--surface-2); }
:root[data-theme="dark"] .sw > i { background: #f7fafc; }
:root[data-theme="dark"] .ava { border-color: var(--surface); }
:root[data-theme="dark"] .toast { background: #26334c; }
:root[data-theme="dark"] .tip { background: #26334c; border: 1px solid var(--line-2); }
/* журнал должен остаться темнее карточки, а не сливаться с ней */
:root[data-theme="dark"] .log { background: #0b111c; border: 1px solid var(--line); }
:root[data-theme="dark"] .brand-mark { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .pill.warn { color: var(--warn); }
:root[data-theme="dark"] .feat.no svg { color: var(--fg-3); }
:root[data-theme="dark"] .chip.tariff.on { color: var(--ok); }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background-color: var(--frame);
  /* те же подсветки, что на лендинге: фон перестаёт быть плоской заливкой */
  background-image:
    radial-gradient(at top right, #e6fffa 0%, transparent 42%),
    radial-gradient(at bottom left, #ebf8ff 0%, transparent 42%);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.solid { fill: currentColor; stroke: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
h1, h2, h3, p { margin: 0; }
table { border-collapse: collapse; width: 100%; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 4px;
}

.kv { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ============ каркас ============ */

.shell { display: flex; height: 100%; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 36px calc(48px + var(--safe-b));
}

/* Ширину не зажимаем: на широком мониторе колонка обрывалась задолго до края.
   Верхний предел только против абсурдных 4К-ширин. Читаемость длинных абзацев
   держим не шириной страницы, а max-width на самом тексте (см. .note p, .fine). */
.page { display: flex; flex-direction: column; gap: 26px; max-width: 2200px; }

.page-h h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; }
.page-h p { font-size: 15px; color: var(--fg-2); margin-top: 8px; max-width: 720px; }
.sec-h h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }
.sec-h p { font-size: 14px; color: var(--fg-2); margin-top: 5px; }
.sec-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sec-row > :last-child.right { margin-left: auto; }

.cap {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
}

/* ============ сайдбар ============ */

.side {
  width: var(--side-w); flex: none;
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px calc(16px + var(--safe-b));
  overflow-y: auto;
}

.side-top { display: flex; align-items: center; gap: 8px; padding: 0 8px 22px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--acc-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.28);
  overflow: hidden;
}
/* Логотип круглый, поэтому скругление у подложки полное — иначе по углам
   торчал бы градиент. Подложка остаётся: если картинка не загрузилась,
   на её месте будет фирменный знак, а не пустой квадрат. */
.brand-mark { border-radius: 50%; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-txt { min-width: 0; }
/* написание логотипа как на лендинге: Fun тёмный, Cloud синий */
.brand-txt b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.brand-txt b span { color: var(--acc); }
.brand-txt i { display: block; font-style: normal; font-size: 11.5px; color: var(--fg-3); margin-top: -2px; }
/* Скрыты на десктопе. Селектор с двумя классами — намеренно: .ib объявлен
   ниже по файлу и с одиночным .side-close перебивал бы скрытие. */
.side-close.ib { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-g { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding: 0 12px; margin: 20px 0 8px; }
.nav-g:first-child { margin-top: 0; }

.nav-i {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  color: var(--fg-2); font-size: 14px; font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
  min-height: 42px;
}
.nav-i:hover { background: var(--surface-2); color: var(--fg); }
.nav-i.on { background: var(--acc-light); color: var(--acc-deep); font-weight: 600; }
.nav-i.on::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--acc);
}
.nav-i.on svg { color: var(--acc); }
.nav-i svg { flex: none; }
.nav-i .tail { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--fg-3); }
.nav-i.on .tail { color: var(--acc); }

/* строка бота в меню: имя усекается, статус и тариф всегда видны */
.nav-bot { gap: 10px; }
.nav-bot .dot { margin: 0 2px; }
.nav-bot-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.nav-bot .tail {
  flex: none; font-size: 10.5px; padding: 3px 8px; border-radius: 100px;
  background: var(--surface-2); color: var(--fg-3);
}
.nav-i.on .tail { background: #fff; color: var(--acc); }
.nav-add { color: var(--acc); font-weight: 600; }
.nav-add:hover { background: var(--acc-light); color: var(--acc-deep); }

.side-foot { margin-top: auto; padding-top: 20px; }
.bal-card {
  background: var(--dark-grad); border-radius: var(--r-l); padding: 18px;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 14px 30px -12px rgba(26, 32, 44, 0.55);
}
.bal-card::before {
  content: ''; position: absolute; top: -60%; right: -30%;
  width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(43, 108, 176, 0.45) 0%, transparent 70%);
}
.bal-card > * { position: relative; }
.bal-l { display: block; font-size: 12px; color: #a0aec0; font-weight: 500; }
.bal-v { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.8px; margin-top: 2px; }

.user { display: flex; align-items: center; gap: 11px; padding: 16px 8px 2px; }
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--acc-light); color: var(--acc);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
  border: 2px solid #fff; box-shadow: var(--sh-sm);
}
.user-txt b { display: block; font-size: 13.5px; font-weight: 600; }
.user-txt i { display: block; font-style: normal; font-size: 11.5px; color: var(--fg-3); }

.side-scrim { display: none; }

/* ============ шапка ============ */

.top {
  height: 76px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.burger.ib { display: none; }

.botsel {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px;
  border-radius: var(--r); border: 2px solid var(--line);
  background: #fff;
  font-size: 14px; font-weight: 600;
  transition: all 0.2s ease;
}
.botsel:hover { border-color: var(--acc); color: var(--acc); box-shadow: 0 4px 15px rgba(43, 108, 176, 0.08); }
.botsel svg { color: var(--fg-3); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: none; }
.dot.running { background: #38a169; box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.18); }
.dot.paused  { background: #dd6b20; box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.18); }
.dot.stopped { background: #c53030; box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.15); }

.pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: 100px;
  background: var(--acc-wash); color: var(--acc);
  border: 1px solid rgba(43, 108, 176, 0.2);
  white-space: nowrap;
}
.pill.ok   { background: var(--ok-wash);   color: var(--ok);   border-color: rgba(47, 133, 90, 0.22); }
/* текст бейджа темнее заливки: #dd6b20 на светло-оранжевом не дотягивает
   по контрасту на 11px, а сам оранжевый остаётся для полос и точек статуса */
.pill.warn { background: var(--warn-wash); color: #c05621; border-color: rgba(237, 137, 54, 0.28); }
.pill.bad  { background: var(--bad-wash);  color: var(--bad);  border-color: rgba(197, 48, 48, 0.22); }
.pill.soft { background: var(--acc-light); color: var(--acc-deep); border-color: rgba(43, 108, 176, 0.16); }
.pill.mute { background: var(--surface-2); color: var(--fg-2); border-color: var(--line); }

.top-acts { display: flex; gap: 8px; margin-left: 4px; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.top-meta .m { text-align: right; }
.top-meta .m span { display: block; font-size: 11.5px; color: var(--fg-3); font-weight: 500; }
.top-meta .m b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.vr { width: 1px; height: 30px; background: var(--line); }

/* ============ вкладки бота ============ */

/* Единственное место навигации внутри бота: раньше те же разделы дублировались
   и в сайдбаре, и плитками на «Обзоре». Полоса прокручивается по горизонтали,
   поэтому на телефоне ничего не обрезается насовсем. */
.tabs {
  flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 36px; height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.tabs-s {
  display: flex; align-items: center; gap: 4px;
  min-width: 0; flex: 1;
  overflow-x: auto; scrollbar-width: none;
  height: 100%;
}
.tabs-s::-webkit-scrollbar { display: none; }
.tabs-a { display: flex; gap: 8px; flex: none; }

.tab {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 8px;
  height: 100%; padding: 0 14px;
  font-size: 13.5px; font-weight: 500; color: var(--fg-2);
  white-space: nowrap;
  transition: color 0.18s ease;
}
.tab:hover { color: var(--fg); }
.tab.on { color: var(--acc); font-weight: 600; }
.tab.on::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 2px; border-radius: 2px 2px 0 0; background: var(--acc);
}
.tab svg { flex: none; }
.tab-n {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 100px;
  background: var(--surface-2); color: var(--fg-3);
}
.tab.on .tab-n { background: var(--acc-light); color: var(--acc); }

/* ============ кнопки ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--r);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  border: none; user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn-block { display: flex; width: 100%; margin-top: 14px; }

.btn-acc {
  background: var(--acc-grad); color: #fff;
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}
.btn-acc:hover { box-shadow: 0 6px 20px rgba(43, 108, 176, 0.4); transform: translateY(-2px); }

/* Денежные действия — оранжевые, как главный призыв на лендинге.
   Отбор по data-act, чтобы не заводить ради этого новый класс в panel.js. */
.bal-card .btn-acc,
.btn-acc[data-act="pay"],
.btn-acc[data-act="buy"],
.btn-acc[data-act="withdraw"],
.btn-acc[href="#/deposit"] {
  background: var(--money-grad);
  box-shadow: 0 4px 12px rgba(221, 107, 32, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.bal-card .btn-acc:hover,
.btn-acc[data-act="pay"]:hover,
.btn-acc[data-act="buy"]:hover,
.btn-acc[data-act="withdraw"]:hover,
.btn-acc[href="#/deposit"]:hover { box-shadow: 0 6px 20px rgba(221, 107, 32, 0.45); }

.btn-line { background: #fff; color: var(--fg); border: 2px solid var(--line); }
.btn-line:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(43, 108, 176, 0.06); }

.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }

.btn-bad { background: #fff; border: 2px solid rgba(197, 48, 48, 0.25); color: var(--bad); }
.btn-bad:hover { border-color: var(--bad); box-shadow: 0 4px 15px rgba(197, 48, 48, 0.12); transform: translateY(-2px); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; }

.ib {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: var(--r-s);
  background: #fff; border: 1px solid var(--line-2);
  font-size: 13.5px; font-weight: 600; color: var(--fg-2);
  transition: all 0.2s ease;
}
.ib:hover { color: var(--acc); border-color: var(--acc); box-shadow: 0 4px 12px rgba(43, 108, 176, 0.08); }
.ib.bad:hover { color: var(--bad); border-color: var(--bad); box-shadow: 0 4px 12px rgba(197, 48, 48, 0.1); }
.ib.sq { width: 40px; padding: 0; }
.ib[disabled] { opacity: 0.5; cursor: not-allowed; }

/* сегментированный переключатель */
.segs {
  display: flex; gap: 4px; padding: 5px;
  border-radius: 14px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--sh-sm);
  flex-wrap: wrap;
}
.seg {
  padding: 0 16px; height: 36px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--fg-2);
  display: flex; align-items: center;
  transition: all 0.18s ease;
}
.seg:hover { color: var(--acc); background: var(--acc-light); }
.seg.on { background: var(--acc-grad); color: #fff; box-shadow: 0 3px 10px rgba(43, 108, 176, 0.28); }

/* ============ карточки ============ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 26px 28px;
  box-shadow: var(--sh-sm);
}
.card.pad-s { padding: 22px 24px; }

.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 420px; }
.col { display: flex; flex-direction: column; gap: 18px; }

/* показатели */
.stat-l { font-size: 13px; color: var(--fg-2); font-weight: 500; }
.stat-v { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; line-height: 1.1; }
.stat-s { font-size: 12.5px; color: var(--fg-3); margin-top: 6px; }

.grid.g-3 > .card.pad-s, .grid.g-4 > .card.pad-s { transition: all 0.3s ease; }
.grid.g-3 > .card.pad-s:hover, .grid.g-4 > .card.pad-s:hover {
  transform: translateY(-4px); box-shadow: var(--sh-acc); border-color: var(--line-2);
}

/* ---- главная плашка тарифа: тёмная, как блок цен на лендинге ---- */

.hero {
  position: relative; overflow: hidden;
  background: var(--dark-grad);
  border: none;
  color: #fff;
  box-shadow: 0 25px 50px -12px rgba(26, 32, 44, 0.4);
  padding: 32px 34px;
}
.hero::after {
  content: ''; position: absolute; top: -55%; right: -8%;
  width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(43, 108, 176, 0.42) 0%, transparent 70%);
}
.hero > * { position: relative; z-index: 1; }

.hero .cap { color: #a0aec0; }
.hero-name { font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.hero-sub { font-size: 15px; color: #a0aec0; font-weight: 500; padding-bottom: 6px; }
.hero-figs { display: flex; align-items: flex-end; gap: 44px; margin-top: 28px; flex-wrap: wrap; }
.hero .fig-l { color: #a0aec0; }
.fig-l { font-size: 13px; color: var(--fg-2); font-weight: 500; }
.fig-v { font-size: 46px; font-weight: 800; letter-spacing: -1.6px; margin-top: 2px; line-height: 1; }
.fig-v.sm { font-size: 24px; font-weight: 700; letter-spacing: -0.6px; }

.hero .pill.ok { background: rgba(72, 187, 120, 0.18); color: #9ae6b4; border-color: rgba(72, 187, 120, 0.35); }
.hero .pill.warn { background: rgba(237, 137, 54, 0.2); color: #fbd38d; border-color: rgba(237, 137, 54, 0.4); }
.hero .note { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.hero .note p { color: #e2e8f0; }
.hero .note p b { color: #fff; }
.hero .note.warn svg { color: #f6ad55; }
.hero .split { border-top-color: rgba(255, 255, 255, 0.14); }
.hero .sw-row .t span { color: #a0aec0; }
.hero .bar { background: rgba(255, 255, 255, 0.14); }
.hero .bar > i { background: linear-gradient(90deg, #f6ad55, #f6e05e); }
.hero .bar-l { color: #a0aec0; }

.bar { height: 10px; border-radius: 100px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 100px; background: var(--acc-grad); }
.bar-l { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12.5px; color: var(--fg-3); }

.split { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }

/* тумблер */
.sw {
  width: 52px; height: 30px; border-radius: 100px; padding: 3px; flex: none;
  display: flex; background: var(--track); justify-content: flex-start;
  transition: background 0.22s ease;
}
/* ползунок едет трансформом: justify-content не анимируется, и раньше он
   перескакивал из края в край рывком */
.sw > i {
  width: 24px; height: 24px; border-radius: 50%; background: #fff; display: block;
  box-shadow: var(--sh-sm);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.sw.on { background: linear-gradient(135deg, #f6ad55, #dd6b20); }
.sw.on > i { transform: translateX(22px); }
.hero .sw { background: rgba(255, 255, 255, 0.18); }
.hero .sw.on { background: linear-gradient(135deg, #f6ad55, #dd6b20); }
.sw-row { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; min-height: 48px; }
.sw-row .t b { display: block; font-size: 15px; font-weight: 600; }
.sw-row .t span { display: block; font-size: 13px; color: var(--fg-2); margin-top: 3px; }
.sw-row .sw { margin-left: auto; }

/* ---- тарифные карточки ---- */

.tcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 26px 24px; text-align: left;
  box-shadow: var(--sh-sm);
  transition: all 0.3s ease;
}
.tcard:hover { transform: translateY(-5px); box-shadow: var(--sh-acc); border-color: var(--line-2); }
.tcard.on {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px var(--acc), 0 22px 44px -12px rgba(43, 108, 176, 0.32);
}
.tcard.on::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--r-l); pointer-events: none;
  background: linear-gradient(180deg, rgba(43, 108, 176, 0.05), transparent 45%);
}
.tcard.locked { opacity: 0.62; box-shadow: none; }
.tcard.locked:hover { transform: none; box-shadow: none; border-color: var(--line); }

.tprice { display: flex; align-items: flex-end; gap: 7px; margin-top: 18px; }
.tprice b { font-size: 36px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.tprice span { font-size: 14px; color: var(--fg-2); padding-bottom: 3px; }
.tdaily { font-size: 13px; color: var(--fg-3); margin-top: 6px; }
.tsave { height: 26px; margin-top: 12px; }

.feats { display: flex; flex-direction: column; gap: 11px; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.feat { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.feat svg { flex: none; margin-top: 2px; }
.feat.yes { color: var(--fg); }
.feat.yes svg { color: #38a169; }
.feat.no { color: var(--fg-3); }
.feat.no svg { color: var(--line-2); }
.hero .feat.yes { color: #fff; }
.hero .feat.no { color: #a0aec0; }

/* ---- заметки ---- */

.note {
  display: flex; gap: 12px; padding: 16px 20px; border-radius: var(--r);
  border: 1px solid var(--line); background: #fff;
}
.note svg { flex: none; margin-top: 2px; color: var(--fg-3); }
.note p { font-size: 13.5px; line-height: 1.6; color: var(--fg-2); max-width: 96ch; }
.note p b { color: var(--fg); font-weight: 700; }
.note.warn { background: var(--warn-wash); border-color: rgba(237, 137, 54, 0.3); }
.note.warn svg { color: var(--warn); }
.note.bad { background: var(--bad-wash); border-color: rgba(197, 48, 48, 0.24); }
.note.bad svg { color: var(--bad); }
.note.acc { background: var(--acc-light); border-color: rgba(43, 108, 176, 0.18); }
.note.acc svg { color: var(--acc); }
.note.ok { background: var(--ok-wash); border-color: rgba(47, 133, 90, 0.22); }
.note.ok svg { color: var(--ok); }
.fine { font-size: 13px; color: var(--fg-3); line-height: 1.65; max-width: 96ch; }

/* ============ списки строк ============ */

.rows { display: flex; flex-direction: column; gap: 12px; }
.row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; min-height: 76px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); text-align: left; width: 100%;
  box-shadow: var(--sh-sm);
  transition: all 0.25s ease;
}
.row:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(43, 108, 176, 0.16); border-color: var(--line-2); }
.row.on { border-color: var(--acc); background: var(--acc-light); box-shadow: 0 8px 20px -8px rgba(43, 108, 176, 0.28); }

.row-mark {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: var(--acc-light); color: var(--acc);
  display: flex; align-items: center; justify-content: center;
}
.row-mark.mute { background: var(--surface-2); color: var(--fg-3); }
.row-mark.ok { background: var(--ok-wash); color: var(--ok); }
.row-mark.warn { background: var(--warn-wash); color: var(--warn); }
.row.on .row-mark { background: #fff; box-shadow: var(--sh-sm); }

.row-txt { min-width: 0; flex: 1; }
.row-txt b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-txt span { display: block; font-size: 13px; color: var(--fg-2); margin-top: 3px; }
.row-end { margin-left: auto; flex: none; display: flex; align-items: center; gap: 12px; }
.row-end .kv b { display: block; font-size: 17px; font-weight: 700; text-align: right; letter-spacing: -0.3px; }
.row-end .kv span { display: block; font-size: 12px; color: var(--fg-3); text-align: right; margin-top: 2px; }

.chev { color: var(--line-2); flex: none; }
.row:hover .chev { color: var(--acc); }

/* ============ сводка по аккаунту (правая колонка) ============ */

.acct-head { display: flex; align-items: center; gap: 14px; }
.acct-head .ava { width: 46px; height: 46px; font-size: 15px; }
.acct-head b { display: block; font-size: 16px; font-weight: 700; }
.acct-head span { display: block; font-size: 12.5px; color: var(--fg-3); }

.acct-bal {
  margin-top: 20px; padding: 18px 20px; border-radius: var(--r);
  background: var(--dark-grad); color: #fff;
  position: relative; overflow: hidden;
}
.acct-bal::before {
  content: ''; position: absolute; top: -70%; right: -25%;
  width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(43, 108, 176, 0.45) 0%, transparent 70%);
}
.acct-bal > * { position: relative; }
.acct-bal .l { font-size: 12.5px; color: #a0aec0; font-weight: 500; }
.acct-bal .v { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 2px; line-height: 1.1; }
.acct-bal .s { font-size: 12.5px; color: #a0aec0; margin-top: 6px; }

.acct-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.acct-l { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.acct-l > span:first-child { color: var(--fg-2); }
.acct-l > b { margin-left: auto; font-weight: 700; text-align: right; }
.acct-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ============ экран бота ============ */

.bot-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.bot-ava {
  position: relative; flex: none;
  width: 62px; height: 62px; border-radius: 18px;
  background: var(--acc-light); color: var(--acc);
  display: flex; align-items: center; justify-content: center;
}
.bot-ava .dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 16px; height: 16px; border: 3px solid #fff;
}

.bot-id { min-width: 0; flex: 1; }
.bot-id h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.7px; line-height: 1.15; }
.bot-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; font-size: 13px; color: var(--fg-2);
}
.bot-meta > span:not(.pill) { white-space: nowrap; }

.bot-ops { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* проверки состояния — главный смысл экрана «Обзор» */
.hcs { display: flex; flex-direction: column; margin-top: 6px; }
.hc { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.hc:first-child { border-top: 0; }
.hc-m {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.hc-m.ok { background: var(--ok-wash); color: var(--ok); }
.hc-m.warn { background: var(--warn-wash); color: var(--warn); }
.hc-m.bad { background: var(--bad-wash); color: var(--bad); }
.hc-t { min-width: 0; }
.hc-t b { display: block; font-size: 14px; font-weight: 600; }
.hc-t span { display: block; font-size: 12.5px; color: var(--fg-2); margin-top: 2px; }

/* журнал: тёмный блок внутри белой карточки — как консоль, но в языке панели */
.log {
  margin-top: 18px; padding: 16px 18px;
  background: #1a202c; border-radius: var(--r);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  overflow-x: auto;
}
.log-l { display: flex; gap: 12px; white-space: nowrap; }
.log-t { color: #718096; flex: none; }
.log-v { flex: none; font-weight: 700; width: 46px; }
.log-v.info { color: #63b3ed; }
.log-v.warn { color: #f6ad55; }
.log-v.error { color: #fc8181; }
.log-m { color: #e2e8f0; }

/* датчики ресурсов */
.gauge { margin-top: 16px; }
.gauge-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.gauge-h span { color: var(--fg-2); }
.gauge-h b { font-weight: 700; font-size: 13px; }

/* карточка удаления: красная только рамкой, чтобы не кричать раньше времени */
.card.danger { border-color: rgba(197, 48, 48, 0.28); }
.row-mark.bad-mark { background: var(--bad-wash); color: var(--bad); }

/* ============ лента событий ============ */

.feed { display: flex; flex-direction: column; margin-top: 6px; }
.feed-i {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.feed-i:first-child { border-top: 0; }
.feed-i .row-mark { width: 40px; height: 40px; border-radius: 12px; }
.feed-e { margin-left: auto; flex: none; text-align: right; }
.feed-e b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.feed-e span { display: block; font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ============ таблица ============ */

.th { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); padding: 0 0 14px; text-align: left; }
.td { font-size: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.td.r { text-align: right; }
.tx-i { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.tx-m { width: 32px; height: 32px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; }

/* ============ график ============ */

.chart { display: flex; gap: 16px; margin-top: 24px; }
.chart-y { width: 50px; flex: none; height: 180px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 12px; color: var(--fg-3); }
.chart-b { flex: 1; min-width: 0; }
.plot { position: relative; height: 180px; }
.grid-l { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.grid-l i { display: block; height: 1px; background: var(--line); }
.grid-l i:last-child { background: var(--line-2); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.bar-c { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-c > i { display: block; border-radius: 5px 5px 0 0; background: var(--acc-grad); }
.bar-c.payg > i { background: var(--money-grad); }
.bar-c.off > i { background: var(--track); }
.bar-c:hover > i { filter: brightness(1.12); }
.tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: #1a202c; color: #fff; border: none;
  border-radius: 10px; padding: 9px 13px; font-size: 12.5px; line-height: 1.45;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease; z-index: 3;
  box-shadow: 0 12px 28px rgba(26, 32, 44, 0.28);
}
.bar-c:hover .tip { opacity: 1; }
.chart-x { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--fg-3); }
.legend { margin-left: auto; display: flex; gap: 20px; font-size: 12.5px; color: var(--fg-2); flex-wrap: wrap; font-weight: 500; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: block; }

/* ============ поля ============ */

.field { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; }
.field-t { min-width: 0; flex: 1; }
.field-t b { display: block; font-size: 15px; font-weight: 600; }
.field-t span { display: block; font-size: 13.5px; color: var(--fg-2); margin-top: 5px; word-break: break-all; }
.inp {
  width: 100%; height: 48px; padding: 0 16px;
  border-radius: var(--r); border: 2px solid var(--line);
  background: #fff; color: var(--fg); font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inp:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.1); outline: none; }
textarea.inp { height: auto; padding: 12px 16px; resize: vertical; min-height: 96px; }

/* ============ модальное окно ============ */

.modal-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(26, 32, 44, 0.4); backdrop-filter: blur(4px); }
.modal {
  position: relative; width: 100%; max-width: 520px;
  background: #fff; border: none;
  border-radius: 24px; padding: 30px 32px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(26, 32, 44, 0.35);
}
.modal.wide { max-width: 940px; padding: 0; }
.modal h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.modal .sub { font-size: 14px; color: var(--fg-2); margin-top: 6px; }
.modal-acts { display: flex; gap: 12px; margin-top: 26px; }
.modal-acts .btn { flex: 1; }

/* чек оформления */
.co { display: grid; grid-template-columns: minmax(0, 1fr) 348px; }
.co-l { padding: 28px 30px; display: flex; flex-direction: column; gap: 24px; }
.co-r { border-left: 1px solid var(--line); background: var(--surface-2); padding: 28px 30px; display: flex; flex-direction: column; }
.co-h { display: flex; align-items: center; gap: 14px; padding: 24px 30px; border-bottom: 1px solid var(--line); }
.co-sum { display: flex; flex-direction: column; gap: 13px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.co-sum .l { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.co-sum .l span { color: var(--fg-2); }
.co-sum .l b { font-weight: 700; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 2px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--fg-2);
  display: flex; align-items: center;
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--line-2); color: var(--fg); }
.chip.on { border-color: var(--acc); background: var(--acc-light); color: var(--acc-deep); box-shadow: 0 4px 12px rgba(43, 108, 176, 0.12); }
/* суммы, равные месячной цене тарифа бота — зелёные, как в боте */
.chip.tariff { border-color: rgba(47, 133, 90, 0.35); color: var(--ok); }
.chip.tariff:hover { border-color: var(--ok); }
.chip.tariff.on { border-color: var(--ok); background: var(--ok-wash); color: #276749; box-shadow: 0 4px 12px rgba(47, 133, 90, 0.14); }

/* ввод своей суммы */
.own { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.own-f { position: relative; flex: 1; min-width: 200px; display: block; }
.own-f .inp { padding-right: 44px; font-size: 17px; font-weight: 700; }
.own-c {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--fg-3); font-size: 15px; font-weight: 600; pointer-events: none;
}

.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease; }
.radio i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  background: var(--acc); transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.row.on .radio { border-color: var(--acc); }
.row.on .radio i { transform: scale(1); }

/* ============ уведомления ============ */

.toasts {
  position: fixed; z-index: 60; right: 24px; bottom: calc(24px + var(--safe-b));
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 20px; border-radius: var(--r);
  background: #1a202c; color: #fff;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 16px 32px -8px rgba(26, 32, 44, 0.4);
  animation: pop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast svg { flex: none; color: #63b3ed; }
.toast.ok svg { color: #68d391; }
.toast.bad svg { color: #fc8181; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }

/* ============ порог доступа ============

   Экран кода занимает всё окно: сайдбар и шапка на нём не рисуются вовсе,
   чтобы по разметке нельзя было понять, что внутри. */

body.gate-on .side,
body.gate-on .top,
body.gate-on .tabs { display: none; }
body.gate-on .view { padding: 0; overflow: hidden; }

.gate {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 40px 36px;
  box-shadow: var(--sh-lg);
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.gate-mark {
  width: 68px; height: 68px; margin: 0 auto 22px;
  border-radius: 50%; overflow: hidden;
  background: var(--acc-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(43, 108, 176, 0.3);
}
.gate-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gate-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; }
.gate-card > p { font-size: 14px; color: var(--fg-2); margin-top: 10px; line-height: 1.6; }
.gate-form { display: flex; gap: 10px; margin-top: 24px; }
.gate-form .inp { flex: 1; text-align: center; letter-spacing: 0.12em; }
.gate-msg { font-size: 13.5px; margin-top: 16px; font-weight: 500; }
.gate-msg.bad { color: var(--bad); }
.gate-foot { margin-top: 24px; }
.gate-foot a { color: var(--acc); }

@media (max-width: 480px) {
  .gate-card { padding: 30px 22px; border-radius: 20px; }
  .gate-form { flex-direction: column; }
}

/* Действие, которое пока делается только в боте. Кнопку НЕ убираем и не
   выключаем через pointer-events: человек должен по ней кликнуть и получить
   ответ «это в боте», а не тыкать в мёртвый элемент. */
.gated {
  opacity: 0.55;
  filter: grayscale(0.6);
  box-shadow: none !important;
}
.gated:hover { transform: none !important; box-shadow: none !important; }
.gated svg:last-child { margin-left: 2px; opacity: 0.8; }

/* демо-метка: панель показывает выдуманные данные, и это должно быть видно */
.demo {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 100px;
  border: 1px dashed var(--line-2); color: var(--fg-3);
}
/* режим «просмотр»: данные настоящие, изменения пока в боте */
.demo.live { border-style: solid; border-color: rgba(43,108,176,.28); color: var(--acc); background: var(--acc-light); }

/* ============ движение ============

   Один поставленный вход на экран: блоки страницы всплывают лесенкой, полосы
   и цифры дорастают до значения. Внутри экрана перерисовки (переключение
   периода, тумблеры) НЕ анимируются — иначе интерфейс дёргался бы на каждый
   клик. Вход включает класс .is-entering, который ставится только при смене
   маршрута. Всё движение выключается при prefers-reduced-motion. */

@keyframes rise    { from { opacity: 0; transform: translateY(16px); } }
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.2); }
  50%      { box-shadow: 0 0 0 7px rgba(56, 161, 105, 0.04); }
}
@keyframes sheen {
  from { transform: translateX(-120%); }
  to   { transform: translateX(220%); }
}

/* вход страницы */
.view.is-entering .page > * {
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.view.is-entering .page > *:nth-child(1) { animation-delay: 0.02s; }
.view.is-entering .page > *:nth-child(2) { animation-delay: 0.07s; }
.view.is-entering .page > *:nth-child(3) { animation-delay: 0.12s; }
.view.is-entering .page > *:nth-child(4) { animation-delay: 0.17s; }
.view.is-entering .page > *:nth-child(5) { animation-delay: 0.22s; }
.view.is-entering .page > *:nth-child(6) { animation-delay: 0.27s; }
.view.is-entering .page > *:nth-child(n + 7) { animation-delay: 0.32s; }

/* карточки и строки въезжают поимённо, а не общим блоком */
.view.is-entering .page > .grid,
.view.is-entering .page > .rows { animation: none; }
.view.is-entering .page > .grid > *,
.view.is-entering .page > .rows > * {
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.view.is-entering .page > .grid > *:nth-child(1),
.view.is-entering .page > .rows > *:nth-child(1) { animation-delay: 0.08s; }
.view.is-entering .page > .grid > *:nth-child(2),
.view.is-entering .page > .rows > *:nth-child(2) { animation-delay: 0.14s; }
.view.is-entering .page > .grid > *:nth-child(3),
.view.is-entering .page > .rows > *:nth-child(3) { animation-delay: 0.2s; }
.view.is-entering .page > .grid > *:nth-child(4),
.view.is-entering .page > .rows > *:nth-child(4) { animation-delay: 0.26s; }
.view.is-entering .page > .grid > *:nth-child(5),
.view.is-entering .page > .rows > *:nth-child(5) { animation-delay: 0.32s; }
.view.is-entering .page > .grid > *:nth-child(6),
.view.is-entering .page > .rows > *:nth-child(6) { animation-delay: 0.38s; }
.view.is-entering .page > .grid > *:nth-child(n + 7),
.view.is-entering .page > .rows > *:nth-child(n + 7) { animation-delay: 0.44s; }

/* Содержимое карточек тоже въезжает лесенкой. Без этого вкладки без графиков
   и крупных чисел выглядели статично: всплывала одна большая карточка, а
   строки внутри появлялись разом.

   Колонки (.col) сами не едут — вместо них по очереди едут карточки внутри,
   иначе правая колонка «Пополнения» поднималась одним куском. Список ниже
   собран через :is(), чтобы не плодить полсотни строк на каждый шаг задержки. */
.view.is-entering .col,
.view.is-entering .rows { animation: none; }

.view.is-entering :is(
  .col > *,
  .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge,
  .co-sum .l, .chips > .chip, .rows > .row, tbody tr
) {
  animation: rise 0.42s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.view.is-entering :is(.col > *, .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge, .co-sum .l, .chips > .chip, .rows > .row, tbody tr):nth-child(1) { animation-delay: 0.14s; }
.view.is-entering :is(.col > *, .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge, .co-sum .l, .chips > .chip, .rows > .row, tbody tr):nth-child(2) { animation-delay: 0.2s; }
.view.is-entering :is(.col > *, .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge, .co-sum .l, .chips > .chip, .rows > .row, tbody tr):nth-child(3) { animation-delay: 0.26s; }
.view.is-entering :is(.col > *, .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge, .co-sum .l, .chips > .chip, .rows > .row, tbody tr):nth-child(4) { animation-delay: 0.32s; }
.view.is-entering :is(.col > *, .field, .hc, .feed-i, .log-l, .feat, .acct-l, .gauge, .co-sum .l, .chips > .chip, .rows > .row, tbody tr):nth-child(n + 5) { animation-delay: 0.38s; }

/* блик по тёмной плашке — один раз на входе, не циклом */
.view.is-entering .hero::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: sheen 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.25s backwards;
  pointer-events: none; z-index: 2;
}

/* полосы дорастают до значения: ширина/высота ставится из panel.js после кадра */
.bar > i { transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.bar-c > i { transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

/* живой статус: пульсирует только «работает» */
.dot.running { animation: livePulse 2.4s ease-in-out infinite; }

/* модалка и уведомления */
.modal { animation: modalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-scrim { animation: fadeIn 0.2s ease; }
.toast { animation: toastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1); }

/* кнопка в работе: операция с ботом идёт не мгновенно */
.spin {
  width: 15px; height: 15px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: block;
  animation: spin 0.7s linear infinite;
}
.ib.busy, .btn.busy { opacity: 0.75; pointer-events: none; }

/* плавные смены состояний, которые задаются инлайново из panel.js */
.tcard, .row, .seg, .chip, .sw, .radio i, .nav-i { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .view.is-entering .hero::before { display: none; }
}

/* ============ адаптив ============ */

@media (max-width: 1240px) {
  .g-side { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co { grid-template-columns: minmax(0, 1fr); }
  .co-r { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .side {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 60px rgba(26, 32, 44, 0.25);
  }
  body.side-open .side { transform: none; }
  body.side-open .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(26, 32, 44, 0.4); backdrop-filter: blur(4px);
  }
  .side-close.ib { display: inline-flex; }
  .burger.ib { display: inline-flex; }
  .top { padding: 0 18px; gap: 10px; height: 68px; }
  .top-acts { display: none; }
  .tabs { padding: 0 12px 0 18px; gap: 10px; height: 52px; }
  .tab { padding: 0 12px; font-size: 13px; }
  .view { padding: 22px 18px calc(36px + var(--safe-b)); }
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .page-h h1 { font-size: 25px; letter-spacing: -0.6px; }
  .hero { padding: 26px 24px; }
  .hero-name { font-size: 32px; }
  .fig-v { font-size: 38px; }
}

@media (max-width: 620px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  /* в списках на телефоне остаётся суть строки: имя и статус.
     Денежная подпись и второй бейдж выталкивали бы имя за край. */
  .row-end .kv { display: none; }
  .row-end .pill + .pill { display: none; }

  /* шапка на 360px: бургер, имя бота и баланс — всё остальное лишнее */
  .top { padding: 0 12px; gap: 8px; height: 62px; }
  .top-meta .m:first-child { display: none; }
  .top-meta .vr { display: none; }
  .top-meta { gap: 10px; }
  .botsel .pill { display: none; }
  .botsel { height: 40px; padding: 0 12px; font-size: 13.5px; min-width: 0; }
  /* длинное имя бота обязано усечься, а не вытолкнуть баланс за край */
  .botsel > span:nth-child(2) {
    max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .demo { display: none; }

  .view { padding: 18px 14px calc(32px + var(--safe-b)); }
  .page { gap: 20px; }
  .page-h h1 { font-size: 23px; }
  .page-h p { font-size: 14px; }
  .card { padding: 20px 18px; border-radius: 16px; }
  .card.pad-s { padding: 18px; }

  .hero-figs { gap: 26px; }
  .fig-v { font-size: 32px; }
  .stat-v { font-size: 27px; }
  .tprice b { font-size: 30px; }

  /* строки и лента: даём тексту место, отбирая его у отступов и иконок */
  .row { padding: 14px 16px; min-height: 68px; gap: 12px; }
  .row-mark { width: 40px; height: 40px; border-radius: 12px; }
  .feed-i { gap: 12px; padding: 14px 0; }
  .feed-i .row-mark { width: 36px; height: 36px; border-radius: 11px; }
  .feed-e b { font-size: 14px; }

  /* «Источник» в истории операций — первая колонка, которой можно
     пожертвовать: то же самое написано в названии операции */
  .td:nth-child(3), .th:nth-child(3) { display: none; }
  .td { font-size: 13px; padding: 13px 0; }

  .chart { gap: 10px; }
  .chart-y { width: 40px; font-size: 11px; }

  /* на телефоне у вкладок остаётся только прокручиваемая полоса разделов:
     управление ботом переезжает под его имя на экране «Обзор» */
  .tabs { padding: 0 10px 0 14px; gap: 8px; }
  .tab svg { display: none; }
  .tab { padding: 0 11px; }
  /* кнопки управления остаются доступны с любой вкладки, но без подписей */
  .tabs-a .ops-l { display: none; }
  .tabs-a .ib { width: 38px; padding: 0; gap: 0; }

  /* шапка бота: имя, статус, потом кнопки на всю ширину — так они
     остаются нажимаемыми пальцем, а не сжимаются в полоски */
  .bot-head { gap: 16px; }
  .bot-ava { width: 52px; height: 52px; border-radius: 15px; }
  .bot-id h1 { font-size: 22px; }
  .bot-meta { gap: 8px; font-size: 12.5px; }
  .bot-ops { margin-left: 0; width: 100%; }
  .bot-ops .btn { flex: 1; padding: 0 12px; }
  .hc { gap: 12px; padding: 12px 0; }
  .log { font-size: 11.5px; padding: 14px; }

  .modal { padding: 22px; border-radius: 20px; }
  .modal h3 { font-size: 19px; }
  .modal-acts { flex-direction: column; }
  .co-l, .co-r, .co-h { padding: 20px; }
  .toasts { right: 14px; left: 14px; align-items: stretch; }
  .btn { height: 44px; padding: 0 18px; }
  .segs { width: 100%; }
  .seg { flex: 1; justify-content: center; padding: 0 10px; }
}

/* совсем узкие экраны (360px и меньше) */
@media (max-width: 380px) {
  .top-meta .m { display: none; }
  .legend { gap: 10px; font-size: 11.5px; }
  .chips .chip { flex: 1; justify-content: center; }
}
