/* ============================================================
   RoboVitrina — дизайн-система (общий файл для всех страниц)
   Тёмная тема. Цвета Т-Инвестиций: #FFDD2D / #11151B. Дух OKX.
   Mobile-first: базовые стили — под телефон, десктоп — через
   min-width media queries.
   White-label: бренд и цвета — в :root ниже, заменяются точечно.
   ============================================================ */

:root {
  /* Бренд (white-label: менять здесь) */
  --brand-name: "RoboVitrina";

  /* Палитра (из фирменного гайда Т-Инвестиций) */
  --yellow: #FFDD2D;
  --yellow-soft: #FFEE96;
  --ink: #11151B;        /* фирменный тёмный — базовый фон */
  --text: #E8E5EC;
  --muted: #A1A1B2;
  --muted-2: #6A6A7C;

  /* Поверхности тёмной темы */
  --surface: #1B212B;    /* карточки */
  --surface-2: #232A36;  /* приподнятые элементы внутри карточек */
  --surface-3: #41414D;  /* чипы, теги (фирменный серый) */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Семантика (из гайда: «для цифр») */
  --green: #73B077;
  --red: #FF7B76;

  /* Радиусы — крупные «плашки» как в шаблоне */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  /* Типографика — системный стек, без внешних CDN */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --container: 1160px;
}

/* ---------- База ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* защита от горизонтальной «гуляющей» прокрутки на мобильных */
html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--ink);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  /* не выходить за видимую область даже при верт. скроллбаре
     (защита от горизонтальной прокрутки на узких окнах) */
  max-width: min(var(--container), 100vw - 16px);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 56px 0; }

.section-title {
  font-size: clamp(26px, 5.6vw, 44px);
  font-weight: 800;
}
.section-lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
  margin-bottom: 32px;
}

.hidden { display: none !important; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--r-md);
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--yellow); color: #11151B; }
.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.btn-dark { background: var(--surface-3); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 123, 118, 0.5);
}
.btn-danger:hover { background: rgba(255, 123, 118, 0.1); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: var(--r-sm); }
.btn-lg { padding: 17px 34px; font-size: 17px; }

.btn[disabled], .btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 21, 27, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border-radius: 10px;
  color: #11151B;
}
.logo-mark svg { width: 20px; height: 20px; }

.main-nav {
  display: none; /* mobile: меню в бургере */
  gap: 26px;
  margin-left: 8px;
}
.main-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--yellow); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-user {
  display: none;
  font-size: 14px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  /* тап-зона как у кнопок .btn-sm рядом: одинаковая высота на мобильных */
  min-height: 40px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 20px 20px;
  background: var(--ink);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 12px 4px;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu .header-user { display: block; padding: 12px 4px 0; }

/* ---------- Герой ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 64px;
  background-color: var(--ink);
  /* White-label: hero-фон подменяется здесь */
  background-image:
    linear-gradient(90deg,
      rgba(17, 21, 27, 0.96) 0%,
      rgba(17, 21, 27, 0.88) 42%,
      rgba(17, 21, 27, 0.45) 75%,
      rgba(17, 21, 27, 0.55) 100%),
    linear-gradient(0deg,
      var(--ink) 0%,
      rgba(17, 21, 27, 0.6) 12%,
      rgba(17, 21, 27, 0) 30%),
    var(--hero-bg, url("img/hero-robot-violet.png"));
  background-size: cover;
  background-position: center right;
}
.hero::before {
  /* лёгкая техническая сетка поверх фона, с затуханием */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 70%, transparent);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.25) 70%, transparent);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero-title {
  font-size: clamp(34px, 8vw, 64px);
  font-weight: 800;
  max-width: 14ch;
}
.hero-title .accent { color: var(--yellow); }
.hero-lead {
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 44px;
  margin-top: 44px;
}
.hero-stat .num {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.02em;
}
.hero-stat .lbl { color: var(--muted); font-size: 14px; }

/* ---------- Карточки / плашки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px;
}
.card-pad-lg { padding: 30px; }

.grid { display: grid; gap: 18px; }
/* Резиновая двухколоночная сетка: вторая колонка — только когда
   колонке хватает ~340px, иначе сама складывается в одну */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3, .grid-4 { grid-template-columns: 1fr; }

