/* SlotRadar — единая дизайн-система. Основной цвет — фиолетовый #7C3AED.
   Синий — только как дополнительный информационный. Зелёный — успех, красный — ошибка. */
:root {
  --purple: #7C3AED;         /* основной */
  --purple-600: #6D28D9;     /* дополнительный фиолетовый (акцент/hover) */
  --purple-50: #F3EEFF;      /* светлые плашки */
  --purple-100: #E7DCFF;
  --blue: #2563EB;           /* ТОЛЬКО как информационный дополнительный */
  --blue-600: #1D4ED8;
  --blue-50: #E8F0FE;
  --grad: linear-gradient(120deg, #7C3AED 0%, #6D28D9 100%);       /* единый фиолетовый */
  --grad-soft: linear-gradient(120deg, #8B5CF6 0%, #7C3AED 100%);
  --ink: #171427;
  --ink-2: #3A3A52;
  --muted: #8A8AA3;
  --muted-2: #A9A9C2;
  --line: #ECE9F4;
  --bg: #F8F7FC;             /* светлый фон */
  --card: #FFFFFF;           /* карточки */
  --card-2: #FAFAFE;
  --green: #18B26B;
  --amber: #F5A524;
  --red: #F04452;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(44, 23, 92, 0.08);
  --shadow-sm: 0 4px 14px rgba(44, 23, 92, 0.06);
  --shadow-btn: 0 10px 24px rgba(124, 58, 237, 0.30);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; }
.ico { width: 20px; height: 20px; flex: none; }
.plan li svg, .summary-row svg, .info-box svg { width: 18px; height: 18px; flex: none; }
.event .dotico svg { width: 15px; height: 15px; }
.task-row svg { width: 16px; height: 16px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; font-weight: 600; font-size: 14px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(74,58,240,.45); }
.btn-ghost { background: var(--purple-50); color: var(--purple); }
.btn-ghost:hover { background: var(--purple-100); }
.btn-outline { border: 1.5px solid var(--line); color: var(--ink-2); background: #fff; }
.btn-outline:hover { border-color: var(--purple-100); }
.btn-danger { background: #FEECEE; color: var(--red); }
.btn-lg { padding: 15px 26px; font-size: 15px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }

/* ---------- Бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-purple { background: var(--purple-50); color: var(--purple); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-green { background: #E6F7EF; color: var(--green); }
.badge-amber { background: #FEF3E0; color: #C87E12; }
.badge-red { background: #FEECEE; color: var(--red); }
.badge-gray { background: #F0F0F6; color: var(--muted); }
.badge-demo { background: #FFF4D9; color: #9A6B00; border: 1px solid #F5E2AE; }

/* ---------- Карточки ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card-line { border: 1px solid var(--line); box-shadow: none; }

/* ---------- Демо-баннер ---------- */
.demo-banner {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: #FFF8E6; color: #8A6400; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-bottom: 1px solid #F3E6BD;
}
.demo-banner .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* ---------- Логотип / бренд ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand .logo { width: 30px; height: 30px; }
.brand .sr-slot { color: var(--ink); }
.brand .sr-radar { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ================= APP SHELL (десктоп) ================= */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 8px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative;
}
.nav-item .ico { width: 20px; height: 20px; color: var(--muted); }
.nav-item:hover { background: var(--card-2); }
.nav-item.active { background: var(--purple-50); color: var(--purple); }
.nav-item.active .ico { color: var(--purple); }
.nav-item .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.sidebar .spacer { flex: 1; }
.side-help { background: var(--card-2); border-radius: 16px; padding: 14px; font-size: 12.5px; color: var(--muted); }
.side-help .btn { margin-top: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 28px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--card-2); position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.avatar { display: flex; align-items: center; gap: 10px; }
.avatar .pic { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.avatar .meta { line-height: 1.2; }
.avatar .meta b { font-size: 13.5px; }
.avatar .meta span { font-size: 11.5px; color: var(--muted); }

.content { padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-head h2 { font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }
.page-head .btn { margin-left: auto; }

/* ---------- Сетка статистики (единое оформление 4 карточек) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.stat-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat-ico .ico, .stat-ico svg { width: 20px; height: 20px; }
.stat .num { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.stat .label { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.stat .link { font-size: 12px; font-weight: 600; color: var(--purple); margin-top: auto; }
.stat.accent { background: var(--grad); color: #fff; }
.stat.accent .label { color: rgba(255,255,255,.88); }
.stat.accent .stat-ico { background: rgba(255,255,255,.2); color: #fff; }
.stat.accent .link { color: #fff; text-decoration: underline; opacity: .95; }

/* ---------- Задачи ---------- */
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 14px; }
.task {
  background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  margin-bottom: 14px; border: 1px solid transparent;
}
.task:hover { border-color: var(--purple-100); }
.task-top { display: flex; align-items: center; gap: 12px; }
.wb-ava { width: 42px; height: 42px; border-radius: 12px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.task-title { font-weight: 700; font-size: 15px; }
.task-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.task .more { margin-left: auto; color: var(--muted-2); font-size: 20px; padding: 4px 8px; }
.task-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13px; }
.task-row .k { color: var(--muted); }
.task-row .v { font-weight: 700; overflow-wrap: anywhere; }
.task-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.task-actions .btn { flex: 1 1 auto; min-width: 130px; }

/* ---------- События / список ---------- */
.event { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.event:last-child { border-bottom: none; }
.event .t { color: var(--muted); font-size: 12px; min-width: 42px; }
.event .dotico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.event .task { all: unset; color: var(--muted); font-size: 12px; margin-left: auto; }
.ic-found { background: #FEF3E0; color: var(--amber); }
.ic-booked { background: #E6F7EF; color: var(--green); }
.ic-checked { background: var(--blue-50); color: var(--blue); }
.ic-error { background: #FEECEE; color: var(--red); }
.ic-auth { background: var(--purple-50); color: var(--purple); }

/* ---------- Мастер (stepper) ---------- */
.stepper { display: flex; align-items: center; gap: 8px; margin: 10px 0 24px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #EDEDF5; color: var(--muted); font-weight: 700; font-size: 13px; }
.step.active .n { background: var(--grad); color: #fff; }
.step.active { color: var(--ink); }
.step.done .n { background: var(--purple-50); color: var(--purple); }
.step .bar { width: 28px; height: 2px; background: var(--line); }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.input, .select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; }
.input:focus, .select:focus { outline: none; border-color: var(--purple); }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; }

.pick {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line);
  border-radius: 14px; margin-bottom: 10px; cursor: pointer; background: #fff;
}
.pick:hover { border-color: var(--purple-100); }
.pick.sel { border-color: var(--purple); background: var(--purple-50); }
.pick .check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.pick.sel .check { background: var(--purple); border-color: var(--purple); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 11px; border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; color: var(--ink-2); background: #fff; }
.chip.sel { background: var(--purple); color: #fff; border-color: var(--purple); }
.chip-blue.sel { background: var(--blue); border-color: var(--blue); }

.summary-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-row .k { color: var(--muted); }
.summary-row .v { font-weight: 700; }

.info-box { background: var(--blue-50); color: #244; border-radius: 14px; padding: 14px; font-size: 13px; display: flex; gap: 10px; }
.info-box .ico { color: var(--blue); flex: none; }

/* ---------- Мониторинг ---------- */
.monitor-ring { display: grid; place-items: center; padding: 20px; }
.ring { width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--purple) 0 70%, var(--line) 0); display: grid; place-items: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.ring .rc { position: relative; text-align: center; }
.ring .rc b { font-size: 15px; }
.ring .rc span { font-size: 12px; color: var(--muted); display: block; }
.mon-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; text-align: center; margin-top: 10px; }
.mon-stats .num { font-size: 22px; font-weight: 800; }
.mon-stats .label { color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 6px; background: var(--card-2); padding: 4px; border-radius: 12px; }
.tab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ================= LANDING ================= */
.landing { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.lnav { display: flex; align-items: center; gap: 28px; padding: 22px 0; }
.lnav .links { display: flex; gap: 26px; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-left: 20px; }
.lnav .links a:hover { color: var(--purple); }
.lnav .right { margin-left: auto; display: flex; gap: 10px; }
.hero {
  background: linear-gradient(135deg, #140F3A 0%, #2A1E6E 55%, #1E2A7A 100%);
  border-radius: 28px; padding: 48px; color: #fff; display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center;
  position: relative; overflow: hidden;
}
.hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.03em; }
.hero h1 .wb { background: linear-gradient(90deg,#9D86FF,#5C8CFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: rgba(255,255,255,.75); font-size: 16px; margin: 18px 0 26px; max-width: 440px; }
.hero .price { color: rgba(255,255,255,.6); font-size: 13px; margin-top: 12px; }
.hero-art { position: relative; height: 320px; }
.hero-card { position: absolute; background: rgba(255,255,255,.1); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 14px 18px; color: #fff; font-weight: 700; }
.hero-card.c1 { top: 10px; right: 30px; }
.hero-card.c2 { top: 120px; right: 90px; background: var(--grad); }
.hero-card.c3 { top: 210px; right: 10px; }
.hero-wb { position: absolute; top: 30px; left: 10px; width: 92px; height: 92px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; box-shadow: var(--shadow-btn); }
.features { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin: 26px 0; }
.feature { text-align: left; }
.feature .fico { width: 46px; height: 46px; border-radius: 14px; background: var(--purple-50); color: var(--purple); display: grid; place-items: center; margin-bottom: 12px; }
.feature b { display: block; font-size: 15px; }
.feature span { color: var(--muted); font-size: 13px; }
.section { padding: 40px 0; }
.section h2 { font-size: 30px; text-align: center; }
.section .lead { text-align: center; color: var(--muted); max-width: 540px; margin: 10px auto 30px; }
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.plan { border: 1.5px solid var(--line); border-radius: 20px; padding: 24px; background: #fff; }
.plan.pop { border-color: var(--purple); box-shadow: var(--shadow); position: relative; }
.plan.pop::after { content: "Популярный"; position: absolute; top: -11px; left: 24px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan .price { font-size: 34px; font-weight: 800; margin: 8px 0; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 16px 0; }
.plan li { padding: 7px 0; font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; }
.lfoot { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

/* ================= MOBILE ================= */
.mobile-head { display: none; }
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: none; }
  .mobile-head {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  }
  .mobile-head .brand { font-size: 17px; }
  .mobile-head .brand .logo { width: 26px; height: 26px; }
  .mobile-head .right { margin-left: auto; display: flex; gap: 10px; }
  .mobile-head .back { font-size: 22px; color: var(--ink-2); padding: 0 4px; }
  .content { padding: 16px 16px 96px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat .num { font-size: 26px; }
  .features, .plans { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 30px 22px; }
  .hero h1 { font-size: 32px; }
  .hero-art { display: none; }
  .lnav .links { display: none; }
  .mon-stats .num { font-size: 20px; }
  .page-head { flex-wrap: wrap; }
  .page-head .btn { margin-left: 0; width: 100%; order: 3; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; padding: 4px 8px; }
  .bottom-nav a.active { color: var(--purple); }
  .bottom-nav a .ico { width: 22px; height: 22px; }
  .bottom-nav a .count { position: absolute; top: 0; right: 6px; background: var(--red); color: #fff; font-size: 9px; border-radius: 999px; padding: 0 4px; }
  .bottom-nav .plus { width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-btn); margin-top: -22px; }
  .bottom-nav .plus .ico { width: 26px; height: 26px; }
}

/* утилиты */
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: #C87E12; }

/* ---------- Telegram Mini App / мобильная адаптация + safe-area ---------- */
:root { --tg-safe-top: 0px; --tg-safe-bottom: 0px; }

/* Нет горизонтального скролла на уровне документа */
html, body { max-width: 100%; overflow-x: hidden; }
/* Длинный текст переносится, а не растягивает контейнеры вправо */
.task-title, .task-sub, .label, .summary-row, .task-row .v, .event, .pick, h1, h2, p {
  overflow-wrap: anywhere; word-break: break-word;
}
/* Flex/grid-элементы не распирают родителя */
.main, .content, .card, .task, .stat, .plan, .pick { min-width: 0; max-width: 100%; }
img, svg, video { max-width: 100%; }

/* safe-area: отступы даём шапке/контенту/нижней навигации, а не body (без белых полос) */
.in-telegram .mobile-head { padding-top: calc(14px + var(--tg-safe-top)); }
.in-telegram .content { padding-bottom: calc(96px + var(--tg-safe-bottom)); }
.in-telegram .bottom-nav {
  padding-bottom: calc(8px + var(--tg-safe-bottom) + env(safe-area-inset-bottom, 0px));
}

/* Экран фатальной ошибки — вместо бесконечного белого экрана (Задача 1.8) */
.fatal { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.fatal-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 22px; max-width: 360px; width: 100%; text-align: center;
}
.fatal-title { font-size: 18px; font-weight: 800; }
.fatal-sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 14px; }
.fatal-detail {
  font-size: 11px; color: var(--muted-2); background: var(--card-2);
  border-radius: 10px; padding: 8px; margin-bottom: 14px; overflow-wrap: anywhere;
}
.fatal-card .btn { margin-top: 4px; }

/* Очень узкие экраны (320–380 px) */
@media (max-width: 380px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .stat .num { font-size: 23px; }
  .stat .label { font-size: 11.5px; }
  .btn { padding: 11px 14px; }
}
