/* Ширина рабочей области и плавность */
.content > * { max-width: 1760px; }
.facts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.facts li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; color: var(--muted); }
.facts li b { color: var(--text); font-weight: 500; }
@media (min-width: 1600px) {
  body { font-size: 17px; }
  .shell { padding: 20px; gap: 24px; }
  .side { width: 268px; top: 20px; height: calc(100vh - 40px); }
  .content { padding: 10px 14px 40px; }
  h1 { font-size: 32px; }
  .card { padding: 24px; }
  .grid { gap: 20px; }
  .stack { gap: 20px; }
  .cols-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
  .chart { height: 300px; }
  .bars .bar { width: 18px; }
  .bar.err { width: 10px; }
  .kpi b { font-size: 32px; }
}
@media (min-width: 2100px) {
  body { font-size: 18px; }
  .cols-3 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.content { animation: rise 0.25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card { transition: box-shadow 0.15s ease; }
.card:hover { box-shadow: 0 2px 4px rgba(31, 32, 35, 0.05), 0 12px 28px rgba(31, 32, 35, 0.09); }
.btn { transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255, 87, 34, 0.35); }
.btn.ghost:hover { box-shadow: none; background: rgba(255, 90, 47, 0.08); }
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
@media (prefers-reduced-motion: reduce) { .content, .dot.pulse, .flow .line, .bubble.pop { animation: none; } .btn:hover { transform: none; } }

/* Пустые состояния */
.empty-ill { text-align: center; padding: 18px 8px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-ill svg { width: 56px; height: 56px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }
.empty-ill p { margin: 0; max-width: 360px; }

/* Онбординг */
.onboard-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.onboard-progress { min-width: 160px; text-align: right; color: var(--muted); }
.onboard-progress b { color: var(--text); font-size: 20px; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist small { display: block; color: var(--muted); }
.checklist .num, .stepper li::before, .steps3 .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #fff1e6; color: var(--accent); flex: none; }
.checklist li.done .num { background: var(--grad); color: #fff; }

/* Форма подключения бота */
.cols-2.connect { align-items: start; }
.form.wide { max-width: none; }
.field-group { display: grid; gap: 8px; }
.field-label { font-weight: 500; }
.messenger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.messenger-card { position: relative; font-weight: 400; display: block; }
.messenger-card input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.card-content { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; transition: all 0.2s ease; }
.messenger-card:hover .card-content { border-color: #cbd0d6; }
.messenger-card input:checked + .card-content { border-color: #ff5a30; background: rgba(255, 90, 48, 0.06); box-shadow: 0 0 0 3px rgba(255, 90, 48, 0.12); }
.messenger-card input:focus-visible + .card-content { outline: 2px solid #ffb48a; outline-offset: 2px; }
.icon-box { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.tg-bg { background: linear-gradient(135deg, #2aabee, #229ed9); }
.max-bg { background: linear-gradient(135deg, #6b4eff, #5236ff); }
.card-text { display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--muted); }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #cfd4dc; position: relative; transition: all 0.2s ease; flex: none; }
.messenger-card input:checked + .card-content .radio-dot { border-color: #ff5a30; background: #ff5a30; }
.messenger-card input:checked + .card-content .radio-dot::after { content: ""; position: absolute; width: 6px; height: 6px; background: #fff; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); }
@media (max-width: 480px) { .messenger-grid { grid-template-columns: 1fr; } }

/* Подключение 1С */
.stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { counter-increment: step; position: relative; padding: 0 0 18px 50px; }
.stepper li::before { content: counter(step); position: absolute; left: 0; top: 0; }
.stepper li::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.stepper li:last-child { padding-bottom: 0; }
.stepper li:last-child::after { display: none; }
.stepper p { margin: 2px 0 0; color: var(--muted); }
.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy-row code { flex: 1; padding: 8px 12px; border-radius: 10px; word-break: break-all; }
.copy { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; color: var(--text); }
.copy:hover { border-color: var(--accent); }

/* Настройки */
.settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.one-c { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.85fr); align-items: start; }
.one-c > .card { margin: 0; }
.table { display: table; }
@media (max-width: 1100px) { .settings-grid, .one-c { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .settings-grid, .one-c { grid-template-columns: 1fr; } .table { display: block; overflow-x: auto; } }
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }

/* Лендинг */
.wrap { max-width: 1120px; }
.hero2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 28px 0 40px; }
.hero2 h1 { font-size: 40px; line-height: 1.15; margin: 10px 0 14px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: rgba(255, 90, 47, 0.1); padding: 4px 12px; border-radius: 999px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.demo { display: grid; gap: 14px; justify-items: center; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.flow .node { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.flow .brand-node { background: var(--grad); color: #fff; border-color: transparent; }
.flow .line { width: 34px; height: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px); background-size: 12px 2px; animation: marching 0.8s linear infinite; }
@keyframes marching { to { background-position: 12px 0; } }
.phone { width: 300px; border-radius: 30px; background: #1b1c1f; padding: 10px; box-shadow: 0 20px 50px rgba(31, 32, 35, 0.25); }
.phone-head { display: flex; align-items: center; gap: 10px; color: #fff; padding: 8px 10px 12px; }
.phone-head small { display: block; color: #9a9ea8; }
.phone-body { background: #f1ece6; border-radius: 22px; padding: 16px 12px; min-height: 190px; display: grid; gap: 8px; align-content: start; }
@media (prefers-color-scheme: dark) { .phone-body { background: #26272c; } }
.bubble { background: var(--card); border-radius: 16px 16px 16px 4px; padding: 10px 14px; max-width: 92%; box-shadow: var(--shadow); }
.bubble.pop { animation: pop 0.25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
.bubble.file { display: flex; align-items: center; gap: 10px; }
.file-ico { background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: 11px; padding: 6px 7px; border-radius: 8px; }
.bubble[hidden] { display: none; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.seg button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.on { background: var(--grad); color: #fff; border-color: transparent; }
.section-title { font-size: 26px; margin: 24px 0 16px; }
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.step h3 { margin: 12px 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); }
.qr { width: 84px; height: 84px; margin-top: 12px; color: var(--text); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.features { margin-top: 24px; }
.features .card { margin: 0; }
.features .ico { margin-bottom: 8px; font-size: 20px; }
.pilot { margin-top: 24px; }
@media (max-width: 980px) { .hero2 { grid-template-columns: 1fr; } .steps3, .cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .steps3, .cols-4 { grid-template-columns: 1fr; } .hero2 h1 { font-size: 30px; } }

/* Правая колонка главной тянется на высоту левой, пустые состояния по центру карточек */
.cols-main { align-items: stretch; }
.stack.fill { display: flex; flex-direction: column; }
.stack.fill > .card { flex: 1 1 0; display: flex; flex-direction: column; }
.stack.fill > .card > .empty-ill { margin: auto 0; }
@media (max-width: 1100px) { .stack.fill > .card { flex: 0 0 auto; } }

/* Рабочие действия и настройки оформления */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.quick-actions a { display: grid; gap: 5px; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 12px 12px 0; color: var(--text); text-decoration: none; transition: background .18s, transform .18s; }
.quick-actions span { color: var(--muted); font-size: .85em; }
.quick-actions a:hover { transform: translateY(-2px); background: var(--code); }
.appearance { margin-bottom: 20px; }
.appearance label { display: grid; gap: 8px; }
.appearance select { width: 100%; }
.preference-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: .9em; }
.faq { margin: 40px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { max-width: 75ch; color: var(--muted); margin-bottom: 0; animation: answer-in .18s ease-out; }
@keyframes answer-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bar { transform-origin: bottom; animation: bar-in .55s ease-out; }
@keyframes bar-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
:root[data-density="compact"] .content .card { padding: 16px; }
:root[data-density="compact"] .content .grid, :root[data-density="compact"] .content .stack { gap: 12px; }
:root[data-density="compact"] .content td, :root[data-density="compact"] .content th { padding: 8px 12px; }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 1100px) { .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .quick-actions { grid-template-columns: 1fr; } .preference-footer { align-items: start; flex-direction: column; } }


/* Разделяем список ботов, справку и форму подключения. */
.card.instances-list { margin: 32px 0 0; padding: 24px; }
.instances-list h2 { margin: 0 0 18px; }
.instances-table-scroll { overflow-x: auto; }
.instances-list .table { display: table; margin: 0; border: 0; }
.instances-list .table th { background: var(--bg); }
.instances-list .table th, .instances-list .table td { padding: 14px 16px; }
.instances-list .table tr:last-child td { border-bottom: 0; }
.cols-2.connect { gap: 28px; }
.connect > .card { margin: 0; padding: 28px; min-width: 0; }
.connect h2 { margin-top: 0; margin-bottom: 12px; }
.connect-intro { margin: 0 0 24px; }
.connect .form { gap: 20px; }
.connect .form label { gap: 8px; }
.connect .form .messenger-card { display: block; }
.connect .field-group { gap: 10px; }
.help-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.help-section h3 { margin: 0 0 10px; }
.help-section p { margin: 0; max-width: 65ch; line-height: 1.65; }
.help-section p + p { margin-top: 12px; }
.token-guide { padding: 18px 0; border-bottom: 1px solid var(--line); }
.token-guide summary { cursor: pointer; font-weight: 600; }
.token-guide p { margin: 14px 0 0; line-height: 1.65; }
.connect-note { margin: 20px 0 0; line-height: 1.6; }
@media (max-width: 860px) {
  .cols-2.connect { gap: 20px; }
  .connect > .card, .card.instances-list { padding: 20px; }
}

/* Подключение: основное действие видно сразу, технические детали раскрываются отдельно. */
[hidden] { display: none !important; }
.setup-notice { margin: 0; padding: 14px 16px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--code); font-weight: 400; line-height: 1.6; }
.launch-guide { padding: 28px; margin-bottom: 24px; }
.launch-guide p, .setup-next p { max-width: 75ch; }
.setup-steps { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.setup-steps summary, .advanced > summary { cursor: pointer; font-weight: 600; }
.setup-steps .stepper { margin-top: 22px; }
.advanced[open] > summary { margin-bottom: 20px; }
.advanced[open] { animation: answer-in .18s ease-out; }
.setup-next { border-top: 3px solid var(--accent); }
.copied { color: var(--ok); border-color: var(--ok); }
button:disabled { cursor: wait; opacity: .65; }
[data-own-bot]:not([hidden]) { animation: answer-in .18s ease-out; }
@media (max-width: 600px) { .launch-guide { padding: 20px; } .setup-next .hero-actions .btn { width: 100%; text-align: center; } }

input, select, textarea, .form, .field-group { min-width: 0; }
.menu-toggle { display: none; }
.content .grid2 { align-items: start; }
@media (max-width: 860px) {
  .side { width: 100%; min-width: 0; justify-content: space-between; }
  .side .brand { flex: 1; }
  .menu-toggle { display: inline-block; border: 1px solid #555860; border-radius: 10px; padding: 8px 14px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
  .side .menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; min-width: 0; gap: 6px; margin-top: 12px; }
  .menu a { white-space: normal; border-radius: 12px; padding: 10px; font-size: 13px; }
  .menu:not([hidden]) { animation: answer-in .18s ease-out; }
  .content { width: 100%; }
}

/* Единые списки выбора: нативная клавиатура и доступность сохраняются. */
select { border-radius: 12px; padding: 11px 14px; min-height: 44px; cursor: pointer; transition: border-color .16s, box-shadow .16s; }
select:hover { border-color: #ffb48a; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  select::picker-icon { color: var(--accent); transition: rotate .18s; }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) { color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin-top: 7px; box-shadow: 0 12px 36px rgba(0,0,0,.16); max-block-size: min(360px, 55vh); overflow-y: auto; }
  option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 44px; border-radius: 9px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
  option:hover, option:focus { background: var(--code); outline: none; }
  option:checked { background: rgba(255,90,47,.10); font-weight: 600; }
  option::checkmark { color: var(--accent); order: 1; margin-inline-start: auto; }
}
details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--code); color: var(--accent); font-size: 20px; font-weight: 400; }
details[open] > summary::after { content: '−'; }
details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

@supports (appearance: base-select) {
  .bot-select > button { display: flex; align-items: center; min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
  .bot-select selectedcontent { display: block; min-width: 0; }
  .bot-select option .bot-choice { flex: 1; }
  .bot-choice { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .bot-choice img { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: contain; }
  .bot-choice-copy { display: grid; gap: 3px; min-width: 0; }
  .bot-choice-copy b { font-weight: 600; }
  .bot-choice-copy small { color: var(--muted); font-size: 12px; font-weight: 400; }
  .bot-select { padding: 10px 14px; }
  .bot-select option { padding: 12px; }
}

.logo-preview { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--code); color: var(--muted); font-size: 13px; }
.logo-preview img, .saved-logo { width: 80px; height: 80px; object-fit: contain; border-radius: 10px; background: #fff; padding: 6px; }
.saved-logo { margin-bottom: 12px; }
input[type=file] { font-size: 13px; padding: 10px; }
input[type=file]::file-selector-button { border: 0; border-radius: 8px; background: var(--code); color: var(--text); padding: 8px 12px; margin-right: 12px; cursor: pointer; }

/* Название и логотип: общие настройки и пример сообщения. */
.company-branding-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); gap: 40px; align-items: start; }
.company-branding-controls, .company-message-preview { min-width: 0; }
.company-branding-controls > p:first-child { margin-top: 0; }
.company-branding-controls .form { max-width: none; }
.company-logo-settings { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.company-message-preview { position: sticky; top: 24px; }
.company-message-preview h3 { margin-top: 0; font-size: 16px; }
.company-preview-chat { background: var(--code); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.company-preview-bot { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.company-preview-bot > img { width: 36px; height: 36px; }
.company-preview-bot strong { display: block; font-size: 14px; }
.company-preview-bot span { display: block; color: var(--muted); font-size: 12px; }
.company-preview-bubble { max-width: 360px; overflow: hidden; border-radius: 14px 14px 14px 3px; background: var(--card); border: 1px solid var(--line); }
.company-preview-photo { display: block; width: 100%; max-height: 280px; object-fit: contain; background: var(--card); }
.company-preview-photo[hidden] { display: none; }
.company-preview-caption { padding: 16px; overflow-wrap: anywhere; }
.company-preview-caption > strong { white-space: pre-wrap; }
.company-preview-caption p { margin: 12px 0 8px; line-height: 1.55; }
.company-preview-time { display: block; text-align: right; color: var(--muted); font-size: 11px; }
@media (max-width: 1000px) { .company-branding-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } .company-message-preview { position: static; } }

/* Правовые документы и управление доступностью. */
.foot{flex-wrap:wrap;gap:12px 20px}.legal-page nav{line-height:2;overflow-wrap:anywhere}.legal-page .card{margin-block:24px}.legal-page h2{line-height:1.3}.billing-footer{flex-wrap:wrap}