/* Витрина: резиновая сетка — вторая колонка появляется, только
   когда карточке реально хватает ~380px. На узком окне карточки
   сами перестраиваются в одну колонку, ничего не обрезается. */
.grid-kits {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

/* ---------- Карточка комплекта (витрина) ---------- */

.kit-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.kit-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 221, 45, 0.35);
}
.kit-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kit-card h3 { font-size: 21px; margin: 0; }
.kit-tag {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(255, 221, 45, 0.1);
  border-radius: 999px;
  padding: 5px 12px;
}
.kit-desc { color: var(--muted); font-size: 15px; margin: 0; min-height: 3em; }

.kit-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 16px 14px;
}
.metric .val {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.metric .val.pos { color: var(--green); }
.metric .val.neg { color: var(--red); }
.metric .val.neu { color: var(--text); }
.metric .key {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.kit-source {
  font-size: 12px;
  color: var(--muted-2);
  margin: -6px 0 0;
}
.kit-card .btn { margin-top: auto; }

/* Пресеты настроек в карточке комплекта */
.preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preset-row .preset-chips { flex: 1; min-width: 0; }
/* Если пресетов > 3 — края ряда подсвечивают, что есть ещё */
.preset-row.many .preset-chips {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.preset-arrow {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.preset-arrow:hover { color: var(--yellow); border-color: var(--yellow); }
.preset-arrow.disabled { opacity: 0.25; pointer-events: none; }
.preset-arrow svg { display: block; }

.preset-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.preset-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #11151B;
}
.preset-label {
  font-size: 12px;
  color: var(--muted-2);
  margin: 0 0 -4px;
}

/* Эквити-график в карточке комплекта */
.kit-equity {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 14px 14px 10px;
}
.kit-equity svg { display: block; width: 100%; height: 110px; }
.kit-equity-cap {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Шаги «Как это работает» ---------- */

.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
}
.step-num {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--yellow);
  color: #11151B;
  font-weight: 800;
  font-size: 19px;
  display: grid;
  place-items: center;
}
.step h3 { font-size: 18px; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Блок доверия ---------- */

.trust-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 30px 24px 26px;
  text-align: center;
}
.trust-card .ico {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  color: var(--yellow);
  display: grid;
  place-items: center;
}
.trust-card .ico svg { width: 100%; height: 100%; }
.trust-card h3 { font-size: 17px; }
.trust-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Дисклеймер ---------- */

.disclaimer {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.disclaimer strong { color: var(--text); }

/* ---------- Подвал ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 32px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
}
.footer-grid { display: grid; gap: 28px; }
.site-footer h4 {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
}
.footer-links a {
  display: block;
  color: var(--muted);
  padding: 4px 0;
}
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted-2);
}

/* ---------- Формы ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.form-title { font-size: 26px; text-align: center; }
.form-lead { color: var(--muted); text-align: center; font-size: 14px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 7px;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus {
  outline: none;
  border-color: var(--yellow);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field .err-text { font-size: 12px; color: var(--red); margin-top: 6px; }

.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.checkbox input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--yellow);
  margin-top: 1px;
}

.form-alt {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
}

/* Центрированный узкий экран (auth) */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

/* Спиннер проверки ключа */
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--yellow);
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Бегунок развёртывания роботов: бежит, пока ждём ответ ядра */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 18px 0;
}
.progress-runner {
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: var(--yellow);
  animation: runSlide 1.3s ease-in-out infinite;
}
@keyframes runSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

/* Список счетов брокера (радио-карточки) */
.account-list { display: grid; gap: 10px; margin: 18px 0 22px; }
.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.account-item:has(input:checked) { border-color: var(--yellow); }
.account-item input { width: 18px; height: 18px; accent-color: var(--yellow); flex: none; }
.account-item .acc-name { font-weight: 600; font-size: 15px; }
.account-item .acc-sum { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Плашка-инструкция в форме */
.info-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 22px;
}
.info-box svg { width: 20px; height: 20px; flex: none; color: var(--yellow); margin-top: 1px; }
.info-box a { color: var(--yellow); }

/* ---------- Бейджи статусов ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-ok   { color: var(--green); background: rgba(115, 176, 119, 0.13); }
.badge-err  { color: var(--red);   background: rgba(255, 123, 118, 0.13); }
.badge-warn { color: var(--yellow); background: rgba(255, 221, 45, 0.12); }
.badge-off  { color: var(--muted); background: rgba(255, 255, 255, 0.07); }

/* ---------- Алерты ---------- */

.alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: var(--r-lg);
  padding: 16px 20px;
  font-size: 14px;
  margin-bottom: 20px;
}
.alert .ico { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin: 0; color: inherit; opacity: 0.85; }

