/* Файл оформляет разделы кабинета 2.0: подключения, знания, агентов и голоса, аналитику, помощника и шаги настройки. Цвета - токены SITE.THEME. */

/* --- Заголовок страницы и блоки --- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.page-head-text h2{font-size:26px;line-height:1.2;letter-spacing:-.02em}
.page-head-text p{margin-top:6px;color:var(--muted);font-size:14px}
.page-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.block{display:flex;flex-direction:column;gap:12px}
.block-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.block-title{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600}
.block-title .count{font-weight:400}
.add-row{display:flex;gap:8px;flex-wrap:wrap}
.small-note{font-size:12px}
.dot.danger{background:var(--accent);box-shadow:var(--live-glow)}

/* --- Форма в панели: поля с отступами от края --- */
.pad-form{display:flex;flex-direction:column;gap:16px;padding:20px 22px}
.pad-form .form-row{padding:0;border:0}
.pad-form textarea{min-height:84px;height:auto;padding:10px 12px;resize:vertical}
.dialog-content .chips{margin:12px 0 4px}

/* --- Фильтры-кнопки --- */
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:15px;border:1px solid var(--line-strong);background:transparent;color:var(--muted);font-size:13px;transition:background .15s,color .15s,border-color .15s}
.chip:hover{color:var(--ink);background:var(--fill)}
.chip[aria-pressed="true"]{color:var(--ink);background:var(--selected-bg);border-color:var(--selected-line)}
.mini-chip{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:11px;background:var(--fill-hover);font-size:12px;color:var(--muted);white-space:nowrap}

/* --- Состояние --- */
.state-chip{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:12px;font-size:12px;font-weight:600;color:var(--muted);background:var(--fill-hover);white-space:nowrap;flex-shrink:0}
.state-chip.ok{color:var(--green);background:var(--green-soft)}
.state-chip.warn{color:var(--amber);background:var(--amber-soft)}
.state-chip.danger{color:var(--accent);background:var(--accent-soft)}
.state-chip .dot{width:6px;height:6px}

/* --- Первый шаг (пусто) --- */
.first-step{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:22px 24px;border-radius:var(--radius);border:1px dashed var(--line-strong);background:var(--fill)}
.first-step>svg{width:28px;height:28px;color:var(--accent)}
.first-step>div{flex:1;min-width:220px}
.first-step strong{display:block;font-size:15px}
.first-step p{color:var(--muted);font-size:13px;margin-top:2px}

/* --- Подключения --- */
.conn-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px}
.conn-card{display:flex;flex-direction:column;background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);box-shadow:var(--highlight)}
.cc-head{display:flex;align-items:center;gap:12px;padding:16px 18px 10px}
.cc-icon,.cat-icon,.source-icon,.tpl-icon,.agent-tile{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;flex-shrink:0;color:var(--tile-ink);background:var(--tile-bg);border:1px solid var(--tile-border)}
.cc-icon svg,.cat-icon svg,.tpl-icon svg{width:20px;height:20px}
/* Настоящие логотипы: неизменённое соотношение сторон, одинаковая область и центр без ручных сдвигов. */
.cc-icon:has(.service-logo),.cat-icon:has(.service-logo){background:transparent;border-color:transparent}
.service-logo{display:block;width:28px;height:28px;object-fit:contain;flex-shrink:0}
.cc-title{display:flex;flex-direction:column;flex:1;min-width:0}
.cc-title strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cc-title small{color:var(--subtle);font-size:12px}
.cc-body{display:flex;flex-direction:column;gap:10px;padding:4px 18px 14px;flex:1}
.cc-note{font-size:12px;color:var(--muted)}
.cc-foot{display:flex;align-items:center;gap:8px;padding:10px 14px 12px 18px;border-top:1px solid var(--row-line)}
.input-lines{display:flex;flex-direction:column;gap:6px}
.input-line{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;background:var(--fill);border:1px solid transparent}
.input-line.on{background:var(--selected-bg);border-color:var(--selected-line)}
.input-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--fill-hover);color:var(--muted);flex-shrink:0}
.input-line.on .input-icon{color:var(--accent);background:var(--accent-soft)}
.input-icon svg{width:16px;height:16px}
.input-copy{display:flex;flex-direction:column;flex:1;min-width:0}
.input-copy strong{font-size:13px}
.input-copy span{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.forward-row{display:flex;align-items:center;gap:14px;padding:12px;border-radius:12px;background:var(--fill)}
.forward-copy{display:flex;align-items:center;gap:6px;flex:1;font-size:13px}
.forward-mode,.forward-test{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(400px,100%),1fr));gap:10px}
.cat-card{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);transition:border-color .15s,transform .15s}
.cat-card:hover{border-color:var(--card-border-hover)}
.cat-card.soon{background:transparent;border-style:dashed}
.cat-card.soon .cat-icon{color:var(--subtle);background:var(--fill);border-color:var(--line)}
.cat-copy{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.cat-copy strong{display:flex;align-items:center;gap:6px;font-size:14px}
.cat-copy span{font-size:12px;color:var(--muted)}
.cat-action{display:flex;flex-shrink:0}
.btn[aria-pressed="true"]{color:var(--accent);border-color:var(--selected-line);background:var(--selected-bg)}

/* --- Окна подключения и правила входа --- */
.mini-steps{display:flex;gap:6px;margin:0 0 4px;padding:0;list-style:none}
.mini-steps li{flex:1;display:flex;align-items:center;gap:6px;font-size:12px;color:var(--subtle)}
.mini-steps .step-mark{display:grid;place-items:center;width:20px;height:20px;flex-shrink:0;border-radius:50%;border:1px solid var(--line-strong);font-size:11px}
.mini-steps .step-mark svg{width:14px;height:14px}
.mini-steps li.on{color:var(--ink)}
.mini-steps li.on .step-mark{border-color:var(--accent);color:var(--accent)}
.mini-steps li.done .step-mark{background:var(--green-soft);border-color:transparent;color:var(--green)}
.steps-list{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px}
.rule-section{border:1px solid var(--line);border-radius:14px;background:var(--fill)}
.rule-head{display:flex;align-items:center;gap:12px;padding:14px 16px}
.rule-body{display:flex;flex-direction:column;gap:14px;padding:4px 16px 16px;border-top:1px solid var(--row-line);padding-top:14px}
.rule-section[data-off] .rule-body{display:none}
.rule-section:not([data-off]) .input-icon{color:var(--accent);background:var(--accent-soft)}
.rule-field{display:flex;flex-direction:column;gap:6px}
.rule-field[hidden]{display:none}
.list-editor{display:flex;flex-direction:column;gap:8px}
.entry-chips{display:flex;flex-wrap:wrap;gap:6px}
.entry-chips:empty{display:none}
.entry-chip{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 4px 0 10px;border-radius:14px;background:var(--surface-raised);border:1px solid var(--line-strong);font-size:12px}
.entry-chip button{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;color:var(--subtle)}
.entry-chip button:hover{color:var(--ink);background:var(--fill-hover)}
.entry-chip svg{width:12px;height:12px}
.entry-add{display:flex;gap:8px;flex-wrap:wrap}
.entry-add input{flex:1;min-width:160px;height:30px;padding:0 10px;border-radius:8px;border:1px solid var(--line-strong);background:var(--fill);font-size:13px}
.pick-box{display:flex;flex-direction:column;max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.pick-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--row-line);font-size:13px;cursor:pointer}
.pick-row:last-child{border-bottom:0}
.pick-row:hover{background:var(--fill)}
.pick-row small{color:var(--subtle);margin-left:auto}
.pick-row>span{display:flex;flex-direction:column}
.pick-row>span small{margin:0}
.field.compact{flex-direction:row;align-items:center;gap:8px}
.field.compact .field-label{font-weight:400;color:var(--muted);white-space:nowrap}

