/* UzCloud style: Google Sans, основной #335CFF, радиус 10px, светлый фон */
:root {
  --brand: #335cff;
  --brand-hover: #2649e0;
  --brand-tint: rgba(71, 108, 255, 0.1);
  --brand-tint-2: rgba(71, 108, 255, 0.18);
  --text: #171717;
  --muted: #6b7280;
  --line: #e7e9ef;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --ok: #16a34a;
  --ok-tint: #ecfdf3;
  --warn: #b45309;
  --warn-tint: #fff7e6;
  --err: #dc2626;
  --err-tint: #fef2f2;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --font: "Google Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 500; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border: 0; border-radius: var(--radius);
  font: 500 15px var(--font); cursor: pointer; transition: background .15s, opacity .15s;
  background: var(--brand); color: #fff; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--brand-tint); color: var(--brand); }
.btn.secondary:hover { background: var(--brand-tint-2); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.danger { background: var(--err-tint); color: var(--err); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }

/* Поля */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font: 15px var(--font); color: var(--text); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 6px 0 16px; }
.check input { margin-top: 3px; accent-color: var(--brand); }

.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 14px; }
.alert.err { background: var(--err-tint); color: var(--err); }
.alert.ok { background: var(--ok-tint); color: var(--ok); }
.alert.info { background: var(--brand-tint); color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg-soft); color: var(--muted); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.err { background: var(--err-tint); color: var(--err); }
.badge.brand { background: var(--brand-tint); color: var(--brand); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }

/* ===== Экран входа/регистрации ===== */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-promo {
  background: radial-gradient(1200px 600px at -10% -10%, #e8edff 0%, transparent 60%), linear-gradient(180deg, #f5f7ff, #eef2ff);
  padding: 40px 56px; display: flex; flex-direction: column; gap: 32px;
}
.auth-promo h1 { font-size: 44px; margin-top: auto; }
.auth-promo h1 span { color: var(--brand); }
.auth-promo .lead { font-size: 17px; color: #3f4553; max-width: 520px; }
.promo-list { display: grid; gap: 12px; margin: 0 0 auto; padding: 0; list-style: none; max-width: 520px; }
.promo-list li { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,.7); border: 1px solid #e3e8ff; border-radius: var(--radius); padding: 12px 14px; }
.promo-list .ic { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.auth-main { display: flex; flex-direction: column; padding: 32px 40px; }
.auth-top { display: flex; justify-content: flex-end; gap: 8px; }
.auth-box { width: 100%; max-width: 420px; margin: auto; padding: 24px 0; }
.tabs { display: flex; background: var(--bg-soft); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.tabs button { flex: 1; height: 38px; border: 0; background: transparent; border-radius: 8px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; }
.tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.logo { height: 28px; width: auto; max-width: 220px; object-fit: contain; object-position: left center; display: block; align-self: flex-start; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: #fff; padding: 6px 10px; font: 500 13px var(--font); color: var(--muted); cursor: pointer; }
.lang-switch button.active { background: var(--brand-tint); color: var(--brand); }

.verify-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.verify-item .row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.code-row { display: flex; gap: 8px; margin-top: 12px; }
.code-row .input.otp { letter-spacing: .3em; font-size: 18px; text-align: center; }

/* ===== Чат ===== */
.chat-app { height: 100%; display: grid; grid-template-columns: 280px 1fr; }
.side { border-right: 1px solid var(--line); background: var(--bg-soft); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.side-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.conv { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font: 14px var(--font); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv:hover { background: #eceff7; }
.conv.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.side-foot { border-top: 1px solid var(--line); padding: 14px 16px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.side-foot .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main-head { height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 12px; }
.main-head .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { flex: 1; overflow-y: auto; padding: 24px; }
.feed-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; }
.msg .avatar { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; font-weight: 500; }
.msg.assistant .avatar { background: var(--brand); color: #fff; }
.msg.user { flex-direction: row-reverse; }
.msg.user .avatar { background: #e9ebf2; color: var(--muted); }
.bubble { min-width: 0; max-width: 100%; }
.msg.user .bubble { background: var(--brand-tint); padding: 10px 14px; border-radius: 14px 14px 4px 14px; max-width: 80%; white-space: pre-wrap; }
.msg.assistant .bubble { padding-top: 4px; flex: 1; }
.md p { margin: 0 0 .7em; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: .3em 0 .8em; padding-left: 1.3em; }
.md code { background: var(--bg-soft); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.md pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; }
.md table { border-collapse: collapse; margin: .5em 0 1em; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--bg-soft); font-weight: 500; }

.tool { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; margin: 2px 0; max-width: 100%; }
.tool .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: pulse 1s infinite; flex: none; }
.tool.done .dot { background: var(--ok); animation: none; }
.tool.fail .dot { background: var(--err); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }

.confirm { border: 1px solid #c9d4ff; background: #f7f9ff; border-radius: var(--radius); padding: 14px 16px; margin: 6px 0; }
.confirm .t { font-weight: 500; margin-bottom: 4px; }
.confirm .actions { display: flex; gap: 8px; margin-top: 12px; }
.confirm.done { opacity: .7; }

.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b8c2e0; animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

.composer { border-top: 1px solid var(--line); padding: 16px 24px 20px; }
.composer-inner { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; font: 15px/1.5 var(--font); max-height: 200px; padding: 8px 0; background: transparent; }
.composer .hint { max-width: 820px; margin: 8px auto 0; font-size: 12px; color: var(--muted); text-align: center; }

.empty { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.empty h1 { font-size: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: 14px var(--font); cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--brand); color: var(--brand); }

.banner { background: var(--warn-tint); color: var(--warn); padding: 10px 24px; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }

/* ===== Админка ===== */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100%; }
.admin-nav { background: #0f1729; color: #c7cede; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav .brand { color: #fff; font-weight: 500; padding: 4px 12px 18px; display: flex; gap: 10px; align-items: center; }
.admin-nav a { color: #c7cede; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }
.admin-main { padding: 28px 32px; background: var(--bg-soft); min-width: 0; }
.admin-main > .card + .card { margin-top: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi .v { font-size: 28px; font-weight: 500; }
.kpi .l { font-size: 13px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbff; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { max-width: 320px; height: 38px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.derived { font: 12px ui-monospace, Consolas, monospace; color: var(--muted); margin-top: 4px; word-break: break-all; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.transcript .m { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.transcript .m.user { background: var(--brand-tint); }
.transcript .m.tool { font: 12px ui-monospace, Consolas, monospace; background: var(--bg-soft); max-height: 220px; overflow: auto; }
.transcript .role { font-size: 11px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; letter-spacing: .05em; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-promo { display: none; }
  .auth-main { padding: 20px 16px; }
  .chat-app { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 20% 0 0; z-index: 10; box-shadow: var(--shadow); }
  .feed, .composer { padding-left: 16px; padding-right: 16px; }
  .main-head { padding: 0 16px; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding: 10px; }
  .admin-nav .brand { display: none; }
  .admin-main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .only-mobile { display: none !important; } }

/* Карточки в чате: выбор кнопками, согласия, форма */
.confirm .body:empty { display: none; }
.confirm .options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.confirm .opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid #c9d4ff; background: #fff; border-radius: var(--radius); font: 14px var(--font); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.confirm .opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.confirm .opt .ol { font-weight: 500; }
.confirm .opt .od { font-size: 12px; color: var(--muted); }
.confirm .opt .od:empty { display: none; }
.confirm .opt.chosen { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 2px var(--brand-tint-2); }
.confirm .opt:disabled:not(.chosen) { opacity: .55; cursor: default; }
.confirm .agree { margin: 12px 0 0; color: var(--text); }
.confirm .card-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 12px; }
.confirm .card-form .field { margin-bottom: 10px; }
.confirm .card-form .input { height: 40px; }
.confirm .js-card-err { margin: 10px 0 0; }
@media (max-width: 700px) { .confirm .card-form { grid-template-columns: 1fr; } }

/* Аватар ассистента — логотип; логотип справа в шапке */
.msg.assistant .avatar { background: var(--brand); overflow: hidden; padding: 4px; }
.msg.assistant .avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.header-logo { height: 26px; width: auto; max-width: 160px; object-fit: contain; flex: none; }
/* Форма в чате: подсказки и широкие поля */
.confirm .card-form .field.wide { grid-column: 1 / -1; }
.confirm .card-form .hint { font-size: 12px; color: var(--muted); line-height: 1.35; }
.confirm .card-form textarea.input { height: auto; }
/* Ожидание MyID / оплаты */
.confirm .qr { display: block; width: 220px; height: 220px; margin: 12px 0 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.wait-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.wait-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: pulse 1s infinite; }
.wait-status.ok .dot { background: var(--ok); animation: none; }
.wait-status.fail .dot { background: var(--err); animation: none; }
.wait-status.fail { color: var(--err); }

/* ===== Стиль как на главной: Google Sans, синий UzCloud, пузыри, минимализм ===== */
.msg .avatar { display: none; }
.msg.user .bubble { background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 20px 20px 6px 20px; max-width: 78%; }
.msg.assistant .bubble { padding-top: 0; }
.msg.assistant .txt { display: inline-block; max-width: 88%; background: #f3f5ff; color: var(--text); padding: 12px 16px; border-radius: 20px 20px 20px 6px; margin: 2px 0; }
.msg.assistant .txt + .txt { margin-top: 8px; }
.msg.assistant .txt .md table, .msg.assistant .txt table { background: #fff; }
.feed-inner { gap: 14px; }
.main-head { border-bottom-color: #eef0f6; }
.main-head .title { flex: 1; }
.composer { border-top: 0; background: linear-gradient(to top, #fff 60%, rgba(255, 255, 255, 0)); }
.composer-inner { border: 1.5px solid #d5ddff; border-radius: 20px; box-shadow: 0 6px 24px rgba(51, 92, 255, .06); transition: border-color .2s, box-shadow .2s; }
.composer-inner:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(51, 92, 255, .10); }
.composer .btn { border-radius: 14px; }
.chip { border: 1.5px solid #d5ddff; color: var(--brand); font-weight: 500; }
.chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.confirm { border-color: #dfe5ff; background: #fafbff; border-radius: 18px; }
.confirm .opt { border-radius: 14px; }
.confirm .opt.primary { background: linear-gradient(135deg, #335cff 0%, #4a6dff 55%, #6f8cff 100%); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(51, 92, 255, .25); }
.confirm .opt.primary .od { color: rgba(255, 255, 255, .85); }
.confirm .opt.primary:hover:not(:disabled) { background: linear-gradient(135deg, #2649e0 0%, #335cff 55%, #5a7bff 100%); }
.btn { border-radius: 12px; }

/* ===== Вход и регистрация: слева — спокойная фоновая анимация, форма без эффектов ===== */
.auth-promo { position: relative; overflow: hidden; isolation: isolate; background: #f7f8fc; }
.auth-promo::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(51, 92, 255, .28) 1.5px, transparent 1.6px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(70% 60% at 30% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 30% 40%, #000 30%, transparent 75%);
  animation: dotsDrift 40s linear infinite; }
.auth-promo::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 92, 255, .18), rgba(51, 92, 255, 0) 70%); animation: blobFloat 18s ease-in-out infinite alternate; }
@keyframes dotsDrift { from { background-position: 0 0; } to { background-position: 220px 110px; } }
@keyframes blobFloat { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, -60px) scale(1.15); } }
.auth-box { background: #fff; }
@media (max-width: 900px) {
  .side-foot .lang-switch { display: none; }
  .auth-box { padding: 22px 18px; }
  .msg.user .bubble { max-width: 88%; }
  .msg.assistant .txt { max-width: 100%; }
  /* Кнопка отправки — стрелкой, чтобы подсказка в поле помещалась */
  .composer .btn { font-size: 0; width: 46px; padding: 0; flex: none; }
  .composer .btn::after { content: "→"; font-size: 20px; line-height: 1; }
  .composer textarea:placeholder-shown { white-space: nowrap; overflow: hidden; }
  .main-head .title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .auth-promo::before, .auth-promo::after { animation: none; } }

/* ===== Регистрация: звёздочка у обязательных полей, «глазик» у пароля ===== */
#form-register .field:has([required]) > label::after { content: " *"; color: #e5484d; font-weight: 600; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 46px; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted, #6e7380); cursor: pointer; display: grid; place-items: center; }
.pass-eye:hover { background: rgba(51, 92, 255, .08); color: var(--brand, #335cff); }
.pass-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pass-eye .eye-off { display: none; }
.pass-eye.on { color: var(--brand, #335cff); }
.pass-eye.on .eye-off { display: block; }

/* ===== Варианты выбора: карточки с описанием — плитками, без описания — компактными кнопками ===== */
.confirm .options { display: flex; flex-wrap: wrap; align-items: flex-start; }
.confirm .opt { flex: 1 1 190px; }
.confirm .opt.compact { flex: 0 0 auto; padding: 10px 18px; border-radius: 999px; align-self: center; }

/* Кнопка «Перейти в панель» — BILLmanager под сессией клиента */
.main-head .panel-go { margin-left: auto; white-space: nowrap; }
@media (max-width: 720px) { .main-head .panel-go { padding: 0 10px; font-size: 13px; } }

/* ===== Админка: чат целиком — инструменты и карточки ===== */
.transcript .m { display: block; }
.transcript details.m.tool { white-space: normal; max-height: none; }
.transcript details summary { cursor: pointer; font-size: 13px; }
.transcript pre { margin: 6px 0 8px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font: 12px ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.transcript .m.assistant { background: #fff; }
.transcript .m.card-log { white-space: normal; border-color: var(--brand-tint-2, #c9d4ff); background: var(--brand-tint, #f3f5ff); }
.transcript .m.card-log ul { margin: 6px 0 0 18px; padding: 0; }

/* Поле ввода в карточке выбора (например, свой домен) */
.confirm .choice-input { margin-top: 10px; }

/* Режим «один чат»: без левой колонки, в шапке — язык и выход */
.only-single { display: none !important; }
.chat-app.single { grid-template-columns: 1fr; }
.chat-app.single .side, .chat-app.single #btn-side { display: none !important; }
.chat-app.single .only-single { display: flex !important; }
.head-user { align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.chat-app.single .main-head .lang-switch.only-mobile { display: none !important; }

/* «Размышления»: ход работы ассистента свёрнут, как в IDE */
details.work { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
details.work > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; user-select: none; }
details.work > summary::-webkit-details-marker { display: none; }
details.work > summary::after { content: '▸'; font-size: 11px; transition: transform .15s; }
details.work[open] > summary::after { transform: rotate(90deg); }
details.work .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
details.work.done .spin { display: none; }
details.work .wl { max-width: 52ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.work .wb { border-left: 2px solid var(--line); margin: 4px 0 0 5px; padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 4px; }
details.work .wb .txt { color: var(--muted); }
details.work .wb .txt p { margin: 2px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Карточка «Доступы» */
.creds { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.cred { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 10px; align-items: center; }
.cred .cl { color: var(--muted); font-size: 13px; }
.cred .cv { font: 13px ui-monospace, Consolas, monospace; background: var(--bg-soft); padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; }
@media (max-width: 600px) { .cred { grid-template-columns: 1fr auto; } .cred .cl { grid-column: 1 / -1; } }

/* Вложения: скрепка, лоток перед отправкой, превью в сообщении клиента */
.composer .attach { flex: none; width: 40px; padding: 0; display: grid; place-items: center; }
.composer .attach svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.att-tray { max-width: 820px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.att-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.att-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 2px; }
.msg.user .att-img { display: block; max-width: 260px; max-height: 200px; border-radius: 10px; margin-top: 8px; }
.msg.user .att-file { display: inline-block; margin-top: 8px; font-size: 13px; opacity: .9; }
details.work .spin.hidden { display: none; }

/* ===================================================================================================
   Кабинет (один чат) — в духе Telegram, в цветах UzCloud: фон с облаками, пузыри с хвостиком,
   аватар ассистента, плавающая строка ввода, кнопки выбора — как инлайн-клавиатура.
   =================================================================================================== */
.chat-app.single {
  --tg-bg: #e6ecfa;
  --tg-in: #ffffff;
  --tg-out: linear-gradient(135deg, #335cff 0%, #4a6dff 60%, #5f7fff 100%);
  --tg-shadow: 0 1px 1.5px rgba(23, 37, 84, .12);
}
.chat-app.single .main { background: var(--tg-bg); }

/* Шапка: аватар, имя, «онлайн» */
.chat-app.single .main-head { height: 62px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(51, 92, 255, .08); gap: 12px; padding: 0 18px; }
.chat-app.single .head-ava { width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; align-items: center; justify-content: center; background: var(--tg-out); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 2px 8px rgba(51, 92, 255, .3); }
.chat-app.single .head-ava img { width: 100%; height: 100%; object-fit: cover; }
.chat-app.single .head-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-app.single .main-head .title { font-weight: 600; font-size: 16px; line-height: 1.2; }
.chat-app.single .head-sub { display: flex !important; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand); }
.chat-app.single .on-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.chat-app.single .main-head .panel-go { border-radius: 999px; background: var(--brand-tint); color: var(--brand); border: 0; font-weight: 500; }
.chat-app.single .main-head .panel-go:hover { background: var(--brand-tint-2); text-decoration: none; }
.chat-app.single .head-user a { color: var(--muted); }

/* Фон ленты: мягкий синий с узором из облаков UzCloud */
.chat-app.single .main {
  background-color: var(--tg-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23335cff' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M28 46h26a10 10 0 0 0 0-20 14 14 0 0 0-27-3 9 9 0 0 0 1 23z'/%3E%3Cpath d='M104 122h22a8 8 0 0 0 0-16 11 11 0 0 0-21-2 7 7 0 0 0-1 18z'/%3E%3Ccircle cx='120' cy='40' r='3'/%3E%3Ccircle cx='40' cy='112' r='2.5'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 100% 0%, rgba(51, 92, 255, .10), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(111, 140, 255, .12), transparent 60%);
  background-size: 160px 160px, auto, auto;
}
.chat-app.single .feed-inner { max-width: 760px; gap: 6px; padding-bottom: 8px; }

/* Сообщения */
.chat-app.single .msg { align-items: flex-end; gap: 8px; margin-top: 6px; }
.chat-app.single .msg.assistant .avatar { display: grid; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--tg-out); color: #fff; font-size: 12px; flex: none; }
.chat-app.single .msg.assistant .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-app.single .msg.user .avatar { display: none; }

.chat-app.single .msg.assistant .bubble {
  flex: 0 1 auto; max-width: min(640px, 88%); background: var(--tg-in); color: var(--text);
  padding: 8px 12px 10px; border-radius: 18px 18px 18px 6px; box-shadow: var(--tg-shadow); position: relative;
}
.chat-app.single .msg.assistant .bubble::before { content: ""; position: absolute; left: -6px; bottom: 0; width: 12px; height: 14px; background: var(--tg-in); clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-left-radius: 4px; }
.chat-app.single .msg.assistant .txt { display: block; max-width: none; background: none; padding: 2px 0; margin: 0; border-radius: 0; }
.chat-app.single .msg.assistant .txt + .txt { margin-top: 6px; }
.chat-app.single .msg.assistant .txt table { background: #f7f9ff; border-radius: 10px; overflow: hidden; }
.chat-app.single .msg.assistant .txt code { background: #eef2ff; padding: 1px 5px; border-radius: 5px; }

.chat-app.single .msg.user .bubble {
  background: var(--tg-out); color: #fff; padding: 8px 14px; border-radius: 18px 18px 6px 18px;
  max-width: min(560px, 82%); box-shadow: 0 1px 2px rgba(51, 92, 255, .35); position: relative;
}
.chat-app.single .msg.user .bubble::after { content: ""; position: absolute; right: -6px; bottom: 0; width: 12px; height: 14px; background: #4f72ff; clip-path: polygon(0 0, 100% 100%, 0 100%); border-bottom-right-radius: 4px; }
.chat-app.single .msg.user .att-file { background: rgba(255, 255, 255, .18); padding: 4px 10px; border-radius: 10px; }
.chat-app.single .msg.user .att-img { border-radius: 12px; }

/* Ход работы — тонкая строка внутри пузыря */
.chat-app.single details.work { margin: 0 0 6px; }
.chat-app.single details.work > summary { font-size: 12.5px; color: var(--brand); background: var(--brand-tint); border-radius: 999px; padding: 3px 10px; }
.chat-app.single details.work[open] > summary { margin-bottom: 4px; }
.chat-app.single .tool { background: #f4f6fd; border-color: transparent; border-radius: 999px; }

/* Карточки внутри пузыря ассистента */
.chat-app.single .confirm { background: #f6f8ff; border: 1px solid #e3e8fb; border-radius: 14px; padding: 12px 14px; margin: 8px 0 2px; }
.chat-app.single .confirm .t { font-weight: 600; }
.chat-app.single .confirm .options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; }
.chat-app.single .confirm .opt { border: 0; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(23, 37, 84, .10); padding: 10px 12px; }
.chat-app.single .confirm .opt .ol { color: var(--brand); font-weight: 600; }
.chat-app.single .confirm .opt:hover:not(:disabled) { background: var(--brand-tint); }
.chat-app.single .confirm .opt.primary { background: var(--tg-out); box-shadow: 0 4px 12px rgba(51, 92, 255, .28); }
.chat-app.single .confirm .opt.primary .ol { color: #fff; }
.chat-app.single .confirm .opt.compact { flex: initial; border-radius: 999px; }
.chat-app.single .confirm .actions .btn { border-radius: 999px; }
.chat-app.single .confirm.done { background: #fafbff; }
.chat-app.single .badge.ok { border-radius: 999px; }

/* Форма загрузки файла */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; padding: 22px 16px; border: 2px dashed #c5d1ff; border-radius: 14px; background: #fff; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-tint); }
.dropzone.busy { opacity: .7; pointer-events: none; }
.dropzone .dz-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tg-out, var(--brand)); color: #fff; font-size: 22px; }
.dropzone .dz-t { font-weight: 500; color: var(--brand); }

/* Строка ввода — плавающая «пилюля», круглая кнопка отправки */
.chat-app.single .composer { background: transparent; padding: 8px 16px 16px; border: 0; }
.chat-app.single .composer-inner { max-width: 760px; background: #fff; border: 0; border-radius: 26px; padding: 6px 6px 6px 8px; box-shadow: 0 2px 10px rgba(23, 37, 84, .10); align-items: flex-end; }
.chat-app.single .composer-inner:focus-within { box-shadow: 0 0 0 3px rgba(51, 92, 255, .18), 0 2px 10px rgba(23, 37, 84, .10); }
.chat-app.single .composer textarea { padding: 9px 4px; }
.chat-app.single .composer .attach { width: 40px; height: 40px; border-radius: 50%; color: var(--muted); }
.chat-app.single .composer .attach:hover { color: var(--brand); background: var(--brand-tint); }
.chat-app.single #btn-send { display: none; }
.chat-app.single .send-round { display: grid !important; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; flex: none; background: var(--tg-out); font-size: 0; box-shadow: 0 3px 10px rgba(51, 92, 255, .35); }
.chat-app.single .send-round svg { width: 20px; height: 20px; fill: #fff; transform: translateX(1px); }
.chat-app.single .send-round::after { content: none !important; }
.chat-app.single .send-round:disabled { opacity: .5; }
.chat-app.single .composer .hint { text-align: center; font-size: 11.5px; color: #8a94b3; }
.chat-app.single .att-tray { max-width: 760px; }

/* Пустой экран — карточка по центру */
.chat-app.single .empty { background: rgba(255, 255, 255, .85); border-radius: 22px; padding: 28px 24px; margin: 40px auto 0; max-width: 520px; box-shadow: var(--tg-shadow); }
.chat-app.single .chip { background: #fff; border: 0; box-shadow: 0 1px 2px rgba(23, 37, 84, .12); border-radius: 999px; }

@media (max-width: 720px) {
  .chat-app.single .main-head { padding: 0 10px; }
  .chat-app.single .main-head .panel-go { font-size: 0; padding: 0 10px; }
  .chat-app.single .main-head .panel-go::after { content: "↗"; font-size: 16px; }
  .chat-app.single .msg.assistant .bubble { max-width: calc(100% - 42px); }
  .chat-app.single .msg.user .bubble { max-width: 86%; }
  .chat-app.single .composer { padding: 6px 8px 10px; }
}
.chat-app.single .feed { background: transparent; }
.chat-app.single .head-sub, .chat-app.single .main-head .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ===== Кабинет: правки мобильной версии и «под катом» ===== */
.chat-app.single .composer .attach::after { content: none !important; }           /* старое мобильное правило рисовало «→» */
.chat-app.single .msg .bubble, .chat-app.single .confirm .s, .chat-app.single .confirm .body { overflow-wrap: anywhere; }
.chat-app.single .msg.assistant .txt table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chat-app.single .msg.assistant .txt pre { max-width: 100%; overflow-x: auto; }

/* Подробности под катом: в ответе (<details> от модели) и длинное описание в карточке */
.chat-app.single .txt details { margin: 6px 0 2px; background: #f5f7ff; border-radius: 12px; padding: 6px 10px; }
.chat-app.single .txt details > summary { cursor: pointer; color: var(--brand); font-weight: 500; font-size: 14px; list-style: none; }
.chat-app.single .txt details > summary::-webkit-details-marker { display: none; }
.chat-app.single .txt details > summary::before { content: '▸ '; }
.chat-app.single .txt details[open] > summary::before { content: '▾ '; }
.confirm .s.clamp { max-height: 6.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.confirm .more { border: 0; background: none; color: var(--brand); font: 500 13px var(--font); padding: 2px 0; cursor: pointer; }

@media (max-width: 720px) {
  .chat-app.single .main-head { gap: 8px; height: 56px; }
  .chat-app.single .head-ava { width: 36px; height: 36px; }
  .chat-app.single .main-head .title { font-size: 15px; }
  .chat-app.single .head-sub { font-size: 12px; }
  .chat-app.single .main-head .panel-go { width: 34px; height: 34px; padding: 0; justify-content: center; flex: none; }
  .chat-app.single .head-user { gap: 6px; flex: none; }
  .chat-app.single .head-user .lang-switch button { padding: 3px 7px; font-size: 12px; }
  .chat-app.single .head-user .js-logout { font-size: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
  .chat-app.single .head-user .js-logout::after { content: '⏻'; font-size: 16px; color: var(--muted); }
  .chat-app.single .composer .hint { display: none; }                               /* подсказка уже есть в карточках подтверждения */
  .chat-app.single .composer-inner { padding: 5px 5px 5px 6px; }
  .chat-app.single .composer .attach { width: 38px; height: 38px; }
  .chat-app.single .send-round { width: 40px; height: 40px; }
  .chat-app.single .feed { padding-left: 8px; padding-right: 8px; }
  .chat-app.single .msg.assistant .avatar { width: 28px; height: 28px; }
  .chat-app.single .msg.assistant .bubble { max-width: calc(100% - 34px); padding: 8px 10px; }
  .chat-app.single .confirm { padding: 10px 11px; }
  .chat-app.single .confirm .options { grid-template-columns: 1fr; }
  .chat-app.single .cred { grid-template-columns: 1fr auto; }
  .chat-app.single .empty { margin-top: 16px; padding: 20px 16px; }
}

/* ===================================================================================================
   Кабинет: ритм и палитра в духе Telegram. Фон — зелёный с узором, входящие — белые, исходящие —
   светло-зелёные с тёмным текстом, акцент — голубой (#3390ec): «онлайн», ссылки, кнопки, отправка.
   Карточки — как цитата в Telegram: полоса слева и лёгкая заливка. Панель, язык и выход — в меню ☰.
   =================================================================================================== */
.chat-app.single {
  --acc: #3390ec;
  --acc-hover: #2a7fd4;
  --acc-tint: rgba(51, 144, 236, .1);
  --acc-tint-2: rgba(51, 144, 236, .18);
  --link: #168acd;
  --out: #effdde;
  --out-meta: #4fae4e;
  --tg-bg: #a9c78f;
  --card-line: #e4e8ee;
  --muted-2: #8b96a5;
}
/* Фон ленты: мягкий зелёный градиент и узор из облаков UzCloud */
.chat-app.single .main {
  background-color: var(--tg-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%232f4a1e' stroke-opacity='.13' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M28 46h26a10 10 0 0 0 0-20 14 14 0 0 0-27-3 9 9 0 0 0 1 23z'/%3E%3Cpath d='M112 136h22a8 8 0 0 0 0-16 11 11 0 0 0-21-2 7 7 0 0 0-1 18z'/%3E%3Cpath d='M126 34l6 6 12-12'/%3E%3Crect x='30' y='112' width='22' height='16' rx='3'/%3E%3Cpath d='M36 118h10M36 123h6'/%3E%3Ccircle cx='150' cy='84' r='4'/%3E%3Ccircle cx='86' cy='88' r='2.5'/%3E%3Cpath d='M78 22l4 8 8 1-6 6 2 8-8-4-8 4 2-8-6-6 8-1z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #d2e3b2 0%, #a9c78f 45%, #87b17a 100%);
  background-size: 180px 180px, cover;
  background-attachment: local, fixed;
}

/* Шапка: белая, имя тёмное, «онлайн» голубым; справа — только меню */
.chat-app.single .main-head { background: #fff; backdrop-filter: none; border-bottom: 1px solid var(--card-line); height: 58px; }
.chat-app.single .main-head .title { color: #000; font-weight: 600; }
.chat-app.single .head-sub { color: var(--acc); }
.chat-app.single .on-dot { display: none; }
.chat-app.single .main-head .panel-go, .chat-app.single .head-user, .chat-app.single .main-head > .lang-switch { display: none !important; }
.head-menu { position: relative; margin-left: auto; flex: none; }
.chat-app.single .head-menu { display: block !important; }
.menu-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #707579; display: grid; place-items: center; cursor: pointer; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: #f1f3f5; color: #000; }
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 280px; white-space: nowrap; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .04); }
.menu-pop .mi { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; color: #000; font-size: 14.5px; text-decoration: none; cursor: pointer; }
.menu-pop a.mi:hover { background: #f1f3f5; text-decoration: none; }
.menu-pop .mi svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #707579; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-pop .mi-ext { margin-left: auto; color: var(--muted-2); }
.menu-pop .mi-lang { cursor: default; }
.menu-pop .mi-lang .lang-switch { margin-left: auto; border-radius: 8px; }
.menu-pop .lang-switch button.active { background: var(--acc); color: #fff; }
.menu-pop .js-logout { color: #e53935; }
.menu-pop .js-logout svg { stroke: #e53935; }

/* Ритм ленты: между репликами — воздух, внутри пузыря — абзацы */
.chat-app.single .feed { padding-top: 20px; }
.chat-app.single .feed-inner { gap: 14px; padding-bottom: 16px; }
.chat-app.single .msg { margin-top: 0; gap: 10px; }
.chat-app.single .msg.assistant .avatar { background: var(--tg-out); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.chat-app.single .msg.assistant .bubble { padding: 10px 14px 12px; line-height: 1.55; border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.chat-app.single .msg.assistant .txt a { color: var(--link); }
.chat-app.single .msg.assistant .txt p { margin: 0 0 .6em; }
.chat-app.single .msg.assistant .txt p:last-child { margin-bottom: 0; }
.chat-app.single .msg.assistant .txt ul, .chat-app.single .msg.assistant .txt ol { margin: .4em 0 .7em; padding-left: 1.3em; }
.chat-app.single .msg.assistant .txt li + li { margin-top: .3em; }
.chat-app.single .msg.assistant .txt + .txt { margin-top: 10px; }
.chat-app.single .msg.assistant .txt table { background: #fff; border: 1px solid var(--card-line); border-collapse: collapse; }
.chat-app.single .msg.assistant .txt th { background: #eef2f8; font-weight: 600; }
.chat-app.single .msg.assistant .txt th, .chat-app.single .msg.assistant .txt td { padding: 6px 10px; border-bottom: 1px solid var(--card-line); }
.chat-app.single .msg.assistant .txt code { background: #f1f3f5; }

/* Исходящие — светло-зелёные с тёмным текстом, как в Telegram */
.chat-app.single .msg.user .bubble { background: var(--out); color: #000; padding: 8px 14px 9px; line-height: 1.5; border-radius: 16px 16px 4px 16px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.chat-app.single .msg.user .bubble::after { background: var(--out); }
.chat-app.single .msg.user .bubble a { color: var(--link); }
.chat-app.single .msg.user .att-file { background: rgba(79, 174, 78, .14); color: #2d6a2c; }

/* Ход работы — тонкая серая плашка */
.chat-app.single details.work { margin: 0 0 8px; }
.chat-app.single details.work > summary { color: var(--muted-2); background: #f1f3f5; padding: 3px 11px; }
.chat-app.single details.work .spin { border-top-color: var(--acc); }
.chat-app.single details.work .wb { gap: 6px; padding: 4px 0 4px 14px; }
.chat-app.single .tool { background: #fff; border: 1px solid var(--card-line); }

/* Карточки — как цитата: голубая полоса слева, лёгкая заливка */
.chat-app.single .confirm { background: var(--acc-tint); border: 0; border-left: 3px solid var(--acc); border-radius: 6px 12px 12px 6px; padding: 12px 14px 14px; margin: 12px 0 4px; box-shadow: none; }
.chat-app.single .confirm .t { color: var(--acc); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.chat-app.single .confirm .s { line-height: 1.55; }
.chat-app.single .confirm .s p { margin: 0 0 .5em; }
.chat-app.single .confirm .s ul { margin: .3em 0; padding-left: 1.2em; }
.chat-app.single .confirm .s li + li { margin-top: .25em; }
.chat-app.single .confirm .options { gap: 8px; margin-top: 12px; }
.chat-app.single .confirm .opt { background: #fff; border: 0; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); padding: 10px 12px; gap: 3px; border-radius: 10px; }
.chat-app.single .confirm .opt .ol { color: var(--acc); }
.chat-app.single .confirm .opt .od { line-height: 1.45; }
.chat-app.single .confirm .opt:hover:not(:disabled) { background: #fff; box-shadow: 0 0 0 1.5px var(--acc); }
.chat-app.single .confirm .opt.primary { background: var(--acc); box-shadow: 0 2px 6px rgba(51, 144, 236, .3); }
.chat-app.single .confirm .opt.primary:hover:not(:disabled) { background: var(--acc-hover); box-shadow: 0 2px 6px rgba(51, 144, 236, .3); }
.chat-app.single .confirm .opt.primary .ol { color: #fff; }
.chat-app.single .confirm .opt.primary .od { color: rgba(255, 255, 255, .8); }
.chat-app.single .confirm .opt.chosen { background: #fff; box-shadow: 0 0 0 2px var(--acc); }
.chat-app.single .confirm .actions { margin-top: 14px; gap: 8px; }
.chat-app.single .confirm .actions .btn:not(.ghost):not(.secondary) { background: var(--acc); }
.chat-app.single .confirm .actions .btn:not(.ghost):not(.secondary):hover { background: var(--acc-hover); }
.chat-app.single .confirm .actions .btn.ghost { background: #fff; border-color: transparent; }
.chat-app.single .confirm .agree { margin-top: 12px; }
.chat-app.single .confirm .card-form { gap: 0 16px; margin-top: 12px; }
.chat-app.single .confirm .card-form .field { margin-bottom: 12px; }
.chat-app.single .confirm .card-form .input { background: #fff; }
.chat-app.single .confirm.done { background: #f4f6f8; border-left-color: #c3cad3; }
.chat-app.single .confirm.done .t { color: #707579; }
.chat-app.single .confirm .more { color: var(--link); }
.chat-app.single .confirm .badge { margin-top: 10px; }
.chat-app.single .creds { gap: 10px; margin-top: 10px; }
.chat-app.single .txt details { background: #f4f6f8; border-left: 3px solid var(--acc); border-radius: 6px 10px 10px 6px; padding: 7px 12px; margin: 10px 0 2px; }
.chat-app.single .txt details > summary { color: var(--acc); }
.chat-app.single .txt details[open] > summary { margin-bottom: 6px; }
.chat-app.single .dropzone { border-color: #b9d6f3; margin-top: 12px; }
.chat-app.single .dropzone .dz-ic { background: var(--acc); }
.chat-app.single .dropzone .dz-t { color: var(--acc); }

/* Строка ввода: белая пилюля, голубая кнопка отправки */
.chat-app.single .composer { padding: 10px 16px 16px; }
.chat-app.single .composer-inner { box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.chat-app.single .composer-inner:focus-within { box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 0 0 2px var(--acc-tint-2); }
.chat-app.single .send-round { background: var(--acc); box-shadow: 0 2px 6px rgba(51, 144, 236, .35); }
.chat-app.single .send-round:hover:not(:disabled) { background: var(--acc-hover); }
.chat-app.single .composer .attach:hover { color: var(--acc); background: var(--acc-tint); }
.chat-app.single .composer .hint { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.chat-app.single .chip { background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); border: 0; padding: 9px 16px; color: var(--acc); }
.chat-app.single .chip:hover { box-shadow: 0 0 0 1.5px var(--acc); color: var(--acc); }
.chat-app.single .empty { background: rgba(255, 255, 255, .92); margin-top: 48px; padding: 32px 28px; }

@media (max-width: 720px) {
  .chat-app.single .main-head { height: 56px; }
  .chat-app.single .feed { padding-top: 14px; }
  .chat-app.single .feed-inner { gap: 12px; }
  .chat-app.single .msg.assistant .bubble { padding: 9px 12px 11px; }
  .chat-app.single .confirm { padding: 11px 12px 12px; margin-top: 10px; }
  .chat-app.single .confirm .options { gap: 6px; }
  .chat-app.single .composer { padding: 8px 8px 12px; }
  .menu-pop { min-width: 230px; }
}

/* ---------------------------------------------------------------------------------------------
   Кабинет: язык и переходы в кабинет/панель хостинга — прямо в шапке; приветствие; скролл-бар.
   --------------------------------------------------------------------------------------------- */
.head-actions { display: none; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.chat-app.single .head-actions { display: flex; }
.chat-app.single .head-menu { margin-left: 0; }
.chat-app.single .head-lang { display: inline-flex !important; border: 0; background: #f1f3f5; border-radius: 999px; padding: 3px; }
.chat-app.single .head-lang button { background: transparent; border-radius: 999px; padding: 5px 12px; font-weight: 600; color: #707579; }
.chat-app.single .head-lang button.active { background: #fff; color: var(--acc); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.head-go { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--acc); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 3px rgba(51, 144, 236, .35); }
.head-go:hover { background: var(--acc-hover); color: #fff; text-decoration: none; }
.head-go + .head-go { background: #fff; color: var(--acc); box-shadow: inset 0 0 0 1.5px var(--acc); }
.head-go + .head-go:hover { background: var(--acc-tint); color: var(--acc); }
.head-go svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.head-go.hidden { display: none; }
.head-go .go-short { display: none; }
/* На широком экране панель хостинга — в шапке, в меню её не дублируем */
@media (min-width: 721px) { .menu-pop .js-hosting-go { display: none !important; } }
@media (max-width: 720px) {
  .chat-app.single .head-sub { display: none !important; }
  .head-actions { gap: 6px; }
  .head-go { height: 34px; padding: 0 11px; font-size: 13px; }
  .head-go svg { display: none; }
  .head-actions .js-hosting-go { display: none !important; } /* на телефоне — в меню ☰ */
  .chat-app.single .head-lang button { padding: 4px 9px; font-size: 12px; }
}
@media (max-width: 480px) { .head-go .go-long { display: none; } .head-go .go-short { display: inline; } }
@media (max-width: 360px) { .chat-app.single .head-ava { display: none !important; } }

/* Приветствие: что это и как с ним работать */
.chat-app.single .empty.welcome { max-width: 560px; text-align: left; padding: 28px 28px 24px; }
.welcome .wl-ava { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--acc); color: #fff; font-weight: 700; margin-bottom: 14px; }
.welcome .wl-ava img { width: 100%; height: 100%; object-fit: cover; }
.welcome h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; color: #000; }
.welcome .wl-lead { font-size: 15.5px; line-height: 1.5; color: #333; margin: 0 0 14px; }
.welcome .wl-can { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.welcome .wl-can li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.4; }
.welcome .wl-can li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--acc-tint); color: var(--acc); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.welcome .wl-safe { font-size: 13.5px; color: #4a5560; background: #f4f6f8; border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; }
.welcome .wl-try { margin-bottom: 8px; }
.welcome .chips { justify-content: flex-start; }
@media (max-width: 720px) {
  .chat-app.single .empty.welcome { padding: 20px 16px 18px; }
  .welcome h1 { font-size: 20px; }
}

/* Подтверждение телефона: одна кнопка, «ещё раз» и «изменить номер» — ссылками */
.verify-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.verify-links a.off { color: var(--muted); pointer-events: none; }

/* Скролл-бар: тонкий, полупрозрачный, без стрелок — как в Telegram */
* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .22) transparent; }
.chat-app.single .feed { scrollbar-color: rgba(255, 255, 255, .55) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .35); background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; }
.chat-app.single .feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .55); background-clip: padding-box; }
.chat-app.single .feed::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .8); background-clip: padding-box; }

/* Варианты в карточке — ровной сеткой: в ряду одной высоты, текст сверху (раньше высота «прыгала» по тексту) */
.chat-app.single .confirm .options { align-items: stretch; grid-auto-rows: 1fr; }
.chat-app.single .confirm .opt { height: 100%; justify-content: flex-start; }
.chat-app.single .confirm .opt.compact { height: auto; }

/* Ответ специалиста (оператор из админки) */
.msg.operator .op-ava { background: #fff3e0; font-size: 18px; display: grid; place-items: center; }
.msg.operator .op-name { font-size: 13px; font-weight: 600; color: #e67e22; margin-bottom: 2px; }
.op-note { font-size: 13.5px; color: #4a5560; }

/* Админка: ответ специалиста в чате клиента */
.transcript .m.operator { background: #fff3e0; border-color: #ffd8a8; }
.operator-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.operator-box .op-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.operator-box form { display: grid; gap: 8px; }
.operator-box textarea { min-height: 80px; resize: vertical; font: inherit; }
.operator-box form .btn { justify-self: start; }