.alert-err {
  background: rgba(255, 123, 118, 0.1);
  border: 1px solid rgba(255, 123, 118, 0.35);
  color: #FFC0BE;
}
.alert-ok {
  background: rgba(115, 176, 119, 0.1);
  border: 1px solid rgba(115, 176, 119, 0.35);
  color: #C4E3C7;
}
.alert-warn {
  background: rgba(255, 221, 45, 0.08);
  border: 1px solid rgba(255, 221, 45, 0.3);
  color: #F5E9B8;
}

/* ---------- Кабинет: статус-блок и портфель ---------- */

.cabinet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 24px;
}
.cabinet-head h1 { font-size: clamp(26px, 5vw, 36px); margin: 0; }
.cabinet-head .sub { color: var(--muted); font-size: 14px; }

.status-strip {
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.status-item .lbl {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.status-item .val { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }

.portfolio-summary { text-align: left; }
.portfolio-summary .big {
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.portfolio-summary .delta { font-size: 15px; font-weight: 700; }
.portfolio-summary .delta.pos { color: var(--green); }
.portfolio-summary .delta.neg { color: var(--red); }

.alloc-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  margin: 14px 0 10px;
}
.alloc-bar .seg-robots { background: var(--yellow); }
.alloc-bar .seg-free { background: var(--surface-3); }
.alloc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13px;
  color: var(--muted);
}
.alloc-legend b { color: var(--text); font-weight: 700; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-y { background: var(--yellow); }
.dot-g { background: var(--surface-3); }

/* ---------- Карточки комплектов в кабинете ---------- */

.kit-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.kit-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 6px;
}
.kit-panel-head h3 { margin: 0; font-size: 19px; }
.kit-panel-head .actions { margin-left: auto; display: flex; gap: 8px; }
.kit-panel-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.kit-panel-meta b { color: var(--text); }

.robot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  font-size: 14px;
}
.robot-row:last-child { margin-bottom: 0; }
.robot-row .name { font-weight: 700; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13.5px; }
.robot-row .stat { color: var(--muted); font-size: 13px; }
.robot-row .stat b { color: var(--text); }
.robot-row .pnl { margin-left: auto; font-weight: 800; }
.robot-row .pnl.pos { color: var(--green); }
.robot-row .pnl.neg { color: var(--red); }

/* ---------- Пустые состояния ---------- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
}
.empty-state .ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(255, 221, 45, 0.1);
  color: var(--yellow);
  display: grid;
  place-items: center;
}
.empty-state h3 { font-size: 20px; }
.empty-state p { color: var(--muted); font-size: 14px; max-width: 42ch; margin: 0 auto 20px; }

/* ---------- Таблицы (админка) ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}
table.data th, table.data td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-2);
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-weight: 700; }

/* ---------- Дашборд ---------- */

.page-wrap { padding: 40px 0 72px; }
.page-title { font-size: clamp(26px, 4vw, 34px); margin-bottom: 6px; }
.page-lead { color: var(--muted); margin-bottom: 28px; }

.status-grid { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 760px) { .status-grid { grid-template-columns: repeat(3, 1fr); } }

