/* Pigeon CRM V2 — фирменный стиль: графит, молочный фон, сдержанное золото, знак — голубь в медальоне.
   Шрифты лежат на нашем сервере (Manrope — текст и цифры, Playfair Display — заголовки). */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/v2/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/v2/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/v2/fonts/playfair-display-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/v2/fonts/playfair-display-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --milk: #f4f1ea; --paper: #ffffff; --sunk: #ece8df; --ink: #1b1920; --ink2: #3e3b45; --muted: #66626e; --faint: #75717d;
  --hair: #e3ded3; --hair2: #eeeae2; --gold: #8a5c12; --gold2: #a0701f; --gold-soft: #f2e9d6; --gold-line: #c9a55e; --on-gold: #ffffff;
  --red: #a0352a; --red-soft: #f7e4df; --green: #2f6648; --green-soft: #e3efe7; --side: #1c1a21; --side2: #29272f; --side-ink: #e3dfd7;
  --side-mute: #9893a0; --band: #1f1d24; --band-ink: #f1ede5; --band-mute: #aaa5b1;
  --blue: #275a8c; --blue-soft: #e1ebf5; --plum: #6d3d7d; --plum-soft: #f0e6f3; --teal: #22676a; --teal-soft: #ddeeed; --indigo: #46499a; --indigo-soft: #e6e6f6;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --milk: #131216; --paper: #1b1a20; --sunk: #232128; --ink: #f0ece4; --ink2: #d0cbc2; --muted: #a39ea9; --faint: #9a95a1;
  --hair: #2f2d35; --hair2: #26242b; --gold: #d6a74f; --gold2: #e4ba68; --gold-soft: #33291a; --gold-line: #8a6a33; --on-gold: #1b1920;
  --red: #ef8f81; --red-soft: #3a2320; --green: #8ccaa5; --green-soft: #1d2f25; --side: #0f0e12; --side2: #222027;
  --band: #0f0e12; color-scheme: dark;
  --blue: #8db8e6; --blue-soft: #1c2836; --plum: #d2a6e0; --plum-soft: #2d2033; --teal: #85cfcf; --teal-soft: #19302f; --indigo: #a9acf0; --indigo-soft: #23243c; } }
:root[data-theme="dark"] {
  --milk: #131216; --paper: #1b1a20; --sunk: #232128; --ink: #f0ece4; --ink2: #d0cbc2; --muted: #a39ea9; --faint: #9a95a1;
  --hair: #2f2d35; --hair2: #26242b; --gold: #d6a74f; --gold2: #e4ba68; --gold-soft: #33291a; --gold-line: #8a6a33; --on-gold: #1b1920;
  --red: #ef8f81; --red-soft: #3a2320; --green: #8ccaa5; --green-soft: #1d2f25; --side: #0f0e12; --side2: #222027;
  --band: #0f0e12; color-scheme: dark;
  --blue: #8db8e6; --blue-soft: #1c2836; --plum: #d2a6e0; --plum-soft: #2d2033; --teal: #85cfcf; --teal-soft: #19302f; --indigo: #a9acf0; --indigo-soft: #23243c; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--milk); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* знак: голубь в золотом медальоне */
.mark { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--gold-line); background: #2b2620; }
.mark img { width: 100%; height: 100%; display: block; object-fit: cover; animation: mark-in .45s ease-out both; }
@keyframes mark-in { from { transform: scale(.92); opacity: .5; } to { transform: none; opacity: 1; } }

/* загрузка, вход, «не включено» */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--milk); }
.boot .mark { width: 64px; height: 64px; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 380px; background: var(--paper); border-radius: 18px; padding: 30px 26px; box-shadow: 0 0 0 1px var(--hair), 0 20px 60px rgba(27, 25, 32, .07); display: grid; gap: 12px; }
.gate-card .logo { width: 132px; height: 132px; margin: 0 auto 6px; display: block; }
.gate-card h1 { font: 700 24px/1.2 var(--display); margin: 0; text-align: center; }
.gate-card p { margin: 0; color: var(--muted); text-align: center; }
.gate-card input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--hair); background: var(--milk); }
.gate-card .err { color: var(--red); min-height: 1.5em; text-align: center; font-size: 14px; }

