/* console.css — веб-консоль бота: боковое меню и страницы настроек */
.cs-body .nav { margin: 14px auto 0; }
.cs { display: grid; grid-template-columns: 250px 1fr; gap: 22px; max-width: 1180px; margin: 0 auto; padding: 24px 24px 90px; }

/* ---------- боковое меню ---------- */
.cs-side { position: sticky; top: 18px; align-self: start; display: grid; gap: 12px; }
.cs-who { padding: 16px 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.cs-who b { display: block; font-size: 14.5px; }
.cs-who small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.cs-who .cs-sub { margin-top: 10px; display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.cs-sub.on { color: #86efac; background: rgba(34, 197, 94, .12); }
.cs-sub.off { color: #fca5a5; background: rgba(248, 113, 113, .12); }

.cs-nav { padding: 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 3px; }
.cs-nav b { padding: 10px 12px 6px; font-size: 10.5px; letter-spacing: .1em; color: var(--muted); }
.cs-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: #a7afc4; text-align: left; }
.cs-nav button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.cs-nav button.on { color: #fff; background: rgba(99, 102, 241, .2); }
.cs-nav i { font-style: normal; font-size: 15px; width: 20px; text-align: center; }

/* ---------- содержимое ---------- */
.cs-main { min-width: 0; }
.cs-draft { display: grid; gap: 5px; margin-bottom: 18px; padding: 14px 18px; border-radius: 16px; font-size: 13px; line-height: 1.55;
  color: #cbd5e1; background: rgba(245, 158, 11, .07); border: 1px solid rgba(245, 158, 11, .25); }
.cs-draft b { color: #fcd34d; font-size: 13px; }

.cs-back { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.cs-back:hover { color: var(--text); }
.cs-h { margin-bottom: 16px; }
.cs-h h1 { font-size: 24px; letter-spacing: -.5px; }
.cs-h p { margin-top: 7px; font-size: 13.5px; color: var(--muted); max-width: 680px; line-height: 1.6; }

.cs-card { padding: 20px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
.cs-card > h2 { font-size: 16px; margin-bottom: 4px; }
.cs-card > p.hint { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }

/* ---------- дашборд ---------- */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 22px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .14), transparent 58%), var(--panel);
  border: 1px solid var(--line); animation: dashUp .45s ease both; }
.dash-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: #a5b4fc; }
.dash-hero h1 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.8px; }
.dash-hero p { font-size: 13.5px; color: var(--muted); max-width: 560px; line-height: 1.55; }
.dash-ring { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 18px;
  background: var(--panel-2); border: 1px solid var(--line); }
.dash-ring-in { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(#8b5cf6 calc(var(--p) * 1%), rgba(255, 255, 255, .07) 0); }
.dash-ring-in::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--panel-2); }
.dash-ring-in b { position: relative; z-index: 1; font-size: 17px; }
.dash-ring > div:last-child b { display: block; font-size: 14px; }
.dash-ring > div:last-child small { font-size: 11.5px; color: var(--muted); }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-card { position: relative; padding: 16px 18px; border-radius: 16px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  animation: dashUp .45s ease both; animation-delay: calc(var(--i) * .05s); }
.dash-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--indigo); }
.dash-card.k-a::before { background: #34d399; } .dash-card.k-b::before { background: #38bdf8; }
.dash-card.k-c::before { background: #a78bfa; } .dash-card.k-d::before { background: #f87171; }
.dash-card.k-e::before { background: #fbbf24; } .dash-card.k-f::before { background: #f472b6; }
.dash-card small { font-size: 11.5px; color: var(--muted); }
.dash-card b { display: block; margin: 6px 0 3px; font-size: 25px; letter-spacing: -.6px; }
.dash-card span { font-size: 11.5px; color: var(--muted); }

.dash-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dash-chart-head h2 { font-size: 16px; margin-bottom: 4px; }
.dash-total { text-align: right; }
.dash-total small { display: block; font-size: 11px; color: var(--muted); }
.dash-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; margin: 18px 0 10px;
  padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.dash-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px;
  height: 100%; animation: dashGrow .5s ease both; animation-delay: calc(var(--i) * .03s); }
.dash-bar i { width: 100%; border-radius: 4px; background: linear-gradient(180deg, #38bdf8, #6366f1); }
.dash-bar small { font-size: 9.5px; color: var(--muted); }
.dash-warn { list-style: none; display: grid; gap: 9px; }
.dash-warn li { position: relative; padding-left: 17px; font-size: 12.5px; line-height: 1.5; }
.dash-warn li::before { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: #fbbf24; }
.dash-warn b { display: block; font-size: 13px; }
.dash-warn span { color: var(--muted); }
.dash-plugs { display: grid; gap: 8px; }
.dash-plug { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px;
  background: var(--panel-2); border: 1px solid var(--line); }
.dash-plug b { flex: 1; font-size: 13.5px; }
.dash-plug span { font-size: 11.5px; color: var(--muted); }
.dash-plug span.on { color: #4ade80; }

@keyframes dashUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dashGrow { from { opacity: 0; transform: scaleY(.4); transform-origin: bottom; } to { opacity: 1; transform: none; } }

/* ---------- плагины сеткой ---------- */
.plug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.plug-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line);
  animation: dashUp .4s ease both; animation-delay: calc(var(--i) * .04s);
  transition: transform .18s ease, border-color .2s ease, box-shadow .2s ease; }
.plug-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, .5); }
.plug-card.on { border-color: rgba(52, 211, 153, .45); box-shadow: 0 16px 40px -28px rgba(52, 211, 153, .8); }
.plug-top { display: flex; align-items: center; gap: 8px; }
.plug-top b { font-size: 14.5px; }
.plug-tag { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.plug-tag.beta { color: #86efac; background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .34); }
.plug-tag.star { color: #fcd34d; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .3); }
.plug-state { margin-left: auto; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--muted); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.plug-state.on { color: #86efac; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .3); }
.plug-card p { flex: 1; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.plug-foot { display: flex; align-items: center; gap: 10px; }
.plug-sw-label { flex: 1; font-size: 12.5px; color: var(--muted); }

/* ---------- настройки: шаги и вкладки ---------- */
.set-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.set-step { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); }
.set-step:hover { border-color: rgba(99, 102, 241, .5); }
.set-step i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: rgba(99, 102, 241, .5); }
.set-step.done i { background: linear-gradient(135deg, #34d399, #10b981); color: #0b1020; }
.set-step b { font-size: 13.5px; }
.set-step small { display: block; font-size: 11.5px; color: var(--muted); }
.set-progress { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 16px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.set-progress b { font-size: 13.5px; }
.set-how { font-size: 12px; color: #93c5fd; text-align: left; }

.set-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; padding: 6px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.set-tabs button { padding: 9px 15px; border-radius: 11px; font-size: 13px; font-weight: 600; color: #93a4bd; }
.set-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.set-tabs button.on { color: #fff; background: rgba(99, 102, 241, .22); }

.set-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; margin-bottom: 14px; }
.set-step-card { display: flex; gap: 14px; padding: 20px 22px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); animation: dashUp .4s ease both; }
.set-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex: none;
  font-size: 13px; font-weight: 800; color: #c7d2fe; background: rgba(99, 102, 241, .18); }
.set-step-card h3 { font-size: 15px; margin-bottom: 7px; }
.set-step-card p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.set-faq { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.set-faq summary { cursor: pointer; font-size: 13.5px; font-weight: 600; }
.set-faq p { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ожидание подтверждения в Telegram */
.cs-wait { margin-top: 14px; padding: 13px 16px; border-radius: 13px; display: grid; gap: 5px;
  background: rgba(56, 189, 248, .07); border: 1px solid rgba(56, 189, 248, .28); }
.cs-wait b { font-size: 13.5px; color: #bae6fd; }
.cs-wait span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cs-wait a { color: #93c5fd; }

/* главная карточка запуска */
.cs-run { border-color: rgba(248, 113, 113, .3); background: linear-gradient(135deg, rgba(248, 113, 113, .07), transparent 55%), var(--panel); }
.cs-run.on { border-color: rgba(34, 197, 94, .35); background: linear-gradient(135deg, rgba(34, 197, 94, .09), transparent 55%), var(--panel); }
.cs-run-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cs-run-top b { font-size: 18px; }
.cs-run-top p { margin-top: 6px; font-size: 13px; color: var(--muted); max-width: 520px; line-height: 1.55; }
.cs-dot { display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: #f87171; }
.cs-run.on .cs-dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.cs-worker { margin-top: 16px; padding-top: 13px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, .06); }
.cs-run .btn[disabled] { opacity: .5; cursor: not-allowed; }

.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cs-field { display: grid; gap: 6px; }
.cs-field > span { font-size: 12.5px; font-weight: 600; color: #aab2c6; }
.cs-field small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.cs-field input, .cs-field select, .cs-field textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; color: var(--text); font-family: inherit;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); }
.cs-field textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
.cs-grid .cs-field:has(textarea) { grid-column: 1 / -1; }  /* тексты — во всю ширину, рядом с короткими полями они смотрятся рвано */
.cs-field input:focus, .cs-field select:focus, .cs-field textarea:focus { outline: 0; border-color: rgba(99, 102, 241, .6); }

.cs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* выбранная площадка — показываем, а не предлагаем выбрать заново */
.cs-market { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px;
  padding: 12px 16px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); }
.cs-market b { font-size: 15px; }
.cs-market a { font-size: 12.5px; color: #93c5fd; }

/* подсказка «что дальше» */
.cs-next { border-color: rgba(99, 102, 241, .35); background: linear-gradient(135deg, rgba(99, 102, 241, .1), transparent 60%), var(--panel); }

/* строки таблиц плагина */
.cs-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.cs-row .cs-grid { flex: 1; min-width: 0; }
.cs-row-x { flex: none; width: 30px; height: 30px; border-radius: 9px; font-size: 13px; color: #93a4bd;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.cs-row-x:hover { color: #fca5a5; border-color: rgba(248, 113, 113, .4); }
.cs-count { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 8px;
  border-radius: 999px; background: rgba(255, 255, 255, .06); }

/* шаги запуска */
.cs-steps { list-style: none; display: grid; gap: 10px; counter-reset: s; }
.cs-steps li { position: relative; padding: 14px 16px 14px 48px; border-radius: 14px; font-size: 13.5px; line-height: 1.5;
  background: var(--panel-2); border: 1px solid var(--line); counter-increment: s; }
.cs-steps li b { display: block; margin-bottom: 3px; font-size: 14px; }
.cs-steps li span { color: var(--muted); }
.cs-steps li::before { content: counter(s); position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #0b1020; background: linear-gradient(135deg, #60a5fa, #22d3ee); }
.cs-steps li.done::before { content: "✓"; background: linear-gradient(135deg, #34d399, #10b981); }

/* переключатели плагинов */
.cs-plugs { display: grid; gap: 10px; }
.cs-plug { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line); }
.cs-plug .ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 17px; flex: none;
  background: rgba(99, 102, 241, .16); }
.cs-plug .tx { flex: 1; min-width: 0; }
.cs-plug .tx b { display: block; font-size: 14px; }
.cs-plug .tx p { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.cs-plug .tx a { font-size: 12px; color: #93c5fd; }
.cs-sw { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12); transition: background .18s ease; }
.cs-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #cbd5e1; transition: transform .18s ease; }
.cs-sw.on { background: rgba(99, 102, 241, .7); border-color: rgba(99, 102, 241, .9); }
.cs-sw.on::after { transform: translateX(20px); background: #fff; }
.cs-sw[disabled] { opacity: .4; cursor: not-allowed; }

.cs-empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6;
  border-radius: 16px; background: var(--panel-2); border: 1px dashed var(--line); }

/* поле с кнопками-помощниками */
.cs-input { position: relative; display: block; }
.cs-input input { padding-right: 68px; }
.cs-eye { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 8px;
  font-size: 12px; line-height: 1; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); }
.cs-eye:hover { background: rgba(255, 255, 255, .12); }
.cs-eye[data-eye]:not([data-paste]) { right: 38px; }
.cs-eye[data-paste] { right: 7px; }

/* инструкция «как это сделать» */
.cs-help { margin: 0 0 14px; border-radius: 14px; background: rgba(56, 189, 248, .05); border: 1px solid rgba(56, 189, 248, .2); }
.cs-help summary { display: flex; align-items: center; gap: 9px; padding: 12px 16px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: #bae6fd; list-style: none; }
.cs-help summary::-webkit-details-marker { display: none; }
.cs-help summary span { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%;
  font-size: 12px; font-weight: 800; color: #0b1020; background: #7dd3fc; }
.cs-help summary::after { content: "▾"; margin-left: auto; opacity: .6; font-size: 11px; }
.cs-help[open] summary::after { content: "▴"; }
.cs-help ol { margin: 0; padding: 0 20px 16px 44px; display: grid; gap: 8px; }
.cs-help li { font-size: 13px; line-height: 1.6; color: #cbd5e1; }
.cs-help code { padding: 1px 6px; border-radius: 5px; font-size: .92em; background: rgba(255, 255, 255, .08); }
.cs-help b { color: #fff; }

/* чат с ботом */
.cs-chat { border-radius: 18px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.cs-talk { min-height: 300px; max-height: 50vh; overflow-y: auto; padding: 18px; display: grid; gap: 10px; }
.cs-msg { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; }
.cs-msg.bot { justify-self: start; border-bottom-left-radius: 5px; color: #e4e8f2; background: var(--panel-2);
  border: 1px solid var(--line); }
.cs-msg.me { justify-self: end; border-bottom-right-radius: 5px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #38bdf8); }
.cs-msg b { color: #fff; }
.cs-keys { display: grid; gap: 7px; padding: 0 14px 14px; }
.cs-keyrow { display: flex; gap: 7px; flex-wrap: wrap; }
.cs-key { flex: 1 1 auto; padding: 10px 14px; border-radius: 11px; font-size: 13px; font-weight: 600; color: #cbd5e1;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); }
.cs-key:hover { color: #fff; background: rgba(99, 102, 241, .2); border-color: rgba(99, 102, 241, .5); }
.cs-say { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.cs-say input { flex: 1; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; color: var(--text);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); }
.cs-say input:focus { outline: 0; border-color: rgba(99, 102, 241, .6); }

/* нижняя панель сохранения */
.cs-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 20px; border-radius: 14px;
  font-size: 13.5px; color: #fcd34d; background: rgba(20, 18, 12, .96); border: 1px solid rgba(245, 158, 11, .4);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9); }

.cs-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60;
  padding: 11px 20px; border-radius: 12px; font-size: 13.5px; color: #0b1020; font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #38bdf8); box-shadow: 0 16px 40px -18px rgba(99, 102, 241, .9); }

@media (max-width: 880px) {
  .cs { grid-template-columns: 1fr; }
  .cs-side { position: static; }
  .cs-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .cs-nav b { display: none; }
}