.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.status-card .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.status-card .val { font-size: 18px; font-weight: 700; }
.status-card .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Портфель: распределение */
.pf-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  margin: 14px 0 10px;
}
.pf-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), #f5b800);
  border-radius: 999px;
}
.pf-cap { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pf-cap b { color: var(--text); font-weight: 700; }

/* Запущенные комплекты пользователя */
.run-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 16px;
}
.run-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.run-head h3 { font-size: 18px; margin: 0; }
.run-head .meta { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.run-head .pnl { font-size: 17px; font-weight: 800; }
.run-robots { margin-top: 14px; border-top: 1px solid var(--line); }
.run-robot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}
.run-robot:last-child { border-bottom: 0; }
.run-robot .rname { font-weight: 600; min-width: 0; }
.run-robot .rmeta { color: var(--muted); font-size: 13px; margin-left: auto; }
.run-robot .rpnl { font-weight: 700; min-width: 84px; text-align: right; }

/* ---------- Запуск роботов ---------- */

.launch-kit {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.launch-kit .lk-body { flex: 1 1 260px; min-width: 0; }
.launch-kit h3 { font-size: 18px; margin: 0 0 6px; }
.launch-kit .lk-lead { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.launch-kit .lk-metrics { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.launch-kit .lk-metrics b { display: block; font-size: 16px; color: var(--text); font-weight: 800; }
.launch-kit.running { opacity: 0.75; }

/* Форма запуска: выбор доли портфеля */
.share-box { display: grid; gap: 14px; }
.share-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.share-chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.share-chip:hover { color: var(--text); }
.share-chip.sel { border-color: var(--yellow); background: rgba(255, 221, 45, 0.1); color: var(--text); }
.preset-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* ---------- Схема архитектуры (лендинг для брокера) ---------- */

.arch {
  display: grid;
  gap: 14px;
}
.arch-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .arch-row-2 { grid-template-columns: repeat(2, 1fr); max-width: 640px; margin: 0 auto; width: 100%; }
  .arch-row-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Соединители блок-схемы */
.arch-conn { display: none; }
@media (min-width: 720px) {
  .arch-conn {
    display: flex;
    justify-content: space-around;
    height: 26px;
  }
  .arch-conn i {
    width: 2px;
    background: rgba(255, 221, 45, 0.45);
  }
  .arch-conn-2 { max-width: 640px; margin: 0 auto; }
}
.arch-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 0;
}
.arch-link::before, .arch-link::after {
  content: "";
  flex: 0 0 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 221, 45, 0.6));
}
.arch-link::after {
  background: linear-gradient(90deg, rgba(255, 221, 45, 0.6), transparent);
}

/* Ядро — центр схемы */
.arch-core {
  background: var(--yellow);
  color: #11151B;
  border-radius: var(--r-lg);
  padding: 20px 26px;
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 0 44px rgba(255, 221, 45, 0.22);
}
.arch-core b { display: block; font-size: 17px; margin-bottom: 3px; }
.arch-core span { color: rgba(17, 21, 27, 0.65); font-size: 13px; }
.arch-box {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: center;
  font-size: 14px;
}
.arch-box b { display: block; font-size: 15px; margin-bottom: 4px; }
.arch-box span { color: var(--muted); font-size: 13px; }

/* Замок внутри бокса схемы */
.arch-box .lock { color: var(--yellow); }
.arch-core .lock { color: #11151B; }

/* Стрелка-подпись со стороны (запрос/выдача токена) */
.arch-flow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  padding: 0 8px;
}
.arch-flow span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.arch-flow span svg { flex: none; }

/* Бокс «злоумышленник» */
.arch-box.thief {
  border-style: dashed;
  border-color: rgba(255, 123, 118, 0.5);
}
.arch-box.thief b { color: var(--red); }
.arch-box.core {
  background: var(--yellow);
  color: #11151B;
  border-color: var(--yellow);
}
.arch-box.core span { color: rgba(17, 21, 27, 0.65); }
.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 0;
}
.arch-arrow::before, .arch-arrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 221, 45, 0.5), transparent);
}

/* ---------- Прочее ---------- */

.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }

.page-title { font-size: clamp(28px, 6vw, 40px); }

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

/* График-заглушка (DYNAMIC: заменить на реальный) */
.chart-stub {
  width: 100%;
  height: 220px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 221, 45, 0.07), transparent 70%),
    var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}