/* каркас */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side) 240px, transparent 240px); }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 22px 12px 14px; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; text-decoration: none; }
.brand b { font: 700 17px/1.15 var(--display); display: block; letter-spacing: 0; }
.brand small { font-size: 10.5px; color: var(--gold-line); letter-spacing: .16em; font-weight: 800; text-transform: uppercase; }
.org { margin: 0 4px 18px; padding: 10px 12px; border-radius: 12px; background: var(--side2); display: grid; gap: 2px; }
.org b { font-size: 14px; font-weight: 700; }
.org select { background: transparent; border: 0; color: var(--side-mute); font-size: 12.5px; padding: 0; margin: 0 -2px; cursor: pointer; }
.org select option { color: #1b1920; }
.org span { color: var(--side-mute); font-size: 12.5px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); text-decoration: none; padding: 10px 11px; border-radius: 10px; font-weight: 650; font-size: 14.5px; position: relative; transition: background-color .16s ease, color .16s ease; }
.nav a:hover { background: var(--side2); }
.nav a.on { background: var(--side2); color: #fff; }
/* активный пункт — сдержанная золотая линия (корона — только в логотипе) */
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-line); }
.nav a.on svg { color: #e4ba68; }
.nav svg, .tabbar svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .c { margin-left: auto; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); font-variant-numeric: tabular-nums; }
.nav .c.hot { background: #c9a55e; color: #1b1920; }
.nav .old { margin-left: auto; color: var(--side-mute); font-size: 11px; font-weight: 600; }
.nav .c + .old { margin-left: 6px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 12px 8px; }
.me { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 10px; position: relative; }
.ava { width: 36px; height: 36px; border-radius: 50%; background: var(--side2); display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-mute); font-size: 12px; }
.me-btn { border: 0; background: none; color: var(--side-mute); padding: 6px; border-radius: 8px; }
.me-btn:hover { background: var(--side2); color: var(--side-ink); }
.menu { position: absolute; z-index: 40; min-width: 230px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 6px; box-shadow: 0 0 0 1px var(--hair), 0 16px 40px rgba(27, 25, 32, .18); display: grid; }
.menu a, .menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--sunk); }
.menu small { padding: 6px 12px 4px; color: var(--muted); font-size: 12px; }
.side .menu { left: 8px; bottom: 56px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--hair); background: var(--paper); position: sticky; top: 0; z-index: 20; min-height: 64px; }
.top .title { display: none; }
.top .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 99px; background: var(--sunk); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.pill.warn i { background: var(--red); }
.pill.warn { color: var(--red); background: var(--red-soft); }
.conn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 99px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.banner { margin: 16px 28px 0; padding: 12px 16px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.banner.bad { background: var(--red-soft); }
.banner b { font-weight: 750; }
.banner .btn { margin-left: auto; }
.view { padding: 26px 28px 48px; max-width: 1440px; width: 100%; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 14px;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--hair); text-decoration: none; white-space: nowrap; color: var(--ink);
  transition: background-color .16s ease, box-shadow .16s ease, transform .12s ease; }