/* --- Знания --- */
.base-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.base-card{display:flex;flex-direction:column;gap:12px;padding:16px 18px;border-radius:var(--radius);background:var(--card);border:1px solid var(--card-border);transition:border-color .15s}
.base-card:hover{border-color:var(--card-border-hover)}
.base-top{display:flex;align-items:center;gap:12px}
.base-rule{font-size:12px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.base-agents{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.rule-card .panel-body{font-size:14px}
.base-rule-text{white-space:pre-wrap}
.source-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden}
.source-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--row-line)}
.source-row:last-child{border-bottom:0}
.source-icon{width:34px;height:34px;border-radius:10px}
.source-icon svg{width:16px;height:16px}
.source-main{display:flex;flex-direction:column;flex:1;min-width:0}
.source-main strong{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.source-main span{font-size:12px;color:var(--subtle);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.source-main:hover strong{color:var(--accent)}
.drop-zone{display:flex;align-items:center;justify-content:center;gap:14px;padding:30px;border-radius:var(--radius);border:1.5px dashed var(--line-strong);color:var(--muted);cursor:pointer;text-align:left;transition:border-color .15s,background .15s}
.drop-zone.compact{padding:14px}
.drop-zone:hover,.drop-zone.over{border-color:var(--accent);background:var(--accent-soft);color:var(--ink)}
.drop-zone>svg{width:24px;height:24px;color:var(--accent)}
.drop-zone span{display:flex;flex-direction:column}
.drop-zone small{color:var(--subtle)}
.test-search{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.test-search>input{flex:1;min-width:220px;height:38px;padding:0 12px;border-radius:10px;border:1px solid var(--line-strong);background:var(--fill)}
.found-list{display:flex;flex-direction:column;gap:8px}
.found{padding:12px 14px;border-radius:12px;background:var(--fill);border:1px solid var(--line)}
.found-head{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.found p{font-size:13px;color:var(--muted)}

/* --- Агенты и витрина --- */
.agent-hero{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:20px 22px;border-radius:var(--radius);background:var(--window-lit);border:1px solid var(--window-lit-border);box-shadow:var(--window-lit-shadow)}
.agent-tile{width:52px;height:52px;border-radius:16px}
.agent-tile svg{width:26px;height:26px}
.agent-hero-main{flex:1;min-width:200px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.agent-hero-main h2{font-size:22px}
.agent-hero-main p{color:var(--muted);font-size:13px}
.agent-hero-stats{display:flex;gap:18px}
.kpi-mini{display:flex;flex-direction:column;align-items:center}
.kpi-mini b{font-size:20px;font-variant-numeric:tabular-nums}
.kpi-mini small{font-size:11px;color:var(--subtle)}
.tabs{display:flex;overflow-x:auto}
.voice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.voice-card{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.voice-card.selected{background:var(--selected-bg);border-color:var(--selected-line)}
.voice-play{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--accent-soft);color:var(--accent);flex-shrink:0;transition:background .15s}
.voice-play:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 25%,transparent)}
.voice-play svg{width:16px;height:16px}
.voice-copy{display:flex;flex-direction:column;flex:1;min-width:0}
.voice-copy strong{font-size:14px}
.voice-copy span{font-size:12px}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;margin-top:14px}
.tpl-card{display:flex;align-items:center;gap:12px;padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);text-align:left;transition:border-color .15s,background .15s}
.tpl-card:hover{border-color:var(--card-border-hover);background:var(--fill)}
.tpl-card>svg{color:var(--subtle)}
.tpl-card.blank{border-style:dashed}
.tpl-card.static{cursor:default}
.tpl-copy{display:flex;flex-direction:column;flex:1;min-width:0}
.tpl-copy strong{font-size:14px}
.tpl-copy span{font-size:12px;color:var(--muted)}

/* --- Аналитика и тариф --- */
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.kpi{display:flex;flex-direction:column;gap:4px;padding:16px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line)}
.kpi-label{font-size:12px;color:var(--muted)}
.kpi-value{font-size:26px;font-weight:650;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.kpi.hot .kpi-value{color:var(--big-number)}
.kpi-sub{font-size:12px;color:var(--subtle)}
.analytics-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:14px;align-items:start}
.analytics-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.usage-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.plan-name{font-size:18px;font-weight:650}
.usage-numbers{display:flex;align-items:baseline;gap:8px;margin:12px 0 8px}
.usage-numbers strong{font-size:30px;font-weight:650;color:var(--big-number);text-shadow:var(--big-glow);font-variant-numeric:tabular-nums}
.usage-numbers span{color:var(--muted);font-size:13px}
.meter{height:8px;border-radius:4px;background:var(--bar-track);overflow:hidden}
.meter span{display:block;height:100%;border-radius:4px;background:var(--bar-agent);transition:width .4s}
.meter.warn span{background:var(--amber)}
.meter.danger span{background:var(--accent)}
.usage-warn{display:flex;gap:6px;align-items:flex-start;margin-top:10px;font-size:12px;color:var(--amber)}
.usage-warn svg{width:14px;height:14px;margin-top:2px}
.usage-lines{display:flex;flex-direction:column;margin-top:14px;border-top:1px solid var(--row-line)}
.usage-line{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid var(--row-line);font-size:13px}
.usage-line span{color:var(--muted)}
.usage-line.total{border-bottom:0}
.usage-line.total strong{font-size:16px}
.hbars{display:flex;flex-direction:column;gap:10px}
.hbar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'label num' 'track track';align-items:center;gap:6px 10px;font-size:13px}
.hbar-label{grid-area:label;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.hbar-track{grid-area:track;height:8px;border-radius:4px;background:var(--bar-track);overflow:hidden}
.hbar-track span{display:block;height:100%;border-radius:4px;background:var(--bar-agent)}
.hbar strong{grid-area:num;text-align:right;font-variant-numeric:tabular-nums}
.day-chart{display:flex;align-items:flex-end;gap:3px;height:180px;padding-top:6px}
.day-col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:stretch;height:100%;min-width:0}
.day-stack{display:flex;flex-direction:column-reverse;border-radius:4px 4px 0 0;overflow:hidden;min-height:2px;background:var(--bar-track)}
.day-stack .seg.base{background:var(--bar-agent-up)}
.day-stack .seg.attention{background:var(--bar-hot)}
.day-x{height:18px;text-align:center;font-size:10px;color:var(--subtle);margin-top:4px}
.rank-list{display:flex;flex-direction:column}
.rank-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--row-line);font-size:13px}
.rank-row:last-child{border-bottom:0}
.rank-row:hover .rank-name{color:var(--accent)}
.agent-dot{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:var(--tile-bg);color:var(--tile-ink)}
.agent-dot svg{width:14px;height:14px}
.rank-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-num{font-weight:600;font-variant-numeric:tabular-nums}
.rank-sub{font-size:12px;color:var(--subtle);white-space:nowrap}
.rank-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rank-main .rank-sub{white-space:normal}
.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.plan-card{display:flex;flex-direction:column;gap:6px;padding:16px;border-radius:14px;background:var(--surface);border:1px solid var(--line);text-align:left;font-size:13px;transition:border-color .15s}
.plan-card:hover:not(:disabled){border-color:var(--card-border-hover)}
.plan-card strong{font-size:16px}
.plan-card.current{background:var(--card-plan);border-color:var(--selected-line);opacity:1;cursor:default}
.plan-price{font-size:20px;font-weight:650}