.chart-stub svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Десктоп ---------- */

@media (max-width: 719px) {
  /* mobile: робот виден вверху за заголовком,
     нижняя часть сильнее затемнена под читаемость текста */
  .hero {
    padding: 120px 0 64px;
    background-image:
      linear-gradient(0deg,
        rgba(17, 21, 27, 0.98) 0%,
        rgba(17, 21, 27, 0.9) 55%,
        rgba(17, 21, 27, 0.55) 85%,
        rgba(17, 21, 27, 0.45) 100%),
      var(--hero-bg, url("img/hero-robot-violet.png"));
    background-size: 215%;
    background-position: 62% top;
  }
}

@media (max-width: 719px) {
  /* Шапка на мобильных: всё должно влезать — плотнее отступы и кнопки */
  .site-header .container { gap: 10px; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; }
  .header-actions { gap: 8px; }
  .header-actions .btn-sm { padding: 9px 12px; }
  .burger { padding: 9px 11px; min-height: 40px; }
}

@media (max-width: 420px) {
  /* Совсем узкие экраны: логотип — только значок, без текстовой части */
  .logo { font-size: 0; gap: 0; }
}

@media (min-width: 720px) {
  .section { padding: 76px 0; }
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .header-user { display: block; }
}

@media (min-width: 960px) {
  .main-nav { display: flex; }
  .burger { display: none; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-card { padding: 36px 34px; }
  .hero { padding: 110px 0 90px; }
}

@media (min-width: 1160px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-4 .metric .val { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Страница комплекта (kit.html) ---------- */

.kit-hero {
  background:
    radial-gradient(420px 220px at 85% 0%, rgba(255, 221, 45, 0.10), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 30px 26px;
  margin: 18px 0 26px;
}
.kit-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.kit-h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 34px 0 14px;
}

/* Состав комплекта: пронумерованные строки роботов */
.kit-robot-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
}
.kit-robot-card:first-child { padding-top: 0; }
.kit-robot-card .name { font-size: 16px; font-weight: 700; }
.kit-robot-num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 221, 45, 0.12);
  color: var(--yellow);
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
}

/* Крупная эквити на странице комплекта */
.kit-equity-lg svg { height: 220px; }

/* Условия запуска — список с жёлтыми маркерами */
.kit-conditions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kit-conditions li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
}
.kit-conditions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

/* Боковая плашка запуска */
.kit-side-card .btn { margin-top: 16px; }

@media (min-width: 960px) {
  .kit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 26px;
    align-items: start;
  }
  .kit-side { position: sticky; top: 90px; }
}

/* ---------- Лендинг для брокера (broker.html) ---------- */

/* Блок «есть на всех крипто-биржах» */
.broker-crypto { border-color: var(--line-strong); }
.broker-crypto-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.broker-crypto-item p { font-size: 14px; margin: 6px 0 0; }
.broker-crypto-name {
  display: inline-block;
  background: rgba(255, 221, 45, 0.12);
  color: var(--yellow);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 800;
  font-size: 14px;
}
.broker-crypto-punch {
  margin: 24px 0 0;
  font-size: 17px;
  color: var(--text);
}
.broker-crypto-punch b { color: var(--yellow); }

/* Условия команды: крупные цифры */
.broker-term { display: flex; gap: 18px; align-items: flex-start; }
.broker-term-num {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--yellow);
  color: #11151B;
  font-weight: 800;
  font-size: 17px;
  display: grid;
  place-items: center;
}
.broker-term-big {
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--yellow);
  white-space: nowrap;
}
.broker-term-big span { font-size: 0.45em; color: var(--muted); font-weight: 600; }

/* ---------- Блок «Интеграция за дни» (broker.html) ---------- */

.jump { display: grid; gap: 22px; }
.jump-points { display: grid; gap: 14px; margin-top: 22px; }
.jump-img img {
  width: 100%;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  display: block;
}

@media (min-width: 960px) {
  .jump {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 36px;
  }
  .jump-points { grid-template-columns: 1fr; }
}