.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.pri { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn.pri:hover { background: var(--ink2); }
.btn.gold { background: var(--gold); color: var(--on-gold); box-shadow: none; }
.btn.gold:hover { background: var(--gold2); }
.btn.ghost { background: none; box-shadow: none; color: var(--gold); padding: 6px 4px; }
.btn.ghost:hover { text-decoration: underline; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* заголовок экрана */
.hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hd h1 { font: 700 30px/1.15 var(--display); margin: 0 0 6px; letter-spacing: 0; }
.hd .sub { color: var(--muted); margin: 0; font-size: 14.5px; }
.hd .act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* фокус-панель «Что сейчас» */
.band { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px 28px; align-items: center;
  background: var(--band); color: var(--band-ink); border-radius: 14px; padding: 15px 20px; margin-bottom: 22px; box-shadow: inset 0 0 0 1px #3d3628; }
.band::after { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 48px; background: #c9a55e; }
.band .k { font-size: 12px; color: var(--band-mute); font-weight: 650; }
.band .v { font-size: 24px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.band .v small { font-size: 13.5px; font-weight: 650; color: var(--band-mute); }
.band .v.hot { color: #f0a493; }
.band .v.ok { color: #9fd4b3; font-size: 17px; }
.band .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.band .t small { color: var(--band-mute); font-weight: 600; font-size: 13px; }
.band .go { justify-self: end; }
.band .btn.gold { background: #c9a55e; color: #1b1920; }
.band .btn.gold:hover { background: #d8b673; }
.band > :not(.deco) { position: relative; z-index: 1; }
.band .deco { position: absolute; right: 0; top: 0; bottom: 0; width: 230px; pointer-events: none; opacity: .26; overflow: hidden; }
.band .deco svg { position: absolute; right: -24px; top: 50%; transform: translateY(-50%); height: 165%; width: auto; fill: none; stroke: #e4ba68; stroke-width: 1.4; }

/* блоки */
.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.col { display: grid; gap: 22px; min-width: 0; }
.sec { background: var(--paper); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--hair2), 0 1px 2px rgba(27, 25, 32, .03); min-width: 0; overflow: hidden; }
.sh { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; flex-wrap: wrap; }
.sh h2 { font: 700 18px/1.25 var(--display); margin: 0; letter-spacing: 0; }
.sh .hint { margin-left: auto; color: var(--muted); font-size: 13px; }
.sh .btn.ghost { margin-left: auto; }
.cnt { font-size: 12.5px; font-weight: 800; padding: 1px 9px; border-radius: 99px; background: var(--sunk); color: var(--ink2); font-variant-numeric: tabular-nums; }
.cnt.hot { background: var(--red-soft); color: var(--red); }
.foot { padding: 12px 20px 16px; color: var(--muted); font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--hair2); }
.foot a { color: var(--gold); font-weight: 700; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* строки списков */
.rows { display: grid; }
.row { display: grid; align-items: center; gap: 6px 16px; padding: 12px 20px; border-top: 1px solid var(--hair2); position: relative; transition: background-color .16s ease, box-shadow .16s ease; }
.row.click { cursor: pointer; }
.row.click:hover { background: color-mix(in srgb, var(--sunk) 45%, transparent); box-shadow: inset 3px 0 0 var(--gold-line); }
.row.urgent { background: color-mix(in srgb, var(--red-soft) 55%, transparent); }
.row.urgent.click:hover { box-shadow: inset 3px 0 0 var(--red); }
.row .acts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.who-l b { font-weight: 750; font-size: 14.5px; }
.who-l .meta { color: var(--muted); font-size: 12.5px; display: block; }
.chn { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--faint); margin-left: 6px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 1px 8px; border-radius: 6px; background: var(--sunk); color: var(--ink2); margin-right: 6px; vertical-align: 1px; white-space: nowrap; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.ai { background: none; box-shadow: inset 0 0 0 1px var(--hair); color: var(--muted); font-weight: 650; }
.msg { min-width: 0; color: var(--ink2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-size: 14px; }
.wait.warn { color: var(--gold); }
.wait.late { color: var(--red); }
.reply .row { grid-template-columns: minmax(170px, 1.15fr) minmax(0, 2fr) 92px 110px; }
.thead { display: grid; grid-template-columns: minmax(170px, 1.15fr) minmax(0, 2fr) 92px 110px; gap: 16px; padding: 0 20px 8px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 750; }
.thead span:nth-child(3) { text-align: right; }
.group { padding: 10px 20px 6px; font-size: 12.5px; font-weight: 750; color: var(--muted); border-top: 1px solid var(--hair2); display: flex; gap: 8px; align-items: baseline; }
.group b { color: var(--ink); }
.group.urgent b { color: var(--red); }
.todo .row { grid-template-columns: 62px minmax(0, 1fr) auto; }
.todo .row.many .acts { grid-column: 2 / -1; justify-content: flex-start; }
.when { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink2); }
.when.late { color: var(--red); }
.todo .txt, .win .txt { min-width: 0; }
.todo .txt b, .win .txt b { font-weight: 750; font-size: 14.5px; }
.kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }
.kind.red { color: var(--red); }
.kind.gold { color: var(--gold); }
.line { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win .row { grid-template-columns: minmax(0, 1fr) auto; }
.handover { display: flex; gap: 12px; align-items: center; padding: 14px 20px; flex-wrap: wrap; }
.handover .txt { flex: 1; min-width: 200px; font-size: 14px; }

/* пустые состояния: фирменный голубь, без шуток */
.estate { display: grid; justify-items: center; gap: 8px; padding: 26px 20px 32px; text-align: center; border-top: 1px solid var(--hair2); }
.estate img { width: 132px; height: auto; display: block; animation: rise .5s ease-out both; }
.estate b { font: 700 17px/1.3 var(--display); }
.estate span { color: var(--muted); font-size: 14px; max-width: 360px; }
.estate.small img { width: 96px; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--sunk), var(--hair2), var(--sunk)); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin: 16px 20px; }
@keyframes sk { to { background-position: -200% 0; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); animation: rise .2s ease-out both; }

.tabbar { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* планшет */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .band { grid-template-columns: auto minmax(0, 1fr) auto; }
  .band .b3 { display: none; }
}

/* телефон: нижнее меню, строки — карточками */
@media (max-width: 760px) {
  .app { display: block; padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .side { display: none; }
  .top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top, 0px)); min-height: 56px; gap: 10px; }
  .top .title { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; min-width: 0; }
  .top .title .mark { width: 32px; height: 32px; }
  .top .pill span, .conn span { display: none; }
  .top .pill, .conn { padding: 8px; }
  .top .me-top { display: grid; }
  .banner { margin: 12px 16px 0; }
  .view { padding: 18px 16px 32px; }
  .hd { margin-bottom: 16px; align-items: flex-start; }
  .hd h1 { font-size: 24px; }
  .hd .act { width: 100%; }
  .hd .act .btn { flex: 1; }
  .band { grid-template-columns: 1fr 1fr; padding: 14px 16px; gap: 12px 16px; margin-bottom: 16px; }
  .band .b2 { grid-column: 1 / -1; }
  .band .b3 { display: block; }
  .band .go { grid-column: 1 / -1; justify-self: stretch; }
  .band .go .btn { width: 100%; }
  .band .deco { display: none; }
  .grid, .col { gap: 16px; }
  .sh { padding: 16px 16px 10px; }
  .thead { display: none; }
  .reply .row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "who wait act" "msg msg msg"; padding: 12px 16px; gap: 4px 12px; }
  .reply .row .who-l { grid-area: who; min-width: 0; }
  .reply .row .msg { grid-area: msg; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .reply .row .wait { grid-area: wait; }
  .reply .row .acts { grid-area: act; }
  .todo .row { grid-template-columns: 50px minmax(0, 1fr); padding: 12px 16px; }
  .todo .row .acts { grid-column: 2; justify-content: flex-start; }
  .win .row { padding: 12px 16px; }
  .group, .foot { padding-left: 16px; padding-right: 16px; }
  .group span { display: none; }
  .app { background: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper);
    border-top: 1px solid var(--hair); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px 2px; position: relative; }
  .tabbar .on { color: var(--gold); }
  .tabbar .c { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10.5px; font-weight: 800; background: var(--gold); color: var(--on-gold); border-radius: 99px; padding: 0 6px; line-height: 16px; }
  .top .menu { right: 12px; top: 54px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 761px) { .top .me-top { display: none; } .hd .mob-branch { display: none; } }
.me-top { border: 0; color: var(--side-ink); background: var(--side); }
.hd .mob-branch { appearance: auto; padding: 9px 12px; }

/* ===== Переписки: список · переписка · карточка ===== */
.view.full { padding: 0; max-width: none; }
.chats { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 64px); min-height: 0; }
.chats.card-open { grid-template-columns: 340px minmax(0, 1fr) 372px; }
.cl { border-right: 1px solid var(--hair); background: var(--paper); display: flex; flex-direction: column; min-height: 0; }
.cl-top { display: flex; gap: 8px; padding: 14px 14px 8px; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--milk); font-size: 14px; }
.tabs { display: flex; gap: 2px; background: var(--sunk); border-radius: 10px; padding: 3px; margin: 0 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.tabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 25, 32, .08); }
.tabs .num { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.cl-sub { display: flex; gap: 8px; padding: 8px 14px; }
.cl-sub select { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; }
.filters { display: grid; gap: 6px; padding: 4px 14px 10px; border-bottom: 1px solid var(--hair2); }
.filters select { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.cl-list { overflow-y: auto; flex: 1; min-height: 0; border-top: 1px solid var(--hair2); }
.ci { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--hair2); text-decoration: none; color: inherit; position: relative;
  transition: background-color .16s ease, box-shadow .16s ease; }
.ci:hover { background: color-mix(in srgb, var(--sunk) 45%, transparent); }
.ci.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold-line); }
.ci.unread b { font-weight: 800; }
.ava.sm { width: 36px; height: 36px; font-size: 12px; background: var(--sunk); color: var(--ink2); }
.ci-b { min-width: 0; display: grid; gap: 2px; }
.ci-t { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ci-t b { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-t .chn { margin-left: 0; }
.own { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tm { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm.late { color: var(--red); font-weight: 750; }
.ci-p { font-size: 13.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-s { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ci-s .tag, .ci-s .stage { margin: 0; font-size: 11px; }
.star { color: var(--gold2); font-size: 13px; }
.badge { margin-left: auto; min-width: 20px; text-align: center; font-size: 11.5px; font-weight: 800; padding: 0 6px; border-radius: 99px; background: var(--gold); color: var(--on-gold); line-height: 19px; }
.stage { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 1px 8px; border-radius: 6px; background: var(--sunk); color: var(--ink2); white-space: nowrap; }
.stage.st-booked { background: var(--green-soft); color: var(--green); }
.stage.st-lost { background: var(--red-soft); color: var(--red); }
.stage.st-thinking, .stage.st-new { background: var(--gold-soft); color: var(--gold); }
.tag.green { background: var(--green-soft); color: var(--green); }

.cv { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--milk); position: relative; }
.cv-empty { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px; }
.cv-empty img { width: 132px; height: auto; }
.cv-empty b { font: 700 18px/1.3 var(--display); }
.cv-empty span { color: var(--muted); }
.cv-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 18px; background: var(--paper); border-bottom: 1px solid var(--hair); }
.cv-head .back { display: none; font-size: 28px; line-height: 1; text-decoration: none; padding: 0 6px 4px 0; color: var(--ink2); }
.cv-head .ava { background: var(--gold-soft); color: var(--gold); }
.cv-who { min-width: 0; flex: 1 1 220px; }
.cv-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cv-name b { font-size: 16px; font-weight: 800; }
.cv-name .tag { margin: 0; }
.cv-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-sub .wait { font-size: 13px; }
.cv-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; margin-left: auto; }
.btn.icon { padding: 6px 10px; }
.btn.fav { color: var(--gold2); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
/* длинная переписка прокручивается, сообщения не сжимаются по высоте */
.msgs > * { flex: none; }
.day { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0; }
.day span { background: var(--sunk); padding: 3px 12px; border-radius: 99px; }
.msg { max-width: min(560px, 78%); padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; box-shadow: 0 1px 2px rgba(27, 25, 32, .05); animation: rise .2s ease-out both; }
.msg.in { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg .mt { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .mm { font-size: 11.5px; opacity: .65; margin-top: 4px; }
.msg.undelivered { background: var(--red-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--red); }
.msg .ul { font-size: 12px; font-weight: 800; color: var(--red); margin-bottom: 4px; }
.link { border: 0; background: none; padding: 0; color: var(--gold); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }
.banner.window { margin: 0 18px 8px; font-size: 13.5px; }
.composer { background: var(--paper); border-top: 1px solid var(--hair); padding: 12px 18px 10px; display: grid; gap: 6px; }
.cmp-row { display: flex; gap: 10px; align-items: flex-end; }
.cmp-row textarea { flex: 1; min-width: 0; min-height: 44px; resize: none; border: 1px solid var(--hair); border-radius: 12px; padding: 10px 13px; background: var(--milk); font-size: 15px; line-height: 1.45; max-height: 180px; }
.cmp-row textarea:focus { outline: 2px solid var(--gold-line); outline-offset: 0; }
.cmp-row .btn { padding: 11px 18px; }
.cmp-tools { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.cmp-tools .btn.ghost { padding: 4px 0; font-size: 13.5px; }
.cmp-tools .hint { margin-left: auto; color: var(--faint); font-size: 12px; }
.ro-note { padding: 12px 18px; color: var(--muted); background: var(--paper); border-top: 1px solid var(--hair); }
.menu.pop { position: absolute; left: 18px; bottom: 108px; z-index: 30; max-height: 320px; overflow-y: auto; width: min(420px, calc(100% - 36px)); }
.menu.pop button { display: grid; gap: 2px; }
.menu.pop button .mute { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.pop.emoji { grid-template-columns: repeat(7, 1fr); width: 300px; }
.menu.pop.emoji button { font-size: 20px; text-align: center; padding: 6px; }

.cc { border-left: 1px solid var(--hair); background: var(--paper); min-height: 0; overflow-y: auto; display: none; }
.chats.card-open .cc { display: block; }
.cc-head { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; gap: 8px; align-items: center; padding: 12px 12px 10px 0; border-bottom: 1px solid var(--hair2); }
.cc-head .tabs { flex: 1; margin: 0 0 0 12px; }
.cc-body { padding-bottom: 24px; }
.cs { padding: 14px 18px; border-bottom: 1px solid var(--hair2); display: grid; gap: 8px; font-size: 14px; }
.cs .lbl { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 800; }
.cs.top { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.cs.top .chip { grid-column: 1 / -1; justify-self: start; }
.ava.lg { width: 48px; height: 48px; font-size: 15px; background: var(--gold-soft); color: var(--gold); }
.nm { font: 700 18px/1.25 var(--display); }
.cs.stats { grid-template-columns: repeat(3, 1fr); text-align: center; gap: 4px; }
.cs.stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.cs.stats b.late { color: var(--red); }
.cs.stats span { font-size: 11.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 700; background: var(--sunk); color: var(--ink2); text-decoration: none; display: inline-flex; align-items: center;
  transition: background-color .16s ease, transform .12s ease; }
.chip:hover { background: var(--hair); }
.chip:active { transform: scale(.97); }
.chip:disabled { opacity: .5; }
.chip.on { background: var(--ink); color: var(--paper); }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.ai { box-shadow: inset 0 0 0 1px var(--gold-line); background: none; color: var(--gold); }
.note { padding: 10px 12px; border-radius: 10px; background: var(--sunk); display: grid; gap: 4px; }
.note.gold { background: var(--gold-soft); }
.free { color: var(--red); font-weight: 700; }
.red { color: var(--red); }
.bx { padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair2); display: grid; gap: 3px; }
.bx.late { box-shadow: inset 0 0 0 1px var(--red); background: var(--red-soft); }
.bk { padding: 10px 12px; border-radius: 10px; display: grid; gap: 4px; box-shadow: inset 0 0 0 1px var(--hair2); }
.bk.ok { box-shadow: inset 3px 0 0 var(--green), inset 0 0 0 1px var(--hair2); }
.bk.pre { box-shadow: inset 3px 0 0 var(--gold-line), inset 0 0 0 1px var(--hair2); }
.bk.check { box-shadow: inset 3px 0 0 var(--red), inset 0 0 0 1px var(--hair2); }
.bk-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-h .tag { margin: 0; }
.cl-person { display: grid; }
.cx { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; }
.cx .ci-i { color: var(--gold-line); font-weight: 800; }
.cx.sug { color: var(--gold); font-weight: 650; }
.cx.mute { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .tag { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.tx { border: 0; background: none; padding: 0 2px; color: var(--muted); font-size: 14px; line-height: 1; }
.frm { display: grid; gap: 8px; padding: 10px 0 0; }
.frm input:not([type=checkbox]), .frm select, .frm textarea { width: 100%; min-width: 0; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); font-size: 14px; }
.frm textarea { resize: vertical; }
.ln { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.frm .ln > input:not([type=checkbox]), .frm .ln > select { flex: 1; width: auto; }
.ln.end { justify-content: flex-end; }
.frm > .btn { justify-self: start; }
.frm-in { display: grid; gap: 8px; }
.frm:has(input[name=skip]:checked) .frm-in { display: none; }
.days { display: flex; flex-wrap: wrap; gap: 10px; }
.hist { display: grid; gap: 8px; }
.hr { display: grid; gap: 1px; font-size: 13.5px; }
.hr .mute { font-size: 12px; }
.ht { color: var(--ink2); background: var(--sunk); padding: 6px 9px; border-radius: 8px; font-size: 13px; }
details summary { cursor: pointer; }

@media (max-width: 1180px) {
  .chats, .chats.card-open { grid-template-columns: 300px minmax(0, 1fr); }
  .chats.card-open .cc { position: fixed; top: 64px; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 25; box-shadow: -12px 0 40px rgba(27, 25, 32, .16); }
}
@media (max-width: 760px) {
  .chats, .chats.card-open { display: block; height: calc(100vh - 56px - 66px - env(safe-area-inset-bottom, 0px)); }
  .cl { height: 100%; border-right: 0; }
  .cv { display: none; height: 100%; }
  .chats.has-cur .cl { display: none; }
  .chats.has-cur .cv { display: flex; }
  .chats.has-cur { height: calc(100vh - 56px); }
  .app:has(.chats.has-cur) .tabbar { display: none; }
  .app:has(.chats.has-cur) { padding-bottom: 0; }
  .cv-head { padding: 10px 12px; gap: 8px; }
  .cv-head .back { display: block; }
  .cv-head .ava { display: none; }
  .cv-acts .btn { padding: 6px 9px; font-size: 12.5px; }
  .msgs { padding: 12px; }
  .msg { max-width: 88%; }
  .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .cmp-tools .hint { display: none; }
  .chats.card-open .cc { position: fixed; inset: 56px 0 0; width: auto; z-index: 35; box-shadow: none; }
  .menu.pop { left: 10px; bottom: 120px; }
}

/* фото в переписке и просмотр крупно */
.msg .ph { display: block; border: 0; padding: 0; margin: -4px -8px 6px; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.msg .ph img { display: block; max-width: min(300px, 100%); max-height: 360px; object-fit: cover; background: var(--sunk); }
.msg.has-ph { padding-top: 10px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15, 14, 18, .88); display: grid; place-items: center; gap: 14px; padding: 24px 16px; grid-template-rows: 1fr auto; cursor: zoom-out; animation: rise .15s ease-out both; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; object-fit: contain; align-self: center; }

/* ===== Задачи и план возврата ===== */
.page-tabs { display: inline-flex; margin: 0 0 18px; }
.page-tabs a { text-decoration: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--ink2); }
.page-tabs a.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 25, 32, .08); }
.tabs.mini { margin: 0; display: inline-flex; }
.tabs.mini button { flex: none; padding: 6px 12px; }
.sec.tasks .sh, .sec.queue .sh { justify-content: space-between; }
.qbar { gap: 12px; border-top: 0; background: var(--gold-soft); }
.trow, .prow { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.trow .txt, .prow .txt { display: block; min-width: 0; }
.trow .txt > .tag, .prow .txt .tag { margin: 0 8px 0 0; }
.trow .txt b, .prow .txt b { font-weight: 750; font-size: 15px; margin-right: 4px; }
.trow .line { display: block; margin-top: 2px; white-space: normal; }
.ttext { color: var(--ink2); margin-top: 4px; font-size: 14px; }
.sug { color: var(--gold); font-weight: 650; font-size: 14px; margin-top: 2px; }
.row.done { opacity: .72; }
.trow .acts, .prow .acts { max-width: 420px; }
.trow .acts select { padding: 6px 8px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; max-width: 170px; }
.row .frm { grid-column: 1 / -1; padding: 6px 0 4px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.filters-row select, .filters-row input { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; min-width: 0; flex: 1 1 160px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { border: 0; text-align: left; background: var(--paper); border-radius: 14px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--hair2); display: grid; gap: 2px;
  transition: box-shadow .16s ease, transform .12s ease; }
.tile:hover { box-shadow: inset 0 0 0 1px var(--gold-line); }
.tile:active { transform: scale(.985); }
.tile b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.warn b { color: var(--gold); }
.tile.bad b { color: var(--red); }
.tile.good b { color: var(--green); }
.tile.on { box-shadow: inset 0 0 0 2px var(--ink); }
.rgrid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cands { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 6px; }
.cand { padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair2); display: grid; gap: 4px; }
.pc { padding: 8px 0; border-top: 1px solid var(--hair); display: grid; gap: 4px; }
.chip.danger { background: var(--red-soft); color: var(--red); }
.sec .note { margin: 0 20px 12px; }
@media (max-width: 1180px) { .rgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .trow, .prow { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .trow .acts, .prow .acts { justify-content: flex-start; max-width: none; }
  .filters-row { padding: 0 16px 12px; }
  .sec.tasks .sh { gap: 8px; }
  .page-tabs { display: flex; }
  .page-tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile b { font-size: 22px; }
  .sec .note { margin: 0 16px 12px; }
}
.prow a.mute[href^="tel:"] { white-space: nowrap; margin-left: 4px; }
@media (max-width: 760px) {
  .sec.tasks .sh .tabs.mini { flex-wrap: wrap; max-width: 100%; }
  .sec.tasks .sh .tabs.mini button { flex: 1 1 auto; }
}

/* ===== Клиенты ===== */
.kbody { padding: 0 20px 16px; display: grid; gap: 8px; font-size: 14px; }
.back-link { display: inline-block; color: var(--gold); font-weight: 700; text-decoration: none; margin-bottom: 6px; font-size: 14px; }
.back-link:hover { text-decoration: underline; }
.kbody .ln input:not([type=checkbox]) { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); font-size: 13.5px; }
.kbody .frm { padding-top: 8px; }
.bx.due { box-shadow: inset 3px 0 0 var(--gold-line), inset 0 0 0 1px var(--hair2); }
.green-t { color: var(--green); }
.gold-t { color: var(--gold); }
.vrow .txt .tag { margin: 0 6px; }
.kbody svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; vertical-align: -2px; }
.audio-slot audio { height: 34px; max-width: 100%; }
.dnc { display: grid; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--hair); }
@media (max-width: 760px) { .kbody { padding: 0 16px 14px; } }
.sec > .kbody:first-child { padding-top: 16px; }
.dnc .ln input:not([type=checkbox]) { min-width: 180px; }

/* ===== Обзор и аналитика ===== */
:root { --chart: #a0701f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart: #b88a3a; } }
:root[data-theme="dark"] { --chart: #b88a3a; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.six { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--paper); border-radius: 16px; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--hair2); display: grid; gap: 4px; text-decoration: none; color: inherit;
  transition: box-shadow .16s ease, transform .12s ease; align-content: start; }
a.kpi:hover { box-shadow: inset 0 0 0 1px var(--gold-line); }
a.kpi:active { transform: scale(.99); }
.kl { font-size: 13px; color: var(--muted); font-weight: 650; }
.kv { font-size: 32px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi.good .kv { color: var(--green); }
.kpi.bad .kv { color: var(--red); }
.ks { font-size: 13px; color: var(--muted); }
.delta { font-size: 13px; font-weight: 750; color: var(--muted); }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }
.spark { width: 100%; height: 28px; display: block; }
.spark polyline { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.band.ov { grid-template-columns: repeat(4, auto) 1fr; }
.band.ov .go { justify-self: end; }
.tiles.inner { padding: 0 20px 14px; margin: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tile.static { cursor: default; }
.tile.static:hover { box-shadow: inset 0 0 0 1px var(--hair2); }
.tscroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 800; padding: 8px 12px; border-bottom: 1px solid var(--hair2); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--hair2); font-variant-numeric: tabular-nums; }
.sec > .tscroll .tbl th:first-child, .sec > .tscroll .tbl td:first-child { padding-left: 20px; }
.vchart { margin: 0; display: grid; gap: 4px; }
.vunit { font-size: 12px; color: var(--muted); }
.vplot { position: relative; height: 180px; margin-left: 34px; }
.vgrid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hair2); }
.vgrid span { position: absolute; left: -34px; top: -8px; width: 28px; text-align: right; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.vcols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.vcol { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline-offset: 0; cursor: default; }
.vcol:hover .vbar, .vcol:focus .vbar { opacity: .75; }
.vbar { width: 100%; max-width: 28px; background: var(--chart); border-radius: 4px 4px 0 0; }
.vaxis { display: flex; gap: 2px; margin-left: 34px; }
.vaxis span { flex: 1; text-align: center; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: visible; }
.hb { display: grid; gap: 6px; }
.hbr { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 2px 0; }
.hbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbt { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.hbt i { display: block; height: 100%; background: var(--chart); border-radius: 5px; }
.hbv { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.an-h { font-size: 13px; font-weight: 800; margin: 14px 0 6px; color: var(--ink2); }
.an2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.tview summary { cursor: pointer; color: var(--gold); font-weight: 700; font-size: 13px; margin-top: 10px; }
.planned { display: grid; gap: 10px; }
.pl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.pl .tag { grid-row: span 2; margin: 0; }
.vtip { position: fixed; z-index: 120; background: var(--ink); color: var(--paper); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; max-width: 240px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.vtip b { display: block; font-size: 13.5px; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an2 { grid-template-columns: minmax(0, 1fr); } .band.ov { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .kpis, .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kv { font-size: 24px; }
  .kpi { padding: 12px 14px; }
  .band.ov .go { grid-column: 1 / -1; }
  .tiles.inner { padding: 0 16px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vplot { height: 140px; }
  .hd .act .tabs.mini { width: 100%; }
}

/* ===== Настройки ===== */
.page-tabs.wrap { flex-wrap: wrap; }
.fld { display: grid; gap: 4px; font-size: 13.5px; }
.fld > span { color: var(--muted); font-size: 13px; }
.fld input, .fld select, .kbody > form select, .kbody textarea, .kbody input[type=search] { width: 100%; min-width: 0; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); font-size: 14px; }
.copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--sunk); padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.help { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink2); }
.chcard .sh { flex-wrap: nowrap; }
.chtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px !important; }
.chn.big { font-size: 12px; padding: 4px 7px; border-radius: 7px; background: var(--sunk); color: var(--ink2); margin: 0; }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 8px; box-shadow: inset 0 0 0 1px var(--hair); }
.pair { font-size: 22px; letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; }
.urow { padding: 12px 0; border-top: 1px solid var(--hair2); display: grid; gap: 8px; }
.urow:first-child { border-top: 0; }
.urow.off { opacity: .6; }
.urow .txt { flex: 1; min-width: 0; }
.urow select { padding: 6px 9px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cwd { font-size: 11px; color: var(--faint); text-align: center; font-weight: 800; text-transform: uppercase; }
.cday { min-height: 54px; border-radius: 8px; padding: 4px 6px; background: var(--sunk); display: grid; align-content: start; gap: 1px; font-size: 11.5px; }
.cday b { font-size: 12px; }
.cday.empty { background: none; box-shadow: inset 0 0 0 1px var(--hair2); }
.cday.today { box-shadow: inset 0 0 0 2px var(--gold-line); }
.cday span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow b { min-width: 120px; }
.srow input { flex: 1; min-width: 120px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); }
.nrow .txt, .srv .txt { flex: 1; min-width: 160px; }
.nrow input { width: 110px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); }
.srv { padding: 8px 0; border-top: 1px solid var(--hair2); }
.srv select { max-width: 220px; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--hair); background: var(--paper); font-size: 13px; }
.brow { padding: 4px 0; }
.pre { white-space: pre-wrap; }
.hrs { border-top: 1px dashed var(--hair); }
.hrs .ln input[type=time] { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--hair); background: var(--milk); }
@media (max-width: 760px) { .cday { min-height: 44px; padding: 3px; } .cday span { font-size: 10px; } .qr { width: 200px; height: 200px; } }

/* ===== Проверка Business Check и Платформа (этап 7б) ===== */
.qbc-ctl { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.qa-top .kbody { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 20px; }
.qscore { display: grid; justify-items: center; min-width: 110px; padding: 10px 14px; border-radius: 14px; background: var(--sunk); }
.qscore b { font: 700 32px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.qscore span { color: var(--muted); font-size: 12.5px; }
.qfacts { display: grid; gap: 4px; font-size: 14px; min-width: 0; }
.qsum { margin: 0; padding: 0 20px 14px; font-size: 14.5px; line-height: 1.5; }
.checks, .recs { list-style: none; margin: 0; padding: 0 20px 14px; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.checks b { font-weight: 700; }
.checks .tag { margin-left: 6px; }
.ckm { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--sunk); color: var(--muted); }
.checks .ok .ckm, .hl.ok .ckm { background: var(--green-soft); color: var(--green); }
.checks .fail .ckm, .hl.bad .ckm { background: var(--red-soft); color: var(--red); }
.recs li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.45; }
.recs li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.transcript { white-space: pre-wrap; font-size: 14px; line-height: 1.55; max-height: 60vh; overflow: auto; }
.qaudio { display: block; width: calc(100% - 40px); margin: 0 20px 16px; }
.qa-back { margin-bottom: 4px; }
.qbc-recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.qbc-doc { margin-top: 16px; }
.bcframe { display: block; width: 100%; height: 80vh; border: 0; background: #e9e6e1; }
.bc-text { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--milk); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.health { display: grid; gap: 6px; }
.hl { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13.5px; overflow-wrap: anywhere; }
.hrow { display: grid; gap: 2px; font-size: 13.5px; padding-bottom: 6px; border-bottom: 1px solid var(--hair2); overflow-wrap: anywhere; }
.pf-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 800; margin: 8px 0 2px; }
.pf-orgs { margin-top: 6px; }
@media (max-width: 760px) {
  .qa-top .kbody { grid-template-columns: minmax(0, 1fr); }
  .qscore { justify-self: start; }
  .qbc-ctl .tabs.mini { width: 100%; }
  .qbc-ctl .tabs.mini button { flex: 1 1 auto; white-space: normal; }
  .bcframe { height: 70vh; }
}

/* ===== Передача смены (этап 8) ===== */
.hblock { border: 0; margin: 6px 0 0; padding: 12px 0 0; border-top: 1px solid var(--hair2); display: grid; gap: 10px; min-width: 0; }
.hblock legend { font: 700 15px/1.3 var(--display); padding: 0 0 6px; }
.hitem { display: grid; gap: 6px; padding: 8px 10px; border-radius: 10px; }
.hitem.bad { background: color-mix(in srgb, var(--red-soft) 60%, transparent); }
.hq { font-size: 14px; font-weight: 650; }
.hitem .tabs.mini { justify-self: start; }
.hcomment { display: block; width: 100%; margin-top: 6px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); font-size: 13.5px; }
.hdetails { display: grid; gap: 3px; margin-top: 8px; font-size: 13.5px; }
.hdetails b { margin-top: 6px; }

/* ===== Цветные метки (статус, «свободно», внутренняя, филиал) ===== */
.stage.st-consult, .tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.plum { background: var(--plum-soft); color: var(--plum); }
.tag.teal { background: var(--teal-soft); color: var(--teal); }
.tag.indigo { background: var(--indigo-soft); color: var(--indigo); }
.tag.free { background: none; box-shadow: inset 0 0 0 1px var(--gold-line); color: var(--gold); }
@media (max-width: 760px) { .cv-acts .hd-int { display: none; } }  /* на телефоне — в карточке, «Тип переписки» */
.shot { border: 0; background: var(--sunk); color: var(--ink2); width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; cursor: pointer; }
.shot:hover { background: var(--hair); }
.shot:disabled { opacity: .5; }
.shot svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* ===== Исправить / удалить отправленное ===== */
.msg .macts { display: inline-flex; gap: 10px; margin-left: 10px; }
.msg .macts .link { font-size: 11.5px; color: inherit; opacity: .9; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.msg .macts.mute-hint { display: block; margin: 3px 0 0; white-space: normal; opacity: .85; font-style: italic; }
.msg.deleted { opacity: .62; }
.msg.deleted .mt { text-decoration: line-through; }
.msg.editing { max-width: min(560px, 90%); width: 100%; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold-line); animation: none; }
.medit { display: grid; gap: 8px; }
.medit textarea { width: 100%; font: inherit; color: var(--ink); padding: 8px 10px; border-radius: 9px; border: 1px solid var(--hair); background: var(--milk); resize: vertical; }