/* --- Шаги настройки и строка помощника на главной --- */
.setup-card{display:flex;flex-direction:column;gap:14px;padding:20px 22px;border-radius:var(--radius);background:var(--rules-bg);border:1px solid var(--rules-border);box-shadow:var(--rules-shadow)}
.setup-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.setup-head h3{font-size:16px}
.setup-head p{color:var(--muted);font-size:13px}
.setup-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr));gap:10px;margin:0;padding:0;list-style:none}
.setup-steps a{display:flex;flex-wrap:wrap;align-items:center;gap:12px;height:100%;box-sizing:border-box;padding:14px;border-radius:12px;background:var(--rule-bg);border:1px solid var(--rule-border);transition:border-color .15s}
.setup-steps a:hover{border-color:var(--index-hot-border)}
.setup-steps li.next a{background:var(--rule-hot-bg);border-color:var(--rule-hot-border)}
.setup-steps .step-num{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1px solid var(--index-border);color:var(--index-ink);font-size:12px;flex-shrink:0}
.setup-steps li.done .step-num{background:var(--green-soft);border-color:transparent;color:var(--green)}
.setup-steps li.done .step-copy strong{color:var(--muted)}
.setup-steps .step-num svg{width:14px;height:14px}
.setup-steps .step-copy{flex:1 1 150px;min-width:0}
.setup-steps a>.btn{margin-left:auto}
.step-copy{display:flex;flex-direction:column;flex:1;min-width:0}
.step-copy strong{font-size:14px}
.step-copy small{font-size:12px;color:var(--subtle)}
.ask-bar{display:flex;align-items:center;gap:10px;padding:6px 6px 6px 14px;border-radius:14px;background:var(--fill);border:1px solid var(--line-strong)}
.ask-bar:focus-within{border-color:color-mix(in srgb,var(--accent) 55%,transparent);box-shadow:0 0 0 3px var(--accent-soft)}
.ask-icon{color:var(--accent);display:grid}
.ask-bar input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:14px;height:32px}
.channel-icon{display:inline-grid;color:var(--subtle);margin-right:4px;vertical-align:-3px}
.channel-icon svg{width:14px;height:14px}

/* --- Раздел «Помощник»: чат на всю высоту, поле ввода прилипает к низу; сообщения, слова ответа, карточки и кнопки появляются мягко.
   При «уменьшить движение» анимаций нет --- */
