:root {
  --petrol: #183e4a;
  --petrol-2: #24535f;
  --blue: #4aa4e2;
  --blue-soft: #e4f1fb;
  --bg: #f4f3f8;
  --card: #fff;
  --line: #e3e1ea;
  --text: #1d2b31;
  --muted: #6b7a80;
  --brass: #b08a3e;
  --brass-soft: #f6edd8;
  --danger: #b8423a;
  --ok: #2f8f5b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
b, strong, h1, h3, .head-name, .conv-name { font-weight: 500; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* кнопки */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--petrol);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; font-weight: 400; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-2); }
.btn.warn { border-color: var(--brass); color: var(--brass); background: var(--brass-soft); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* вход */
.login { min-height: 100%; display: grid; place-items: center; background: var(--petrol); padding: 24px; }
.login-card { width: 360px; max-width: 100%; background: #fff; border-radius: 10px; padding: 32px; display: grid; gap: 14px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--petrol); }
.login-card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.login-card input:focus { border-color: var(--blue); outline: none; }
.brand { font-size: 26px; letter-spacing: .5px; color: var(--petrol); font-weight: 500; }
.brand span { color: var(--brass); font-weight: 300; font-size: 14px; letter-spacing: 3px; text-transform: uppercase; margin-left: 4px; }
.form-error { color: var(--danger); margin: 0; font-size: 13px; }

/* каркас */
.app { height: 100vh; display: grid; grid-template-columns: 360px minmax(380px, 1fr) 320px; }
.col-list { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.col-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.col-card { background: var(--card); border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; }

/* шапка с оператором */
.me-bar { background: var(--petrol); color: #fff; padding: 14px 16px 12px; }
.me { display: flex; align-items: center; gap: 10px; }
.me-text { flex: 1; min-width: 0; }
.me-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 12px; opacity: .65; }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 5px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.status-toggle {
  margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff;
  border-radius: 24px; padding: 6px 14px 6px 6px; cursor: pointer; font-weight: 400;
}
.status-toggle .knob { width: 34px; height: 20px; border-radius: 12px; background: rgba(255,255,255,.3); position: relative; transition: background .2s; flex: none; }
.status-toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.status-toggle.on { background: rgba(74,164,226,.25); border-color: var(--blue); }
.status-toggle.on .knob { background: var(--blue); }
.status-toggle.on .knob::after { transform: translateX(14px); }
.status-hint { margin: 8px 2px 0; font-size: 12px; opacity: .7; line-height: 1.35; }

.notice { padding: 8px 16px; background: var(--brass-soft); font-size: 12px; color: #6a5420; }
.notice.err { background: #f8e1de; color: var(--danger); }

.views { display: flex; border-bottom: 1px solid var(--line); }
.view-btn { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 6px; cursor: pointer; color: var(--muted); font-weight: 400; }
.view-btn.active { color: var(--petrol); border-bottom-color: var(--blue); }
.view-btn b { background: var(--blue); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; margin-left: 3px; }
#cnt-live:empty { display: none; }
#cnt-live { background: var(--ok); }

.pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.search { padding: 10px 12px 6px; }
.search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.search input:focus { outline: none; border-color: var(--blue); background: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 10px 8px; }
.tab { background: none; border: 1px solid transparent; border-radius: 14px; padding: 4px 8px; cursor: pointer; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.tab:hover { background: var(--bg); }
.tab.active { background: var(--blue-soft); color: var(--petrol); border-color: var(--blue); }
.tab b { margin-left: 5px; font-size: 11px; background: var(--line); border-radius: 8px; padding: 0 6px; }
.tab b.hot { background: var(--brass); color: #fff; }

.conv-list { overflow-y: auto; flex: 1; border-top: 1px solid var(--line); }
.conv { width: 100%; display: flex; gap: 10px; text-align: left; padding: 12px 14px; background: #fff; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; align-items: flex-start; }
.conv:hover { background: #f8fafc; }
.conv.active { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.conv.unread .conv-name { color: var(--petrol); }
.conv.unread .conv-preview { color: var(--text); font-weight: 400; }
.conv-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { color: var(--muted); font-size: 12px; flex: none; }
.conv-preview { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.conv-preview.typing { color: var(--blue); font-style: italic; }
.conv-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.hot { background: var(--brass-soft); border-color: var(--brass); color: #7a5e22; font-weight: 400; }
.chip.ai { background: var(--blue-soft); border-color: #b9dbf3; color: #2a6a9a; }
.chip.lead { background: #e3f3e8; border-color: #9fd3b0; color: #1f6b3a; font-weight: 400; }
.badge { background: var(--blue); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; align-self: center; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--petrol-2); color: #fff; display: grid; place-items: center; font-weight: 400; flex: none; position: relative; overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; background: #cfd8dc; color: var(--petrol); }
.avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }
.me .avatar { background: rgba(255,255,255,.2); }

/* центр */
.chat-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.head-name { font-size: 16px; color: var(--petrol); }
.head-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.messages { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 8px; }
.day { align-self: center; font-size: 12px; color: var(--muted); background: #e9e7f0; border-radius: 10px; padding: 2px 12px; margin: 8px 0; }
.msg { display: flex; }
.msg.visitor { justify-content: flex-start; }
.msg.operator, .msg.ai { justify-content: flex-end; }
.bubble { max-width: 68%; padding: 8px 12px 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.msg.operator .bubble { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.msg.ai .bubble { background: var(--blue-soft); border-color: #b9dbf3; }
.who { font-size: 11px; opacity: .7; margin-bottom: 2px; font-weight: 400; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; font-size: 14.5px; }
.time { font-size: 11px; opacity: .55; text-align: right; margin-top: 2px; }
.msg.system { justify-content: center; }
.msg.system span { font-size: 12px; color: var(--muted); background: #e9e7f0; padding: 3px 12px; border-radius: 10px; }
.typing-ind { padding: 0 24px 6px; color: var(--blue); font-size: 12px; font-style: italic; }
.composer { display: flex; gap: 10px; padding: 12px 20px 16px; background: var(--card); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; line-height: 1.4; max-height: 160px; min-height: 48px; background: var(--bg); }
.composer textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.composer .btn { height: 44px; padding: 0 22px; }
.closed-note { padding: 16px 20px; background: var(--card); border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.placeholder { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px; height: 100%; }
.placeholder b { display: block; font-size: 18px; color: var(--petrol); margin-bottom: 6px; }
.placeholder p { margin: 0; max-width: 340px; }
.placeholder.small { font-size: 13px; }
.start-hint { justify-content: center; }

/* карточка */
.col-card h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--brass); }
.col-card h3:not(:first-child) { margin-top: 24px; }
dl { margin: 0; }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0eff5; }
dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
dd { margin: 0; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b7bfc3; margin-right: 4px; }
.dot.on { background: var(--ok); }
.lead { border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 6px; padding: 10px 12px; line-height: 1.5; }
.lead.sent { border-left-color: var(--ok); }
.lead.failed { border-left-color: var(--danger); }
.lead span { color: var(--muted); font-size: 12px; }
.lead .err { color: var(--danger); }
.muted { color: var(--muted); margin: 0; font-size: 13px; }
.pages { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.pages li { overflow-wrap: anywhere; line-height: 1.35; }
.pt { color: var(--muted); font-size: 12px; margin-right: 4px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--petrol); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .25s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .app { grid-template-columns: 320px 1fr; }
  .col-card { display: none; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .col-main { display: none; }
}
.lead.failed span { color: var(--danger); }
.lead .btn { margin-top: 8px; }

/* шаблоны ответов */
.tpl-wrap { position: relative; align-self: flex-end; }
.tpl-wrap .btn { height: 44px; }
.tpl-menu { position: absolute; bottom: 52px; left: 0; width: 380px; max-width: 80vw; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(24,62,74,.18); z-index: 5; padding: 4px; }
.tpl-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 12px; cursor: pointer; line-height: 1.35; }
.tpl-item:hover, .tpl-item:focus-visible { background: var(--blue-soft); }
.tpl-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* вкладки «Статистика» / «Настройки» */
.tools { border-bottom: 1px solid var(--line); }
.tool-btn { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px; cursor: pointer; color: var(--muted); font-weight: 400; }
.tool-btn:hover { color: var(--petrol); }
.tool-btn.active { color: var(--petrol); border-bottom-color: var(--brass); }
.app.screen-mode { grid-template-columns: 360px 1fr; }
.app.screen-mode .col-card { display: none; }

/* экраны */
.screen { max-width: 980px; width: 100%; margin: 0 auto; padding: 28px 32px 56px; overflow-y: auto; }
.col-main:has(.screen) { overflow-y: auto; display: block; }
.screen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.screen-head h2 { margin: 0 0 4px; font-size: 24px; font-weight: 300; color: var(--petrol); }
.screen-head .muted { max-width: 560px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-btn { background: none; border: 0; padding: 8px 18px; cursor: pointer; color: var(--muted); font-weight: 400; border-right: 1px solid var(--line); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--petrol); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; border-top: 3px solid var(--blue); }
.tile.brass { border-top-color: var(--brass); }
.tile-num { font-size: 34px; color: var(--petrol); line-height: 1.1; }
.tile-label { margin-top: 6px; font-weight: 500; }
.tile-hint { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.card-block { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 16px; }
.card-block h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--brass); }
.card-block h4 { margin: 0 0 10px; font-weight: 500; color: var(--petrol); }
.cost { display: flex; gap: 40px; flex-wrap: wrap; margin: 12px 0 16px; align-items: flex-end; }
.cost-num { font-size: 36px; color: var(--petrol); line-height: 1.1; }
.cost-num.small { font-size: 24px; }
.tbl { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0eff5; }
.tbl th { color: var(--muted); font-weight: 400; font-size: 12px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* поля настроек */
.field { padding: 12px 0; border-bottom: 1px solid #f0eff5; max-width: 720px; }
.field:last-child { border-bottom: 0; }
.field-label { font-weight: 400; color: var(--text); display: block; margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; line-height: 1.4; }
.field input[type=number] { max-width: 160px; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .field-label { margin: 0; }
.sw { width: 40px; height: 22px; border-radius: 12px; background: #cfd5d8; position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .sw { background: var(--blue); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--blue); outline-offset: 2px; }

/* сотрудники */
.op { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f0eff5; }
.op.off { opacity: .6; }
.op .avatar { width: 52px; height: 52px; font-size: 20px; }
.op-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.op-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.op-actions input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 200px; background: #fff; }
.op-actions input:focus { outline: none; border-color: var(--blue); }
.btn.file { display: inline-block; }
.op-new { margin-top: 18px; padding: 16px; background: var(--bg); border-radius: 8px; }
.op-new-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.op-new-grid input, .op-new-grid select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.op-new-grid .btn { grid-column: span 2; justify-self: start; }

/* ---------- экран «Бот» (кабинет руководителя) ---------- */
.screen.wide { max-width: 1120px; }
.tool-btn b.tab-count, .tab-count { background: var(--brass); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; margin-left: 3px; }
.small { font-size: 12px; }
.bot-card { display: flex; gap: 22px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--ok); border-radius: 10px; padding: 20px 24px; margin-bottom: 18px; }
.bot-card.off { border-left-color: var(--danger); background: #fdf6f5; }
.bot-state { font-size: 24px; color: var(--petrol); font-weight: 300; margin-bottom: 2px; }
.bot-card.off .bot-state { color: var(--danger); }
.bot-text { display: grid; gap: 4px; }
.big-switch { width: 84px; height: 46px; border-radius: 24px; border: 0; background: #c8cfd2; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.big-switch .knob { position: absolute; top: 5px; left: 5px; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.big-switch.on { background: var(--ok); }
.big-switch.on .knob { transform: translateX(38px); }
.warn-note { background: var(--brass-soft); border: 1px solid var(--brass); color: #6a5420; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-top: 6px; line-height: 1.4; }
.warn-note ul { margin: 4px 0; padding-left: 18px; }
.tabs-seg { display: flex; margin-bottom: 18px; flex-wrap: wrap; }
.tabs-seg .seg-btn { flex: 1; }
.card-block.flush { padding: 0; overflow: hidden; }
.tbl.rows th { background: #faf9fc; }
.tbl.rows th, .tbl.rows td { padding: 11px 14px; vertical-align: top; }
.tbl.rows tr.click { cursor: pointer; }
.tbl.rows tr.click:hover, .tbl.rows tr.click:focus-visible { background: var(--blue-soft); outline: none; }
.st { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); white-space: nowrap; font-weight: 400; }
.st-on_sale { background: #e3f3e8; border-color: #9fd3b0; color: #1f6b3a; }
.st-resale { background: var(--blue-soft); border-color: #b9dbf3; color: #2a6a9a; }
.st-case { background: var(--brass-soft); border-color: var(--brass); color: #7a5e22; }
.st-hidden { background: #eceff0; color: var(--muted); }
.empty-box { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 32px 20px; text-align: center; color: var(--muted); }
.empty-box b { display: block; color: var(--petrol); font-size: 16px; margin-bottom: 4px; }
.empty-box p { margin: 0 auto; max-width: 420px; }
.empty-box.small { padding: 22px 16px; border: 0; background: transparent; }
.obj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.obj-title { margin: 0; font-size: 22px !important; font-weight: 300 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--petrol) !important; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.field select, .inline-grid select, .card-block select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.field input[type=date] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.private-box { margin-top: 14px; border: 1px dashed var(--brass); background: var(--brass-soft); border-radius: 8px; padding: 14px 16px 12px; }
.private-box textarea { width: 100%; padding: 9px 12px; border: 1px solid #e3d3a8; border-radius: 6px; background: #fffdf7; line-height: 1.4; resize: vertical; }
.private-tag { display: inline-block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #7a5e22; font-weight: 500; margin-bottom: 8px; }
.facts-ro { white-space: pre-wrap; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.tbl.lots td { padding: 6px 8px; vertical-align: middle; }
.tbl.lots input, .tbl.lots select, .inline-grid input, .inline-grid select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; font: inherit; }
.tbl.lots input:focus, .inline-grid input:focus, #bulk-text:focus, .field select:focus { outline: none; border-color: var(--blue); }
.tbl.lots .in-area { width: 92px; } .tbl.lots .in-price { width: 130px; }
.tbl.lots select.lot-available { color: #1f6b3a; } .tbl.lots select.lot-reserved { color: #7a5e22; } .tbl.lots select.lot-sold { color: var(--muted); }
.row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; margin-top: 8px; }
.tbl.lots .row-actions { margin: 0; }
.link.danger { color: var(--danger); }
.inline-form { margin-top: 18px; padding: 14px 16px; background: var(--bg); border-radius: 8px; }
.inline-grid { display: grid; grid-template-columns: 110px 130px 160px 140px auto; gap: 10px; align-items: center; }
#bulk-text { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; resize: vertical; }
code { background: #ebeaf2; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.bulk-report { margin-top: 12px; display: grid; gap: 8px; justify-items: start; }
.tab-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.promos { display: grid; gap: 10px; }
.promo { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 14px 18px; }
.promo.scheduled { border-left-color: var(--blue); }
.promo.expired, .promo.off { border-left-color: #b7bfc3; opacity: .85; }
.promo-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.promo-text { margin: 8px 0 0; line-height: 1.45; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.promo-form { border-color: var(--blue); }
.promo-form input[type=text] { width: 100%; }
.preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ctx-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.5; background: var(--bg); border-radius: 6px; padding: 14px; max-height: 640px; overflow-y: auto; margin: 10px 0 0; font-weight: 400; }
.chat-block { display: flex; flex-direction: column; }
.tc-log { background: var(--bg); border-radius: 8px; min-height: 280px; max-height: 480px; padding: 14px; margin-top: 10px; flex: none; }
.tc-log .bubble { max-width: 86%; }
.tc-note { margin-top: 6px; font-size: 12px; color: #7a5e22; background: var(--brass-soft); border-radius: 4px; padding: 3px 8px; }
.tc-form { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.tc-form textarea { flex: 1; resize: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.tc-form textarea:focus { outline: none; border-color: var(--blue); }
.tc-form .btn { height: 44px; }
.tc-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip-btn { background: #fff; border: 1px solid var(--blue); color: var(--petrol); border-radius: 16px; padding: 6px 14px; cursor: pointer; font: inherit; }
.chip-btn:hover { background: var(--blue-soft); }
.hist { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid #f0eff5; }
.hist:last-child { border-bottom: 0; }
.hist.reverted { opacity: .6; }
.hist-main { display: grid; gap: 3px; min-width: 0; }
.diff { font-size: 13px; overflow-wrap: anywhere; }
.diff s { color: var(--muted); }
.erase-btn { margin-top: 4px; }
@media (max-width: 1280px) { .preview-grid { grid-template-columns: 1fr; } .inline-grid { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
.grid2 .field { max-width: none; border-bottom: 0; }

/* ---- проверка сайта (head-05) ---- */
.sw-run-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.sw-run-main { margin: 6px 0 8px; }
.sw-run-actions { text-align: right; }
.sw-run-actions .hint { max-width: 220px; margin-left: auto; }
.sw-errors { margin-top: 8px; font-size: 13px; }
.sw-errors summary { cursor: pointer; color: #7a5e22; }
.sw-errors ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.sw-list { display: grid; gap: 12px; }
.sw-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 8px; padding: 14px 18px; }
.sw-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.sw-quote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; color: var(--petrol); }
.sw-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.sw-side { background: var(--bg); border-radius: 6px; padding: 8px 12px; }
.sw-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--brass); margin-bottom: 2px; }
.sw-val { font-size: 16px; color: var(--petrol); overflow-wrap: anywhere; }
.sw-preview { margin: 10px 0 4px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; font-size: 13px; }
.sw-preview ul { margin: 4px 0 0; padding-left: 18px; }
.sw-edit { margin-top: 10px; padding: 10px 14px; border: 1px solid var(--blue); border-radius: 6px; }
.sw-edit .field { max-width: none; }
.sw-card a { color: var(--blue); }
@media (max-width: 1280px) { .sw-run-grid { grid-template-columns: 1fr; } .sw-run-actions { text-align: left; } .sw-run-actions .hint { margin-left: 0; } }

/* ---------- материалы (PDF) ---------- */
.mat-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 20px; border: 2px dashed #b9dbf3; border-radius: 10px; background: var(--blue-soft); color: var(--petrol); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.mat-drop b { font-weight: 400; font-size: 16px; }
.mat-drop:hover, .mat-drop:focus-visible, .mat-drop.over { background: #d3e8f8; border-color: var(--blue); outline: none; }
.mat-drop.busy { cursor: progress; background: #fff; border-style: solid; border-color: var(--line); }
.mat-bar { width: min(420px, 90%); height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 2px; }
.mat-bar i { display: block; height: 100%; background: var(--blue); transition: width .15s; }
.mat-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.mat-card { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mat-cover { display: flex; align-items: flex-start; justify-content: center; }
.mat-cover img { width: 150px; height: auto; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 2px 8px rgba(24, 62, 74, .12); background: #f4f3f8; }
.mat-video video { display: block; width: 100%; max-width: 280px; max-height: 360px; border-radius: 8px; background: #0f2d37; margin-bottom: 6px; }
.mat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mat-order { margin-left: auto; display: flex; gap: 4px; }
.mat-order .icon-btn:disabled { opacity: .35; cursor: default; }
.mat-main .field { margin-bottom: 10px; }
.mat-main input[type=text], .mat-main textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.mat-main textarea { resize: vertical; line-height: 1.4; }
.mat-row select { width: 100%; }
.mat-warn { background: #fdf3d6; border: 1px solid #e0b84a; border-left-width: 4px; color: #6a5420; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.mat-warn ul { margin: 6px 0; padding-left: 18px; }
.mat-warn li { margin-bottom: 4px; }
.mat-warn-kind { text-transform: uppercase; font-size: 11px; letter-spacing: .8px; color: #8a6a10; }
.mat-quote { color: var(--text); font-style: italic; margin-top: 2px; }
.mat-stats { border-collapse: collapse; font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.mat-stats th, .mat-stats td { padding: 2px 14px 2px 0; text-align: left; font-weight: 300; }
.mat-stats tbody th { color: var(--petrol); }
.mat-stats tbody td { color: var(--petrol); }
.mat-actions { flex-wrap: wrap; white-space: normal; }
.mat-actions a.btn, .mat-replace { text-decoration: none; display: inline-block; cursor: pointer; }
.mat-bot { list-style: none; margin: 0; padding: 0; }
.mat-bot li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mat-bot-h { margin-top: 18px !important; }
.mat-warn-blind { background: #fde8e6; border-color: #d9807a; color: #7a2a24; }
.mat-warn-blind p { margin: 4px 0 0; }

.img-field { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.img-field input { flex: 1 1 280px; min-width: 0; }
.img-prev { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 1px rgba(24,62,74,.15); background: #e9edf0; }

.att { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(24,62,74,.06); font-size: 12.5px; }
.msg.operator .att { background: rgba(255,255,255,.14); }
.att-h { font-weight: 500; }
.att-l { margin: 4px 0 0; padding: 0; list-style: none; }
.att-l li { padding: 1px 0; font-variant-numeric: tabular-nums; }
.att-m { margin-top: 2px; opacity: .8; }
.att a { color: inherit; text-decoration: underline; }

/* ---------- часть 4: фото и планировки, презентация в чате, КП ---------- */
.screen .icon-btn { border-color: var(--line); color: var(--petrol); background: #fff; }
.screen .icon-btn:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.screen .icon-btn:disabled { opacity: .35; cursor: default; }
.field input[type=tel], .field input[type=email] { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; line-height: 1.4; }
.field input[type=tel]:focus, .field input[type=email]:focus { outline: none; border-color: var(--blue); }
.obj-tabs { display: flex; margin: 0 0 16px; flex-wrap: wrap; }
.obj-tabs .seg-btn { flex: 1; }
.counter { text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--danger); }
.tbl.lots .in-title { width: 140px; }
.tbl.lots .in-status { min-width: 116px; }
.tbl.lots .in-note { min-width: 110px; }
.tbl.lots tr.lot-sub td { background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 12px 12px; }
.tbl.lots tr.lot-sub textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; line-height: 1.4; resize: vertical; background: #fff; }
.tbl.lots tr.lot-sub textarea:focus, .lot-new-desc textarea:focus { outline: none; border-color: var(--blue); }
.tbl.lots tr.lot-sub .mat-warn { margin: 8px 0 0; }
.link.warn-link { color: #8a6a10; }
.inline-grid.lot6 { grid-template-columns: 100px minmax(150px, 1fr) 120px 140px 130px auto; }
.lot-new-desc { margin-top: 10px; }
.lot-new-desc textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; resize: vertical; }
/* галерея объекта */
.g-group { margin-top: 18px; }
.g-group h4 { margin: 0 0 2px; }
.g-group .hint { margin: 0 0 10px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.g-tile { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.g-tile.off { opacity: .6; }
.g-img { position: relative; display: block; aspect-ratio: 16 / 10; background: #e9edf0; }
.g-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-tile.k-layout .g-img, .g-tile.k-floor_plan .g-img { background: #fff; border-bottom: 1px solid var(--line); }
.g-tile.k-layout .g-img img, .g-tile.k-floor_plan .g-img img { object-fit: contain; }
.g-badge { position: absolute; left: 8px; top: 8px; background: var(--petrol); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.g-tile figcaption { padding: 10px 12px 12px; display: grid; gap: 8px; }
.g-cap { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.g-tile input[type=text], .g-tile input[type=number] { width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.g-tile input:focus { outline: none; border-color: var(--blue); }
.g-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-row label { display: grid; gap: 3px; color: var(--muted); }
.g-note { background: var(--brass-soft); color: #6a5420; border-radius: 6px; padding: 5px 9px; font-size: 12px; line-height: 1.35; }
.g-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.g-actions .btn { padding: 5px 10px; }
.g-report { margin-bottom: 4px; padding: 10px 14px; border: 1px solid #b9dbf3; background: var(--blue-soft); border-radius: 8px; }
.g-report ul { margin: 4px 0 0; padding-left: 18px; }
.g-up-grid { display: grid; grid-template-columns: 190px 110px 100px minmax(160px, 1fr) auto; gap: 10px; align-items: end; }
.g-up-grid label.field-label { display: grid; gap: 4px; margin: 0; color: var(--muted); font-size: 12.5px; }
.g-up-grid select, .g-up-grid input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--text); }
.g-pick-btn { cursor: pointer; text-align: center; }
/* презентация в чате */
.pres-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pv-wrap { position: sticky; top: 0; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.list-row input, .fig-row input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; width: 100%; }
.list-row input:focus, .fig-row input:focus { outline: none; border-color: var(--blue); }
.list-row .counter { margin: 0; min-width: 52px; }
.fig-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.fig-row .fig-note { grid-column: 1 / -1; }
.list-row.has-warn input, .fig-row.has-warn input { border-color: #e0b84a; background: #fffbef; }
.pv-card { width: 300px; max-width: 100%; margin: 10px auto 8px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 6px rgba(24,62,74,.08), 0 0 0 1px rgba(24,62,74,.06); }
.pv-gal { position: relative; aspect-ratio: 16 / 10; background: var(--petrol); }
.pv-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-nophoto { height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.7); font-size: 13px; }
.pv-count { position: absolute; right: 8px; bottom: 8px; background: rgba(15,45,55,.7); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.pv-thumbs { display: flex; gap: 4px; padding: 4px; background: #f7f7fa; }
.pv-thumbs img { width: 52px; height: 34px; object-fit: cover; border-radius: 4px; }
.pv-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.pv-name { font-family: Georgia, serif; font-size: 19px; color: var(--petrol); line-height: 1.2; }
.pv-price { font-family: Georgia, serif; color: var(--petrol); font-size: 14px; margin-top: -4px; }
.pv-loc { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pv-hl { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; line-height: 1.35; }
.pv-hl li { padding-left: 14px; position: relative; }
.pv-hl li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--brass); }
.pv-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pv-fig { background: var(--bg); border-radius: 8px; padding: 6px 8px; display: grid; gap: 1px; }
.pv-fig b { font-family: Georgia, serif; font-weight: 400; color: var(--petrol); font-size: 16px; }
.pv-fig span { font-size: 11px; color: var(--muted); line-height: 1.25; }
.pv-btn { border: 1px solid var(--line); border-radius: 18px; padding: 7px 12px; text-align: center; color: var(--petrol); font-size: 13px; }
.pv-cta { background: #ff8562; color: #fff; border-radius: 18px; padding: 9px 12px; text-align: center; font-size: 14px; font-weight: 400; }
/* «Как видит бот»: что чат может показать */
.show-bot .marks { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.mark { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eceff0; color: var(--muted); }
.mark.on { background: #e3f3e8; color: #1f6b3a; }
/* переписка: карточки маршрута лота и КП */
.att-card { display: flex; gap: 8px; align-items: flex-start; }
.att-th { width: 64px; height: 42px; object-fit: cover; border-radius: 4px; flex: none; background: #dfe5e8; }
.att-b { min-width: 0; }
.att-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-st { display: inline-block; font-size: 11.5px; padding: 0 7px; border-radius: 9px; background: #eceff0; color: var(--petrol); }
.kp-st.wait { background: var(--blue-soft); color: #2a6a9a; }
.kp-st.ok { background: #e3f3e8; color: #1f6b3a; }
.kp-st.manual { background: var(--brass-soft); color: #7a5e22; }
.kp-st.err { background: #fde8e6; color: var(--danger); }
.kp-list li { line-height: 1.45; }
.col-card [data-kp] h3, .col-card [data-mats] h3 { margin-top: 24px; }
@media (max-width: 1280px) { .pres-grid { grid-template-columns: 1fr; } .pv-wrap { position: static; } .g-up-grid { grid-template-columns: 1fr 1fr; } .inline-grid.lot6 { grid-template-columns: repeat(2, 1fr); } }
