/* БМ CRM — стиль «Бизнес Маркет». Один акцент — оранжевый. Без градиентов, теней и свечения; исключение — светлый графитовый перелив верхней панели. */
/* Один вариативный WOFF2 (кириллица + латиница, веса 100–900) вместо трёх TTF по 375 КБ: 96 КБ на все начертания,
   есть настоящий 700. Сборка — scripts/build_font.sh. */
@font-face { font-family: "Montserrat"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/Montserrat-var.b33a94693d60.woff2") format("woff2"); }

:root {
  --bm-orange: #F5921E;
  --bm-orange-light: #FB992A;
  --bm-amber: #E1B52D;
  --bm-graphite: #23272B;
  --bm-paper: #F4F5F6;
  --bm-sage: #869791;
  --bm-white: #FFFFFF;
  --bm-line: #E3E6E8;
  --bm-danger: #C2412D;
  --bm-ok: #3F7D58;
  /* текст и поверхности — одна шкала вместо разрозненных hex и локальных --an/--kb/--mn */
  --ink: #2C3338;
  --ink-2: #4A5154;
  --ink-3: #66756F;
  --ink-4: #8A9692;
  --surface-2: #EEF0F1;
  --line-2: #DADFE2;
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-4: 999px;
  --radius: var(--r-2);
  --radius-sm: var(--r-1);
  --shadow-1: 0 1px 2px rgba(35, 39, 43, .06);
  --shadow-2: 0 8px 24px rgba(35, 39, 43, .10);
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 13.5px; --fs-md: 15px;
  --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px;
  --tap: 44px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
  --topbar-h: 65px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bm-white); color: var(--bm-graphite);
  font-family: var(--font); font-weight: 500; font-size: var(--fs-md); line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--bm-graphite); border-bottom: 1px solid var(--bm-orange); }
h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-lg); } h3 { font-size: var(--fs-md); }
.muted { color: var(--bm-sage); }
.small { font-size: var(--fs-base); }
.danger { color: var(--bm-danger); }
.num-big { font-size: var(--fs-2xl); font-weight: 800; color: var(--bm-orange); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- каркас ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid #D6DBDF;
  background-color: #E6E9ED;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 40%, rgba(35, 39, 43, .06) 100%),
    radial-gradient(ellipse 85% 520% at 18% -330%, rgba(255, 255, 255, 0) 60%, var(--bm-white) 66.5%, rgba(255, 255, 255, 0) 73%),
    radial-gradient(ellipse 80% 560% at 72% 440%, rgba(255, 255, 255, 0) 59%, var(--bm-white) 65.5%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(ellipse 95% 500% at 46% -300%, rgba(35, 39, 43, 0) 59%, rgba(35, 39, 43, .14) 66%, rgba(35, 39, 43, 0) 73%),
    radial-gradient(ellipse 90% 540% at 98% -320%, rgba(35, 39, 43, 0) 60%, rgba(35, 39, 43, .10) 66%, rgba(35, 39, 43, 0) 72%),
    linear-gradient(100deg, #F5F6F8 0%, #DDE2E7 24%, #F2F4F6 48%, #D7DCE1 72%, #EFF1F4 100%);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  height: var(--topbar-h); box-sizing: border-box;
}
.brand { font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.brand b { color: var(--bm-orange); font-weight: 800; }
.topbar form { flex: 1; }
.top-title { flex: 0 1 240px; min-width: 0; max-width: 280px; margin: 0; padding-bottom: 2px; border-bottom: 3px solid var(--bm-orange);
  font-size: var(--fs-xl); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--bm-graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-root .page-head > h1,
.section-root .page-head > div > h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.section-root .page-head:has(> h1) { justify-content: flex-end; margin-bottom: 8px; }
.page-add { display: none; }
.top-add { min-height: 32px; height: 32px; padding: 0 12px; font-size: var(--fs-base); }
@media (min-width: 1024px) {
  main.section-root { padding-top: 10px; }
  .section-root .page-head:has(> h1):not(:has(.muted, .btn-row, .card-sub)) { margin: 0; height: 0; overflow: hidden; }
}
@media (max-width: 1023px) {
  .top-add { display: none; }
  .page-add { display: inline-flex; min-height: var(--tap); }
}
.search-input { width: 100%; }
.main { flex: 1; padding: 16px; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1440px; width: 100%; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bm-white); border-top: 1px solid var(--bm-line);
  display: grid; grid-template-columns: repeat(6, 1fr); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--fs-xs); color: var(--bm-sage); min-height: var(--tap); }
.bottomnav a.active { color: var(--bm-graphite); }
.bottomnav a.active .ico { border-color: var(--bm-orange); }
.bottomnav .plus .ico { background: var(--bm-graphite); color: var(--bm-white); border-color: var(--bm-graphite); }
.bottomnav a.home { color: var(--bm-graphite); font-weight: 800; }
.bottomnav .ico .i { width: 18px; height: 18px; flex-basis: 18px; }
@media (max-width: 380px) { .bottomnav a { font-size: 10px; letter-spacing: -0.01em; } }
.ico { width: 28px; height: 28px; border: 1.5px solid var(--bm-line); border-radius: var(--r-1); display: grid; place-items: center; font-size: var(--fs-md); font-weight: 600; }
.sidenav { display: none; }

@media (min-width: 1024px) {
  .bottomnav { display: none; }
  .app { flex-direction: row; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; width: 220px; flex: 0 0 220px; border-right: 1px solid var(--bm-line); padding: 14px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
  .sidenav .brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 16px 10px; }
  .sidenav .brand { font-size: var(--fs-lg); }
  .sidenav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--bm-graphite);
    border-left: 3px solid transparent; transition: background-color .15s ease, color .15s ease; }
  .sidenav a .i { width: 18px; height: 18px; flex-basis: 18px; stroke: var(--bm-orange); }
  .sidenav a:hover { background: var(--bm-paper); }
  .sidenav a.active { background: var(--bm-paper); border-left-color: var(--bm-orange); border-radius: 0; font-weight: 600; }
  .sidenav .sep { height: 1px; background: var(--bm-line); margin: 10px 4px; }
  .sidenav .nav-home { font-size: var(--fs-md); font-weight: 800; }  /* «Главная» — заметнее остальных пунктов */
  .nav-group-btn { display: flex; width: 100%; align-items: center; gap: 11px; padding: 8px 10px; border: 0; border-left: 3px solid transparent; border-radius: var(--radius-sm);
    background: none; color: var(--bm-graphite); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
  .nav-group-btn .i { width: 18px; height: 18px; flex-basis: 18px; stroke: var(--bm-orange); }
  .nav-group-btn .i:last-child { width: 14px; height: 14px; flex-basis: 14px; margin-left: auto; stroke: var(--ink-3); transition: transform .15s ease; }
  .nav-group.open .nav-group-btn .i:last-child { transform: rotate(180deg); }
  .nav-group-btn:hover { background: var(--bm-paper); }
  .nav-sub { display: none; }
  .nav-group.open .nav-sub { display: flex; flex-direction: column; gap: 2px; }
  .nav-sub a { padding-left: 18px; }
  .content { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
  .main.canvas { padding-top: 12px; padding-bottom: 12px; }
  .topbar .brand-row { display: none; }
  .main { padding: 24px 28px 40px; }
}

/* ---------- кнопки и формы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px;
  border: 1.5px solid var(--bm-graphite); border-radius: var(--radius); background: var(--bm-white); color: var(--bm-graphite);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--bm-graphite); color: var(--bm-white); }
.btn-ghost { border-color: var(--bm-line); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-base); }
.btn-danger { border-color: var(--bm-danger); color: var(--bm-danger); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.push-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.push-toggle .btn { min-height: var(--tap); }
.push-toggle #push-status:empty { display: none; }
@media (max-width: 767px) {
  .push-toggle { display: grid; }
  .push-toggle .btn { width: 100%; white-space: normal; }
  .push-tests { display: grid; }
  .push-tests .btn { width: 100%; min-height: var(--tap); white-space: normal; }
}

input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local],
input[type=time], input[type=search], input[type=url], input[type=password], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; font-size: var(--fs-md); color: var(--bm-graphite);
  background: var(--bm-white); border: 1.5px solid var(--bm-line); border-radius: var(--radius); appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bm-orange); }
label.field select { padding-right: 36px; background: var(--bm-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: var(--fs-base); color: var(--bm-sage); margin-bottom: 6px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--bm-danger); font-size: var(--fs-base); }
.form-error { border-left: 3px solid var(--bm-danger); background: var(--bm-paper); padding: 10px 12px; margin-bottom: 14px; border-radius: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.check input { width: 22px; height: 22px; accent-color: var(--bm-orange); }

/* чипы = радио/чекбоксы без JS */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--bm-line);
  border-radius: var(--r-4); color: var(--bm-graphite); cursor: pointer; font-size: var(--fs-base);
}
.chip input:checked + span { border-color: var(--bm-orange); background: var(--bm-paper); }
.chip input:focus-visible + span { outline: 2px solid var(--bm-orange); outline-offset: 2px; }

.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bm-white); padding: 12px 0; border-top: 1px solid var(--bm-line); margin-top: 8px; }
@media (min-width: 1024px) { .sticky-actions { bottom: 0; } }