:root{--ease-out:cubic-bezier(.2,.9,.25,1);--ease-spring:cubic-bezier(.34,1.4,.64,1)}
.page.is-chat{padding-bottom:6px}
.page.is-chat .page-inner{max-width:780px;min-height:100%;display:flex;flex-direction:column}
.chat{flex:1;display:flex;flex-direction:column}
.chat-top{display:flex;justify-content:flex-end;margin-bottom:6px}
.chat-log{flex:1;display:flex;flex-direction:column;gap:24px;padding:8px 0 60px}
.chat.is-empty .chat-log{justify-content:center}
.chat-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;animation:chat-rise .8s var(--ease-out) both}
.chat-planet{width:260px;height:180px;margin-bottom:4px}
/* мягкая овальная маска: край холста шара не проявляется ни при каком движении курсора */
.chat-planet{-webkit-mask-image:radial-gradient(closest-side,#000 70%,transparent 100%);mask-image:radial-gradient(closest-side,#000 70%,transparent 100%)}
.chat-empty h2{font-size:32px;font-weight:500;letter-spacing:-.03em}
.chat-empty p{color:var(--muted);font-size:15px}
.chat-suggest{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:16px;max-width:640px}
.chat-suggest .chip{height:auto;min-height:38px;padding:9px 15px;border-radius:14px;animation:chat-rise .55s var(--ease-out) both;animation-delay:calc(.3s + var(--i) * 80ms);
  transition:transform .2s var(--ease-out),border-color .2s,background .2s}
.chat-suggest .chip:hover{transform:translateY(-2px);border-color:var(--hover-line)}
.chat-suggest .chip:active{transform:scale(.97)}
.cmsg{display:flex;gap:12px}
.cmsg.user{justify-content:flex-end}
.cmsg .bubble{max-width:78%;padding:10px 15px;border-radius:20px 20px 6px 20px;background:var(--fill-hover);border:1px solid var(--line);
  white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;font-size:15px;transform-origin:100% 100%}
.bot-mark{width:32px;height:32px;flex-shrink:0;display:grid;place-items:center;border-radius:11px;background:var(--tile-bg);border:1px solid var(--tile-border);color:var(--accent)}
.bot-mark svg{width:16px;height:16px}
.bot-mark.is-thinking{background:transparent;border-color:transparent}
.bot-mark .think-orb{display:block;width:42px;height:38px;margin:-4px -5px}
.bot-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:14px;padding-top:5px}
.bot-text{font-size:15px;line-height:1.6;color:var(--ink);overflow-wrap:anywhere}
.bot-text p+p,.bot-text p+ul,.bot-text ul+p{margin-top:8px}
.bot-text ul{padding-left:20px;display:grid;gap:4px}
.bot-text b{font-weight:600}
.bot-text[data-stream] p{white-space:pre-wrap}
.thinking{display:flex;align-items:center;gap:9px;height:26px;color:var(--muted)}
.chat-cards{display:grid;gap:10px}
.chat-card{display:grid;gap:12px;padding:15px 16px;border-radius:18px;border:1px solid var(--card-border);background:var(--card);
  transition:border-color .3s,opacity .3s}
.chat-card:hover{border-color:var(--line-strong)}
.chat-card header{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.chat-card header svg{width:15px;height:15px;color:var(--accent)}
.card-title{display:flex;flex-direction:column;gap:2px}
.card-title strong{font-size:17px;font-weight:500;letter-spacing:-.01em}
.card-title strong.break{font-size:14px;word-break:break-all}
.card-title span{font-size:13px;color:var(--muted)}
.card-rows{display:grid;grid-template-columns:auto 1fr;gap:5px 16px;font-size:13px}
.card-rows dd{margin:0}
.card-rows dt{color:var(--subtle)}
.card-rows dd.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-more summary{cursor:pointer;width:max-content;font-size:13px;color:var(--muted);list-style:none}
.card-more summary::-webkit-details-marker{display:none}
.card-more summary::before{content:"\203A";display:inline-block;margin-right:7px;transition:transform .2s var(--ease-out)}
.card-more[open] summary::before{transform:rotate(90deg)}
.card-more[open] .card-text{animation:chat-rise .35s var(--ease-out) both}
.card-more .card-text{margin-top:8px}
.card-text{font-size:13px;line-height:1.55;color:var(--muted)}
.card-text ul{padding-left:18px;display:grid;gap:3px}
.clamp-4{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.card-foot{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding-top:2px}
.card-foot .field-error{margin-right:auto}
.card-done{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--green);animation:chat-rise .35s var(--ease-out) both}
.card-done.muted{color:var(--subtle)}
.card-done .text-btn{margin-left:auto}
.chat-card.is-done{border-color:color-mix(in srgb,var(--green) 28%,transparent)}
.chat-card.is-skipped{opacity:.5}
.draw-check{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.draw-check circle{stroke-dasharray:64;stroke-dashoffset:64;animation:draw .55s var(--ease-out) forwards}
.draw-check path{stroke-dasharray:16;stroke-dashoffset:16;animation:draw .35s var(--ease-out) .4s forwards}
.btn.is-busy{opacity:.65;pointer-events:none}
.chat-buttons{display:flex;flex-wrap:wrap;gap:8px}
.chat-btn{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 15px;border-radius:13px;border:1px solid var(--line-strong);background:var(--fill);
  font-size:13px;color:var(--ink);animation:card-in .5s var(--ease-out) both;animation-delay:calc(var(--i) * 80ms + 60ms);transition:transform .2s var(--ease-out),border-color .2s,background .2s}
.chat-btn:hover{transform:translateY(-2px);border-color:var(--hover-line);background:var(--fill-hover)}
.chat-btn:active{transform:scale(.97)}
.chat-btn svg{width:15px;height:15px;color:var(--accent)}
.chat-composer{position:sticky;bottom:14px;z-index:2;display:flex;align-items:flex-end;gap:8px;margin-top:auto;padding:8px 8px 8px 18px;border-radius:22px;
  border:1px solid var(--line-strong);background:var(--menu-bg);box-shadow:0 -28px 34px -14px var(--bg),0 14px 40px rgba(0,0,0,.38);transition:border-color .25s,box-shadow .3s}
.chat-composer:focus-within{border-color:color-mix(in srgb,var(--accent) 45%,transparent);box-shadow:0 -28px 34px -14px var(--bg),0 0 0 4px var(--accent-soft),0 14px 40px rgba(0,0,0,.38)}
.chat-composer textarea{flex:1;min-height:40px;max-height:160px;resize:none;border:0;outline:0;background:transparent;font:inherit;font-size:15px;line-height:1.5;padding:9px 0;color:var(--ink)}
.chat-composer textarea::placeholder{color:var(--subtle)}
.chat-send{width:42px;height:42px;padding:0;border-radius:15px;transition:transform .2s var(--ease-spring),opacity .2s}
.chat-send:hover{transform:translateY(-1px)}
.chat-send:active{transform:scale(.9)}
.chat-send svg{display:block;width:20px;height:20px}
.chat-send[disabled]{opacity:.45}
@keyframes chat-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes msg-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes bubble-in{from{opacity:0;transform:translateY(6px) scale(.94)}to{opacity:1;transform:none}}
@keyframes card-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
@keyframes tok-in{from{opacity:0;filter:blur(4px)}to{opacity:1;filter:none}}
@keyframes shimmer{from{background-position:120% 0}to{background-position:-120% 0}}
@keyframes mark-pulse{0%,100%{box-shadow:0 0 0 0 rgba(238,57,63,0)}50%{box-shadow:0 0 0 6px rgba(238,57,63,.12)}}
@keyframes draw{to{stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){
  .cmsg,.cmsg .bubble,.tok,.chat-card,.chat-btn,.chat-empty,.chat-suggest .chip,.card-done,.card-more[open] .card-text{animation:none}
  .cmsg.live .bot-mark{animation:none}
  .shimmer{animation:none;background:none;color:var(--muted)}
  .draw-check circle,.draw-check path{animation:none;stroke-dashoffset:0}
}
@media (max-width:600px){
  .chat-empty h2{font-size:26px}
  .chat-planet{width:220px;height:150px}
  .cmsg .bubble{max-width:88%}
  .chat-composer{bottom:8px}
}

/* --- Узкий экран --- */
@media (max-width:900px){
  .analytics-grid{grid-template-columns:1fr}
  .setup-steps{grid-template-columns:1fr}
  .conn-grid,.base-grid{grid-template-columns:1fr}
  .agent-hero-stats{width:100%;justify-content:space-between}
  .page-head-text h2{font-size:22px}
}
@media (max-width:560px){
  .cat-card{flex-wrap:wrap}
  .cat-copy{flex:1 1 calc(100% - 52px)}
  .cat-action{margin-left:52px}
}
.agent-foot-label{color:var(--subtle);text-transform:uppercase;letter-spacing:.06em;font-size:10px;align-self:center}

/* --- Спокойный вид (20.10.2026, указание владельца): одна плоскость без вложенных рамок, красный только для главного действия
   и того, что требует внимания, меньше жирного, второстепенное - под ⓘ --- */
.app-frame .topbar{display:none}
.site-caption,.section-label{display:none}
.page-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.page-heading .page-title-row .page-head-actions{margin-left:auto}
.page-title-row .info-pop{align-self:center}
.rules-list{gap:0;padding:2px 20px}
.rule{min-height:56px;padding:12px 0;border:0;border-radius:0;background:transparent;border-bottom:1px solid var(--row-line)}
.rule:last-child{border-bottom:0}
.rules-list .rule-copy>span:first-child:not(:only-child){display:none}
.nav-count.warn{background:var(--count-bg);color:var(--muted)}
.status.warn{color:var(--badge-ink);background:var(--badge-bg)}
.task-title,.rule-copy strong,.list-title,.cat-copy strong,.cc-title strong,.mini-task-title,.inbox-copy strong,.tpl-copy strong,.step-copy strong{font-weight:500}
.due-late{color:var(--badge-hot-ink)}
@media (hover:hover){
  .task-row [data-action=task-postpone]{opacity:0;transition:opacity .15s}
  .task-row:hover [data-action=task-postpone],.task-row:focus-within [data-action=task-postpone]{opacity:1}
}
.setup-steps .step-copy small{display:none}
.setup-steps a{background:var(--fill);border-color:transparent}
.setup-steps li.next a{background:var(--fill-hover);border-color:var(--line)}
.cat-card{padding:10px 14px}
.cat-grid{gap:8px}
.block-title{font-size:13px;font-weight:500;color:var(--muted)}
.tpl-copy span{color:var(--subtle)}
.block-note{margin-left:6px;font-size:12px;font-weight:400;color:var(--subtle)}

#cat-grid{display:flex;flex-direction:column;gap:22px}
/* Показатели аналитики - одной панелью с разделителями, без отдельной плитки на каждую цифру */
.kpi-row{gap:0;border:1px solid var(--card-border);border-radius:var(--radius);background:var(--card);overflow:hidden}
.kpi{border:0;border-radius:0;background:transparent;padding:16px 18px}
.kpi+.kpi{border-left:1px solid var(--row-line)}
.kpi-value{font-weight:500}
/* Уведомления - список с разделителями; непрочитанное отмечено точкой, без своей плашки */
.notify-item{border-radius:0;padding:10px 12px}
.notify-item+.notify-item{border-top:1px solid var(--row-line)}
.notify-item.unread{background:transparent}
/* --- Без второстепенного текста (замечание владельца 20.10.2026): пояснения - ⓘ у подписи, редкие блоки свёрнуты --- */
.title-info{display:flex;align-items:center;gap:6px}
.field-label .info-pop{vertical-align:middle;margin:-4px 0 -4px 4px}
.field-label .info-pop>summary,.input-copy .info-pop>summary{width:20px;height:20px}
.info-pop-body{font-weight:400;color:var(--ink);text-transform:none;letter-spacing:0}
.fold>summary{list-style:none;cursor:pointer;width:max-content}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary svg{width:14px;height:14px;transition:transform .2s ease}
.fold[open]>summary svg{transform:rotate(180deg)}
.fold>summary:hover{color:var(--ink)}
.fold[open]>summary{margin-bottom:12px}
/* ⓘ у подписи поля открывается на ширину поля: на телефоне не выходит за край экрана */
label.field,.field{position:relative}
.field-label .info-pop{position:static}
.field-label .info-pop-body{left:0;right:0;top:26px;width:auto;max-width:440px}

/* --- Экран входа (20.10.2026): одно пространство без шва. Поле символов на весь экран, ядро Ansa слева разговаривает с человеком,
   карточка входа справа - стекло над тем же полем; рамка карточки дышит вместе с голосом ядра (--core-level, --core-attn) --- */
.auth-layout{position:relative;isolation:isolate;background:var(--bg);--core-level:0;--core-attn:0}
.auth-layout>.ascii-intro{position:fixed;inset:0;z-index:0;display:block;width:100vw;height:100dvh}
.auth-layout::after{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:radial-gradient(70% 85% at 30% 46%,transparent 40%,rgba(9,9,11,.62) 100%),linear-gradient(90deg,transparent 52%,rgba(9,9,11,.32) 100%)}
.auth-layout .auth-story,.auth-layout .auth-main{position:relative;z-index:1;background:transparent;border:0}
.auth-layout .auth-story::before{display:none}
.auth-layout .auth-story{padding:28px 48px;pointer-events:none}
.auth-layout .auth-story .brand{pointer-events:auto;align-self:flex-start}
.auth-layout .auth-card{max-width:392px;padding:34px 32px 26px;border-radius:22px;
  background:color-mix(in srgb,var(--bg) 66%,transparent);-webkit-backdrop-filter:blur(18px) saturate(125%);backdrop-filter:blur(18px) saturate(125%);
  border:1px solid rgba(255,120,128,calc(.07 + var(--core-attn)*.1 + var(--core-level)*.22));
  box-shadow:0 30px 90px rgba(0,0,0,.5),0 0 calc(var(--core-level)*60px) rgba(237,56,64,calc(var(--core-level)*.18)),inset 0 1px 0 rgba(255,255,255,.04);
  transition:border-color .25s ease}
.auth-layout .auth-card>h2{margin-bottom:18px}
.auth-card.swap{animation:card-swap .5s cubic-bezier(.2,.7,.2,1)}
/* Первое открытие: карточка выезжает после того, как ядро собралось; логотип проявляется вместе с полем */
.auth-layout.boot .auth-card{animation:card-in 1s cubic-bezier(.16,.8,.2,1) .95s both}
.auth-layout.boot .auth-story .brand{animation:brand-in .9s ease .5s both}
@keyframes card-in{from{opacity:0;transform:translateX(26px) scale(.97);filter:blur(8px)}to{opacity:1;transform:none;filter:none}}
@keyframes brand-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes card-swap{from{opacity:0;transform:translateY(10px) scale(.985);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
.auth-layout.leaving .auth-card{opacity:0;transform:scale(.96) translateY(8px);filter:blur(6px);transition:opacity .6s ease,transform .7s ease,filter .6s ease}
.auth-layout.leaving .core-caption,.auth-layout.leaving .brand{opacity:0;transition:opacity .5s ease .2s}
.app-frame{animation:cabinet-in .7s ease both}
@keyframes cabinet-in{from{opacity:0;transform:scale(1.015)}to{opacity:1;transform:none}}

/* Реплика ядра: тег канала (звонок или чат) и строка, которая печатается по буквам; положение задаёт ядро (top) */
.core-caption{position:absolute;left:24px;right:24px;top:62%;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.core-tag{display:inline-flex;align-items:center;gap:8px;height:26px;padding:0 12px;border-radius:999px;font-size:12px;letter-spacing:.02em;color:var(--muted);
  background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.07);opacity:0;transform:translateY(6px);transition:opacity .45s ease,transform .45s ease}
.core-tag.on{opacity:1;transform:none}
.core-tag b{font-weight:500}
.core-tag i{width:13px;height:13px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") center/contain no-repeat}
.core-tag[data-channel=call] i{color:var(--accent);animation:core-ring 1.6s ease-in-out infinite}
.core-tag[data-channel=chat] i{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");color:var(--ink)}
@keyframes core-ring{0%,55%,100%{transform:rotate(0)}10%,30%{transform:rotate(-14deg)}20%,40%{transform:rotate(14deg)}}
.auth-layout .core-caption .core-line{min-height:2.7em;max-width:500px;margin:0;font-size:25px;line-height:1.32;font-weight:500;letter-spacing:-.015em;color:var(--ink);text-wrap:balance;transition:opacity .55s ease,transform .55s ease,filter .55s ease}
.core-line>span{animation:core-char .42s ease both}
.core-line>span.dec{color:var(--accent);text-shadow:0 0 10px rgba(237,56,64,.6)}
@keyframes core-char{from{opacity:0;filter:blur(5px);text-shadow:0 0 18px rgba(255,140,146,.9)}to{opacity:1;filter:none;text-shadow:0 0 0 transparent}}
.core-line .caret{display:inline-block;width:2px;height:.95em;margin-left:3px;vertical-align:-.1em;background:var(--accent);border-radius:1px;animation:core-caret 1s steps(1) infinite}
@keyframes core-caret{50%{opacity:0}}
.core-line.out{opacity:0;transform:translateY(-8px);filter:blur(4px)}
.core-dots{display:inline-flex;gap:6px;padding:10px 0}
.core-dots i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:core-dot 1.1s ease-in-out infinite}
.core-dots i:nth-child(2){animation-delay:.15s}
.core-dots i:nth-child(3){animation-delay:.3s}
@keyframes core-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}
@media (max-width:860px){
  .auth-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}
  .auth-layout .auth-story{min-height:50dvh;padding:16px 20px}
  .auth-layout .auth-main{padding:0 16px 24px;align-items:flex-start}
  .auth-layout .auth-card{padding:26px 22px 22px;border-radius:20px}
  .auth-layout::after{background:radial-gradient(90% 60% at 50% 22%,transparent 35%,rgba(9,9,11,.6) 100%)}
  .auth-layout .core-caption .core-line{font-size:19px;min-height:2.6em}
  .core-caption{gap:8px}
}
@media (prefers-reduced-motion:reduce){.core-line>span,.auth-card.swap,.app-frame,.auth-layout.boot .auth-card,.auth-layout.boot .auth-story .brand{animation:none}}
/* --- Уровни важности (правила 1.26, замечание владельца 20.10.2026: второстепенное сливалось в одну кучу).
   Главное - .btn.primary, одно на экран или окно. Второстепенное - .btn (обводка). «Сделать сейчас» в строке - .btn.soft
   (тихая заливка цветом бренда). Переходы, отмена и повторы в строках - .btn.ghost, .text-btn, .icon-btn. Опасное - в стороне.
   «Всё в порядке» - точка и приглушённый текст без плашки; цветом выделено только то, что требует внимания. --- */
.btn{font-weight:550}
.btn.soft{background:var(--accent-soft);border-color:transparent;color:var(--accent)}
.btn.soft:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 24%,transparent);border-color:transparent;color:var(--ink)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted);font-weight:500}
.btn.ghost:hover:not(:disabled){background:var(--fill-hover);border-color:transparent;color:var(--ink)}
.btn.ghost svg{width:14px;height:14px;opacity:.85}
.state-chip.ok{background:transparent;color:var(--muted);padding:0 2px;font-weight:500}
.status.warn{background:transparent;color:var(--amber);padding:0 2px;font-weight:500}
/* повторяющиеся иконки строк - бледные, проявляются при наведении на строку и фокусе */
.source-row .icon-btn,.task-actions .icon-btn{opacity:.4;transition:opacity .15s,background .15s,color .15s}
.source-row:hover .icon-btn,.source-row:focus-within .icon-btn,.task-row:hover .task-actions .icon-btn,.task-row:focus-within .task-actions .icon-btn{opacity:1}
/* каталог подключений: «Подключить» тихая, при наведении на карточку - цвет бренда */
.cat-card:hover .btn.ghost,.cat-card:focus-within .btn.ghost{color:var(--accent);background:var(--accent-soft)}
/* подзаголовки внутри окна тише его заголовка */
#modal .section-title{font-size:13px;font-weight:600;color:var(--muted);letter-spacing:.01em;margin:4px 0 8px}
/* кнопка прослушивания в каждой строке разговоров - тихая; цвет бренда - при наведении на строку и у идущих разговоров */
.inbox-row .play-btn{border-color:transparent;color:var(--subtle);transition:color .15s,border-color .15s}
.inbox-row:hover .play-btn,.inbox-row:focus-within .play-btn,.inbox-row.live .play-btn{border-color:var(--line-strong);color:var(--accent)}
/* одно состояние - один цвет: «нужна проверка» везде жёлтая, красный - только опасное и просроченное */
.inbox-right .row-status.warn{color:var(--amber)}
/* нейтральные состояния (не в сети, выключен) - точка и приглушённый текст без плашки: повтор на каждой карточке не шумит */
.state-chip:not(.warn):not(.danger){background:transparent;padding:0 2px;font-weight:500}
/* присутствие на карточках: «не в сети» и «свободен» - точка и тихий текст; плашка - только у того, что сейчас происходит */
.status.presence.offline,.status.presence.available{background:transparent;padding:0 2px;font-weight:500;color:var(--muted)}
/* «Отмена» и «Закрыть» в окнах - третьестепенные: без рамки, рядом с главной кнопкой не спорят */
#modal .btn[data-action="close"]:not(.primary){background:transparent;border-color:transparent;color:var(--muted);font-weight:500}
#modal .btn[data-action="close"]:not(.primary):hover{background:var(--fill-hover);color:var(--ink)}
/* Генерация: один индикатор ожидания, затем обычный текст без расшифровки и светящихся рамок. */
.live-caret{display:inline-block;width:2px;height:1em;margin-left:3px;vertical-align:-.12em;background:var(--muted)}
/* --- Лёгкий кабинет (20.10.2026, владелец: «тяжело воспринимается, перегружен»). Один уровень рамок: кабинет без окна вокруг,
   у окон и панелей нет полосы под заголовком, шаги настройки без плиток; жирный - заголовок страницы и цифры, строки - обычным;
   красный - главная кнопка и то, что ждёт решения: полосы тем и обработанные звонки - нейтральные, состояние строки - точка --- */
.app-frame>.shell{background:transparent;border:0;border-radius:0;box-shadow:none;margin-top:4px}
.app-frame .sidebar{background:transparent;border-right:0}
.nav a.active{box-shadow:none;background:var(--fill-hover)}
.win,.panel,.setup-card{box-shadow:var(--card-shadow)}
.win-head{min-height:0;padding:20px 24px 6px;border-bottom:0}
.win-head h3,.panel-head h3{font-size:15px;font-weight:600;letter-spacing:-.01em}
.panel-head{border-bottom-color:transparent}
.win-body.metrics{padding:18px 28px 26px;gap:40px}
.big-value strong{font-size:56px}
.metric-links{margin-top:20px}
.metric-link strong{font-size:18px}
.chart-plot{height:150px}
.chart-line span{color:var(--subtle);opacity:.8}
.seg.base,.key.base{background:var(--chart-base)}
.seg.attention,.key.attention{background:var(--chart-attention)}
.bar-legend{margin-top:10px}
.bar-legend .bar.agent{background:var(--chart-base)}
.bar-legend .bar.hot{background:var(--chart-attention)}
.chart-table summary{font-size:12px;color:var(--subtle)}
.topics{gap:12px}
.topic-name{font-size:13px}
.topic-track{height:4px;background:var(--bar-track)}
.topic-bar{background:var(--chart-base)}
button.topic:hover .topic-bar{background:var(--muted)}
.mini-task{padding:11px 24px}
.mini-task+.mini-task{border-top-color:var(--row-line)}
/* Строки - обычным весом: на Windows 500 рисуется полужирным (Segoe UI Semibold), 450 - обычным, на Mac - чуть плотнее обычного */
.mini-task-title,.inbox-copy strong,.task-title{font-weight:450}
.due-late{color:inherit}
.due-late::before{content:"";display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%;background:var(--chart-attention);vertical-align:1px}
.inbox-right .row-status.warn,.inbox-right .row-status.hot{color:var(--muted)}
.inbox-right .row-status.warn::before,.inbox-right .row-status.hot::before{content:"";display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%;background:var(--amber);vertical-align:1px}
.inbox-right .row-status.hot::before{background:var(--chart-attention)}
.inbox-main{padding:14px 0}
.inbox-main .avatar{width:36px;height:36px;border-radius:11px}
.tag{border:0;background:var(--fill-hover);color:var(--muted);font-weight:500}
/* Шаги настройки: одна карточка, внутри - три шага в строку без своих плиток; следующий шаг узнаётся по главной кнопке */
.setup-card{padding:16px 20px;gap:8px;border-radius:20px}
.setup-head h3{font-size:13px;font-weight:500;color:var(--muted)}
.setup-steps{gap:4px}
.setup-steps a{padding:10px 12px;border:0;background:transparent}
.setup-steps a:hover{background:var(--fill)}
.setup-steps li.next a{background:transparent}
.setup-steps .step-copy strong{font-weight:450}
.setup-steps .step-num{width:26px;height:26px}
@media(max-width:600px){.setup-card{padding:14px 12px}.setup-steps a{padding:9px 8px}.win-head{padding:16px 16px 4px}.mini-task{padding:11px 16px}.big-value strong{font-size:48px}}
/* Светлая тема: карточки белые на тёплом фоне, тени мягкие; тяжёлые тёмные тени тёмной темы здесь не нужны */
[data-theme=light] .chat-composer{box-shadow:0 -28px 34px -14px var(--bg),0 8px 24px rgba(20,22,30,.08)}
[data-theme=light] .chat-composer:focus-within{box-shadow:0 -28px 34px -14px var(--bg),0 0 0 4px var(--accent-soft),0 8px 24px rgba(20,22,30,.08)}
[data-theme=light] .recording audio{color-scheme:light}
[data-theme=light] .tok.dec{text-shadow:none}
[data-theme=light] .live-caret{box-shadow:none}
::view-transition-old(root),::view-transition-new(root){animation-duration:.35s}
/* Аналитика - по тому же правилу: обработанное и объёмы - нейтральным, красным - только то, где понадобился человек */
.day-stack .seg.base,.hbar-track span{background:var(--chart-base)}
.day-stack .seg.attention{background:var(--chart-attention)}
.meter span{background:var(--subtle)}
/* «Нужна проверка» в строках - как на главной: янтарная точка и обычный текст, а не цветная надпись */
.status.warn{color:var(--muted);font-weight:400}
.status.warn::before{display:inline-block;content:"";width:6px;height:6px;margin:0;border-radius:50%;background:var(--amber)}
/* --- Кнопка темы (20.10.2026, владелец: «всегда сверху, даже при регистрации»): в шапке кабинета - рядом с уведомлениями,
   на входе и регистрации - в правом верхнем углу над полем символов --- */
.auth-theme{position:fixed;top:22px;right:28px;z-index:3}
.theme-btn svg{width:18px;height:18px}
@media(max-width:860px){.auth-theme{top:12px;right:14px}}
/* Вход в светлой теме: поле и ядро на тёплом белом, карточка - белое стекло, свет голоса - мягкая красная кромка */
[data-theme=light] .auth-layout::after{background:radial-gradient(70% 85% at 30% 46%,transparent 40%,color-mix(in srgb,var(--bg) 70%,transparent) 100%),linear-gradient(90deg,transparent 52%,color-mix(in srgb,var(--bg) 40%,transparent) 100%)}
[data-theme=light] .auth-layout .auth-card{background:color-mix(in srgb,var(--surface) 80%,transparent);
  border-color:color-mix(in srgb,var(--accent) calc(10% + var(--core-attn)*10% + var(--core-level)*24%),var(--line));
  box-shadow:0 30px 80px rgba(20,22,30,.10),0 0 calc(var(--core-level)*60px) color-mix(in srgb,var(--accent) calc(var(--core-level)*14%),transparent)}
[data-theme=light] .core-tag{background:var(--fill);border-color:var(--line)}
[data-theme=light] .core-line>span{animation-name:core-char-light}
[data-theme=light] .core-line>span.dec{text-shadow:none}
@keyframes core-char-light{from{opacity:0;filter:blur(5px)}to{opacity:1;filter:none}}
@media (max-width:860px){[data-theme=light] .auth-layout::after{background:radial-gradient(90% 60% at 50% 22%,transparent 35%,color-mix(in srgb,var(--bg) 70%,transparent) 100%)}}
/* Прокрутка карточки входа обрезала её тень прямоугольником (на светлом фоне это видно): у прокрутки - запас под тень, отступы те же */
.auth-layout .auth-scroll{padding-block:56px 120px;margin-block:-56px -120px}
@media(max-width:860px){.auth-layout .auth-scroll{padding:40px 16px 80px;margin:-40px -16px -80px}}
.auth-theme .theme-btn{width:38px;height:38px;border:1px solid var(--line-strong);border-radius:11px;color:var(--ink);
  background:color-mix(in srgb,var(--surface) 60%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
/* --- Подключение в чате (20.10.2026, владелец: «не кнопка, а окошко прямо в чате, где вводишь данные»): шаги подключения - форма
   внутри карточки помощника; несколько вариантов - переключатель над формой; CRM выбирается кнопками каталога --- */
.connect-card{gap:14px}
.connect-tabs{justify-self:start}
.connect-inline .demo-form{display:grid;gap:14px}
.connect-inline .form-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0;padding:0;border:0}
.connect-inline .field-error:empty{display:none}
.connect-inline .mini-steps{margin:0}

/* Действия CRM на телефоне помещаются в окно; отключение отделено от сохранения. */
@media(max-width:600px){
  #crm-settings-form .form-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}
  #crm-settings-form .form-footer>.spacer{display:none}
  #crm-settings-form .form-footer>[data-action=crm-disconnect]{grid-column:1/-1;justify-self:start}
  #crm-settings-form .form-footer>[data-action=crm-test]{justify-self:end}
}
.chip-row{display:flex;flex-wrap:wrap;gap:8px}
/* Карточка с формой не шире сообщения: длинные шаги переносятся, кнопки уходят на новую строку (на телефоне не вылезают за край) */
.cmsg.bot .bot-body,.chat-cards,.connect-card,.connect-inline,.connect-inline form{min-width:0;max-width:100%}
.connect-inline .form-footer{flex-wrap:wrap}
.connect-inline .steps-list li,.connect-inline .page-note{overflow-wrap:anywhere}
.chat-cards,.chat-card{grid-template-columns:minmax(0,1fr)}

/* Чёткий выбор роли и спокойные служебные состояния (21.10.2026). */
.role-card{position:relative;padding-right:16px}
.role-card strong{padding-right:24px}
.role-card .role-check{position:absolute;right:16px;top:18px;display:grid;place-items:center;width:22px;height:22px;border:1px solid var(--line-strong);border-radius:50%;color:transparent}
.role-card .role-check svg{width:15px;height:15px}
.role-card[aria-pressed="true"]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,var(--card));box-shadow:0 0 0 1px var(--accent)}
.role-card[aria-pressed="true"] .role-check{color:#fff;background:var(--accent);border-color:var(--accent)}
.role-card:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.mini-steps li.on{font-weight:600}
.mini-steps li.on .step-mark{background:var(--accent);color:#fff;border-color:var(--accent)}
.card-audience{display:flex;align-items:flex-start;gap:9px;padding:12px 0;margin:0;font-size:14px;line-height:1.5}
.card-audience svg{width:18px;height:18px;flex-shrink:0;margin-top:2px;color:var(--muted)}
.setup-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.setup-go{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--muted)}
.setup-go svg{width:16px;height:16px}
.service-notice,.helper-notice{display:flex;gap:12px;padding:14px 18px;border:1px solid color-mix(in srgb,var(--muted) 22%,transparent);border-radius:14px;background:var(--card);font-size:13px;line-height:1.5}
.service-notice{margin:0 28px 12px}
.service-notice>svg,.helper-notice>svg{flex-shrink:0;width:19px;height:19px;color:var(--muted);margin-top:1px}
.service-notice strong,.helper-notice strong{font-weight:500;color:var(--ink)}
.service-notice p,.helper-notice p{margin:3px 0 0;color:var(--muted)}
.service-notice details{margin-top:8px}.service-notice summary{cursor:pointer;color:var(--muted)}
.service-notice details strong{display:block;margin-top:8px}
.presence-menu small{line-height:1.45}
@media(max-width:860px){.service-notice{margin:0 14px 10px;padding:11px 13px}.mini-steps{flex-wrap:wrap;row-gap:12px}.mini-steps li{min-width:calc(50% - 6px)}.setup-head .btn{width:100%;justify-content:center}}
