/* Формула бар · дизайн 2 (26.11): навигация сверху, светлые карточки, акцент — жёлтый бренда */
:root {
  --y: #f6c200; --y-d: #e09b00; --y2: #fff4c7; --grad: linear-gradient(140deg, #ffd83a 0%, #f6b800 55%, #ee9d00 100%);
  --dark: #1e1e20; --dark2: #2c2c2f; --bg: #e7e7e4; --page: #f3f3f1; --card: #fff; --soft: #f5f5f3;
  --text: #1e1e20; --muted: #8b8b86; --line: #ececea; --good: #1d9a57; --good-bg: #e3f6ea; --bad: #e1483d; --bad-bg: #fde6e3;
  --r: 22px; --r2: 16px; --sh: 0 1px 2px rgba(20,20,20,.04), 0 6px 24px rgba(20,20,20,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); }
.nowrap { white-space: nowrap; }

/* каркас */
.app { max-width: 1440px; margin: 18px auto; background: var(--page); border-radius: 32px; padding: 18px 22px 30px; min-height: calc(100vh - 36px); }
main { min-width: 0; }

/* верхняя панель */
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.pill { background: var(--card); border-radius: 999px; box-shadow: var(--sh); }
.brand { display: flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px; flex: none; }
.logo-img { width: 44px; height: 44px; border-radius: 50%; display: block; flex: none; }
.brand-t b { display: block; font-size: 15px; line-height: 1.15; }
.brand-t small { color: var(--muted); font-size: 12px; }
.navpill { display: flex; gap: 2px; padding: 5px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.navpill::-webkit-scrollbar { display: none; }
.navpill a { display: flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; color: #55554f; text-decoration: none; white-space: nowrap; font-size: 14.5px; font-weight: 600; transition: background .15s; }
.navpill a:hover { background: var(--soft); color: var(--text); }
.navpill a.on { background: var(--dark); color: #fff; }
.navpill a i { display: none; }
.navpill a .ns { display: none; }
.badge { background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; line-height: 16px; }
.navpill a.on .badge { background: var(--y); color: var(--dark); }
.top-r { display: flex; gap: 10px; align-items: center; flex: none; }
.iconpill { display: flex; gap: 2px; padding: 5px; }
.ib { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; background: none; cursor: pointer; color: #3a3a36; text-decoration: none; }
.ib:hover { background: var(--soft); }
.ib svg { width: 20px; height: 20px; }
.user { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; cursor: pointer; min-width: 190px; }
.uava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--y2); font-weight: 700; flex: none; overflow: hidden; }
.uava img { width: 100%; height: 100%; display: block; }
.uinfo { min-width: 0; flex: 1; line-height: 1.2; }
.uinfo b { display: block; font-size: 14px; }
.uinfo small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.user select { display: none; }
.user .uava { position: relative; overflow: visible; }
.user .uava img { border-radius: 50%; }
.user.onshift .uava::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #2ecc71; border: 2px solid #fff; }
.user.open .chev { transform: rotate(180deg); }
.chev { transition: transform .15s; }
/* меню «Смотреть как» (04.12) */
.rmenu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 300px; max-height: min(70vh, 520px); overflow-y: auto; background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(20,20,20,.18), 0 2px 6px rgba(20,20,20,.06); padding: 8px; cursor: default; animation: rmIn .14s ease-out; }
@keyframes rmIn { from { opacity: 0; transform: translateY(-6px); } }
.rm-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 2px; }
.rm-g { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.rm-h + .rm-g { border-top: 0; margin-top: 0; }
.rm-it { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 12px; cursor: pointer; text-align: left; }
.rm-it:hover { background: var(--soft); }
.rm-it.cur { background: var(--y2); }
.rm-it.onshift:not(.cur) { background: #effaf3; }
.rm-it.onshift:not(.cur):hover { background: #e3f6ea; }
.rm-ava { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-weight: 700; font-size: 14px; flex: none; }
.rm-ava img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.rm-it.onshift .rm-ava { background: #d4f2df; color: #157a43; box-shadow: 0 0 0 2px #2ecc71; }
.rm-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #2f8cff; border: 2px solid #fff; }
.rm-t { flex: 1; min-width: 0; line-height: 1.25; }
.rm-t b { display: block; font-size: 14px; }
.rm-t small { font-size: 12px; }
.rm-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.rm-pr { font-size: 12px; color: var(--muted); }
.rm-pr.in { color: #1769c2; font-weight: 600; }
.rm-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.rm-tag.on { color: var(--good); font-weight: 600; }
.rm-tag.on i { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; animation: rmPulse 1.8s infinite; }
@keyframes rmPulse { 0% { box-shadow: 0 0 0 0 rgba(46,204,113,.6); } 70% { box-shadow: 0 0 0 6px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }
.rm-ok { width: 18px; height: 18px; color: var(--y-d); stroke-width: 2.4; flex: none; }
.rm-note { margin: 8px 10px 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 800px) { .user.open::before { content: ""; position: fixed; inset: 0; background: rgba(20,20,20,.35); z-index: 299; cursor: default; } .rmenu { z-index: 300; position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 75vh; border-radius: 22px 22px 0 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); animation: rmUp .18s ease-out; } @keyframes rmUp { from { transform: translateY(30px); opacity: 0; } } .rm-it { padding: 10px; } }

/* заголовок страницы */
.page-head { margin: 0 4px 22px; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.6px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head p:empty { display: none; }

/* кнопки, чипы */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--dark); border-color: var(--dark); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #333336; }
.btn.primary:active { transform: scale(.97); }
.btn.ghost { background: var(--card); }
.btn.small { padding: 8px 14px; font-size: 13.5px; }
.btn.wide { width: 100%; padding: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip:hover { background: var(--soft); }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: #55554f; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.center { text-align: center; margin: 18px 0; }
.hint { background: var(--y2); border-radius: var(--r2); padding: 12px 16px; font-size: 14px; margin: 0 0 16px; line-height: 1.4; }
.sel { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; cursor: pointer; font-weight: 500; }

/* карточки */
.card { background: var(--card); border-radius: var(--r); padding: 22px; margin-bottom: 18px; box-shadow: var(--sh); }
.card h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.card h3 small { font-weight: 400; font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kpis.boxed { background: var(--card); border-radius: var(--r); padding: 12px; box-shadow: var(--sh); }
.kpi { background: var(--soft); border-radius: var(--r2); padding: 18px; position: relative; min-width: 0; }
.kpis:not(.boxed) .kpi { background: var(--card); box-shadow: var(--sh); }
.kpi small { color: #55554f; font-size: 14px; display: block; padding-right: 44px; }
.kpi b { display: block; font-size: 32px; font-weight: 600; margin: 14px 0 10px; letter-spacing: -.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi > span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi .ki { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: #4a4a45; border: 1px solid var(--line); }
.kpi .ki svg { width: 17px; height: 17px; }
.kpi.good b { color: var(--good); } .kpi.bad b { color: var(--bad); }
.kpi.hl { background: var(--grad); color: var(--dark); }
.kpi.hl small, .kpi.hl > span { color: rgba(30,30,32,.75); }
.kpi.hl .ki { background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.45); color: var(--dark); }
.dl { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--good-bg); color: var(--good); white-space: nowrap; }
.dl.down { background: var(--bad-bg); color: var(--bad); }
.dl.flat { background: #ececea; color: #77776f; }
.kpi.hl .dl { background: rgba(255,255,255,.55); color: var(--dark); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; }
.grid2 > .card { margin-bottom: 18px; }
.grid2 > .card:has(.lc) { display: flex; flex-direction: column; }
.grid2 > .card .lc { flex: 1; min-height: 260px; }

/* линейный график */
.lc { position: relative; width: 100%; height: 260px; user-select: none; touch-action: pan-y; }
.lc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lc .grid { stroke: #ececea; stroke-width: 1; stroke-dasharray: 4 5; }
.lc .ax { fill: #9a9a94; stroke: none; font-size: 11.5px; }
.lc .ln { stroke: var(--y-d); stroke-width: 2.6; }
.lc .pt { fill: #fff; stroke: var(--y-d); stroke-width: 2; }
.lc .hl-line { stroke: #c8c8c2; stroke-width: 1; stroke-dasharray: 3 4; }
.lc .hl-pt { fill: var(--y-d); stroke: #fff; stroke-width: 3; }
.tip { position: absolute; pointer-events: none; background: var(--dark); color: #fff; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .12s; z-index: 3; line-height: 1.35; }
.tip b { font-size: 14px; display: block; }
.tip.show { opacity: 1; }
.lc-empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* магазины */
.shops2 { display: grid; gap: 12px; }
.shop { background: var(--soft); border-radius: var(--r2); padding: 16px; }
.shop-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shop-top .ki { width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.shop-top .ki svg { width: 17px; height: 17px; }
.shop-top b { font-size: 15px; }
.shop-top small { display: block; color: var(--muted); font-size: 12px; }
.shop-rev { font-size: 24px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 10px; }
.shop-split { display: block; margin: -4px 0 10px; font-size: 13px; }
#cSum { text-align: right; line-height: 1.4; }
.shop-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shop-nums span { font-weight: 600; font-size: 16px; background: var(--card); border-radius: 12px; padding: 8px 10px; }
.shop-nums small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.share { height: 8px; border-radius: 99px; background: repeating-linear-gradient(-45deg, #ececea 0 4px, #f6f6f4 4px 8px); overflow: hidden; margin: 2px 0 12px; }
.share i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* таблицы */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 14px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; color: #6b6b66; font-weight: 500; font-size: 13px; padding: 12px 14px; background: var(--soft); white-space: nowrap; }
th:first-child { border-radius: 12px 0 0 12px; } th:last-child { border-radius: 0 12px 12px 0; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fafaf8; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ava { position: relative; overflow: hidden; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--y2); color: var(--dark); font-weight: 700; flex: none; font-size: 14px; }
td .ava { width: 30px; height: 30px; font-size: 12px; margin-right: 8px; vertical-align: middle; }

/* статусы — точка + текст */
.st { font-size: 12.5px; padding: 4px 10px 4px 9px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: #e8efff; color: #2b5fd9; } .st-work { background: var(--y2); color: #9a6b00; }
.st-today { background: #e6f6ff; color: #0b6fa4; }
.st-sold { background: var(--good-bg); color: var(--good); } .st-undone { background: var(--bad-bg); color: var(--bad); }
.st-non { background: #efefed; color: #77776f; }

/* «кого дожать» */
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r2); background: var(--soft); margin-bottom: 10px; cursor: pointer; }
.todo:hover { background: #eeeeeb; }
.todo small { display: block; color: var(--muted); }
.todo p { margin: 6px 0 0; font-size: 13.5px; }
.todo .arrow { margin-left: auto; font-size: 22px; color: var(--muted); }

/* заявки */
.leads { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lead { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); animation: pop .3s; border-top: 4px solid var(--y); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.lead-top { display: flex; gap: 10px; align-items: center; }
.lead-top small { display: block; }
.wait { margin-left: auto; font-size: 13px; font-weight: 600; background: var(--soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.wait.bad { background: var(--bad-bg); }
.lead p { margin: 14px 0; line-height: 1.4; }
.lead-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* чаты */
.chats { display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); background: var(--card); border-radius: var(--r); overflow: hidden; height: calc(100vh - 250px - var(--pb, 0px)); min-height: 480px; box-shadow: var(--sh); }
.clist { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; padding: 8px; }
.ctabs { display: flex; gap: 4px; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.ctabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-size: 14px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.ctabs button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ctabs button b { color: #c0392b; margin-left: 2px; }
.waitold { margin: 10px 4px 4px; padding: 12px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 13px; line-height: 1.4; }
.waitold .btn { display: block; margin-top: 8px; }
.ci { display: flex; gap: 10px; padding: 11px 12px; cursor: pointer; border-radius: 14px; align-items: center; margin-bottom: 2px; }
.ci { content-visibility: auto; contain-intrinsic-size: auto 64px; } /* 04.12: ~1000 чатов — браузер раскладывает только видимые, «Чаты» открываются быстрее */
.ci:hover { background: var(--soft); } .ci.on { background: var(--y2); }
.ci-mid { min-width: 0; flex: 1; }
.ci-mid small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ci-r small { color: var(--muted); font-size: 11px; }
.cpane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f1ea; position: relative; }
.ch-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.ch-head small { display: block; }
.back { display: none; border: 0; background: none; font-size: 28px; cursor: pointer; padding: 0 6px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.msg { max-width: 72%; padding: 9px 13px 19px; border-radius: 16px 16px 16px 6px; position: relative; background: #fff; align-self: flex-start; line-height: 1.38; min-width: 70px; flex: none; overflow-wrap: anywhere; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.msg.out { background: #fff1b8; align-self: flex-end; border-radius: 16px 16px 6px 16px; }
.msg small { position: absolute; right: 10px; bottom: 3px; font-size: 10px; color: var(--muted); }
.ch-status { display: flex; gap: 6px; align-items: center; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.ch-in { display: flex; gap: 8px; padding: 10px 12px; background: var(--card); flex: none; align-items: center; }
.ch-in input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 11px 16px; }
.ch-in input:focus { outline: none; border-color: var(--y); background: #fff; }
.ch-in .btn.primary { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; }
.ro { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; background: var(--card); flex: none; }
.clip { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 20px; flex: none; }
.clip:hover { background: var(--soft); }
.msg.media { padding: 4px 4px 19px; }
.msg img, .msg video { display: block; max-width: 100%; width: 260px; height: 260px; object-fit: cover; border-radius: 12px; background: #ddd; } /* высота сразу известна — чат не прыгает, пока грузится фото */
.msg.media span { display: block; padding: 6px 8px 0; }
.msg audio { display: block; width: 260px; max-width: 100%; height: 40px; }
.msg img.sticker { width: 120px; height: 120px; object-fit: contain; background: none; }
.msg a.doc { display: block; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.05); color: inherit; text-decoration: none; word-break: break-word; }
.drop { display: none; position: absolute; inset: 0; background: rgba(246,194,0,.18); border: 3px dashed var(--y); border-radius: var(--r); place-items: center; font-weight: 700; z-index: 5; pointer-events: none; }
.drop.on { display: grid; }

/* обучение */
.svc { display: none; }

/* реклама */
.sec { margin: 8px 4px 14px; font-size: 18px; font-weight: 600; }
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ad { background: var(--card); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh); }
.ad-img { position: relative; display: block; aspect-ratio: 1; background: #ddd; }
.ad-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-img span { position: absolute; left: 10px; bottom: 10px; background: rgba(30,30,32,.85); color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 999px; }
.empty-img { display: grid; place-items: center; color: var(--muted); }
.ad-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ad-m { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
.ad-m span { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 8px 10px; }
.ad-m b { display: block; font-size: 16px; color: var(--text); margin-top: 2px; }

/* отзывы */
.stars { color: var(--y); letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.stars i { color: #ddd; font-style: normal; }
.kpi b .stars { font-size: 16px; vertical-align: middle; }
.revs { display: grid; gap: 12px; }
.rev { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); }
.rev.neg { box-shadow: inset 4px 0 0 var(--bad), var(--sh); }
.rev-top { display: flex; gap: 10px; align-items: center; }
.rev-top small { display: block; }
.rev-top .stars { margin-left: auto; }
.rev p { margin: 10px 0 0; line-height: 1.45; }
.rev-ans { margin-top: 10px; background: var(--soft); border-radius: 12px; padding: 9px 12px; font-size: 14px; }
.rev-warn { margin-top: 10px; color: var(--bad); font-weight: 600; font-size: 14px; }

/* диапазон дат */
.range { display: flex; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; }
.range label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.range input { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--card); }

/* тост */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); background: var(--dark); color: #fff; padding: 12px 20px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tabbar, .more-sheet, .more-dim { display: none; }

/* вход */
.login-body { display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--card); border-radius: 28px; padding: 34px 28px; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--sh); }
.login-card .logo-img { width: 96px; height: 96px; margin: 0 auto 14px; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-card p { margin: 6px 0 0; }
.login-card input { width: 100%; margin: 22px 0 6px; padding: 14px; font-size: 22px; letter-spacing: 8px; text-align: center; border: 2px solid var(--line); border-radius: 16px; background: var(--soft); }
.login-card input:focus { outline: none; border-color: var(--y); background: #fff; }
.err { color: var(--bad); min-height: 20px; font-size: 14px; margin: 0 0 10px; }

/* средние экраны */
@media (max-width: 1240px) {
  .brand-t { display: none; } .brand { padding: 5px; }
  .user { min-width: 0; }
}
@media (max-width: 1400px) {
  .navpill a { padding: 10px 12px; font-size: 14px; }
  .navpill a .nl:not(:only-of-type) { display: none; } .navpill a .ns { display: inline; }
}
@media (max-width: 1060px) { .navpill { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); } } /* не влезает — край меню тает: видно, что листается */
@media (max-width: 1060px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .uinfo small { display: none; }
}
@media (max-width: 900px) {
  .app { margin: 0; border-radius: 0; min-height: 100vh; }
}

/* телефон */
@media (max-width: 800px) {
  body { background: var(--page); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .app { padding: calc(10px + env(safe-area-inset-top)) 12px 16px; }
  .topbar { margin-bottom: 18px; gap: 8px; }
  .navpill { display: none; }
  .brand { padding: 4px 14px 4px 4px; }
  .brand-t { display: block; }
  .logo-img { width: 40px; height: 40px; }
  .top-r { margin-left: auto; }
  .user { padding: 4px 10px 4px 4px; gap: 8px; }
  .uava { width: 36px; height: 36px; }
  .uinfo b { font-size: 13px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 26px; }
  .page-head p { font-size: 14px; }
  .kpis { gap: 8px; }
  .kpis.boxed { padding: 8px; }
  .kpi { padding: 14px; }
  .kpi small { font-size: 13px; padding-right: 34px; }
  .kpi .ki { width: 28px; height: 28px; top: 11px; right: 11px; }
  .kpi .ki svg { width: 14px; height: 14px; }
  .kpi b { font-size: 22px; margin: 10px 0 8px; letter-spacing: -.4px; }
  .card { padding: 16px; border-radius: 20px; }
  .lc { height: 220px; }
  .tabbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: var(--card); padding: 6px; z-index: 20; border-radius: 999px; box-shadow: 0 6px 30px rgba(0,0,0,.12); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #4a4a44; text-decoration: none; font-size: 10px; font-weight: 600; padding: 6px 0 5px; position: relative; border-radius: 999px; min-width: 0; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar a i { font-style: normal; display: grid; place-items: center; }
  .tabbar a i svg { width: 20px; height: 20px; stroke-width: 2.3; }
  .tabbar a.on { background: var(--dark); color: #fff; }
  .tabbar { transition: transform .25s ease; }
  body.tabhide .tabbar { transform: translateY(calc(100% + 30px)); }
  .tabbar a { font-size: 11px; }
  .tabbar a i svg { width: 22px; height: 22px; }
  .more-dim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.25); cursor: pointer; z-index: 18; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .more-sheet { display: flex; flex-direction: column; position: fixed; left: 10px; right: 10px; bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--card); border-radius: 24px; padding: 8px; z-index: 19; box-shadow: 0 10px 40px rgba(0,0,0,.18); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s, transform .2s; }
  body.moreopen .more-dim { opacity: 1; pointer-events: auto; }
  body.moreopen .more-sheet { opacity: 1; transform: none; pointer-events: auto; }
  .more-sheet a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; min-height: 52px; color: var(--dark); text-decoration: none; font-size: 16px; font-weight: 600; border-radius: 16px; }
  .more-sheet a i { font-style: normal; width: 38px; height: 38px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; }
  .more-sheet a i svg { width: 20px; height: 20px; stroke-width: 2.3; }
  .more-sheet a span { flex: 1; }
  .more-sheet a em { font-style: normal; color: #9a9a92; font-size: 22px; }
  .more-sheet a.on { background: var(--dark); color: #fff; }
  .more-sheet a.on i { background: var(--dark2); }
  body.chatfull .more-sheet, body.chatfull .more-dim { display: none; }
  .tabbar .badge { position: absolute; top: 0; right: 14%; margin: 0; font-size: 10px; padding: 0 5px; }
  .chats { grid-template-columns: 1fr; height: calc(100dvh - 300px - var(--pb, 0px) - env(safe-area-inset-bottom)); min-height: 380px; }
  .chats.has .clist { display: none; }
  .chats:not(.has) .cpane { display: none; }
  .back { display: block; }
  .msg { max-width: 85%; }
  .msg img, .msg video { width: 220px; height: 220px; }
  .ch-in { padding: 8px; gap: 6px; }
  .shop-rev { font-size: 21px; }
  .shop-nums span { font-size: 15px; }
  .svc { display: block; }
  .toast { top: calc(12px + env(safe-area-inset-top)); bottom: auto; transform: translate(-50%, -30px); }
  .toast.show { transform: translate(-50%, 0); }
}
@media (max-width: 800px) {
  .row-between > .chips, .card-head .seg, .row-between > .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .row-between > .chips::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .card-head .seg { width: 100%; }
  .card-head .seg button, .row-between > .seg button { flex: 1; }
}
@media (max-width: 400px) {
  .brand-t { display: none; } .brand { padding: 4px; }
  th { padding: 10px 7px; font-size: 12px; } td { padding: 11px 7px; font-size: 13px; } /* 04.12: iPhone SE — таблица заявок влезает целиком */
}

/* правки после проверки 26.11 (ночь) */
.lead-top > div { min-width: 0; flex: 1; }
.lead-top small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats { grid-template-columns: 370px minmax(0, 1fr); }
@media (max-width: 800px) { .chats { grid-template-columns: 1fr; } }
@media (max-width: 1060px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.back { min-width: 44px; min-height: 44px; display: none; place-items: center; }
@media (max-width: 800px) { .back { display: grid; } }
.page-head { margin-left: 0; margin-right: 0; }
.sec { margin-left: 0; }

/* видео-обучение */
.learn { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.learn .card { margin-bottom: 0; }
.lesson-card { padding: 12px; }
video.lesson { display: block; width: 100%; aspect-ratio: 16/9; border-radius: 16px; background: #1e1e20; }
.chap { display: flex; flex-direction: column; gap: 2px; }
.chap button { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 12px; cursor: pointer; font-size: 14.5px; }
.chap button:hover { background: var(--soft); }
.chap button span { flex: none; width: 46px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.intro { position: fixed; inset: 0; z-index: 100; background: rgba(20,20,22,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; } }
.intro-box { position: relative; width: min(960px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--card); border-radius: 28px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pop .3s; }
.intro-head { display: flex; gap: 14px; align-items: center; margin: 0 44px 14px 4px; }
.intro-head img { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.intro-head b { display: block; font-size: 19px; }
.intro-head span { color: var(--muted); font-size: 14px; }
.intro-x { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 16px; }
.intro-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 1060px) { .learn { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .intro { padding: 10px; align-items: center; }
  .intro-box { padding: 14px; border-radius: 22px; }
  .intro-head b { font-size: 16px; } .intro-head span { font-size: 13px; }
  .intro-head img { width: 42px; height: 42px; }
  .intro-foot .btn { width: 100%; }
  .intro-foot .muted { font-size: 13px; }
}

/* Входы: менеджер не может переключать профиль */
.pill.user.locked { cursor: default; }
.pill.user.locked .chev { display: none; }
.pill.user.locked select { pointer-events: none; }
.staff table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.staff td { padding: 8px 6px; border-top: 1px solid #eee; }
.staff td.pin { font-family: ui-monospace, monospace; font-size: 16px; letter-spacing: 2px; text-align: right; }

/* Подключения */
.conn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.conn-rules { grid-column: 1 / -1; }
.conn-rules ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.8; }
.conn-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.conn-head h3 { margin: 0; }
.conn-head .cst { margin-left: auto; }
.conn-head { flex-wrap: wrap; } .conn-head > div { min-width: 0; flex: 1 1 150px; } .conn-head .cst { white-space: nowrap; } .conn-card { min-width: 0; overflow-wrap: anywhere; } /* 04.12: iPhone SE — карточка «Связь» не вылезает за край */
.conn-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.conn-ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.conn-ico.wa { background: #25d366; }
.conn-ico.ig { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); }
.cst { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.cst.ok { background: #e3f6ea; color: #17803d; }
.cst.warn { background: #fff4d6; color: #9a6a00; }
.cst.bad { background: #fde7e7; color: #c62828; }
.cst.off { background: #efefed; color: #666; }
.conn-num { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
.qrbox { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 12px; }
.qrbox img { width: 220px; height: 220px; border-radius: 12px; border: 1px solid #eee; background: #fff; }
.qrbox ol { margin: 0; padding-left: 20px; line-height: 1.8; flex: 1; min-width: 200px; }
.qrbox p { flex-basis: 100%; margin: 0; }
@media (max-width: 800px) { .conn { grid-template-columns: 1fr; } .qrbox img { width: 100%; max-width: 280px; height: auto; } }

.ads-upd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* 01.12: телефон «на экран Домой» — страница не должна уезжать вбок и уменьшаться */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
.app, main, #view { max-width: 100%; }
@media (max-width: 800px) {
  .app { max-width: 100vw; }
  input, select, textarea { font-size: 16px; } /* iPhone не приближает экран при наборе */
}

/* 01.12: подсказка «что написать», чтобы дожать клиента */
.push { flex: none; display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--y2); border-top: 1px solid var(--line); }
.push-t { flex: 1; min-width: 0; }
.push-t b { font-size: 13px; }
.push-t p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.35; }
.push-b { display: flex; flex-direction: column; gap: 6px; flex: none; }
@media (max-width: 800px) {
  .push { flex-direction: column; align-items: stretch; padding: 8px 10px; }
  .push-t p { max-height: 5.4em; overflow-y: auto; }
  .push-b { flex-direction: row; }
  .push-b .btn { flex: 1; }
}
.visits { margin-bottom: 16px; } .visits p { line-height: 1.6; }
.vlist { max-height: 420px; overflow-y: auto; }
.vrow { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.4; }

/* Автоответ и рассылка — не ответ менеджера */
.msg.auto { opacity: .7; border: 1px dashed #d8cfa0; }
.msg .flag { display: block; font-size: 11.5px; font-weight: 600; color: #8a7a2c; margin-bottom: 3px; }

/* Источник заявки, Дожать, Нецелевые */
.src { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; margin-left: auto; align-self: flex-start; }
.src-ad { background: #fde9f1; color: #b0205a; }
.src-2gis { background: #e7f5e9; color: #1d7a34; }
.src.mini { padding: 1px 5px; font-size: 11px; margin-left: 4px; }
.lead.pushcard p { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.lead.pushcard .lead-top small { white-space: normal; }
.push-msg { background: #fffbea; border: 1px dashed #e8d68a; border-radius: 10px; padding: 9px 11px; font-size: 14px; margin: 8px 0; white-space: pre-wrap; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: 0 0 0 2px #f6c200 inset; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: #fff; border-radius: 18px; padding: 22px; width: min(720px, 100%); max-height: 88vh; overflow: auto; position: relative; }
.modal-x { position: absolute; top: 12px; right: 14px; border: 0; background: #f1f1ef; border-radius: 99px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; }
.nt-src { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 15px; }
.nt-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.nt-table td, .nt-table th { padding: 7px 6px; border-top: 1px solid #eee; text-align: left; font-size: 14px; }
.nt-list { margin-top: 10px; display: grid; gap: 6px; }
.nt-item { padding: 8px 10px; border-radius: 10px; background: #f7f7f5; display: grid; gap: 2px; font-size: 14px; }
.nt-item.click { cursor: pointer; }
.nt-item .src { margin-left: 6px; }

/* 01.12 после проверки агентами */
.msg > span.muted { display: block; } /* «📷 Фото» и подпись не слипаются */
@media (max-width: 800px) {
  .hm { display: none; } /* «Мои»/«Все» на телефоне: только клиент, статус, сумма, когда */
  .lead .btn, .ch-status .chip { min-height: 44px; } /* кнопки под палец */
  .table-wrap th, .table-wrap td { padding: 11px 8px; }
  .table-wrap td { white-space: normal; }
  .table-wrap th, .table-wrap td { padding-left: 6px; padding-right: 6px; font-size: 13px; }
}

/* поиск по чатам (01.12) */
.csearch { position: sticky; top: -8px; background: var(--card); padding: 0 0 8px; margin-top: -2px; z-index: 2; }
.csearch input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 10px 14px; font: inherit; font-size: 14px; }
@media (max-width: 800px) { .csearch input { font-size: 16px; } }

/* голосовые и удаление (01.12) */
.recbar { gap: 10px; }
.recbar .muted { flex: 1; font-size: 13px; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: #e5484d; flex: none; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .25; } }
.msg .mdel { position: absolute; left: -30px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 15px; opacity: 0; padding: 4px; }
.msg:hover .mdel { opacity: .55; } .msg .mdel:hover { opacity: 1; }
@media (hover: none) { .msg .mdel { opacity: .45; } }
.msg.del { opacity: .7; font-style: italic; }

/* ---------- 02.12: чаты (период, ожидание, карта клиента), пост продажа, сотрудники ---------- */
.chatbar { flex-wrap: wrap; gap: 8px; }
.chatbar #newCard { margin-left: auto; }
.cper { flex-wrap: wrap; }
.cdates { display: inline-flex; align-items: center; gap: 6px; }
.cdates input { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; font: inherit; }
.cwait { color: #c0392b; font-weight: 700; font-size: 12px; white-space: nowrap; }
.ch-in textarea { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--soft); border-radius: 20px; padding: 11px 16px; font: inherit; resize: none; line-height: 1.35; max-height: 140px; overflow-y: auto; }
.ch-in textarea:focus { outline: none; border-color: var(--y); background: #fff; }
.push-toggle { display: none; }
.rgrp { margin: 18px 0 10px; font-size: 16px; }
.lead.pushcard p.due { color: #c0392b; font-weight: 600; }
.src-card { background: #eef3ff; color: #2c4a9a; }
.lead-foot > span { display: inline-flex; gap: 6px; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.cform { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.cform h3 { margin: 0; }
.cform p { margin: 0; font-size: 13px; }
.cform label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.cform input, .cform textarea, .cform select { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 400; background: #fff; }
.cform textarea { resize: vertical; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cform .btn.primary { margin-top: 4px; min-height: 44px; }
.ctabs { margin-bottom: 14px; }
.staffc h3 { margin: 0; }
.staffc > p { font-size: 13px; }
.mnav { display: inline-flex; align-items: center; gap: 8px; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.st-row:hover { background: var(--soft); }
.st-mid { flex: 1; min-width: 0; }
.st-num { text-align: right; min-width: 90px; }
.st-num b, .st-num small { display: block; }
.st-arr { color: #888; width: 14px; }
.on-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22a55a; margin-right: 6px; vertical-align: middle; }
.st-days { padding: 0 6px 12px 50px; }
.st-days table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-days th { text-align: left; font-size: 12px; color: #888; font-weight: 600; padding: 6px 4px; }
.st-days td { padding: 7px 4px; border-top: 1px solid var(--line); }
.st-days tr.off td { color: #aaa; }
@media (max-width: 800px) {
  .chatbar #newCard { margin-left: 0; width: 100%; min-height: 44px; }
  .cper { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .cper .chip { flex: none; }
  .cf-row { grid-template-columns: 1fr; }
  .st-num.hm { display: none; }
  .st-days { padding-left: 0; }
  .st-days table { font-size: 13px; }
  /* чат на весь экран: переписку видно целиком */
  body.chatfull { overflow: hidden; position: fixed; inset: 0; width: 100%; overscroll-behavior: none; }
  /* клавиатура открыта: убираем всё лишнее, чтобы была видна переписка */
  body.chatfull.kb .ch-status, body.chatfull.kb .push:not(.open), body.chatfull.kb #waAlert { display: none; }
  body.chatfull.kb .ch-head { padding-top: 6px; padding-bottom: 6px; }
  body.chatfull.kb .ch-head small { -webkit-line-clamp: 1; }
  body.chatfull .msgs { overscroll-behavior: contain; }
  body.chatfull .back { font-size: 34px; min-width: 48px; min-height: 48px; }
  body.chatfull .tabbar { display: none; }
  body.chatfull .chats.has { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); min-height: 0; z-index: 40; border-radius: 0; box-shadow: none; }
  body.chatfull .ch-head { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  body.chatfull .ch-head small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.3; }
  body.chatfull .ch-head > div { min-width: 0; }
  body.chatfull .ch-in { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  body.chatfull .msgs { padding: 12px; }
  .ch-status { flex-wrap: nowrap; overflow-x: auto; padding: 6px 8px; gap: 6px; }
  .ch-status .chip { flex: none; min-height: 38px; padding: 6px 12px; white-space: nowrap; }
  .ch-in textarea { font-size: 16px; padding: 9px 14px; }
  .push { padding: 0; gap: 0; }
  .push-toggle { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; padding: 9px 12px; text-align: left; cursor: pointer; color: inherit; }
  .push-toggle span { transition: transform .2s; }
  .push .push-t, .push .push-b { display: none; }
  .push.open .push-t { display: block; padding: 0 12px; }
  .push.open .push-t b { display: none; }
  .push.open .push-b { display: flex; padding: 8px 12px 10px; }
  .push.open .push-toggle span { transform: rotate(90deg); }
}
@media (max-width: 800px) { .cper { gap: 4px; } .cper .chip { padding: 6px 9px; font-size: 13px; min-height: 36px; } .cdates { width: 100%; } .cdates input { flex: 1; min-width: 0; } }
.cf-days { margin: 0; font-size: 14px; font-weight: 600; background: var(--y2); border-radius: 12px; padding: 10px 12px; }
.cf-days.bad { background: #fdecea; color: #b3261e; }
/* 02.12: дата — отдельной строкой внизу пузыря, не налезает на короткий текст («📷 Фото») */
.msg { padding-bottom: 5px; }
.msg.media { padding-bottom: 5px; }
.msg small { position: static; display: block; text-align: right; white-space: nowrap; margin-top: 2px; line-height: 1.2; }
.msg.media small { padding-right: 6px; }
/* 02.12: перевести / снять заявку */
.ch-head .asg { margin-left: auto; flex: none; }
.ch-head.assignable #chWho { cursor: pointer; min-width: 0; }
.asgform p { margin: 0; }
.asg-list { display: flex; flex-wrap: wrap; gap: 8px; }
.asg-list .btn { min-height: 44px; flex: 1 1 140px; }
.btn.danger { color: #b3261e; border-color: #f2c4c0; min-height: 44px; }
@media (max-width: 800px) { .ch-head .asg { padding: 6px 10px; font-size: 12px; } }
.src-new { background: #e8f7ee; color: #1d7a45; }
/* 02.12: товары на Главной */
.prods { margin-top: 16px; }
.precs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.prec { border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.prec b { font-size: 14px; margin-bottom: 2px; }
.prec.buy { background: #eef3ff; } .prec.ad { background: #e8f7ee; } .prec.fix { background: #fdf3e3; }
.pbar { height: 4px; background: var(--soft); border-radius: 4px; margin-top: 5px; max-width: 220px; }
.pbar i { display: block; height: 100%; background: var(--y); border-radius: 4px; }
.pnote { display: block; font-size: 11.5px; font-weight: 400; }
.mtr { font-size: 13px; line-height: 1.35; color: #4a4a44; background: rgba(0,0,0,.04); border-radius: 10px; padding: 6px 9px; margin: 4px 0 2px; max-width: 280px; }
.msg.media .mtr { margin: 6px 4px 0; }
.und-foot { display: flex; justify-content: flex-end; margin-top: 6px; } .und-foot:empty { display: none; } .nt-item small { display: block; margin-top: 3px; }
/* 02.12: тревога WhatsApp — красная полоса сверху на любом экране */
#waAlert { position: sticky; top: 0; z-index: 35; display: flex; flex-direction: column; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: transparent; }
.wa-al { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #d93025; color: #fff; box-shadow: 0 8px 24px rgba(217,48,37,.35); animation: waPulse 2s ease-in-out infinite; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.wa-al.banned { background: #8a1c14; animation: none; }
.wa-al.down { background: #e8710a; box-shadow: 0 8px 24px rgba(232,113,10,.35); }
.wa-al-i { font-size: 24px; }
.wa-al > div { flex: 1; min-width: 0; }
.wa-al b { display: block; font-size: 15.5px; }
.wa-al small { display: block; font-size: 13px; opacity: .92; margin-top: 2px; line-height: 1.35; }
.wa-al .btn { background: #fff; color: #b3261e; border: 0; font-weight: 700; flex: none; min-height: 40px; }
@keyframes waPulse { 0%, 100% { box-shadow: 0 8px 24px rgba(217,48,37,.35); } 50% { box-shadow: 0 8px 34px rgba(217,48,37,.7); } }
@media (max-width: 800px) { .wa-al { flex-wrap: wrap; } .wa-al .btn { width: 100%; } body.chatfull #waAlert { display: none; } }

/* Push-уведомления (03.12) */
.ib.bell { border: 0; background: transparent; cursor: pointer; position: relative; }
.ib.bell.off::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.ib.bell.on svg { fill: #f6c200; stroke: #1a1a1a; }
#pushBar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: #fff8d6; border: 1px solid #f6c200; }
#pushBar .pb-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#pushBar small { color: #555; line-height: 1.35; }
#pushBar .pb-x { border: 0; background: transparent; font-size: 18px; color: #888; cursor: pointer; min-width: 44px; min-height: 44px; }
@media (max-width: 800px) { #pushBar { flex-wrap: wrap; } #pushBar .pb-t { flex: 1 1 calc(100% - 60px); } #pushBar .btn { order: 3; flex: 1 1 100%; } body.chatfull #pushBar { display: none; } }
.ib[hidden] { display: none; }

/* Пропущенные в чатах (03.12) */
.unb { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #25d366; color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.ci.unr b { font-weight: 800; }
.ci.unr small { color: #1a1a1a; }
.ci.unr .ci-r small { color: #1f9d55; font-weight: 700; }
.unt { color: #1f9d55; font-size: 12px; white-space: nowrap; }
@media (max-width: 800px) { .ib.bell { width: 44px; height: 44px; } #pushBar .btn { min-height: 44px; } }
.pm-snd { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.pm-snd input { width: 22px; height: 22px; }

/* Перевод (03.12) */
.mtrb { display: block; margin: 4px 0 2px; padding: 4px 10px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; color: #333; }
.mtrb:hover { border-color: var(--y); }
.mtrn { font-size: 13.5px; line-height: 1.35; color: #1f3d2b; background: #e9f6ee; border-radius: 10px; padding: 6px 9px; margin: 4px 0 2px; max-width: 320px; white-space: pre-wrap; }
.msg.media .mtrn, .msg.media .mtrb { margin: 6px 4px 0; }
.trbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px 0; background: var(--card); font-size: 13.5px; flex: none; }
.trbar .trx { width: 32px; height: 32px; font-size: 15px; margin-left: auto; }
@media (max-width: 800px) { .mtrb { min-height: 38px; padding: 6px 14px; } .trbar .btn { min-height: 38px; } .trbar .trx { width: 38px; height: 38px; } }

/* Клиент писал в оба филиала (03.12) */
.twin { flex: none; background: #eef3ff; border-bottom: 1px solid var(--line); font-size: 13px; }
.twin summary { list-style: none; cursor: pointer; padding: 8px 16px; font-weight: 600; display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.twin summary::-webkit-details-marker { display: none; }
.twin-ar { transition: transform .2s; flex: none; }
.twin[open] .twin-ar { transform: rotate(90deg); }
.twin-in { padding: 0 16px 10px; max-height: 38vh; overflow-y: auto; border-bottom: 1px solid #d6e0ff; }
@media (max-width: 800px) { .twin-in { max-height: 32vh; } .twin summary { padding: 8px 12px; } }
.twin-in p { margin: 4px 0; line-height: 1.35; }
.twin-m { margin-top: 6px; padding: 6px 10px; border-left: 3px solid #9db4ff; background: #fff; border-radius: 8px; }
.twin-note { font-size: 12px; margin-top: 6px; }
.twin-b { font-size: 12px; }

/* Карточка клиента (03.12) */
.ch-who { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.ch-who.click { cursor: pointer; border-radius: 12px; }
.ch-who.click:hover b { text-decoration: underline; }
.who-i { font-size: 12px; opacity: .7; }
.pform { max-width: 560px; max-height: 90vh; overflow-y: auto; }
.pf-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.pf-head .ava { width: 52px; height: 52px; font-size: 20px; }
.pf-head h3 { margin: 0; }
.pf-head p { margin: 2px 0 0; }
.pf-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pf-stats span { background: var(--y2); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.pf-row { display: grid; grid-template-columns: 1fr 90px; gap: 10px; }
.pf-auto { color: #3a6df0; font-weight: 500; }
.pf-upd { font-size: 12px; margin: 6px 0 0; }
.pform h4 { margin: 16px 0 6px; }
.pf-h { border-left: 3px solid var(--y); background: #faf8f2; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.pf-h p { margin: 3px 0; line-height: 1.35; }
.pf-h-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-found { background: #eef3ff; border-radius: 10px; padding: 8px 10px; }
/* 04.12: «Покупал раньше», ИИ-выжимка, кто менял статус */
.pf-buy { border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; line-height: 1.4; }
.pf-buy.yes { background: #e9f7ee; }
.pf-buy.no { background: #f3f3f3; }
.pf-buy-r { font-size: 13px; margin-top: 3px; }
.pf-sum { background: #fff8de; border-radius: 10px; padding: 8px 10px; margin: 8px 0 10px; font-size: 14px; }
.pf-sum ul { margin: 6px 0 2px; padding-left: 18px; }
.pf-sum li { margin: 3px 0; line-height: 1.35; font-size: 13px; }
.pf-sum p { margin: 4px 0 0; font-size: 13px; }
.pf-sum .pf-sum-t { font-size: 11px; }
.pf-slog { font-size: 13px; }
.pf-sl { padding: 4px 0; border-bottom: 1px solid #eee; line-height: 1.35; }
.pf-slog summary { cursor: pointer; padding: 4px 0; }
.st-by { font-size: 12px; }
.pf-found pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 4px 0 6px; }
.lead-twin { background: #eef3ff; border-radius: 10px; padding: 6px 10px; font-size: 13px; margin: 6px 0; line-height: 1.35; }
/* 03.12: галочки у сообщений магазина (как в WhatsApp) */
.msg .tick { letter-spacing: -3px; margin-left: 2px; padding-right: 3px; font-weight: 700; font-size: 11px; }
.msg .tick.read { color: #1a8fe3; }
/* 03.12: выбор камера / галерея у 📎 (телефон) */
.ch-in { position: relative; }
.clipmenu { position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; min-width: 210px; }
.clipmenu button { text-align: left; padding: 14px 16px; font: inherit; font-size: 16px; background: none; border: 0; cursor: pointer; }
.clipmenu button + button { border-top: 1px solid var(--line); }
.clipmenu button:active { background: var(--soft); }
/* 03.12: вечерняя проверка ИИ */
.aifx { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r2); background: var(--soft); margin-top: 10px; }
.aifx-who { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 260px; min-width: 0; cursor: pointer; }
.aifx-who small { display: block; color: var(--muted); }
.aifx-who p { margin: 4px 0 0; font-size: 13.5px; }
.aifx-in { display: flex; gap: 8px; align-items: center; }
.aifx-in input { width: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 16px; background: #fff; }
.aifx-wait { margin: 0; font-size: 13px; }
.aifix-bar { margin: 0 12px 8px; padding: 8px 12px; border-radius: 12px; background: #eef3ff; border: 1px solid #d6e2ff; font-size: 13px; line-height: 1.4; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.aifix-bar > div:first-child { flex: 1 1 100%; }
.aifix-bar .aifx-in input { width: 140px; }
#cSum .nw { white-space: nowrap; }
.cell-split { display: block; font-size: 11.5px; font-weight: 400; white-space: nowrap; }
/* LTV клиентов (03.12): компьютер — таблица, телефон — карточки */
.lt-top { margin: -6px 0 12px; }
.lt-note { font-size: 12.5px; color: #6f6f68; background: #fff8d6; border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; line-height: 1.45; }
.lt-kpis { grid-template-columns: repeat(5, 1fr); }
.lt-kpis .kpi b { font-size: 26px; }
.lt-filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lt-segd { margin: -2px 0 10px; font-size: 13.5px; }
.lt-q { width: 100%; margin-bottom: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); font-size: 15px; background: var(--card); }
.lt-table tbody tr { cursor: pointer; }
.lt-table tbody tr:hover td { background: #fafaf5; }
.lt-table small { font-size: 12px; }
.lt-sumc { white-space: nowrap; }
.lt-bar { display: inline-block; height: 8px; border-radius: 6px; background: #f6c200; vertical-align: middle; margin-right: 8px; }
.lt-seg { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: #f1efe6; color: #55554f; }
.lt-seg.lt-vip { background: #f6c200; color: #1e1e20; } .lt-seg.lt-loyal { background: #e3f4ea; color: #2b8a57; } .lt-seg.lt-sleep { background: #ecebfd; color: #5a4dd6; }
.lt-cards { display: none; }
.lt-card { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--sh); cursor: pointer; position: relative; margin-bottom: 10px; }
.lt-card .lt-seg { position: absolute; top: 14px; right: 14px; }
.lt-h { display: flex; gap: 10px; align-items: center; min-width: 0; padding-right: 90px; }
.lt-h b, .lt-h h3 { display: block; font-size: 15px; margin: 0; }
.lt-h small { color: var(--muted); font-size: 12.5px; }
.lt-sum { font-size: 26px; font-weight: 650; margin: 12px 0 4px; letter-spacing: -.6px; }
.lt-meta { font-size: 13px; color: #55554f; line-height: 1.6; }
.lt-more { display: block; margin: 12px auto; }
.lt-modal { max-width: 580px; }
.lt-modal .lt-h { padding-right: 40px; }
.lt-modal .lt-h h3 { font-size: 18px; }
.lt-mk { grid-template-columns: repeat(3, 1fr); margin: 16px 0; }
.lt-mk { grid-template-columns: 1.5fr 1fr 1fr; }
.lt-mk .kpi small { padding-right: 0; }
.lt-mk .kpi b { font-size: 22px; margin: 10px 0 0; }
.lt-hist { border-left: 3px solid #f1efe6; margin: 8px 0 0 8px; padding-left: 16px; }
.lt-hist > div { margin-bottom: 14px; position: relative; line-height: 1.5; }
.lt-hist > div::before { content: ''; position: absolute; left: -23px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: #f6c200; }
.lt-tag { font-size: 11.5px; border-radius: 999px; padding: 2px 8px; background: #e3f4ea; color: #2b8a57; white-space: nowrap; }
.lt-tag.ai { background: #fff3c4; color: #8a6a00; } .lt-tag.est { background: #f1efe6; color: #77776f; }
.lt-src { font-size: 12.5px; }
.lt-act { display: flex; gap: 8px; margin-top: 6px; }
@media (max-width: 1060px) { .lt-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) {
  .lt-table { display: none; } .lt-cards { display: block; }
  .lt-kpis { grid-template-columns: 1fr 1fr; } .lt-kpis .kpi b { font-size: 22px; }
  .lt-filters .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .lt-mk { gap: 8px; } .lt-mk .kpi { padding: 12px; } .lt-mk .kpi b { font-size: 15px; overflow: visible; white-space: normal; }
}

/* 04.12 (ночная проверка): поле ответа на телефоне, шапка чата, плашка уведомлений */
#pushBar .pb-more { display: none; }
@media (max-width: 800px) {
  .ch-in.has-txt { flex-wrap: wrap; justify-content: flex-end; }
  .ch-in.has-txt textarea { flex: 1 1 100%; order: -1; max-height: 40vh; }
  .ch-in.has-txt #clipBtn, .ch-in.has-txt #mic { display: none; }
  .ch-head .asg { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 18px; }
  .ch-head .asg .asg-t { display: none; }
  #pushBar { padding: 8px 10px; gap: 8px; }
  #pushBar:not(.more) small { display: none; }
  #pushBar:not(.more) .pb-more { display: inline; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: #6b5400; text-decoration: underline; text-align: left; cursor: pointer; }
  #pushBar:not(.more) .btn { order: 0; flex: none; }
  #pushBar:not(.more) .pb-t { flex: 1 1 0; }
}
@media (max-width: 800px) {
  /* кнопки под палец (норма 44 px) */
  .chips .chip, .seg button { min-height: 44px; }
  .clip { width: 44px; height: 44px; }
  .msg .mdel { padding: 10px; left: -40px; }
  /* шапка: длинное имя профиля не вылезает за экран */
  .topbar { min-width: 0; }
  .top-r, .user, .uinfo { min-width: 0; }
  .top-r { flex: 0 1 auto; }
  /* ряд статусов в чате: видно, что можно листать вбок */
  .ch-status.more { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .ch-status .chip { min-height: 44px; }
  /* подсказки: переносить текст, не обрезать */
  .toast { white-space: normal; text-align: center; border-radius: 16px; width: max-content; max-width: 92vw; line-height: 1.35; }
  body.chatfull .toast { top: calc(70px + env(safe-area-inset-top)); }
}
/* 04.12: фильтр чатов по статусу */
.cst { -webkit-appearance: none; appearance: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 34px 8px 14px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; }
@media (max-width: 800px) { .cst { min-height: 44px; font-size: 16px; flex: 1 1 auto; } }

/* 04.12: смены */
.shiftbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff6d6; border: 1px solid #f1d46b; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.sh-week h3 small { font-weight: 400; margin-left: 6px; }
.sh-table td, .sh-table th { vertical-align: middle; }
.sh-table tr.today td { background: #fffbea; }
.sh-table tr.past td { opacity: .55; }
.sh-table { table-layout: fixed; width: 100%; }
.sh-table th:first-child { width: 22%; } .sh-table th:nth-child(2) { width: 14%; }
.sh-sel { display: block; width: 100%; min-width: 0; height: 44px; padding: 0 12px; line-height: 42px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-fb { display: block; margin-top: 3px; font-size: 12px; line-height: 1.25; }
.sh-sel.empty { border-color: #f1b04b; background: #fff8ee; }
@media (max-width: 800px) {
  .sh-table th:nth-child(2), .sh-table td:nth-child(2) { display: none; }
  .sh-sel { font-size: 14px; padding-left: 10px; }
  .sh-table th:first-child { width: 26%; }
  .sh-table td { padding: 6px 4px; }
}
/* 04.12: распределение по менеджерам */
.dist h3 { margin: 0; }
.dist-t th.num, .dist-t td.num { text-align: center; white-space: nowrap; }
.dist-t th { font-size: 12px; }
.dcell { min-width: 44px; min-height: 36px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-weight: 600; cursor: pointer; }
.dcell.tot { background: #f4f4f1; }
.dcell.on { background: #1d1d1b; color: #fff; border-color: #1d1d1b; }
.dist-sum td { border-top: 2px solid var(--line); }
.dist-f { margin: 10px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip.small { padding: 6px 12px; font-size: 13px; }

/* 04.12: блок «📋 Из Битрикса» в карточке клиента */
.pf-bx { background: #eef3fb; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; line-height: 1.4; }
.pf-bx.yes { background: #e6f0ff; border-left: 3px solid #2f6fdf; }
.pf-bx.none { background: #f3f3f3; font-size: 13px; }
.pf-bx-d { border-top: 1px solid #d6e0f0; margin-top: 6px; padding-top: 6px; font-size: 13px; }
.pf-bx-d p { margin: 2px 0; overflow-wrap: anywhere; }
.pf-bx-m { font-size: 11px; }
.pf-bx-st { font-size: 12px; padding: 1px 6px; border-radius: 8px; background: #e7e7e7; }
.pf-bx-st.ok { background: #d8f3e2; color: #146c36; }
.pf-bx-st.bad { background: #fde2e2; color: #a12626; }
.pf-bx-w { color: #a15c00; font-size: 13px; margin: 4px 0; }

@media (max-width: 400px) { /* 04.12: iPhone SE — таблица заявок влезает без прокрутки вбок */
  .table-wrap th { white-space: normal; } .table-wrap th, .table-wrap td { padding: 10px 4px; font-size: 12px; } .card.table-wrap { padding: 10px 8px; }
  .table-wrap td .st { font-size: 11px; padding: 3px 6px; }
}
.more-rows { text-align: center; margin: 14px 0; }

/* 04.12: строка «откуда пришли» на карточках главной */
.kpi .kpi-src { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 10px; color: #2f2f2b; font-weight: 500; }
.kpi .kpi-src i { font-style: normal; white-space: nowrap; }
.lt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lt-row #ltvBtn { white-space: nowrap; }
/* 05.12: кнопка «Перепроверка ИИ» на Главной руководства */
.aifix-btn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 14px 18px; margin: 14px 0; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--sh); }
.aifix-btn span { font-weight: 600; font-size: 16px; }
.aifix-btn small { color: var(--muted); font-size: 14px; flex: 1; }
.aifix-btn em { font-style: normal; font-size: 22px; color: var(--muted); }
.aifix-btn:hover { box-shadow: 0 0 0 2px #f6c200 inset; }
/* 05.12 (Арман: «листаю чаты — страница тоже листается»): на телефоне у списка чатов нет своей прокрутки — листается только страница */
@media (max-width: 800px) {
  .chats:not(.has) { height: auto; min-height: 0; overflow: visible; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .chats:not(.has) .clist { overflow: visible; min-width: 0; border-right: 0; }
  .chats:not(.has) .csearch { position: sticky; top: 0; z-index: 5; background: var(--card); padding-top: 6px; padding-bottom: 6px; }
}
/* 05.12: Главная — переключатель «Все / Торекулова / Туркестанская» над 6 цифрами */
.seg.home-shop { margin: 0 0 12px; }
.seg.home-shop button { padding: 9px 18px; font-size: 14.5px; }
@media (max-width: 800px) { .seg.home-shop { display: flex; width: 100%; flex-wrap: nowrap; } .seg.home-shop button { flex: 1; padding: 10px 6px; } }
/* 05.12 (Арман, п.15): «Менеджеры» на телефоне — карточки вместо таблицы, всё умещается без прокрутки вбок */
.mgr-cards { display: none; }
@media (max-width: 640px) {
  .mgr-t { display: none; }
  .mgr-cards { display: grid; gap: 10px; }
  .mgr-c { background: var(--soft); border-radius: 16px; padding: 12px; min-width: 0; }
  .mgr-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .mgr-h small { margin-left: auto; font-size: 12px; }
  .mgr-n { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 6px; margin-top: 10px; }
  .mgr-n span { display: flex; flex-direction: column; min-width: 0; }
  .mgr-n small { font-size: 11.5px; color: var(--muted, #77776f); }
  .mgr-n b { font-size: 17px; white-space: nowrap; }
  .mgr-n em { font-style: normal; font-size: 11.5px; color: var(--muted, #77776f); white-space: nowrap; }
  .mgr-f { margin-top: 8px; font-size: 12px; }
}
@media (max-width: 340px) { .mgr-n b { font-size: 15px; } .mgr-n { grid-template-columns: 0.8fr 1fr 1.7fr; } }
.lesson-tabs{margin:0 0 12px}
/* 05.12: смайлики в чате — панель над полем ввода (частые + поиск) */
.emo-pop { position: fixed; z-index: 60; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line, #ddd); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18); overflow: hidden; }
.emo-top { display: flex; gap: 6px; padding: 8px 8px 4px; }
.emo-q { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 0 10px; font-size: 16px; background: var(--soft); color: inherit; }
.emo-x { width: 38px; height: 38px; border: 0; background: none; font-size: 16px; cursor: pointer; color: inherit; }
.emo-tabs { display: flex; gap: 2px; padding: 2px 6px; border-bottom: 1px solid var(--line, #eee); overflow-x: auto; flex: none; }
.emo-tab { flex: 1; min-width: 38px; height: 36px; border: 0; background: none; font-size: 20px; border-radius: 8px; cursor: pointer; opacity: .55; }
.emo-tab.on { opacity: 1; background: rgba(127,127,127,.15); }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); padding: 4px 6px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.emo-h { grid-column: 1 / -1; font-size: 12px; opacity: .6; padding: 6px 4px 2px; }
.emo-b { height: 42px; border: 0; background: none; font-size: 26px; line-height: 1; border-radius: 8px; cursor: pointer; padding: 0; }
.emo-b:hover { background: rgba(127,127,127,.15); }
.emo-none { grid-column: 1 / -1; padding: 16px 8px; font-size: 13.5px; opacity: .7; }
@media (max-width: 420px) { .ch-in .clip { width: 36px; height: 36px; font-size: 19px; } }