/* ---------- блоки ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section { margin: 22px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section h2 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bm-sage); font-weight: 600; }
.section h2.with-dot { display: inline-flex; align-items: center; gap: 8px; }
.tg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bm-danger); box-shadow: 0 0 0 3px rgba(194, 65, 45, 0.18); }
.tg-dot.is-on { background: var(--bm-ok); box-shadow: 0 0 0 3px rgba(63, 125, 88, 0.2); }
.tg-dot-sm { width: 7px; height: 7px; box-shadow: 0 0 0 2px rgba(194, 65, 45, 0.18); }
.tg-dot-sm.is-on { box-shadow: 0 0 0 2px rgba(63, 125, 88, 0.2); }
.block-head h3.with-dot, .block-head h4.with-dot, .cm-dh h3.with-dot { display: inline-flex; align-items: center; gap: 6px; }
.doc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.doc-trash { display: inline-flex; }
.doc-trash .btn { padding: 2px 6px; min-height: 0; }
/* ---------- чат Telegram: карточка клиента и «Ждут ответа» на плане. Светлая тема Telegram ---------- */
.tg-open { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.tg-chat-brand { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; }
.tg-chat-brand svg { width: 22px; height: 22px; }

/* превью — всегда последним в «Контактах» */
.tgc-preview { display: grid; gap: 6px; width: 100%; margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--bm-line); border-radius: var(--r-2);
  background: var(--bm-white); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.tgc-preview:hover { border-color: #a9cdf0; background: #f6faff; }
.tgc-preview:focus-visible { outline: 2px solid #3390ec; outline-offset: 2px; }
.tgc-preview-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); }
.tgc-preview-head b { font-weight: 700; }
.tgc-preview-open { margin-left: auto; font-size: var(--fs-base); font-weight: 600; color: #3390ec; }
.tgc-preview-last { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: var(--fs-base); color: #3c4a55; }
.tgc-preview-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgc-preview-text em { font-style: normal; color: #3390ec; }
.tgc-preview-last time { flex: none; font-size: var(--fs-sm); color: #8a96a0; }

/* окно */
.cm-dialog.tg-chat-dialog { --tgc-bg: #dfe6d3; width: min(480px, calc(100vw - 16px)); border-radius: var(--r-3); overflow: hidden; background: var(--tgc-bg); }
.tg-chat-panel { display: flex; flex-direction: column; height: min(86dvh, 760px); background: var(--tgc-bg); }
.tg-chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--bm-white); border-bottom: 1px solid #e7e9eb; }
.tgc-ava.ava { width: 40px; height: 40px; font-size: var(--fs-base); }
.tgc-who { flex: 1; min-width: 0; }
.tgc-name { margin: 0; overflow: hidden; font-size: var(--fs-md); font-weight: 700; line-height: 1.25; color: #000; text-overflow: ellipsis; white-space: nowrap; }
.tgc-name a { color: inherit; }
.tgc-name a:hover { color: #3390ec; }
.tgc-status { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; overflow: hidden; font-size: var(--fs-base); line-height: 1.2; color: #8a96a0; text-overflow: ellipsis; white-space: nowrap; }
.tgc-status .tg-dot { flex: none; }
.tg-chat-min { flex: none; padding: 7px 10px; border: 0; border-radius: var(--r-1); background: none; color: #707579; font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; }
.tg-chat-min:hover { background: #f1f3f4; color: #000; }
.tgc-bind { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--bm-white); border-bottom: 1px solid #e7e9eb; }
.tgc-bind p { flex: 1; margin: 0; font-size: var(--fs-base); color: #3c4a55; }
.tgc-bind .btn { flex: none; }
.tgc-bind .btn .i { width: 14px; height: 14px; flex-basis: 14px; }

/* лента: стандартный фон Telegram без картинки */
.tg-chat-dialog .tg-msgs-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 12px;
  background: radial-gradient(120% 80% at 0% 0%, #eaefdc 0%, transparent 60%), radial-gradient(120% 90% at 100% 100%, #cbd9bb 0%, transparent 62%), var(--tgc-bg); }
.tg-msg-list { display: flex; flex-direction: column; gap: 6px; }
.tg-chat-dialog .tg-msgs-scroll { display: flex; flex-direction: column; }
.tg-chat-dialog [data-tg-msgs] { margin-top: auto; }  /* мало сообщений — прижаты к полю ввода, как в Telegram */
.tgc-empty { width: fit-content; margin: 24px auto; padding: 4px 12px; border-radius: var(--r-2); background: rgba(41, 56, 36, .3); color: var(--bm-white); font-size: var(--fs-base); }
.tgc-day { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; margin: 6px 0 2px; pointer-events: none; }
.tgc-day span { padding: 3px 10px; border-radius: var(--r-2); background: rgba(41, 56, 36, .32); color: var(--bm-white); font-size: var(--fs-base); font-weight: 600; }
.tgc-msg { display: flex; }
.tgc-msg.out { justify-content: flex-end; }
.tgc-msg.in + .tgc-msg.in, .tgc-msg.out + .tgc-msg.out { margin-top: -4px; }
.tgc-bubble { position: relative; max-width: min(82%, 380px); min-width: 72px; padding: 6px 9px 6px 11px; border-radius: var(--r-2); background: var(--bm-white); color: #000;
  font-size: var(--fs-base); line-height: 1.38; box-shadow: 0 1px 1.5px rgba(16, 35, 47, .15); }
.tgc-msg.out .tgc-bubble { background: #effdde; }
.tgc-msg.in .tgc-bubble { border-bottom-left-radius: 4px; }
.tgc-msg.out .tgc-bubble { border-bottom-right-radius: 4px; }
.tgc-msg.in:has(+ .tgc-msg.in) .tgc-bubble { border-bottom-left-radius: 12px; }  /* хвостик — у последнего в серии, как в Telegram */
.tgc-msg.out:has(+ .tgc-msg.out) .tgc-bubble { border-bottom-right-radius: 12px; }
.tgc-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tgc-text::after { content: ""; display: inline-block; width: 40px; height: 1px; }  /* место под время в последней строке */
.tgc-msg.out .tgc-text::after { width: 58px; }
.tgc-none { color: #8a96a0; font-style: italic; }
.tgc-deleted { margin-top: 2px; font-size: var(--fs-sm); color: #c2412d; }
.tgc-meta { position: absolute; right: 8px; bottom: 5px; display: flex; align-items: center; gap: 2px; font-size: var(--fs-sm); line-height: 1; color: #a0acb6; white-space: nowrap; }
.tgc-msg.out .tgc-meta { color: #5dac63; }
.tgc-ticks { display: inline-grid; }
.tgc-ticks .i { width: 16px; height: 16px; stroke-width: 2; }
.tgc-file { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 0; color: inherit; text-decoration: none; }
.tgc-file:has(+ .tgc-meta), .tgc-file:has(+ .tgc-deleted) { padding-bottom: 14px; }
.tgc-file + .tgc-file, .tgc-photo + .tgc-file, .tgc-file + .tgc-photo, .tgc-file + .tgc-text { margin-top: 6px; }
.tgc-file-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: #3390ec; color: var(--bm-white); }
.tgc-msg.out .tgc-file-ico { background: #4fae4e; }
.tgc-file.is-missing .tgc-file-ico { background: #c4cdd4; }
.tgc-file-ico .i { width: 22px; height: 22px; stroke-width: 2.2; }
.tgc-file-txt { display: grid; min-width: 0; }
.tgc-file-txt b { overflow: hidden; font-size: var(--fs-base); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tgc-file-txt small { font-size: var(--fs-base); color: #8a96a0; }
.tgc-msg.out .tgc-file-txt small { color: #6aa86c; }
a.tgc-file:hover b { color: #3390ec; }
.tgc-bubble:has(.tgc-photo) { width: min(82%, 320px); }
.tgc-photo { display: block; margin: -3px -6px 6px -8px; overflow: hidden; border-radius: var(--r-2) var(--r-2) 4px 4px; line-height: 0; background: rgba(0, 0, 0, .06); }
.tgc-photo img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.tgc-bubble.is-photo { padding: 0; background: none; box-shadow: none; }  /* фото без подписи — без пузыря, как в Telegram */
.tgc-bubble.is-photo .tgc-photo { margin: 0; border-radius: var(--r-2); box-shadow: 0 1px 1.5px rgba(16, 35, 47, .15); }
.tgc-bubble.is-photo .tgc-meta { right: 7px; bottom: 7px; padding: 3px 6px; border-radius: var(--r-2); background: rgba(0, 0, 0, .42); color: var(--bm-white); }

/* поле ввода */
.tg-composer { display: flex; align-items: flex-end; gap: 2px; padding: 4px 6px; background: var(--bm-white); border-top: 1px solid #e7e9eb; }
.tg-attach { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; color: #a2acb4; cursor: pointer; }
.tg-attach:hover { color: #3390ec; background: #f1f3f4; }
.tg-attach:focus-within { outline: 2px solid #3390ec; outline-offset: -2px; }
.tg-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tg-attach .i, .tg-attach svg { width: 24px; height: 24px; }
.tg-composer-field { flex: 1; min-width: 0; margin: 0; }
.tg-chat-dialog .tg-composer-field textarea { display: block; width: 100%; min-height: 44px; max-height: 140px; margin: 0; padding: 11px 6px; border: 0; border-radius: 0;
  background: transparent; color: #000; font: inherit; font-size: var(--fs-md); line-height: 1.38; resize: none; box-shadow: none; }
.tg-chat-dialog .tg-composer-field textarea::placeholder { color: #a2acb4; }
.tg-chat-dialog .tg-composer-field textarea:focus { outline: none; }
.tg-send { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #3390ec; cursor: pointer; }
.tg-send:hover { background: #eaf3fd; }
.tg-send:focus-visible { outline: 2px solid #3390ec; outline-offset: -2px; }
.tg-send .i, .tg-send svg { width: 24px; height: 24px; stroke-width: 2; }
@media (max-width: 767px) {
  .cm-dialog.tg-chat-dialog { width: 100%; border-radius: var(--r-3) var(--r-3) 0 0; }
  .tg-chat-panel { height: 92dvh; }
}
.doc-view { display: flex; flex-direction: column; gap: 12px; min-height: calc(100dvh - 120px); }
.doc-view-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-view-bar-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--bm-line); }
.doc-view-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-view-body { flex: 1; display: grid; place-items: center; background: #0e1621; border-radius: var(--radius); min-height: 50vh; padding: 12px; }
.doc-view-img { max-width: 100%; max-height: min(70dvh, 900px); object-fit: contain; border-radius: var(--r-1); }
.doc-view-video { width: min(100%, 960px); max-height: min(70dvh, 900px); background: #000; border-radius: var(--r-1); }
.doc-view-frame { width: 100%; height: min(70dvh, 900px); border: 0; background: var(--bm-white); border-radius: var(--r-1); }
.doc-view-other { text-align: center; color: #f5f5f5; }
.section.danger h2 { color: var(--bm-danger); }
.panel { background: var(--bm-paper); border-radius: var(--radius); padding: 14px 16px; }
.accent { border-left: 3px solid var(--bm-orange); border-radius: 0; padding: 10px 14px; background: var(--bm-paper); }
form > .accent { margin-bottom: 14px; }
.warn { border-left: 3px solid var(--bm-amber); border-radius: 0; padding: 8px 12px; background: var(--bm-paper); font-size: var(--fs-base); margin-top: 8px; }
.alert { border-left: 3px solid var(--bm-danger); border-radius: 0; padding: 8px 12px; background: var(--bm-paper); font-size: var(--fs-base); margin-top: 8px; }
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages:not(:has(.msg)):not(:has(li)) { margin: 0; }
.messages li, .messages .msg { border-left: 3px solid var(--bm-orange); background: var(--bm-paper); padding: 10px 12px; margin-bottom: 6px; }
.messages li.error, .messages .msg.error { border-left-color: var(--bm-danger); }
.phone-notice { width: min(380px, calc(100vw - 32px)); margin: auto; padding: 22px 22px 18px; border: 0; border-radius: var(--radius); background: var(--bm-white); color: var(--bm-graphite); box-shadow: 0 16px 40px rgba(35, 39, 43, 0.18); }
.phone-notice::backdrop { background: rgba(35, 39, 43, 0.45); }
.phone-notice-title { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 800; line-height: 1.3; }
.phone-notice .muted { margin: 0 0 16px; }
.phone-notice form { display: flex; justify-content: flex-end; margin: 0; }

.rows { border-top: 1px solid var(--bm-line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bm-line); min-height: 56px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: var(--fs-base); color: var(--bm-sage); }
.row .when { font-size: var(--fs-base); color: var(--bm-sage); white-space: nowrap; }
.row.overdue .when { color: var(--bm-danger); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
details.fold > summary { cursor: pointer; list-style: none; padding: 10px 0; color: var(--bm-sage); font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }

.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border: 1.5px solid var(--bm-line); border-radius: var(--r-4); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.badge.stage { border-color: var(--bm-orange); }
.badge.muted { color: var(--bm-sage); }
.progress { width: 100%; height: 4px; appearance: none; border: 0; background: var(--bm-paper); border-radius: 2px; }
.progress::-webkit-progress-bar { background: var(--bm-paper); border-radius: 2px; }
.progress::-webkit-progress-value { background: var(--bm-orange); border-radius: 2px; }
.progress::-moz-progress-bar { background: var(--bm-orange); }

/* ---------- карточка ---------- */
.card-head { position: sticky; top: var(--topbar-h); z-index: 6; margin: -4px 0 8px; padding: 8px 0 6px; background: var(--bm-white); }
.main.canvas .card-head { background: #F1F3F4; }
.card-head h1 { font-size: var(--fs-xl); font-weight: 600; }
.kind-tabs { max-width: 100%; }
.kind-tabs a { min-height: var(--tap); }
@media (max-width: 767px) {
  .client-head .page-head { flex-wrap: wrap; }
  .client-head .page-head > :first-child { flex: 1 1 100%; }
  .client-head .page-head > .btn-row { margin-left: auto; }
}
.client-head .btn-row { align-items: center; }
.client-head .btn-new { min-height: var(--tap); }
.card-head .page-head { align-items: flex-end; }
.card-head .name-row, .client-head .name-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.client-head .name-row { align-items: center; }
.card-head .name-row { flex: 1 1 auto; min-width: 0; }
.name-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.name-status-label { font-size: var(--fs-xs); line-height: 1.1; font-weight: 600; color: var(--bm-sage); }
.card-head .name-status .badge { font-size: var(--fs-base); min-height: 28px; padding: 0 10px; font-weight: 600; }
.card-head .name-status .status-menu-list { left: 0; right: auto; }
.name-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.name-tools form { margin: 0; }
.name-tools .head-brief, .name-tools .head-task { min-height: 34px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-2); font-size: var(--fs-base); font-weight: 800; }
.name-tools .head-brief { background: var(--bm-graphite); color: var(--bm-orange); }
.name-tools .head-brief:hover { background: #1c2023; }
.name-tools .head-task { padding: 0 14px 0 11px; }
.name-tools .head-task .i { width: 15px; height: 15px; flex-basis: 15px; }
.card-sub { color: var(--bm-sage); font-size: var(--fs-base); margin-top: 2px; }
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin: 14px 0; }
.quick form { display: contents; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; min-height: 60px; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--fs-xs); color: var(--bm-graphite); cursor: pointer; overflow-wrap: break-word; text-align: center; }
@media (min-width: 420px) { .quick a, .quick button { font-size: var(--fs-sm); } }
.quick .ico { width: 34px; height: 34px; border-radius: var(--r-2); }
.quick .ico-app { border: 0; background: none; }
.quick .ico-app .app-i { width: 34px; height: 34px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 10px; border-bottom: 1px solid var(--bm-line); scroll-margin-top: 80px; }
.tabs a { padding: 10px 12px; white-space: nowrap; color: var(--bm-sage); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--bm-graphite); border-bottom-color: var(--bm-orange); }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 12px; font-size: var(--fs-base); }
.kv dt { color: var(--bm-sage); } .kv dd { margin: 0; }

.figure { background: var(--bm-paper); padding: 10px 12px; }
.figure .label { font-size: var(--fs-sm); color: var(--bm-sage); }
.figure .value { font-size: var(--fs-lg); font-weight: 600; }

/* ---------- лента ---------- */
.timeline { margin-top: 6px; }
/* каждое событие — отдельная карточка: полоса слева по виду, над днём — разделитель */
.ev-day { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: var(--fs-sm); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--bm-graphite); }
.ev-day:first-child { margin-top: 2px; }
.ev-day::after { content: ""; flex: 1; height: 1px; background: var(--bm-line); }
.ev { margin: 0 0 8px; padding: 10px 12px 10px 13px; background: var(--bm-white); border: 1px solid var(--bm-line);
  border-left: 3px solid var(--bm-sage); border-radius: var(--r-1); }
.ev.evk-note { border-left-color: var(--bm-amber); }
.ev.evk-call { border-left-color: var(--bm-graphite); }
.ev.evk-meeting, .ev.evk-showing, .ev.hot { border-left-color: var(--bm-orange); }
.ev.sys { padding: 6px 12px; background: var(--bm-paper); border-color: var(--bm-paper); border-left-color: #C9CFD2; font-size: var(--fs-base); color: #5B6166; }
.ev .meta { margin-bottom: 4px; font-size: var(--fs-sm); line-height: 1.5; color: var(--bm-sage); }
.ev-kind { margin-right: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--bm-graphite); }
.ev-time { font-variant-numeric: tabular-nums; }
.ev .text { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-base); line-height: 1.45; }
.ev.sys .meta { margin-bottom: 0; }
.ev-actions { font-size: var(--fs-sm); margin-top: 6px; display: flex; gap: 10px; }
.ev-actions a { color: var(--bm-sage); }

/* ---------- десктоп: три колонки ---------- */
@media (min-width: 1024px) {
  
  
  .quick { max-width: 520px; }
  .form-narrow { max-width: 640px; }
}

.banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 40; background: var(--bm-graphite); color: var(--bm-white); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.banner .btn { border-color: var(--bm-white); background: var(--bm-white); color: var(--bm-graphite); }
.banner .close { background: none; border: 0; color: var(--bm-white); font-size: var(--fs-xl); cursor: pointer; min-width: var(--tap); min-height: var(--tap); }
@media (min-width: 1024px) { .banner { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }
.call-alert {
  position: fixed; z-index: 45; left: 12px; right: 12px;
  top: calc(var(--topbar-h) + env(safe-area-inset-top) + 8px);
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bm-graphite); color: var(--bm-white); border-radius: var(--radius); padding: 14px 14px 12px;
}
.call-alert .call-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.call-alert .call-kicker { font-size: var(--fs-sm); font-weight: 600; color: var(--bm-orange); }
.call-alert .call-name { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.call-alert .call-meta { font-size: var(--fs-base); color: #C5C9CC; }
.call-alert .call-comment { font-size: var(--fs-base); line-height: 1.35; }
.call-alert .call-actions { display: flex; gap: 8px; margin-top: 8px; }
.call-alert .call-actions .btn { flex: 1; }
.call-alert .close {
  background: none; border: 0; color: var(--bm-white); font-size: var(--fs-xl); line-height: 1; cursor: pointer;
  min-width: var(--tap); min-height: var(--tap);
}
@media (min-width: 1024px) { .call-alert { left: auto; right: 24px; width: 360px; } }
.htmx-request .spinner { display: inline-block; }
.spinner { display: none; }

/* вход */
.auth { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.auth .brand { font-size: var(--fs-xl); margin-bottom: 24px; display: block; }

/* iPhone: действия строки уходят под текст, название не сжимается */
@media (max-width: 767px) {
  .row { flex-wrap: wrap; row-gap: 8px; }
  .row .grow { flex: 1 1 60%; }
  .row .row-actions { flex: 1 1 100%; justify-content: flex-start; }
  .row .row-actions form { display: contents; }
}
.auth form .btn { margin-top: 8px; }
.next-steps { display: grid; gap: 6px; min-width: 0; }
.next-step { display: flex; align-items: center; gap: 12px; min-width: 0; }
.next-step .grow { flex: 1; min-width: 0; }
.next-step .title { font-size: var(--fs-md); font-weight: 600; }

/* Telegram: неразобранные чаты */
.row-actions form { display: inline; margin: 0; }
.tg-chat { border-left: 3px solid var(--bm-orange); padding: 10px 0 12px 14px; margin-bottom: 14px; border-bottom: 1px solid var(--bm-line); }
.tg-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tg-head .title { font-weight: 600; }
.tg-head .when { font-size: var(--fs-base); color: var(--bm-sage); white-space: nowrap; }
.tg-preview { margin: 8px 0; display: grid; gap: 4px; }
.tg-msg { font-size: var(--fs-base); padding: 6px 10px; background: var(--bm-paper); border-radius: var(--radius-sm); max-width: 92%; justify-self: start; }
.tg-msg.out { justify-self: end; background: var(--bm-white); border: 1px solid var(--bm-line); }
.tg-bind { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tg-bind select { flex: 1 1 220px; width: auto; }
.btn-row form { display: inline; margin: 0; }
.steps { padding-left: 18px; margin: 0 0 16px; }
.steps li { margin-bottom: 6px; }
.btn-block + .btn-block { margin-top: 8px; }

/* звонки и голос: блок расшифровки в ленте */
.rec { margin-top: 8px; padding: 10px 12px; background: var(--bm-paper); border-radius: var(--radius-sm); display: grid; gap: 8px; }
.rec-status { font-size: var(--fs-base); color: var(--bm-sage); display: flex; align-items: center; gap: 8px; }
.rec-status.failed { color: var(--bm-danger); }
.rec-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bm-orange); animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .rec-status .dot { animation: none; } }
.rec-summary { font-weight: 600; font-size: var(--fs-base); }
.rec-fields { display: grid; gap: 8px; }
.rec-field { font-size: var(--fs-base); border-left: 3px solid var(--bm-orange); padding-left: 10px; }
.rec-field.done { border-left-color: var(--bm-sage); }
.rec-field .quote { font-size: var(--fs-base); color: var(--bm-sage); margin: 2px 0 6px; }
.rec-step { font-size: var(--fs-base); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rec-step form, .rec form { display: inline; margin: 0; }
.rec-transcript summary { font-size: var(--fs-base); color: var(--bm-sage); cursor: pointer; }
.rec-transcript .small { margin-top: 6px; }
.ok { color: var(--bm-ok); }
form.inline { display: inline; margin: 0; }

/* голосовая заметка */
.recorder { display: grid; justify-items: center; gap: 10px; padding: 24px 0 8px; }
.rec-btn { width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--bm-orange); background: var(--bm-white); display: grid; place-items: center; cursor: pointer; }
.rec-btn .rec-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--bm-orange); }
.rec-btn.on .rec-ico { width: 28px; height: 28px; border-radius: var(--r-1); background: var(--bm-graphite); }
.rec-time { font-size: 28px; font-weight: 800; color: var(--bm-graphite); font-variant-numeric: tabular-nums; }
.dropzone input[type=file] { padding: 22px 12px; border: 1.5px dashed var(--bm-line); border-radius: var(--radius-sm); width: 100%; background: var(--bm-paper); }
.tg-bind input[type=search] { flex: 1 1 220px; width: auto; }
.tg-found { margin-top: 8px; }

/* подбор */
.match { border-bottom: 1px solid var(--bm-line); padding: 12px 0; display: grid; gap: 8px; }
.match.fallback { opacity: 0.85; }
.match-head { display: flex; gap: 12px; align-items: center; }
.match-score { font-size: var(--fs-2xl); font-weight: 800; color: var(--bm-orange); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.match-head .title { font-weight: 600; }
.match-head .sub { font-size: var(--fs-base); color: var(--bm-sage); }
.match-why summary { font-size: var(--fs-base); color: var(--bm-sage); cursor: pointer; }
.match-why ul { margin: 6px 0 0; padding-left: 18px; }
.match .btn-row form { display: inline; margin: 0; }

/* сделка: чек-листы */
.deal-checklists { display: grid; gap: 6px; margin-top: 10px; }
.checklist { display: grid; gap: 2px; margin-top: 6px; }
.checklist form { margin: 0; }
.check-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 0; border: 0; background: none; font: inherit; font-size: var(--fs-base); color: var(--bm-graphite); text-align: left; cursor: pointer; }
.check-item .box { width: 20px; height: 20px; flex: 0 0 20px; border: 1.5px solid var(--bm-line); border-radius: 4px; }
.check-item.on .box { background: var(--bm-orange); border-color: var(--bm-orange); }
.check-item.on { color: var(--bm-sage); }
.panel.deal { display: grid; gap: 6px; }

/* деньги и аналитика */
.money-hero { margin: 4px 0 12px; }

.bars { display: grid; gap: 8px; margin-bottom: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-base); }
.bar-label { min-width: 0; overflow-wrap: anywhere; }
.bar { width: 100%; height: 10px; display: block; }
.bar-bg { fill: var(--bm-paper); }
.bar-fill { fill: var(--bm-orange); }
.bar-fill.done { fill: var(--bm-ok); }
.bar-value { font-size: var(--fs-base); color: var(--bm-graphite); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .bar-row { grid-template-columns: minmax(0, 1fr) auto; } .bar-track { grid-column: 1 / -1; grid-row: 2; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--bm-line); white-space: nowrap; }
.table th { font-size: var(--fs-sm); color: var(--bm-sage); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr.total td { font-weight: 700; }

/* канбан — static/css/kanban.css (подключается на странице «Воронки») */

/* объект: галерея и панель как на сайте БМ */
.obj-top { display: grid; gap: 16px; margin-top: 12px; }
@media (min-width: 900px) { .obj-top { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; gap: 24px; } }
.gallery { position: relative; min-width: 0; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); background: var(--bm-paper); scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; display: block; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip-dark, .gallery-count, .gallery-edit { background: rgba(35, 39, 43, 0.82); color: var(--bm-white); font-size: var(--fs-sm); font-weight: 600; padding: 4px 9px; border-radius: var(--radius-sm); white-space: nowrap; }
.gallery-count { position: absolute; top: 10px; right: 10px; }
.gallery-edit { position: absolute; top: 10px; left: 10px; }
.gallery-thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: thin; }
.gallery-thumb { flex: 0 0 76px; height: 57px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: var(--bm-paper); cursor: pointer; }
.gallery-thumb.on { border-color: var(--bm-orange); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-empty { min-height: 120px; display: grid; place-content: center; justify-items: center; gap: 2px; border: 1.5px dashed var(--bm-line); border-radius: var(--radius); background: var(--bm-paper); font-weight: 600; text-align: center; padding: 12px; }
.gallery-empty .plus { font-size: 28px; line-height: 1; color: var(--bm-orange); font-weight: 800; }
@media (min-width: 900px) { .gallery-empty { aspect-ratio: 4 / 3; } }
.obj-panel { border: 1px solid var(--bm-line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.obj-price .label, .obj-person .label { font-size: var(--fs-base); color: var(--bm-sage); }
.obj-price .value { font-size: 28px; font-weight: 800; color: var(--bm-orange); line-height: 1.15; }
.obj-facts { margin: 0; display: grid; gap: 8px; }
.obj-facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--bm-line); padding-bottom: 8px; }
.obj-facts dt { color: var(--bm-sage); }
.obj-facts dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.obj-actual .label { font-size: var(--fs-base); color: var(--bm-sage); }
.obj-actual .value { font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; }
.obj-person { display: grid; gap: 6px; }
.obj-person .name { font-weight: 600; }
.obj-seller { display: grid; gap: 2px; }
.obj-seller-name { font-size: var(--fs-xl); font-weight: 700; line-height: 1.25; }
.obj-seller-phone { font-size: var(--fs-lg); font-weight: 600; letter-spacing: .01em; }
.obj-panel .bo { margin: 0; align-items: flex-start; }
.obj-panel .bo-id b { white-space: normal; }
.obj-drop { background: var(--bm-paper); border-left: 3px solid var(--bm-orange); }
.obj-drop > summary { list-style: none; cursor: pointer; }
.obj-drop > summary::-webkit-details-marker { display: none; }
.obj-buyers { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bm-paper); border-left: 3px solid var(--bm-orange); }
.obj-drop > summary.obj-buyers { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: transparent; border-left: 0; }
.obj-drop > summary.obj-buyers::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--bm-graphite); border-bottom: 2px solid var(--bm-graphite); transform: rotate(45deg) translateY(-2px); }
.obj-drop[open] > summary.obj-buyers::after { transform: rotate(225deg) translateY(-1px); }
.obj-drop > summary:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: -2px; }
.obj-buyers b { font-size: var(--fs-xl); font-weight: 800; }
.obj-drop-list a, .obj-drop-list p { margin: 0; padding: 8px 12px; border-top: 1px solid var(--bm-line); }
.obj-drop-list a { display: grid; gap: 1px; color: inherit; text-decoration: none; }
.obj-drop-list a:hover, .obj-drop-list a:focus-visible { background: var(--bm-white); }
.obj-drop-list a b { font-size: var(--fs-base); font-weight: 700; }
.obj-drop-list a span { font-size: var(--fs-base); color: var(--bm-sage); }
.obj-actions { margin-top: 4px; }

/* объект: блоки «О бизнесе / Финансы / Помещение / Сотрудники» */
.info-grid { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 1024px) { .info-grid { grid-template-columns: 1fr 1fr; } .info-block.wide { grid-column: 1 / -1; } }
.info-block { border: 1px solid var(--bm-line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.info-block h3 { font-size: var(--fs-lg); margin-bottom: 12px; }
.info-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-item { background: var(--bm-paper); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.info-item.wide { grid-column: 1 / -1; }
.info-item .t { font-size: var(--fs-sm); color: var(--bm-sage); margin-bottom: 4px; }
.info-item .v { font-weight: 600; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.info-block .kv { margin: 0; }

/* список объектов: плитки как в каталоге БМ */
.ogrid { display: grid; gap: 12px; }
@media (min-width: 640px) { .ogrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; } }
.ocard { display: grid; grid-template-columns: 102px minmax(0, 1fr); gap: 12px; border: 1px solid var(--bm-line); border-radius: var(--radius); overflow: hidden; background: var(--bm-white); }
.ocard:hover, .ocard:focus-visible { border-color: var(--bm-orange); }
.ocard-img { position: relative; background: var(--bm-paper); aspect-ratio: 1 / 1; align-self: start; margin: 10px 0 10px 10px; border-radius: var(--radius-sm); overflow: hidden; }
.ocard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ocard-noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-size: var(--fs-sm); color: var(--bm-sage); }
.sticker { position: absolute; top: 6px; left: 6px; max-width: calc(100% - 12px); background: var(--bm-orange); color: var(--bm-white); font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker.muted { background: var(--bm-graphite); }
.ocard-chips { display: none; }
.ocard .sticker { top: 4px; left: 4px; max-width: calc(100% - 8px); font-size: 10px; padding: 2px 5px; white-space: normal; line-height: 1.2; }
.ocard-body { padding: 10px 12px 10px 0; display: grid; gap: 3px; min-width: 0; align-content: start; }
.ocard-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ocard-id { font-size: var(--fs-sm); color: var(--bm-sage); }
.ocard-props { margin: 4px 0 0; display: grid; gap: 2px; font-size: var(--fs-base); }
.ocard-props div { display: flex; gap: 6px; min-width: 0; }
.ocard-props dt { color: var(--bm-sage); flex: 0 0 64px; }
.ocard-props dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ocard-price { font-size: var(--fs-lg); font-weight: 800; color: var(--bm-orange); white-space: nowrap; }
.ocard-next { font-size: var(--fs-sm); color: var(--bm-sage); white-space: nowrap; }
@media (min-width: 640px) {
  .ocard { grid-template-columns: 1fr; gap: 0; }
  .ocard-img { aspect-ratio: 4 / 3; margin: 0; border-radius: 0; }
  .ocard .sticker { top: 8px; left: 8px; max-width: calc(100% - 16px); font-size: var(--fs-xs); padding: 3px 8px; white-space: nowrap; }
  .ocard-chips { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
  .ocard-body { padding: 12px 14px 14px; }
  .ocard-price { font-size: var(--fs-xl); }
}
.row-thumb { width: 56px; height: 42px; flex: 0 0 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bm-paper); display: block; }

/* фото объекта: управление */
.photo-upload { display: grid; gap: 8px; justify-items: start; margin-bottom: 8px; }
.photo-upload .dropzone { width: 100%; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-tile { margin: 0; position: relative; border: 1px solid var(--bm-line); border-radius: var(--radius); overflow: hidden; }
.photo-tile.cover { border-color: var(--bm-orange); }
.photo-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.photo-actions form { margin: 0; }

/* телефон: кнопки «Номер / Telegram / Итог» над галереей — звонок в один тап; миниатюры не нужны, фото листаются */
.obj-stack { display: flex; flex-direction: column; }
@media (max-width: 899px) {
  .obj-stack > .quick { order: -1; margin-top: 4px; }
  .gallery-thumbs { display: none; }
  .gallery-slide { aspect-ratio: 16 / 10; }
}

/* фото на весь экран — внутри страницы: в PWA на iPhone новая вкладка открылась бы без входа */
.lightbox { margin: 0; inset: 0; padding: 0; border: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(35, 39, 43, 0.94); }
.lightbox img { width: auto; height: auto; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); object-fit: contain; display: block; touch-action: pan-y; }
.lightbox-close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--bm-white); color: var(--bm-graphite); font: inherit; font-size: var(--fs-2xl); line-height: 1; cursor: pointer; }

/* карточка клиента: комментарии сверху, телефоны с мессенджерами, правка полей на месте */
.client-id { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
.client-types { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.comments { background: var(--bm-paper); border-left: 3px solid var(--bm-amber); padding: 12px 16px 14px; margin: 14px 0 16px; }
.comments-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.comments-head h2 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bm-graphite); }
.comment { margin-top: 8px; padding: 8px 12px; background: var(--bm-white); border: 1px solid var(--bm-line); border-radius: var(--r-1); }
.comment .meta { margin-bottom: 2px; }
.comment .meta { font-size: var(--fs-sm); color: var(--bm-sage); }
.comment .text { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; font-size: var(--fs-base); }
.comment.pinned { border-left: 3px solid var(--bm-amber); }
.comment.pinned .meta { color: var(--bm-graphite); }
@media (max-width: 767px) { .comments { padding: 10px 12px 12px; } .ev { padding: 9px 11px; } }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.comment-form textarea { min-height: 44px; }
.client-grid { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 1024px) { .client-grid { grid-template-columns: 1fr 1fr; } }
.client-block h3 { margin-bottom: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.block-head h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.block-head > a { white-space: nowrap; }
.phones { display: grid; gap: 10px; margin-bottom: 12px; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: start; padding: 10px 12px; background: var(--bm-paper); border-radius: var(--radius-sm); border-left: 3px solid transparent; }
.phone-row.primary { border-left-color: var(--bm-orange); }
.phone-edit { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; margin-top: -2px; padding: 0 8px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--bm-sage); font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; }
.phone-edit .i { width: 16px; height: 16px; flex-basis: 16px; }
.phone-edit:hover, .phone-edit:focus-visible { background: var(--bm-white); color: var(--bm-graphite); }
.phone-edit:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.phone-line { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; }
.phone-edit-form { display: none; flex: 1 1 140px; min-width: 0; align-items: center; gap: 6px; margin: 0; }
.phone-row.editing .phone-edit-form { display: flex; }
.phone-row.editing .phone-num { display: none; }
.phone-edit-form input { flex: 1; min-width: 0; min-height: 36px; font-size: var(--fs-md); font-weight: 700; }
.phone-actions { grid-column: 1 / -1; }
@media (max-width: 767px) {
  .phone-edit { width: 36px; height: 36px; margin-top: -4px; padding: 0; justify-content: center; }
  .phone-edit-label { display: none; }
}
.phone-num { font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.phone-flag { font-size: var(--fs-md); line-height: 1; flex: none; }
.phone-flag-slot:empty { display: none; }
.phone-line form:not(.phone-edit-form) { display: inline; margin: 0; }
.phone-status-wrap { position: relative; display: inline-flex; align-items: center; }
.phone-status-wrap .i { position: absolute; right: 8px; width: 12px; height: 12px; pointer-events: none; color: var(--bm-sage); }
.phone-status { appearance: none; -webkit-appearance: none; min-height: 26px; max-width: 100%; padding: 0 26px 0 10px; border: 1.5px solid var(--bm-line); border-radius: var(--r-4); background: var(--bm-white); font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--bm-graphite); cursor: pointer; }
.phone-row.primary .phone-status { border-color: var(--bm-orange); }
.phone-status:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
@media (max-width: 767px) { .phone-status { min-height: 36px; font-size: var(--fs-md); } }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-base); color: var(--bm-sage); border-bottom: 1px solid var(--bm-line); cursor: pointer; }
.phone-actions, .client-links { display: flex; flex-wrap: wrap; gap: 6px; }
.phone-actions form { display: contents; }
.pa { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--bm-line); border-radius: var(--r-4); background: var(--bm-white); color: var(--bm-graphite); font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; white-space: nowrap; }
.pa:hover, .pa:focus-visible { border-color: var(--bm-orange); }
.pa-sm { min-height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
/* мессенджеры — цветными значками приложений (спрайт web/partials/app_icons.html), звонок — текстовой кнопкой */
.app-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.pa-app { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; }
.pa-app.pa-sm { width: 30px; }
.pa-app:hover, .pa-app:focus-visible { border-color: var(--bm-line); background: var(--bm-paper); }
.app-i { width: 26px; height: 26px; flex: none; display: block; }
.pa-sm .app-i { width: 22px; height: 22px; }
.pa > .app-i { width: 18px; height: 18px; }
.pa-sm > .app-i { width: 16px; height: 16px; }
.brand-ya { display: inline-flex; align-items: center; }
.brand-ya .app-i { width: 1.05em; height: 1.05em; display: inline-block; }
.pa .brand-ya .app-i { width: 15px; height: 15px; }
.brand-avito { display: inline-flex; align-items: center; gap: 5px; color: #141414; font-weight: 800; letter-spacing: -0.04em; }
.brand-avito .app-i { width: 16px; height: 16px; }
.brand-bm { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 800; letter-spacing: 0.01em; font-size: var(--fs-sm); white-space: nowrap; }
.brand-bm b { color: var(--bm-orange); font-weight: 800; }
.brand-bm .app-i { width: 18px; height: 18px; }
.brand-label { display: inline-flex; align-items: center; gap: 6px; }
.brand-label > .app-i { width: 16px; height: 16px; }
.sidenav .app-i { width: 18px; height: 18px; }
.pa-form { display: contents; }
.i { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.phone-add-open { display: inline-flex; align-items: center; justify-self: start; width: auto; min-height: 28px; margin-top: 2px; padding: 0 10px; border: 1.5px solid var(--bm-line); border-radius: var(--r-4); background: var(--bm-white); color: var(--bm-graphite); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; white-space: nowrap; }
.phone-add-open:hover, .phone-add-open:focus-visible { border-color: var(--bm-orange); color: var(--bm-graphite); }
.phone-add-open:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.phone-add-open[hidden] { display: none; }
.phone-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.phone-add[hidden] { display: none; }
.phone-add input { flex: 1; min-width: 140px; }
.phone-add .phone-status-wrap { flex: none; }
.phone-add, .phone-edit-form { position: relative; }
.phone-edit-form { flex-wrap: wrap; }
.phone-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; flex: 1 1 100%; min-width: 0; }
.phone-slots-prefix { flex: none; font-size: var(--fs-md); font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.phone-slots-group { display: inline-flex; flex: none; gap: 2px; }
.phone-add .phone-slot, .phone-edit-form .phone-slot { width: 26px; max-width: 26px; height: 34px; min-width: 26px; min-height: 34px; flex: none; padding: 0; border: 1.5px solid var(--bm-line); border-radius: var(--r-1); background: var(--bm-white); color: var(--bm-graphite); font: inherit; font-size: var(--fs-md); font-weight: 700; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.phone-add .phone-slot:focus, .phone-edit-form .phone-slot:focus { outline: none; border-color: var(--bm-orange); box-shadow: 0 0 0 2px rgba(245, 146, 30, .18); }
.phone-slots-source { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; flex: none; min-width: 0; }
.client-kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px 12px; margin: 0 0 6px; font-size: var(--fs-base); align-items: baseline; }
.client-kv dt { color: var(--bm-sage); }
.client-kv dd { margin: 0; min-width: 0; }
.client-kv dd > div + div { margin-top: 4px; }
.client-quick { display: grid; gap: 2px; }
.qrow { display: grid; grid-template-columns: minmax(168px, 38%) 1fr; gap: 12px; align-items: center; padding: 4px 0; font-size: var(--fs-base); }
.qrow > span:first-child { color: var(--bm-sage); }
.qrow .brand-avito, .qrow .brand-label, .qrow .brand-bm { font-size: var(--fs-lg); gap: 8px; white-space: nowrap; }
.qrow .brand-avito .app-i, .qrow .brand-label > .app-i, .qrow .brand-bm .app-i { width: 26px; height: 26px; }
.qrow .brand-ya .app-i { width: 1.2em; height: 1.2em; }
.qval { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qval input, .qval select { min-height: 40px; padding: 8px 10px; }
.qval-2 { flex-wrap: wrap; }
.qval-2 select, .qval-2 input { flex: 1 1 140px; width: auto; }
.qstatus { font-size: var(--fs-sm); min-height: 18px; padding-top: 2px; }
@media (max-width: 520px) { .qrow, .client-kv { grid-template-columns: 1fr; gap: 4px; } }
.client-obj { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--bm-line); }
.client-obj:first-of-type { border-top: 0; }
.client-obj .grow { flex: 1; min-width: 0; display: grid; gap: 4px; }
.client-obj .title { font-weight: 600; }
.client-obj .sub { font-size: var(--fs-base); color: var(--bm-sage); }
.client-roles { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* карточка продавца: бизнес — одной понятной ссылкой */
.card-head .head-title { flex: 1 1 auto; min-width: 0; }
.card-head .head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.call-list { display: grid; }
.call-row { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--bm-line); }
.call-row audio, .ev audio { width: 100%; min-height: var(--tap); }
.call-row .title { font-weight: 700; }
.placement-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 8px 16px; margin: 0 0 0 auto; flex: none; }
.placement { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; flex: 0 0 auto; }
.paid-flag { margin: 0; }
.paid-flag .check { min-height: 32px; gap: 8px; font-size: var(--fs-md); font-weight: 700; white-space: nowrap; }
.paid-flag .check input { width: 18px; height: 18px; }
.placement-row .name-tools { margin-left: 0; align-self: center; flex: none; }
.tariff-pill { position: relative; margin: 0 0 0 26px; }
.tariff-pill summary { list-style: none; cursor: pointer; }
.tariff-pill summary::-webkit-details-marker { display: none; }
.tariff-pill-face { display: inline-flex; align-items: center; min-height: 24px; padding: 1px 2px 1px 9px; border: 1.5px solid var(--bm-orange); border-radius: var(--r-4); background: var(--bm-white); white-space: nowrap; }
.tariff-pill-name { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.tariff-pill-rule { width: 1px; height: 11px; margin-left: 7px; background: #E8D0B8; flex: none; }
.tariff-pill-price { margin-left: 5px; padding: 1px 7px; border-radius: var(--r-4); background: #FFF1E0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.tariff-pill-list { position: absolute; left: 0; z-index: 30; display: grid; gap: 4px; min-width: 220px; margin-top: 6px; padding: 6px; border: 1.5px solid var(--bm-orange); border-radius: var(--r-2); background: var(--bm-white); }
.tariff-pill-list form { margin: 0; }
.tariff-pill-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; padding: 6px 10px; border: 1.5px solid transparent; border-radius: var(--r-4); background: none; color: var(--bm-graphite); font: inherit; font-size: var(--fs-base); font-weight: 700; text-transform: uppercase; cursor: pointer; }
.tariff-pill-list button.on { border-color: var(--bm-orange); background: #FFF6EC; }
.tariff-pill-list button:hover, .tariff-pill-list button:focus-visible { background: var(--bm-paper); }
@media (max-width: 640px) {
  .card-head .page-head { flex-wrap: wrap; }
  .card-head .name-row { flex: 1 1 100%; }
  .card-head .head-actions { width: 100%; justify-content: flex-end; }
  .card-head .placement-row { width: 100%; margin-left: 0; flex-wrap: wrap; justify-content: space-between; }
}
.status-menu { position: relative; }
.status-menu summary { list-style: none; cursor: pointer; }
.status-menu summary::-webkit-details-marker { display: none; }
.status-menu-list { position: absolute; right: 0; z-index: 30; display: grid; gap: 4px; width: min(280px, calc(100vw - 32px)); max-height: min(70vh, 420px); margin-top: 6px; padding: 8px; overflow: auto; border: 1px solid var(--bm-line); border-radius: var(--radius); background: var(--bm-white); }
.status-menu-list form { margin: 0; }
.status-menu-list button { display: flex; align-items: center; width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1.5px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--bm-graphite); font: inherit; font-size: var(--fs-base); line-height: 1.25; text-align: left; cursor: pointer; }
.status-menu-list button.on { border-color: var(--bm-orange); background: var(--bm-paper); font-weight: 600; }
.status-menu-list button:hover, .status-menu-list button:focus-visible { background: var(--bm-paper); }
.seller-object { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 4px; border: 1px solid var(--bm-line); border-left: 3px solid var(--bm-orange); border-radius: var(--radius-sm); background: var(--bm-white); }
.seller-object:hover, .seller-object:focus-visible { border-color: var(--bm-orange); }
.seller-object-img { position: relative; width: 56px; height: 56px; flex: 0 0 56px; overflow: hidden; border-radius: var(--radius-sm); background: var(--bm-paper); display: block; }
.seller-object-img .slide-btn { width: 24px; height: 24px; margin-top: -12px; font-size: var(--fs-md); }
.seller-object-img .slide-btn.prev { left: 4px; } .seller-object-img .slide-btn.next { right: 4px; }
.seller-object-img .slide-dots { right: 4px; bottom: 4px; padding: 3px 5px; }
.seller-object .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
.seller-object .label { font-size: var(--fs-sm); color: var(--bm-sage); }
.seller-object .title { font-size: var(--fs-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-object .sub { font-size: var(--fs-base); color: var(--bm-sage); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-object .go { font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--bm-orange); }
@media (max-width: 520px) { .seller-object { flex-wrap: wrap; } .seller-object .go { flex: 1 1 100%; border: 0; color: var(--bm-graphite); } }
.seller-more { margin-bottom: 4px; }
.obj-seller-link { justify-self: end; font-size: var(--fs-base); font-weight: 600; border-bottom: 1px solid var(--bm-orange); }

/* «Покупатели» и «Продавцы»: таблица как в CRM БМ; на телефоне — карточки (фильтры над таблицей — блок .lf ниже в файле) */
.ct { border-top: 2px solid var(--bm-graphite); }
.ct-row { display: grid; grid-template-columns: 48px minmax(108px, 1.15fr) minmax(118px, 1.1fr) minmax(172px, 196px) minmax(154px, 172px) minmax(160px, 1.45fr); gap: 4px 8px; align-items: center; min-height: 44px; padding: 4px 8px; border-bottom: 1px solid var(--bm-line); border-left: 3px solid transparent; font-size: var(--fs-sm); line-height: 1.25; }
.ct-row.overdue { border-left-color: var(--bm-danger); }
.ct-row.nostep { border-left-color: var(--bm-amber); }
.ct-row:not(.ct-head):hover { background: var(--bm-paper); }
.ct-head { position: sticky; top: var(--topbar-h); z-index: 15; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bm-sage); background: var(--bm-white); line-height: 1.2; box-shadow: 0 1px 0 var(--bm-line); }
.ct-id { font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ct-name { min-width: 0; }
.ct-name .title { display: block; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-row .sub { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 1px; line-height: 1.25; }
.ct-name .sub, .ct-status .sub { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ct-status .badge { min-height: 18px; padding: 0 6px; border-width: 1px; font-size: var(--fs-xs); line-height: 16px; white-space: normal; }
.ct-dates { min-width: 0; font-size: var(--fs-xs); line-height: 1.25; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-dates .sub { overflow: hidden; text-overflow: ellipsis; }
.ct-mlabel { display: none; }
.ct-phone .num { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.ct-actions .pa { min-height: 26px; padding: 0 8px; font-size: var(--fs-xs); }
.ct-actions .pa-app { width: 26px; height: 26px; }
.ct-actions .app-i { width: 16px; height: 16px; }
.ct-comment { display: flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: var(--fs-sm); line-height: 1.35; }
.ct-note { flex: 1 1 auto; align-self: stretch; min-width: 0; min-height: 0; max-height: 4.2em; padding-right: 10px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.ct-note::-webkit-scrollbar { width: 8px; }
.ct-note::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: var(--r-1); }
.ct-note::-webkit-scrollbar-track { background: transparent; }
.ct-note:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.ct-note-n { flex: none; font-size: var(--fs-xs); line-height: 1.35; }
/* все комментарии клиента в ячейке — новые сверху, листаются прокруткой */
.ct-n { margin: 0; }
.ct-n + .ct-n { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--bm-line); }
.ct-n-at { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.ct-empty { padding: 16px 0; }
.ct-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 1100px) {
  .ct-head { display: none; }
  .ct-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name id" "status status" "phone phone" "comment comment" "dates dates"; gap: 4px 10px; padding: 8px 4px; font-size: var(--fs-base); }
  .ct-id { grid-area: id; font-size: var(--fs-sm); color: var(--bm-sage); }
  .ct-name { grid-area: name; }
  .ct-name .title { font-size: var(--fs-base); }
  .ct-status { grid-area: status; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
  .ct-status .sub { flex: 1 1 140px; min-width: 0; margin-top: 0; }
  .ct-phone { grid-area: phone; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  .ct-phone .num { font-size: var(--fs-base); }
  .ct-actions { margin-top: 0; }
  .ct-actions .pa { min-height: var(--tap); padding: 0 12px; font-size: var(--fs-base); }
  .ct-actions .pa-app { width: var(--tap); height: var(--tap); }
  .ct-actions .app-i { width: 22px; height: 22px; }
  .ct-comment { grid-area: comment; }
  .ct-note { max-height: 7.2em; font-size: var(--fs-base); }
  .ct-dates { grid-area: dates; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-sm); color: var(--bm-sage); }
  .ct-dates .sub { margin-top: 0; font-size: var(--fs-sm); display: inline; -webkit-line-clamp: unset; overflow: visible; }
  .ct-mlabel { display: inline; }
}
.seller-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seller-add input { flex: 1 1 160px; width: auto; }

/* «План дня»: списки — заголовок обычным регистром со счётчиком, лишнее свёрнуто */

.count { display: inline-flex; min-width: 24px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; border-radius: var(--r-4);
  background: var(--bm-paper); font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.count.hot { background: var(--bm-graphite); color: var(--bm-white); }

.list-count { margin: -4px 0 12px; }

/* «План дня»: план месяца одной полосой (мелкий серый текст — затемнённый серо-зелёный, контраст AA). Темп по рабочим дням — фирменными цветами и формой метки:
   в графике — серо-зелёный, отстаёт — янтарный (метка в контуре), под угрозой — оранжевый (метка залита),
   выполнен — графит с «✓». Ниже полосы — ничего: что проседает, сказано в строке заголовка. */
.kpi { --good: var(--bm-sage); --muted: var(--ink-3); --mid: var(--bm-amber); --mid-ink: #87650A; --bad: var(--bm-orange); --bad-ink: #B35A00;
  margin: 0 0 16px; border: 1px solid var(--bm-line); border-radius: var(--radius); overflow: hidden; }

.kpi-norm { font-size: var(--fs-base); color: var(--muted); }
.kpi-norm b { color: var(--bm-graphite); font-weight: 800; }
.kpi-norm.done b { color: var(--bm-orange); }

.kpi { container-type: inline-size; }

.kpi-c { --c: var(--good); --ink: var(--bm-graphite); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "n n" "v m" "bar bar" "d d"; align-items: center; gap: 3px 6px; min-width: 0; padding: 10px 16px 11px; background: var(--bm-white); }
.kpi-c.s-done { --c: var(--bm-graphite); }
.kpi-c.s-mid { --c: var(--mid); --ink: var(--mid-ink); }
.kpi-c.s-bad { --c: var(--bad); --ink: var(--bad-ink); }
.kpi-c.s-none { --c: var(--bm-line); --ink: var(--bm-sage); }
.kpi-n { grid-area: n; overflow: hidden; font-size: var(--fs-sm); font-weight: 600; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-m { grid-area: m; justify-self: start; min-width: 22px; height: 18px; padding: 0 6px; border-radius: var(--r-4); font-size: var(--fs-xs); font-weight: 800;
  line-height: 18px; text-align: center; color: var(--bm-graphite); }
.kpi-c.s-mid .kpi-m { box-shadow: inset 0 0 0 1.5px var(--mid); color: var(--mid-ink); }
.kpi-c.s-bad .kpi-m { background: var(--bad); }
.kpi-c.s-done .kpi-m { padding: 0; font-size: var(--fs-base); }
.kpi-v { grid-area: v; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; }
.kpi-v b { margin-right: 2px; font-size: var(--fs-2xl); font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.kpi-d { grid-area: d; display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; font-size: var(--fs-xs); line-height: 14px; color: var(--muted); white-space: nowrap; }
.kpi-d b { color: var(--bm-graphite); font-weight: 800; }
.kpi-bar { grid-area: bar; display: block; width: 100%; height: 8px; margin-top: 3px; overflow: visible; }
.kpi-track { fill: #E9EBED; }
.kpi-fill { fill: var(--c); }
.kpi-tick { stroke: var(--bm-graphite); stroke-width: 2; }
.kpi + .warn { margin: 0 0 16px; }
/* колонки — по ширине самого блока, а не окна: с боковым меню на 1280 px шести ячейкам уже тесно */

@container (max-width: 500px) {
  
  .kpi-c { padding: 8px 12px 9px; gap: 2px 6px; }
  .kpi-v b { font-size: var(--fs-xl); }
}
@media (max-width: 560px) {
  
  
  
  
  
  
  .kpi-norm { grid-area: n; justify-self: end; margin-left: 0; font-size: var(--fs-sm); }
  
}

/* списки «Плана дня»: заголовок на месте, под ним окно на пару строк (край третьей виден) с прокруткой */
/* каждый раздел — карточка: светлая шапка с названием и счётчиком, под ней строки; оранжевая полоса слева —
   в разделе есть то, что нужно сделать сейчас */

/* «Показать все» — окно раскрывается на весь список; ещё раз — «Свернуть» */
.plan-all { flex: none; padding: 2px 0; border: 0; border-bottom: 1px solid var(--bm-orange); background: none; color: var(--bm-graphite);
  font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; white-space: nowrap; }
.plan-all:hover, .plan-all:focus-visible { color: var(--bm-orange); }
.plan-scroll.open { overflow: visible; }

/* в окне — две строки и краешек третьей; остальное прокруткой или «Показать все» */
.plan-scroll { max-height: 110px; overflow-y: auto; scrollbar-width: thin; }
.plan-scroll .row .title, .plan-scroll .row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-scroll .row:last-child { border-bottom: 0; }
.plan-scroll:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: -2px; }
@media (max-width: 359px) {
  
  .kpi-norm { justify-self: start; }
}
@media (max-width: 767px) { /* та же граница, где кнопки строки уходят под текст */
  
  
  .plan-scroll { max-height: 182px; }
  
    /* время — в одной строке с кнопками */
  
  
    /* на телефоне — только суть */
  
  .plan-scroll .row .title, .plan-scroll .row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.form-lead { margin: -6px 0 14px; }

.ct-head .sort { color: var(--bm-sage); border-bottom: 1px dotted var(--bm-line); }
.ct-head .sort:hover, .ct-head .sort:focus-visible, .ct-head .sort.on { color: var(--bm-graphite); border-bottom-color: var(--bm-orange); }

/* ---------- календарь: месяц, неделя, день ---------- */
.c-showing { --cat: var(--bm-orange); } .c-meeting { --cat: var(--bm-graphite); } .c-zoom { --cat: var(--bm-amber); } .c-task { --cat: var(--bm-sage); }
.c-company { --cat: #2F6B48; background: #E8F2EC; }
.plan-strip { display: grid; gap: 8px; margin: 0 0 12px; }
.plan-strip a { display: block; min-height: var(--tap); padding: 12px 14px; border: 1px solid var(--bm-line); border-radius: var(--r-2); background: var(--bm-white); color: var(--ink); font-weight: 600; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 10px; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cal-nav .btn { min-width: 40px; }
.cal-title { margin: 0 0 0 8px; font-size: var(--fs-lg); font-weight: 800; }
.cal-views { display: inline-flex; padding: 3px; border: 1px solid var(--bm-line); border-radius: var(--r-4); background: var(--bm-white); }
.cal-views a { padding: 7px 16px; border-radius: var(--r-4); font-size: var(--fs-base); font-weight: 600; color: var(--bm-graphite); }
.cal-views a.on { background: var(--bm-graphite); color: var(--bm-white); }
.cal-views a:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-3); }
.cal-legend li { display: inline-flex; align-items: center; }
.cal-legend b { color: var(--bm-graphite); font-weight: 800; }
/* типы дел — кнопки-фильтры: нажал «Показы» — в календаре только показы, ещё раз (или «Все») — снова всё */
.cal-type { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 11px 5px 6px; border: 1px solid transparent; border-radius: var(--r-4);
  color: var(--ink-3); transition: background-color .15s, border-color .15s, color .15s, opacity .15s; }
.cal-type.all { padding-left: 12px; }
.cal-type:hover { background: var(--bm-white); border-color: var(--bm-line); color: var(--bm-graphite); }
.cal-type:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.cal-type.on { background: var(--bm-white); border-color: var(--bm-graphite); color: var(--bm-graphite); font-weight: 600; box-shadow: inset 0 -2px 0 var(--bm-orange); }
.cal-type.on .i { width: 12px; height: 12px; flex-basis: 12px; margin-left: 1px; color: var(--ink-3); stroke-width: 2.2; }
.cal-type.on:hover .i { color: var(--bm-graphite); }
.cal-type.zero b { color: #A3AEAA; font-weight: 600; }
.cal-legend.filtered .cal-type:not(.on) { opacity: .6; }
.cal-legend.filtered .cal-type:not(.on):hover, .cal-legend.filtered .cal-type:not(.on):focus-visible { opacity: 1; }
.cal-legend .cal-toggle { margin-left: auto; }
.cal-legend .cal-toggle::before { display: none; }

/* месяц */
.cal-month { border: 1px solid var(--bm-line); border-radius: var(--radius); overflow: hidden; }
.cal-wd, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { background: var(--bm-paper); border-bottom: 1px solid var(--bm-line); }
.cal-wd span { padding: 7px 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.cal-week + .cal-week { border-top: 1px solid var(--bm-line); }
.cal-cell { position: relative; min-width: 0; min-height: 118px; padding: 6px 6px 8px; overflow: hidden; }
.cal-cell + .cal-cell { border-left: 1px solid var(--bm-line); }
.cal-cell.out { background: #FAFAFB; }
.cal-cell.out .cal-num { color: #A3AEAA; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r-4); font-size: var(--fs-base); font-weight: 800; }
.cal-num:hover, .cal-num:focus-visible { background: var(--bm-paper); }
.cal-cell.today .cal-num { background: var(--bm-orange); color: var(--bm-graphite); }
.cal-chips { display: grid; gap: 2px; margin: 4px 0 0; padding: 0; list-style: none; min-width: 0; }
.cal-chips li { min-width: 0; }
.cal-chip { display: block; overflow: hidden; padding: 2px 6px; border-left: 3px solid var(--cat); background: var(--bm-paper); font-size: var(--fs-xs); line-height: 1.35;
  text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover, .cal-chip:focus-visible { background: #ECEEEF; }
.cal-chip b { font-weight: 800; }
.cal-chip.done, .cal-card.done, .cal-item.done { opacity: 0.55; }
.cal-chip.done { text-decoration: line-through; }
.cal-chip.late b, .cal-card.late .cal-card-time { color: var(--bm-danger); }
.cal-more { display: block; padding: 1px 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.cal-dots { display: none; }

/* неделя */
.cal-weekview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--bm-line); border-radius: var(--radius); overflow: hidden; }
.cal-col { min-width: 0; min-height: 320px; padding: 0 6px 10px; }
.cal-col + .cal-col { border-left: 1px solid var(--bm-line); }
.cal-col.weekend { background: #FAFAFB; }
.cal-colhead { display: flex; align-items: baseline; gap: 4px; margin: 0 -6px 8px; padding: 8px 10px; border-bottom: 1px solid var(--bm-line); background: var(--bm-paper); font-size: var(--fs-sm); color: var(--ink-3); }
.cal-colhead b { font-size: var(--fs-md); font-weight: 800; color: var(--bm-graphite); }
.cal-colhead .count { margin-left: auto; height: 20px; min-width: 20px; background: var(--bm-white); box-shadow: inset 0 0 0 1px var(--bm-line); }
.cal-col.today .cal-colhead { box-shadow: inset 0 3px 0 var(--bm-orange); }
.cal-col.today .cal-colhead b { color: var(--bm-orange); }
.cal-card { display: grid; gap: 1px; margin: 0 0 6px; padding: 6px 8px; border-left: 3px solid var(--cat); background: var(--bm-paper); }
.cal-card:hover, .cal-card:focus-visible { background: #ECEEEF; }
.cal-card-time { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); }
.cal-card-type { font-size: var(--fs-sm); font-weight: 600; }
.cal-card-title { display: -webkit-box; overflow: hidden; font-size: var(--fs-sm); color: var(--ink-2); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-free { margin: 4px 4px 0; font-size: var(--fs-sm); color: #A3AEAA; }

/* день — подробный список по времени */
.cal-day { display: grid; gap: 10px; }
.cal-item { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; padding: 14px 16px;
  border: 1px solid var(--bm-line); border-left: 4px solid var(--cat); border-radius: var(--radius); background: var(--bm-white); }
.cal-item-time { display: grid; }
.cal-item-time b { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; }
.cal-item-time span { font-size: var(--fs-sm); color: var(--ink-3); }
.cal-item-type { font-size: var(--fs-base); font-weight: 800; }
.cal-item-title { margin: 2px 0 6px; font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.cal-item-title a:hover { color: var(--bm-orange); }
.cal-meta { display: grid; gap: 3px; margin: 0; font-size: var(--fs-base); }
.cal-meta div { display: flex; gap: 8px; min-width: 0; }
.cal-meta dt { flex: 0 0 76px; color: var(--ink-3); }
.cal-meta dd { min-width: 0; margin: 0; }
.cal-meta a { border-bottom: 1px solid var(--bm-line); }
.cal-meta a:hover { border-bottom-color: var(--bm-orange); }
.cal-item-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cal-status { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-4); font-size: var(--fs-xs); font-weight: 600; background: var(--bm-paper); color: var(--ink-3); }
.cal-status.s-overdue { background: var(--bm-danger); color: var(--bm-white); }
.cal-status.s-done { background: var(--bm-paper); color: var(--ink-3); }
.cal-status.s-confirmed { box-shadow: inset 0 0 0 1px var(--bm-sage); background: none; }
.cal-empty { padding: 18px 0; }
.nowrap { white-space: nowrap; }

/* страница задачи */
.task-sheet { max-width: 760px; border-left: 4px solid var(--cat); }
.task-sheet .kv { grid-template-columns: 150px minmax(0, 1fr); }
.task-msg { margin-top: 14px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.task-actions form { margin: 0; }

@media (max-width: 1000px) {
  .cal-weekview { grid-template-columns: 1fr; }
  .cal-col { min-height: 0; padding-bottom: 6px; }
  .cal-col + .cal-col { border-left: 0; border-top: 1px solid var(--bm-line); }
  .cal-card { grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; }
  .cal-card-time { grid-row: span 2; font-size: var(--fs-sm); }
}
@media (max-width: 760px) {
  .cal-title { flex-basis: 100%; margin: 4px 0 0; font-size: var(--fs-lg); }
  .cal-cell { min-height: 56px; padding: 4px 2px 6px; text-align: center; }
  .cal-num { font-size: var(--fs-sm); min-width: 24px; height: 24px; }
  .cal-num::after { content: ""; position: absolute; inset: 0; }  /* на телефоне вся клетка открывает день */
  .cal-chips { display: none; }
  .cal-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cat); }
  .cal-wd span { padding: 6px 0; text-align: center; }
  .cal-item { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; }
  .cal-item-time b { font-size: var(--fs-lg); }
  .cal-item-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cal-meta dt { flex-basis: 64px; }
}

/* «Главная»: сегодняшняя дата и текущее время — графитовая плашка, время оранжевым */

.home-clock { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--bm-orange); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  
   .home-clock { font-size: var(--fs-2xl); }
  
}

/* ---------- переключатель панели: луна — сделать тёмной, солнце — вернуть светлую ---------- */
.brand-row { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--bm-line); border-radius: var(--r-4);
  background: var(--bm-white); color: var(--bm-graphite); cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--bm-orange); }
.theme-toggle .i { width: 16px; height: 16px; flex-basis: 16px; }
.theme-toggle .t-sun { display: none; }
.nav-dark .theme-toggle .t-sun { display: inline-flex; }
.nav-dark .theme-toggle .t-moon { display: none; }
.sidenav, .bottomnav { transition: background-color .25s ease, border-color .25s ease; }
/* тёмная панель — фирменный графит, высветленный: не чёрная, а графитовая; активный пункт — оранжевая полоса, как в светлой */
.nav-dark .sidenav { background: #383E43; border-right-color: #383E43; }
.nav-dark .sidenav .brand { color: #F4F5F6; }
.nav-dark .sidenav a, .nav-dark .nav-group-btn { color: #E1E5E7; }
.nav-dark .nav-group-btn:hover { background: #424950; }
.nav-dark .sidenav a:hover { background: #424950; }
.nav-dark .sidenav a.active { background: #4A5258; color: var(--bm-white); }
.nav-dark .sidenav .sep { background: #4E565C; }
.nav-dark .sidenav .theme-toggle { background: #424950; border-color: #59626A; color: var(--bm-amber); }
.nav-dark .bottomnav { background: #383E43; border-top-color: #383E43; }
.nav-dark .bottomnav a { color: #C3CAC7; }
.nav-dark .bottomnav a.active, .nav-dark .bottomnav a.home { color: var(--bm-white); }
.nav-dark .bottomnav .ico { border-color: #59626A; }
.nav-dark .topbar .theme-toggle { color: var(--bm-orange); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- верхняя строка: умный поиск, колокольчик, профиль ---------- */
.topbar { height: var(--topbar-h); min-height: var(--topbar-h); }
.gsearch { position: relative; display: flex; align-items: center; flex: 1 1 180px; min-width: 140px; max-width: 480px; }
.gsearch > .i { position: absolute; z-index: 1; left: 14px; width: 18px; height: 18px; flex-basis: 18px; color: var(--ink-3); pointer-events: none; }
.gsearch .gsearch-input { width: 100%; height: 36px; min-height: 0; padding: 0 52px 0 40px; border: 1px solid transparent; border-radius: var(--r-2); background: var(--bm-paper);
  font: inherit; font-size: var(--fs-base); color: var(--bm-graphite); transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.gsearch-input::placeholder { color: var(--ink-4); }
.gsearch-input:hover { border-color: var(--bm-line); }
.gsearch-input:focus { outline: none; background: var(--bm-white); border-color: var(--bm-orange); box-shadow: 0 0 0 4px rgba(245, 146, 30, .14); }
.gsearch-input::-webkit-search-cancel-button { display: none; }
.topbar .gsearch-input { background: rgba(255, 255, 255, .5); border-color: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.topbar .gsearch-input:hover { background: rgba(255, 255, 255, .66); border-color: var(--bm-white); }
.topbar .gsearch-input:focus { background: var(--bm-white); border-color: var(--bm-orange); }
.gsearch-kbd { position: absolute; right: 12px; padding: 3px 6px; border: 1px solid var(--bm-line); border-radius: var(--r-1); background: var(--bm-white);
  font: 600 11px/1.2 var(--font); color: var(--ink-3); pointer-events: none; }
.gsearch-close { display: none; }
.gsearch.htmx-request > .i { color: var(--bm-orange); }
.gsearch-dd, .pop-panel { position: absolute; z-index: 60; background: var(--bm-white); border: 1px solid var(--bm-line); border-radius: var(--r-3);
  box-shadow: 0 22px 48px -18px rgba(35, 39, 43, .32), 0 2px 6px rgba(35, 39, 43, .05);
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top; pointer-events: none; visibility: hidden;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s; }
.gsearch-dd { top: calc(100% + 8px); left: 0; right: 0; max-height: min(72vh, 600px); overflow: auto; padding: 6px; overscroll-behavior: contain; }
.gsearch.open .gsearch-dd, .pop.open .pop-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.dd-title { padding: 9px 10px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; color: var(--ink-3); }
.dd-group + .dd-group { margin-top: 2px; border-top: 1px solid var(--surface-2); }
.dd-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: var(--r-2); transition: background-color .12s ease; }
.dd-item:hover, .dd-item.sel { background: var(--bm-paper); }
.dd-item.sel { box-shadow: inset 3px 0 0 var(--bm-orange); }
.dd-item.done { opacity: .6; }
.dd-photo { width: 44px; height: 32px; flex: none; border-radius: var(--r-1); object-fit: cover; background: var(--bm-paper); }
.dd-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-1); background: var(--bm-paper); }
.dd-ico .i { stroke: var(--bm-orange); }
.dd-text { display: grid; min-width: 0; }
.dd-text b, .dd-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-text b { font-size: var(--fs-base); font-weight: 600; }
.dd-text small { font-size: var(--fs-sm); color: var(--ink-3); }
mark { padding: 0 1px; border-radius: 3px; background: rgba(245, 146, 30, .24); color: inherit; }
.dd-all { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding: 10px; border-top: 1px solid var(--bm-line);
  border-radius: 0 0 var(--r-2) var(--r-2); font-size: var(--fs-base); font-weight: 600; }
.dd-all.sel, .dd-all:hover { background: var(--bm-paper); }
.dd-all kbd { padding: 2px 6px; border: 1px solid var(--bm-line); border-radius: var(--r-1); font: 600 11px var(--font); color: var(--ink-3); }
.dd-hint { padding: 14px 12px; font-size: var(--fs-base); line-height: 1.5; color: var(--ink-3); }

.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-4);
  background: none; color: var(--bm-graphite); cursor: pointer; transition: background-color .15s ease; }
.top-btn:hover, .top-btn:focus-visible, .pop.open > .top-btn { background: var(--bm-paper); }
.topbar .top-btn:hover, .topbar .top-btn:focus-visible, .topbar .pop.open > .top-btn,
.topbar .me:hover, .topbar .me:focus-visible, .topbar .pop.open > .me { background: rgba(255, 255, 255, .78); }
.top-btn .i { width: 20px; height: 20px; flex-basis: 20px; }
.top-search { display: none; }
.bell-badge { display: none; }
.bell-badge.on { position: absolute; top: 3px; right: 2px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border: 2px solid var(--bm-white); border-radius: var(--r-4); background: var(--bm-orange); font-size: 10.5px; font-weight: 800; color: var(--bm-graphite);
  animation: badge-in .35s ease; }
@keyframes badge-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { position: relative; }
.pop-panel { top: calc(100% + 8px); right: 0; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 84px); overflow: auto;
  overscroll-behavior: contain; padding: 6px; }
.pop-loading { padding: 16px; font-size: var(--fs-base); color: var(--ink-3); }
.pop-head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px 10px; }
.pop-head b { font-size: var(--fs-md); font-weight: 800; }
.pop-sec { padding: 10px 10px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.pop-more { display: block; padding: 2px 10px 6px; font-size: var(--fs-sm); font-weight: 600; }
.pop-foot { display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--bm-line); font-size: var(--fs-base); font-weight: 600; text-align: center; }
.pop-foot:hover { color: var(--bm-orange); }
.bell-key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 4px 4px; }
.bell-tile { display: grid; gap: 2px; padding: 10px; border-radius: var(--r-2); background: var(--bm-paper); transition: background-color .12s ease; }
.bell-tile:hover { background: #ECEEEF; }
.bell-tile b { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
.bell-tile.hot b { color: #B35A00; }
.bell-tile span { font-size: var(--fs-xs); line-height: 1.3; color: var(--ink-2); }
.bell-list { margin: 0; padding: 0; list-style: none; }
.bell-list a, .bell-list .bell-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-radius: var(--r-2); }
.bell-list a:hover { background: var(--bm-paper); }
.bell-list span:last-child { display: grid; min-width: 0; }
.bell-list b { font-size: var(--fs-base); font-weight: 600; }
.bell-list small { overflow: hidden; font-size: var(--fs-sm); color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.bell-list em { font-size: var(--fs-xs); font-style: normal; color: var(--ink-3); }
.ev-dot { flex: none; width: 8px; height: 8px; margin: 6px 4px 0; border-radius: 50%; background: var(--bm-sage); }
.ev-call { background: var(--bm-graphite); } .ev-message { background: #2AABEE; } .ev-meeting { background: var(--bm-amber); }
.ev-showing { background: var(--bm-orange); } .ev-stage_change { background: #B35A00; }

.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; border-radius: var(--r-4); background: none; font: inherit;
  color: var(--bm-graphite); cursor: pointer; transition: background-color .15s ease; }
.me:hover, .me:focus-visible, .pop.open > .me { background: var(--bm-paper); }
.me .i { width: 16px; height: 16px; flex-basis: 16px; color: var(--ink-3); transition: transform .2s ease; }
.pop.open > .me .i { transform: rotate(180deg); }
.me-ava { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
.me-ava.lg { width: 48px; height: 48px; }
.me-ini { display: grid; place-items: center; background: var(--bm-graphite); color: var(--bm-white); font-size: var(--fs-base); font-weight: 800; box-shadow: inset 0 -3px 0 var(--bm-orange); }
.me-ava.lg.me-ini { font-size: var(--fs-md); }
.me-text { display: grid; text-align: left; line-height: 1.2; }
.me-text b { font-size: var(--fs-base); font-weight: 800; }
.me-text small { font-size: var(--fs-xs); color: var(--ink-3); }
.me-panel { width: 280px; }
.me-card { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 10px 10px 12px; border-bottom: 1px solid var(--bm-line); }
.me-card div { display: grid; min-width: 0; }
.me-card small { overflow: hidden; font-size: var(--fs-sm); color: var(--ink-3); text-overflow: ellipsis; }
.me-panel a, .me-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-2);
  background: none; font: inherit; font-size: var(--fs-base); color: var(--bm-graphite); text-align: left; cursor: pointer; }
.me-panel a:hover, .me-panel button:hover, .me-panel a:focus-visible, .me-panel button:focus-visible { background: var(--bm-paper); }
.me-panel .i { stroke: var(--bm-orange); }
.me-panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--bm-line); }

/* символы видов дел */
.ki { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-1); }
.ki .i { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 1.9; }
.ki-task { background: #E5EBE9; color: #4C5C57; }
.ki-meeting { background: var(--bm-graphite); color: var(--bm-white); }
.ki-zoom { background: var(--bm-amber); color: var(--bm-graphite); }
.ki-showing { background: var(--bm-orange); color: var(--bm-graphite); }
.ki-deposit { background: var(--bm-sage); color: var(--bm-white); }
.ki-deal { background: var(--bm-graphite); color: var(--bm-orange); }

@media (max-width: 1023px) {
  .topbar { --topbar-h: 56px; height: auto; min-height: var(--topbar-h); gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .top-title { font-size: var(--fs-lg); max-width: calc(100vw - 196px); }
  .gsearch { display: none; }
  .top-search { display: grid; }
  .me-text, .me > .i { display: none; }
  .me { padding: 2px; }
  .gsearch-open .gsearch { position: fixed; inset: 0 0 auto 0; z-index: 80; display: flex; flex-wrap: wrap; max-width: none; padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top)); background: var(--bm-white); border-bottom: 1px solid var(--bm-line); }
  .gsearch-open .gsearch > .i { top: calc(max(10px, env(safe-area-inset-top)) + 12px); left: 26px; }
  .gsearch-open .gsearch .gsearch-input { flex: 1; width: auto; padding-right: 12px; font-size: var(--fs-md); }
  .gsearch-open .gsearch-kbd { display: none; }
  .gsearch-open .gsearch-close { display: grid; place-items: center; width: 42px; height: 42px; margin-left: 6px; border: 0; border-radius: var(--r-2);
    background: var(--bm-paper); font-size: var(--fs-xl); color: var(--bm-graphite); }
  .gsearch-open .gsearch-dd { position: static; flex-basis: 100%; max-height: calc(100vh - 90px); margin-top: 8px; border: 0; box-shadow: none; }
  .gsearch-open body { overflow: hidden; }
}

.obj-search { position: relative; display: flex; align-items: center; max-width: 520px; margin: 0 0 12px; }
.obj-search .i { position: absolute; left: 12px; color: var(--ink-3); }
.obj-search input[type=search] { padding-left: 38px; }

.ava-form { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 8px; }
.ava-pick { display: contents; }
.ava-open { display: block; border-radius: 50%; line-height: 0; }
.ava-open:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 3px; }
.ava-form .me-ava { width: 64px; height: 64px; font-size: var(--fs-xl); }
.ava-form input[type=file] { max-width: 100%; font-size: var(--fs-md); }
.ava-crop { flex: 1 1 100%; max-width: 360px; }
.ava-canvas { display: block; width: min(100%, 360px); height: auto; border-radius: var(--r-2); background: #1c2024; touch-action: none; cursor: grab; }
.ava-canvas:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.ava-canvas.moving { cursor: grabbing; }
.ava-zoom { display: flex; gap: 8px; margin-top: 8px; }
.ava-zoom .btn { min-width: var(--tap); min-height: var(--tap); padding: 0; font-size: var(--fs-xl); line-height: 1; }

.ki-sm { width: 20px; height: 20px; border-radius: var(--r-1); }
.ki-sm .i { width: 12px; height: 12px; flex-basis: 12px; stroke-width: 2.1; }
.ki-lg { width: 40px; height: 40px; border-radius: var(--r-2); }
.ki-lg .i { width: 22px; height: 22px; flex-basis: 22px; }
.row > .ki { align-self: center; }
.cal-chip { display: flex; align-items: center; gap: 5px; }
.cal-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip .ki-sm { width: 16px; height: 16px; border-radius: 4px; }
.cal-chip .ki-sm .i { width: 10px; height: 10px; flex-basis: 10px; }
.cal-card-type, .cal-item-type { display: flex; align-items: center; gap: 6px; }
.task-h { display: flex; align-items: center; gap: 12px; }
.c-deposit { --cat: var(--bm-sage); } .c-deal { --cat: #B35A00; }

/* ---------- «холст» «Главной» и «Календаря»: серый фон, белые карточки — блоки не сливаются ---------- */
.main.canvas { background: #F1F3F4; max-width: none; }
.content:has(> .main.canvas), .app:has(.main.canvas) { background: #F1F3F4; }
.main.canvas > * { max-width: 1384px; margin-left: auto; margin-right: auto; }
.main.canvas .kpi{ border-color: var(--bm-line); border-radius: var(--r-3); background: var(--bm-white);
  box-shadow: 0 1px 2px rgba(35, 39, 43, .04), 0 6px 18px -14px rgba(35, 39, 43, .18); }

.main.canvas .warn { background: var(--bm-white); border-radius: 0 var(--r-2) var(--r-2) 0; }

.sec-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 2px; border-radius: var(--r-1); background: var(--surface-2); color: var(--ink-2); }
.sec-ico .i { width: 16px; height: 16px; flex-basis: 16px; }

.plan-scroll { transition: max-height .35s cubic-bezier(.2, .7, .2, 1); }
.main.canvas .cal-month, .main.canvas .cal-weekview, .main.canvas .cal-item { background: var(--bm-white); border-color: var(--bm-line);
  box-shadow: 0 1px 2px rgba(35, 39, 43, .04); }
.main.canvas .cal-month, .main.canvas .cal-weekview { border-radius: var(--r-3); }
.main.canvas .cal-views { border-color: var(--bm-line); }
.main.canvas .cal-wd, .main.canvas .cal-colhead { background: #FAFBFB; }
.cal-item { transition: box-shadow .15s ease, transform .15s ease; }
.cal-item:hover { box-shadow: 0 10px 24px -16px rgba(35, 39, 43, .35); }
.cal-card, .cal-chip { transition: background-color .12s ease; }

/* мягкое появление страницы при переходе и нажатие кнопок */
/* Появление страницы без анимации: каждый переход начинался с 220 мс пустого экрана и ощущался как задержка.
   Движение остаётся только у ответов на действие — диалоги, всплывающие панели. */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease; }
.btn:active { transform: translateY(1px); }

/* предпросмотр дела при наведении (календарь) */
.preview-card { position: fixed; z-index: 90; width: 300px; padding: 12px 14px; border: 1px solid var(--bm-line); border-radius: var(--r-3); background: var(--bm-white);
  box-shadow: 0 22px 48px -18px rgba(35, 39, 43, .35); font-size: var(--fs-base); pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease; }
.preview-card.on { opacity: 1; transform: none; }
.pv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 800; }
.pv-title { margin: 0 0 6px; font-weight: 600; line-height: 1.35; }
.pv-row { display: flex; gap: 8px; color: var(--ink-2); }
.pv-row dt { flex: 0 0 62px; color: var(--ink-3); }
.pv-row dd { margin: 0; min-width: 0; }
.preview-card dl { display: grid; gap: 2px; margin: 0; }

/* ---------- фото листаются в плитке ---------- */
.slides { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.slides::-webkit-scrollbar { display: none; }
.slides img { position: relative; inset: auto; flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start;
  scroll-snap-stop: always; user-select: none; }
.slide-btn { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--bm-graphite); font-size: var(--fs-xl); font-weight: 600; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(35, 39, 43, .18); opacity: 0; transform: scale(.9); transition: opacity .15s ease, transform .15s ease; }
.slide-btn.prev { left: 8px; } .slide-btn.next { right: 8px; }
.slide-btn:focus-visible, .ocard:hover .slide-btn, .ocard:focus-visible .slide-btn, .seller-object:hover .slide-btn { opacity: 1; transform: none; }
.slide-btn:hover { background: var(--bm-white); color: var(--bm-orange); }
.slide-dots { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: flex; gap: 4px; padding: 4px 6px; border-radius: var(--r-4);
  background: rgba(35, 39, 43, .45); pointer-events: none; }
.slide-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: background-color .15s ease, transform .15s ease; }
.slide-dots i.on { background: var(--bm-white); transform: scale(1.3); }
.ocard { transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease; }
.ocard:hover { box-shadow: 0 14px 30px -20px rgba(35, 39, 43, .45); transform: translateY(-2px); }
@media (hover: none) { .slide-btn { display: none; } }
@media (max-width: 1023px) { .ocard .slide-dots { bottom: 6px; right: 6px; } }

/* ---------- «Главная» плотнее: всё на одном экране ---------- */
.main.canvas { padding-top: 12px; padding-bottom: 0; }
@media (max-width: 1023px) { .main.canvas { padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); } }

 .main.canvas .home-clock { font-size: var(--fs-2xl); }

.main.canvas .kpi { margin-bottom: 10px; }

.main.canvas .kpi-c { padding: 6px 12px 7px; gap: 1px 6px; }
.main.canvas .kpi-v b { font-size: var(--fs-xl); }
.main.canvas .kpi-bar { margin-top: 1px; }
.main.canvas .warn { margin: 0 0 10px; padding: 4px 12px; font-size: var(--fs-sm); }

.main.canvas .sec-ico { width: 24px; height: 24px; border-radius: var(--r-1); }
.main.canvas .sec-ico .i { width: 14px; height: 14px; flex-basis: 14px; }
/* на широком экране — две колонки без пустот: разделы укладываются друг под друга, высоты не выравниваются */

/* =========================================================================================
   «Главная» — рабочий стол брокера: план, дела сегодня и шкала дня, воронка, действия, правая колонка
   ========================================================================================= */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.home-main { display: grid; gap: 14px; min-width: 0; }
.home-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.home-rail { display: grid; gap: 12px; min-width: 0; }
.hcard { min-width: 0; border: 1px solid #E5E8EA; border-radius: var(--r-3); background: var(--bm-white);
  box-shadow: 0 1px 2px rgba(35, 39, 43, .04), 0 8px 24px -20px rgba(35, 39, 43, .22); }
.hc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px 8px; }
.hc-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-md); font-weight: 800; white-space: nowrap; }
.hc-sub { font-size: var(--fs-sm); color: var(--ink-3); }
.hc-spacer { flex: 1; }
.hc-link { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--bm-orange); }
.hc-link:hover { color: var(--bm-graphite); }
.hc-empty { margin: 0; padding: 12px 16px 14px; font-size: var(--fs-base); color: var(--ink-3); }
.home .count { height: 20px; min-width: 22px; padding: 0 6px; font-size: var(--fs-xs); }

/* план месяца: шкала выполнения и плитки с мини-графиком по рабочим дням */
.pmeter { display: block; width: 180px; height: 8px; overflow: hidden; border-radius: var(--r-4); }
.pmeter svg { display: block; width: 100%; height: 100%; }
.pm-track { fill: #ECEEF0; } .pm-fill { fill: var(--bm-orange); } .pm-time { stroke: var(--bm-graphite); stroke-width: 2; }
.pm-pct { font-size: var(--fs-base); font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 4px 16px 14px; list-style: none; }
.stat { display: grid; gap: 4px; min-width: 0; padding: 10px 12px 8px; border: 1px solid var(--surface-2); border-radius: var(--r-2); transition: border-color .15s ease, box-shadow .15s ease; }
.stat:hover { border-color: #E0E3E5; box-shadow: 0 6px 16px -14px rgba(35, 39, 43, .4); }
.stat-l { overflow: hidden; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.stat-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.stat-v b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat-v small { margin-left: -4px; font-size: var(--fs-base); font-weight: 600; color: var(--ink-4); }
.delta { margin-left: auto; padding: 1px 6px; border-radius: var(--r-1); background: var(--bm-paper); font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); white-space: nowrap; }
.delta.up { background: #E6F2EA; color: #2F6346; }
.delta.down { background: #FBE7E3; color: #A3311F; }
.spark { display: block; width: 100%; height: 20px; margin-top: 2px; }
.spark .on { fill: #B9C3BF; } .spark .zero { fill: #E2E6E8; } .spark .future { fill: #F1F3F4; } .spark .today { fill: var(--bm-orange); }
.stat.s-bad { border-color: #F3D5CE; } .stat.s-mid { border-color: #F2E3B6; }

/* сегодня: дела по времени с фильтром по виду */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: var(--r-4); background: #F1F3F4; }
.seg button { padding: 4px 10px; border: 0; border-radius: var(--r-4); background: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background-color .15s ease, color .15s ease; }
.seg button span { color: var(--ink-4); }
.seg button[aria-selected="true"] { background: var(--bm-graphite); color: var(--bm-white); }
.seg button[aria-selected="true"] span { color: #C9D0CD; }
.agenda { max-height: 360px; overflow-y: auto; scrollbar-width: thin; }
.ag-row { display: grid; grid-template-columns: 20px 44px minmax(0, 1fr) auto 28px 18px; align-items: center; gap: 10px; padding: 8px 16px;
  border-top: 1px solid #F0F2F3; transition: background-color .12s ease; }
.ag-row:hover { background: #FAFBFB; }
.ag-row.hidden { display: none; }
.ag-check { display: grid; place-items: center; width: 18px; height: 18px; border: 2px solid #C9D0CD; border-radius: 50%; font-size: var(--fs-xs); font-weight: 800; color: var(--bm-white);
  transition: border-color .15s ease, background-color .15s ease; }
a.ag-check:hover { border-color: var(--bm-orange); background: #FFF4E8; }
.ag-check.on { border-color: var(--bm-orange); background: var(--bm-orange); color: var(--bm-graphite); }
.ag-time { font-size: var(--fs-base); font-weight: 800; font-variant-numeric: tabular-nums; }
.ag-time.late { color: var(--bm-danger); }
.ag-main { display: grid; min-width: 0; }
.ag-main b, .ag-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-main b { font-size: var(--fs-base); font-weight: 600; }
.ag-main small { font-size: var(--fs-sm); color: var(--ink-3); }
.ag-main:hover b { color: #B35A00; }
.ag-row.done .ag-main b { text-decoration: line-through; color: var(--ink-4); }
.ag-more { display: grid; place-items: center; height: 24px; border-radius: var(--r-1); font-size: var(--fs-md); color: var(--ink-4); }
.ag-more:hover { background: #F1F3F4; color: var(--bm-graphite); }
.pill { padding: 2px 8px; border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.p-call { background: var(--surface-2); color: var(--bm-graphite); } .p-meeting { background: var(--bm-graphite); color: var(--bm-white); }
.p-showing { background: #FDEBD6; color: #8A4A00; } .p-message { background: #E3F2FB; color: #1C6A93; } .p-task { background: #EEF2F0; color: #3E5550; }
.ava { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.ava.t0 { background: var(--bm-graphite); color: var(--bm-white); } .ava.t1 { background: #FDEBD6; color: #8A4A00; } .ava.t2 { background: #E2EAE7; color: #3E5550; }
.ava.t3 { background: #F7EFD3; color: #6E5406; } .ava.t4 { background: #ECE6DE; color: #5E4A38; } .ava.t5 { background: #DFE7EE; color: #34506A; }

/* шкала дня: полчаса — строка, дело — блок на своё время */
.tl { position: relative; display: grid; grid-template-columns: 40px 1fr 1fr; grid-template-rows: repeat(24, 15px); padding: 6px 14px 14px 10px; }
.tl-h { grid-column: 1; align-self: start; transform: translateY(-6px); font-size: 10.5px; font-weight: 600; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.tl-line { grid-column: 2 / 4; align-self: start; border-top: 1px solid var(--surface-2); }
.tl-now { position: relative; z-index: 3; grid-column: 2 / 4; align-self: center; border-top: 2px solid var(--bm-orange); }
.tl-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bm-orange); }
.tl-ev { --cat: var(--bm-sage); position: relative; z-index: 2; display: grid; align-content: start; min-width: 0; margin: 1px 2px; padding: 2px 6px; overflow: hidden;
  border-left: 3px solid var(--cat); border-radius: var(--r-1); background: #F3F5F4; font-size: var(--fs-xs); line-height: 13px; transition: transform .12s ease, box-shadow .12s ease; }
.tl-ev:hover { z-index: 4; box-shadow: 0 8px 18px -12px rgba(35, 39, 43, .5); }
.tl-ev b { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tl-ev span { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.tl-ev.solo { grid-column: 2 / 4; } .tl-ev.l1 { grid-column: 2; } .tl-ev.l2 { grid-column: 3; }
.tl-ev.c-showing { background: #FEF1E2; } .tl-ev.c-meeting { background: var(--surface-2); } .tl-ev.c-zoom { background: #FBF4DC; }
.tl-ev.done { opacity: .5; }
.r1 { grid-row-start: 1; }
.r2 { grid-row-start: 2; }
.r3 { grid-row-start: 3; }
.r4 { grid-row-start: 4; }
.r5 { grid-row-start: 5; }
.r6 { grid-row-start: 6; }
.r7 { grid-row-start: 7; }
.r8 { grid-row-start: 8; }
.r9 { grid-row-start: 9; }
.r10 { grid-row-start: 10; }
.r11 { grid-row-start: 11; }
.r12 { grid-row-start: 12; }
.r13 { grid-row-start: 13; }
.r14 { grid-row-start: 14; }
.r15 { grid-row-start: 15; }
.r16 { grid-row-start: 16; }
.r17 { grid-row-start: 17; }
.r18 { grid-row-start: 18; }
.r19 { grid-row-start: 19; }
.r20 { grid-row-start: 20; }
.r21 { grid-row-start: 21; }
.r22 { grid-row-start: 22; }
.r23 { grid-row-start: 23; }
.r24 { grid-row-start: 24; }
.s1 { grid-row-end: span 1; }
.s2 { grid-row-end: span 2; }
.s3 { grid-row-end: span 3; }
.s4 { grid-row-end: span 4; }

/* воронка: этапы одним оттенком, насыщенность растёт к сделке */
.fun { display: flex; gap: 3px; margin: 0; padding: 4px 16px 16px; list-style: none; }
.fun.hidden { display: none; }
.fs { position: relative; display: grid; flex: 1; align-content: start; gap: 2px; min-width: 0; padding: 10px 10px 10px 18px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.fs:first-child { padding-left: 12px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: var(--r-2) 0 0 var(--r-2); }
.fs:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); border-radius: 0 var(--r-2) var(--r-2) 0; }
.fs span { overflow: hidden; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.fs b { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; }
.fs small { overflow: hidden; font-size: 10.5px; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.f0 { background: #FFF6EC; } .f1 { background: #FEEDD9; } .f2 { background: #FDE2C2; } .f3 { background: #FCD3A3; }
.f4 { background: #FAC07D; } .f5 { background: #F8AA54; } .f6 { background: var(--bm-orange); }

/* последние действия */
.act { margin: 0; padding: 0 0 8px; list-style: none; }
.act a, .act .act-row { display: grid; grid-template-columns: 10px max-content minmax(0, 1fr); align-items: start; gap: 8px; padding: 6px 16px; transition: background-color .12s ease; }
.act a:hover { background: #FAFBFB; }
.act .ev-dot { margin: 5px 0 0; }
.act time { display: flex; flex-direction: column; font-size: var(--fs-xs); line-height: calc(13px * 1.45); color: var(--ink-4); white-space: nowrap; font-variant-numeric: tabular-nums; }
.act time span + span { line-height: calc(12px * 1.45); }
.act-text { display: grid; min-width: 0; }
.act-text b, .act-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-text b { font-size: var(--fs-base); font-weight: 600; } .act-text small { font-size: var(--fs-sm); color: var(--ink-3); }

.sysbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #F6D7A9; border-radius: var(--r-2); background: #FFF8EC; font-size: var(--fs-base); }
.sysbar > span:nth-child(2) { flex: 1; }
.sysbar-ico .app-i { width: 22px; height: 22px; }

/* правая колонка: дата, главное действие, списки «что требует внимания» */
.rail-date { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.rail-date > .i { width: 18px; height: 18px; flex-basis: 18px; color: var(--bm-orange); }
.rail-date b { font-size: var(--fs-base); font-weight: 600; }
.rail-date .home-clock { margin-left: auto; font-size: var(--fs-xl); }
.btn-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--r-2); background: var(--bm-orange);
  color: var(--bm-graphite); font-size: var(--fs-md); font-weight: 800; transition: background-color .15s ease, transform .08s ease; }
.btn-cta:hover { background: #EC8710; } .btn-cta:active { transform: translateY(1px); }
.btn-cta .i { width: 18px; height: 18px; flex-basis: 18px; stroke-width: 2.4; }
.rl-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.rl-head h2 { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; margin: 0; overflow: hidden; font-size: var(--fs-base); font-weight: 800; white-space: nowrap; }
.rail-list.hot .rl-head h2::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--bm-orange); }
.rl-head .plan-all { font-size: var(--fs-sm); }
.rl-body.plan-scroll { max-height: 104px; }
.rl-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border-top: 1px solid #F0F2F3; transition: background-color .12s ease; }
.rl-row:hover { background: #FAFBFB; }
.rl-row form { display: contents; }
.rl-main { display: grid; flex: 1; min-width: 0; }
.rl-main b, .rl-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-main b { font-size: var(--fs-base); font-weight: 600; } .rl-main small { font-size: var(--fs-xs); color: var(--ink-3); }
.rl-main small .badge { min-height: 0; padding: 0 5px; border-width: 1px; font-size: 11px; line-height: 14px; vertical-align: 1px; }
.rl-main:hover b { color: #B35A00; }
.rl-meta { flex: none; font-size: var(--fs-xs); color: var(--ink-4); white-space: nowrap; }
.rl-late { display: inline-flex; flex: none; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.rl-late.soft { color: #87650A; }
.rl-late .i { width: 12px; height: 12px; flex-basis: 12px; }
.rl-btn { flex: none; padding: 3px 8px; border: 1px solid var(--bm-line); border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; transition: border-color .15s ease, color .15s ease; }
.rl-btn:hover { border-color: var(--bm-orange); color: #B35A00; }
.rl-x { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--r-1); background: none; font-size: var(--fs-md); color: var(--ink-4); cursor: pointer; }
.rl-x:hover { background: #F1F3F4; color: var(--bm-graphite); }
.rl-row .ava { width: 28px; height: 28px; }

@media (max-width: 1279px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home-rail { display: contents; }
  .home-rail > .rail-date { order: -2; } .home-rail > .btn-cta, .home-rail > .add-pop { order: -1; }
  .home-rail > .rail-list { order: 1; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .home-row { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-head .pmeter { width: 100%; order: 5; }
  .ag-row { grid-template-columns: 20px 40px minmax(0, 1fr) 18px; gap: 8px; padding: 8px 12px; }
  .ag-row .pill, .ag-row .ava { display: none; }
  .hday { display: none; }
  .fun { flex-wrap: wrap; }
  .fs, .fs:first-child, .fs:last-child { flex: 1 1 30%; clip-path: none; border-radius: var(--r-2); padding-left: 12px; }
}

/* ---------- «Главная»: уточнения плотности ---------- */
.home {
  --home-gap: 14px;
  --rail-w: 300px;
  /* правая колонка забирает место свёрнутого меню и пустые поля, но не расползается в широкую пустую ленту */
  --rail-max: 640px;
  --home-main-max: calc(1384px - var(--rail-w) - var(--home-gap));
  /* ширина левой колонки при открытом меню (220) и боковых полях .main (28 + 28) */
  --open-main: min(var(--home-main-max), calc(100vw - 276px - var(--rail-w) - var(--home-gap)));
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
}
.home-row { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.hplan .hc-head { flex-wrap: nowrap; }
.hplan .pmeter { flex: 1 1 100px; max-width: 220px; min-width: 60px; }
.hplan .kpi-norm { margin-left: auto; font-size: var(--fs-sm); white-space: nowrap; }
.hplan .hc-link, .hplan .hc-sub { white-space: nowrap; }
.htoday .hc-head { flex-wrap: nowrap; }
.htoday h2 a:hover { color: #B35A00; }
.seg button { padding: 3px 8px; font-size: var(--fs-xs); }
.htoday .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.agenda { max-height: 276px; }
.ag-row { padding: 7px 16px; }
.tl { grid-template-rows: repeat(24, 13px); padding-bottom: 10px; }
.tl-ev { font-size: 10.5px; line-height: 11px; padding: 1px 6px; }
.tl-ev span { display: none; }
.tl-ev.s2 span, .tl-ev.s3 span, .tl-ev.s4 span { display: block; }
.tl-more { position: absolute; right: 14px; bottom: 2px; font-size: 10.5px; color: var(--ink-4); }
.hfunnel .fun { padding-top: 6px; }
.fs b { font-size: var(--fs-2xl); }
.act a, .act .act-row { padding: 5px 16px; }
.rail-date { padding: 8px 14px; }
.btn-cta { height: 44px; }
.home-rail { gap: 10px; }
.rl-head { padding: 8px 14px 5px; }
.rl-body.plan-scroll { max-height: 96px; }
.rl-row { padding: 5px 14px; }

.seg button { flex: none; white-space: nowrap; }
.fun .fs:nth-child(1) { background: #FFF3E5; } .fun .fs:nth-child(2) { background: #FEE3C4; } .fun .fs:nth-child(3) { background: #FCCB93; }
.fun .fs:nth-child(4) { background: #F9AF5C; } .fun .fs:nth-child(5) { background: var(--bm-orange); }
.tl { grid-template-rows: repeat(22, 12px); }
.agenda { max-height: 264px; }

.tl { grid-template-rows: repeat(22, 14px); }
.tl-ev { padding: 0 6px; line-height: 12px; }
.agenda { max-height: 300px; }
.p-meeting { background: #E7EAEC; color: var(--bm-graphite); }
/* счётчики в левой панели (подгружаются вместе со счётчиком колокольчика) */
.nav-badge { display: none; margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-4); background: var(--bm-orange);
  font-size: var(--fs-xs); font-weight: 800; line-height: 20px; text-align: center; color: var(--bm-graphite); }
.nav-badge.on { display: inline-block; }
.nav-dark .nav-badge { color: var(--bm-graphite); }
.tl { padding: 2px 14px 4px 10px; }

/* «Главная» на узких экранах — после всех уточнений, чтобы перекрывать их */
@media (max-width: 1279px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home-rail { display: contents; }
  .home-rail > .rail-date { order: -2; } .home-rail > .btn-cta, .home-rail > .add-pop { order: -1; }
  .home-rail > .rail-list { order: 1; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .home-row { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hplan .hc-head { flex-wrap: wrap; }
  .hplan .pmeter { flex-basis: 100%; max-width: none; order: 5; }
  .hplan .kpi-norm { margin-left: 0; }
  .htoday .hc-head { flex-wrap: wrap; }
  .htoday .seg { max-width: 100%; }
  .ag-row { grid-template-columns: 20px 40px minmax(0, 1fr) 18px; gap: 8px; padding: 8px 12px; }
  .ag-row .pill, .ag-row .ava { display: none; }
  .hday { display: none; }
  .fun { flex-wrap: wrap; }
  .fun .fs, .fun .fs:first-child, .fun .fs:last-child { flex: 1 1 30%; clip-path: none; border-radius: var(--r-2); padding-left: 12px; }
  .rail-date .home-clock { font-size: var(--fs-lg); }
}

/* «Главная» на ноутбуке (высота до 860 px): ужимаем, чтобы всё осталось на одном экране */
@media (min-width: 1280px) and (max-width: 1439px) { .hplan .hc-sub { display: none; } }
@media (min-width: 1280px) and (max-height: 860px) {
  .home, .home-main, .home-row { --home-gap: 10px; gap: 10px; }
  .home-rail { gap: 8px; }
  .hc-head { padding: 9px 16px 6px; }
  .stats { gap: 8px; padding-bottom: 10px; }
  .stat { gap: 2px; padding: 7px 10px 6px; }
  .stat-v b { font-size: var(--fs-xl); }
  .spark { height: 14px; }
  .tl { grid-template-rows: repeat(22, 11px); }
  .tl-ev { line-height: 10px; font-size: 10px; }
  .agenda { max-height: 236px; }
  .ag-row { padding: 6px 16px; }
  .fs { padding-top: 7px; padding-bottom: 7px; }
  .fs b { font-size: var(--fs-xl); }
  .act a, .act .act-row { padding: 4px 16px; }
  .rail-date { padding: 6px 14px; }
  .btn-cta { height: 40px; }
  .rl-head { padding: 6px 14px 4px; }
  .rl-body.plan-scroll { max-height: 84px; }
  .rl-row { padding: 4px 14px; }
  .sysbar { padding: 5px 10px; }
}

/* ---------- сетка полей .of-grid / .of-field — форма «Брокеры на Авито»; фильтры списков — блок .lf ниже в файле ---------- */
.of-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.of-field { display: grid; gap: 3px; min-width: 0; margin: 0; padding: 0; border: 0; }
.of-field > span, .of-field > legend { padding: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-grid input, .of-grid select { min-height: 38px; padding: 7px 10px; border-width: 1px; border-radius: var(--r-1); }
.of-grid select { padding-right: 28px; background: var(--bm-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; text-overflow: ellipsis; }
.of-field select:has(option:checked:not([value=""])), .of-grid input:not(:placeholder-shown):not([type=search]) { border-color: var(--bm-graphite); }
.of-apply { grid-column: 1 / -1; min-height: 38px; }
@media (min-width: 720px) {
  .of-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .of-apply { grid-column: auto; }
}
@media (min-width: 1100px) { .of-grid input, .of-grid select { font-size: var(--fs-base); } }

/* «Список» объектов: таблица с ценой, прибылью, окупаемостью, городом, районом и метро; на телефоне — карточки */
.olist { border-top: 2px solid var(--bm-graphite); }
.ol-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) 136px minmax(104px, 1fr) minmax(100px, 1fr) 112px 128px 96px 92px; gap: 12px; align-items: center;
  padding: 9px 10px; border-bottom: 1px solid var(--bm-line); border-left: 3px solid transparent; font-size: var(--fs-base); transition: background-color .15s, border-color .15s; }
a.ol-row:hover, a.ol-row:focus-visible { background: var(--bm-paper); border-left-color: var(--bm-orange); outline: none; }
.ol-head { padding-top: 8px; padding-bottom: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--bm-sage); }
.ol-head .sort { color: var(--bm-sage); border-bottom: 1px dotted var(--bm-line); }
.ol-head .sort:hover, .ol-head .sort:focus-visible, .ol-head .sort.on { color: var(--bm-graphite); border-bottom-color: var(--bm-orange); }
.ol-obj { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ol-name { display: grid; gap: 1px; min-width: 0; }
.ol-name b { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ol-name small, .ol-loc small { font-size: var(--fs-sm); color: var(--bm-sage); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-loc { display: grid; min-width: 0; }
.ol-metro { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-status .badge { white-space: normal; min-height: 22px; padding: 2px 8px; line-height: 1.2; font-size: var(--fs-xs); }
.ol-num { text-align: right; white-space: nowrap; }
.ol-price { font-weight: 800; color: var(--bm-orange); }
.ol-step { font-size: var(--fs-sm); color: var(--bm-sage); white-space: nowrap; }
.ol-k { display: none; }
@media (max-width: 1099px) {
  .ol-row.ol-head { display: none; }
  .ol-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 8px; }
  .ol-obj { flex: 1 1 100%; align-items: flex-start; }
  .ol-status { flex: 1 1 100%; padding-left: 66px; }
  .ol-loc, .ol-metro, .ol-num { display: block; text-align: left; font-size: var(--fs-base); }
  .ol-loc small { display: inline; margin-left: 4px; }
  .ol-k { display: inline; margin-right: 4px; font-size: var(--fs-sm); color: var(--bm-sage); font-weight: 500; }
  .ol-loc, .ol-metro, .ol-num, .ol-step { padding-left: 0; }
  .ol-loc { margin-left: 66px; }
  .ol-step { margin-left: auto; }
}

/* «Назад» на внутренних экранах — одно место для всех: над заголовком слева */
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin: -6px 0 6px -6px; padding: 0 10px 0 4px; border-radius: var(--r-4);
  font-size: var(--fs-base); font-weight: 600; color: var(--ink-3); transition: background-color .15s, color .15s; }
.back-link .i { width: 18px; height: 18px; flex-basis: 18px; stroke-width: 2.2; }
.back-link:hover, .back-link:focus-visible { color: var(--bm-graphite); background: var(--bm-paper); }
.back-link:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.main.canvas .back-link:hover { background: var(--bm-white); }
@media (max-width: 767px) { .back-link { min-height: var(--tap); margin-top: -10px; margin-bottom: 2px; font-size: var(--fs-base); } }

/* голос: «Надиктовать», «Текстом / Голосом» под комментарием итога */
.btn-mic { display: inline-flex; align-items: center; gap: 6px; }
.btn-mic .i, .say-opt .i { width: 16px; height: 16px; flex-basis: 16px; }
.btn-mic.on, .say-opt.on[data-dictate-btn], .say-opt[aria-pressed="true"] { border-color: var(--bm-danger); color: var(--bm-danger); }
.btn-mic[aria-pressed="true"] .i, .say-opt[aria-pressed="true"] .i { animation: mic-pulse 1.1s ease-in-out infinite; }
@keyframes mic-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .btn-mic[aria-pressed="true"] .i, .say-opt[aria-pressed="true"] .i { animation: none; } }
.say-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -8px 0 14px; }
.say-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--bm-line); border-radius: var(--r-4);
  background: var(--bm-white); color: var(--ink-3); font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer; }
.say-opt:hover { color: var(--bm-graphite); border-color: var(--bm-graphite); }
.say-opt.on { color: var(--bm-graphite); border-color: var(--bm-orange); background: var(--bm-paper); }
.say-opt:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.say-hint { flex: 1 1 100%; }

/* файлы к итогу задачи */
.tfiles { margin: 4px 0 16px; padding: 12px 14px 2px; border: 0; border-left: 3px solid var(--bm-orange); background: var(--bm-paper); border-radius: 0 var(--radius) var(--radius) 0; }
.tfiles legend { float: left; display: flex; align-items: center; gap: 6px; padding: 0; margin-bottom: 2px; font-weight: 600; }
.tfiles legend .i { width: 16px; height: 16px; flex-basis: 16px; color: var(--bm-orange); }
.tfiles > p { clear: both; margin: 0 0 8px; }
.tfiles-row { display: grid; gap: 0 12px; }
@media (min-width: 720px) { .tfiles-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }

/* новая задача / файл: фраза, «Понял так», выбор клиента */
.tnew .page-head .muted { margin-top: 4px; max-width: 60ch; }
.tn-say { padding: 14px 14px 4px; margin-bottom: 16px; border: 1px solid var(--bm-line); border-radius: var(--radius); background: var(--bm-white); }
.tn-say .field { margin-bottom: 10px; }
.tn-say-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tn-hint { flex: 1 1 220px; }
.tn-understood { display: flex; align-items: baseline; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border-left: 3px solid var(--bm-orange); background: var(--bm-paper); font-size: var(--fs-base); }
.tn-understood .i { width: 14px; height: 14px; flex-basis: 14px; align-self: center; color: var(--bm-ok); }
.tn-block { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.tn-block > legend { padding: 0; margin-bottom: 8px; font-size: var(--fs-base); color: var(--bm-sage); }
.tn-block .chips { margin-bottom: 6px; }
.tn-when { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.tn-when .field { margin-bottom: 8px; }
.tn-days .badge { cursor: pointer; background: var(--bm-white); font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--bm-graphite); }
.tn-days .badge:hover { border-color: var(--bm-orange); }
.tn-search { max-width: none; margin: 0 0 8px; }
.tn-search input[type=search] { padding-left: 38px; }
.who-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.who-opt { position: relative; display: block; }
.who-opt input { position: absolute; opacity: 0; pointer-events: none; }
.who-opt > span { display: grid; gap: 1px; padding: 8px 12px; border: 1.5px solid var(--bm-line); border-radius: var(--radius); cursor: pointer; }
.who-opt small { color: var(--bm-sage); font-size: var(--fs-sm); }
.who-opt input:checked + span { border-color: var(--bm-orange); background: var(--bm-paper); }
.who-opt input:focus-visible + span { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.who-empty { margin: 4px 0; }
.tn-place { margin-top: 2px; }

/* «Добавить»: меню под кнопкой на Главной и страница с теми же пунктами (боковая и нижняя панели) */
.add-pop { position: relative; }
.add-pop > .btn-cta { width: 100%; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.add-panel { left: 0; right: 0; width: auto; padding: 6px; }
.add-panel a, .add-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-2); color: var(--bm-graphite); }
.add-panel a:hover, .add-panel a:focus-visible, .add-list a:hover, .add-list a:focus-visible { background: var(--bm-paper); outline: none; }
.add-panel a > .i, .add-list a > .i { flex: 0 0 34px; width: 34px; height: 34px; padding: 8px; border-radius: var(--r-1); background: var(--bm-paper); color: var(--bm-graphite); }
.add-panel a:hover > .i, .add-list a:hover > .i { background: var(--bm-orange); color: var(--bm-graphite); }
.add-panel span, .add-list span { display: grid; gap: 1px; min-width: 0; }
.add-panel b, .add-list b { font-weight: 600; font-size: var(--fs-base); }
.add-panel small, .add-list small { font-size: var(--fs-sm); color: var(--bm-sage); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-list { display: grid; gap: 4px; }
.add-list a { padding: 12px; border: 1px solid var(--bm-line); }
.add-list a > .i { flex-basis: 40px; width: 40px; height: 40px; padding: 10px; }
.who-none { margin-bottom: 8px; }
.who-none > span { border-style: dashed; }

/* Мессенджер Telegram (API аккаунта) */
.tg-app { display: grid; gap: 16px; }
.tg-thread { display: grid; gap: 12px; min-width: 0; }
.tg-thread-head { display: flex; align-items: center; gap: 12px; }
.tg-msgs { display: grid; gap: 6px; max-height: 52vh; overflow: auto; padding: 8px 0; }
.tg-msg { padding: 8px 12px; border-radius: var(--r-2); background: var(--bm-paper); max-width: 42rem; }
.tg-msg.out { justify-self: end; background: #f3e6d4; }
.tg-msg.in { justify-self: start; }
.tg-reply { display: grid; gap: 8px; }
.tg-card .tg-msgs { max-height: 220px; }
@media (min-width: 900px) {
  .tg-app { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .tg-back { display: none; }
}
@media (max-width: 899px) {
  .tg-side { display: none; }
}

/* =========================================================================================
   11.10.2026 — телефон и планшет: меню разделов у «БМ CRM», окна шапки в пределах экрана, плотнее без пустот
   ========================================================================================= */
.d-short { display: none; }
.fs small span { font: inherit; color: inherit; }
@media (max-width: 767px) { .m-hide { display: none; } }

/* меню разделов: кнопка слева от «БМ CRM» — там, где нет боковой панели; в меню — то, чего нет в нижней панели */
.nav-menu { display: none; }
@media (max-width: 1023px) {
  .topbar .brand-row { gap: 4px; }
  .nav-menu { display: grid; margin-left: -8px; }
  .nav-menu.on::after { content: ""; position: absolute; top: 8px; right: 7px; width: 7px; height: 7px; border: 1.5px solid var(--bm-white); border-radius: 50%; background: var(--bm-orange); }
  .topbar .brand-row .theme-toggle { margin-left: 4px; }  /* солнце/луна — рядом с «БМ CRM», как на компьютере */
}
.drawer { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bm-white); color: var(--bm-graphite); box-shadow: 18px 0 40px -24px rgba(35, 39, 43, .45); }
.drawer[open] { animation: drawer-in .2s ease-out; }
.drawer::backdrop { background: rgba(35, 39, 43, .42); }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
html:has(.drawer[open]) { overflow: hidden; }
.drawer-in { display: flex; flex-direction: column; height: 100%; padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); overflow-y: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 6px; padding: 0 0 6px 12px; border-bottom: 1px solid var(--bm-line); }
.drawer-head .brand { font-size: var(--fs-lg); }
.drawer-x { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-4); background: none; color: inherit; cursor: pointer; }
.drawer-x:hover, .drawer-x:focus-visible { background: var(--bm-paper); }
.drawer-x .i { width: 20px; height: 20px; flex-basis: 20px; }
.drawer-nav { display: grid; gap: 2px; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-left: 3px solid transparent; border-radius: var(--radius-sm); font-size: var(--fs-md); font-weight: 600; }
.drawer-nav a .i, .drawer-theme .i { width: 20px; height: 20px; flex-basis: 20px; stroke: var(--bm-orange); }
.drawer-nav .app-i { width: 20px; height: 20px; }
.drawer-nav a:hover, .drawer-nav a:focus-visible { background: var(--bm-paper); }
.drawer-nav a:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: -2px; }
.drawer-nav a.active { background: var(--bm-paper); border-left-color: var(--bm-orange); border-radius: 0; }
.drawer-nav .sep { height: 1px; margin: 6px 4px; background: var(--bm-line); }
.drawer-theme { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-top: auto; padding: 0 12px; border: 0; border-top: 1px solid var(--bm-line);
  background: none; font: inherit; font-size: var(--fs-base); font-weight: 600; color: inherit; text-align: left; cursor: pointer; }
.drawer-theme > span:first-of-type { flex: 1; }
.drawer-theme .sw { position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--r-4); background: #D5DADD; transition: background-color .2s ease; }
.drawer-theme .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bm-white); transition: transform .2s ease; }
.drawer-theme[aria-pressed="true"] .sw { background: var(--bm-graphite); }
.drawer-theme[aria-pressed="true"] .sw::after { transform: translateX(16px); background: var(--bm-orange); }
.drawer-theme:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: -2px; }
.nav-dark .drawer { background: #383E43; color: #E1E5E7; }
.nav-dark .drawer .brand { color: #F4F5F6; }
.nav-dark .drawer-head, .nav-dark .drawer-theme { border-color: #4E565C; }
.nav-dark .drawer-nav .sep { background: #4E565C; }
.nav-dark .drawer-nav a:hover, .nav-dark .drawer-nav a:focus-visible, .nav-dark .drawer-x:hover, .nav-dark .drawer-x:focus-visible { background: #424950; }
.nav-dark .drawer-nav a.active { background: #4A5258; color: var(--bm-white); }
.nav-dark .drawer-theme .sw { background: #59626A; }
.nav-dark .drawer-theme[aria-pressed="true"] .sw { background: var(--bm-graphite); }

/* колокольчик и профиль: на телефоне окно привязано к краю экрана, а не к кнопке — целиком в кадре, над нижней панелью */
@media (max-width: 1023px) {
  .topbar .pop-panel { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 52px); right: 8px; left: auto; width: min(380px, calc(100vw - 16px)); max-width: none;
    max-height: calc(100vh - max(8px, env(safe-area-inset-top)) - 64px - var(--nav-h) - env(safe-area-inset-bottom)); }
  @supports (height: 100dvh) {
    .topbar .pop-panel { max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - 64px - var(--nav-h) - env(safe-area-inset-bottom)); }
  }
  .topbar .me-panel { width: min(300px, calc(100vw - 16px)); }
}
/* в карточке профиля ссылка-фото не растягивается на всю ширину (иначе имя уезжает за край) */
.me-panel .me-card a { display: block; flex: none; width: auto; padding: 0; border-radius: 50%; }
.me-card a img { display: block; }
.me-card b, .me-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* плитки плана на столе: подпись / число и отклонение (не влезает — строкой ниже) / столбики по дням */
@media (min-width: 1280px) {
  .stat { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; }
  .stat-l, .stat .spark { flex: 1 1 100%; min-width: 0; }
  .stat .delta { margin-left: auto; }
}

/* «Главная» до 1279 px (одна колонка): дата и «Добавить» в одну строку; плитки ниже — отклонение у подписи, столбики рядом с числом */
@media (max-width: 1279px) {
  .home { grid-template-columns: minmax(0, 1fr) auto; }
  .home > .home-main, .home-rail > .rail-list { grid-column: 1 / -1; }
  .home-rail > .rail-date { grid-column: 1; }
  .home-rail > .add-pop { grid-column: 2; }
  .home-rail > .rail-date, .home-rail > .add-pop { align-self: stretch; }
  .add-pop > .btn-cta { height: 100%; min-height: 42px; padding: 0 18px; }
  .add-pop .add-panel { left: auto; right: 0; width: min(340px, calc(100vw - 32px)); }
  .stats { gap: 8px; padding: 2px 12px 12px; }
  .stat { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "l d" "v s"; align-items: center; gap: 3px 10px; padding: 7px 10px 8px; }
  .stat-l { grid-area: l; } .stat-v { grid-area: v; } .stat .delta { grid-area: d; justify-self: end; margin-left: 0; } .stat .spark { grid-area: s; }
  .stat .delta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .stat-v b { font-size: var(--fs-xl); }
  .stat .spark { align-self: end; height: 16px; margin: 0 0 2px; }
}
@media (max-width: 760px) {
  .home, .home-main, .home-row { gap: 10px; }
  .rail-date { padding: 8px 12px; }
  .rail-date b { font-size: var(--fs-base); }
  .d-long { display: none; } .d-short { display: inline; }
  .hc-head { padding: 10px 12px 6px; }
  .hc-empty { padding: 8px 12px 12px; }
  /* шапка плана: «План на октябрь … Изменить цели» / шкала и процент / день месяца и норма действий */
  .hplan .hc-head { gap: 4px 10px; }
  .hplan .hc-link { order: 1; margin-left: auto; }
  .hplan .pmeter { order: 2; flex: 1 1 calc(100% - 56px); min-width: 0; max-width: none; }
  .hplan .pm-pct { order: 3; }
  .hplan .hc-sub { order: 4; }
  .hplan .kpi-norm { order: 5; }
  .stats { padding: 2px 10px 10px; }
  .ag-row { padding: 7px 12px; }
  .hfunnel .fun { gap: 6px; padding: 2px 12px 12px; }
  .fun .fs, .fun .fs:first-child, .fun .fs:last-child { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "l l" "n p"; align-items: baseline; gap: 0 6px; padding: 6px 10px; }
  .fun .fs > span { grid-area: l; } .fun .fs b { grid-area: n; font-size: var(--fs-lg); } .fun .fs small { grid-area: p; }
  .hfunnel .hc-link { order: 1; margin-left: auto; } .hfunnel .seg { order: 2; } .hfunnel .hc-spacer { display: none; }
  .act a, .act .act-row { grid-template-columns: 8px max-content minmax(0, 1fr); gap: 6px; padding: 5px 12px; }
  .act time { font-size: 10.5px; }
  .sysbar { gap: 8px; padding: 8px 10px; font-size: var(--fs-sm); line-height: 1.35; }
  .sysbar .btn { min-height: 32px; }
  .sys-tech { display: none; }
  .rl-head { padding: 8px 12px 5px; }
  .rl-row { padding: 5px 12px; }
}
@media (max-width: 420px) { .rail-date .home-clock { display: none; } }

/* разделы на телефоне: заголовок уже в шапке — пустая строка под ним не остаётся */
@media (max-width: 1023px) {
  .section-root .page-head:has(> h1) { margin-bottom: 6px; }
  .section-root .page-head:has(> h1):not(:has(.btn, .muted, .btn-row, .card-sub)) { margin: 0; height: 0; overflow: hidden; }
}
@media (max-width: 767px) {
  .rows .row { min-height: 48px; padding: 8px 0; }
}

/* ---------- фильтры списков: общие элементы — у каждой функции свой вид ----------
   создать — оранжевая кнопка с «+» (как «Добавить» на Главной); чьи — дорожка-переключатель с графитовым выбором;
   фильтр-галочка — пилюля с квадратиком; «Фильтры» — кнопка-раскрывашка со счётчиком и шевроном; вид — значки на дорожке. */
.lf { margin: 0 0 12px; }
.segtabs { display: inline-flex; flex: none; max-width: 100%; padding: 3px; overflow-x: auto; border-radius: var(--r-4); background: var(--surface-2); scrollbar-width: none; }
.segtabs::-webkit-scrollbar { display: none; }
.segtabs label, .segtabs a { position: relative; display: flex; flex: none; }
.segtabs input { position: absolute; opacity: 0; pointer-events: none; }
.segtabs label > span, .segtabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 13px; border-radius: var(--r-4);
  font-size: var(--fs-base); font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.segtabs label > span:hover, .segtabs a:hover { color: var(--bm-graphite); }
.segtabs input:checked + span, .segtabs a.on { background: var(--bm-graphite); color: var(--bm-white); }
.segtabs input:focus-visible + span, .segtabs a:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 1px; }
.segtabs .i { width: 16px; height: 16px; flex-basis: 16px; }
.vtabs label > span { padding: 0 9px; }
.vtabs .vt-l { display: none; }
.btn-new { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 36px; padding: 0 14px 0 11px; border: 0; border-radius: var(--r-2);
  background: var(--bm-orange); color: var(--bm-graphite); font: inherit; font-size: var(--fs-base); font-weight: 800; white-space: nowrap; cursor: pointer; transition: background-color .15s ease; }
.btn-new:hover { background: #EC8710; }
.btn-new:focus-visible { outline: 2px solid var(--bm-graphite); outline-offset: 2px; }
.btn-new .i { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 2.4; }
.btn-new.top-add { min-height: 34px; height: 34px; font-size: var(--fs-base); }
@media (max-width: 1023px) { .btn-new.top-add { display: none; } }  /* на телефоне «создать» — в строке фильтров раздела */
.tchip { position: relative; display: inline-flex; flex: none; }
.tchip input { position: absolute; opacity: 0; pointer-events: none; }
.tchip > span { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px 0 9px; border: 1px solid var(--line-2); border-radius: var(--r-4); background: var(--bm-white);
  font-size: var(--fs-base); font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.tchip > span::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--bm-sage); border-radius: 4px; background: var(--bm-white) center / 10px 10px no-repeat; }
.tchip > span:hover { border-color: #B9C3BF; color: var(--bm-graphite); }
.tchip input:checked + span { border-color: var(--bm-orange); background: #FFF6EC; color: var(--bm-graphite); }
.tchip input:checked + span::before { border-color: var(--bm-orange); background-color: var(--bm-orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323272B' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.tchip input:focus-visible + span { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.lf-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lf-search { position: relative; display: flex; flex: 1 1 240px; align-items: center; min-width: 0; max-width: none; margin: 0; }
.lf-search > .i { position: absolute; left: 12px; width: 16px; height: 16px; flex-basis: 16px; color: var(--ink-3); pointer-events: none; }
.lf-search input[type=search] { min-height: 38px; padding: 6px 10px 6px 36px; border-width: 1px; border-color: var(--line-2); border-radius: var(--r-2); font-size: var(--fs-base); }
.lf-search input[type=search]:hover { border-color: #B9C3BF; }
.lf-search input[type=search]:focus { border-color: var(--bm-orange); }
.lf-more { display: none; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bm-white);
  font: inherit; font-size: var(--fs-base); font-weight: 600; color: var(--bm-graphite); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.lf-more:hover { border-color: #B9C3BF; }
.lf-more:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.lf-more .i { width: 16px; height: 16px; flex-basis: 16px; }
.lf-more .i:last-child { width: 14px; height: 14px; flex-basis: 14px; color: var(--ink-3); transition: transform .2s ease; }
.lf-more[aria-expanded="true"] { border-color: var(--bm-graphite); background: var(--bm-paper); }
.lf-more[aria-expanded="true"] .i:last-child { transform: rotate(180deg); }
.lf-more .count { height: 18px; min-width: 18px; padding: 0 5px; background: var(--bm-orange); color: var(--bm-graphite); font-size: var(--fs-xs); }

/* «Контакты»: одна строка «виды · поиск · Найти · списки · создать»; на телефоне списки — по кнопке «Фильтры» */
.lf-simple { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-filters .lf-fields select { width: auto; min-width: 150px; min-height: 38px; padding: 6px 30px 6px 10px; border-width: 1px; border-radius: var(--r-2); font-size: var(--fs-base);
  background: var(--bm-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 14px; text-overflow: ellipsis; }
.lf-go { min-height: 38px; }
@media (min-width: 768px) {
  .lf-simple .page-add { order: 6; }  /* поиск · Найти · списки · создать */
  .lf-simple .lf-search { order: 4; flex-basis: 180px; }
  .lf-simple .lf-go { order: 5; }
  .ct-filters .lf-fields { display: contents; }
  .ct-filters .lf-fields > * { order: 5; }
  .ct-filters .ct-sort select { width: 196px; min-width: 0; }  /* иначе ширина — по самому длинному пункту */
}
@media (min-width: 1024px) { .lf .page-add { display: none; } }  /* на столе «создать» — в верхней строке */
@media (max-width: 767px) {
  .lf-simple { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
  .lf-simple > .segtabs { justify-self: start; }
  .lf-simple .lf-more { display: inline-flex; }
  .lf-simple .lf-fields { grid-column: 1 / -1; }
  .lf-simple:not(.more-open) .lf-fields { display: none; }
  .ct-filters .lf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ct-filters .lf-fields select { width: 100%; min-width: 0; font-size: var(--fs-md); }
  .lf-go { display: none; }  /* поиск — кнопкой «Найти» на клавиатуре, списки применяются сразу */
}

/* ---------- панель «Фильтры» списков: Объекты, Авито, Покупатели, Продавцы, Звонки ----------
   строка .lf-bar видна всегда: чьи · поиск · «Фильтры» (счётчик включённых, шеврон) · создать;
   под ней — включённое плашками с крестиком и «Сбросить всё»; панель .lf-panel свёрнута, пока не нажали «Фильтры»:
   поля по группам с подписью и волосяной линейкой («Что», «Где», «Деньги», «Порядок»), галочки и «Сбросить · Показать» — внизу.
   Поля — одной сеткой клеток (--lf-cols), группа занимает столько клеток, сколько в ней полей (k2…k4), — края полей совпадают по строкам;
   где группы не складываются в полные строки, ширину группы задаёт --span (без дыр в сетке). */
.lf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lf-find { display: flex; flex: 1 1 320px; align-items: center; gap: 8px; min-width: 0; }
.lf-find > .lf-search { flex: 1 1 auto; }
.lf-bar .lf-more { display: inline-flex; }
.lf-bar .page-add { order: 2; min-height: 38px; }  /* планшет: «создать» — в конце строки, высотой с поиск */

.lf-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; }
.of-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.of-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; min-height: 30px; overflow-wrap: anywhere; padding: 4px 8px 4px 12px; border: 1px solid var(--bm-orange); border-radius: var(--r-4);
  background: #FFF6EC; font-size: var(--fs-base); font-weight: 600; line-height: 1.25; color: var(--bm-graphite); transition: background-color .15s ease; }
.of-chip .i { width: 13px; height: 13px; flex-basis: 13px; color: var(--ink-3); stroke-width: 2.4; }
.of-chip:hover { background: #FFEBD3; }
.of-chip:hover .i { color: var(--bm-graphite); }
.of-chip:focus-visible { outline: 2px solid var(--bm-graphite); outline-offset: 2px; }
.lf-clear { display: inline-flex; align-items: center; min-height: 30px; font-size: var(--fs-base); font-weight: 600; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--bm-orange); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lf-clear:hover { color: var(--bm-graphite); }

.lf-panel { display: none; margin-top: 10px; padding: 14px 16px; border: 1px solid var(--bm-line); border-radius: var(--r-3); background: var(--bm-paper); }
.lf.more-open .lf-panel { display: block; }
.lf[data-lf-anim] .lf-panel { animation: lf-open .18s ease-out; }  /* только по нажатию: после автоприменения панель не «въезжает» заново */
@keyframes lf-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.lf-groups { --lf-cols: 2; display: grid; grid-template-columns: repeat(var(--lf-cols), minmax(0, 1fr)); grid-auto-flow: row dense; gap: 14px 12px; }
.lf-group { --k: 1; grid-column: span var(--span, var(--k)); min-width: 0; }
.lf-group.k2 { --k: 2; }
.lf-group.k3 { --k: 3; }
.lf-group.k4 { --k: 4; }
.lf-group.wide { grid-column: 1 / -1; }
.lf-extra .lf-toggles { min-height: 58px; align-content: flex-end; }  /* «Покупатели/Продавцы»: пилюли — по нижнему краю соседних полей */
.lf-gt { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 800; line-height: 1.2; letter-spacing: .07em; text-transform: uppercase; color: var(--bm-graphite); }
.lf-gt::after { content: ""; flex: 1 1 auto; height: 1px; background: #D5DADD; }
.lf-gf { display: grid; grid-template-columns: repeat(var(--k), minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.lf-gf > .lf-field:only-child { grid-column: 1 / -1; }
.lf-field { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.lf-field > span:first-child, .lf-range > legend { display: block; padding: 0; font-size: var(--fs-sm); font-weight: 600; line-height: 16px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-range { display: block; }
.lf-range > legend { float: left; width: 100%; margin: 0 0 4px; }  /* float — легенда встаёт строкой над полями, как подписи соседей */
.lf-pair { clear: both; display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); align-items: center; text-align: center; font-size: var(--fs-base); color: var(--ink-3); }
.lf-pair > label { display: block; min-width: 0; }
.lf-panel select, .lf-panel input[type=number], .lf-panel input[type=text] { height: 38px; min-height: 38px; padding: 0 10px; border: 1px solid #D5DADD; border-radius: var(--r-1);
  background-color: var(--bm-white); font-size: var(--fs-base); font-weight: 500; color: var(--bm-graphite); text-align: left; }
.lf-panel select { padding-right: 28px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
  background: var(--bm-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 14px; }
.lf-panel select:hover, .lf-panel input[type=number]:hover, .lf-panel input[type=text]:hover { border-color: #B9C3BF; }
.lf-panel input::placeholder { color: #8A9590; }
.lf-panel input[type=number] { -moz-appearance: textfield; }
.lf-panel input[type=number]::-webkit-inner-spin-button, .lf-panel input[type=number]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
/* выбранное значение — графитовой рамкой: видно, какие поля включены; у «Порядка» значение есть всегда — его не выделяем */
.lf-panel input[type=number]:not(:placeholder-shown), .lf-panel input[type=text]:not(:placeholder-shown) { border-color: var(--bm-graphite); font-weight: 600; }
.lf-field:not(.lf-plain) select:has(option:checked:not([value=""])) { border-color: var(--bm-graphite); font-weight: 600; }
.lf-panel select:focus, .lf-panel input:focus { outline: 1px solid var(--bm-orange); outline-offset: -1px; border-color: var(--bm-orange); }
.lf-panel .tchip > span { min-height: 38px; }  /* галочки — той же высоты, что поля и «Показать» */
/* «Какие звонки» в панели — отдельные пилюли с переносом: дорожка-переключатель в две строки на телефоне выглядит сломанной */
.lf-panel .segtabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; overflow: visible; border-radius: 0; background: none; }
.lf-panel .segtabs label > span { min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--bm-white); }
.lf-panel .segtabs label > span:hover { border-color: #B9C3BF; }
.lf-panel .segtabs input:checked + span { border-color: var(--bm-graphite); background: var(--bm-graphite); color: var(--bm-white); }
.lf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #D5DADD; }
.lf-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.lf-reset { font-size: var(--fs-base); font-weight: 600; }
.lf-apply { min-height: 38px; padding: 0 20px; border-width: 1px; font-size: var(--fs-base); }
.lf-apply:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
/* Ширины клеток посчитаны по Montserrat 14 px: значение по умолчанию («Все статусы», «Все продавцы», «Сначала новые») и подписи
   полей не режутся ни на одной ширине; порядку всегда две клетки — «Быстрее окупаемость», «Недавно изменённые» длинные.
   Клетка = (ширина панели − промежутки) / --lf-cols; панель уже экрана на 66 px (до 1024) и на 310 px (меню слева, с 1024). */
@media (min-width: 768px) {
  .lf-groups { --lf-cols: 4; }
  .lf-gf > .lf-range { grid-column: span 2; }  /* «Цена от – до» — две клетки: каждое поле шириной с соседей */
  .lf-sort { --span: 2; }
  /* «Объекты» в четыре клетки (от 166 px): что · порядок / где (три поля во всю строку) / деньги */
  #ofilter .lf-group.k3 { --span: 4; }
  /* «Авито»: цена «от – до» — в одной клетке; что · где / публикация · порядок / деньги */
  #afilter .lf-gf > .lf-range { grid-column: span 1; }
  /* «Покупатели/Продавцы»: статус · порядок · галочки «Ещё» одной строкой, галочкам — сколько им нужно */
  .ct-filters .lf-groups { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
  .ct-filters .lf-group { grid-column: auto; }
}
/* «Объекты» шире — две полные строки по пять клеток (от 172 px): что · где / деньги · порядок; цена «от – до» — в одной клетке */
@media (min-width: 976px) and (max-width: 1023px), (min-width: 1220px) {
  #ofilter .lf-groups { --lf-cols: 5; }
  #ofilter .lf-group.k3 { --span: 3; }
  #ofilter .lf-group.k4 { --k: 3; }
  #ofilter .lf-gf > .lf-range { grid-column: span 1; }
}
/* «Авито» в шесть клеток (от 150 px) — что · где · публикация / деньги · порядок */
@media (min-width: 1280px) { #afilter .lf-groups { --lf-cols: 6; } }

/* под фильтрами: счётчик, «Отметить просмотренными», вид «плиткой/списком» справа */
.of-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 12px; }
.of-result .list-count { margin: 0; }
.of-result .vtabs { margin-left: auto; }

/* телефон: строка — «чьи + создать», под ней «поиск + Фильтры»; панель во всю ширину, поля в две колонки */
@media (max-width: 767px) {
  .lf-bar .page-add { order: 1; min-height: 40px; margin-left: auto; }
  .lf-find { order: 2; flex-basis: 100%; }
  .lf-panel { padding: 12px; border-radius: var(--r-2); }
  .lf-group { grid-column: 1 / -1; }
  .lf-gf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .lf-extra .lf-toggles { min-height: 0; }
  .lf-gf > .lf-range { grid-column: 1 / -1; }
  /* нечётное последнее поле — во всю ширину, без пустой половины строки */
  .lf-gf:not(:has(> .lf-range)) > :last-child:nth-child(odd),
  .lf-gf:has(> .lf-range:first-child) > :last-child:nth-child(even) { grid-column: 1 / -1; }
  .lf-panel select, .lf-panel input[type=number], .lf-panel input[type=text] { height: 40px; min-height: 40px; font-size: var(--fs-md); }  /* меньше 16 px — iPhone увеличивает страницу */
  .lf-foot { gap: 10px; }
  .lf-actions { flex: 1 1 100%; gap: 14px; }
  .lf-apply { flex: 1 1 auto; min-height: var(--tap); }
  .lf-search input[type=search] { font-size: var(--fs-md); }
  .segtabs label > span, .segtabs a { min-height: 34px; padding: 0 11px; font-size: var(--fs-sm); }
  .tchip > span { min-height: 36px; }
  .vtabs label > span { padding: 0 8px; }
  .btn-new { min-height: 38px; padding: 0 12px 0 9px; font-size: var(--fs-base); }
  .lf-search input[type=search], .lf-more { min-height: 40px; }
  .of-result { margin: 4px 0 10px; }
}
/* до 1024 px внизу экрана меню: длинная панель — «Сбросить · Показать» прилипает над ним и видна без прокрутки
   (у цифровой клавиатуры iPhone нет Enter — цену применяют «Готово» → «Показать», а не автоприменением посреди «от – до») */
@media (max-width: 1023px) {
  .lf-foot { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 2; margin: 14px -16px -14px; padding: 12px 16px 14px;
    border-radius: 0 0 13px 13px; background: var(--bm-paper); }
}
@media (max-width: 767px) {
  .lf-foot { margin: 12px -12px -12px; padding: 10px 12px 12px; border-radius: 0 0 11px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .lf[data-lf-anim] .lf-panel { animation: none; }
  .lf-more, .lf-more .i:last-child, .of-chip, .tchip > span, .segtabs label > span, .segtabs a { transition: none; }
}
.lf > .kind-tabs.segtabs { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-self: stretch; grid-column: 1 / -1; width: auto; max-width: 100%; border-radius: var(--r-3); }
.kind-tabs.segtabs a { min-height: var(--tap); padding: 0 14px; font-size: var(--fs-base); }
@media (max-width: 400px) {  /* узкий телефон: «Мои · Коллег · Внешние» и «+ Добавить бизнес» — всё ещё одной строкой */
  .segtabs label > span, .segtabs a { padding: 0 8px; font-size: var(--fs-sm); }
  .kind-tabs.segtabs a { min-height: var(--tap); padding: 0 14px; font-size: var(--fs-base); }
  .btn-new { padding: 0 10px 0 8px; gap: 5px; }
}
@media (max-width: 370px) {  /* 320–360 px: «создать» — одним «+», доски воронок переносятся, а не прячутся за край */
  .lf .btn-new { width: 40px; padding: 0; }
  .lf .btn-new .bn-l, .lf-more .lm-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lf-more .i:last-child { display: none; }  /* «Фильтры» — значком и счётчиком, иначе поиск слишком узкий */
  .page-tabs { flex-wrap: wrap; border-radius: var(--r-3); }
}
/* календарь на телефоне: под заголовком в шапке пустой строки не остаётся */
@media (max-width: 767px) {
  .section-root .page-head:has(> div > h1):not(:has(.btn, .btn-row, .card-sub, .segtabs, .muted:not(.m-hide))) { margin: 0; height: 0; overflow: hidden; }
}
.page-tabs { margin-bottom: 12px; }

/* календарь на телефоне: стрелки и вид — одной строкой, под ними период; типы дел мельче */
@media (max-width: 767px) {
  .cal-bar { justify-content: flex-start; gap: 6px 4px; margin-bottom: 8px; }
  .cal-nav { display: contents; }
  .cal-nav .btn { min-width: 34px; min-height: 34px; padding: 0 9px; }
  .cal-views { order: 1; margin-left: auto; padding: 2px; }
  .cal-views a { padding: 6px 8px; font-size: var(--fs-sm); }
  .cal-legend li:has(> .cal-type.zero) { display: none; }  /* пустые типы на телефоне не занимают строку */
  .cal-title { order: 2; flex: 1 1 100%; margin: 0; font-size: var(--fs-lg); }
  .cal-legend { gap: 4px; margin-bottom: 10px; }
  .cal-type { min-height: 30px; gap: 5px; padding: 3px 9px 3px 4px; }
  .cal-type .ki { width: 22px; height: 22px; }
  .cal-type .ki .i { width: 13px; height: 13px; flex-basis: 13px; }
  /* аналитика: этап, полоса и число — одной строкой */
  .bars { gap: 6px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 72px auto; gap: 8px; font-size: var(--fs-base); }
  .bar-track { grid-column: auto; grid-row: auto; }
}

/* ===== «Авито»: лента объявлений сканера — плитка и список как в «Объектах» ===== */
.av-headbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.av-headbar h1 { margin: 0; }
.av-sync { margin: 4px 0 0; }
.av-head { display: flex; gap: 8px; flex-wrap: wrap; }
.av-head form { margin: 0; }
.av-head .btn { gap: 6px; }
.av-tabs .av-n, .av-base .av-n { font-size: var(--fs-xs); font-weight: 600; color: var(--bm-sage); margin-left: 2px; font-variant-numeric: tabular-nums; }
.av-tabs input:checked + span .av-n, .av-base input:checked + span .av-n { color: inherit; opacity: .75; }
.av-seen { margin: 0; }
.av-seen .link { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-base); cursor: pointer; }

/* карточка */
.av-card { display: flex; flex-direction: column; }
.av-card .ocard-img { align-self: stretch; flex: none; aspect-ratio: 4 / 3; }
.av-card .ocard-noimg { background: var(--surface-2); font-weight: 600; }
/* телефон: карточка объявления вертикальная — фото сверху, под ним текст и действия во всю ширину */
@media (max-width: 639px) {
  .av-card { gap: 0; }
  .av-card .ocard-img { aspect-ratio: 16 / 10; margin: 0; border-radius: 0; }
  .av-card .ocard-body { padding: 12px 14px 12px; }
  .av-card .ocard-chips { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
  .av-card .sticker { top: 8px; left: 8px; font-size: var(--fs-xs); padding: 3px 8px; white-space: nowrap; }
}
.av-card .ocard-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
/* превью в ленте — вся плитка ссылка на карточку объявления в CRM (на Авито — из карточки) */
a.av-card { color: inherit; text-decoration: none; }
a.av-card:hover .ocard-title, a.av-card:focus-visible .ocard-title { color: var(--bm-orange); }
a.av-card:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.av-card .ocard-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: auto; }
.av-card .sticker.av-gone { background: var(--bm-danger, #A3311F); color: var(--bm-white); }
.av-card .ocard-foot s { font-size: var(--fs-sm); font-weight: 600; color: var(--bm-sage); }
.av-card.av-off .ocard-img { filter: grayscale(.6); opacity: .85; }
.av-card .ocard-title { color: inherit; text-decoration: none; }
/* заголовок ведёт в карточку объявления в CRM, значок рядом — на само объявление на Авито */
.av-title-row { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.av-title-row .ocard-title { flex: 1 1 auto; min-width: 0; }
.av-ext { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -3px -6px 0 0; border-radius: var(--r-1); color: var(--bm-sage); }
.av-ext:hover, .av-ext:focus-visible { color: var(--bm-graphite); background: var(--bm-paper); outline: none; }
.av-ph { display: inline-flex; align-items: center; gap: 4px; }
.av-ph .i { width: 12px; height: 12px; flex-basis: 12px; stroke-width: 2.2; color: var(--bm-orange); }
.av-gone { background: rgba(194, 65, 45, .9); }
.av-ph-t { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.av-ph-t .i { width: 11px; height: 11px; flex-basis: 11px; color: var(--bm-orange); stroke-width: 2.2; }
.av-gone-t { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--bm-danger); }
.av-card .ocard-next s { color: var(--bm-sage); }
.av-card.av-changed { border-color: var(--bm-orange); box-shadow: inset 0 3px 0 var(--bm-orange); }
.av-drop { background: var(--bm-orange); }
.av-drop-text { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--bm-orange); }
.av-chg { color: var(--bm-orange); box-shadow: inset 3px 0 0 var(--bm-orange); padding-left: 6px; }
.ocard-props .av-chg dd, .ocard-props .av-chg dt { color: var(--bm-orange); }

/* плашка сверки с базой: фон бумаги и левая полоса, как «Цена расходится» в карточке объекта */
.av-match { display: grid; gap: 2px; margin: 6px 0 2px; padding: 6px 9px; background: var(--bm-paper); box-shadow: inset 3px 0 0 var(--bm-orange); font-size: var(--fs-sm); }
.av-match.av-similar { box-shadow: inset 3px 0 0 var(--bm-sage); }
.av-match a { color: var(--bm-graphite); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-match a:hover, .av-match a:focus-visible { color: var(--bm-orange); }
.av-match.av-similar a { font-weight: 500; }
.av-mismatch { color: var(--bm-danger); font-weight: 600; }

/* история изменений */
.av-changes { margin-top: 8px; font-size: var(--fs-sm); }
.av-changes summary { cursor: pointer; color: var(--bm-sage); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.av-changes summary::-webkit-details-marker { display: none; }
.av-changes summary::after { content: "›"; transition: transform .15s; }
.av-changes[open] summary::after { transform: rotate(90deg); }
.av-changes ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.av-changes li { overflow-wrap: anywhere; padding-left: 9px; box-shadow: inset 2px 0 0 var(--bm-line); }
.av-changes li small { color: var(--bm-sage); }
.av-changes li.av-unseen { box-shadow: inset 2px 0 0 var(--bm-orange); }
.av-changes li.av-unseen b { color: var(--bm-orange); }

/* действия: одна главная кнопка и ряд инструментов «значок над подписью», как быстрые действия карточки */
.av-act { margin-top: auto; padding-top: 10px; display: grid; gap: 6px; }
.av-main-f { margin: 0; }
.av-main { width: 100%; gap: 8px; min-height: 40px; }
.av-main .av-s { display: none; }
.av-main .i { width: 18px; height: 18px; flex-basis: 18px; }
.av-tools { display: flex; border-top: 1px solid var(--bm-line); margin: 4px -2px 0; padding-top: 2px; }
.av-tools form { display: contents; }
.av-tool { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 2px;
  border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--bm-sage); cursor: pointer; text-decoration: none;
  transition: color .15s, background-color .15s; }
.av-tool .i { width: 18px; height: 18px; flex-basis: 18px; }
.av-tool span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-tool:hover, .av-tool:focus-visible { color: var(--bm-graphite); background: var(--bm-paper); outline: none; }
.av-tool.on { color: var(--bm-orange); }
.av-tool.on .i { stroke-width: 2.4; }

/* список: главная кнопка компактная, инструменты — квадраты со значком */
.av-list .ol-obj { color: inherit; text-decoration: none; }
.av-list .av-act { padding-top: 0; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.av-list .av-main { width: auto; min-height: 34px; padding: 0 10px; font-size: var(--fs-sm); }
.av-list .av-main span { white-space: nowrap; }
.av-list .av-main .av-l { display: none; }
.av-list .av-main .av-s { display: inline; }
.av-list .av-tools { border-top: 0; margin: 0; padding: 0; gap: 2px; }
.av-list .av-tool { flex: none; width: 34px; min-height: 34px; padding: 0; }
.av-list .av-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ol-row.av-changed { border-left-color: var(--bm-orange); }
@media (min-width: 1100px) { .av-list .ol-row { grid-template-columns: minmax(170px, 2fr) 96px minmax(110px, 1fr) minmax(96px, 1fr) 96px 112px 80px 236px; } }
@media (max-width: 1099px) { .av-list .ol-step { flex: 1 1 100%; margin-left: 66px; } .av-list .av-act { justify-content: flex-start; } }

/* брокеры */
.av-broker-form { border: 1px solid var(--bm-line); border-radius: var(--radius); padding: 14px; margin: 12px 0 18px; display: grid; gap: 8px; }
.av-broker-form .of-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }
/* «Брокеры на Авито»: итог с «+ Брокер» (форма раскрывается под ним), таблица с сортировками, на телефоне — карточки */
.av-br-top { position: relative; display: grid; gap: 10px; margin: 0 0 14px; }
.av-br-sum { margin: 0; min-height: 36px; padding: 8px 128px 0 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--bm-sage); }
.av-br-sum b { color: var(--bm-graphite); font-weight: 600; }
.av-add > summary { position: absolute; top: 0; right: 0; list-style: none; }
.av-add > summary::-webkit-details-marker { display: none; }
.av-add[open] > summary { box-shadow: inset 0 0 0 2px var(--bm-graphite); }
.av-add .av-broker-form { margin: 0; }
.av-add .av-broker-form > .muted { margin: 0; }
.av-br-sort { display: none; }
.av-br-name small a { color: inherit; }
.av-br-note { font-style: italic; }
.av-br-sph { display: grid; gap: 1px; min-width: 0; font-size: var(--fs-sm); line-height: 1.3; }
.av-br-sph > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-br-sph i { font-style: normal; color: var(--bm-sage); margin-left: 2px; }
.av-br-sph small, .av-br-n small { display: block; font-size: var(--fs-xs); color: var(--bm-sage); line-height: 1.3; }
.av-br-n .av-br-drop { color: var(--ink-2); font-weight: 600; }
.av-br-mk { font-weight: 600; }
.av-br-mk.up { color: var(--bm-danger); }
.av-br-mk.down { color: var(--bm-ok); }
@media (min-width: 1100px) {
  .av-brokers .ol-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.4fr) repeat(6, minmax(64px, .8fr)) 76px; align-items: start; }
  .av-brokers .ol-head { align-items: end; }
  .av-br-act { text-align: right; }
}
@media (max-width: 1099px) {
  .av-br-sum { padding-right: 112px; }
  .av-br-sort { display: flex; justify-content: flex-end; margin: 0 0 8px; }
  .av-br-sort label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--bm-sage); }
  .av-brokers .av-br { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 12px; align-items: baseline; padding: 10px 8px; }
  .av-brokers .av-br-name { grid-column: 1 / -1; padding-right: 88px; }
  .av-brokers .av-br-sph { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 10px; }
  .av-brokers .av-br-sph > span { max-width: 100%; }
  .av-brokers .av-br-sph small { display: inline; }
  .av-brokers .av-br-n { min-width: 0; font-size: var(--fs-sm); }
  .av-brokers .av-br-n small { display: none; }  /* на телефоне — только главные числа */
  .av-brokers .av-br-n .av-br-drop { display: block; }
  .av-brokers .av-br-act { position: absolute; top: 8px; right: 8px; }
}

/* аналитика: сводка команды и личная воронка */
.report .page-head { flex-wrap: wrap; align-items: center; }
.report .page-head .muted { color: var(--ink); }
.report .page-head .btn { min-height: var(--tap); }
.report-lead { margin: 0 0 14px; max-width: 68ch; color: var(--ink); font-size: var(--fs-base); line-height: 1.45; }
.report .section h2 { color: var(--ink); }
.report-tools { display: grid; gap: 12px; margin: 0 0 16px; padding: 16px; border: 1px solid var(--bm-line); border-radius: var(--radius); }
.report-fold { margin: 0 0 16px; }
.report-fold > summary { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--bm-line); border-radius: var(--r-2); background: var(--bm-white); color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.report-fold > summary::-webkit-details-marker { display: none; }
.report-fold > summary::after { content: ""; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.report-fold[open] > summary { margin-bottom: 12px; }
.report-fold[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.report-fold .report-tools { margin: 0; }

.report-tools .segtabs { display: flex; flex-wrap: wrap; width: max-content; max-width: 100%; border-radius: var(--r-3); }
.report-tools .segtabs a { min-height: var(--tap); padding: 0 16px; }
.report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.report-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.report-filters .field, .report-range .field { margin: 0; }
.report-tools .btn { min-height: var(--tap); }
.team-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.report .stat { padding: 16px; gap: 8px; }
.report .stat .muted { color: var(--ink); }
.team-stats .stat-v b, .team-stats .muted { font-variant-numeric: tabular-nums; }
.report .table { font-size: var(--fs-base); }
.report .table th, .report .table td { padding: 12px; }
.report .table th { color: var(--ink); white-space: normal; line-height: 1.3; vertical-align: bottom; }
.report .table td:first-child, .report .table th:first-child { position: sticky; left: 0; background: var(--bm-white); z-index: 1; }
.report .table tr.total td, .report .table tr.total td:first-child { background: var(--bm-paper); }
.report-people th:nth-child(n+4), .report-people td:nth-child(n+4),
.report-dept th:nth-child(n+2), .report-dept td:nth-child(n+2),
.report-branch th:nth-child(n+2), .report-branch td:nth-child(n+2),
.report-sources th:nth-child(n+2), .report-sources td:nth-child(n+2),
.report-actions th:nth-child(n+2), .report-actions td:nth-child(n+2) { text-align: right; }
.report-actions th:last-child, .report-actions td:last-child { background: var(--bm-paper); }

.report-split { display: grid; gap: 12px; margin: 0 0 8px; }
.report .info-block .section { margin-top: 0; }
.report .info-block h3 { margin: 16px 0 8px; }
.report .info-block > h3:first-child { margin-top: 0; }
.report .row .sub { color: var(--ink); }
.report .row.overdue .title { color: #8E2E22; }
.report .rows .row { min-height: 56px; padding: 12px 0; }
@media (min-width: 900px) {
  .report-split { grid-template-columns: 1fr 1fr; }
  .report-split.thirds { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .team-stats, .report-split, .report-split.thirds, .report-range, .report-filters { grid-template-columns: minmax(0, 1fr); }
}

/* аналитика: график, воронки, отмены */
.dash-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-kpis .stat { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; align-items: start; }
.dash-kpis .stat-l, .dash-kpis .stat-v, .dash-kpis .spark { grid-area: auto; }
.dash-kpis .stat-l { white-space: normal; color: var(--ink); }
.dash .section span, .dash-note { color: var(--ink); }
.dash-note { margin: 0 0 12px; font-size: var(--fs-base); line-height: 1.45; }
.chart-panel { margin: 0 0 16px; }
.chart { display: block; width: 100%; height: 180px; }
.chart-grid { stroke: var(--bm-line); stroke-width: 1; }
.chart-bar.clients { fill: var(--bm-graphite); }
.chart-bar.showings { fill: #F5921E; }
.chart-bar.deposits { fill: #8A6A12; }
.chart-bar.deals { fill: #2F6B48; }
.chart-bar.meetings { fill: #4E5960; }
.chart-labels { display: flex; margin-top: 6px; }
.chart-labels span { flex: 1; min-width: 0; overflow: hidden; font-size: var(--fs-xs); line-height: 1.3; color: var(--ink); text-align: center; }
.chart-labels.sparse { justify-content: space-between; }
.chart-labels.sparse span { flex: none; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--ink); font-size: var(--fs-base); }
.chart-legend b { font-variant-numeric: tabular-nums; }
.swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.swatch.clients { background: var(--bm-graphite); }
.swatch.showings { background: #F5921E; }
.swatch.deposits { background: #8A6A12; }
.swatch.deals { background: #2F6B48; }
.swatch.meetings { background: #4E5960; }
.dash .fun { padding: 4px 0 0; }
.dash-split { display: flex; gap: 20px; margin: 14px 0 8px; }
.dash-split div { display: grid; gap: 2px; }
.dash-split b { font-size: var(--fs-xl); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.dash-split span { font-size: var(--fs-base); color: var(--ink); }
.splitbar, .reason svg { display: block; width: 100%; height: 8px; }
.split-rest { fill: #E6E9EB; }
.split-yes { fill: var(--bm-graphite); }
.reason { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; min-height: 36px; color: var(--ink); }
.reason b { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-tools { min-width: 0; }
  .report-tools .segtabs { width: 100%; }
  .report-filters, .report-range { min-width: 0; }
  .report-tools input, .report-tools select { min-width: 0; max-width: 100%; }
  .reason { grid-template-columns: minmax(0, 1fr) auto; }
  .reason svg { grid-column: 1 / -1; }
  .dash .fun { flex-direction: column; gap: 8px; }
  .dash .fun .fs, .dash .fun .fs:first-child, .dash .fun .fs:last-child {
    flex: none; clip-path: none; border-radius: var(--r-2); padding: 12px;
  }
}

/* резюме по клиенту: этап, хронология, как говорить и что делать дальше */
.brief-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.brief-bar form { margin: 0; }
.brief-wait { display: none; }
.brief-wait.htmx-request { display: inline; }
.brief { margin: 0 0 16px; padding: 16px; background: #FFF6EC; border: 2px solid var(--bm-orange); border-radius: var(--r-2); color: var(--ink); }
.brief-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brief h2 { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.brief-now { margin: 10px 0 0; padding: 10px 12px; background: var(--bm-white); border-radius: var(--r-1); font-size: var(--fs-md); font-weight: 700; line-height: 1.35; }
.brief h3 { margin: 14px 0 6px; font-size: var(--fs-base); font-weight: 800; }
.brief ol, .brief ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-base); line-height: 1.4; }
.brief .muted { color: var(--ink); }
.brief-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.brief-points li { padding: 10px 12px; background: var(--bm-white); border-radius: var(--r-1); font-weight: 600; }
.name-tools [data-brief] .head-brief.on { background: var(--bm-graphite); color: var(--bm-orange); box-shadow: inset 0 0 0 2px var(--bm-orange); }
.staff-list .row { flex-wrap: wrap; align-items: flex-end; }
.office-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; flex: 1 1 260px; max-width: 420px; }
.office-form .field { margin: 0; flex: 1; min-width: 0; }
a.row { color: inherit; text-decoration: none; }
a.staff-open { color: inherit; text-decoration: none; min-width: 0; }
.org-nav { margin: 0 0 16px; }
.staff-page .page-head, .unit-page .page-head { align-items: center; flex-wrap: wrap; }
.staff-page .page-head .btn, .unit-page .page-head .btn { flex: none; }

.staff-page .section, .unit-page .section, .unit-card .section { justify-content: flex-start; gap: 10px; }
.org-nav.segtabs { display: flex; flex-wrap: wrap; width: max-content; max-width: 100%; border-radius: var(--r-3); }
.org-nav.segtabs a { min-height: var(--tap); padding: 0 16px; }
.org-line { align-items: flex-start; gap: 12px; padding: 14px 0; }
.org-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1; }
.org-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.org-text .title { font-size: var(--fs-md); }
.org-text .role { font-size: var(--fs-base); font-weight: 600; }
.org-text .meta { font-size: var(--fs-base); }
.org-count { display: grid; justify-items: end; gap: 4px; margin-left: auto; min-width: 64px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.org-count b { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.org-count span { font-size: var(--fs-sm); }
.unit-add { display: flex; align-items: flex-end; gap: 12px; }
.unit-add .field { flex: 1; margin: 0; min-width: 0; }
.unit-add-block { max-width: 720px; margin: 22px 0 8px; }
.unit-add-block h3 { margin-bottom: 12px; }
.hire-note { margin: 0 0 12px; color: var(--ink); font-size: var(--fs-base); }
.person-line { display: flex; align-items: flex-start; gap: 14px; }
.person-line > .me-ava { width: 64px; height: 64px; font-size: var(--fs-xl); flex: none; }
.person-line .who { flex: 1; min-width: 0; }
.person-line + .card-sub { margin-top: 8px; }
.person-line .page-head { margin-bottom: 2px; justify-content: flex-start; }
.person-line .head-actions { margin-left: 0; }
a.staff-open { display: flex; align-items: flex-start; gap: 12px; }
.unit-page .row .title, .unit-card .row .title, .staff-page .row .title,
.unit-page .row .sub, .unit-card .row .sub, .staff-page .row .sub { display: block; }
.roster-ava { flex: none; }
.org-fields { display: grid; gap: 8px; }
.org-fields .field { margin: 0; }
.person-card > .info-block, .unit-card > .info-block { margin-bottom: 14px; }
.unit-card .info-block > p { margin: 0 0 10px; }
@media (max-width: 640px) {
  .unit-add { flex-direction: column; align-items: stretch; }
  .unit-card .grid-2, .person-card .grid-2, .staff-page .grid-2 { grid-template-columns: 1fr; }
}

.staff-page .card-sub, .unit-page .card-sub, .person-card .card-sub, .unit-card .card-sub,
.staff-page .client-id, .unit-card .client-id, .person-card .client-id,
.staff-page .section h2, .unit-page .section h2, .unit-card .section h2, .person-card .section h2,
.staff-page .section span, .unit-page .section span, .unit-card .section span,
.org-text .role, .org-text .meta, .org-count span, .hire-note,
.staff-page label.field > span, .unit-page label.field > span, .person-card label.field > span, .unit-card label.field > span,
.person-card .kv dt, .unit-card .kv dt { color: var(--ink); }
.person-card .tabs a, .unit-card .tabs a { min-height: var(--tap); display: inline-flex; align-items: center; padding: 12px 16px; color: var(--ink); }
.roster-ava { width: 40px; height: 40px; font-size: var(--fs-base); }
.staff-page .org-line .btn, .unit-page .org-line .btn { min-height: var(--tap); }
@media (max-width: 640px) {
  .org-line { flex-wrap: wrap; }
  .org-count { margin-left: 0; }
}
.brief li { min-width: 0; }

/* колокольчик: «Цены расходятся» — строкой под плитками, ведёт в «Объекты → Цена расходится» */
.bell-alert { display: flex; align-items: flex-start; gap: 10px; margin: 6px 4px 2px; padding: 9px 10px; border-left: 3px solid var(--bm-orange); border-radius: 0 var(--r-2) var(--r-2) 0; background: #FFF6EC; }
.bell-alert .i { flex: none; width: 18px; height: 18px; flex-basis: 18px; margin-top: 1px; color: #B35A00; }
.bell-alert span { display: grid; gap: 1px; min-width: 0; }
.bell-alert b { font-size: var(--fs-base); font-weight: 600; }
.bell-alert small { font-size: var(--fs-sm); color: var(--ink-2); }
.bell-alert:hover { background: #FDEBD6; }

/* карта бизнесов в «Объектах» и «Авито»: те же фильтры, точка — станция метро */
.bmap { position: relative; margin: 8px 0 18px; }
.bmap-view { position: relative; height: clamp(420px, 72vh, 760px); overflow: hidden; border-radius: var(--r-3); background: #E6E4DF; cursor: grab; touch-action: none; }
.bmap-view:focus-visible { outline: 2px solid var(--bm-orange); outline-offset: 2px; }
.bmap-view.dragging { cursor: grabbing; }
.bmap-tiles, .bmap-pins, .bmap-view .bmap-base { position: absolute; inset: 0; }
.bmap-tiles img { position: absolute; width: 256px; height: 256px; user-select: none; }
.bmap-pins { z-index: 1; pointer-events: none; }
.bmap-pins > * { pointer-events: auto; }
.bmap-pin { position: absolute; transform: translate(-50%, calc(-100% - 5px)); margin: 0; padding: 4px 8px; border: 0; border-radius: var(--r-1); background: var(--bm-white); box-shadow: 0 2px 8px rgba(20, 24, 28, .2); color: var(--bm-graphite); font: 700 12px/1.2 inherit; white-space: nowrap; cursor: pointer; }
.bmap-pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--bm-white); border-bottom: 0; }
.bmap-pin.on { background: var(--bm-graphite); color: var(--bm-white); }
.bmap-pin.on::after { border-top-color: var(--bm-graphite); }
.bmap-cluster { transform: translate(-50%, -50%); width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--bm-graphite); color: var(--bm-white); font-size: var(--fs-base); }
.bmap-cluster::after { display: none; }
@media (pointer: coarse) {
  .bmap-pin::before { content: ""; position: absolute; inset: -10px -6px; }
  .bmap-cluster { width: var(--tap); height: var(--tap); }
}
.bmap-card { position: absolute; z-index: 2; width: 232px; overflow: hidden; border-radius: var(--r-2); background: var(--bm-white); box-shadow: 0 10px 28px rgba(20, 24, 28, .22); }
.bmap-card a { display: block; color: inherit; text-decoration: none; }
.bmap-card img { display: block; width: 100%; height: 112px; object-fit: cover; background: var(--surface-2); }
.bmap-card-t { display: grid; gap: 2px; padding: 10px 12px 12px; }
.bmap-card-t b { font-size: var(--fs-base); line-height: 1.3; }
.bmap-card-t small { color: var(--bm-sage); font-size: var(--fs-sm); }
.bmap-card-t em { font-style: normal; font-weight: 800; font-size: var(--fs-base); }
.bmap-card-h { margin: 0; padding: 10px 12px 6px; font-weight: 700; font-size: var(--fs-base); color: var(--ink); }
.bmap-list { max-height: 264px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0 0 4px; list-style: none; }
.bmap-list a { display: grid; gap: 2px; min-height: 44px; padding: 8px 12px; border-top: 1px solid var(--bm-line); color: inherit; text-decoration: none; }
.bmap-list a:hover, .bmap-list a:focus-visible { background: var(--bm-paper); }
.bmap-list b { font-size: var(--fs-base); line-height: 1.3; }
.bmap-list em { font-style: normal; font-weight: 800; font-size: var(--fs-sm); }
.bmap-tools { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; gap: 6px; }
.bmap-tools button { width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r-2); background: var(--bm-white); box-shadow: 0 2px 8px rgba(20, 24, 28, .18); font: 700 18px/1 inherit; cursor: pointer; }
.bmap-copy { position: absolute; left: 10px; bottom: 8px; z-index: 2; margin: 0; padding: 2px 6px; border-radius: var(--r-1); background: rgba(255, 255, 255, .86); color: var(--bm-sage); font-size: var(--fs-xs); }
.bmap-copy a { color: inherit; }
.bmap-empty { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); margin: 0; padding: 10px 14px; border-radius: var(--r-2); background: var(--bm-white); font-weight: 600; }
.bmap-off { margin: 0 0 18px; }
.bmap-off h2 { margin: 0 0 4px; font-size: var(--fs-md); }
.bmap-off ul { list-style: none; margin: 8px 0 0; padding: 0; }
.bmap-off li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bm-line); }
.bmap-off span { color: var(--bm-sage); font-size: var(--fs-base); text-align: right; }

.cm-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--r-3); background: var(--bm-white);
  color: var(--bm-graphite); box-shadow: 0 24px 60px rgba(35, 39, 43, .22); }
.cm-dialog::backdrop { background: rgba(35, 39, 43, .45); }
.cm-dialog[open] { animation: cm-in .16s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cm-panel { display: grid; gap: 12px; padding: 18px 20px 20px; }
.cm-panel h3 { margin: 0; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; }
.cm-panel .cm-foot { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 767px) {
  .cm-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--r-3) var(--r-3) 0 0; max-height: 92dvh; }
}
@media (prefers-reduced-motion: reduce) { .cm-dialog[open] { animation: none; } }

/* Вход с телефона: QR на компьютере, подтверждение, страницы телефона */
.pl-dialog { width: min(480px, calc(100vw - 32px)); }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-close { display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: var(--r-2); background: none; color: inherit; cursor: pointer; }
.pl-close:hover, .pl-close:focus-visible { background: var(--bm-paper); }
.pl-close .i { width: 20px; height: 20px; }
#phone-login-body { display: grid; gap: 14px; }
.pl-grid { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 20px; align-items: center; }
.pl-grid[hidden] { display: none; }
.pl-qr { display: block; width: 184px; height: 184px; padding: 6px; border-radius: var(--r-2); background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--bm-line); }
.pl-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--fs-base); }
.pl-steps li::marker { color: var(--bm-orange); font-weight: 800; }
.pl-code-label { margin: 14px 0 2px; color: var(--bm-sage); font-size: var(--fs-sm); }
.pl-code { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.pl-state { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--bm-line); }
.pl-msg { margin: 0; }
.pl-msg:has(.pl-dot) { display: flex; align-items: center; gap: 8px; }
.pl-note { margin: 0; color: var(--bm-sage); font-size: var(--fs-sm); }
.pl-pending { border-top-color: var(--bm-orange); }
.pl-ok { font-weight: 700; }
.pl-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bm-orange); animation: pl-pulse 1.4s ease-in-out infinite; }
@keyframes pl-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pl-dot { animation: none; } }
@media (max-width: 520px) {
  .pl-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}
/* на телефоне и планшете QR сканировать нечем — кнопки нет */
@media (pointer: coarse) { .top-phone, .me-phone { display: none; } }
.pl-check { display: flex; align-items: center; gap: 16px; }
.pl-match { flex: none; margin: 0; font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pl-check .pl-match { padding-right: 16px; border-right: 2px solid var(--bm-orange); }
.pl-check .pl-msg + .pl-note { margin-top: 4px; }
.auth .pl-match { margin: 4px 0 16px; font-size: 56px; }
.pl-howto { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; }
.pl-howto li::marker { color: var(--bm-orange); font-weight: 800; }
.pl-code-input { font-size: 24px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.auth .pl-code-entry, .auth .pl-app-link { margin-top: 8px; }

/* Шаг 5: строка человека, следующий шаг, запрос, цена объекта */
.card-head:has(.person) .page-head { margin-bottom: 4px; }
.person { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 0 0 6px; min-width: 0; }
.person-ava { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.person-name { font-size: var(--fs-base); font-weight: 600; color: var(--bm-graphite); text-decoration: none; }
.person-name:hover { color: var(--bm-orange); }
.person-phone { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.person-actions { display: inline-flex; align-items: center; gap: 4px; }
.person-actions .pa { width: 32px; min-width: 32px; min-height: 32px; padding: 0; justify-content: center; }
.person-more { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.person-more:hover { color: var(--bm-orange); }
.person-broker { margin: 8px 0 10px; font-size: var(--fs-base); font-weight: 600; color: var(--bm-graphite); }
.person-broker::before { content: "Ответственный брокер "; color: var(--ink-3); font-weight: 600; }
.seller-price { font-size: var(--fs-md); font-weight: 800; color: var(--bm-graphite); }
.next-step { border: 1px solid var(--bm-line); border-left: 3px solid var(--bm-orange); border-radius: var(--r-2); background: var(--bm-white); }
.next-step .small { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.next-acts { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.next-acts form { margin: 0; }
.seek { margin: 0 0 8px; border: 1px solid var(--bm-line); border-radius: var(--r-2); background: var(--bm-white); }
.seek > summary { display: flex; align-items: baseline; gap: 12px; padding: 8px 12px; cursor: pointer; list-style: none; }
.seek-budget { margin-left: auto; }
.seek > summary::after { content: ""; width: 7px; height: 7px; flex: none; align-self: center; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); }
.seek[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.seek > summary::-webkit-details-marker { display: none; }
.seek-what { font-size: var(--fs-base); color: var(--ink-2); min-width: 0; }
.seek-budget { font-size: var(--fs-md); font-weight: 800; color: var(--bm-graphite); white-space: nowrap; }
.seek .kv, .seek .btn-row { margin: 0 12px 12px; }
.fold { margin: 0 0 8px; }
.fold > summary { cursor: pointer; font-size: var(--fs-base); font-weight: 600; color: var(--ink-2); }
.obj-price .value { font-size: var(--fs-2xl); }
.obj-facts dd { font-size: var(--fs-base); }
.obj-facts .obj-key dd { font-size: var(--fs-md); font-weight: 600; }
.obj-seller-name { font-size: var(--fs-md); font-weight: 600; }
.obj-seller-phone { font-size: var(--fs-base); font-weight: 600; }
@media (max-width: 767px) {
  .card-head .page-head { align-items: flex-start; }
}
.type-line { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.type-line .badge { min-height: 22px; font-size: var(--fs-xs); }

/* Карточки клиента: заметные переходы, без изменения остальных вкладок CRM. */
.person-more.btn { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; min-height: 35px; padding: 7px 12px; border: 1px solid var(--bm-line); border-radius: var(--r-1); background: var(--bm-white); color: var(--bm-graphite); font-size: var(--fs-sm); font-weight: 600; }
.person-more.btn:hover { background: var(--bm-paper); border-color: var(--line-2); }
.seek-spheres { font-size: var(--fs-md); font-weight: 700; color: var(--bm-graphite); }
.client-card-tabs { flex-wrap: wrap; gap: 7px; overflow: visible; border-bottom: 0; }
.client-card-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 13px; border: 1px solid var(--bm-line); border-radius: var(--r-1); color: var(--ink-2); background: var(--bm-white); font-size: var(--fs-base); font-weight: 600; }
.client-card-tabs a:hover { background: var(--bm-paper); border-color: var(--line-2); }
.client-card-tabs a.active { background: var(--bm-graphite); border-color: var(--bm-graphite); color: var(--bm-white); }
.client-card-tabs a.active .i { color: var(--bm-orange); }
@media (max-width: 767px) {
  .person-more.btn { margin-left: 0; min-height: var(--tap); }
  .client-card-tabs a { min-height: var(--tap); }
}

/* Параметры и описание доступны сразу под галереей на каждой вкладке объекта. */
.object-overview { display: grid; gap: 14px; margin: 18px 0 14px; }
.object-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.object-section-head h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 700; }
.object-section-head h2 .i { color: var(--bm-orange); }
.object-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.object-summary-grid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--bm-line); }
.object-summary-grid dt { font-size: var(--fs-sm); color: var(--ink-3); }
.object-summary-grid dd { margin: 0; min-width: 0; text-align: right; font-size: var(--fs-base); font-weight: 600; overflow-wrap: anywhere; }
.object-sale-reason { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: var(--fs-base); margin: 12px 0 0; }
.object-sale-reason span { color: var(--ink-3); }
.object-description { display: flex; flex-direction: column; align-items: flex-start; }
.object-description-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 90ch; font-size: var(--fs-base); line-height: 1.75; }
.object-description:has(.object-description-toggle:not([open])) .object-description-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden; }
.object-description-toggle { order: 1; margin-top: 12px; }
.object-description-toggle summary { list-style: none; cursor: pointer; }
.object-description-toggle summary::-webkit-details-marker { display: none; }
.object-read-less, .object-description-toggle[open] .object-read-more { display: none; }
.object-description-toggle[open] .object-read-less { display: inline; }
.object-description-toggle[open] .i { transform: rotate(180deg); }
.object-description > a { margin-top: 12px; order: 2; }
.object-details { border: 1px solid var(--bm-line); border-radius: var(--r-2); overflow: hidden; }
.object-detail + .object-detail { border-top: 1px solid var(--bm-line); }
.object-detail > summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--bm-paper); font-size: var(--fs-base); font-weight: 600; list-style: none; cursor: pointer; }
.object-detail > summary::-webkit-details-marker { display: none; }
.object-detail > summary .i:last-child { margin-left: auto; }
.object-detail[open] > summary .i:last-child { transform: rotate(180deg); }
.object-detail-body { padding: 14px 16px; }
@media (max-width: 650px) {
  .object-summary-grid { grid-template-columns: 1fr; }
  .object-overview .info-block { padding: 14px; }
  .object-section-head .btn, .object-description-toggle summary, .object-detail > summary { min-height: var(--tap); }
}

/* Мобильная карточка клиента: данные важнее служебных действий. */
@media (max-width: 767px) {
  .main:has(.client-id) .back-link { margin-bottom: 10px; font-size: var(--fs-sm); }
  .main:has(.client-id) .client-id { font-size: var(--fs-xs); line-height: 1.5; margin-bottom: 6px; }
  .main:has(.client-id) .card-head { position: static; padding-top: 4px; margin-bottom: 6px; }
  .main:has(.client-id) .card-head h1 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.35; }
  .main:has(.client-id) .page-head { gap: 8px; }
  .main:has(.client-id) .head-actions { width: 100%; margin: 0; }
  .main:has(.client-id) .name-tools { justify-content: flex-start; gap: 8px; padding: 5px 0; }
  .main:has(.client-id) .name-tools .head-brief,
  .main:has(.client-id) .name-tools .head-task { height: 28px; min-height: 28px; padding: 0 10px; font-size: var(--fs-sm); font-weight: 700; border-radius: var(--r-1); position: relative; }
  .main:has(.client-id) .head-brief::after, .main:has(.client-id) .head-task::after { content: ""; position: absolute; inset: -5px 0; }
  .main:has(.client-id) .person { gap: 5px 8px; }
  .main:has(.client-id) .person-more.btn { padding: 6px 9px; font-size: var(--fs-xs); }
  .main:has(.client-id) .type-line { margin: 8px 0 12px; font-size: var(--fs-xs); }
  .main:has(.client-id) .seek > summary { flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; }
  .main:has(.client-id) .seek-what { flex-basis: 100%; line-height: 1.6; }
  .main:has(.client-id) .seek-budget { margin-left: 0; font-size: var(--fs-lg); }
  .main:has(.client-id) .seek > summary::after { margin-left: auto; }
  .main:has(.client-id) .comments { margin: 12px 0 14px; }
  .main:has(.client-id) .comments-one .note-line { white-space: pre-wrap; overflow: visible; text-overflow: clip; font-size: var(--fs-md); line-height: 1.6; }
  .main:has(.client-id) .comments-one .comments-head h2 { font-size: var(--fs-base); }
  .main:has(.client-id) .comments-one .cm-add { min-height: var(--tap); min-width: var(--tap); }
  .main:has(.client-id) .client-card-tabs { margin-top: 12px; }
  .main:has(.client-id) .client-card-tabs a { padding: 7px 10px; font-size: var(--fs-sm); }
}
@media (max-width: 767px) {
  .main:has(.client-id) .head-actions { justify-content: flex-start; }
  .main:has(.client-id) .next-step { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .main:has(.client-id) .next-step .grow { flex-basis: 100%; }
  .main:has(.client-id) .next-acts .btn { font-size: var(--fs-sm); padding: 6px 10px; }
}
@media (max-width: 767px) {
  .main:has(.client-id) .card-head .page-head { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 8px 6px; }
  .main:has(.client-id) .card-head .name-row, .main:has(.client-id) .placement-row { display: contents; }
  .main:has(.client-id) .card-head h1 { grid-column: 1 / -1; }
  .main:has(.client-id) .name-status { grid-column: 1; min-width: 0; }
  .main:has(.client-id) .name-status .badge { font-size: var(--fs-xs); padding: 4px 6px; line-height: 1.3; white-space: normal; }
  .main:has(.client-id) .status-menu { max-width: 100%; }
  .main:has(.client-id) .head-actions, .main:has(.client-id) .placement-row .name-tools { grid-column: 2; width: auto; }
  .main:has(.client-id) .name-tools { flex-wrap: nowrap; gap: 5px; padding: 5px 0; }
  .main:has(.client-id) .name-tools .head-brief, .main:has(.client-id) .name-tools .head-task { padding: 0 7px; font-size: var(--fs-xs); }
  .main:has(.client-id) .placement-row .placement { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; }
  .main:has(.client-id) .brief-wait { position: absolute; top: 100%; right: 0; max-width: 100%; background: var(--bm-white); }
}
@media (max-width: 767px) {
  .main:has(.client-id) .card-head h1 { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
  .main:has(.client-id) .person-phone { font-size: 16px; font-weight: 700; }
}

/* Имя и телефон — главные ориентиры в мобильном списке клиентов. */
@media (max-width: 767px) {
  .ct-name .title { font-size: 17px; font-weight: 750; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
  .ct-phone .num { font-size: 16px; font-weight: 700; line-height: 1.4; }
}

/* Настраиваемые колонки клиентов. Мобильные карточки сохраняют свой порядок. */
.ct-sizing { display: none; }
@media (min-width: 1101px) {
  .ct-sizing { display: flex; align-items: center; gap: 14px; min-height: 32px; color: var(--ink-3); font-size: var(--fs-xs); }
  .ct-reset { border: 0; background: transparent; padding: 5px 0; color: var(--ink-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .ct-viewport { overflow-x: auto; }
  .ct { width: 100%; min-width: 0; }
  .ct-row { grid-template-columns: var(--ct-columns, 48px minmax(80px,.95fr) 184px minmax(80px,1.1fr) 172px minmax(140px,1.45fr)); }
  .ct-head { top: 0; }
  .ct-head > span { position: relative; min-width: 0; padding-right: 12px; }
  .ct-resize { position: absolute; right: -6px; top: -6px; bottom: -6px; width: 12px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
  .ct-resize::after { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: 2px; border-radius: 2px; background: var(--bm-line); }
  .ct-resize:hover::after, .ct-resize:focus-visible::after { background: var(--bm-orange); }
  .ct-resize:focus-visible { outline: 1px solid var(--bm-orange); }
  .ct-resizing { user-select: none; cursor: col-resize; }
  .ct-actions { flex-wrap: nowrap; }
  .ct-actions > * { flex-shrink: 0; }
  .ct-note { max-height: 4.05em; overflow-y: auto; scrollbar-gutter: stable; scrollbar-color: var(--ink-3) var(--bm-paper); }
}

@media (min-width: 1101px) {
  .ct-row > [role="cell"] { min-width: 0; }
  .ct-note { width: 0; max-width: 100%; overflow-x: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
}

.ct-head > span { overflow-wrap: anywhere; }

/* «Авито»: значок состояния сканера в шапке раздела */
.scn-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 1px solid var(--bm-line); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--bm-graphite); text-decoration: none; white-space: nowrap; }
.scn-pill:hover, .scn-pill:focus-visible { border-color: var(--bm-graphite); }
.scn-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--bm-sage); }
.scn-ok .scn-dot { background: #2E9E5B; }
.scn-warn .scn-dot { background: var(--bm-amber); }
.scn-bad .scn-dot { background: var(--bm-danger); }
.scn-pill.scn-bad { border-color: var(--bm-danger); color: var(--bm-danger); }
@media (max-width: 767px) { .scn-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; } }
.av-vweek { color: var(--bm-orange); font-weight: 600; font-size: 12px; }

/* «Калькулятор БМ» по аналитике Авито: значение справа, пояснение строкой ниже */
.obj-facts .obj-calc { flex-wrap: wrap; row-gap: 4px; }
.obj-facts .obj-calc-note { flex-basis: 100%; text-align: left; font-weight: 500; font-size: var(--fs-sm); color: var(--bm-sage); line-height: 1.35; }
.obj-facts .obj-calc-warn { color: var(--bm-graphite); border-left: 2px solid var(--bm-orange); padding-left: 8px; }

/* Сфера и ниша: полные названия БМ читаются на узком экране. */
.business-taxonomy-fields > * { min-width: 0; }
@media (max-width: 600px) { .business-taxonomy-fields { grid-template-columns: minmax(0, 1fr); } }
.business-taxonomy-fields .field > span { color: var(--ink2); }
.business-taxonomy-fields label.field select { background-image: none; appearance: auto; }
.business-taxonomy-fields select:focus-visible { outline: 2px solid var(--accent, #F5921E); outline-offset: 2px; }
