/* Фирменный стиль экосистемы DEEP IT (как в deep чат и Deep пульс) */
:root {
  --app: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #ececef;
  --surface-3: #e0e0e4;
  --content: #2a2b2f;
  --muted: #52545a;
  --faint: #696b71;
  --line: #e0e0e4;
  --accent: #bb080b;
  --accent-hover: #9e070a;
  --accent-soft: #fbe9e9;
  --ok: #0f7b3f;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.04);
  --radius: 8px;
  /* синонимы: часть экранов пишет --border / --text */
  --border: var(--line);
  --text: var(--content);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --app: #17181c; --surface: #1f2025; --surface-2: #2a2b31; --surface-3: #35363d;
    --content: #f2f2f4; --muted: #b4b5bb; --faint: #8d8f96; --line: #33343a;
    --accent: #e02d30; --accent-hover: #f04346; --accent-soft: #3a1d1e;
    --ok: #4cc27f; --ok-soft: #173325; --warn: #e5a93a; --warn-soft: #3a2e17;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --app: #17181c; --surface: #1f2025; --surface-2: #2a2b31; --surface-3: #35363d;
  --content: #f2f2f4; --muted: #b4b5bb; --faint: #8d8f96; --line: #33343a;
  --accent: #e02d30; --accent-hover: #f04346; --accent-soft: #3a1d1e;
  --ok: #4cc27f; --ok-soft: #173325; --warn: #e5a93a; --warn-soft: #3a2e17;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; background: var(--app); color: var(--content);
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--faint); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Каркас */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; padding: 4px 8px 16px; letter-spacing: -0.02em; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.logo b { color: var(--accent); font-weight: 800; }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius);
  text-decoration: none; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--content); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-backdrop, .mobile-nav-close { display: none; }
.main { padding: 24px 28px 48px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.mobile-bar { display: none; }

/* Карточки и таблицы */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.stat .label { color: var(--faint); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; margin-top: 2px; }
.up { color: var(--ok); } .down { color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--faint); padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: none; }
.empty { padding: 40px 16px; text-align: center; color: var(--faint); }
.access-denied{max-width:640px;margin:clamp(24px,8vh,90px) auto;padding:clamp(20px,5vw,38px);text-align:center}.access-denied-icon{width:54px;height:54px;margin:0 auto 14px;display:grid;place-items:center;border-radius:50%;background:var(--surface-2);font-size:23px}.access-denied h1{margin:0 0 8px;font-size:22px}.access-denied p{max-width:480px;margin:0 auto 20px;line-height:1.55}.access-denied .row{justify-content:center;flex-wrap:wrap;gap:10px}

/* Кнопки и поля */
button, .btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--content);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.big { padding: 14px 20px; font-size: 16px; }
button.danger { color: var(--accent); }
input, select, textarea {
  font: inherit; color: var(--content); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input.cell { padding: 5px 8px; text-align: right; width: 96px; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form { display: grid; gap: 12px; }
.form-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: auto; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--accent-soft); color: var(--accent); }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.tabs button { border: none; background: transparent; padding: 6px 12px; }
.tabs button.on { background: var(--surface); box-shadow: var(--shadow); }

/* Модальное окно и уведомления */
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; box-shadow: 0 12px 48px rgb(0 0 0 / 0.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 60; background: var(--content); color: var(--surface); padding: 12px 16px; border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.2); max-width: 380px; }
.toast.error { background: var(--accent); color: #fff; }

/* Статус программы кассы (Deep Учёт Агент) */
.agent-bar { margin: -8px 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.agent-bar.warn { background: var(--warn-soft); color: var(--warn); }
.agent-bar.red { background: var(--accent-soft); color: var(--accent); }

/* Дисплей покупателя — крупно, читается с метра-двух */
.cd { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--app); color: var(--content); font-size: 22px; }
.cd-head { display: flex; align-items: center; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cd-store { font-weight: 800; font-size: 24px; flex: 1; }
.cd-customer { font-size: 20px; color: var(--muted); }
.cd-lines { overflow-y: auto; padding: 8px 28px; }
.cd-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cd-name { font-weight: 600; }
.cd-qty { grid-row: 2; color: var(--faint); font-size: 18px; }
.cd-amount { grid-row: 1 / span 2; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cd-return { color: var(--accent); font-weight: 800; padding: 8px 0; text-transform: uppercase; }
.cd-total { padding: 18px 28px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.cd-row { display: flex; justify-content: space-between; font-size: 22px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.cd-sum { font-size: 44px; font-weight: 800; }
.cd-sum b { color: var(--accent); }
.cd-thanks { font-size: 40px; font-weight: 800; text-align: center; padding: 8px 0 12px; }
.cd-idle { grid-template-rows: auto auto 1fr auto; place-items: center; text-align: center; padding: 48px; gap: 24px; }
.cd-brand .logo { font-size: 28px; padding: 0; }
.cd-title { font-size: 56px; font-weight: 800; letter-spacing: -0.02em; }
.cd-message { font-size: 36px; color: var(--accent); font-weight: 700; max-width: 900px; animation: cd-fade 0.6s ease; }
.cd-hint { color: var(--muted); font-size: 22px; }
.drop-on { outline: 2px dashed var(--accent); outline-offset: -6px; }
/* Слайды рекламы */
.cd-ads { display: block; background: #000; }
.cd-split { position: fixed; inset: 0; display: grid; grid-template-columns: 55% 45%; }
.cd-split .cd { position: relative; }
.cd-side { position: relative; background: #000; }
.ss { position: absolute; inset: 0; animation: cd-fade 0.6s ease; }
.ss img, .ss video { width: 100%; height: 100%; display: block; object-fit: contain; }
.ss-text { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 6vw; font-size: clamp(28px, 5vw, 80px); font-weight: 800; line-height: 1.15; }
.ss-thumb { width: 96px; height: 54px; border-radius: 6px; overflow: hidden; background: #000; position: relative; flex: none; }
.ss-thumb img, .ss-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ss-thumb .ss-text { font-size: 9px; padding: 4px; }
@keyframes cd-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cd-message { animation: none; } }

/* Поиск товара */
.picker { position: relative; }
.picker-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); max-height: 320px; overflow-y: auto;
}
.picker-item { padding: 8px 12px; cursor: pointer; display: flex; gap: 12px; }
.picker-item:hover, .picker-item.on { background: var(--surface-2); }

/* Вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 20px; }
.logo-mark svg { width: 66%; height: 66%; }
.auth-hero .logo { justify-content: center; font-size: 30px; padding: 0 0 8px; gap: 10px; }
.auth-hero .logo-mark { width: 44px; height: 44px; border-radius: 11px; }
.auth-hero p { color: var(--muted); margin: 0; }

/* Касса */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .pos { grid-template-columns: minmax(0, 1fr); } .pos-side { position: static; } }
.pos-cart td { padding: 8px 10px; }
.pos-total { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pos-side { position: sticky; top: 16px; display: grid; gap: 12px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { padding: 2px 8px; }
.qty input { width: 64px; text-align: center; padding: 4px; }
.pos-scan input { font-size: 18px; padding: 12px 14px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* График */

@media (max-width: 900px) {
  .layout { display: block; width: 100%; min-height: 100vh; min-height: 100dvh; }
  .sidebar { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(320px, 88vw); height: auto; min-height: 100vh; min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); transform: translate3d(-103%,0,0); transition: transform .22s ease; overscroll-behavior: contain; box-shadow: none; }
  .sidebar.open { transform: translate3d(0,0,0); box-shadow: 8px 0 38px rgb(0 0 0 / .22); }
  .sidebar-backdrop { position: fixed; z-index: 69; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgb(13 17 24 / .48); backdrop-filter: blur(1px); }
  .nav a { min-height: 44px; padding: 10px 11px; }
  .nav-group { padding-top: 15px; }
  .nav-collapse { display: none !important; }
  .mobile-nav-close { display: inline-flex !important; width: 42px; height: 42px; flex: none; justify-content: center; align-items: center; padding: 0; font-size: 28px; line-height: 1; }
  .sidebar-top { display: flex; align-items: center; }
  .sidebar-top .logo { flex: 1; }
  .mobile-bar { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
  .mobile-bar > button { min-width: 42px; min-height: 42px; justify-content: center; padding: 7px; }
  .mobile-bar .logo { padding: 4px 2px; font-size: 16px; gap: 6px; white-space: nowrap; }
  .mobile-bar .logo-mark { width: 26px; height: 26px; }
  .mobile-bar .theme-toggle { flex: none; }
  .main { width: 100%; min-width: 0; padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); }
  .main > * { min-width: 0; }
  .page-head { align-items: flex-start; gap: 8px; margin-bottom: 15px; }
  .page-head h1 { font-size: 21px; }
  .card { padding: 13px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tabs { max-width: 100%; overflow-x: auto; white-space: nowrap; }
  .tabs button { flex: none; min-height: 40px; }
  button, .btn { min-height: 42px; }
  input, select, textarea { min-height: 42px; }
  .toast { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
  .pos { grid-template-columns: 1fr; }
  .pos-side { position: static; }
  .form-2 { grid-template-columns: 1fr; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
}
@media (max-width: 480px) {
  .main { padding: 12px 10px calc(28px + env(safe-area-inset-bottom)); }
  .mobile-bar { gap: 3px; padding-right: 6px; padding-left: 6px; }
  .mobile-menu-button { min-width: 38px !important; }
  .mobile-bar .logo { font-size: 14px; }
  .mobile-bar .workplace-switch .workplace-label { display: none; }
  .mobile-bar .bell-wrap, .mobile-bar .team-chat { flex: none; }
  .mobile-bar .chat-fab { width: 38px; min-width: 38px; height: 40px; padding: 7px; }
  .mobile-bar .theme-toggle { width: 38px; min-width: 38px; padding: 6px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat .value { font-size: 21px; }
  .card { border-radius: 10px; padding: 11px; }
  .form-2 { grid-template-columns: minmax(0, 1fr); }
  .modal { max-height: calc(100dvh - 20px); padding: 15px; }
}
@media print {
  .sidebar, .mobile-bar, .no-print, .page-head button { display: none !important; }
  .layout { display: block; }
  .card { box-shadow: none; border: none; }
}

/* Меню «Печать ▾» */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  display: grid; gap: 2px;
}
.dropdown-menu button { background: none; border: 0; text-align: left; justify-content: flex-start; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.dropdown-menu button:hover { background: var(--surface-2); }
@media (max-width: 640px) { .dropdown-menu { right: auto; left: 0; } }

/* Карточка компании */
.company-card { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.company-card h2 { margin: 0 0 4px; font-size: 16px; }
@media (max-width: 640px) { .company-card { grid-template-columns: 1fr; } }

/* Фото товара */
.thumb { flex: none; width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: inline-grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-head { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.photo-field { display: grid; gap: 6px; text-align: center; }
.photo-box { width: 150px; height: 150px; border: 1.5px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.photo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.photo-field.drag .photo-box { border-color: var(--accent, #bb080b); }
@media (max-width: 520px) { .product-head { grid-template-columns: 1fr; } .photo-field { justify-items: center; } }
.org-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.org-card { display: grid; gap: 4px; cursor: pointer; }
.org-card:hover { border-color: var(--faint); }
.org-card h2 { margin: 6px 0 2px; font-size: 17px; }
.price-types { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 12px; border-radius: 10px; background: var(--surface-2); }

/* Товары: дерево групп, папки, колонки */
.products-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.products-layout.no-tree { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .products-layout { grid-template-columns: 1fr; } }
.tree { padding: 10px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; border: 1px dashed transparent; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.on { background: var(--surface-3); font-weight: 600; }
.tree-row.over, .folder-row.over td { border-color: #bb080b; background: color-mix(in srgb, #bb080b 10%, transparent); }
.tree-caret { background: none; border: 0; padding: 0 2px; width: 16px; color: var(--muted); cursor: pointer; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: 12px; color: var(--faint); }
.tree-actions { display: none; gap: 2px; }
.tree-row:hover .tree-actions { display: inline-flex; }
.tree-actions button { background: none; border: 0; padding: 2px 4px; color: var(--muted); cursor: pointer; border-radius: 4px; }
.tree-actions button:hover { background: var(--surface-3); color: var(--content); }
@media (hover: none) { .tree-actions { display: inline-flex; } }
.crumbs { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
button.link { background: none; border: 0; padding: 0; color: #bb080b; cursor: pointer; font: inherit; }
button.link:hover { text-decoration: underline; }
.folder-row td { background: var(--surface-2); }
.folder-icon { font-size: 18px; }
.group-row td { background: var(--surface-2); font-weight: 600; font-size: 13px; }
tr.selected td { background: color-mix(in srgb, #bb080b 6%, transparent); }
th.col-mark, td.col-mark { background: color-mix(in srgb, #f5b400 14%, transparent); font-weight: 600; }
.warn-text { color: #b26a00; font-weight: 600; }
.bulk-bar { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; gap: 10px; }
.bulk-bar select { width: auto; }
.col-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.col-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.col-list li.dragging { opacity: .5; }
.grip { cursor: grab; color: var(--faint); user-select: none; letter-spacing: -2px; }
.filters .check { flex: none; white-space: nowrap; }
.filters .check input { width: auto; flex: none; min-width: 0; }

/* Каталог на кассе */
.pos-catalog { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 60vh; overflow: auto; padding: 2px; }
.cat-tile { position: relative; display: grid; grid-template-rows: 96px auto auto; gap: 4px; padding: 8px; text-align: left; align-content: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; color: inherit; }
.cat-tile:hover { border-color: #bb080b; box-shadow: var(--shadow); }
.cat-tile:active { transform: scale(.98); }
.cat-tile.folder { background: var(--surface-2); }
.cat-tile.out { opacity: .6; }
.cat-img { height: 96px; display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; overflow: hidden; font-size: 40px; color: var(--faint); }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-name { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.cat-added { position: absolute; top: 6px; right: 6px; background: #bb080b; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

/* Дисплей покупателя: тема, фирменный цвет, масштаб шрифта из конструктора */
.cd-theme-dark { --cd-bg: #17181c; --cd-surface: #1f2025; --cd-text: #f2f2f4; --cd-muted: #b4b5bb; --cd-faint: #8d8f96; --cd-line: #33343a; }
.cd-theme-light { --cd-bg: #f4f4f6; --cd-surface: #ffffff; --cd-text: #17181c; --cd-muted: #55565c; --cd-faint: #7a7b82; --cd-line: #e0e0e4; }
.cd { background: var(--cd-bg, var(--app)); color: var(--cd-text, var(--content)); font-size: calc(22px * var(--cd-font, 1)); }
.cd-head, .cd-total { background: var(--cd-surface, var(--surface)); border-color: var(--cd-line, var(--line)); }
.cd-line { border-color: var(--cd-line, var(--line)); }
.cd-store { font-size: 1.1em; display: flex; align-items: center; gap: 12px; }
.cd-customer, .cd-hint { color: var(--cd-muted, var(--muted)); font-size: 0.9em; }
.cd-qty { color: var(--cd-faint, var(--faint)); font-size: 0.82em; }
.cd-row { font-size: 1em; }
.cd-sum { font-size: 2em; }
.cd-thanks { font-size: 1.8em; }
.cd-title { font-size: 2.5em; }
.cd-return, .cd-sum b, .cd-message { color: var(--cd-accent, var(--accent)); }
.cd-idle { background-size: cover; background-position: center; }
.cd-logo { max-height: 120px; max-width: 60%; object-fit: contain; }
.cd-logo.small { max-height: 1.6em; }
.cd-line.with-photo { grid-template-columns: auto 1fr auto; }
.cd-photo { grid-row: 1 / span 2; width: 2.6em; height: 2.6em; border-radius: 8px; overflow: hidden; background: var(--cd-line, var(--line)); align-self: center; }
.cd-photo img { width: 100%; height: 100%; object-fit: cover; }
.cd-line.with-photo .cd-qty { grid-row: 2; grid-column: 2; }
.cd-line.with-photo .cd-amount { grid-column: 3; }
.cd-split { display: flex; grid-template-columns: none; }
.cd-split .cd { flex: 1; min-width: 0; }

/* Предпросмотр в конструкторе: экран 1280×720, уменьшенный под ширину */
.cd-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.cd-preview-screen { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; transform-origin: 0 0; }
.cd-preview-screen .cd, .cd-preview-screen .cd-split { position: absolute; inset: 0; }
.cd-preview-screen .cd-split .cd { position: relative; }
.display-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.display-builder .sticky { position: sticky; top: 12px; }
@media (max-width: 1100px) { .display-builder { grid-template-columns: 1fr; } .display-builder .sticky { position: static; } }
.data-table td:first-child { font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: nowrap; }

/* ---------- Посадочная страница (стиль экосистемы DEEP: deep чат, Deep пульс) ---------- */
.lp { background: var(--app); color: var(--content); min-height: 100vh; --lp-radius: 16px; }
.lp-wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.lp section { padding: 56px 0; }
.lp h1, .lp h2 { font-family: Montserrat, Inter, system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.lp h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; }
.lp h1 em, .lp-eco em { font-style: normal; color: var(--accent); }
.lp h2 { font-size: clamp(24px, 3vw, 36px); line-height: 1.15; margin-bottom: 10px; }
.lp h3 { font-size: 17px; margin: 0 0 6px; }
.lp p { line-height: 1.55; }
.lp-center { text-align: center; }
.lp-kicker { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.lp-sub { color: var(--muted); margin: 0 0 24px; max-width: 760px; }
.lp-pill { border-radius: 999px !important; padding: 12px 22px !important; font-weight: 700; }
.lp-shadow { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }

.lp-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--app) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lp-head-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.lp-head .logo { font-size: 20px; }
.lp-nav { display: flex; gap: 22px; margin-left: 24px; }
.lp-nav a { color: var(--content); text-decoration: none; font-size: 14px; font-weight: 500; }
.lp-nav a:hover { color: var(--accent); }
.lp-login { padding: 8px 18px !important; }
.lp-burger { display: none; }
@media (max-width: 960px) {
  .lp-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .lp-nav.open { display: flex; }
  .lp-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .lp-burger { display: inline-flex; }
}

.lp-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 420px); gap: 48px; align-items: start; padding-top: 48px !important; }
@media (max-width: 960px) { .lp-hero { grid-template-columns: 1fr; gap: 28px; } }
.lp-badge { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.lp-lead { font-size: 18px; margin: 20px 0 10px; }
.lp-note { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.lp-chips span:nth-child(-n+7) { background: #52545a; color: #fff; border-color: transparent; }
.lp-flow { margin-top: 28px; max-width: 360px; }
.lp-flow-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.lp-flow-card small { display: block; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.lp-arrow { color: var(--accent); text-align: center; padding: 2px 0; }
.lp-auth-wrap { position: sticky; top: 88px; }
.lp-auth { padding: 22px; border-radius: 20px; box-shadow: 0 18px 50px rgb(0 0 0 / .08); }

.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--lp-radius); padding: 22px; position: relative; }
.lp-card p { color: var(--muted); margin: 0; font-size: 15px; }
.lp-grid3, .lp-grid4 { display: grid; gap: 16px; }
.lp-grid3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lp-grid4 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lp-values h2 { margin-bottom: 24px; }
.lp-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); margin-bottom: 14px; }
.lp-tag { position: absolute; top: 16px; right: 16px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.lp-case small { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.lp-case ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.lp-num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.lp-eco { text-decoration: none; color: inherit; }
.lp-eco b { font-family: Montserrat, Inter, sans-serif; font-size: 22px; display: block; margin-bottom: 6px; }
.lp-eco.on { border-color: var(--accent); }
a.lp-eco:hover { border-color: var(--faint); }
.lp-plan { display: flex; flex-direction: column; gap: 8px; }
.lp-plan h3 { font-family: Montserrat, Inter, sans-serif; font-size: 24px; }
.lp-plan ul { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; flex: 1; }
.lp-plan li::before { content: '✓'; color: var(--accent); font-weight: 800; margin-right: 8px; }
.lp-plan.popular { border: 2px solid var(--accent); box-shadow: 0 18px 50px color-mix(in srgb, var(--accent) 14%, transparent); }
.lp-price { font-weight: 800; font-size: 18px; margin: 4px 0 8px; }
.lp-faq .lp-q { padding: 0; margin-bottom: 10px; }
.lp-q button { width: 100%; display: flex; justify-content: space-between; gap: 12px; background: none; border: 0; padding: 18px 22px; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
.lp-q button span { color: var(--accent); font-size: 22px; line-height: 1; }
.lp-q p { padding: 0 22px 18px; }
.lp-band { background: linear-gradient(135deg, var(--accent), #6d0507); color: #fff; border-radius: 24px; padding: 48px 24px; text-align: center; }
.lp-band h2 { color: #fff; }
.lp-band p { color: rgb(255 255 255 / .85); margin: 0 0 22px; }
.lp-white { background: #fff !important; color: #1f2025 !important; border: 0 !important; }
.lp-outline { background: transparent !important; color: #fff !important; border: 1px solid rgb(255 255 255 / .6) !important; }
.lp-foot { background: #1f2025; color: #d9d9de; padding: 48px 0 24px; margin-top: 24px; }
.lp-foot h3 { color: #fff; }
.lp-foot p { margin: 4px 0; font-size: 14px; }
.lp-foot a { color: #fff; }
.lp-foot-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.lp-copy { margin-top: 28px; padding-top: 16px; border-top: 1px solid #33343a; font-size: 13px; color: #8d8f96; }
.lp section, .lp footer { scroll-margin-top: 72px; }

/* Касса: баллы и любимые категории */
.pos-points { font-size: 15px; } .pos-points b { font-size: 26px; font-weight: 800; color: var(--accent); }
.fav-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip { border-radius: 999px; padding: 8px 14px; }
.fav-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Логотип компании вместо логотипа Deep Учёт */
.brand-logo img { max-height: 40px; max-width: 180px; object-fit: contain; display: block; }
.brand-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--content); }
.price-map { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* ---------- Магазины на карте (сводка) ---------- */
.stores-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.store-map { height: 380px; border-radius: var(--radius); overflow: hidden; position: relative; z-index: 0; background: var(--surface-2); }
.empty-map { display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex: none; }
.store-pin { background: #bb080b; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.store-map .leaflet-popup-content { color: #1a1a1a; font: 13px/1.45 Inter, system-ui, sans-serif; }
.place-stores { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .place-stores { grid-template-columns: 1fr; } }
.place-stores .list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.place-stores .list button { justify-content: flex-start; text-align: left; }
.place-stores .list button.on { background: var(--surface-2); font-weight: 600; }
.geo-results { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; max-height: 160px; overflow: auto; }
.geo-results button { justify-content: flex-start; text-align: left; white-space: normal; }
/* Тёмная тема: подложка карты темнее, метки остаются своих цветов */
:root[data-theme='dark'] .store-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .store-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
}

/* ---------- Разбор выручки ---------- */
.explain { margin: 0; padding-left: 20px; line-height: 1.6; }
.factor-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
a.plain { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
/* Подписи меток и легенда карты */
.store-map .leaflet-tooltip.store-label { background: rgba(255, 255, 255, .94); color: #111827; border: 1px solid #d1d5db; border-left: 4px solid #8b8b95; border-radius: 6px; padding: 3px 7px; font: 12px/1.35 Inter, system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.store-map .leaflet-tooltip.store-label::before { display: none; }
.store-map .leaflet-tooltip.store-label.good { border-left-color: #16a34a; }
.store-map .leaflet-tooltip.store-label.warn { border-left-color: #d97706; }
.store-map .leaflet-tooltip.store-label.bad { border-left-color: #dc2626; }
.map-legend { background: rgba(255, 255, 255, .94); color: #111827; border-radius: 8px; padding: 6px 10px; font: 12px/1.6 Inter, system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 320px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; border: 1.5px solid #1f2937; vertical-align: -1px; }
.map-legend .muted { color: #6b7280; }

/* ---------- Кадры ---------- */
.form.grid-3 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-items: start; }
.big-num { font-size: 22px; font-weight: 700; margin-top: 4px; }
.msg-box, .msg.warn { padding: 8px 12px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }
table.timesheet { font-size: 12px; border-collapse: separate; border-spacing: 0; }
table.timesheet th, table.timesheet td { padding: 4px 3px; text-align: center; min-width: 30px; }
table.timesheet th.wkend { color: var(--accent); }
table.timesheet .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 190px; padding-left: 12px; }
table.timesheet td.ts { cursor: pointer; font-weight: 600; line-height: 1.1; border-left: 1px solid var(--border); user-select: none; }
table.timesheet td.ts small { display: block; font-weight: 400; font-size: 10px; opacity: .8; }
table.timesheet td.ts:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
table.timesheet td.wkend { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.timesheet td.out { cursor: default; background: repeating-linear-gradient(45deg, transparent 0 4px, var(--surface-2) 4px 8px); }
table.timesheet td.dirty { box-shadow: inset 0 -3px 0 var(--accent); }
.ts.w, .ts-code.w { color: var(--ok); }
.ts.w2, .ts-code.w2 { color: #7c3aed; }
.ts.off, .ts-code.off { color: var(--muted); }
.ts.vac, .ts-code.vac { color: #2563eb; }
.ts.sick, .ts-code.sick { color: var(--warn); }
.ts.bad, .ts-code.bad { color: var(--accent); }
.ts-code { min-width: 38px; padding: 4px 8px; font-weight: 700; }
.ts-code.on { outline: 2px solid currentColor; background: var(--surface-2); }
.staff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.staff-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; height: auto; }
.staff-list button:disabled { opacity: .5; }

/* ---------- Конструктор чека ---------- */
.receipt-builder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .receipt-builder { grid-template-columns: 1fr; } }
.receipt-preview-col { position: sticky; top: 12px; }
.tpl-line { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.tpl-main { flex: 1; min-width: 220px; display: flex; gap: 6px; }
.tpl-main input { flex: 1; min-width: 0; }
.tpl-token { width: 62px; flex: none; }
.tpl-tools { display: flex; gap: 2px; align-items: center; }
.tpl-tools select { width: auto; padding: 4px 6px; }
.tpl-tools button.on { background: var(--surface-2); outline: 1px solid var(--accent); }
.paper { background: #fff; color: #111; font: 13px/1.35 'Courier New', ui-monospace, monospace; padding: 16px; border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25); white-space: pre; overflow: hidden; max-width: 100%;
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) bottom/12px 8px repeat-x; }
.paper .b { font-weight: 700; }
.paper .big { font-size: 22px; line-height: 1.3; font-weight: 700; }
.paper .fiscal { color: #9ca3af; margin: 8px 0; padding: 6px 0; border-top: 1px dashed #d1d5db; border-bottom: 1px dashed #d1d5db; white-space: pre-wrap; }
.qr-box { display: flex; flex-direction: column; align-items: center; margin: 6px 0; }
.qr-mock { width: 96px; height: 96px; background:
  conic-gradient(#111 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0/16px 16px; outline: 6px solid #fff; box-shadow: 0 0 0 7px #111; }
.qr-data { font-size: 10px; color: #6b7280; margin-top: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Весы ---------- */
.weigh { display: grid; gap: 10px; text-align: center; min-width: 300px; }
.weigh-value { font-size: 52px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: var(--muted); transition: color .15s; }
.weigh-value.ok { color: var(--ok); }
.weigh-value small { font-size: 20px; font-weight: 600; }
.weigh-state { color: var(--muted); min-height: 20px; }
.weigh-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.weigh-manual { display: flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 700; }
.weigh-manual input { font-size: 32px; font-weight: 700; text-align: right; }
.prefix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }

/* Меню: сворачиваемые и перетаскиваемые группы */
button.nav-group { display: flex; align-items: center; gap: 4px; width: 100%; background: none; border: none; border-radius: 6px; cursor: pointer; text-align: left; box-shadow: none; height: auto; }
button.nav-group:hover { color: var(--content); background: var(--surface-2); }
button.nav-group .chev { width: 10px; font-size: 9px; }
button.nav-group .grip { margin-left: auto; opacity: 0; cursor: grab; letter-spacing: -2px; }
button.nav-group:hover .grip { opacity: .6; }
.nav-block.dragging { opacity: .4; }
.nav-block.drop { box-shadow: inset 0 2px 0 var(--accent); }
.nav-reset { display: block; margin: 12px 10px 0; padding: 0; background: none; border: none; box-shadow: none; color: var(--faint); font-size: 12px; cursor: pointer; height: auto; }
.nav-reset:hover { color: var(--accent); }
.nav-customize-button{display:flex;width:calc(100% - 8px);align-items:center;gap:8px;margin:4px;padding:8px 10px;border:1px solid var(--line);background:var(--surface);color:var(--muted);box-shadow:none;text-align:left;font-size:12px}.nav-customize-button:hover{border-color:var(--accent);color:var(--accent)}.nav-customize-modal.modal{width:min(720px,calc(100vw - 32px))}.nav-customize-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 22px}.nav-customize-list section{min-width:0;padding-bottom:8px;border-bottom:1px solid var(--line)}.nav-customize-list h3{margin:4px 0 8px;font-size:13px}.nav-customize-list .check{display:flex;align-items:center;gap:8px;margin:6px 0;color:var(--content);font-size:13px}.nav-customize-list .check input{flex:none}
@media(max-width:700px){.nav-customize-modal.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.nav-customize-modal .modal-body{overflow:auto}.nav-customize-list{grid-template-columns:minmax(0,1fr);gap:10px}.nav-customize-modal>.modal-foot{padding-bottom:calc(10px + env(safe-area-inset-bottom))}}
@media(min-width:901px){.layout.mini .nav-customize-button{justify-content:center;width:38px;padding:9px 8px}.layout.mini .nav-customize-button span{display:none}}
.xml-view { max-height: 60vh; overflow: auto; font-size: 11px; background: var(--surface-2); padding: 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
.msg.warn, .msg { display: block; }

/* ---------- Конструктор ценников ---------- */
.label-builder { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .label-builder { grid-template-columns: minmax(0, 1fr); } }
.label-props { position: sticky; top: 12px; }
.label-props button.on { background: var(--surface-2); outline: 1px solid var(--accent); }
.label-canvas-wrap { padding: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 8px; overflow: auto; }
.label-canvas { position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); background: #fff; }
.label-render { position: absolute; left: 0; top: 0; pointer-events: none; }
.label-el { position: absolute; outline: 1px dashed rgba(37, 99, 235, .45); cursor: move; touch-action: none; }
.label-el:hover { outline-color: #2563eb; }
.label-el.on { outline: 2px solid #2563eb; background: rgba(37, 99, 235, .06); }
.label-handle { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #2563eb; border: 2px solid #fff; border-radius: 2px; cursor: nwse-resize; }
.label-el:not(.on) .label-handle { display: none; }
.label-preview-row { overflow: auto; padding: 8px; background: var(--surface-2); border-radius: 8px; }

/* ---------- Отчёты ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.report-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.report-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.report-card .badge { align-self: flex-start; }
.report-table tfoot td { border-top: 2px solid var(--line); background: var(--surface-2); }
.report-table tr.drillable { cursor: pointer; }
.report-table tr.drillable:hover td { background: var(--accent-soft); }
.drill-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.drill-path .link, .viz-tip .link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.drill-path .link:hover, .viz-tip .link:hover { text-decoration: underline; }

/* Графики отчётов: палитра на 8 цветов (проверена на различимость, в том числе при дальтонизме), тёмная тема — свои оттенки */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948; --series-other: #a3a5ab;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767; --series-other: #6b6d74;
  }
}
:root[data-theme='dark'] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767; --series-other: #6b6d74;
}
.viz { padding: 16px 18px; }
.viz-title { font-weight: 600; margin-bottom: 14px; }
.viz-title span { font-weight: 400; color: var(--muted); }
.viz-title .viz-hint { color: var(--faint); font-size: 13px; }

/* Горизонтальные полосы: у каждой позиции свой цвет */
.hbars { display: grid; gap: 2px; container-type: inline-size; }
/* В узкой карточке название — над полосой, чтобы не обрезалось */
@container (max-width: 560px) {
  .hbars .hbar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .hbars .hbar-label { grid-column: 1; grid-row: 1; }
  .hbars .hbar-value { grid-column: 2; grid-row: 1; min-width: 0; }
  .hbars .hbar-track { grid-column: 1 / -1; grid-row: 2; height: 10px; }
}
.hbar-row { display: grid; grid-template-columns: minmax(120px, 26%) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 6px; border-radius: 6px; }
.hbar-row:hover { background: var(--surface-2); }
.hbar-row.pickable { cursor: pointer; }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.hbar-label .dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.hbar-track { position: relative; height: 18px; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; transition: filter .15s; }
.hbar-row:hover .hbar-fill { filter: brightness(1.08) saturate(1.1); }
.hbar-value { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--content); min-width: 90px; text-align: right; }
@media (max-width: 640px) { .hbar-row { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); } .hbar-value { grid-column: 1 / -1; text-align: left; min-width: 0; color: var(--muted); font-size: 13px; } }

/* Столбики по времени: один цвет, скруглённые вершины, зазор 2px */
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 200px; padding-top: 8px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 49px, var(--line) 49px 50px); background-position: bottom; }
.vbar { position: relative; flex: 1 1 0; max-width: 48px; height: 100%; display: flex; align-items: flex-end; }
.vbar.pickable { cursor: pointer; }
.vbar-stack { position: relative; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.vbar-fill { flex: 1 1 0; min-width: 0; background: var(--series-1); border-radius: 4px 4px 0 0; transition: filter .15s, opacity .15s; }
.vbar-fill.before { background: var(--series-other); opacity: .7; }
.vbar-fill.down { background: var(--series-8); }
.vbar:hover .vbar-fill { filter: brightness(1.15); }
.vbars:hover .vbar:not(:hover) .vbar-fill { opacity: .5; }
.viz-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.card > h2 + .viz-cols, .card > h2 + .hbars { margin-top: 12px; }
.card .hbars { margin: 8px -6px 12px; }
.vbar-axis { display: flex; gap: 2px; margin-top: 6px; }
.vbar-axis span { flex: 1 1 0; max-width: 48px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }

/* Линия */
.viz-line-wrap { position: relative; height: 220px; }
.viz-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.viz-line polyline { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.viz-line .grid { stroke: var(--line); stroke-width: 1; }
.viz-line-hits { position: absolute; inset: 0; display: flex; }
.line-hit { position: relative; flex: 1 1 0; }
.line-hit.pickable { cursor: pointer; }
.line-hit:hover { background: linear-gradient(to right, transparent calc(50% - 0.5px), var(--line) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.line-dot { position: absolute; left: 50%; width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%; }
.line-hit:hover .line-dot { background: var(--series-1); box-shadow: 0 0 0 2px var(--surface); }

/* Подсказка при наведении: остаётся открытой, пока курсор на ней — можно нажать «Подробнее» */
.viz-tip { display: none; position: absolute; bottom: calc(100% + 6px); z-index: 20; min-width: 180px; max-width: 280px; padding: 10px 12px;
  background: var(--surface); color: var(--content); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow), 0 8px 24px rgb(0 0 0 / .12);
  flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.35; white-space: normal; text-align: left; cursor: default; }
.viz-tip::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; } /* мостик: курсор доходит до подсказки, не теряя наведения */
.viz-tip b { font-size: 14px; }
.viz-tip .link { margin-top: 4px; text-align: left; font-weight: 600; }
.viz-tip.center { left: 50%; transform: translateX(-50%); }
.viz-tip.left { left: 0; }
.viz-tip.right { right: 0; }
.vbar:hover .viz-tip, .line-hit:hover .viz-tip, .hbar-row:hover .viz-tip { display: flex; }
.line-dot .viz-tip { bottom: 14px; }
.line-dot .viz-tip.center { left: 4px; }
.line-dot .viz-tip.left { left: -4px; }
.line-dot .viz-tip.right { right: -4px; }
@media print { .viz-tip { display: none !important; } }.report-builder { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .report-builder { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.measure-list { display: grid; gap: 4px; }
.loading-fade { opacity: .6; transition: opacity .2s; }
@media print { .sidebar, .no-print, .page-head button, .page-head a { display: none !important; } }

/* ---------- Инструкция ---------- */
.help-link { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 8px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: none; flex: none; }
.help-link:hover { border-color: var(--accent); color: var(--accent); }
.nav-help { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.help-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.help-toc { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.help-toc input { width: 100%; }
.help-toc-group { display: flex; flex-direction: column; }
.help-toc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 0 0 4px 10px; }
.help-toc a { padding: 5px 10px; border-radius: 6px; color: var(--content); text-decoration: none; font-size: 14px; }
.help-toc a:hover { background: var(--surface-2); }
.help-toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.help-article { padding: 24px 28px; max-width: 820px; }
.help-title { font-size: 24px; margin: 4px 0 16px; }
.help-body { font-size: 15px; line-height: 1.6; }
.help-body h3 { font-size: 17px; margin: 20px 0 8px; }
.help-body p { margin: 0 0 10px; }
.help-body ul, .help-body ol { margin: 0 0 12px; padding-left: 22px; }
.help-body li { margin: 4px 0; }
.help-path { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font-size: 14px; white-space: nowrap; }
.help-tip { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 0 6px 6px 0; }
.help-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.help-hit { display: flex; flex-direction: column; gap: 2px; padding: 12px; margin: 0 -12px; border-radius: 8px; color: inherit; text-decoration: none; }
.help-hit:hover { background: var(--surface-2); }
@media (max-width: 860px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; max-height: none; } .help-article { padding: 18px 16px; } .help-path { white-space: normal; } }

/* ---------- CRM ---------- */
.kanban { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; min-height: 60vh; }
.kb-col { flex: 0 0 272px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; transition: background .15s; }
.kb-col.over { background: var(--surface-3); }
.kb-head { position: relative; padding: 6px 6px 4px; }
.kb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stage); flex: none; }
.kb-share { height: 3px; margin-top: 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.kb-share i { display: block; height: 100%; background: var(--stage); border-radius: 2px; }
.kb-title { display: flex; align-items: center; gap: 8px; }
.kb-title b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-count { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.kb-sum { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kb-add { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; padding: 6px; }
.kb-add:hover { border-color: var(--accent); color: var(--accent); }
.kb-cards { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.kb-card { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 4px; border: 1px solid transparent; transition: border-color .15s, transform .1s; }
.kb-card:hover { border-color: var(--line); }
.kb-card.dragging { opacity: .4; }
.kb-card.drop-before { box-shadow: 0 -3px 0 var(--accent), var(--shadow); }
.kb-card-top { display: flex; gap: 6px; align-items: flex-start; }
.kb-card-title { flex: 1; font-size: 14px; line-height: 1.3; }
.kb-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.kb-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.kb-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.kb-notask { color: var(--warn); }
.kb-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.kb-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 16px 8px; border: 1px dashed var(--line); border-radius: 8px; }
.chip-btn { padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.chip-btn:hover { border-color: var(--accent); }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 5px; padding: 0; border: 2px solid transparent; }
.swatch.on { border-color: var(--content); }
.pick { position: relative; }
.pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow), 0 8px 24px rgb(0 0 0 / .12); max-height: 280px; overflow: auto; }
.pick-list button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 8px 12px; }
.pick-list button:hover { background: var(--surface-2); }
.pick-list .pick-new { color: var(--accent); font-weight: 600; border-top: 1px solid var(--line); }

.stage-track { display: flex; margin: 4px 0 18px; padding: 14px 8px 10px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.st-node { position: relative; flex: 1 1 0; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.st-node::before { content: ''; position: absolute; top: 7px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.st-node:first-child::before { display: none; }
.st-node.reached::before { background: var(--stage); }
.st-dot { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); transition: transform .15s; }
.st-node.reached .st-dot { background: var(--stage); border-color: var(--stage); }
.st-node.cur .st-dot { transform: scale(1.25); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage) 25%, transparent); }
.st-node.cur .st-label { color: var(--content); font-weight: 700; }
.st-node:hover .st-dot { transform: scale(1.2); border-color: var(--stage); }
.st-label { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }.deal-closed { margin: -4px 0 14px; padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.deal-closed.won { background: var(--ok-soft); color: var(--ok); }
.deal-closed.lost { background: var(--accent-soft); color: var(--accent); }
.ok-btn { background: var(--ok); color: #fff; border-color: var(--ok); }
.deal-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.deal-side, .deal-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1000px) { .deal-layout { grid-template-columns: 1fr; } }
.cust-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.cust-stats div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.other-deal { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: inherit; text-decoration: none; font-size: 14px; }
.other-deal:hover { color: var(--accent); }
.other-deal i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.composer { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.composer .tabs button { border-radius: 999px; }
.composer textarea { resize: vertical; }
.deal-tasks h2 { margin-bottom: 6px; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.task-row > .grow { flex: 1 1 0%; min-width: 0; overflow-wrap: anywhere; }
.task-row > .grow > button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.task-row > .grow > .small { overflow-wrap: anywhere; }
.task-row:first-of-type { border-top: 0; }
.task-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.task-row.done > .grow > div:first-child { text-decoration: line-through; color: var(--muted); }
.task-kanban-board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 12px; align-items: start; width: 100%; overflow-x: auto; padding-bottom: 8px; overscroll-behavior-inline: contain; }
.task-kanban-lane { min-width: 0; min-height: 180px; padding: 12px; scroll-snap-align: start; }
.task-kanban-lane.drop-target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.task-kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.task-kanban-head h2 { min-width: 0; margin: 0; font-size: 16px; }
.task-kanban-head button { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; font-size: 19px; }
.task-kanban-card { margin: 8px 0; padding: 10px; min-width: 0; }
.task-kanban-drag { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; margin: -2px 0 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--muted); cursor: grab; touch-action: none; }
.task-kanban-drag:active { cursor: grabbing; }
.task-kanban-card .task-row { flex-wrap: wrap; }
.task-kanban-card .task-row > .grow { flex-basis: calc(100% - 30px); }
.task-kanban-card > .field { margin-top: 8px; }
@media (max-width: 700px) {
  .task-kanban-board { grid-template-columns: repeat(4, minmax(270px, 84vw)); scroll-snap-type: inline mandatory; }
  .task-kanban-lane { padding: 10px; }
  .task-kanban-card { padding: 9px; }
}
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-day { text-align: center; margin: 8px 0; }
.tl-day span { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 12px; }
.tl-line { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); padding: 2px 0 2px 6px; }
.tl-line > span:nth-child(2) { flex: 1; color: var(--content); }
.tl-line.stage > span:nth-child(2) { font-weight: 600; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-icon { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.tl-line .tl-icon { width: 18px; height: 18px; background: none; }
.tl-bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tl-item.message_in .tl-bubble { background: var(--surface-2); }
.tl-item.message_out .tl-bubble { background: var(--accent-soft); border-color: transparent; }
.tl-item.call .tl-icon { background: var(--ok-soft); color: var(--ok); }
.tl-meta { margin-bottom: 4px; }
.tl-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Чат команды ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.team { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 480px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.team-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--line); min-height: 0; }
.team-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.team-rooms { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; }
.team-room { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; background: none; border: 0; text-align: left; width: 100%; font: inherit; cursor: pointer; }
.team-room:hover { background: var(--surface-2); }
.team-room.on { background: var(--accent-soft); }
.team-room-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-room-top { display: flex; gap: 6px; align-items: baseline; }
.team-room-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.team-room.unread .team-room-top b { font-weight: 800; }
.team-room-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.team-sep { padding: 10px 8px 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.team-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: var(--series-1); }
.team-av.general, .team-av.channel { border-radius: 10px; background: var(--surface-3); color: var(--muted); font-size: 16px; }
.team-av-space { flex: none; width: 36px; }
.team-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.team-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.team-msgs { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; }
.team-more { text-align: center; margin-bottom: 8px; }
.team-empty { margin: auto; }
.team-day { text-align: center; margin: 12px 0 6px; }
.team-day span { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 12px; }
.team-system { text-align: center; margin: 4px 0; }
.team-msg { position: relative; display: flex; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.team-msg.cont { padding-top: 1px; }
.team-msg:hover { background: var(--surface-2); }
.team-msg-body { flex: 1; min-width: 0; }
.team-msg-head { display: flex; gap: 8px; align-items: baseline; }
.team-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.team-text.deleted { color: var(--faint); font-style: italic; }
.team-time { display: none; margin-left: 8px; }
.team-msg:hover .team-time { display: inline; }
.team-read { margin-left: 6px; color: var(--series-1); }
.team-quote { border-left: 3px solid var(--line); padding: 2px 8px; margin: 2px 0 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-deal { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); text-decoration: none; }
.team-actions { position: absolute; top: -10px; right: 8px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.team-msg:hover .team-actions { display: flex; }
.team-compose { border-top: 1px solid var(--line); padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.team-compose-ctx { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.team-compose-ctx span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.team-compose-row textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; }
.team-hint { font-size: 11px; }
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; }
@media (max-width: 760px) {
  .team { grid-template-columns: 1fr; height: auto; }
  .team-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .team-main { height: 70vh; }
}

/* ---------- Сворачиваемое левое меню ---------- */
.sidebar-top { display: flex; align-items: flex-start; gap: 4px; }
.sidebar-top > :first-child { flex: 1; min-width: 0; }
.nav-collapse { flex: none; width: 28px; height: 28px; margin-top: 4px; padding: 0; border-radius: 8px; background: none; border: 1px solid transparent; color: var(--faint); font-size: 16px; line-height: 1; cursor: pointer; }
.nav-collapse:hover { background: var(--surface-2); color: var(--content); border-color: var(--line); }
@media (min-width: 901px) {
  .layout { transition: grid-template-columns .18s ease; }
  .layout.mini { grid-template-columns: 68px 1fr; }
  .layout.mini .sidebar { padding: 14px 8px; overflow-x: hidden; }
  .layout.mini .sidebar-top { flex-direction: column; align-items: center; }
  .layout.mini .logo { padding: 4px 0 6px; font-size: 0; gap: 0; }
  .layout.mini .logo img { max-width: 40px; }
  .layout.mini .nav a { position: relative; justify-content: center; gap: 0; padding: 9px 0; font-size: 0; }
  .layout.mini .nav a svg { width: 20px; height: 20px; }
  .layout.mini .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
  .layout.mini .nav-group { font-size: 0; padding: 0; height: 1px; margin: 10px 8px; background: var(--line); pointer-events: none; }
  .layout.mini .nav-group * { display: none; }
  .layout.mini .nav-reset, .layout.mini .foot-who, .layout.mini .foot-label, .layout.mini .sidebar-foot .badge { display: none; }
  .layout.mini .sidebar-foot { padding: 10px 0 0; }
  .layout.mini .sidebar-foot .row { flex-direction: column; align-items: center; }
  .layout.mini .sidebar-foot .spacer { display: none; }
}
@media (max-width: 900px) { .nav-collapse { display: none; } }

/* ---------- Уведомления ---------- */
.notices { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.notice { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 36px 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--surface); color: var(--content); border: 1px solid var(--line); border-left: 4px solid var(--series-1);
  box-shadow: var(--shadow), 0 12px 32px rgb(0 0 0 / .18); animation: notice-in .22s ease-out; }
.notice.task { border-left-color: var(--series-4); }
.notice.deal { border-left-color: var(--series-3); }
.notice span { font-size: 14px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.notice-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--faint); }
@keyframes notice-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }
.sidebar-foot { position: relative; }
.notify-pop { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 62px); left: auto; right: 12px; bottom: auto; z-index: 80;
  display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 76px - env(safe-area-inset-top, 0px)); overflow: auto; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgb(0 0 0 / .18); }

/* Переписка с клиентом в сделке */
.deal-views { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; align-self: flex-start; }
.deal-views button { border: 0; background: none; border-radius: 9px; padding: 7px 14px; color: var(--muted); font-weight: 600; }
.deal-views button.on { background: var(--surface); color: var(--content); box-shadow: var(--shadow); }
.deal-views-n { margin-left: 6px; font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 7px; }
@media(max-width:600px){.deal-views{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-self:stretch;width:100%}.deal-views button{min-width:0;padding:9px 6px;font-size:13px;white-space:normal}.deal-views-n{margin-left:4px;padding:1px 5px}}
.client-chat { display: flex; flex-direction: column; gap: 10px; }
.client-chat-msgs { display: flex; flex-direction: column; gap: 6px; min-height: 260px; max-height: 60vh; overflow: auto; padding: 4px; }
.cc-msg { display: flex; }
.cc-msg.out { justify-content: flex-end; }
.cc-bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); }
.cc-msg.out .cc-bubble { border-radius: 14px 14px 4px 14px; background: var(--accent-soft); }
.cc-meta { margin-top: 4px; color: var(--faint); }
.cc-msg.out .cc-meta { text-align: right; }
.dc-embed { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.dc-embed-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dc-frame { width: 100%; height: min(72vh, 760px); border: 0; background: var(--surface); }

/* ---------- CRM: цвет, фильтры, вид, свои поля, автоматизация ---------- */
.kb-card.colored.stripe { box-shadow: inset 4px 0 0 var(--deal), var(--shadow); }
.kb-card.colored.fill { background: color-mix(in srgb, var(--deal) 14%, var(--surface)); box-shadow: inset 4px 0 0 var(--deal), var(--shadow); }
.kb-paint { flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--deal, var(--faint)); font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s; cursor: pointer; }
.kb-card:hover .kb-paint, .kb-card.colored .kb-paint { opacity: 1; }
.kb-palette { margin: 2px 0 4px; }
.kb-field { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban.compact .kb-card { padding: 7px 10px; gap: 2px; }
.kanban.compact .kb-card-title { font-size: 13px; }
.kanban.compact .kb-amount { font-size: 13px; }
.deal-colors { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dc-swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.dc-swatch.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--c, var(--content)); }
.dc-swatch.none { background: var(--surface); color: var(--faint); font-size: 11px; line-height: 1; }
.dc-swatch.none.on { box-shadow: 0 0 0 2px var(--content); }
.crm-bar { flex-wrap: wrap; }
.active-filter { border-color: var(--accent); color: var(--accent); }
.filter-chips { margin: -4px 0 12px; }
.filter-chips .chip { background: var(--accent-soft); color: var(--content); }
.filter-panel { margin-bottom: 14px; }
.fp-grid { display: flex; flex-direction: column; gap: 12px; }
.fp-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 4px 0 6px; }
.fp-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; user-select: none; }
.fchip input { display: none; }
.fchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.fchip.color i { width: 10px; height: 10px; border-radius: 50%; }
.view-wrap { position: relative; }
.view-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 260px; max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgb(0 0 0 / .16); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tpl { text-align: left; font: inherit; cursor: pointer; border: 1px dashed var(--line); }
.tpl:hover { border-color: var(--accent); }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rule.off { opacity: .6; }
.rule-head { display: flex; align-items: center; gap: 10px; }
.rule-flow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rf { padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.rf.when { background: color-mix(in srgb, var(--series-1) 14%, transparent); }
.rf.if { background: color-mix(in srgb, var(--series-4) 16%, transparent); }
.rf.then { background: color-mix(in srgb, var(--series-3) 16%, transparent); }
.rule-step { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; display: flex; flex-direction: column; gap: 8px; }
.rule-step.when { border-color: var(--series-1); }
.rule-step.if { border-color: var(--series-4); }
.rule-step.then { border-color: var(--series-3); }
.rule-step-title { font-weight: 700; }
.rule-action { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .3); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Аватары и профиль ---------- */
.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; overflow: hidden; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.click { cursor: pointer; }
.foot-me { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 4px; margin: -4px; border-radius: 10px; min-width: 0; }
.foot-me:hover { background: var(--surface-2); }
.foot-who { min-width: 0; overflow: hidden; }
.foot-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.layout.mini .foot-me { justify-content: center; margin: 0 0 6px; }
.profile { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1000px; }
@media (max-width: 800px) { .profile { grid-template-columns: 1fr; } }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 16px; }
.profile-password { grid-column: 2; }
@media (max-width: 800px) { .profile-password { grid-column: 1; } }
.profile-av { position: relative; cursor: pointer; margin-bottom: 8px; }
.profile-av-edit { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); font-size: 15px; }
.profile-name { font-size: 18px; }
.person { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.person-rows { display: flex; flex-direction: column; gap: 10px; }
.person-rows > div { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Карточка клиента / компании ---------- */
.cp-hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 12px; }
.cp-logo { flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; font-size: 30px; }
.cp-hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cp-contacts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cp-contacts a { text-decoration: none; }
.cp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cp-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.cp-tile b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cp-layout { grid-template-columns: 1fr; } }
.cp-main, .cp-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cp-task { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cp-task:first-of-type { border-top: 0; }
.cp-task > span { font-size: 12px; }
.cp-deal-mini { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 14px; }
.cp-deal-mini:first-of-type { border-top: 0; }
.cp-deal-mini i { width: 10px; height: 10px; border-radius: 50%; }
.cp-deal-mini:hover .grow { color: var(--accent); }
.cp-req > div { display: flex; flex-direction: column; margin-bottom: 8px; font-size: 14px; }
.cp-deals { display: flex; flex-direction: column; gap: 8px; }
.cp-deal { padding: 0; overflow: hidden; box-shadow: inset 4px 0 0 var(--stage), var(--shadow); }
.cp-deal-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.cp-deal-head .kb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stage); flex: none; }
.cp-deal-body { padding: 0 16px 14px 38px; display: flex; flex-direction: column; gap: 8px; }
.cp-deal-hist { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.tl-item.doc .tl-bubble { border-style: dashed; }
.tl-bubble.click { cursor: pointer; }

/* ---------- Переписка в сделке: вид диалога Deep чат ---------- */
:root {
  --dcm-note-bg: #fef3c7; --dcm-note-fg: #451a03; --dcm-note-line: #fcd34d; --dcm-note-label: #b45309;
  --dcm-out-bg: var(--accent); --dcm-out-fg: #fff;
}
.notify-item { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.notify-item b, .notify-item .small { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --dcm-note-bg: rgba(251, 191, 36, 0.12); --dcm-note-fg: #fef3c7; --dcm-note-line: rgba(251, 191, 36, 0.28); --dcm-note-label: #fbbf24; }
}
:root[data-theme='dark'] { --dcm-note-bg: rgba(251, 191, 36, 0.12); --dcm-note-fg: #fef3c7; --dcm-note-line: rgba(251, 191, 36, 0.28); --dcm-note-label: #fbbf24; }
.dcm { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: min(74vh, 760px); min-height: 420px; }
.dcm-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dcm-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--app); }
.dcm-more { text-align: center; padding-bottom: 6px; }
.dcm-day { display: flex; justify-content: center; margin: 10px 0 6px; }
.dcm-day span { background: var(--surface-2); color: var(--muted); font-size: 12px; padding: 3px 12px; border-radius: 999px; }
.dcm-row { display: flex; align-items: flex-end; gap: 6px; margin: 2px 0; }
.dcm-row.out { justify-content: flex-end; }
.dcm-ava { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; object-fit: cover; }
.dcm-bubble { position: relative; max-width: min(70%, 560px); padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.dcm-bubble.in { background: var(--surface-2); color: var(--content); border-bottom-left-radius: 4px; }
.dcm-bubble.out { background: var(--dcm-out-bg); color: var(--dcm-out-fg); border-bottom-right-radius: 4px; }
.dcm-bubble.note { background: var(--dcm-note-bg); color: var(--dcm-note-fg); border: 1px solid var(--dcm-note-line); }
.dcm-bubble a { color: inherit; text-decoration: underline; }
.dcm-text { white-space: pre-wrap; }
.dcm-label { font-size: 11px; font-weight: 600; opacity: 0.85; margin-bottom: 3px; }
.dcm-label.note { color: var(--dcm-note-label); opacity: 1; }
.dcm-sender { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.dcm-quote { border-left: 2px solid rgba(128, 128, 128, 0.55); padding-left: 8px; margin-bottom: 5px; font-size: 12px; display: flex; flex-direction: column; opacity: 0.9; }
.dcm-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcm-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 3px; font-size: 11px; opacity: 0.8; flex-wrap: wrap; }
.dcm-chan { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; opacity: 1; }
.dcm-chan i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dcm-bubble.out:not(.note) .dcm-chan { filter: brightness(1.6) saturate(0.6); }
.dcm-by { font-weight: 600; }
.dcm-tick { vertical-align: middle; }
.dcm-tick.read { color: #7dd3fc; }
.dcm-fail { color: #fecaca; display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.dcm-bubble.note .dcm-fail { color: var(--down, #b91c1c); }
.dcm-reply-btn { position: absolute; top: 4px; right: -26px; border: 0; background: var(--surface-3); color: var(--muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity 0.15s; line-height: 1; padding: 0; }
.dcm-row.out .dcm-reply-btn { right: auto; left: -26px; }
.dcm-bubble:hover .dcm-reply-btn, .dcm-reply-btn:focus-visible { opacity: 1; }
.dcm-img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-bottom: 4px; }
.dcm-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(128, 128, 128, 0.16); text-decoration: none !important; color: inherit; margin-bottom: 4px; }
.dcm-file-t { display: flex; flex-direction: column; min-width: 0; }
.dcm-file-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.dcm-file-t small { opacity: 0.75; }
.dcm-voice { display: flex; align-items: center; gap: 8px; min-width: 200px; margin-bottom: 4px; }
.dcm-play { padding: 0; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.28); color: inherit; }
.dcm-bubble.in .dcm-play { background: var(--accent); color: #fff; }
.dcm-seek { flex: 1; height: 6px; border-radius: 3px; background: rgba(128, 128, 128, 0.35); cursor: pointer; overflow: hidden; }
.dcm-seek-fill { height: 100%; background: currentColor; }
.dcm-bubble.in .dcm-seek-fill { background: var(--accent); }
.dcm-time-s { font-variant-numeric: tabular-nums; font-size: 12px; }
.dcm-composer { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.dcm-composer.note textarea { border-color: var(--dcm-note-line); }
.dcm-replybar { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.dcm-replybar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcm-replybar button { padding: 0 4px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.dcm-modebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dcm-seg { display: inline-flex; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 2px; }
.dcm-seg button { border: 0; background: none; padding: 3px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--muted); }
.dcm-seg button.on { background: var(--surface); color: var(--content); box-shadow: var(--shadow); }
.dcm-seg button.on.note { background: var(--dcm-note-bg); color: var(--dcm-note-fg); }
.dcm-chsel { font-size: 12px; padding: 3px 6px; border-radius: 8px; max-width: 220px; }
.dcm-tool { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px 7px; border-radius: 6px; font-size: 13px; }
.dcm-tool:hover { background: var(--surface-2); color: var(--content); }
.dcm-inputrow { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.dcm-inputrow textarea { flex: 1 1 240px; min-width: 0; resize: none; min-height: 38px; max-height: 140px; padding: 8px 12px; border-radius: 10px; margin: 0; }
.dcm-btns { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.dcm-ico { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.dcm-ico:hover:not(:disabled) { background: var(--surface-2); color: var(--content); }
.dcm-send { border: 0; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; margin-left: 4px; }
.dcm-send.note { background: #d97706; }
.dcm-send:disabled { opacity: 0.45; cursor: default; }
.dcm-emojiwrap { position: relative; }
.dcm-emoji { position: absolute; bottom: 42px; right: 0; width: 290px; max-height: 210px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; grid-template-columns: repeat(8, 1fr); z-index: 5; }
.dcm-emoji button { border: 0; background: none; font-size: 20px; cursor: pointer; padding: 3px; border-radius: 6px; }
.dcm-emoji button:hover { background: var(--surface-2); }
.dcm-suggest { position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 6; overflow: hidden; }
.dcm-suggest button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--content); }
.dcm-suggest button.on, .dcm-suggest button:hover { background: var(--surface-2); }
.dcm-suggest button span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dcm-suggest small { display: block; padding: 4px 12px; color: var(--faint); font-size: 11px; border-top: 1px solid var(--line); }
.dcm-recbar { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.dcm-recdot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: dcm-pulse 1s infinite; }
@keyframes dcm-pulse { 50% { opacity: 0.25; } }
@media (max-width: 720px) { .dcm { height: 78vh; } .dcm-bubble { max-width: 84%; } .dcm-reply-btn { display: none; } }

/* ---------- Документы сделки и конструктор документов ---------- */
.deal-items input.cell { width: 100%; }
.deal-items td { vertical-align: middle; }
.doc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .tpl-layout { grid-template-columns: 1fr; } }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; margin: 10px 0 0; background: var(--surface-2); border-radius: 10px 10px 0 0; border: 1px solid var(--line); border-bottom: 0; }
.ed-toolbar button { padding: 4px 10px; min-width: 34px; font-size: 13px; }
.ed-sep { width: 1px; background: var(--line); margin: 2px 4px; }
.doc-editor, .paper { background: #fff; color: #111; font: 14px/1.5 'Times New Roman', Georgia, serif; }
.doc-editor { min-height: 560px; padding: 32px 40px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; outline: none; overflow: auto; }
.doc-editor:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.doc-editor table, .paper table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.doc-editor td, .doc-editor th { border: 1px dashed #bbb; padding: 4px 6px; vertical-align: top; }
.paper { padding: 32px 40px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); max-height: 70vh; overflow: auto; }
.paper table.g td, .paper table.g th { border: 1px solid #000; padding: 3px 5px; }
.paper .n, .paper .r { text-align: right; } .paper .c { text-align: center; } .paper .b { font-weight: 700; }
.tpl-vars { display: flex; flex-direction: column; gap: 2px; max-height: 80vh; overflow: auto; position: sticky; top: 12px; }
.tpl-var { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.tpl-var:hover { background: var(--surface-2); }
.tpl-var code { font-size: 12px; color: var(--accent); }
.tpl-var span { font-size: 13px; color: var(--muted); }

/* Ссылки на документы в ленте и окно просмотра */
.doc-ref { display: inline; padding: 0 2px; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline dotted; cursor: pointer; }
.doc-ref:hover { text-decoration: underline; }
.tl-line.has-doc .doc-ref { font-weight: 600; text-decoration: none; }
.doc-frame { width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------- Контактные лица, файлы, партнёры ---------- */
.contact-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin: 0 -8px; border-radius: 10px; width: calc(100% + 16px); background: none; border: 0; text-align: left; font: inherit; color: inherit; }
.contact-row[role=button] { cursor: pointer; }
.contact-row:hover { background: var(--surface-2); }
.contact-row.on { background: var(--accent-soft); }
.contact-row.all { margin-top: 6px; padding: 6px 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.contact-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.contact-row:hover .contact-acts { opacity: 1; }
.contact-tag { color: var(--accent); font-weight: 600; }
.files-card.over { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.file-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.file-row:first-of-type { border-top: 0; }
.file-ico { width: 36px; height: 36px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); border-radius: 8px; flex: none; }
.file-thumb { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface-2); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.attach-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 10px; }
a.badge { text-decoration: none; }

/* ---------- Календарь ---------- */
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-filter-toggle { display: none; }
.cal-title { font-size: 22px; margin: 0 8px 0 0; text-transform: capitalize; min-width: 220px; }
.cal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .cal-layout { grid-template-columns: 1fr; } .cal-side { order: 2; position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; } .cal-side .mini-month, .cal-side .fp-title { grid-column: 1 / -1; } .cal-side .mini-month { max-width: 280px; } }
.cal-side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.cal-cal { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 14px; cursor: pointer; }
.cal-cal input { flex: none; width: auto; margin: 0; }
.cal-cal i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cal-main { padding: 0; overflow: hidden; }
.cal-month-mobile { display: none; }
.mini-month { margin-bottom: 8px; }
.mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.mm-wd { text-align: center; font-size: 11px; color: var(--faint); }
.mm-day { border: 0; background: none; padding: 4px 0; border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--content); }
.mm-day.out { color: var(--faint); }
.mm-day:hover { background: var(--surface-2); }
.mm-day.today { color: var(--accent); font-weight: 700; }
.mm-day.sel { background: var(--accent); color: #fff; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-wd { padding: 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; }
.month-day { min-height: 112px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.out { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.month-day.out .month-num { color: var(--faint); }
.month-day.weekend { background: color-mix(in srgb, var(--surface-2) 35%, transparent); }
.month-num { align-self: flex-end; border: 0; background: none; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--content); }
.month-num:hover { background: var(--surface-2); }
.month-num.today { background: var(--accent); color: #fff; font-weight: 700; }
.month-more { align-self: flex-start; font-size: 12px; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--content); box-shadow: inset 3px 0 0 var(--c); }
.cal-chip.allday { background: var(--c); color: #fff; box-shadow: none; }
.cal-chip.faded { opacity: .5; text-decoration: line-through; }
.cal-chip-time { color: var(--muted); margin-right: 4px; font-variant-numeric: tabular-nums; }
.tg { user-select: none; }
.tg-head { display: grid; border-bottom: 1px solid var(--line); }
.tg-day { padding: 6px 4px; text-align: center; border-left: 1px solid var(--line); min-width: 0; }
.tg-day.today b { background: var(--accent); color: #fff; border-radius: 50%; padding: 1px 7px; }
.tg-allday { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; min-height: 18px; }
.tg-body { display: grid; grid-template-columns: 56px 1fr; max-height: calc(100vh - 240px); min-height: 420px; overflow: auto; position: relative; }
.tg-hours > div { position: relative; border-bottom: 1px solid transparent; }
.tg-hours span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--faint); }
.tg-cols { display: grid; }
.tg-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line) 47px 48px); cursor: cell; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 3; }
.tg-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tg-ev { position: absolute; z-index: 2; border-radius: 6px; padding: 3px 6px; overflow: hidden; font-size: 12px; line-height: 1.3; cursor: grab; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--c), 0 1px 2px rgb(0 0 0 / .08); color: var(--content); touch-action: none; }
.tg-ev b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ev span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-ev.dragging { cursor: grabbing; opacity: .85; z-index: 5; box-shadow: inset 3px 0 0 var(--c), 0 8px 20px rgb(0 0 0 / .2); }
.tg-ev.faded { opacity: .5; }

/* ---------- Почта ---------- */
.mail { display: grid; grid-template-columns: 230px minmax(260px, 380px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1200px) { .mail { grid-template-columns: 1fr; } }
.mail-side { display: flex; flex-direction: column; gap: 2px; }
.mail-folder { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; border-radius: 8px; font: inherit; color: inherit; cursor: pointer; overflow: hidden; }
.mail-folder:hover { background: var(--surface-2); }
.mail-folder.on, .mail-acc.on > .mail-folder { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mail-folder .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-acc { position: relative; }
.mail-acc-edit { position: absolute; right: 2px; top: 3px; opacity: 0; }
.mail-acc:hover .mail-acc-edit { opacity: 1; }
.mail-list { max-height: calc(100vh - 170px); overflow: auto; }
.mail-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; cursor: pointer; }
.mail-row:hover { background: var(--surface-2); }
.mail-row.on { background: var(--accent-soft); }
.mail-row.unread .mail-from, .mail-row.unread .mail-subj { font-weight: 700; }
.mail-row.unread { box-shadow: inset 3px 0 0 var(--accent); }
.mail-from, .mail-subj, .mail-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-read { min-height: 400px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); max-height: 60vh; overflow: auto; }
.mail-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mail-empty { max-width: 560px; text-align: center; margin: 24px auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px; }
.tl-item.click { cursor: pointer; }
.tl-item.email_in .tl-bubble { background: color-mix(in srgb, var(--series-1) 8%, var(--surface)); }
.tl-item.email_out .tl-bubble { background: color-mix(in srgb, var(--series-3) 10%, var(--surface)); }
.tl-item.email_in .tl-text, .tl-item.email_out .tl-text { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.mail-deal-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

.dropdown-row { display: flex; align-items: stretch; }
.dropdown-row > button:first-child { flex: 1; }
.dropdown-mail { flex: none; width: 36px; padding: 0; border: 0; background: none; cursor: pointer; }
.dropdown-mail:hover { background: var(--surface-2); color: var(--accent); }

.dcm-start { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; max-width: 640px; margin: 0 auto; width: 100%; justify-content: center; }
.dcm-start textarea { width: 100%; resize: vertical; min-height: 90px; }
.dcm-tpls { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Чат команды: кнопка вверху справа и всплывающее окно ---------- */
.topbar { display: flex; justify-content: flex-end; margin: -6px 0 6px; min-height: 40px; }
.chat-fab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--content); font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.chat-fab:hover, .chat-fab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chat-fab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.chat-fab.inline { padding: 7px 10px; box-shadow: none; }
.chat-fab.inline .chat-fab-label { display: none; }
.chat-fab.inline .chat-fab-badge { position: absolute; top: -6px; right: -6px; }
.mobile-bar .chat-fab { display: none; }
@media (max-width: 900px) { .topbar { display: none; } .mobile-bar .chat-fab { display: inline-flex; } }
.team-pop { position: fixed; top: 58px; right: 20px; z-index: 45; width: min(960px, calc(100vw - 40px)); height: min(700px, calc(100vh - 78px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 60px rgb(0 0 0 / 0.28); overflow: hidden; }
.team-pop-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.team-pop-body { flex: 1; min-height: 0; }
.team-pop .team { height: 100%; min-height: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 900px) { .team-pop { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; } .team-pop .team { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } .team-pop .team-side { max-height: 150px; } .team-pop .team-main { height: auto; } }

/* Возможности как в Deep чат */
.team-avwrap { position: relative; display: inline-flex; flex: none; }
.team-online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok, #1baf7a); border: 2px solid var(--surface); }
.team-online.in { position: static; margin-left: auto; }
.team-online-t { color: var(--ok, #1baf7a); font-weight: 600; }
.team-typing, .team-typing-bar { color: var(--accent); font-style: italic; }
.team-typing-bar { padding: 2px 16px; }
.team-badge.at { background: var(--warn, #eda100); margin-right: 4px; }
.team-mention { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.team-mention.me { background: var(--accent); color: #fff; }
.team-msg.mentioned { background: var(--warn-soft); }
.team-msg.flash { animation: team-flash 1.8s ease-out; }
@keyframes team-flash { 0%, 60% { background: var(--accent-soft); } 100% { background: transparent; } }
.team-pinbar { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.team-pin-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.team-pin-t b { font-size: 12px; color: var(--accent); }
.team-pin-t span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-fwd { color: var(--muted); margin-bottom: 2px; }
.team-att { margin: 2px 0 4px; max-width: 360px; }
.team-att .dcm-play { background: var(--accent); color: #fff; }
.team-att .dcm-seek-fill { background: var(--accent); }
.team-att .dcm-file { background: var(--surface-3); }
.team-meta { display: flex; gap: 8px; }
.team-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.team-reacts button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; color: var(--content); }
.team-reacts button.on { background: var(--accent-soft); border-color: var(--accent); }
.team-reactpick { position: relative; display: inline-flex; }
.team-quick { position: absolute; top: 100%; right: 0; z-index: 5; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.team-quick button { border: 0; background: none; font-size: 18px; cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.team-quick button:hover { background: var(--surface-2); }
.team-search { padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.team-hits { max-height: 240px; overflow: auto; display: flex; flex-direction: column; margin-top: 6px; }
.team-hits button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--content); }
.team-hits button:hover { background: var(--surface); }
.team-tools { display: flex; align-items: center; gap: 2px; }
.team-compose-row { position: relative; }
.team-compose-row .dcm-btns { display: flex; align-items: center; gap: 2px; }
@media (max-width: 600px) {
  .team-compose { padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
  .team-compose-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .team-compose-row textarea { width: 100%; min-width: 0; min-height: 44px; max-height: 28dvh; }
  .team-compose-row .dcm-btns { width: 100%; gap: 4px; }
  .team-compose-row .dcm-btns .dcm-ico { width: 40px; height: 40px; }
  .team-compose-row .dcm-btns > button.primary { margin-left: auto; min-width: 90px; white-space: nowrap; }
  .team-tools { min-height: 34px; overflow-x: auto; }
}
.team-mentionmenu { position: absolute; left: 0; bottom: 100%; z-index: 6; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.team-mentionmenu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 5px 8px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--content); }
.team-mentionmenu button.on, .team-mentionmenu button:hover { background: var(--accent-soft); }
.team-search .row { flex-wrap: nowrap; align-items: center; }
.team-search input { flex: 1; width: auto; min-width: 0; }

.mail-row { align-items: stretch; justify-content: flex-start; }
.mail-row > * { text-align: left; }
.mail-row .badge { margin-right: 4px; }

/* Колокольчик рядом с чатом команды */
.bell-wrap { position: relative; display: inline-flex; }
.topbar { gap: 8px; }
.bell-btn { padding: 8px 11px; }
/* На компьютере панель — под колокольчиком: absolute (у fixed «100%» — это высота окна, и панель уезжала за нижний край) */
.bell-wrap .notify-pop { position: absolute; top: calc(100% + 8px); bottom: auto; left: auto; right: 0; width: 320px; max-height: calc(100dvh - 120px); text-align: left; }

/* ---------- Почта (новый вид) ---------- */
.mx { display: grid; grid-template-columns: 236px minmax(300px, 400px) minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
@media (max-width: 1100px) { .mx { grid-template-columns: 200px minmax(260px, 1fr); } .mx-read { grid-column: 1 / -1; border-top: 1px solid var(--line); } .mx { height: auto; } }
@media (max-width: 700px) { .mx { grid-template-columns: 1fr; } }
.mx-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; background: var(--surface-2); overflow: auto; }
.mx-compose { margin: 0 4px 12px; padding: 12px 16px; border-radius: 14px; font-size: 15px; box-shadow: var(--shadow); }
.mx-folder { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: none; border-radius: 999px; font: inherit; color: var(--content); cursor: pointer; text-align: left; }
.mx-folder:hover { background: color-mix(in srgb, var(--content) 6%, transparent); }
.mx-folder.on, .mx-box.on > .mx-folder { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mx-fi { width: 20px; text-align: center; flex: none; }
.mx-count { font-size: 12px; font-weight: 700; color: var(--accent); }
.mx-nav-title { margin: 16px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.mx-box { position: relative; }
.mx-gear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface); border-radius: 50%; width: 26px; height: 26px; padding: 0; cursor: pointer; opacity: 0; box-shadow: var(--shadow); }
.mx-box:hover .mx-gear { opacity: 1; }
.mx-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.mx-dot.ok { background: #1baf7a; } .mx-dot.err { background: #e34948; }
.mx-add { color: var(--muted); }
.mx-note { margin: auto 12px 0; padding-top: 12px; font-size: 12px; color: var(--faint); }
.mx-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mx-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.mx-list-head { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }
.mx-list-head input { flex: 1; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.mx-icon { width: 38px; padding: 0; border-radius: 50%; font-size: 17px; }
.mx-rows { overflow: auto; flex: 1; }
.mx-none { padding: 40px 16px; text-align: center; color: var(--muted); }
.mx-row { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; outline: none; }
.mx-row:hover { background: var(--surface-2); }
.mx-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.mx-row.on { background: var(--accent-soft); }
.mx-row.unread::before { content: ''; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.mx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mx-row-top { display: flex; gap: 8px; align-items: baseline; }
.mx-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mx-time { flex: none; font-size: 12px; color: var(--muted); }
.mx-subj, .mx-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mx-snip { color: var(--muted); }
.mx-row.unread .mx-name, .mx-row.unread .mx-subj, .mx-row.unread .mx-time { font-weight: 700; color: var(--content); }
.mx-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mx-tag { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-tag.deal { background: color-mix(in srgb, #1baf7a 14%, transparent); color: var(--content); }
a.mx-tag:hover { color: var(--accent); }
.mx-ava { flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; }
.mx-read { overflow: auto; min-height: 0; }
.mx-placeholder { height: 100%; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.mx-hero-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: var(--accent-soft); color: var(--accent); }
.mx-view { padding: 16px 28px 28px; }
.mx-actions { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 0 12px; margin: -8px 0 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mx-actions button, .mx-actions .btn { border-radius: 999px; }
.mx-attach { display: inline-flex; gap: 4px; }
.mx-attach select { width: auto; max-width: 240px; border-radius: 999px; }
.mx-title { font-size: 22px; font-weight: 600; margin: 10px 0 14px; line-height: 1.3; }
.mx-from { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mx-body { margin-top: 8px; }
.mx-frame { width: 100%; min-height: 160px; border: 0; background: #fff; border-radius: 8px; }
.mx-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; }
.mx-files, .mx-att { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mx-file { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--content); text-decoration: none; background: var(--surface); cursor: pointer; }
.mx-file:hover { border-color: var(--accent); }
.mx-file.on { background: var(--accent-soft); border-color: transparent; }
.mx-file input { display: none; }
.mx-quick { display: flex; gap: 8px; margin-top: 24px; }
.mx-quick button { border-radius: 999px; padding: 8px 18px; }
.mx-empty-page { display: grid; place-items: center; min-height: 60vh; }
.mx-hero { max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 32px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.mx-hero h1 { margin: 4px 0 0; }
.mx-hero-providers { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mx-hero-providers span { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
button.big { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
/* Окно письма */
.mx-compose-form { display: flex; flex-direction: column; gap: 0; }
.mx-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mx-lbl { flex: none; width: 64px; color: var(--muted); font-size: 14px; }
.mx-line > select, .mx-subj-input { flex: 1; border: 0; background: none; padding: 6px 0; box-shadow: none; font-size: 15px; }
.mx-subj-input:focus { outline: none; }
.mx-addr { position: relative; flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 34px; cursor: text; }
.mx-addr input { flex: 1; min-width: 160px; border: 0; background: none; padding: 6px 0; box-shadow: none; }
.mx-addr input:focus { outline: none; }
.mx-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; }
.mx-chip button { border: 0; background: none; padding: 0 6px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }
.mx-sugg { position: absolute; z-index: 20; left: 0; top: 100%; min-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow), 0 8px 24px rgb(0 0 0 / .14); overflow: hidden; }
.mx-sugg button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; }
.mx-sugg button:hover { background: var(--surface-2); }
/* Редактор */
.rt { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--surface); }
.rt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 12px 12px 0 0; }
.rt-btn { min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--content); cursor: pointer; font-size: 14px; }
.rt-btn:hover { background: color-mix(in srgb, var(--content) 8%, transparent); }
.rt-btn.on { background: var(--accent-soft); color: var(--accent); }
.rt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rt-drop { position: relative; }
.rt-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; min-width: 150px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow), 0 8px 24px rgb(0 0 0 / .14); }
.rt-menu button { border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--content); }
.rt-menu button:hover { background: var(--surface-2); }
.rt-colors { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 172px; }
.rt-color { width: 32px !important; height: 26px; padding: 0 !important; border-radius: 6px !important; }
.rt-hl { width: 100%; margin-top: 4px; background: #fff3a3 !important; color: #222 !important; }
.rt-area { padding: 14px 16px; outline: none; font: 14px/1.6 -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; overflow-wrap: anywhere; max-height: 55vh; overflow: auto; }
.rt-area:empty::before { content: attr(data-placeholder); color: var(--faint); }
.rt-area blockquote { margin: 4px 0 4px 6px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.rt-area .signature { color: var(--muted); }
.rt-area a { color: var(--accent); }
.rt.compact .rt-area { max-height: 200px; }

/* Выпадающий выбор товара */
.psel { position: relative; }
.psel-input { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: text; }
.psel-input.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.psel-input input { flex: 1; border: 0; background: none; box-shadow: none; padding: 10px 0; }
.psel-input input:focus { outline: none; }
.psel-caret { color: var(--muted); font-size: 12px; }
.psel-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 380px; overflow: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgb(0 0 0 / .16); }
.psel-cat { position: sticky; top: -4px; z-index: 1; padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); background: var(--surface); }
.psel-opt { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.psel-opt.cur { background: var(--accent-soft); }
.psel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psel-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.psel-none { padding: 16px; text-align: center; color: var(--muted); }

/* Подписи и печать организации */
.sign-slots { display: flex; gap: 14px; flex-wrap: wrap; }
.sign-slot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sign-slot .photo-box { width: 200px; height: 90px; background: #fff; }
.sign-slot .photo-box.stamp { width: 130px; height: 130px; }
.sign-slot .photo-box img { object-fit: contain; background: transparent; }


/* 1С: Бухгалтерия */
.onec-pre { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
a.btn.disabled { opacity: .5; pointer-events: none; }

.check > input[type=checkbox] { flex: none; }

/* Подстановка реквизитов по ИНН и БИК */
.req-hint { font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.req-hint button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: underline; }


.lp-ico.lp-ico-tone { width: auto; height: auto; background: none; border-radius: 0; place-items: start; }

/* Тариф и блоки */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.module-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.module-tile.on { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); cursor: default; }
.module-tile.picked { border-color: var(--accent); background: var(--accent-soft); }
.module-locked { max-width: 560px; margin: 40px auto; text-align: center; padding: 32px; }
.module-locked h1 { font-size: 22px; margin: 8px 0; }
.module-lock-ico { font-size: 40px; }


/* Посадочная: блоки для своего набора */
.lp-blocks-title { margin: 36px 0 6px; font-size: 20px; }
.lp-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lp-block { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.lp-block span { color: var(--muted); font-size: 14px; }


/* Посадочная: цены */
.lp-period { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); margin: 0 0 18px; }
.lp-period button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: inherit; font: inherit; }
.lp-period button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.lp-period b { color: var(--accent); }
.lp-plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.lp-plan .lp-price b { font-size: 26px; }
.lp-block em { font-style: normal; font-weight: 600; margin-top: auto; }
.small-tabs button { padding: 4px 10px; font-size: 13px; }


/* Конструктор тарифов */
.form-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pe-table { width: 100%; border-collapse: collapse; }
.pe-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 4px 6px; }
.pe-table td { padding: 4px 6px; }
.pe-table input { width: 100%; }
.pe-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pe-plan.popular { border-color: var(--accent); }
.pe-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.pe-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }


/* Посадочная: калькулятор тарифа */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; margin-top: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.calc-main { padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.calc-head h3 { margin: 0 0 4px; font-size: 22px; }
.calc-head p { margin: 0; color: var(--muted); font-size: 15px; }
.calc-check { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; transition: background .15s, border-color .15s; }
.calc-check.on { background: var(--accent); border-color: var(--accent); }
.calc-price { flex: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.calc-base { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.calc-base > div { flex: 1; min-width: 0; }
.calc-base small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.calc-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--content); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.calc-opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.calc-opt:active { transform: scale(.98); }
.calc-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.calc-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.25; }
.calc-name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.calc-steps { display: flex; gap: 12px; flex-wrap: wrap; }
.calc-step { flex: 1; min-width: 240px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; }
.calc-step small { display: block; font-size: 12px; color: var(--muted); }
.calc-step-ctl { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.calc-step-ctl button { width: 36px; height: 36px; border: 0; border-radius: 0; padding: 0; background: none; color: var(--content); font-size: 20px; font-weight: 600; cursor: pointer; }
.calc-step-ctl button:hover:not(:disabled) { background: var(--surface-2); }
.calc-step-ctl button:disabled { opacity: .35; cursor: default; }
.calc-step-ctl span { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-sum { padding: 28px; background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #000) 100%); color: #fff; display: flex; flex-direction: column; gap: 6px; }
.calc-sum-label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; font-weight: 600; }
.calc-total { font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.calc-total span { font-size: 17px; font-weight: 500; opacity: .8; }
.calc-sub { font-size: 14px; opacity: .85; }
.calc-win { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: rgb(255 255 255 / .16); font-size: 14px; font-weight: 600; }
.calc-lines { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid rgb(255 255 255 / .25); display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.calc-lines li { display: flex; justify-content: space-between; gap: 12px; }
.calc-lines li span { opacity: .9; }
.calc-lines li.gift { opacity: .85; font-style: italic; }
.calc-cta { margin-top: auto; background: #fff !important; color: var(--accent) !important; border-color: #fff !important; font-weight: 700; }
.calc-sum .calc-cta { margin-top: 18px; }
.calc-note { font-size: 12px; opacity: .75; text-align: center; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } .calc-main, .calc-sum { padding: 20px; } .calc-total { font-size: 38px; } }


/* Тариф вверху справа */
.plan-wrap { position: relative; display: inline-flex; margin-right: auto; }
.topbar .plan-wrap { margin-right: 0; }
.plan-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: inherit; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.plan-chip:hover, .plan-chip.on { border-color: var(--accent); }
.plan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.plan-chip.warn .plan-dot { background: #f5a524; }
.plan-days { font-weight: 500; font-size: 12px; color: var(--muted); }
.plan-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.plan-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; }
.plan-usage { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.plan-usage b { color: var(--text, inherit); }
.plan-support { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.plan-support a { color: inherit; text-decoration: none; }
.plan-support a:hover { color: var(--accent); }


/* Производство */
.prod-plan { width: 100%; border-collapse: collapse; }
.prod-plan th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.prod-plan td { padding: 8px; border-bottom: 1px solid var(--line); }
.prod-plan .num { text-align: right; white-space: nowrap; }
.prod-plan tr.short td { background: var(--accent-soft); }
.prod-total { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.prod-total > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.prod-total > div span { font-size: 12px; }
.prod-total > div b { font-size: 18px; }
.prod-total > div.accent { background: var(--accent); color: #fff; }
.prod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.prod-card ul { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.prod-card li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 3px; }


/* Касса: автономный терминал */
.standalone-pay { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.standalone-ok { padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--accent); background: var(--accent-soft); }


/* Производство: вкладки, задания, разделы техкарты */
.prod-tabs { margin: -4px 0 14px; flex-wrap: wrap; }
.prod-tabs a { padding: 7px 14px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; }
.prod-tabs a.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }
.prod-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.prod-order ul { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prod-order li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; }
.prod-order li .prod-bar { grid-column: 1 / -1; }
.prod-order.overdue { border-color: var(--accent); }
.prod-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.prod-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.prod-sec { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.prod-sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }

/* Маркетплейсы */
.mp-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.mp-chip::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--mp); }
.mp-empty { text-align: center; padding: 40px 24px; }
.mp-empty p { max-width: 620px; margin: 8px auto 18px; }
.mp-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.mp-acc { display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--mp); }
.mp-acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mp-acc-stats > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.mp-acc-stats b { font-size: 17px; }
.mp-acc-stats span { font-size: 12px; color: var(--muted); }
.mp-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.mp-supplies { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.prod-plan tr.sel td { background: var(--accent-soft); }
.warn-t { color: var(--warn); }
@media (max-width: 720px) { .mp-switches { grid-template-columns: 1fr; } .mp-acc-stats { grid-template-columns: 1fr; } }


/* Адресный склад */
.wms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.wms-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--content); font: inherit; text-align: left; cursor: pointer; }
.wms-cell b { font-size: 13px; letter-spacing: .2px; }
.wms-cell span { font-size: 11px; color: var(--muted); }
.wms-cell.full { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.wms-cell.k-receiving { border-color: var(--warn); } .wms-cell.k-shipping { border-color: var(--ok); } .wms-cell.k-defect { border-color: var(--accent); }
.wms-cell.off { opacity: .45; }
.wms-cells { display: flex; flex-wrap: wrap; gap: 4px; }
.wms-cell-chip { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--content); font: inherit; font-size: 12px; cursor: pointer; }
.wms-cell-chip:hover { border-color: var(--accent); }
.wms-cell-chip.k-shipping { background: var(--ok-soft); } .wms-cell-chip.k-receiving { background: var(--warn-soft); }


/* Маркетплейсы: прогноз остатков */
.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.fc-chip { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--content); font: inherit; font-size: 13px; cursor: pointer; }
.fc-chip b { font-size: 15px; margin-right: 2px; }
.fc-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.fc-chip.s-out b, .fc-chip.s-critical b { color: var(--accent); } .fc-chip.s-low b { color: var(--warn); } .fc-chip.s-ok b { color: var(--ok); }
.fc-wh { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }

.help-screen-figure{margin:14px 0 24px}.help-screen{display:grid;grid-template-columns:minmax(120px,22%) 1fr;min-height:205px;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 5px 20px #18243b12;color:var(--content)}.help-screen>aside{padding:14px 9px;background:var(--surface-2);border-right:1px solid var(--line)}.help-screen-brand{font-weight:800;font-size:13px;padding:3px 6px 14px;color:var(--accent)}.help-screen-brand span{color:var(--content)}.help-screen-nav{font-size:11px;padding:8px 6px;border-radius:7px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.help-screen-nav.active{background:var(--accent-soft);color:var(--accent);font-weight:700}.help-screen-main{padding:14px 16px;min-width:0}.help-screen-top{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:10px;white-space:nowrap;overflow:hidden}.help-screen-title{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:750;font-size:15px;margin:16px 0 12px}.help-screen-title button{border:0;border-radius:7px;background:var(--accent);color:white;padding:7px 10px;font-size:10px;white-space:nowrap}.help-screen-tools{display:flex;gap:7px;margin-bottom:12px}.help-screen-tools i{font-style:normal;border:1px solid var(--line);border-radius:6px;padding:5px 8px;color:var(--muted);font-size:9px}.help-screen-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.help-screen-cards>div{display:flex;flex-direction:column;gap:7px;border:1px solid var(--line);border-radius:8px;padding:9px;font-size:9px;min-width:0}.help-screen-cards b{font-size:10px}.help-screen-cards span{color:var(--muted)}.help-screen-figure figcaption{font-size:12px;color:var(--muted);margin:6px 2px 0}@media(max-width:600px){.help-screen{grid-template-columns:92px 1fr;min-height:170px}.help-screen>aside{padding:9px 5px}.help-screen-brand span{display:none}.help-screen-nav{font-size:9px;padding:7px 4px}.help-screen-main{padding:10px 9px}.help-screen-top{font-size:8px}.help-screen-title{font-size:12px;margin:12px 0 9px}.help-screen-tools{gap:4px}.help-screen-tools i{font-size:7px;padding:4px}.help-screen-cards{gap:4px}.help-screen-cards>div{font-size:7px;padding:5px;gap:5px}.help-screen-cards b{font-size:8px}}
.tsd-shell{max-width:760px;margin:0 auto}.tsd-card{padding:clamp(14px,4vw,24px)}.tsd-scan{margin:18px 0;gap:8px}.tsd-scan input{font-size:18px;min-height:52px;flex:1}.tsd-scan .primary{min-width:94px;min-height:52px}.tsd-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}.tsd-steps>div{display:flex;flex-direction:column;gap:6px;border:1px solid var(--line);border-radius:10px;padding:10px;color:var(--muted);font-size:12px}.tsd-steps b{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:var(--surface-2)}.tsd-steps strong{color:var(--content);overflow-wrap:anywhere}.tsd-steps .complete{border-color:var(--ok);background:var(--ok-soft)}.tsd-item{padding:14px;margin-top:14px}.tsd-camera{width:100%;max-height:40vh;object-fit:cover;border-radius:12px;background:#111}@media(max-width:600px){.tsd-steps{gap:5px}.tsd-steps>div{font-size:10px;padding:7px}.tsd-scan input{min-width:0;font-size:16px}.tsd-scan .primary{min-width:72px;padding:8px}}

.help-figure{margin:18px 0 22px}.help-figure img{display:block;width:100%;height:auto;border-radius:16px;border:1px solid var(--line,#e3e7ee)}.help-figure figcaption{font-size:12px;color:var(--muted,#758094);margin-top:6px}
.org-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px}.org-summary{display:flex;align-items:center;gap:12px;margin-bottom:18px}.org-summary>div{min-width:125px;padding:12px 16px;background:var(--card);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:3px}.org-summary strong{font-size:21px}.org-summary span{font-size:12px;color:var(--muted)}.org-summary input{margin-left:auto;max-width:280px}.org-layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.9fr);gap:16px;align-items:start}.org-chart,.org-people{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px;min-width:0}.org-chart h3,.org-people h3{margin:0 0 14px}.org-node-wrap{position:relative;margin:0 0 12px 20px;padding-left:22px;border-left:1px solid var(--line)}.org-node-wrap:before{content:"";position:absolute;left:0;top:25px;width:22px;border-top:1px solid var(--line)}.org-node-wrap:first-of-type{margin-left:0;padding-left:0;border:0}.org-node-wrap:first-of-type:before{display:none}.org-children{margin-top:10px}.org-node{--org-color:#3275d9;display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--line);border-left:4px solid var(--org-color);border-radius:11px;background:var(--bg);min-width:0}.org-node-mark{width:11px;height:11px;border-radius:50%;background:var(--org-color);flex:none}.org-node-main{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.org-node-main strong{overflow:hidden;text-overflow:ellipsis}.org-node-main span,.org-node-main small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.org-node-actions{display:flex;gap:4px}.org-node-actions button{min-width:30px;height:30px;padding:0;border:0;background:transparent}.org-node-actions button:hover{background:var(--hover)}.org-section-title{display:flex;align-items:center;gap:9px}.org-section-title span{font-size:12px;color:var(--muted)}.org-people-list{display:flex;flex-direction:column}.org-person{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);min-width:0}.org-person:last-child{border-bottom:0}.org-avatar{width:34px;height:34px;border-radius:50%;background:var(--hover);display:grid;place-items:center;font-size:11px;font-weight:700;flex:none}.org-person-name{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.org-person-name b,.org-person-name small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.org-person-name b{font-size:13px}.org-person-name small{font-size:11px;color:var(--muted)}.org-person select{width:min(150px,40%);padding:6px;font-size:12px}.org-form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.org-form-row input[type=color]{height:38px;padding:3px}@media(max-width:900px){.org-layout{grid-template-columns:1fr}.org-summary{flex-wrap:wrap}.org-summary input{margin:0;max-width:none;flex:1 1 100%}}@media(max-width:560px){.org-toolbar{align-items:flex-start;flex-direction:column}.org-person{flex-wrap:wrap}.org-person select{width:100%;margin-left:44px}.org-chart,.org-people{padding:13px}.org-node-actions{gap:0}.org-node{padding:9px}.org-node-wrap{margin-left:10px;padding-left:12px}.org-node-wrap:before{width:12px}}
.task-chat-dialog.modal{width:min(900px,calc(100vw - 40px));height:min(760px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);display:flex;flex-direction:column;overflow:hidden;padding:0;border:1px solid var(--line)}.task-chat-dialog .modal-head{flex:none;margin:0;padding:17px 22px;border-bottom:1px solid var(--line)}.task-chat-dialog .modal-head h2{font-size:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.task-chat-context{display:flex;align-items:center;gap:9px 16px;flex-wrap:wrap;padding:10px 22px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}.task-chat-priority{color:var(--muted)}.task-chat-priority.high{color:#d57d24}.task-chat-priority.urgent{color:#c83232}.task-chat-live{margin-left:auto;display:flex;align-items:center;gap:6px}.task-chat-live i{display:block;width:8px;height:8px;border-radius:50%;background:#39a779}.task-chat-thread{flex:1;min-height:100px;overflow-y:auto;padding:20px clamp(16px,5vw,60px);background:var(--bg);display:flex;flex-direction:column;gap:13px;overscroll-behavior:contain}.task-chat-day{display:flex;align-items:center;justify-content:center;margin:3px 0 5px;color:var(--muted);font-size:11px}.task-chat-day span{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:4px 10px}.task-chat-message{display:flex;align-items:flex-end;gap:9px;max-width:min(82%,650px)}.task-chat-message.mine{align-self:flex-end;flex-direction:row-reverse}.task-chat-message>.avatar{flex:none}.task-chat-message-body{min-width:0}.task-chat-byline{display:flex;align-items:center;gap:9px;margin:0 3px 4px;font-size:11px}.task-chat-byline b{font-weight:650}.task-chat-byline time{color:var(--muted)}.task-chat-message.mine .task-chat-byline{justify-content:flex-end}.task-chat-bubble{padding:10px 13px;background:var(--surface);border:1px solid var(--line);border-radius:4px 14px 14px 14px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.5;box-shadow:0 1px 2px rgb(20 36 60 / 5%)}.task-chat-message.mine .task-chat-bubble{background:#eaf2ff;border-color:#d5e4fb;border-radius:14px 4px 14px 14px;color:#243750}.task-chat-empty{margin:auto;max-width:340px;display:flex;flex-direction:column;align-items:center;gap:9px;text-align:center;color:var(--muted);font-size:13px}.task-chat-empty b{color:var(--text);font-size:15px}.task-chat-empty-icon{width:52px;height:52px;border-radius:50%;background:var(--surface);display:grid;place-items:center;font-size:23px}.task-chat-loading{margin:auto;color:var(--muted);font-size:13px}.task-chat-composer{flex:none;padding:12px 18px 14px;border-top:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;gap:7px}.task-chat-composer textarea{width:100%;resize:vertical;min-height:58px;max-height:150px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--bg);color:var(--text);font:inherit;outline:none}.task-chat-composer textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.task-chat-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}.task-chat-composer-foot span{font-size:11px;color:var(--muted)}@media(max-width:600px){.task-chat-dialog.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.task-chat-dialog .modal-head{padding:13px 15px}.task-chat-context{padding:9px 15px;gap:8px 12px}.task-chat-live{margin-left:0}.task-chat-thread{padding:14px 12px}.task-chat-message{max-width:93%}.task-chat-composer{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.task-chat-composer-foot span{max-width:55%;line-height:1.3}}
.global-search{position:relative;display:flex;align-items:center;gap:9px;width:min(440px,45vw);height:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);box-shadow:var(--shadow);z-index:40}.global-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}.global-search-icon{font-size:22px;line-height:1;transform:rotate(-20deg)}.global-search input{width:100%;min-width:0;border:0!important;outline:none!important;background:transparent!important;box-shadow:none!important;padding:4px 0!important;color:var(--text)}.global-search input::placeholder{color:var(--muted)}.global-search kbd{flex:none;font:11px/1.5 inherit;padding:2px 5px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--muted)}.global-search-results{position:absolute;left:0;right:0;top:calc(100% + 7px);max-height:min(65vh,520px);overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 40px rgb(17 28 45 / 20%);padding:5px}.global-search-hit{display:flex;align-items:center;gap:10px;padding:9px;border-radius:8px;color:var(--text);text-decoration:none}.global-search-hit:hover,.global-search-hit:focus{background:var(--hover);outline:0}.global-search-kind{flex:none;min-width:70px;padding:4px 6px;border-radius:6px;background:var(--bg);color:var(--muted);font-size:10px;text-align:center}.global-search-text{display:flex;flex-direction:column;min-width:0;flex:1;gap:2px}.global-search-text b,.global-search-text small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.global-search-text b{font-size:13px}.global-search-text small{font-size:11px;color:var(--muted)}.global-search-enter{color:var(--muted);font-size:12px}.global-search-empty{padding:18px 12px;text-align:center;color:var(--muted);font-size:13px}@media(max-width:900px){.topbar{display:flex;justify-content:stretch;min-height:42px;margin:0 0 12px}.topbar>.plan-wrap,.topbar>.bell-wrap,.topbar>.team-chat,.topbar>.chat-fab{display:none}.global-search{width:100%;box-shadow:none}.global-search-results{max-height:55vh}}
.task-detail-dialog.modal{width:min(980px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;overflow:hidden;display:flex;flex-direction:column}.task-detail-dialog .modal-head{flex:none;padding:17px 22px;margin:0;border-bottom:1px solid var(--line)}.task-detail-dialog .modal-body{overflow:auto;padding:20px 22px}.task-detail-dialog .modal-foot{flex:none;padding:12px 22px;margin:0;border-top:1px solid var(--line)}.task-detail-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:22px;align-items:start}.task-detail-fields{min-width:0}.task-checklist{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--surface-2)}.task-checklist-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.task-checklist-head>div{display:flex;flex-direction:column;gap:3px}.task-checklist-head small{color:var(--muted);font-size:11px}.task-checklist-head>span{font-size:22px;color:var(--ok)}.task-check-item{display:flex;align-items:center;gap:9px;padding:8px 2px;border-bottom:1px solid var(--line);font-size:13px}.task-check-item>span{flex:1}.task-check-item>span.done{text-decoration:line-through;color:var(--muted)}.task-check-add{display:flex;gap:6px;margin:11px 0}.task-check-add input{flex:1;min-width:0}.task-check-add button{width:38px;border:0;border-radius:8px;background:var(--accent);color:#fff;font-size:20px}.task-project-card{border-top:3px solid var(--project-color);min-width:0}.task-project-stats{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:12px}.task-project-stats b{color:var(--text)}.task-project-editor.modal{width:min(840px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;overflow:hidden;display:flex;flex-direction:column}.task-project-editor .modal-head{flex:none;margin:0;padding:17px 22px;border-bottom:1px solid var(--line)}.task-project-editor .modal-body{overflow:auto;padding:20px 22px}.task-project-editor .modal-foot{flex:none;margin:0;padding:12px 22px;border-top:1px solid var(--line)}.task-project-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.task-project-members{min-width:0}.task-project-members h3{margin:0 0 4px}.task-project-member{display:flex;align-items:center;gap:9px;padding:8px 4px;border-bottom:1px solid var(--line);font-size:13px}.task-project-member>span:last-of-type{flex:1}.task-project-member small{color:var(--muted)}@media(max-width:700px){.task-detail-dialog.modal,.task-project-editor.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.task-detail-grid,.task-project-editor-grid{grid-template-columns:1fr;gap:16px}.task-detail-dialog .modal-head,.task-project-editor .modal-head{padding:13px 16px}.task-detail-dialog .modal-body,.task-project-editor .modal-body{padding:15px}.task-detail-dialog .modal-foot,.task-project-editor .modal-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom));flex-wrap:wrap}}

/* Mobile quick navigation: core actions stay reachable without opening the full module list. */
.mobile-bottom-nav { display: none; }
@media (max-width: 900px) {
  .mobile-bottom-nav {
    position: fixed; z-index: 45; inset: auto 0 0; display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(14px); box-shadow: 0 -5px 20px rgb(20 28 42 / 7%);
  }
  .mobile-bottom-nav a, .mobile-bottom-nav button {
    min-width: 0; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 4px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
    text-decoration: none; font-size: 10px; font-weight: 600; line-height: 1.15; white-space: nowrap;
  }
  .mobile-bottom-nav a.on { color: var(--accent); background: var(--accent-soft); }
  .mobile-bottom-nav svg { width: 20px; height: 20px; flex: none; }
  .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .topbar { display: none; }
}
@media (max-width: 480px) {
  .mobile-bottom-nav { padding-right: 5px; padding-left: 5px; }
  .mobile-bottom-nav a, .mobile-bottom-nav button { min-height: 48px; font-size: 9px; }
}
.internal-call-dialog.modal{width:min(780px,calc(100vw - 34px));padding:0;overflow:hidden}.internal-call-dialog .modal-head{padding:14px 18px;margin:0;border-bottom:1px solid var(--line)}.internal-call-stage{height:min(62vh,460px);min-height:280px;position:relative;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse at 50% 38%,#394b68,#141c2b 78%);color:#fff}.internal-call-remote{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#0b1019}.internal-call-peer{position:relative;z-index:1;display:flex;align-items:center;flex-direction:column;gap:10px;text-shadow:0 1px 5px #0009}.internal-call-peer span{font-size:13px;color:#d0d7e3}.internal-call-avatar{width:96px;height:96px;display:grid;place-items:center;border-radius:50%;background:#f1f4f9;color:#34435a;font-size:31px;font-weight:700;box-shadow:0 8px 28px #0004}.internal-call-local{position:absolute;right:16px;bottom:16px;width:clamp(90px,22%,180px);aspect-ratio:3/4;object-fit:cover;border:2px solid #ffffffa0;border-radius:12px;background:#222;box-shadow:0 5px 20px #0006}.internal-call-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;padding:15px}.internal-call-controls button{min-height:42px}.internal-call-controls .on{background:var(--accent-soft);color:var(--accent)}.internal-call-controls .internal-call-accept{border:0;border-radius:22px;background:#19a363;color:#fff;font-weight:700;padding:10px 24px}.internal-call-controls .internal-call-decline{border:0;border-radius:22px;background:#d93645;color:#fff;font-weight:700;padding:10px 20px}.internal-call-note{text-align:center;padding:0 12px 12px;font-size:11px;color:var(--muted)}@media(max-width:600px){.internal-call-dialog.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;display:flex;flex-direction:column}.internal-call-stage{height:auto;min-height:0;flex:1}.internal-call-controls{padding:12px 8px calc(12px + env(safe-area-inset-bottom));gap:7px}.internal-call-controls button{padding:9px 12px;font-size:12px}}
.call-history-dialog.modal{width:min(560px,calc(100vw - 30px))}.call-history-list{max-height:min(65vh,620px);overflow:auto;padding:4px 16px}.call-history-row{display:flex;align-items:center;gap:11px;padding:11px 2px;border-bottom:1px solid var(--line)}.call-history-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:17px}.call-history-icon.missed{background:#fff0f0;color:#c83232}.call-history-text{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.call-history-text b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.call-history-text small,.call-history-empty{color:var(--muted);font-size:11px}.call-history-empty{text-align:center;padding:30px}

.conference-client-invite{display:flex;flex-direction:column;gap:8px;margin-top:16px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}.conference-client-fields{display:grid;grid-template-columns:1fr 1.3fr auto;gap:8px}.conference-client-row,.conference-guest-link{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:7px 9px;border-radius:8px;background:var(--surface)}.conference-client-row span,.conference-guest-link span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conference-guest-links{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-top:1px solid var(--line)}.guest-call-page{min-height:100dvh;box-sizing:border-box;padding:20px;background:radial-gradient(ellipse at top,#fbe6e7,var(--bg) 58%);color:var(--content)}.guest-call-brand{max-width:1040px;margin:0 auto 20px;font-size:19px;font-weight:800}.guest-call-brand span{color:var(--accent)}.guest-call-card{width:min(900px,100%);box-sizing:border-box;margin:0 auto;padding:clamp(18px,4vw,36px);border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}.guest-call-eyebrow{color:var(--muted);font-size:13px}.guest-call-card h1{margin:6px 0;font-size:clamp(22px,4vw,32px)}.guest-call-card>p{color:var(--muted)}.guest-call-primary{min-height:48px;margin-top:10px;padding:0 24px;border:0;border-radius:12px;background:var(--accent);color:#fff;font-weight:700}.guest-call-error{margin:12px 0;padding:10px 12px;border-radius:9px;background:#fff0f0;color:#a11b20}.guest-call-stage{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr));gap:12px;margin:20px 0}.guest-call-tile{position:relative;display:flex;min-height:220px;align-items:center;justify-content:center;flex-direction:column;gap:8px;overflow:hidden;border-radius:14px;background:#192334;color:#fff}.guest-call-tile>video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.guest-call-tile>b,.guest-call-tile>small,.guest-call-avatar{position:relative;z-index:1}.guest-call-avatar{display:grid;width:72px;height:72px;place-items:center;border-radius:50%;background:#eff2f7;color:#26364d;font-size:22px;font-weight:800}.guest-call-tile>small{color:#d2d8e1}.guest-call-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:9px}.guest-call-controls button{min-height:42px}.guest-call-controls .danger{border:0;border-radius:10px;background:#c92b31;color:#fff;padding:8px 16px}
.conference-recording-note{padding:10px 14px;background:#fff4f4;color:#9b1c26;font-size:13px;font-weight:600;text-align:center}.conference-recording-note span{color:#d3212b}
.guest-call-footnote{margin:12px 0 0;color:var(--muted);font-size:12px;text-align:center}
@media(max-width:600px){.conference-client-fields{grid-template-columns:1fr}.guest-call-page{padding:12px}.guest-call-card{border-radius:14px}.guest-call-tile{min-height:180px}}

/* The mobile search lives in the bottom navigation. Never render the desktop search
   row on top of the slide-out menu (a later search rule used to re-enable it). */
@media (max-width: 900px) {
  html, body, #root { min-width: 0; width: 100%; overflow-x: clip; }
  *, *::before, *::after { box-sizing: border-box; }
  .main > .topbar { display: none !important; }
  .sidebar { box-sizing: border-box; max-width: 88vw; overflow-x: hidden; overflow-y: auto; }
  .sidebar .global-search, .sidebar .global-search-results { display: none !important; }
  .mobile-bar { position: sticky; top: 0; }
  .mobile-bar .logo { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .mobile-bar .bell-wrap { position: static; }
}

/* A full-screen mobile chat must sit above the app chrome, with the conversation
   fitted inside the actual viewport instead of being covered by the bottom bar. */
@media (max-width: 900px) {
  .team-pop {
    z-index: 120;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    overflow: hidden;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 0;
  }
  .team-pop-head { flex: 0 0 auto; min-height: 48px; }
  .team-pop-body { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .team-pop .team {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, min(27dvh, 230px)) minmax(0, 1fr);
  }
  .team-pop .team-side,
  .team-pop .team-main,
  .team-pop .team-msgs,
  .team-pop .team-msg,
  .team-pop .team-msg-body,
  .team-pop .team-head,
  .team-pop .team-compose { min-width: 0; max-width: 100%; }
  .team-pop .team-head > .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .team-pop .team-head > .grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .team-pop .team-msgs { overflow-x: hidden; }
  .team-pop .team { height: 100%; min-height: 0; }
  .team-pop .team-side { min-height: 0; max-height: none; overflow: hidden; }
  .team-pop .team-rooms { min-height: 0; overscroll-behavior: contain; }
  .team-pop .team-main { height: auto; min-height: 0; flex: 1 1 0; }
  .team-pop .team-msgs { min-height: 0; flex: 1 1 0; overscroll-behavior: contain; }
  .team-pop .team-head { flex: 0 0 auto; }
  .team-pop .team-text { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
  .team-pop .team-compose { flex: 0 0 auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); }
  .team-pop .team-compose-row,
  .team-pop .team-compose-row textarea { min-width: 0; }
  /* Keep the text field on its own line; the action buttons must not squeeze it
     into a narrow column when Android's keyboard reduces the available height. */
  .team-pop .team-compose-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
  .team-pop .team-compose-row > textarea { flex: 1 1 100%; width: 100%; min-height: 46px; max-height: 22dvh; }
  .team-pop .team-compose-row > .dcm-btns { flex: 1 1 100%; width: 100%; min-width: 0; margin-left: 0; justify-content: space-between; }
  /* The notification panel is anchored to a tiny header button on desktop.
     On phones, anchor it to the viewport so its full contents remain visible. */
  .bell-wrap .notify-pop {
    position: fixed;
    top: calc(66px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 78px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 130;
  }
  .bell-wrap .notify-pop > div[style*="max-height"] { max-height: min(42dvh, 340px) !important; overflow-x: hidden; overflow-y: auto; }
  .notify-pop, .notify-pop * { min-width: 0; }
  .notify-item { width: 100%; max-width: 100%; }
}

/* Task dialogs used to place their form directly in the modal, so the declared
   modal-body padding and scrolling never applied. */
.task-detail-dialog > .modal-body,
.task-project-editor > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px 22px;
}
@media (max-width: 1024px) {
  .task-detail-grid,
  .task-project-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 700px) {
  .task-detail-dialog.modal,
  .task-project-editor.modal {
    width: calc(100vw - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: 14px;
  }
  .task-detail-dialog > .modal-body,
  .task-project-editor > .modal-body { padding: 15px; }
  .task-detail-dialog .modal-foot,
  .task-project-editor .modal-foot {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .task-detail-dialog .modal-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-detail-dialog .modal-foot > :first-child { grid-column: 1 / -1; }
  .task-detail-dialog .modal-foot > button,
  .task-project-editor .modal-foot > button { justify-content: center; min-width: 0; }
}

/* Small-screen dialogs and cards: keep every grid column shrinkable and let long
   labels wrap instead of pushing the viewport sideways. */
@media (max-width: 700px) {
  .overlay { z-index: 140; padding: 0; }
  .modal { width: calc(100vw - 20px); max-width: none; max-height: calc(100dvh - 20px); overflow-x: hidden; }
  .modal-head, .page-head { min-width: 0; }
  .modal-head h2, .page-head h1 { min-width: 0; overflow-wrap: anywhere; }
  .form-2, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .table-wrap, .table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
  .card, .panel, .modal, .page-head, .filters, .toolbar { min-width: 0; }
  .conference-create.modal, .conference-invites.modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; }
  .conference-create-actions { flex-wrap: wrap; }
  .conference-create-actions > button { flex: 1 1 auto; }
}
.deal-create-dialog.modal{width:min(620px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;overflow:hidden;display:flex;flex-direction:column}.deal-create-dialog .modal-head{flex:none;margin:0;padding:15px 20px;border-bottom:1px solid var(--line)}.deal-create-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px}.deal-create-dialog>.modal-foot{flex:none;margin:0;padding:11px 20px;border-top:1px solid var(--line);background:var(--surface)}
@media(max-width:700px){.deal-create-dialog.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.deal-create-dialog .modal-head{padding:13px 16px}.deal-create-body{padding:15px}.deal-create-dialog>.modal-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom));gap:8px}.deal-create-dialog>.modal-foot>button{flex:1;justify-content:center;min-width:0}}
.calendar-event-dialog.modal{width:min(760px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;overflow:hidden;display:flex;flex-direction:column}.calendar-event-dialog .modal-head{flex:none;margin:0;padding:15px 20px;border-bottom:1px solid var(--line)}.calendar-event-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px}.calendar-event-dialog>.modal-foot{flex:none;margin:0;padding:11px 20px;border-top:1px solid var(--line);background:var(--surface)}
@media(max-width:700px){.calendar-event-dialog.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.calendar-event-dialog .modal-head{padding:13px 16px}.calendar-event-body{padding:15px}.calendar-event-dialog>.modal-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.calendar-event-dialog>.modal-foot>.spacer{display:none}.calendar-event-dialog>.modal-foot>button{min-width:0;justify-content:center}}
.task-create-dialog.modal{width:min(680px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;overflow:hidden;display:flex;flex-direction:column}.task-create-dialog .modal-head{flex:none;margin:0;padding:15px 20px;border-bottom:1px solid var(--line)}.task-create-dialog>.modal-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px}.task-create-dialog>.modal-foot{flex:none;margin:0;padding:11px 20px;border-top:1px solid var(--line);background:var(--surface)}
@media(max-width:700px){.task-create-dialog.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.task-create-dialog .modal-head{padding:13px 16px}.task-create-dialog>.modal-body{padding:15px}.task-create-dialog>.modal-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom));display:flex;gap:8px}.task-create-dialog>.modal-foot>button{flex:1;justify-content:center;min-width:0}}
.cal-week-agenda{display:none}.cal-agenda{display:flex;flex-direction:column}.cal-agenda-day{padding:0 14px;border-bottom:1px solid var(--line)}.cal-agenda-day:last-child{border-bottom:0}.cal-agenda-day>header{display:flex;align-items:center;gap:8px;padding:11px 0 8px}.cal-agenda-day>header>div{display:flex;flex:1;align-items:baseline;gap:9px;min-width:0}.cal-agenda-day>header b{text-transform:capitalize}.cal-agenda-day>header span{color:var(--muted);font-size:12px}.cal-agenda-day>header.today b{color:var(--accent)}.cal-agenda-day>header>button{min-width:34px;min-height:34px;justify-content:center;padding:4px}.cal-agenda-item{display:grid;width:100%;grid-template-columns:72px minmax(0,1fr);align-items:start;gap:10px;margin:0 0 7px;padding:10px;border:1px solid var(--line);border-left:3px solid var(--c);border-radius:9px;background:var(--surface);color:var(--content);text-align:left}.cal-agenda-item time{font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}.cal-agenda-item>span{min-width:0;display:flex;flex-direction:column;gap:3px}.cal-agenda-item b{overflow-wrap:anywhere;font-size:13px}.cal-agenda-item small{color:var(--muted);font-size:11px;overflow-wrap:anywhere}.cal-agenda-empty{padding:0 0 10px 82px;color:var(--faint);font-size:12px}
.cal-agenda-item,.cal-agenda-item>span,.cal-agenda-item b,.cal-agenda-item small{white-space:normal}
@media(max-width:700px){.cal-week-agenda{display:block}.cal-week-grid{display:none}.cal-main{overflow:visible}.cal-agenda-day{padding-left:10px;padding-right:10px}.cal-agenda-item{grid-template-columns:68px minmax(0,1fr);gap:8px;padding:9px}.cal-agenda-empty{padding-left:76px}.cal-month-desktop{display:none}.cal-month-mobile{display:block}.cal-month-agenda{display:flex;flex-direction:column}.cal-month-day{display:grid;grid-template-columns:52px minmax(0,1fr);gap:6px;padding:7px 10px;border-bottom:1px solid var(--line);min-width:0}.cal-month-day.empty{align-items:center;padding-top:2px;padding-bottom:2px}.cal-month-date{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;align-self:start;padding:5px 2px;border:0;border-radius:8px;background:transparent;color:var(--content);cursor:pointer}.cal-month-date b{font-size:17px;line-height:1.2}.cal-month-date span{font-size:11px;color:var(--muted);text-transform:capitalize}.cal-month-day.empty .cal-month-date{flex-direction:row;justify-content:flex-start;align-items:baseline;gap:6px;align-self:center}.cal-month-day.empty .cal-month-date b{font-size:14px}.cal-month-day.empty .cal-month-date span{font-size:11px}.cal-month-date.today{background:var(--accent);color:#fff}.cal-month-date.today span{color:#fff}.cal-month-events{min-width:0}.cal-month-events .cal-agenda-item{margin-bottom:5px}.cal-month-empty{display:block;padding:2px 4px;color:var(--faint);font-size:11px}}
@media(max-width:1200px){.cal-filter-toggle{display:inline-flex!important}.cal-side{display:none!important}.cal-side.filters-open{display:flex!important;order:0;position:static;max-height:min(60dvh,540px);overflow:auto}.cal-bar{flex-wrap:wrap}.cal-filter-toggle{min-height:40px}}
@media(max-width:700px){
  .cal-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:10px}
  .cal-title{grid-column:1/-1;min-width:0;margin:0;font-size:20px;line-height:1.25}
  .cal-bar>div.tabs:nth-of-type(1){grid-column:1;grid-row:2;display:flex;min-width:0}
  .cal-bar>div.tabs:nth-of-type(1)>button:nth-child(2){flex:1}
  .cal-bar>div.tabs:nth-of-type(2){grid-column:2;grid-row:2;display:flex;min-width:0}
  .cal-bar>div.tabs:nth-of-type(2)>button{min-width:0;padding:7px 9px;font-size:12px}
  .cal-bar>.spacer{display:none}
  .cal-filter-toggle{grid-column:1;grid-row:3;justify-content:center}
  .cal-bar>button:nth-last-child(2){grid-column:2;grid-row:3;justify-content:center;white-space:nowrap}
  .cal-bar>.primary{grid-column:1/-1;grid-row:4;justify-content:center;min-height:42px}
}

/* Article-specific illustrated workflows */
.help-screen-title{min-width:0;flex-wrap:wrap}
.help-screen-tools i{display:flex;align-items:center;gap:5px;flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.help-screen-tools i b{display:grid;place-items:center;flex:0 0 17px;height:17px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:9px}
.help-screen-cards>div{min-width:0;overflow:hidden}
.help-screen-cards span{overflow-wrap:anywhere}
/* Team audio/video conferences */
.conference-create-tools{display:flex;justify-content:flex-end;margin:-5px 0 8px}.conference-scheduled-row{display:flex;align-items:center;gap:8px;padding:13px 0;border-bottom:1px solid var(--line)}.conference-scheduled-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.conference-scheduled-info>span,.conference-scheduled-info small{color:var(--muted);font-size:12px;overflow-wrap:anywhere}.conference-scheduled-row>span.muted{font-size:12px}.guest-call-scheduled{padding:13px 15px;margin:14px 0;border-radius:12px;background:var(--accent-soft);color:var(--text);line-height:1.5}
.conference-create.modal{width:min(590px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden;display:flex;flex-direction:column}.conference-create .modal-head{flex:none;margin:0;padding:14px 18px;border-bottom:1px solid var(--line)}.conference-create-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 18px 4px}.conference-create-body>p{margin:0 0 14px;font-size:13px}.conference-create .field{display:flex;flex-direction:column;gap:6px;margin:12px 0}.conference-kind{display:flex;gap:8px;margin:12px 0}.conference-kind button{flex:1;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}.conference-kind button.selected{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:700}.conference-people-head{display:flex;justify-content:space-between;align-items:center;padding:10px 0 6px}.conference-people-head small,.conference-person small{color:var(--muted);font-size:11px}.conference-people{max-height:38vh;overflow:auto;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.conference-person{display:flex;align-items:center;gap:10px;padding:9px 4px;border-bottom:1px solid var(--line);cursor:pointer}.conference-person:last-child{border-bottom:0}.conference-person input{width:17px;height:17px;accent-color:var(--accent)}.conference-person>span:last-child{display:flex;flex-direction:column;gap:3px}.conference-avatar{width:38px;height:38px;flex:none;display:grid;place-items:center;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:12px;font-weight:700}.conference-create-actions{flex:none;display:flex;justify-content:flex-end;gap:9px;padding:12px 18px;border-top:1px solid var(--line);background:var(--surface)}.conference-invites.modal{width:min(650px,calc(100vw - 28px))}.conference-invite{display:flex;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}.conference-invite>div{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.conference-invite small{color:var(--muted);font-size:11px}.conference-live.modal{width:min(1000px,calc(100vw - 28px));padding:0;overflow:hidden}.conference-live .modal-head{margin:0;padding:14px 18px;border-bottom:1px solid var(--line)}.conference-stage{min-height:340px;max-height:min(68vh,700px);padding:12px;background:#111827;overflow:auto}.conference-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;min-height:310px}.conference-grid.audio{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));align-content:center}.conference-tile{position:relative;min-height:170px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;border-radius:13px;background:linear-gradient(145deg,#26344b,#151d2b);color:#fff;overflow:hidden}.conference-tile video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#0b1019}.conference-tile b,.conference-tile small,.conference-tile .conference-avatar{position:relative;z-index:1;text-shadow:0 1px 4px #000b}.conference-tile b{align-self:flex-start;margin:0 0 0 12px}.conference-tile small{align-self:flex-start;margin:0 12px 10px;color:#d0d7e3}.conference-avatar.large{width:70px;height:70px;font-size:23px;background:#eef2f8;color:#334155;text-shadow:none}.conference-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;padding:14px}.conference-controls button{min-height:40px}.conference-controls button.on{background:var(--accent-soft);color:var(--accent)}.conference-footnote{text-align:center;padding:0 14px 13px;color:var(--muted);font-size:11px}
@media(max-width:700px){.conference-scheduled-row{align-items:flex-start;flex-wrap:wrap}.conference-scheduled-info{flex-basis:100%}.conference-live.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;display:flex;flex-direction:column}.conference-stage{flex:1;max-height:none}.conference-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-content:center}.conference-tile{min-height:150px}.conference-create.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.conference-create .modal-head{padding:13px 16px}.conference-create-body{padding:13px 14px 4px}.conference-create-actions{padding:10px 12px calc(10px + env(safe-area-inset-bottom));gap:8px}.conference-create-actions>button{flex:1;justify-content:center}.conference-create-actions .primary{flex:1}}
@media(max-width:900px){.mobile-bar-meeting{display:inline-flex!important;flex:none;width:40px;min-width:40px;height:40px;padding:6px;justify-content:center}}
@media(max-width:900px){input,select,textarea{font-size:16px}.mobile-search-overlay{position:fixed;z-index:150;inset:0;display:flex;align-items:flex-start;justify-content:center;padding:calc(10px + env(safe-area-inset-top)) 10px 10px;background:rgb(12 18 28 / .44);backdrop-filter:blur(2px)}.mobile-search-dialog{position:relative;width:min(620px,100%);padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 42px rgb(0 0 0 / .24)}.mobile-search-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.mobile-search-head button{width:38px;min-width:38px;height:38px;min-height:38px;justify-content:center;padding:0;font-size:25px}.mobile-search-dialog .global-search{width:100%;height:46px}.mobile-search-dialog .global-search input{font-size:16px!important}.mobile-search-dialog .global-search kbd{display:none!important}.mobile-search-dialog .global-search-results{max-height:60dvh}}
.delivery-stop{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:10px;padding:12px 0;border-top:1px solid var(--line)}.delivery-stop-seq{display:grid;place-items:center;min-width:28px;height:28px;border-radius:50%;background:var(--surface-2);color:var(--content)}.delivery-stop-body{min-width:0}.delivery-stop-address{overflow-wrap:anywhere}.delivery-stop-note{margin-top:4px;color:var(--warn)}.delivery-stop-actions,.delivery-stop-quick{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:9px}.delivery-stop-actions .btn,.delivery-stop-quick button{min-height:38px}.delivery-stop select{width:auto;max-width:130px}.delivery-stop-quick .danger{color:var(--accent);border-color:var(--line)}.delivery-route-nav{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:10px;padding:10px;border-radius:10px;background:var(--surface-2)}.delivery-route-nav>b{flex-basis:100%}
 .delivery-table-wrap{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.delivery-orders-table{min-width:760px}
@media(max-width:600px){.delivery-stop{grid-template-columns:28px minmax(0,1fr);gap:8px}.delivery-stop select,.delivery-stop-quick{grid-column:2;width:100%;max-width:none}.delivery-stop select{min-height:44px}.delivery-stop-actions .btn{flex:1 1 auto;min-height:44px;justify-content:center;padding:7px 8px;font-size:12px}.delivery-stop-quick button{flex:1;min-height:44px;justify-content:center}.delivery-route-nav>a{flex:1 1 auto;justify-content:center}}
@media(max-width:600px){
  .delivery-table-wrap{overflow:visible}
  .delivery-orders-table{display:block;width:100%;min-width:0;border-collapse:separate;border-spacing:0}
  .delivery-orders-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .delivery-orders-table tbody{display:grid;gap:10px;padding:0 10px 12px}
  .delivery-orders-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
  .delivery-orders-table tbody td{display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:4px;padding:9px 10px;border:0;border-bottom:1px solid var(--line);font-size:13px;overflow-wrap:anywhere}
  .delivery-orders-table tbody td::before{content:attr(data-label);font-size:10px;font-weight:700;color:var(--muted)}
  .delivery-orders-table tbody td:nth-child(-n+3){grid-column:1/-1}
  .delivery-orders-table tbody td:nth-child(4),.delivery-orders-table tbody td:nth-child(5){grid-column:span 1}
  .delivery-orders-table tbody td:nth-child(6),.delivery-orders-table tbody td:nth-child(7){grid-column:1/-1}
  .delivery-orders-table tbody td:last-child{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;gap:6px;border-bottom:0}
  .delivery-orders-table tbody td:last-child::before{flex-basis:100%}
.delivery-orders-table tbody td:last-child button{flex:1 1 112px;min-height:40px;justify-content:center}
}

.conference-guest-link{flex-wrap:wrap}
.conference-guest-link .row{flex:none;gap:6px}
.conference-guest-link .btn{white-space:nowrap;text-decoration:none}
.conference-guest-link>span{flex:1}
.conference-scheduled-guest{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.conference-scheduled-guest>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.conference-scheduled-guest .row{flex:none;gap:6px}
.conference-scheduled-guest .btn{white-space:nowrap;text-decoration:none}
@media(max-width:520px){.conference-scheduled-guest{align-items:flex-start;flex-direction:column}.conference-scheduled-guest>span{width:100%}.conference-scheduled-guest .row{width:100%}.conference-scheduled-guest .row>*{flex:1;justify-content:center}}

/* Установка iPhone PWA и режим сопровождения компании супер-администратором. */
.ios-install-hint{display:flex;align-items:center;gap:12px;margin:0 0 12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}.ios-install-icon{width:42px;height:42px;flex:none;border-radius:10px;overflow:hidden}.ios-install-icon img{display:block;width:100%;height:100%}.ios-install-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.ios-install-copy span{color:var(--muted);font-size:12px}.ios-install-dismiss{font-size:20px;padding:4px 8px}.ios-install-steps{padding-left:23px;line-height:1.65}.ios-install-steps li{padding:4px 0}.admin-company-context{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:10px 14px;border:1px solid var(--warn);border-radius:10px;background:var(--warn-soft);color:var(--text)}@media(max-width:600px){.ios-install-hint{gap:9px;padding:10px}.ios-install-copy span{font-size:11px}.ios-install-hint>.btn{font-size:12px;padding:8px}.admin-company-context{align-items:flex-start;flex-direction:column}}

/* Mobile chat uses one pane at a time and follows the visible viewport above the keyboard. */
.team-mobile-back{display:none}.team-mobile-actions,.team-action-label{display:none}@media(max-width:900px){.team.mobile-rooms-open,.team.mobile-room-open{height:calc(100dvh - 158px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:0;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}.team.mobile-rooms-open .team-side{display:flex;max-height:none;height:100%;min-height:0}.team.mobile-rooms-open .team-main{display:none}.team.mobile-room-open .team-side{display:none}.team.mobile-room-open .team-main{display:flex;min-height:0;height:100%;width:100%}.team-mobile-back{display:inline-flex;flex:none;align-items:center;min-height:38px;padding:6px 8px;white-space:nowrap}.team-head{position:relative;gap:5px;padding:8px 10px}.team-head>.grow{min-width:0;flex:1 1 auto}.team-head-actions{display:none;position:absolute;top:calc(100% + 4px);right:8px;z-index:40;min-width:210px;max-width:calc(100vw - 24px);padding:6px;flex-direction:column;align-items:stretch;gap:2px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}.team-head.actions-open .team-head-actions{display:flex}.team-head-actions>button{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:42px;padding:8px 10px;text-align:left}.team-action-label{display:inline}.team-mobile-actions{display:inline-flex;flex:none;align-items:center;justify-content:center;min-width:38px;min-height:38px;padding:4px;font-size:24px;line-height:1}.team-pop.keyboard-open .team-tools,.team-pop.keyboard-open .team-hint{display:none}.team-pop.keyboard-open .team-compose{gap:4px;padding-top:5px}.team-pop.keyboard-open .team-compose-row>textarea{max-height:18dvh}.team-pop.keyboard-open .team-msgs{scroll-padding-bottom:12px}.bell-wrap .notify-pop{overscroll-behavior:contain;touch-action:pan-y}.bell-wrap .notify-pop>div[style*='max-height']{overscroll-behavior:contain}}
@media(max-width:600px){.task-chat-dialog.modal{min-height:0;max-height:100dvh;display:flex;flex-direction:column}.task-chat-dialog.keyboard-open .task-chat-context{display:none}.task-chat-dialog.keyboard-open .task-chat-thread{min-height:0}.task-chat-dialog.keyboard-open .task-chat-composer textarea{max-height:18dvh;resize:none}}
@media(max-width:700px){.task-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.task-filters>.task-search-filter,.task-filters>.task-project-filter,.task-filters>.task-view-filter,.task-filters>.task-template-filter{grid-column:1/-1;width:100%;max-width:none!important;min-width:0}.task-filters>.tabs{display:grid;min-width:0;max-width:none}.task-filters>.tabs button{min-width:0;padding:8px 5px;font-size:12px;white-space:normal}.task-filters>.task-view-filter{grid-template-columns:repeat(3,minmax(0,1fr))}.task-filters>.task-scope-filter,.task-filters>.task-status-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.task-filters>select{width:100%!important}}

.delivery-route-head{flex-wrap:wrap}.delivery-route-head>div:first-child{min-width:0;overflow-wrap:anywhere}.delivery-stop-quick{min-width:0}.delivery-route-leg{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
@media(max-width:600px){.delivery-route-head>div:first-child{flex-basis:100%!important}.delivery-route-head>button,.delivery-route-head>select{min-height:44px;max-width:100%}.delivery-route-leg{width:100%}.delivery-route-leg>a{flex:1;white-space:normal;text-align:center}.delivery-stop-quick .badge{flex-basis:100%}}

.notify-preferences{margin:0;padding:0;border:0;min-width:0}.notify-preferences:disabled{opacity:.7}
@media(max-width:700px){.overlay>.modal{max-height:calc(var(--modal-viewport-height,100dvh) - 32px)}.overlay>.task-chat-dialog.modal,.overlay>.task-detail-dialog.modal,.overlay>.task-project-editor.modal,.overlay>.nav-customize-modal.modal,.overlay>.internal-call-dialog.modal{height:var(--modal-viewport-height,100dvh);max-height:var(--modal-viewport-height,100dvh)}.overlay:has(>.task-chat-dialog),.overlay:has(>.task-detail-dialog),.overlay:has(>.task-project-editor),.overlay:has(>.nav-customize-modal),.overlay:has(>.internal-call-dialog){padding:0}.modal.keyboard-open .task-chat-composer textarea{font-size:16px;max-height:100px}.notify-pop .notify-item{overflow-wrap:anywhere}.notify-pop button{min-height:40px}}

@media(max-width:900px){body:has(.team.keyboard-open) .mobile-bottom-nav{display:none}.team.keyboard-open .team-tools,.team.keyboard-open .team-hint{display:none}.team.keyboard-open .team-compose{padding-top:5px;gap:4px}.team.keyboard-open .team-compose-row>textarea{max-height:100px;font-size:16px}.team .team-compose-row{flex-wrap:wrap}.team .team-compose-row>textarea{flex:1 1 100%;width:100%;min-width:0}.team .team-compose-row>.dcm-btns{flex:1 1 100%;width:100%;min-width:0;justify-content:space-between}.team.keyboard-open .team-msgs{min-height:0}}

.cal-status{padding:12px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
@media(max-width:700px){.overlay:has(>.calendar-event-dialog){padding:0}.overlay>.calendar-event-dialog.modal{height:var(--modal-viewport-height,100dvh);max-height:var(--modal-viewport-height,100dvh)}.calendar-event-body input,.calendar-event-body textarea{font-size:16px}.cal-status>button{min-height:44px}}

.internal-call-peer.has-video{position:absolute;left:16px;bottom:16px;align-items:flex-start;gap:3px;max-width:55%;padding:8px 12px;background:#101722b8;border-radius:10px;font-size:13px}.internal-call-peer.has-video .internal-call-avatar{display:none}.internal-call-local{max-height:145px;width:110px;aspect-ratio:3/4}.internal-call-chat{padding:12px 16px;border-top:1px solid var(--border);min-height:0}.internal-call-messages{max-height:180px;overflow:auto;display:flex;flex-direction:column;gap:8px;margin:8px 0}.internal-call-messages>div{background:var(--bg);border-radius:8px;padding:6px 10px;align-self:flex-start;max-width:90%;overflow-wrap:anywhere}.internal-call-messages>div.self{align-self:flex-end;background:#fff0f0}.internal-call-messages p{margin:3px 0;white-space:pre-wrap}.internal-call-chat form{display:flex;gap:8px}.internal-call-chat input{flex:1;min-width:0}.global-search-results .selected{background:#fff0f0;outline:2px solid #c00000;outline-offset:-2px}@media(max-width:700px){.internal-call-controls{gap:6px;padding:10px;flex-wrap:wrap}.internal-call-controls button{padding:8px;font-size:12px}.internal-call-chat{flex-shrink:0}.internal-call-messages{max-height:120px}.internal-call-local{width:80px;max-height:110px;right:10px;bottom:10px}}

.internal-call-dialog.modal{display:flex;flex-direction:column;max-height:calc(100dvh - 24px)}.internal-call-dialog>.modal-head,.internal-call-controls,.internal-call-note,.internal-call-dialog>.conference-recording-note{flex-shrink:0}.internal-call-stage{flex:1 1 auto;min-height:140px}.internal-call-chat{flex:0 1 auto;overflow:auto;border-color:var(--line)}.internal-call-messages>div.self,.global-search-results .selected{background:var(--accent-soft)}@media(max-width:700px){.internal-call-dialog.modal{max-height:var(--modal-viewport-height,100dvh)}.internal-call-dialog.keyboard-open .internal-call-stage{min-height:70px}.internal-call-dialog.keyboard-open .internal-call-messages{max-height:70px}}

.call-history-chat .internal-call-messages{max-height:65dvh}.internal-call-controls{flex-wrap:wrap}.internal-call-chat input{font-size:16px}

.meeting-chat{padding:10px 16px;border-top:1px solid var(--line);background:var(--surface);min-width:0;flex-shrink:0}.meeting-chat-toggle{width:100%;text-align:left;font-weight:700}.meeting-chat form{display:flex;gap:8px;align-items:flex-end}.meeting-chat textarea{flex:1;min-width:0;resize:none;font-size:16px}.meeting-chat-error{font-size:13px;color:var(--accent)}.meeting-chat .internal-call-messages{max-height:160px}.conference-live.modal{display:flex;flex-direction:column;max-height:calc(100dvh - 24px)}.conference-stage{flex:1 1 auto;min-height:160px}.conference-live>.modal-head,.conference-controls,.conference-footnote{flex-shrink:0}@media(max-width:700px){.conference-live.modal{max-height:var(--modal-viewport-height,100dvh)}.conference-grid{min-height:160px}.meeting-chat .internal-call-messages{max-height:100px}.conference-live.keyboard-open .conference-stage{min-height:80px}.conference-live.keyboard-open .meeting-chat .internal-call-messages{max-height:60px}.meeting-chat{padding:8px 12px}}

.call-history-dialog.modal{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100dvh - 28px)}.call-history-tabs{display:flex;gap:8px;margin:0 0 12px}.call-history-tabs button{flex:1}.call-history-tabs .selected{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.call-history-search{width:100%;margin-bottom:12px}.call-history-list{min-height:0;overflow:auto}.call-history-chat .meeting-chat .internal-call-messages{max-height:55dvh}.conference-live>.meeting-chat{flex:0 1 auto;min-height:0;overflow:auto}.conference-live>.conference-guest-links{max-height:100px;overflow:auto;flex-shrink:1}.conference-controls{flex-wrap:wrap}@media(max-width:700px){.call-history-dialog.modal{max-height:calc(var(--modal-viewport-height,100dvh) - 16px)}.call-history-row{flex-wrap:wrap}.call-history-text{flex:1;min-width:0;overflow-wrap:anywhere}.conference-live.keyboard-open .conference-stage{min-height:0;max-height:70px;flex:0 1 70px}.conference-live.keyboard-open .conference-footnote,.conference-live.keyboard-open .conference-guest-links{display:none}.conference-live.keyboard-open>.meeting-chat{flex:1 1 auto;overflow:auto}.conference-live.keyboard-open .conference-controls button{padding:7px;font-size:12px}.conference-live.keyboard-open .meeting-chat .internal-call-messages{max-height:60px}.internal-call-dialog.keyboard-open .internal-call-stage{min-height:0;max-height:70px;flex:0 1 70px}.internal-call-dialog.keyboard-open>.internal-call-chat{flex:1 1 auto;min-height:0;overflow:auto}.internal-call-dialog.keyboard-open>.internal-call-note{display:none}}

.notify-pop{display:flex;flex-direction:column;gap:8px;overflow:hidden;max-height:min(80dvh,650px)}.notify-pop>.row,.notify-pop>.tabs,.notify-kind-filter,.notify-pop>.check{flex-shrink:0}.notify-kind-filter{display:flex;align-items:center;gap:10px;font-size:12px}.notify-kind-filter select{flex:1;min-width:0}.notify-feed{min-height:0;max-height:340px;overflow:auto;display:flex;flex-direction:column;gap:6px;overscroll-behavior:contain}.notify-feed-row{display:flex;align-items:flex-start;border-radius:9px;background:var(--surface)}.notify-feed-row.unread{background:var(--bg)}.notify-feed-row .notify-item{flex:1;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere;border:0;background:transparent;padding:10px;border-radius:9px}.notify-item b{display:block}.notify-mark-read{flex:none;margin:8px 5px 0 0}.notify-preferences{min-width:0}.notify-pop select{font-size:14px}@media(max-width:700px){.notify-feed{max-height:none;flex:1 1 auto}.notify-pop select{font-size:16px}.notify-kind-filter{flex-wrap:wrap}.notify-kind-filter select{min-width:150px}}

.notify-pop[data-tab="settings"]{overflow-y:auto}
.team-message-more{display:none}
@media(max-width:900px){.team-msg{flex-wrap:wrap;gap:8px}.team-message-more{display:inline-flex;flex:none;align-self:flex-start;align-items:center;justify-content:center;width:32px;height:32px;padding:0;font-size:23px}.team-msg .team-actions,.team-msg:hover .team-actions{display:none}.team-msg.message-actions-open .team-actions{display:flex;position:static;flex-wrap:wrap;flex-basis:calc(100% - 46px);margin-left:46px;box-shadow:none;padding:4px;gap:4px}.team-actions>button,.team-actions>div>button{min-height:40px;min-width:40px}.team-msg:hover{background:transparent}.team-msg.message-actions-open{background:var(--surface-2)}}
.conference-preview.modal{display:flex;flex-direction:column;padding:0;overflow:hidden;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 28px)}
.conference-preview>.modal-head{flex:none;margin:0;padding:14px 18px;border-bottom:1px solid var(--line)}
.conference-preview-body{min-height:0;overflow:auto;padding:16px 18px;overscroll-behavior:contain;overflow-wrap:anywhere}
.conference-preview-members{display:flex;flex-direction:column;gap:8px}.conference-preview-members>div{display:flex;justify-content:space-between;gap:12px;padding:9px;border:1px solid var(--line);border-radius:8px}.conference-preview-members small{color:var(--muted);flex:none}
.conference-preview-actions{flex:none;display:flex;justify-content:flex-end;gap:8px;padding:12px 18px;border-top:1px solid var(--line)}
@media(max-width:700px){.conference-preview.modal{max-height:calc(var(--modal-viewport-height,100dvh) - 20px)}.conference-preview-members>div{flex-direction:column;gap:4px}.conference-preview-actions{padding-bottom:calc(12px + env(safe-area-inset-bottom))}.conference-preview-actions>button{flex:1;min-height:44px}}

/* The popup already fills the visible viewport; page chrome offsets apply only to a standalone chat. */
.internal-call-peer.has-video{position:absolute;left:12px;bottom:12px;max-width:calc(100% - 140px);align-items:flex-start;gap:4px;padding:6px 10px;border-radius:8px;background:rgb(0 0 0 / 55%)}
.internal-call-peer.has-video b{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conference-tile:has(>video)>b,.conference-tile:has(>video)>small{position:absolute;left:10px;max-width:calc(100% - 20px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 6px;border-radius:5px;background:rgb(0 0 0 / 55%)}
.conference-tile:has(>video)>b{bottom:28px}.conference-tile:has(>video)>small{bottom:7px}
@media(max-width:700px){.internal-call-controls button,.conference-controls button{min-height:44px}.internal-call-peer.has-video{max-width:calc(100% - 110px);font-size:13px}}
.guest-call-tile:has(>video)>b,.guest-call-tile:has(>video)>small{position:absolute;left:10px;max-width:calc(100% - 20px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 6px;border-radius:5px;background:rgb(0 0 0 / 55%)}
.guest-call-tile:has(>video)>b{bottom:28px}.guest-call-tile:has(>video)>small{bottom:7px}
.guest-call-card h1{overflow-wrap:anywhere}
.conference-setup.modal{max-width:1080px;max-height:calc(100dvh - 24px);overflow:auto}
.conference-setup-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(280px,1fr);gap:24px;align-items:start}
.conference-setup-preview{position:sticky;top:0;aspect-ratio:16/10;background:#192334;border-radius:18px;overflow:hidden;display:grid;place-items:center;color:#fff}
.conference-setup-preview video{width:100%;height:100%;object-fit:cover}
.conference-setup-preview>span{position:absolute;bottom:12px;left:12px;border-radius:20px;padding:6px 10px;background:#101827cc;font-size:12px}
.conference-setup-placeholder{padding:24px;text-align:center}.conference-setup-settings{min-width:0}.conference-setup-settings>.field{display:flex;flex-direction:column;gap:6px;margin:12px 0}
.conference-setup-settings select,.conference-setup-settings meter{width:100%;min-width:0}.conference-setup-toggles{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}.conference-setup-toggles label{display:flex;gap:8px;align-items:center}
.background-controls{padding:14px;border:1px solid var(--line);border-radius:14px;margin:12px 0;background:var(--surface-2)}.background-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}.background-options button{white-space:normal;min-height:44px}.background-options button[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.background-upload{display:flex;flex-direction:column;gap:8px;grid-column:1/-1;font-size:13px;padding:8px}.background-upload input{width:100%;min-width:0}.conference-setup-actions{display:flex;justify-content:flex-end;gap:10px;position:sticky;bottom:-16px;background:var(--surface);border-top:1px solid var(--line);padding:16px 0 0;margin-top:16px}.conference-setup-actions button{min-height:44px}
.conference-network{margin:12px 0;border:1px solid var(--line);border-radius:12px;padding:12px}.conference-network summary{cursor:pointer;font-weight:600}.conference-network li{margin:8px 0;overflow-wrap:anywhere}.conference-network button{margin:4px 8px 4px 0}
.conference-effect-dialog.modal{max-width:520px}
@media(max-width:700px){.conference-setup-layout{grid-template-columns:minmax(0,1fr);gap:12px}.conference-setup-preview{position:relative;aspect-ratio:16/9;max-height:230px}.conference-setup.modal{padding:14px;max-height:calc(100dvh - 12px)}.conference-setup-actions{bottom:-14px}.conference-setup-toggles{flex-direction:column}}
@media(max-width:700px){
  .guest-call-page{padding:12px 10px calc(12px + env(safe-area-inset-bottom))}
  .guest-call-card{padding:14px;min-width:0}
  .guest-call-stage{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;max-height:390px;overflow-y:auto}
  .guest-call-tile{min-height:140px}.guest-call-tile:only-child{grid-column:1/-1;min-height:220px}
  .guest-call-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .guest-call-controls button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
  .guest-call-card>.meeting-chat{padding:10px 0}
  .guest-call-card .meeting-chat form button{min-height:44px;flex-shrink:0}
  .guest-call-card:has(.meeting-chat form:focus-within) .guest-call-stage{max-height:90px;margin:8px 0}
  .guest-call-card:has(.meeting-chat form:focus-within) .guest-call-tile{min-height:80px}
  .guest-call-card:has(.meeting-chat form:focus-within) .guest-call-footnote{display:none}
}
.task-chat-thread>div:has(>.task-chat-message){display:flex;flex-direction:column;min-width:0;flex-shrink:0}
.task-chat-message:not(.mine){align-self:flex-start}
.task-chat-byline b{overflow-wrap:anywhere;min-width:0}
.task-chat-byline time{flex-shrink:0}
@media(max-width:700px){
  .overlay:has(>.task-create-dialog){padding:0}
  .overlay>.task-create-dialog.modal{height:var(--modal-viewport-height,100dvh);max-height:var(--modal-viewport-height,100dvh)}
  .task-create-dialog .form-2{grid-template-columns:minmax(0,1fr)}
  .task-create-dialog input,.task-create-dialog textarea,.task-create-dialog select{font-size:16px;min-width:0}
  .task-chat-composer-foot>span{display:none}
}
@media(max-width:900px){
  .team-pop .team.mobile-rooms-open,.team-pop .team.mobile-room-open{height:100%;min-height:0}
  .team-pop .team-main{overflow:hidden}
  .team-pop .team-compose{padding-bottom:calc(10px + env(safe-area-inset-bottom));flex-shrink:0}
  .team-pop .team-hint{display:none}
  .team-pop .team-compose-row textarea{font-size:16px;line-height:1.4;padding:10px 12px;min-height:44px;max-height:120px;overflow-y:auto}
  .team-pop .team-msgs{scrollbar-width:thin}
  .team-pop .team-compose-row .dcm-btns>button{min-height:44px}
  .bell-wrap .notify-pop[data-tab="feed"]{overflow:hidden}
  .bell-wrap .notify-pop[data-tab="settings"]{overflow-y:auto}
}

.team-active-call{display:flex;align-items:center;gap:12px;padding:12px 16px;background:var(--surface,#fff);border-bottom:1px solid var(--border,#ddd);flex-shrink:0}.team-active-call>div{flex:1;min-width:0}.team-active-call b,.team-active-call small{display:block;overflow-wrap:anywhere}.team-active-call small{color:var(--muted,#666)}.team-active-call button{min-height:44px;flex-shrink:0}.call-minimize{margin:8px 16px;min-height:44px}@media(max-width:700px){.team-active-call{gap:8px;padding:8px 12px}.team-active-call b{font-size:14px}.team-active-call button{max-width:130px}}

.team-side-call{display:none}@media(max-width:900px){.team-side-call{display:block}.team-side-call .team-active-call{background:var(--surface);border-color:var(--line)}}

.team-head-actions{display:flex;align-items:center;gap:6px}.team-head-actions>button{display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:42px;padding:9px;border-radius:11px;color:var(--text);border:1px solid var(--line);background:var(--surface);transition:background .15s,color .15s}.team-head-actions>button:hover{color:var(--brand,#c8000a);background:var(--surface2,#f3f4f6)}.team-head-actions>button:focus-visible{outline:2px solid var(--brand,#c8000a);outline-offset:2px}.team-head-actions svg{flex:none}@media(max-width:900px){.team-head-actions{display:none}.team-head.actions-open .team-head-actions{display:flex}.team-head-actions>button{justify-content:flex-start;min-height:44px;border-color:transparent}}

.chat-emoji-picker{position:fixed;box-sizing:border-box;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;padding:8px;overflow:auto;overscroll-behavior:contain;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);z-index:10000}.chat-emoji-picker button{border:0;background:transparent;border-radius:8px;font-size:24px;min-width:0;min-height:40px;padding:4px}.chat-emoji-picker button:hover,.chat-emoji-picker button:focus-visible{background:var(--surface-2)}

.task-chat-latest{align-self:center;display:flex;align-items:center;gap:8px;min-height:44px;margin:6px;flex-shrink:0}.task-search-match .task-chat-bubble{outline:2px solid var(--brand,#c8000a);outline-offset:2px}

.team-hits{min-width:0;overflow-x:hidden;overscroll-behavior:contain}.team-hits>button{width:100%;min-width:0;max-width:100%;white-space:normal;flex-shrink:0;min-height:44px}.team-hits>button>span{max-width:100%;overflow-wrap:anywhere;white-space:normal}.team-hits mark{background:#ffe8a3;color:#352900;border-radius:3px;padding:0 2px}.team-search>.row>button{min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center}

.workspace-tabs{margin:0 0 16px}.workspace-tabs-list{display:flex;gap:6px;align-items:center;overflow-x:auto;padding:4px 0 8px}.workspace-tab{display:flex;align-items:center;border:1px solid var(--border,#dce0e7);border-radius:10px;background:var(--surface,#fff);flex-shrink:0;max-width:280px}.workspace-tab.on{border-color:#2563eb;background:#eff6ff}.workspace-tab-title{border:0;background:transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}.workspace-tab-action{border:0;background:transparent;padding:6px;min-width:28px}.workspace-tab-picker{display:flex;flex-wrap:wrap;gap:6px;padding:12px;border:1px solid var(--border,#dce0e7);border-radius:10px}.workspace-tab-picker p{width:100%;margin:4px 0}.workspace-tabs-list>button{white-space:nowrap;flex-shrink:0}@media(max-width:700px){.workspace-tab-title{max-width:140px}.workspace-tabs-list>button{font-size:12px}}

.document-catalog-modal.modal{width:min(1180px,calc(100vw - 36px));max-height:calc(100dvh - 36px);padding:0;display:flex;flex-direction:column;overflow:hidden}.document-catalog-modal .modal-head{padding:18px 22px;margin:0;border-bottom:1px solid var(--line)}.document-catalog-modal .modal-body{padding:0;min-height:0;overflow:hidden}.document-catalog-modal .modal-foot{padding:14px 20px;margin:0;border-top:1px solid var(--line);flex-wrap:wrap;gap:8px}.document-catalog-selected{margin-right:auto}.document-catalog-layout{display:grid;grid-template-columns:260px minmax(0,1fr);height:min(64vh,660px);min-height:300px}.document-catalog-groups{overflow:auto;border-right:1px solid var(--line);padding:14px 10px}.document-catalog-group-head{display:flex;justify-content:space-between;align-items:center;padding:0 8px 12px}.document-catalog-tree-row{display:flex;align-items:center}.document-catalog-group{display:flex;align-items:center;gap:8px;justify-content:space-between;text-align:left;border:0;background:transparent;width:100%;padding:9px 8px;border-radius:7px;min-width:0;font-weight:400}.document-catalog-group span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document-catalog-group small{color:var(--muted);flex-shrink:0}.document-catalog-group.on{background:var(--surface-2,#eff6ff);color:var(--accent);font-weight:600}.document-catalog-expand{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;padding:4px 0;background:transparent;border:0}.document-catalog-products{display:flex;flex-direction:column;min-width:0;min-height:0;padding:16px}.document-catalog-toolbar{display:flex;gap:8px}.document-catalog-toolbar input{flex:1;min-width:0}.document-catalog-path{padding:12px 0;font-size:13px}.document-catalog-table{overflow:auto;flex:1;min-height:0;border:1px solid var(--line);border-radius:10px}.document-catalog-table table{width:100%;min-width:620px}.document-catalog-table thead{position:sticky;top:0;background:var(--surface,#fff);z-index:1}.document-catalog-table th:first-child,.document-catalog-table td:first-child{width:38px;text-align:center}.document-catalog-table input[type=checkbox]{width:17px;height:17px;display:inline-block;margin:0;vertical-align:middle}.document-catalog-table tbody tr{cursor:pointer}.document-catalog-table tr.selected{background:var(--surface-2,#eff6ff)}.document-catalog-table td:nth-child(2){min-width:240px}.document-catalog-pagination{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;padding-top:12px;font-size:12px}.document-catalog-pagination label{display:flex;align-items:center;gap:6px;margin-right:auto}.document-catalog-pagination select{width:auto;padding:6px}.document-catalog-mobile{display:none}@media(max-width:700px){.document-catalog-modal.modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.document-catalog-modal .modal-body{flex:1}.document-catalog-layout{display:block;position:relative;height:100%;min-height:0}.document-catalog-products{height:100%;padding:12px}.document-catalog-mobile{display:inline-flex}.document-catalog-groups{display:none}.document-catalog-groups.is-open{display:block;position:absolute;inset:0;background:var(--surface,#fff);z-index:3;border:0}.document-catalog-modal .modal-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.document-catalog-pagination{gap:6px}.document-catalog-pagination label{width:100%}.document-catalog-table table{display:table}.document-catalog-table thead{display:table-header-group}.document-catalog-table tbody{display:table-row-group}.document-catalog-table tr{display:table-row}.document-catalog-table td,.document-catalog-table th{display:table-cell}.document-catalog-table td:before{display:none}}

.document-catalog-modal>.modal-head,.document-catalog-modal>.modal-foot{flex:none}.document-catalog-modal>.document-catalog-layout{min-height:0;flex-shrink:1}@media(max-width:700px){.document-catalog-modal>.document-catalog-layout{height:auto;flex:1;min-height:0}.document-catalog-modal.modal.keyboard-open{height:var(--modal-viewport-height,100dvh);max-height:var(--modal-viewport-height,100dvh)}}

.cd-platform-footer{display:flex;align-items:center;justify-content:center;padding:10px 16px;opacity:.65}.cd-platform-footer .logo{font-size:16px;padding:0}.cd-platform-footer .logo-mark{width:24px;height:24px;border-radius:7px}.cd-platform-footer .logo-mark svg{width:14px;height:14px}.cd-idle{grid-template-rows:auto auto 1fr auto auto}.cd-idle .cd-platform-footer{grid-row:5}.cd-idle .cd-hint{grid-row:4}.cd-receipt{grid-template-rows:auto 1fr auto auto}.cd-ads{grid-template-rows:auto 1fr auto}.cd-company-ads{display:flex;align-items:center;justify-content:center;padding:16px}.cd-company-ads .cd-logo{max-height:80px}.cd-ads-stage{position:relative;min-height:0;overflow:hidden}

/* Элементы сетки раскладки не растягивают страницу по самому широкому содержимому (строка вкладок, таблицы, маршруты) */
.layout > * { min-width: 0; }
/* Вкладки открытых страниц — в цветах темы (в тёмной теме фон был белым, текст не читался) */
.workspace-tab { background: var(--surface); border-color: var(--line); color: var(--content); }
.workspace-tab.on { background: var(--accent-soft); border-color: var(--accent); }
.workspace-tab.on .workspace-tab-title { color: var(--accent); font-weight: 600; }
.workspace-tab-title, .workspace-tab-action { color: inherit; }
.workspace-tab-action:hover:not(:disabled) { color: var(--accent); }
.workspace-tab-picker { border-color: var(--line); background: var(--surface); }
/* Колонки сеток не распирает широкое содержимое (таблицы в карточках) — оно прокручивается внутри карточки */
.grid > * { min-width: 0; }
.grid > .card { overflow-x: auto; }

/* Голос: заметная кнопка-микрофон под полем, красная мигающая во время записи */
.voice-field { display: grid; gap: 6px; }
.voice-field > textarea { min-width: 0; }
.voice-field > .voice-btn { order: 2; justify-self: start; }
.voice-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 12px 5px 10px; border: 1.5px solid var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; line-height: 1.2; cursor: pointer; }
.voice-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.voice-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.voice-btn.compact { padding: 0; width: 34px; height: 34px; justify-content: center; }
.voice-btn.rec { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); animation: voice-ring 1.4s ease-out infinite; }
.voice-btn.busy { opacity: .85; cursor: progress; }
.voice-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: voice-blink 1s steps(2) infinite; }
.voice-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: voice-rot .8s linear infinite; }
@keyframes voice-ring { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes voice-blink { 50% { opacity: .2; } }
@keyframes voice-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .voice-btn.rec, .voice-dot, .voice-spin { animation: none; } }
.voice-order { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }
.voice-order table input { padding: 3px 6px; }
.voice-result section h3 { margin: 4px 0 6px; font-size: 14px; }
.voice-result section p { margin: 0 0 6px; }
.voice-result ul { margin: 0; padding-left: 18px; }
.voice-result .check { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.voice-transcript { white-space: pre-wrap; max-height: 40vh; overflow: auto; font-size: 13px; color: var(--muted, inherit); }
.voice-wait { padding: 12px 0; }
.task-chat-composer-foot .voice-btn { margin-left: auto; margin-right: 8px; }

/* Помощник Deep в чате команды */
.assist-av { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), #7a1fd1); }
.assist-av.big { width: 56px; height: 56px; font-size: 24px; border-radius: 16px; margin: 0 auto 8px; }
.team-room.assistant { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 6px; }
.team-room.assistant.on { background: var(--accent-soft); }
.assist { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.assist-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.assist-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.assist-empty { margin: auto; max-width: 460px; text-align: center; }
.assist-empty h3 { margin: 4px 0; }
.assist-hints { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.assist-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.assist-msg.user { justify-content: flex-end; }
.assist-msg .assist-av { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
.assist-bubble { max-width: min(560px, 85%); display: grid; gap: 8px; min-width: 0; }
.assist-msg.user .assist-bubble { background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 14px 14px 4px 14px; }
.assist-msg.assistant .assist-text { background: var(--surface-2, var(--surface)); padding: 8px 12px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; }
.assist-msg.user .assist-text { white-space: pre-wrap; }
.assist-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; }
.assist-card.done { border-color: color-mix(in srgb, #0f8a4f 45%, var(--line)); }
.assist-card.canceled { opacity: .6; }
.assist-card-head { display: flex; align-items: center; gap: 8px; }
.assist-card-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.assist-ok { margin-left: auto; color: #0f8a4f; font-weight: 600; font-size: 13px; }
.assist-card-body { display: grid; gap: 6px; }
.assist-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted, inherit); }
.assist-items { margin: 0; padding-left: 18px; }
.assist-err { color: var(--accent); }
.assist-typing { background: var(--surface-2, var(--surface)); padding: 8px 12px; border-radius: 14px; color: var(--muted, inherit); display: flex; align-items: center; gap: 3px; }
.assist-typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: voice-blink 1s infinite; }
.assist-typing i:nth-child(2) { animation-delay: .2s; } .assist-typing i:nth-child(3) { animation-delay: .4s; margin-right: 6px; }
.assist-composer { border-top: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 8px; }
.assist-composer-btns { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.assist-composer .voice-btn { padding: 8px 16px; font-size: 14px; }

/* Посадочная, «Возможности»: ровная сетка 3 / 2 / 1 колонки, карточки одной высоты в ряду, текст по одной линии */
#features .lp-sub { margin-bottom: 28px; }
#features .lp-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
@media (max-width: 1020px) { #features .lp-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { #features .lp-grid3 { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.lp-feature { display: flex; flex-direction: column; gap: 10px; padding: 24px; height: 100%; box-sizing: border-box; transition: border-color .15s, transform .15s; }
.lp-feature:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .lp-feature, .lp-feature:hover { transition: none; transform: none; } }
.lp-feature .lp-ico { margin: 0; height: 52px; }
.lp-feature h3 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; }
.lp-feature p { line-height: 1.55; font-size: 15px; }
.lp-feature .lp-tag { top: 20px; right: 20px; }

/* «Принять оплату»: крупные кнопки отправки клиенту */
.accept-send { display: flex; gap: 8px; flex-wrap: wrap; }
.accept-send > button { flex: 1 1 180px; padding: 11px 16px; font-size: 15px; }

.assist-found { padding: 7px 10px; border-radius: 8px; background: var(--surface-2, var(--accent-soft)); font-weight: 600; overflow-wrap: anywhere; }
.assist-paylink { display: grid; gap: 6px; }

/* Мобильная версия и Android-приложение: круглая кнопка помощника Deep над нижним меню */
.mobile-deep-fab { display: none; }
@media (max-width: 900px) {
  .mobile-deep-fab { display: grid; place-items: center; gap: 0; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    width: 62px; height: 62px; border-radius: 50%; border: 0; color: #fff; cursor: pointer; padding: 6px 0 4px;
    background: linear-gradient(135deg, var(--accent), #7a1fd1); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
  .mobile-deep-fab span { font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
  .mobile-deep-fab:active { transform: scale(.95); }
  body:has(.team-pop) .mobile-deep-fab, body:has(.modal) .mobile-deep-fab { display: none; }
}

/* Помощник на телефоне: ничего не шире экрана — подсказки переносят текст, блок приветствия сжимается */
.assist, .assist-msgs, .assist-composer { min-width: 0; max-width: 100%; }
.assist-msgs { overflow-x: hidden; }
.assist-empty { width: 100%; max-width: 460px; box-sizing: border-box; padding: 0 4px; overflow-wrap: anywhere; }
.assist-hints .chip-btn { white-space: normal; text-align: left; max-width: 100%; line-height: 1.3; }
@media (max-width: 640px) {
  .assist-hints { flex-direction: column; align-items: stretch; }
  .assist-hints .chip-btn { display: block; width: 100%; text-align: left; padding: 9px 14px; border-radius: 14px; }
}

/* Вышла новая версия — предложение обновить страницу */
.update-banner { position: fixed; left: 50%; transform: translateX(-50%); top: 12px; z-index: 70; display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 8px 24px rgb(0 0 0 / .25); max-width: calc(100vw - 24px); }
.update-banner span { font-weight: 600; }

/* «Знакомство с Deep» — квест при первом входе */
.onb { position: fixed; left: 20px; bottom: 20px; z-index: 55; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgb(0 0 0 / .25); padding: 14px; display: grid; gap: 10px; }
.onb-invite { grid-template-columns: auto 1fr; align-items: start; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.onb-body p, .onb-win p { margin: 4px 0 10px; color: var(--muted, inherit); font-size: 14px; line-height: 1.45; }
.onb-head { display: flex; align-items: center; gap: 8px; }
.onb-head .assist-av { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
.onb-stars { font-weight: 700; font-size: 13px; }
.onb-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.onb-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #7a1fd1); transition: width .4s; }
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.onb-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 10px; }
.onb-steps li.cur { background: var(--accent-soft); }
.onb-steps li.ok { opacity: .65; }
.onb-steps li p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; }
.onb-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 1.5px solid var(--accent); color: var(--accent); }
.onb-steps li.ok .onb-mark { background: var(--accent); color: #fff; }
.onb-skip { justify-self: start; }
.onb-pill { position: fixed; left: 20px; bottom: 20px; z-index: 55; border-radius: 999px; padding: 8px 14px; font-weight: 700; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); box-shadow: 0 6px 16px rgb(0 0 0 / .2); cursor: pointer; }
.onb-win { text-align: center; justify-items: center; border-color: var(--accent); }
.onb-trophy { font-size: 46px; animation: onb-pop .6s ease-out; }
@keyframes onb-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .onb-trophy { animation: none; } .onb-bar i { transition: none; } }
@media (max-width: 900px) {
  .onb, .onb-pill { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .onb { width: calc(100vw - 24px - 74px); max-height: 60vh; overflow: auto; }
  .onb-invite, .onb-win { width: calc(100vw - 24px); }
}
body:has(.team-pop) .onb, body:has(.team-pop) .onb-pill { display: none; }

/* Знакомство не перекрывает окна */
body:has(.modal) .onb, body:has(.modal) .onb-pill { display: none; }
/* Подсказки над полем ввода помощника — одной прокручиваемой строкой */
.assist-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 0; scrollbar-width: none; }
.assist-quick::-webkit-scrollbar { display: none; }
.assist-quick .chip-btn { white-space: nowrap; flex: none; }

/* Кабинет администратора: воронка «Знакомства с Deep» */
.onb-funnel { display: grid; gap: 8px; }
.onb-funnel-row { display: grid; grid-template-columns: 160px 1fr 48px; gap: 10px; align-items: center; }
.onb-funnel-row i { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #7a1fd1); min-width: 4px; }
.onb-funnel-row b { text-align: right; }
/* Оценка ответа помощника: незаметно, пока не наведёшь; выбранная оценка видна всегда */
.assist-rate { display: flex; gap: 2px; margin-top: -4px; }
.assist-rate button { background: none; border: 0; padding: 2px 6px; border-radius: 6px; font-size: 13px; line-height: 1; cursor: pointer; opacity: .35; filter: grayscale(1); }
.assist-msg:hover .assist-rate button, .assist-rate button:focus-visible { opacity: .75; }
.assist-rate button:hover { opacity: 1; background: var(--hover, rgba(0,0,0,.05)); }
.assist-rate button.on { opacity: 1; filter: none; }
@media (hover: none) { .assist-rate button { opacity: .6; } }
/* Утренняя сводка: выключена — приглушённое солнце */
.assist-digest:not(.on) { filter: grayscale(1); opacity: .55; }
/* ТСД: режимы, списки заданий, пошаговый отбор — крупно, под палец и сканер */
.tsd-modes{display:flex;width:100%}.tsd-modes button{flex:1;min-height:46px;font-size:15px}
.tsd-list{display:grid;gap:8px;margin-top:10px}.tsd-item-btn{display:grid;gap:4px;text-align:left;padding:14px 16px;min-height:64px;border-radius:12px;font-size:15px;background:var(--surface,#fff);border:1px solid var(--line)}
.tsd-step{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:grid;gap:4px;color:var(--muted)}.tsd-step b{color:var(--content);font-size:17px}
.tsd-step.now{border-color:var(--accent);background:var(--accent-soft)}.tsd-step.done{border-color:var(--ok);background:var(--ok-soft)}
.tsd-cell{font:800 clamp(30px,9vw,46px)/1.1 ui-monospace,Consolas,monospace;color:var(--content);letter-spacing:.02em}
.tsd-big{width:100%;min-height:56px;font-size:17px}.tsd-qty{font-size:24px;min-height:56px;text-align:center}
.tsd-item-btn{width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}.tsd-modes button{white-space:normal;line-height:1.2;padding:6px 8px}.tsd-shell,.tsd-card{min-width:0;max-width:100%}
.tsd-check{display:grid;place-items:center;padding:0 6px}.tsd-check input{width:24px;height:24px}.tsd-order{background:var(--accent);color:#fff;border-radius:10px;padding:8px 12px;font-weight:700}
#cases .lp-grid4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Посадочная: блок WMS — процесс склада одной лентой шагов */
.lp-wms-flow{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 18px}
.lp-wms-flow span{display:inline-flex;align-items:center;gap:8px;padding:8px 14px 8px 8px;border-radius:999px;background:var(--surface,#fff);border:1px solid var(--line);font-weight:600;font-size:14px}
.lp-wms-flow b{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--accent);color:#fff;font-size:12px}
.lp-wms h2{max-width:100%;overflow-wrap:anywhere;text-wrap:balance}
.tsd-big{white-space:normal;line-height:1.25;height:auto;padding-block:12px}

/* Режим ТСД: на экране только терминал */
body.tsd-mode aside.sidebar,body.tsd-mode .mobile-bar,body.tsd-mode .mobile-deep-fab,body.tsd-mode .mobile-bottom-nav,body.tsd-mode .admin-company-context,
body.tsd-mode .topbar,body.tsd-mode .workspace-tabs,body.tsd-mode .page-head,body.tsd-mode .prod-tabs{display:none!important}
body.tsd-mode .layout{display:block!important;grid-template-columns:none!important}
body.tsd-mode main.main{margin:0!important;padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px))!important;max-width:none!important;min-height:100vh}
.tsd-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;font-size:14px;color:var(--muted)}.tsd-bar b{color:var(--content)}
/* Шапка помощника на узком экране: заголовок сжимается с многоточием, кнопки не обрезаются */
.assist-head .grow { min-width: 0; }
.assist-head .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assist-head > button { flex: none; white-space: nowrap; }
@media (max-width: 600px) { .assist-head { gap: 6px; padding: 8px 10px; } .assist-head .grow .small { display: none; } }

/* Плашка связи: нет интернета / ждут отправки / не отправлено */
.offline-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 950;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 7px 8px 7px 14px; border-radius: 999px;
  background: var(--surface, #fff); color: var(--content, #1f2633); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px; }
.offline-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offline-bar.off { background: #1f2633; color: #fff; border-color: #1f2633; }
.offline-bar.bad { border-color: var(--danger, #d33); }
.offline-bar button { flex: none; }
@media (min-width: 901px) { .offline-bar { bottom: 18px; } }
body.tsd-mode .offline-bar { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

/* Сканирование камерой: панель внизу экрана, поверх окон, но не окно — код уходит в поле под ней */
.cam-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000; background: #111; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
.cam-panel video { display: block; width: 100%; max-height: 42vh; object-fit: cover; border-radius: 10px; background: #000; }
.cam-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: #fff; }
.cam-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-btn { flex: none; }
/* Экран «Моё»: рабочее место роли — крупные плитки главных действий */
.my-page { max-width: 900px; }
.my-head h1 { margin: 2px 0 2px; font-size: clamp(22px, 5vw, 30px); }
.my-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.my-tile { display: grid; gap: 4px; align-content: start; padding: 16px; min-height: 112px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); color: var(--content); text-decoration: none; transition: border-color .15s, transform .15s; }
.my-tile:hover, .my-tile:focus-visible { border-color: var(--primary, #bb080b); transform: translateY(-1px); }
.my-tile b { font-size: 17px; }
.my-tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2, #f3f4f6); color: var(--primary, #bb080b); margin-bottom: 4px; }
@media (max-width: 600px) { .my-tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .my-tile { min-height: 104px; padding: 14px 12px; } .my-tile b { font-size: 15px; } }
/* Телефон: таблица прямо в карточке (без .table-wrap) прокручивается внутри карточки, а не выходит за экран */
@media (max-width: 900px) { .card.flush { overflow-x: auto; } .card.flush > table { min-width: 100%; } .label-builder > *, .label-builder .row > * { min-width: 0; } }

/* Пустой экран: что делать дальше */
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; background: var(--surface-2, #f3f4f6); color: var(--muted); }
.empty-actions { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* Сообщения: поверх окон и камеры; ошибка закрывается касанием */
.toast { z-index: 4000; cursor: pointer; }
.toast.error { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.toast-x { margin-left: auto; font-size: 18px; line-height: 1; opacity: .8; }
@media (max-width: 900px) { .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); max-width: none; } body.tsd-mode .toast { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } }

/* «Что здесь делать?» — статья справки сбоку, поверх экрана */
.help-drawer-backdrop { position: fixed; inset: 0; z-index: 900; background: rgb(0 0 0 / .25); border: 0; padding: 0; cursor: default; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 901; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface, #fff); box-shadow: -10px 0 40px rgb(0 0 0 / .2); }
.help-drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.help-drawer-head b { flex: 1; font-size: 16px; }
.help-drawer-body { flex: 1; overflow-y: auto; padding: 4px 18px 16px; }
.help-drawer-body img { max-width: 100%; height: auto; }
.help-drawer-foot { display: flex; align-items: center; gap: 14px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
/* «⤓ Excel» у таблицы под курсором */
.table-export-btn { position: fixed; z-index: 30; padding: 3px 9px; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--content); box-shadow: 0 2px 8px rgb(0 0 0 / .12); cursor: pointer; opacity: .92; }
.table-export-btn:hover { opacity: 1; border-color: var(--primary, #bb080b); }
/* Подборки фильтров */
.saved-views { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; }
.saved-view { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #fff); overflow: hidden; }
.saved-view > button { border: 0; background: none; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--content); }
.saved-view .saved-view-x { padding: 4px 8px 4px 2px; color: var(--muted); }
.saved-view.on { border-color: var(--primary, #bb080b); background: var(--accent-soft, #fdecec); }

.toast-action { margin-left: 14px; border: 0; background: rgb(255 255 255 / .18); color: inherit; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; }

/* Карточка сбоку: список виден и не теряет место; на телефоне — как обычное окно */
@media (min-width: 901px) {
  .overlay:has(> .modal.side) { place-items: stretch end; padding: 0; background: rgb(0 0 0 / .12); }
  .modal.side { width: min(600px, 100vw); max-width: none; height: 100vh; max-height: 100vh; border-radius: 0; display: flex; flex-direction: column; overflow-y: auto; animation: side-in .15s ease-out; }
  @keyframes side-in { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.card-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* Оформление: компактные таблицы и повышенная контрастность */
.ui-compact td, .ui-compact th { padding-top: 5px !important; padding-bottom: 5px !important; }
.ui-compact .card { padding: 12px; }
.ui-compact .card.flush { padding: 0; }
.ui-contrast { --line: #9a9ca3; --muted: #2f3136; --faint: #3c3e44; --content: #111214; }
.ui-contrast[data-theme="dark"] { --line: #6b6d75; --muted: #e2e3e7; --faint: #c9cad0; --content: #ffffff; }
@media (prefers-color-scheme: dark) { .ui-contrast:not([data-theme="light"]) { --line: #6b6d75; --muted: #e2e3e7; --faint: #c9cad0; --content: #ffffff; } }
.ui-contrast :focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px; }

.doc-preview-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; color: var(--muted); }
tr.selected > td { background: var(--accent-soft); }

/* Подложка за интерфейсом и «стекло» поверх неё */
html.ui-backdrop body { background: var(--app-backdrop); background-attachment: fixed; }
html.ui-backdrop .sidebar { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-right-color: color-mix(in srgb, var(--line) 55%, transparent); }
html.ui-backdrop .mobile-bar, html.ui-backdrop .mobile-bottom-nav { background: color-mix(in srgb, var(--surface) 74%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
html.ui-backdrop .card { background: color-mix(in srgb, var(--surface) 88%, transparent); border-color: color-mix(in srgb, var(--line) 70%, transparent); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 30px rgb(0 0 0 / .06); }
html.ui-backdrop .modal, html.ui-backdrop .help-drawer { background: var(--surface); }

/* Страница «Оформление» */
.appearance h2 { font-size: 17px; margin: 22px 0 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.theme-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 10px 10px 12px; white-space: normal; text-align: left; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--content); transition: transform .15s, border-color .15s, box-shadow .15s; }
.theme-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(0 0 0 / .10); background: var(--surface); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card b { margin-top: 6px; font-size: 15px; }
.theme-card .small { line-height: 1.3; overflow-wrap: anywhere; }
.theme-preview { display: flex; width: 100%; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid rgb(0 0 0 / .08); }
.tp-side { width: 24%; display: flex; flex-direction: column; gap: 5px; padding: 8px 6px; background: rgb(255 255 255 / .6); backdrop-filter: blur(6px); border-right: 1px solid rgb(0 0 0 / .06); }
.theme-preview.dark .tp-side { background: rgb(20 22 28 / .55); border-color: rgb(255 255 255 / .06); }
.tp-dot { width: 12px; height: 12px; border-radius: 4px; margin-bottom: 3px; }
.tp-item { height: 5px; border-radius: 3px; background: rgb(0 0 0 / .12); }
.theme-preview.dark .tp-item { background: rgb(255 255 255 / .16); }
.tp-main { flex: 1; padding: 10px; display: flex; align-items: flex-start; }
.tp-card { flex: 1; display: grid; gap: 6px; padding: 8px; border-radius: 7px; background: rgb(255 255 255 / .85); box-shadow: 0 2px 8px rgb(0 0 0 / .08); }
.theme-preview.dark .tp-card { background: rgb(31 32 37 / .85); }
.tp-bar { height: 7px; width: 48%; border-radius: 4px; }
.tp-line { height: 5px; border-radius: 3px; background: rgb(0 0 0 / .12); }
.tp-line.short { width: 62%; }
.theme-preview.dark .tp-line { background: rgb(255 255 255 / .16); }
.tp-btn { height: 12px; width: 40%; border-radius: 4px; justify-self: end; }
.appearance-own { max-width: 760px; }
.backdrop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.backdrop-chip { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px 4px 6px; white-space: normal; text-align: center; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.backdrop-chip.on { border-color: var(--accent); }
.backdrop-swatch { display: block; height: 46px; border-radius: 7px; border: 1px solid rgb(0 0 0 / .06); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--surface); outline: 3px solid var(--content); }
.swatch.brand, .swatch.custom { width: auto; height: 30px; border-radius: 15px; padding: 0 10px; background: var(--surface-2); color: var(--content); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.swatch.custom input { width: 22px; height: 22px; padding: 0; border: 0; background: none; }

/* Своя картинка-подложка: размытие — отдельным слоем позади интерфейса */
html.ui-backdrop-blur { background: var(--app); }
html.ui-backdrop-blur body { background: transparent; }
html.ui-backdrop-blur body::before { content: ''; position: fixed; inset: -30px; z-index: -1; background: var(--app-backdrop); filter: blur(16px); }
.backdrop-swatch.own { display: grid; place-items: center; font-size: 22px; color: var(--muted); background: var(--surface-2); }

/* Низ меню: «Выйти», оформление и тема — в одну строку */
.sidebar-foot .row { flex-wrap: nowrap; }
.sidebar-foot .theme-toggle { flex: none; padding: 6px 8px; }

/* Избранное и недавние */
.fav-star { border: 0; background: none; padding: 2px 4px; font-size: 20px; line-height: 1; color: var(--faint); cursor: pointer; }
.fav-star.on, .fav-star:hover { color: #e6a700; background: none; }
.pin-link { display: flex !important; align-items: center; gap: 8px; min-width: 0; }
.pin-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-x { border: 0; background: none; padding: 0 4px; color: var(--faint); opacity: 0; }
.pin-link:hover .pin-x { opacity: 1; }

/* Шпаргалка горячих клавиш */
.hotkeys td { padding: 6px 10px 6px 0; vertical-align: top; }
kbd { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font: 600 12px/1.4 ui-monospace, Consolas, monospace; white-space: nowrap; }

/* История изменений */
.history { margin-top: 12px; }
.history-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.history-list li { padding: 6px 10px; border-left: 3px solid var(--line); }

/* Массовые действия */
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
td.pick, th.pick { width: 34px; text-align: center; }

/* Длинные списки на компьютере: заголовок таблицы не уезжает */
@media (min-width: 901px) { main .card.flush > .table-wrap { max-height: calc(100vh - 170px); overflow: auto; } main .card.flush > .table-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); } }
/* «Σ Итоги» */
.table-totals { position: fixed; z-index: 31; width: 280px; max-height: 60vh; overflow: auto; display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--content); box-shadow: 0 10px 30px rgb(0 0 0 / .18); font-size: 13px; }
.table-totals > div { display: flex; justify-content: space-between; gap: 10px; }

/* Сводка из настраиваемых блоков */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-full { grid-column: 1 / -1; min-width: 0; }
.dash-half { min-width: 0; }
.dash-grid > div > .card, .dash-grid > div > .grid { margin-bottom: 0 !important; }
.dash-half > .card { height: 100%; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-half { grid-column: 1 / -1; } }
.dash-settings { display: grid; gap: 6px; }

.peek-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.peek-list li { padding: 6px 10px; border-left: 3px solid var(--line); }

/* Сводка из настраиваемых блоков */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-full { grid-column: 1 / -1; min-width: 0; }
.dash-half { min-width: 0; }
.dash-grid > div > .card, .dash-grid > div > .grid { margin-bottom: 0 !important; }
.dash-half > .card { height: 100%; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-half { grid-column: 1 / -1; } }
.dash-settings { display: grid; gap: 6px; }

.peek-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.peek-list li { padding: 6px 10px; border-left: 3px solid var(--line); }

/* Workspace usability: colors inherit the user-selected theme. */
.nav-search{position:relative;margin:10px 0 12px}.nav-search input{width:100%;min-width:0;padding-right:32px;font-size:13px}.nav-search button{position:absolute;right:4px;top:4px;border:0;background:transparent;padding:3px 7px}.nav-search-empty{padding:10px;color:var(--muted);font-size:13px}.nav-group .grip{opacity:0}.nav-group:hover .grip,.nav-group:focus-visible .grip{opacity:.65}
.sidebar nav a{min-height:36px}.sidebar .nav-group{min-height:34px}.sidebar .nav-block{margin-top:8px}
.stores-overview{grid-template-columns:minmax(0,1fr)}.stores-overview .store-map{height:320px}.stores-overview table{width:100%;font-size:13px}.stores-overview th{white-space:nowrap}.stores-overview td:first-child{min-width:200px}.stores-overview td:last-child{min-width:250px}.stores-overview td{padding-top:14px;padding-bottom:14px}.stores-overview .num{white-space:nowrap}.stores-overview td:last-child>div+div{margin-top:5px}
.product-filters{background:var(--surface);border:1px solid var(--line);padding:12px;border-radius:var(--radius)}.product-filters .product-search{flex:1 1 100%;width:100%;min-width:0}.products-layout{grid-template-columns:220px minmax(0,1fr)}.products-layout.no-tree{grid-template-columns:minmax(0,1fr)}
.mobile-stage-select{display:none}.kanban{scrollbar-gutter:stable;scroll-snap-type:x proximity}.kb-col{scroll-snap-align:start}.kb-card{box-shadow:0 1px 3px rgb(0 0 0/.06)}.kb-card-title{line-height:1.4}.kb-field{line-height:1.45}.kb-card-foot{row-gap:6px}
@media(min-width:901px){.onb,.onb-pill{left:auto;right:24px;bottom:24px}.onb{max-height:70vh;overflow:auto}}
@media(max-width:640px){.page-head{gap:8px;margin-bottom:14px}.page-head h1{flex:1 1 100%;margin-bottom:4px}.page-head>button,.page-head>.btn{padding:8px 10px;font-size:13px}.crm-bar input[type=search]{flex:1 1 100%;width:100%;max-width:none!important}.crm-bar{gap:6px}.mobile-stage-select{display:grid;gap:6px;margin:12px 0;font-size:13px;color:var(--muted)}.mobile-stage-select select{width:100%}.kanban{min-height:0}.kb-col{flex-basis:calc(100vw - 40px)}.kb-col.mobile-stage-hidden{display:none}.kanban:has(.mobile-stage-hidden){display:block}.kanban:has(.mobile-stage-hidden)>.kb-col:not(.mobile-stage-hidden){width:100%}.products-layout{grid-template-columns:minmax(0,1fr)}.product-filters{gap:10px}.product-filters .check{white-space:normal}.stores-overview td:first-child{min-width:170px}.stores-overview td:last-child{min-width:240px}.stores-overview .store-map{height:260px}.onb{max-height:60vh;overflow:auto;bottom:calc(80px + env(safe-area-inset-bottom))}}
@media(max-width:640px){.page-head h1{flex:0 1 auto;margin-bottom:0}.page-head>.spacer{flex:1 0 100%;height:0}.page-head>.fav-star{margin-left:auto}.page-head>button.primary{margin-left:auto}}
/* Cards and daily work: theme variables, no fixed brand colors. */
.product-card-section[hidden],.product-card section[hidden]{display:none!important}.product-card-tabs{position:sticky;top:0;z-index:3;padding:10px 0;background:var(--surface);margin-bottom:12px;overflow-x:auto;flex-wrap:nowrap}.product-card-tabs button{white-space:nowrap}.product-card .modal-foot{position:sticky;bottom:-20px;z-index:4;background:var(--surface);padding:12px 0;border-top:1px solid var(--line);flex-wrap:wrap}.card-save-state{font-size:12px;color:var(--muted);flex:1;align-self:center}.card-inline-error{padding:12px;border:1px solid var(--accent);border-radius:var(--radius);background:var(--accent-soft);margin:8px 0;overflow-wrap:anywhere}.product-bulk{position:sticky;top:10px;z-index:6;padding:12px!important;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);gap:10px}.product-bulk select{flex:1;max-width:300px}.product-quick-filters{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.product-quick-filters button{font-size:13px}.product-quick-filters .on{border-color:var(--accent);background:var(--accent-soft);color:var(--content)}
.product-table-scroll{max-height:65vh;overflow:auto;scrollbar-gutter:stable}.product-table{border-collapse:separate;border-spacing:0}.product-table thead th{position:sticky;top:0;z-index:3;background:var(--surface);box-shadow:0 1px 0 var(--line)}.product-table tr:not(.folder-row):not(.group-row)>:first-child{position:sticky;left:0;z-index:2;background:var(--surface);width:32px;min-width:32px}.product-table .product-name-column{position:sticky;left:32px;z-index:2;background:var(--surface);min-width:200px;max-width:260px;box-shadow:2px 0 0 var(--line)}.product-table thead .product-name-column,.product-table thead tr>:first-child{z-index:5}.product-table tr.selected td{background:var(--accent-soft)}
.deal-action-header{position:sticky;top:0;z-index:9;background:var(--app);padding:10px 0}.deal-action-header .page-head{margin-bottom:0}.deal-save-bar{position:sticky;top:100px;z-index:8;display:flex;align-items:center;gap:8px;margin:12px 0;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.deal-save-bar>span{flex:1;color:var(--muted);font-size:13px}.kb-task-button{align-self:flex-start;padding:4px 8px;font-size:12px;margin-top:6px;background:var(--surface);color:var(--content)}.kb-next-task{font-size:12px}.overdue-task{color:var(--warn);font-weight:600}.attention-card h2{flex:1;margin:0}.attention-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;margin-top:12px}.attention-items>a{display:grid;gap:7px;padding:12px;border:1px solid var(--line);border-radius:var(--radius);color:var(--content);text-decoration:none}.attention-items>a:hover{background:var(--surface-2)}.attention-items>a>span{font-size:13px;color:var(--muted)}
@media(max-width:640px){.product-table-scroll{max-height:none;overflow:visible}.product-table,.product-table tbody{display:block}.product-table thead{display:none}.product-table tbody{display:grid;gap:12px}.product-table tr:not(.folder-row):not(.group-row){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:14px;border:1px solid var(--line);border-radius:var(--radius);position:relative;background:var(--surface)}.product-table tr:not(.folder-row):not(.group-row)>td{position:static;min-width:0;max-width:none;width:auto;border:0;padding:0;background:transparent;text-align:left;overflow-wrap:anywhere;white-space:normal;box-shadow:none}.product-table tr:not(.folder-row):not(.group-row)>td:first-child{position:absolute;left:auto;right:12px;top:12px;min-width:0;width:auto}.product-table .product-name-column{grid-column:1/-1;font-weight:600;padding-right:30px!important;font-size:15px}.product-table td[data-label]:not(.product-name-column):before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;margin-bottom:3px}.product-table .folder-row,.product-table .group-row{display:block}.product-table .folder-row td,.product-table .group-row td{display:inline-block;border:0;padding:10px}.product-bulk{top:62px;flex-wrap:wrap}.product-bulk select{max-width:none;width:100%;flex:1 1 100%}.deal-action-header{position:static}.deal-save-bar{top:62px;flex-wrap:wrap}.deal-save-bar>span{flex-basis:100%}.product-card .modal-foot{bottom:0}.card-save-state{flex-basis:100%;order:-1}.attention-items{grid-template-columns:minmax(0,1fr)}}
.product-table input[type=checkbox]{width:18px!important;height:18px!important;min-height:0;vertical-align:middle}.deal-action-header .deal-save-bar{position:static;margin-bottom:0}.deal-additional summary{cursor:pointer;font-weight:600;padding:10px 0}.deal-additional[open]>.form{padding-top:8px}
@media(max-width:640px){.deal-action-header .deal-save-bar{position:fixed;left:10px;right:10px;top:auto;bottom:calc(74px + env(safe-area-inset-bottom));z-index:20;margin:0}.main:has(.deal-save-bar){padding-bottom:200px}.deal-save-bar>span{flex-basis:auto}.deal-save-bar button{font-size:13px;padding:8px 10px}}
.product-form-fields,.deal-form-fields{border:0;padding:0;margin:0;min-width:0}.product-form-fields{display:grid;gap:12px}
@media(max-width:640px){body:has(.deal-save-bar) .mobile-deep-fab{display:none}.deal-save-bar>span{flex-basis:100%}.deal-save-bar{justify-content:flex-end}}
.money-intro{max-width:900px}.money-filters{display:flex;gap:10px;flex-wrap:wrap;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:18px}.money-filters input{flex:1 1 300px}.money-filters select{width:auto;max-width:100%}.money-kpi{margin-bottom:16px}.money-notice{padding:12px;background:var(--warn-soft);border-radius:var(--radius)}.money-table th{white-space:nowrap}.money-table td{vertical-align:top}.money-table td:first-child{min-width:230px}.money-table td.num{white-space:nowrap}.money-table-wrap{max-height:65vh;overflow:auto}.money-table th{position:sticky;top:0;z-index:2;background:var(--surface)}.money-detail-summary{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}.money-detail-summary>div{flex:1;min-width:130px;display:grid;gap:6px;padding:12px;background:var(--surface-2);border-radius:var(--radius)}.money-detail-summary span{font-size:12px;color:var(--muted)}.money-detail-summary b{font-size:20px}.money-section{border:1px solid var(--line);border-radius:var(--radius);padding:14px;margin:14px 0;min-width:0;display:grid;gap:12px}.money-section h3,.money-section p{margin:0}.money-section .check{align-items:flex-start;white-space:normal}.money-section .check input{flex:none;margin-top:3px}.money-payment-list{display:grid;gap:10px}.money-payment-list article{border-bottom:1px solid var(--line);padding:10px 0}.money-payment-list .voided{color:var(--muted)}.money-payment-list .row{gap:10px;flex-wrap:wrap}.money-detail .modal-foot{position:sticky;bottom:-20px;z-index:3;background:var(--surface);padding:12px 0;border-top:1px solid var(--line);flex-wrap:wrap}.money-loading{padding:24px;color:var(--muted)}
.deal-document-flow{background:var(--surface);border:1px solid var(--line);padding:16px;border-radius:var(--radius);margin-bottom:16px}.deal-document-flow ol{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.deal-document-flow li{border:1px solid var(--line);border-radius:var(--radius);padding:12px;display:grid;gap:8px;font-size:13px}.deal-document-flow li>span{color:var(--muted)}.deal-document-flow li.complete{border-color:var(--ok);background:var(--ok-soft)}.deal-document-flow>.row{gap:10px;flex-wrap:wrap;margin-top:12px}.deal-document-flow p{flex:1;margin:0;min-width:200px}.deal-flow-error{padding:12px;border:1px solid var(--line);margin-bottom:16px}
@media(max-width:640px){.money-filters input,.money-filters select{width:100%;flex:1 1 100%}.money-table-wrap{max-height:none;overflow:visible}.money-table,.money-table tbody{display:block}.money-table thead{display:none}.money-table tbody{display:grid;gap:12px;padding:12px}.money-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:1px solid var(--line);border-radius:var(--radius);padding:12px}.money-table td{display:block;border:0;padding:0;min-width:0!important;white-space:normal!important;text-align:left!important;overflow-wrap:anywhere}.money-table td:first-child,.money-table td:last-child{grid-column:1/-1}.money-table td[data-label]:not(:first-child):before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;margin-bottom:4px}.money-table td:last-child button{width:100%}.deal-document-flow ol{grid-template-columns:repeat(2,minmax(0,1fr))}.money-detail .modal-foot{bottom:0}}
.deal-doc-register{display:grid;gap:12px;margin-top:14px}.deal-doc-register article{display:grid;gap:8px;border:1px solid var(--line);border-radius:var(--radius);padding:12px;min-width:0}.deal-doc-register-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.deal-doc-register-head .link{text-align:left;font-weight:600;white-space:normal}.deal-doc-register-head b{white-space:nowrap}.deal-doc-actions{display:flex;gap:8px;flex-wrap:wrap}.deal-doc-actions .ghost{display:inline-flex;align-items:center;padding:6px 8px;border:1px solid var(--line);border-radius:6px}.money-detail .modal-foot{gap:8px}
@media(max-width:640px){.money-detail .modal-foot>*{flex:1 1 auto}.money-detail~.toast{bottom:auto;top:70px}}
.money-success{padding:10px 12px;border:1px solid var(--ok);background:var(--ok-soft);border-radius:var(--radius);font-size:13px}

/* Единый вход DEEP: соседние приложения в подвале меню */
.deep-apps { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.deep-apps a { color: var(--muted); text-decoration: none; }
.deep-apps a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Персонаж помощника Deep (web/src/mascot.tsx + mascot-faces.ts; те же стили в deep чат) ---------- */
.dm { display: inline-grid; place-items: center; width: var(--dm-size, 40px); height: var(--dm-size, 40px); flex: none; line-height: 0; }
.dm svg { display: block; overflow: visible; }
.dm-click { cursor: pointer; }
.dm-body, .dm-eyes, .dm-mouth, .dm-extra { transform-box: fill-box; transform-origin: center; }
.dm-gray { filter: grayscale(.85); opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .dm-idle .dm-body, .dm-wave .dm-body, .dm-cool .dm-body { animation: dm-float 3.2s ease-in-out infinite; }
  .dm-idle .dm-eyes, .dm-talking .dm-eyes, .dm-wave .dm-eyes, .dm-thinking .dm-eyes { animation: dm-blink 4.6s infinite; }
  .dm-thinking .dm-body { animation: dm-float 1.6s ease-in-out infinite; }
  .dm-thinking .dm-extra { animation: dm-rise 1.8s ease-in infinite; }
  .dm-talking .dm-body { animation: dm-nod .55s ease-in-out infinite; }
  .dm-talking .dm-mouth { animation: dm-talk .28s ease-in-out infinite alternate; }
  .dm-happy .dm-body, .dm-thumbs .dm-body { animation: dm-hop .9s ease-out infinite; }
  .dm-thumbs .dm-extra { animation: dm-pop .9s ease-out infinite; }
  .dm-party .dm-body { animation: dm-hop .6s ease-out infinite; }
  .dm-party .dm-extra { animation: dm-twinkle .8s steps(2) infinite; }
  .dm-love .dm-body { animation: dm-float 2s ease-in-out infinite; }
  .dm-love .dm-extra { animation: dm-beat .9s ease-in-out infinite; }
  .dm-wave .dm-extra { animation: dm-wave .7s ease-in-out infinite; transform-origin: 30% 80%; }
  .dm-wink .dm-body { animation: dm-tilt 1.6s ease-in-out infinite; }
  .dm-wink .dm-extra, .dm-cool .dm-extra { animation: dm-twinkle 1.2s steps(2) infinite; }
  .dm-surprised .dm-body { animation: dm-jolt .5s ease-out 1; }
  .dm-surprised .dm-extra { animation: dm-pop .6s ease-out infinite alternate; }
  .dm-sleepy .dm-body { animation: dm-float 4.5s ease-in-out infinite; }
  .dm-sleepy .dm-extra { animation: dm-drift 3s ease-in-out infinite; }
  .dm-confused .dm-body { animation: dm-tilt 2.2s ease-in-out infinite; }
  .dm-confused .dm-extra { animation: dm-pop 1.2s ease-in-out infinite alternate; }
  .dm-oops .dm-body { animation: dm-shiver .25s linear 4; }
  .dm-oops .dm-extra { animation: dm-drip 1.4s ease-in infinite; }
  .dm-sad .dm-body { animation: dm-float 4s ease-in-out infinite; }
  .dm-angry .dm-body { animation: dm-shiver .18s linear infinite; }
  .dm-bored .dm-body { animation: dm-sway 4.2s ease-in-out infinite; }
  .dm-bored .dm-eyes { animation: dm-lookslow 6s ease-in-out infinite; }
  .dm-bored .dm-mouth { animation: dm-yawn 7s ease-in-out infinite; }
  .dm-bored .dm-extra { animation: dm-dots 2.4s ease-in-out infinite; }
  .dm-mail .dm-body { animation: dm-hop .7s ease-out infinite; }
  .dm-mail .dm-extra { animation: dm-wiggle .45s ease-in-out infinite; }
  /* Касса и ТСД: сканирование важнее анимации */
  body.tsd-mode .dm *, .pos .dm * { animation: none !important; }
}
@keyframes dm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes dm-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes dm-rise { 0% { opacity: 0; transform: translateY(5px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes dm-nod { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-.6px); } }
@keyframes dm-talk { from { transform: scaleY(.6); } to { transform: scaleY(1.5); } }
@keyframes dm-hop { 0%, 60%, 100% { transform: translateY(0); } 25% { transform: translateY(-5px); } }
@keyframes dm-pop { from { transform: scale(.85); } to { transform: scale(1.12); } }
@keyframes dm-twinkle { 0% { opacity: 1; } 100% { opacity: .35; } }
@keyframes dm-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.18); } }
@keyframes dm-wave { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(14deg); } }
@keyframes dm-tilt { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes dm-jolt { 0% { transform: scale(1); } 30% { transform: scale(1.12) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes dm-drift { 0% { opacity: .2; transform: translate(-2px, 4px); } 50% { opacity: 1; } 100% { opacity: .2; transform: translate(3px, -5px); } }
@keyframes dm-shiver { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }
@keyframes dm-drip { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(6px); opacity: 0; } }

/* Кнопка помощника справа внизу (ПК и браузер; на телефоне — .mobile-deep-fab) и его окно поверх экранов */
.deep-fab { position: fixed; right: 18px; bottom: 18px; z-index: 3500; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); box-shadow: 0 6px 22px rgb(0 0 0 / .28); display: grid; place-items: center; cursor: pointer; transition: transform .15s; }
.deep-fab:hover { transform: scale(1.07); }
.deep-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.deep-fab-tip { position: absolute; right: 72px; bottom: 50%; transform: translateY(50%); white-space: nowrap; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; font-size: 13px; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .15s; }
.deep-fab:hover .deep-fab-tip { opacity: 1; }
.deep-pop { position: fixed; right: 18px; bottom: 92px; z-index: 3500; width: min(420px, calc(100vw - 36px)); height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgb(0 0 0 / .32); overflow: hidden; }
.deep-pop > .assist { flex: 1; min-height: 0; }
.deep-pop-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
@media (max-width: 900px) { .deep-fab, .deep-pop { display: none; } }
/* Сообщения и уведомления — над кнопкой помощника */
@media (min-width: 901px) { .toast { bottom: 96px; } .notices { bottom: 96px; } }
/* Персонаж вместо буквы «D» в аватаре помощника */
.assist-av.dm-av { background: none !important; padding: 0; border: 0; box-shadow: none; width: auto; height: auto; }
.dm-av-big { display: flex; justify-content: center; margin: 0 auto 8px; }

.nav-group-row{display:flex;align-items:center}.nav-group-row .nav-group{flex:1;min-width:0}.nav-group-grip{padding:5px 7px;border:0;background:transparent;color:var(--muted);cursor:grab}.nav-group-grip:active{cursor:grabbing}.nav-block.drop{border-top:3px solid var(--accent)}@media(pointer:coarse){.nav-group-grip{display:none}}

/* Кнопка помощника «живая»: волна вокруг, подскок-напоминание раз в несколько секунд, покачивание при наведении */
.deep-fab, .mobile-deep-fab { isolation: isolate; }
.deep-fab::before, .mobile-deep-fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: -1; background: color-mix(in srgb, var(--accent) 55%, transparent); }
@media (max-width: 900px) { .mobile-deep-fab { background: var(--surface); padding: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .deep-fab::before, .mobile-deep-fab::before { animation: deep-ring 2.6s ease-out infinite; }
  .deep-fab:not([aria-expanded="true"]), .mobile-deep-fab { animation: deep-call 7s ease-in-out infinite; }
  .deep-fab:hover { animation: deep-wobble .6s ease-in-out; }
  .deep-fab[aria-expanded="true"]::before { animation: none; opacity: 0; }
}
@keyframes deep-ring { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(1.55); opacity: 0; } }
@keyframes deep-call { 0%, 86%, 100% { transform: translateY(0) rotate(0); } 89% { transform: translateY(-7px) rotate(-6deg); } 92% { transform: translateY(0) rotate(5deg); } 95% { transform: translateY(-3px) rotate(0); } }
@keyframes deep-wobble { 0%, 100% { transform: scale(1.07) rotate(0); } 25% { transform: scale(1.07) rotate(-8deg); } 75% { transform: scale(1.07) rotate(8deg); } }

/* Уведомления через помощника: счётчик на кнопке, облачка у персонажа, вкладка в окне */
.deep-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e3262f; color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.deep-fab.has-unread::before { background: color-mix(in srgb, #e3262f 60%, transparent); }
.deep-says { position: fixed; right: 18px; bottom: 96px; z-index: 3500; display: flex; flex-direction: column; gap: 8px; width: min(320px, calc(100vw - 36px)); align-items: flex-end; }
.deep-say { position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; padding: 10px 30px 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; box-shadow: 0 8px 26px rgb(0 0 0 / .22); cursor: pointer; font-size: 13px; line-height: 1.35; }
.deep-say b { font-size: 13.5px; }
.deep-say span { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.deep-say:last-child::after { content: ''; position: absolute; right: 26px; bottom: -7px; width: 12px; height: 12px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.deep-say-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.deep-pop-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 44px 0 10px; border-bottom: 1px solid var(--line); }
.deep-pop-tabs [role="tab"] { border: 0; background: none; padding: 8px 10px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.deep-pop-tabs [role="tab"].on { color: var(--text); border-bottom-color: var(--accent); }
.deep-pop-count { background: #e3262f; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 18px; }
.deep-pop-notices { flex: 1; min-height: 0; overflow: auto; }
.deep-pop-notices .notify-pop { position: static; width: auto; max-height: none; box-shadow: none; border: 0; border-radius: 0; }
@media (prefers-reduced-motion: no-preference) {
  .deep-fab.has-unread::before { animation-duration: 1.4s; }
  .deep-say { animation: deep-say-in .35s cubic-bezier(.2, 1.4, .4, 1); transform-origin: 90% 100%; }
}
@keyframes deep-say-in { from { opacity: 0; transform: translateY(8px) scale(.85); } to { opacity: 1; transform: none; } }


/* Стикеры Deep в чате команды */
.dcm-sticker .dm { pointer-events: none; }
.deep-stickers { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 60; width: min(360px, 86vw); max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.deep-stickers button { padding: 4px; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.deep-stickers button:hover, .deep-stickers button:focus-visible { background: var(--surface-2); }
.deep-stickers img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
@keyframes dm-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes dm-lookslow { 0%, 20% { transform: translateX(-1.8px); } 45%, 65% { transform: translateX(1.8px); } 85%, 100% { transform: translateX(-1.8px); } }
@keyframes dm-yawn { 0%, 78%, 100% { transform: scale(1); } 84%, 92% { transform: scale(1.3, 3.2); } }
@keyframes dm-dots { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes dm-wiggle { 0%, 100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(10deg) scale(1.12); } }
/* «Поделиться в Учёт» из других приложений телефона */
.share-card { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.share-where { display: flex; gap: 6px; flex-wrap: wrap; }
.share-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.share-files li { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line, #8883); border-radius: 10px; }
.share-files img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.share-file-ic { width: 48px; text-align: center; font-size: 26px; }

@media(max-width:900px){.deal-layout.order-focus .deal-main{order:-1}.deal-layout.order-focus .deal-side{order:1}}
.assist-support { margin-top: 8px; font-weight: 600; }
/* Коробочная версия: вход и первый запуск без посадочной страницы */
.box-start { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg, #f4f5f8); }
.box-start-in { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.box-start-logo { font-size: 28px; letter-spacing: -.02em; text-align: center; }
.box-start-logo b { color: var(--accent, #e3262f); }
/* Лицензия коробочной версии */
.license-card { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.license-card h3 { margin: 0; }
.license-dl { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 6px 14px; margin: 0; }
.license-dl dt { color: var(--muted, #6b7280); }
.license-dl dd { margin: 0; }
.license-warn { color: #b45309; }
.license-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* Коробка: обновления и копии */
.box-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.box-card h3 { margin: 0; }
.box-task { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; border-left: 4px solid #eda100; }
.box-task.done { border-left-color: #1baf7a; }
.box-task.error { border-left-color: #e34948; }
.box-task pre { margin: 6px 0 0; white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow: auto; }
.box-restore { border: 1px solid #e34948; border-radius: 10px; padding: 12px; }


.cal-chip{display:flex;align-items:baseline;gap:6px}.cal-chip-time{flex-shrink:0;margin-right:0}.cal-chip-title{min-width:0;overflow:hidden;text-overflow:ellipsis}.tg-ev b{flex-shrink:0}.tg-ev span{flex-shrink:0}

.dashboard-kpi{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.dash-payment-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);text-decoration:none}.dash-payment-row span{min-width:0}.tg-ev.short{flex-direction:row;align-items:center;gap:5px}.tg-ev.short time{flex-shrink:0;font-variant-numeric:tabular-nums}.tg-ev.short b{flex-shrink:1;min-width:0}.tg-ev.short>span{display:none}@media(max-width:1000px){.dashboard-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:480px){.dashboard-kpi{grid-template-columns:1fr}.dash-payment-row{flex-direction:column;gap:4px}}

/* Mail list controls must not inherit full-width form-field sizing. */
.mx-list{min-width:0}.mx-row{gap:8px;align-items:flex-start;padding:10px 12px}.mx-check-hit{display:flex;align-items:center;justify-content:center;flex:0 0 26px;width:26px;height:36px;margin:0;padding:0;cursor:pointer}.mx-row .mx-select,.mx-bulk input[type=checkbox]{flex:none;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;max-height:18px;padding:0;margin:0;align-self:center}.mx-row .mx-mark{flex:0 0 28px;width:28px;height:28px;min-height:28px;align-self:center;padding:0;border:0;border-radius:6px;background:transparent;font-size:20px;color:var(--muted)}.mx-row .mx-mark[aria-pressed=true]{color:var(--accent);background:var(--accent-soft)}.mx-rows{overflow-x:hidden}.mx-row-main{overflow:hidden}.mx-row .mx-ava{flex:none}.mx-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}.mx-bulk button{font-size:12px;padding:6px 8px}.mx-list-head input{width:auto;min-width:0}.mx-folders-toggle{flex:none;padding:0 9px}.mx-box-tools{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:flex;gap:4px}.mx-box-tools .mx-gear{position:static;transform:none;opacity:1;flex:none}.mx-box:has(.mx-box-tools)>.mx-folder{padding-right:70px}.mx.nav-collapsed{grid-template-columns:minmax(300px,400px) minmax(0,1fr)}.mail-draftbar{position:fixed;bottom:20px;right:24px;z-index:95;width:min(380px,calc(100vw - 32px));display:flex;align-items:center;gap:8px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}.mail-draftbar>button{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;text-align:left;border:0;background:transparent}.mail-draftbar>button span{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;color:var(--muted)}@media(max-width:1100px){.mx.nav-collapsed{grid-template-columns:1fr}}@media(max-width:700px){.mail-draftbar{bottom:calc(76px + env(safe-area-inset-bottom));right:16px}}

.mx-box-tools .mx-gear{min-height:26px}.mx-folders-toggle+.primary{padding:6px 8px;flex:none}
/* Почта: список на всю ширину и регулируемая область чтения. */
.mx.mail-workspace{display:flex;height:calc(100dvh - 170px);min-height:460px;max-height:1000px;position:relative}
.mail-workspace .mx-nav{flex:0 0 260px;min-width:0;border-right:1px solid var(--line)}
.mail-workspace .mx-list{flex:1;min-width:0;border-right:0}
.mail-workspace.has-reader .mx-list{flex:0 0 clamp(300px,var(--mail-list-width,480px),calc(100% - 660px))}
.mail-workspace.nav-collapsed.has-reader .mx-list{flex-basis:clamp(300px,var(--mail-list-width,480px),calc(100% - 400px))}
.mail-workspace .mx-read{flex:1;min-width:0;border-top:0;grid-column:auto}
.mail-workspace.reader-expanded .mx-list{display:none}
.mail-workspace .mx-account-address{font-size:12px;overflow-wrap:anywhere;min-width:0}
.mail-workspace .mx-box:has(.mx-box-tools)>.mx-folder{padding-right:12px;padding-bottom:38px}
.mail-workspace .mx-box-tools{top:auto;bottom:5px;right:10px;transform:none}
.mail-workspace .mx-box-tools .mx-gear{border-radius:6px;width:28px;height:26px;box-shadow:none}
.mx-list-toolbar{display:flex;gap:8px;align-items:center;padding:8px 14px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.mx-list-toolbar>input[type=checkbox]{width:18px;height:18px;min-height:18px;padding:0;margin:0;flex:none}
.mx-list-toolbar button{font-size:12px;padding:6px 9px;border:0;background:transparent;color:var(--muted)}
.mx-list-toolbar button.on{color:var(--accent);background:var(--accent-soft)}
.mx-list-total{font-size:12px;color:var(--faint);margin-left:auto}
.mx-selection-menu{position:relative}.mx-selection-menu summary{cursor:pointer;list-style:none;padding:4px 8px;border-radius:6px}.mx-selection-menu summary::-webkit-details-marker{display:none}
.mx-selection-menu>div{position:absolute;left:0;top:100%;z-index:15;min-width:240px;display:flex;flex-direction:column;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}
.mx-selection-menu button{text-align:left;padding:10px;color:var(--content)}.mx-selection-menu button:hover{background:var(--surface-2)}
.mx-divider{flex:0 0 9px;background:var(--surface-2);cursor:col-resize;touch-action:none;position:relative;outline:none}
.mx-divider::after{content:'';position:absolute;top:0;bottom:0;left:4px;width:1px;background:var(--line)}
.mx-divider:hover,.mx-divider:focus-visible{background:var(--accent-soft)}.mx-divider:hover::after,.mx-divider:focus-visible::after{background:var(--accent)}
.mx-reader-tools{display:flex;align-items:center;gap:6px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--surface);position:sticky;top:0;z-index:5}
.mx-reader-tools button{font-size:12px;padding:6px 9px}.mx-reader-tools>span{font-size:12px;color:var(--muted)}.mx-back-list{display:none}
.mx-reader-restore{margin:8px 12px;text-align:left;background:var(--accent-soft);color:var(--accent);border-color:transparent}
.mail-workspace.list-only .mx-row{align-items:center;min-height:72px}.mail-workspace.list-only .mx-row-main{display:grid;grid-template-columns:minmax(160px,.4fr) minmax(180px,1fr);column-gap:24px}
.mail-workspace.list-only .mx-row-top{grid-row:1/3}.mail-workspace.list-only .mx-tags{grid-column:2}
@media(max-width:1100px){.mail-workspace .mx-nav{flex-basis:220px}.mail-workspace.has-reader .mx-list{flex-basis:clamp(300px,var(--mail-list-width),calc(100% - 580px))}.mail-workspace .mx-view{padding:14px 18px}}
@media(max-width:900px){.mx.mail-workspace{height:calc(100dvh - 155px);min-height:400px}.mail-workspace.has-reader .mx-list,.mail-workspace.has-reader .mx-nav,.mail-workspace .mx-divider{display:none}.mail-workspace .mx-back-list{display:block}.mail-workspace .mx-reader-tools>span,.mail-workspace .mx-reader-tools button[aria-pressed]{display:none}.mail-workspace.list-only .mx-row-main{display:flex}.mail-workspace .mx-list-head{flex-wrap:wrap}.mail-workspace .mx-list-head input{min-width:100px}.mail-workspace .mx-list-total{display:none}}
@media(max-width:600px){.mail-workspace .mx-nav{flex-basis:100%;width:100%}.mail-workspace:not(.nav-collapsed):not(.has-reader) .mx-list{display:none}.mail-workspace .mx-nav .mx-compose{margin-bottom:8px}.mail-workspace .mx-nav .mx-note{margin-top:20px}.mail-workspace .mx-reader-tools{padding:8px}.mail-workspace .mx-bulk{gap:6px}.mail-workspace .mx-bulk button{font-size:11px}}
.mail-workspace{container-type:inline-size}
@container(max-width:900px){.mail-workspace.has-reader .mx-list,.mail-workspace.has-reader .mx-nav,.mail-workspace .mx-divider{display:none}.mail-workspace .mx-back-list{display:block}.mail-workspace .mx-reader-tools>span,.mail-workspace .mx-reader-tools button[aria-pressed]{display:none}.mail-workspace.list-only .mx-row-main{display:flex}}
.mx-nav-close{display:none}@media(max-width:600px){.mx-nav-close{display:block;text-align:left;margin-bottom:6px}}
.receive-wizard{max-width:760px;margin:auto}.receive-wizard input{min-width:0}.receive-steps{display:flex;list-style:none;gap:8px;padding:0;flex-wrap:wrap}.receive-steps li{padding:8px 12px;border-radius:8px;background:var(--surface-2);color:var(--muted);font-size:13px}.receive-steps li.on{background:var(--accent-soft);color:var(--accent);font-weight:600}.receive-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.receive-wizard .tsd-list{margin:16px 0}.receive-wizard .tsd-item-btn span{display:block;font-size:13px;color:var(--muted);margin-top:6px}@media(max-width:600px){.receive-wizard{padding:12px}.receive-controls button{width:100%;min-height:44px}.receive-wizard .row{flex-wrap:wrap}.receive-wizard .row input{flex:1;min-width:150px}}
.receive-entry{border:0;padding:0;margin:0;min-width:0}
.mx.mail-workspace{width:max(min(100%,640px),var(--mail-workspace-width,100%));max-width:100%}.mx-width-control{display:flex;align-items:center;gap:6px;margin-left:auto;font-size:12px;color:var(--muted);white-space:nowrap}.mx-width-control input[type=range]{width:110px;height:24px;min-height:0;padding:0;border:0;box-shadow:none;accent-color:var(--accent)}.mx-width-control output{min-width:34px;text-align:right}.mx-width-control+.mx-list-total{margin-left:0}.mx-filter-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;padding:12px;border-bottom:1px solid var(--line);background:var(--surface-2)}.mx-filter-panel input,.mx-filter-panel select{min-width:0;width:100%}.mx-filter-panel .check{align-self:center}.mx-filter-panel .check input{width:18px;height:18px;min-height:18px;padding:0}.mx-filter-panel>button{align-self:end}@media(max-width:700px){.mx.mail-workspace{width:100%}.mx-width-control{display:none}.mx-filter-panel{grid-template-columns:repeat(2,minmax(0,1fr));max-height:45dvh;overflow:auto}}
.today-toolbar{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:12px}.today-toolbar input,.today-toolbar select{min-width:0}.today-toolbar>.check{align-self:center}.today-status{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;margin:12px 0}.today-stats{margin-bottom:16px}.today-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));gap:16px}.today-grid .card{min-width:0}.today-grid h2{font-size:17px;flex:1;margin:0}.today-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;color:var(--content);text-decoration:none}.today-row:hover{color:var(--accent)}.today-row>div{min-width:0}.today-row b{display:block;overflow-wrap:anywhere}.today-row small{display:block;color:var(--muted);margin-top:5px}.today-row>.badge{flex:none;max-width:160px;white-space:normal}.today-record{border-top:1px solid var(--line);padding-bottom:6px}.today-record>button{margin-bottom:6px}.today-grid.compact .today-row{padding:7px 0}.today-grid.compact .today-row small{font-size:11px}.today-settings .row{padding:10px 0;border-bottom:1px solid var(--line)}.today-settings .check{min-width:0}@media(max-width:700px){.today-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.today-grid{grid-template-columns:1fr}.today-row{align-items:flex-start}.today-row>.badge{max-width:100px;font-size:11px}.today-status{flex-direction:column}}
.today-notify .notify-pop{position:fixed;top:70px;right:16px;left:auto;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 160px);overflow:auto;z-index:90}
.today-grid{align-items:start}

/* CRM list controls and leave schedule */
.crm-column-settings{padding:16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:20px;margin-bottom:16px}.crm-column-settings input[type=checkbox]{display:inline-block;width:18px;height:18px;min-height:18px;margin:0 8px 0 0;padding:0;vertical-align:middle}.crm-column-settings input[type=range]{display:block;width:100%;height:24px;min-height:24px;padding:0;border:0;box-shadow:none;margin-top:8px;accent-color:var(--accent)}.leave-workspace>.card{margin-bottom:16px}.leave-workspace table th:first-child{position:sticky;left:0;background:var(--surface);z-index:1}.leave-workspace .form{display:grid;gap:12px}

.purchase-filter-grid{padding:16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px}.purchase-filter-grid input,.purchase-filter-grid select{min-width:0;width:100%}.purchase-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0}.purchase-stats>.card{padding:16px;display:flex;flex-direction:column;gap:8px}.purchase-stats strong{font-size:22px}.purchase-stats span{font-size:12px;color:var(--muted)}.purchase-settings{padding:16px;display:flex;gap:16px;flex-wrap:wrap;margin-bottom:16px}.purchase-calendar{padding:16px}.purchase-calendar>div{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}.purchase-calendar button{display:flex;flex-direction:column;gap:8px;min-height:90px;padding:8px}.purchase-calendar .overdue{border-color:var(--danger,#c00);color:var(--danger,#c00)}@media(max-width:700px){.purchase-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-calendar>div{grid-template-columns:repeat(3,minmax(0,1fr))}}

.purchase-weekday{text-align:center;font-size:12px;color:var(--muted)}@media(max-width:700px){.purchase-weekday,.purchase-calendar-empty{display:none}}

.purchase-advanced{grid-column:1/-1}.purchase-advanced>summary{cursor:pointer;padding:10px 0;color:var(--muted)}.purchase-advanced>.purchase-filter-grid{margin:0;padding:8px 0}.purchase-filter-grid>button{justify-self:start}

.sales-workbench-table .sales-order-title{position:sticky;left:0;background:var(--surface);z-index:1}.sales-workbench-table td{vertical-align:top}.sales-workbench-table progress{max-width:100px}.sales-workbench-table .btn{white-space:normal}

/* Order execution: independent status signals, readable on narrow screens. */
.order-signal-filters{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.order-signal-list{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.order-signal-list .badge{white-space:normal;line-height:1.45;text-align:left}.order-overview{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:16px}.order-overview .btn{margin:4px}.order-control{min-width:0}.order-control section{margin:20px 0}.order-control section>.card{padding:12px;margin:8px 0;overflow-wrap:anywhere}.order-control p{line-height:1.55}.order-control .badge{white-space:normal;max-width:100%;margin-right:6px}.order-control section .btn{white-space:normal}.order-control .filters{flex-wrap:wrap}

.order-mobile-list{display:none}@media(max-width:700px){.order-mobile-list{display:grid;gap:12px}.order-mobile-list+.sales-workbench-table{display:none}.order-mobile-list article{min-width:0}.order-mobile-list .row,.order-mobile-list .filters{flex-wrap:wrap}.order-mobile-list p,.order-mobile-list a,.order-mobile-list .badge{overflow-wrap:anywhere;white-space:normal}.order-mobile-list .filters>*{max-width:100%}}

.procurement-tabs{flex-wrap:wrap;margin-bottom:16px}.procurement-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px;margin:12px 0}.procurement-cards .card,.procurement-detail .card{min-width:0;overflow-wrap:anywhere}.procurement-cards p{line-height:1.55}.procurement-cards .filters,.procurement-detail .filters{flex-wrap:wrap;gap:8px}.procurement-cards .badge,.procurement-detail .badge{white-space:normal}.procurement-store-list{display:flex;flex-wrap:wrap;gap:12px}.procurement-plan-line{display:grid;gap:10px;border-bottom:1px solid var(--line);padding:14px 0}.procurement-plan-line select,.procurement-plan-line input{min-width:0;max-width:100%}.procurement-detail{min-width:0}.procurement-detail .card{padding:12px;margin:10px 0}.procurement-detail button,.procurement-detail .btn{white-space:normal;max-width:100%}.procurement-detail h3{margin-top:22px}
/* Меню по рабочим задачам: один раскрытый раздел, ясная вложенность. */
.nav-browse-tools{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:16px 8px 6px;color:var(--faint);font-size:11px}.nav-browse-tools button{padding:4px 7px;font-size:11px;min-height:28px;background:transparent;box-shadow:none;white-space:nowrap}.sidebar .nav-section{margin-top:3px}.sidebar .nav-section .nav-group{padding:9px 8px;gap:8px;min-height:40px;text-transform:none;letter-spacing:0;font-size:13px;color:var(--muted)}.nav-section .nav-group>.icon,.nav-section .nav-group>svg{flex:none;width:17px;height:17px}.nav-section-title{flex:1;min-width:0}.nav-section-count{font-size:10px;color:var(--faint);font-weight:500;min-width:15px;text-align:center}.nav-section.current>.nav-group-row .nav-group{color:var(--accent);background:var(--accent-soft)}.nav-section.expanded>a{margin-left:16px;padding-left:12px;border-left:1px solid var(--line);border-radius:0 7px 7px 0;font-size:12px;line-height:1.4}.nav-section.expanded>a.active{border-left:2px solid var(--accent)}.nav-section.expanded>a svg{width:15px;height:15px;flex:none}.nav-section.expanded{padding-bottom:7px}.sidebar .nav-search{margin:9px 0}.layout.mini .nav-section .nav-section-title,.layout.mini .nav-section-count{display:none}
.workspace-switch{display:flex;align-items:center;gap:4px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:16px;overflow-x:auto;max-width:100%;scrollbar-width:thin}.workspace-switch button{flex:none;white-space:nowrap;border:0;background:transparent;box-shadow:none;color:var(--muted);padding:9px 12px}.workspace-switch button.selected{background:var(--accent-soft);color:var(--accent);font-weight:600}.workspace-details{border:1px solid var(--line);border-radius:10px;padding:11px 13px;background:var(--surface);margin-bottom:14px}.workspace-details summary{cursor:pointer;color:var(--muted);font-size:13px}.workspace-details[open]>summary{margin-bottom:10px;color:var(--content)}.workspace-filter-card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:16px}.workspace-filter-card .filters{margin-bottom:10px}.workspace-filter-card .stock-replenishment{margin-bottom:0!important}.workspace-actions{position:relative;font-size:13px}.workspace-actions>summary{cursor:pointer;border:1px solid var(--line);border-radius:8px;padding:9px 12px;list-style:none;background:var(--surface)}.workspace-actions[open]>div{position:absolute;right:0;top:calc(100% + 6px);z-index:15;display:grid;gap:6px;padding:10px;width:210px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px #0002}.workspace-list-tools .workspace-details{margin:0;padding:8px 12px}.workspace-money-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0 18px}.workspace-money-summary span{font-size:12px;color:var(--muted)}.workspace-money-summary strong{display:block;font-size:21px;color:var(--content);margin-top:5px;overflow-wrap:anywhere}@media(max-width:700px){.workspace-money-summary{grid-template-columns:1fr;gap:10px}.workspace-money-summary span{display:flex;align-items:center;justify-content:space-between;gap:8px}.workspace-money-summary strong{font-size:17px;margin:0}.workspace-switch{border-radius:10px}.workspace-filter-card{padding:12px}.workspace-list-tools{align-items:flex-start}.workspace-list-tools>.workspace-details{flex-basis:100%}}
.sidebar .nav-search{position:sticky;top:0;z-index:4;background:var(--surface);padding:6px 0}.sidebar .nav-search button{top:10px}.workspace-switch button:focus-visible,.nav-section .nav-group:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}@media(prefers-reduced-motion:reduce){.workspace-switch{scroll-behavior:auto}}
@media(max-width:900px){.sidebar .nav-section .nav-group,.sidebar .nav-section>a{min-height:44px}.sidebar .nav-section>a{font-size:13px}.nav-section-count{font-size:11px}}
.module-features{margin:4px 0;padding-left:18px;font-size:12px;line-height:1.6;color:var(--muted)}.module-tile .badge{align-self:flex-start}.module-tile>a{align-self:flex-start}.module-tile:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.module-tile input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:none}

.role-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:12px;margin-top:12px}.role-template-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:9px;white-space:normal;padding:16px;min-height:125px}.role-template-card span,.role-template-card small{color:var(--muted);font-weight:400;line-height:1.5}

.today-quick{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px;align-items:center}.today-quick>input{flex:2;min-width:180px;width:auto}.today-quick>select{flex:1;min-width:170px;width:auto}.today-chips{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.today-chips .on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}.today-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:14px 0}.today-metrics>button{display:flex;flex-direction:column;align-items:flex-start;gap:6px;white-space:normal;margin:0;padding:16px}.today-metrics b{font-size:24px}.today-metrics span{font-size:12px;color:var(--muted)}.today-focus{margin-bottom:16px}.today-focus summary{font-weight:600;cursor:pointer}.today-record-head{display:flex;align-items:flex-start;gap:8px}.today-record-head>.today-row{flex:1;min-width:0}.today-record-head>button{margin-top:12px;flex:none;min-width:36px}.today-action{font-size:12px;max-width:130px;flex:none;color:var(--accent);text-align:right}.today-badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.today-group-head{flex-wrap:wrap}.today-group-head h2{min-width:150px}.today-why{font-size:12px;color:var(--muted);margin:12px 0}.today-why summary{cursor:pointer}.today-overdue{padding:4px 0;background:none;color:var(--accent);border:0;box-shadow:none}.today-details>div{display:grid;grid-template-columns:minmax(100px,1fr) 2fr;gap:12px;border-bottom:1px solid var(--line);padding:9px 0}.today-details dt{color:var(--muted)}.today-details dd{margin:0;overflow-wrap:anywhere}.today-error{margin-bottom:16px;border-color:var(--accent)}@media(max-width:700px){.today-action{display:none}.today-quick>*{max-width:100%}.today-quick>input{flex-basis:100%}.today-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.today-row{min-height:44px}.today-chips button{min-height:40px}}@media print{.today-workspace .no-print,.today-workspace .page-head button{display:none!important}.today-workspace .today-grid{display:block}.today-workspace .card{box-shadow:none;break-inside:avoid}.today-workspace .today-record{break-inside:avoid}.today-workspace details:not(.today-why)>summary{display:none}.today-action{display:none}.today-workspace{color:#111;background:#fff}}

.work-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-bottom:14px}.work-filters>input,.work-filters>select{width:auto;flex:1;min-width:150px}.work-filters>label{flex:1;min-width:140px}.work-summary{display:flex;gap:20px;flex-wrap:wrap;margin:16px 0}.work-table-scroll{overflow-x:auto}.work-table table small{display:block;margin-top:5px}.work-table input[type=checkbox]{width:17px;height:17px;min-width:17px}.work-column-sort{border:0;box-shadow:none;background:none;padding:4px 0;text-align:left;white-space:normal;font-weight:600}.work-column-setting{display:grid;grid-template-columns:1fr minmax(80px,1fr) 55px 34px 34px;gap:8px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.work-column-setting input[type=range]{min-width:0;width:100%}.work-table .compact td{padding-top:7px;padding-bottom:7px;font-size:12px}.work-table tbody tr:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.work-fieldset{border:0;margin:0;padding:0;min-width:0}.work-detail>section,.work-detail>details{margin:14px 0}.work-instructions{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.6}.work-line-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px;margin:12px 0}.work-line-grid>.card{padding:12px;box-shadow:none}.work-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;list-style:none;padding:0;margin:16px 0}.work-steps li{border:1px solid var(--line);border-radius:10px;padding:12px}.work-steps li.done{border-color:var(--accent);background:var(--accent-soft)}.work-steps b,.work-steps span{display:block}.work-steps span{font-size:12px;color:var(--muted);margin-top:6px}.work-reviewers{display:flex;gap:10px;flex-wrap:wrap}.work-history{border-bottom:1px solid var(--line);padding:10px 0}.work-source-detail>summary,.work-scan>summary{cursor:pointer;font-weight:600}.work-source-detail>.work-source{margin-top:12px}.work-preview{border-color:var(--accent)}.work-detail .check{margin:10px 0}.work-scan form input{flex:1;min-width:140px}.work-flow-page .tabs button{min-height:42px}@media(max-width:650px){.work-filters>input,.work-filters>select,.work-filters>label{max-width:100%;min-width:0;flex-basis:45%}.work-filters>input{flex-basis:100%}.work-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.work-column-setting{grid-template-columns:1fr 75px 32px 32px}.work-column-setting>input{grid-column:1/3;grid-row:2}.work-column-setting>.small{grid-column:2;grid-row:1}.work-column-setting>button{grid-row:1}.work-detail .row>button,.work-flow-page .tabs button{min-height:44px}}@media print{.work-flow-page .no-print,.work-detail .no-print,.work-table .no-print{display:none!important}.work-table-scroll{overflow:visible}.work-table table{width:100%!important;table-layout:auto!important}.work-table col{width:auto!important}.work-source-detail>summary{display:none}.work-detail .card,.work-flow-page .card{box-shadow:none;break-inside:avoid}}

@media print{body:has(.work-print-dialog) *{visibility:hidden}body:has(.work-print-dialog) .work-print-dialog,body:has(.work-print-dialog) .work-print-dialog *{visibility:visible}body:has(.work-print-dialog) .overlay:has(.work-print-dialog){position:absolute!important;inset:0!important;height:auto!important;overflow:visible!important;background:white!important;display:block!important;padding:0!important}.work-print-dialog.modal{position:static!important;width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;overflow:visible!important;box-shadow:none!important;transform:none!important}.work-print-dialog button,.work-print-dialog .modal-foot,.work-print-dialog .no-print{display:none!important}.work-print-dialog details:not([open]){display:none!important}body:has(.work-print-dialog){overflow:visible!important}}
.operations-workspace,.order-dossier{min-width:0}.order-dossier-dialog.modal{width:min(1180px,calc(100vw - 36px));max-height:calc(100dvh - 36px);overflow:auto}.order-dossier-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}.order-dossier-header p{margin:6px 0}.order-dossier-tabs{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0;padding-bottom:12px;border-bottom:1px solid var(--line)}.operations-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin:16px 0}.operations-metrics article{display:flex;flex-direction:column;gap:8px;padding:18px}.operations-metrics b{font-size:24px;line-height:1.2}.operations-metrics span{font-size:13px;color:var(--muted)}.operations-negative{color:var(--danger,#b91c1c)}.operation-views{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:14px 0}.operation-views select{width:auto;max-width:100%;min-width:180px}.operation-views details{max-width:100%}.operation-views details p{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.operations-problems{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin:18px 0}.operations-problems>button{display:flex;flex-direction:column;gap:10px;text-align:left;white-space:normal;padding:18px}.operations-problems>button.on{outline:2px solid var(--accent)}.operations-problems span{font-weight:400;color:var(--muted)}.order-dossier .card{margin:12px 0}.order-dossier progress{max-width:220px}.order-dossier .work-table-scroll{margin:12px 0}.order-dossier .work-filters{margin:12px 0}.work-scan form input{min-width:0;flex:1 1 180px}.work-scan button{white-space:normal}
@media(max-width:700px){.order-dossier-dialog.modal{width:100vw;max-height:100dvh;border-radius:0}.order-dossier-tabs{gap:6px}.order-dossier-tabs button{min-height:44px;flex:1 1 auto}.operations-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.operations-metrics article{padding:12px}.operations-metrics b{font-size:20px;overflow-wrap:anywhere}.operations-problems{grid-template-columns:minmax(0,1fr)}.operation-views>button,.operation-views>select{min-height:44px}.operations-workspace .work-filters>*{max-width:100%}.operations-workspace .work-filters input{min-width:0}.order-dossier-header .btn{width:100%;justify-content:center}.order-dossier .work-table{min-width:0}}
.operations-curve{margin:16px 0;padding:16px}.operations-curve svg{display:block;width:100%;max-height:180px}.operations-curve figcaption{font-weight:600;margin-bottom:8px}.operations-curve p{margin-bottom:0}
.order-dossier-product-cards{display:none}@media(max-width:700px){.order-dossier-products .work-table-scroll{display:none}.order-dossier-product-cards{display:block}.order-product-quantities{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;margin-top:14px}.order-product-quantities span{font-size:12px;color:var(--muted)}.order-product-quantities b{display:block;color:var(--content);font-size:15px;margin-top:4px}}
/* Почта: видимая область вложений и отдельное состояние каждого файла. */
.mail-dropzone{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1px dashed var(--line,#d5d8df);padding:16px;border-radius:12px;margin:16px 0;background:var(--bg,#f7f8fa)}
.mail-dropzone span{font-size:12px;color:var(--muted,#687080)}
.mail-dropzone.dragging{border-color:var(--accent,#0088be);outline:2px solid var(--accent,#0088be)}
.mail-upload-row{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line,#d5d8df);border-radius:10px;margin:8px 0;overflow-wrap:anywhere}
.mail-upload-row .grow{min-width:0}.mail-upload-row progress{display:block;width:100%;height:6px;margin:8px 0}.mail-upload-row p{margin:5px 0;color:#b42318}
.mail-upload-error{padding:12px;border:1px solid #efb2b2;border-radius:10px;overflow-wrap:anywhere}.mail-compose-dialog .mx-att{display:flex;flex-wrap:wrap;gap:8px}.mail-compose-dialog .mx-file{max-width:100%;min-width:0}.mail-compose-dialog .mx-file a{min-width:0}
@media(max-width:700px){.mail-upload-row{flex-wrap:wrap}.mail-upload-row .grow{flex-basis:100%}.mail-dropzone{padding:12px}.mail-compose-dialog .modal-foot{gap:6px}.mail-compose-dialog .mx-line{min-width:0}}
.dispatch-actions{gap:12px;flex-wrap:wrap;margin:16px 0}.dispatch-list{display:grid;gap:10px;margin:16px 0}.dispatch-task{display:flex;gap:14px;align-items:center;margin:0}.dispatch-task .grow{min-width:0;overflow-wrap:anywhere}.dispatch-task progress{width:min(250px,100%);height:7px}.dispatch-task p{margin:7px 0}.dispatch-task .row{flex-wrap:wrap;gap:8px}.dispatch-task>input{flex-shrink:0;width:18px;height:18px}.dispatch-page .work-filters .field{margin:0;min-width:140px}
@media(max-width:700px){.dispatch-task{flex-wrap:wrap}.dispatch-task .grow{flex-basis:calc(100% - 36px)}.dispatch-task>a{margin-left:auto}.dispatch-page .work-filters{display:grid;grid-template-columns:1fr}.dispatch-page .operations-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
.mail-compose-dialog.modal{display:flex;flex-direction:column;padding:0;overflow:hidden;height:calc(100vh - 32px);max-height:900px;max-width:900px}
.mail-compose-dialog>.modal-head{flex:none;margin:0;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--surface)}
.mail-compose-dialog>.mx-compose-form{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 20px 20px}
.mail-compose-dialog>.modal-foot{flex:none;margin:0;padding:12px 20px;border-top:1px solid var(--line);background:var(--surface);flex-wrap:wrap}
@media(max-width:700px){.mail-compose-dialog.modal{height:calc(var(--modal-viewport-height,100vh) - 16px);max-height:calc(var(--modal-viewport-height,100vh) - 16px)}.mail-compose-dialog>.modal-head{padding:12px 14px}.mail-compose-dialog>.mx-compose-form{padding:8px 14px 14px}.mail-compose-dialog>.modal-foot{padding:10px 12px;display:grid;grid-template-columns:1fr 1fr}.mail-compose-dialog>.modal-foot>.spacer{display:none}.mail-compose-dialog>.modal-foot button{min-width:0;justify-content:center}}
.dispatch-filters summary{cursor:pointer;font-weight:600}.dispatch-filters[open] summary{margin-bottom:14px}
.mail-thread-item{padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.mail-thread-item small{display:block;color:var(--muted)}.mail-thread-item p{margin:7px 0}.mail-thread summary{cursor:pointer;font-weight:600}.mail-thread{margin:12px 0}.shift-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.dispatch-task>.shift-controls{flex-shrink:0;max-width:210px}@media(max-width:700px){.dispatch-task>.shift-controls{max-width:100%;justify-content:flex-end;flex-basis:100%}}
.calendar-followups{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:12px}.calendar-followups button{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:12px;min-height:65px}
/* Кабинет → Интеграторы: блок установки коробки */
.box-install { border: 1px solid var(--line, #8883); border-radius: 10px; padding: 12px; margin: 10px 0; }
.box-cmd { display: block; white-space: pre-wrap; word-break: break-all; background: var(--code-bg, #1113); padding: 8px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.box-cmd:hover { outline: 2px solid var(--accent, #e3262f); }
.first-start{max-width:1180px;margin:0 auto}.first-start>.card{margin-bottom:18px}.first-start-goals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.first-start-goals button{display:flex;flex-direction:column;align-items:flex-start;text-align:left;white-space:normal;padding:20px;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:12px;color:var(--text)}.first-start-goals button.selected{outline:2px solid var(--accent);outline-offset:1px}.first-start-goals button span{font-size:12px;line-height:1.6}.first-start-goals small{opacity:.7}.first-start-step{display:grid;grid-template-columns:40px 1fr auto;gap:20px;align-items:start}.first-start-number{background:var(--surface-2);border:1px solid var(--border);border-radius:50%;width:36px;height:36px;display:grid;place-items:center;font-weight:700}.first-start-step h2{margin-top:0}.first-start-step p{line-height:1.7}.first-start-step .field{max-width:480px;margin:18px 0}.first-start-progress{display:flex;flex-wrap:wrap;gap:20px;align-items:center}.first-start-progress>div{flex:1;min-width:230px}.first-start-progress>strong{font-size:30px}.first-start-progress progress{width:100%;height:12px;accent-color:var(--accent)}.first-start-nudge{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.first-start-nudge p{margin:6px 0 0}.first-start button:disabled{opacity:.5}@media(max-width:850px){.first-start-goals{grid-template-columns:1fr 1fr}}@media(max-width:520px){.first-start-step{grid-template-columns:30px 1fr;gap:12px}.first-start-step>.badge{grid-column:2}.first-start-number{width:28px;height:28px}.first-start-goals{grid-template-columns:1fr}.first-start-nudge{align-items:stretch;flex-direction:column}.first-start .row{flex-wrap:wrap}.first-start .btn,.first-start button{white-space:normal;max-width:100%}}

.first-start-goal-picker>summary{cursor:pointer;font-weight:700;font-size:18px;padding:10px 0}.first-start-goal-picker[open]>.first-start-goals{margin-top:18px}
.first-start-step>div{min-width:0;overflow-wrap:anywhere}.first-start-progress>div{overflow-wrap:anywhere}
.impl-center{max-width:1250px;margin:0 auto}.impl-filters{display:flex;gap:14px;align-items:end;flex-wrap:wrap;margin-bottom:18px}.impl-filters .field{margin:0;min-width:150px}.impl-filters form{flex:1;min-width:220px}.impl-filters form input{min-width:0;width:100%}.impl-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.impl-item{margin-bottom:16px;overflow-wrap:anywhere}.impl-item h3{margin:0}.impl-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;background:var(--surface-2);padding:16px;border-radius:8px;margin:15px 0}.impl-summary b{display:block;font-size:11px;color:var(--muted);margin-bottom:6px}.impl-progress{border-block:1px solid var(--border);padding:16px 0;margin-bottom:16px}.impl-progress ul{list-style:none;padding:0;display:flex;gap:16px;flex-wrap:wrap}.impl-progress li{font-size:12px}.impl-form{overflow-wrap:anywhere}.impl-form fieldset>.field{margin:16px 0}.impl-company-result{display:block;width:100%;text-align:left;margin:8px 0;white-space:normal}.impl-company-result small{display:block;color:var(--muted)}.impl-client{margin-bottom:18px;overflow-wrap:anywhere}.impl-client p{line-height:1.7}@media(max-width:600px){.impl-metrics{grid-template-columns:1fr 1fr}.impl-summary{grid-template-columns:1fr}.impl-filters>.field,.impl-filters form{width:100%;min-width:0}.impl-form .row{flex-wrap:wrap}.impl-form input{min-width:0}.impl-item .row{flex-wrap:wrap}.impl-center .btn,.impl-center button{white-space:normal;max-width:100%}}

.impl-editor.modal{padding:0;overflow:hidden;display:flex;flex-direction:column}.impl-editor>.modal-head{flex:none;margin:0;padding:18px 20px;border-bottom:1px solid var(--line)}.impl-editor>.impl-form{overflow-y:auto;min-height:0;padding:20px}.impl-editor>.modal-foot{flex:none;margin:0;padding:12px 20px;border-top:1px solid var(--line);flex-wrap:wrap}@media(max-width:600px){.impl-editor.modal{height:calc(100dvh - 20px)}.impl-editor>.impl-form{padding:15px}.impl-editor>.modal-foot{padding:10px 15px calc(10px + env(safe-area-inset-bottom))}}

.impl-actions{gap:10px;flex-wrap:wrap;justify-content:space-between}.impl-main-tabs{margin-bottom:18px}.impl-queue-tabs{display:flex;gap:8px;flex-wrap:wrap}.impl-fieldset{border:0;padding:0;min-width:0}.impl-task{margin:14px 0;overflow-wrap:anywhere}.impl-task-edit{margin-top:16px;border-top:1px solid var(--line);padding-top:16px}.impl-task-history{border-top:1px solid var(--line);margin-top:16px}.impl-task-history article{padding:12px 0;border-bottom:1px solid var(--line)}.impl-task-history p{margin:5px 0}.impl-reasons{display:flex;gap:8px;flex-wrap:wrap}.impl-reasons span,.impl-warning{background:var(--surface-2);border-radius:8px;padding:8px 10px}.impl-work-metrics{margin-top:18px}.impl-checklist .card{box-shadow:none}.impl-checklist input,.impl-checklist select,.impl-checklist textarea{min-width:0;max-width:100%}@media(max-width:600px){.impl-actions>button{max-width:100%;white-space:normal}.impl-queue-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.impl-task .form-2{grid-template-columns:1fr}.impl-queue-tabs button{white-space:normal;min-height:40px}}

.impl-actions{justify-content:flex-start}.impl-new-task{margin-top:14px}.impl-new-task>summary{cursor:pointer;font-weight:600;padding:10px 0}.impl-work-metrics+h2{margin-top:22px}.impl-reasons .down{color:var(--danger,#c40016)}

.smm-modal.modal{padding:0;display:flex;flex-direction:column;overflow:hidden}.smm-modal>.modal-head,.smm-modal>.modal-foot{flex:none;margin:0;padding:16px 20px;border-bottom:1px solid var(--line)}.smm-modal>.modal-foot{border-top:1px solid var(--line);flex-wrap:wrap}.smm-scroll{overflow:auto;min-height:0;padding:20px}.smm-editor-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}.smm-fields{border:0;padding:0;min-width:0}.smm-cover{width:100%;height:auto;display:block;border:1px solid var(--line);border-radius:10px}.smm-copy{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;padding:16px}.smm-platforms{display:grid;grid-template-columns:1fr 1fr;gap:8px}.smm-platforms label{display:flex;gap:8px;align-items:center}.smm-platforms input{width:auto}.smm-post-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}.smm-post{min-width:0;overflow-wrap:anywhere}.smm-post h2{font-size:18px}.smm-excerpt{white-space:pre-wrap;max-height:120px;overflow:auto}.smm-actions{gap:8px;flex-wrap:wrap}.smm-logo{max-width:240px;max-height:100px;object-fit:contain}.smm-preview{min-width:0}.smm-modal input[type=color]{width:60px;height:38px;padding:4px}@media(max-width:1100px){.smm-post-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.smm-editor-grid,.smm-post-grid{grid-template-columns:1fr}.smm-modal.modal{height:calc(100dvh - 20px)}.smm-scroll{padding:14px}.smm-modal>.modal-foot{padding:10px 14px calc(10px + env(safe-area-inset-bottom))}}

.smm-calendar{margin-top:18px}.smm-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-top:12px}.smm-calendar-grid>b{text-align:center;font-size:12px}.smm-calendar-grid>button{min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.smm-calendar-grid small{font-size:10px}.smm-calendar-grid>*{min-width:0}@media(max-width:600px){.smm-calendar-grid{gap:3px}.smm-calendar-grid>button{min-height:44px;font-size:12px}}

.smm-modal.wide{max-width:1200px;width:calc(100vw - 32px)}@media(min-width:701px){.smm-preview{position:sticky;top:0;align-self:start;max-height:calc(100dvh - 190px);overflow:auto}}@media(max-width:700px){.smm-modal.wide{width:calc(100vw - 20px)}}
.smm-plan-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}.smm-plan-head h2,.smm-plan-head h3{margin:0 0 8px}.smm-plan-head h3{font-size:16px;overflow-wrap:anywhere}.smm-plans{margin-bottom:18px}.smm-plan-card{border:1px solid var(--border,#ddd);border-radius:12px;padding:20px;margin-top:14px;min-width:0}.smm-plan-status{border-radius:16px;background:var(--surface,#f2f3f5);padding:5px 12px;font-size:12px;white-space:nowrap}.smm-plan-progress{display:flex;gap:14px;align-items:center;margin-top:16px}.smm-plan-progress progress{accent-color:var(--accent,#bf0000);height:9px;flex:1;min-width:0}.smm-plan-progress span{font-size:12px;white-space:nowrap}.smm-plan-error-message{padding:12px;border:1px solid #f1b8b8;border-radius:8px;background:#fff5f5;color:#8c2020}.smm-plan-strategy{margin:16px 0}.smm-plan-strategy summary{cursor:pointer;font-weight:600}.smm-plan-strategy dt{font-weight:600;margin-top:12px}.smm-plan-strategy dd{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.smm-plan-strategy li{padding:6px 0}.smm-plan-strategy li p{margin:4px 0}.smm-archive-toggle{display:flex;align-items:center;gap:8px;font-size:13px;margin:14px 0}.smm-archive-toggle input{width:auto}.smm-plan-card .smm-actions{margin-top:16px}@media(max-width:600px){.smm-plan-card{padding:14px}.smm-plan-head>.smm-actions{width:100%}.smm-plan-head>.smm-actions button{flex:1}.smm-plan-progress{gap:8px}}
.smm-telegram{margin-bottom:18px}.smm-telegram details{margin-top:14px}.smm-telegram summary{cursor:pointer;font-weight:600}.smm-delivery-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--line);padding:12px 0;flex-wrap:wrap}.smm-delivery-list p{margin:4px 0}.smm-publish-confirm{display:flex;align-items:flex-start;gap:10px;padding:14px;border:1px solid var(--line);border-radius:10px}.smm-publish-confirm input{width:auto;margin-top:4px;flex:none}

.smm-select{display:flex;gap:8px;align-items:center;margin-bottom:10px}.smm-select input{width:auto}.smm-result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}.smm-result-grid>div{padding:16px;border:1px solid var(--line);border-radius:10px}.smm-result-grid b,.smm-result-grid span{display:block}.smm-result-grid b{font-size:24px}.smm-result-table{overflow:auto}.smm-result-table table{width:100%;text-align:left}.smm-result-table td,.smm-result-table th{padding:10px;border-bottom:1px solid var(--line)}.smm-delivery-list article>div{min-width:0;overflow-wrap:anywhere}.smm-fields>label:not(.field){display:flex;gap:8px;align-items:center}.smm-fields>label input[type=checkbox]{width:auto}@media(max-width:600px){.smm-result-grid{grid-template-columns:1fr 1fr}.smm-delivery-list button{max-width:100%;white-space:normal}}

.smm-rich-text blockquote{margin:10px 0;padding:8px 14px;border-left:3px solid var(--primary,#bf0000);background:#8888880c;white-space:pre-wrap}.smm-rich-text a{overflow-wrap:anywhere}.smm-rich-text b{font-weight:700}

/* Mail reading: focused layout, compact actions, sender details and readable message. */
.mail-workspace.reader-expanded{width:100%}.mail-workspace.reader-expanded .mx-nav{display:none}
.mail-workspace .mx-read{scroll-padding-top:132px;background:var(--surface-2)}
.mx-reader-tools{height:52px;min-height:52px;padding-top:8px;padding-bottom:8px;box-sizing:border-box}.mx-reader-tools .grow{min-width:30px}
.mx-view{max-width:1100px;margin:0 auto;box-sizing:border-box;width:100%}
.mx-view>.mx-actions{top:0;margin-top:-16px;padding:10px 0;background:var(--surface-2);z-index:4;border-bottom:1px solid var(--line)}
.mx-view .mx-title{font-size:24px;overflow-wrap:anywhere;margin-top:20px}
.mx-view .mx-from{align-items:flex-start;flex-wrap:wrap}.mx-from>.small{margin-left:auto}
.mx-recipient-details{font-size:12px;color:var(--muted);max-width:100%;margin-top:4px}
.mx-recipient-details summary{cursor:pointer;overflow-wrap:anywhere}.mx-recipient-details p{margin:5px 0;overflow-wrap:anywhere}
.mx-message-menu{position:relative}.mx-message-menu>summary{cursor:pointer;list-style:none;border:1px solid var(--line);border-radius:999px;padding:8px 14px;background:var(--surface);font-size:13px}
.mx-message-menu>div{position:absolute;top:calc(100% + 6px);right:0;min-width:240px;display:grid;gap:4px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);z-index:8}
.mx-message-menu>div>button{text-align:left;border:0;border-radius:6px;background:transparent}
.mx-letter{margin-top:18px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:white;color:#202124}
.mx-letter-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:8px 12px;background:var(--surface);color:var(--content);border-bottom:1px solid var(--line)}
.mx-letter-tools>span{margin-right:auto;font-size:12px;color:var(--muted)}.mx-letter-tools [role=group]{display:flex;gap:4px}.mx-letter-tools button{padding:5px 10px;font-size:12px;min-height:30px}
.mx-letter .mx-body{margin:0}.mx-letter .mx-frame{display:block;border-radius:0}.mx-letter .mx-text{padding:20px;line-height:1.7}
.mx-view>.mx-files{margin:16px 0 4px}.mx-view .mx-file{max-width:100%;box-sizing:border-box}.mx-view .mx-file>.mx-ell{white-space:normal;overflow-wrap:anywhere}
.mx-view>.mail-thread{margin-top:20px}.mx-view .mx-quick{margin-bottom:16px}
@media(max-width:600px){.mail-workspace .mx-view{padding:12px}.mx-view>.mx-actions{gap:5px;margin-top:-12px}.mx-view>.mx-actions>button{padding:7px 9px;font-size:12px}.mx-view .mx-title{font-size:20px}.mx-from>.small{width:100%;margin-left:54px;font-size:11px;white-space:normal!important}.mx-view .mx-actions .spacer{display:none}.mx-view .mx-actions>.mx-attach{width:100%}.mx-view .mx-actions .mx-attach select{max-width:100%}.mx-reader-tools{gap:4px}.mx-reader-tools button{padding:6px}.mx-letter-tools{gap:6px;padding:8px}.mx-letter .mx-text{padding:14px}.mx-message-menu>div{right:0;min-width:210px}}

.mx-subject-line{display:flex;align-items:flex-start;gap:12px}.mx-subject-line .mx-title{flex:1;min-width:0}.mx-message-star{margin-top:16px;flex:none;font-size:23px;padding:4px 9px;background:transparent;border-color:transparent}.mx-message-star[aria-pressed=true]{color:#bc7900}@media(max-width:600px){.mx-view>.mx-actions{position:static}.mx-subject-line{gap:6px}}

.mx-read .mx-view>.mx-actions{top:52px}

/* Thread expansion and inline reply keep the inbox beside the reading pane. */
.mail-thread>summary{font-weight:600;cursor:pointer}.mail-thread-item{margin:12px 0;padding:12px 0;border-top:1px solid var(--line)}
.mail-thread-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;background:var(--surface);border-radius:10px;padding:10px}
.mail-thread-toggle>span:first-child{min-width:0;overflow-wrap:anywhere}.mail-thread-toggle small,.mail-thread-current small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.mail-thread-toggle>span:last-child{font-size:12px;flex:none}.mail-thread-snippet{overflow-wrap:anywhere;font-size:13px}.mail-thread-current{padding:12px;margin:12px 0;background:var(--accent-soft);border-radius:10px}
.mail-thread-letter{min-width:0}.mail-thread-letter>.small{overflow-wrap:anywhere}.mail-thread-reply{margin-top:12px}.mail-thread .mx-files{margin-top:10px}
.mail-quick-anchor{scroll-margin-top:120px;min-width:0}.mail-inline-reply{margin-top:20px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px;min-width:0}
.mail-inline-reply[hidden]{display:none}.mail-inline-reply>header{display:flex;align-items:center;justify-content:space-between;gap:10px}.mail-inline-reply h3{margin:0;font-size:16px}
.mail-inline-reply>footer{display:flex;gap:8px;flex-wrap:wrap;padding-top:14px;margin-top:14px;border-top:1px solid var(--line)}.mail-inline-reply>footer>.spacer{display:none}
.mail-inline-reply .mx-line{flex-wrap:wrap}.mail-inline-reply .mx-line>input{min-width:100px}.mail-inline-reply .mx-addr{min-width:120px}.mail-inline-reply .mx-addr input{min-width:100px}
.mail-inline-reply .mx-compose-form>.field{margin-top:12px}.mail-inline-reply .mx-compose-form>.row{gap:6px;flex-wrap:wrap;margin:10px 0}.mail-inline-reply .mail-dropzone{margin-top:12px}
.mail-inline-reply .rich-toolbar{flex-wrap:wrap}.mail-inline-reply input[type=file]{display:none}
@media(max-width:600px){.mail-inline-reply{padding:10px}.mail-inline-reply>header{flex-wrap:wrap}.mail-inline-reply>footer>button{padding:8px 10px;font-size:12px}.mail-thread.card{padding:12px}.mail-thread-toggle{padding:8px}.mail-thread-letter .mx-letter .mx-text{padding:10px}}

.mail-reply-options{margin:10px 0}.mail-reply-options>summary{cursor:pointer;font-size:12px;color:var(--muted);padding:6px 0}.mail-reply-options .row{flex-wrap:wrap;gap:6px;margin:10px 0}.mail-format-toggle{align-self:flex-start;margin:6px 0 10px;font-size:12px}
.mail-editor-compact .rt-bar{display:none}.mail-inline-reply .mail-dropzone{padding:8px;border:0;margin-top:8px}.mail-inline-reply .mail-dropzone>button{display:none}.mail-inline-reply .mail-dropzone>span{font-size:11px}
.mail-inline-reply .mx-addr{min-height:36px}.mail-inline-reply>footer{position:sticky;bottom:0;background:var(--surface);z-index:2;padding-bottom:8px}

/* Conversations expand inside the message list; reading and replying stay in the right pane. */
.mx-conversation{position:relative;min-width:0}.mx-conversation.has-thread>.mx-row{padding-right:64px}
.mx-conversation-toggle{position:absolute;z-index:2;right:10px;top:38px;display:flex;gap:5px;align-items:center;justify-content:center;min-width:40px;padding:3px 6px;min-height:26px;border-radius:8px;background:var(--surface-2);font-size:12px}
.mx-conversation-toggle>span{font-size:18px;line-height:16px}.mx-conversation-toggle[aria-expanded=true]{background:var(--accent-soft);color:var(--accent)}
.mx-conversation-messages{padding:4px 10px 10px 20px;background:var(--surface-2);border-bottom:1px solid var(--line)}.mx-conversation-messages>p{font-size:11px;line-height:1.4;padding:4px 6px}
.mx-conversation-message{display:flex;flex-direction:column;gap:4px;align-items:stretch;text-align:left;width:100%;padding:10px 12px;margin:4px 0;border-radius:9px;background:var(--surface);border:1px solid transparent;min-width:0}
.mx-conversation-message.on{border-color:var(--accent);background:var(--accent-soft)}.mx-conversation-message.unread .mx-conversation-subject{font-weight:700}.mx-conversation-sender{display:flex;gap:8px;align-items:baseline;min-width:0}.mx-conversation-sender b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.mx-conversation-sender small{font-size:10px;flex:none;color:var(--muted)}
.mx-conversation-subject,.mx-conversation-snippet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.mx-conversation-snippet{color:var(--muted);font-size:11px}.mx-conversation-message>small{font-size:10px;color:var(--muted)}
@media(max-width:600px){.mx-conversation-messages{padding-left:12px}.mx-conversation-message{padding:9px}.mx-conversation-sender{flex-wrap:wrap;gap:3px}.mx-conversation-sender b{flex-basis:100%}}

.mx .mx-conversation-toggle{flex-direction:row;white-space:nowrap;line-height:1}.mx .mx-conversation-chevron{width:6px;height:6px;flex:none;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);margin-right:3px}.mx .mx-conversation-toggle[aria-expanded=true] .mx-conversation-chevron{transform:rotate(45deg);margin-top:-3px}

/* Marketing campaigns: purpose, materials and measured results share one card. */
.smm-campaign-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.smm-campaign-heading h2,.smm-campaign-heading h3{margin:0}.smm-campaign-heading p{margin:6px 0}
.smm-campaign-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:14px;margin:18px 0}.smm-campaign-grid>article{border:1px solid var(--line);border-radius:12px;padding:18px;min-width:0}.smm-campaign-grid h3{font-size:17px;margin:8px 0;overflow-wrap:anywhere}.smm-campaign-goal{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;line-height:1.55;white-space:pre-wrap}
.smm-campaign-tabs{margin:18px 0;padding-bottom:12px;border-bottom:1px solid var(--line);flex-wrap:wrap}.smm-campaign-tabs button[aria-pressed=true]{color:var(--accent);background:var(--accent-soft);border-color:var(--accent)}
.smm-campaign-plan{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.smm-campaign-plan>div{min-width:0;overflow-wrap:anywhere}.smm-campaign-plan small{display:block;color:var(--muted);margin-top:5px}.smm-campaign-plan button{flex:none}
.smm-campaign-modal .smm-copy{overflow-wrap:anywhere}.smm-campaign-modal .smm-result-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}.smm-campaign-modal .row{flex-wrap:wrap}.smm-campaign-modal .card{min-width:0}.smm-campaigns>.row{flex-wrap:wrap}
@media(max-width:600px){.smm-campaign-grid>article{padding:14px}.smm-campaign-plan{align-items:flex-start;flex-wrap:wrap}.smm-campaign-tabs{gap:6px}.smm-campaign-tabs button{padding:7px 9px;font-size:12px}.smm-campaign-modal .smm-result-grid{grid-template-columns:1fr 1fr}.smm-campaign-modal .smm-result-grid b{font-size:20px}.smm-campaign-modal input,.smm-campaign-modal select{min-width:0;max-width:100%}}

/* Marketing workbench: scoped stages, report, screenshot verification. */
.smm-section-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 18px}.smm-section-tabs button[aria-pressed=true]{background:var(--accent,#c90016);color:#fff;border-color:transparent}.smm-board{display:grid;grid-template-columns:repeat(4,minmax(240px,1fr));gap:14px;overflow-x:auto;max-width:100%;padding-bottom:12px;align-items:start}.smm-board-column{min-width:0;background:var(--surface-2,#f5f5f7);padding:12px;border:1px solid var(--border,#e1e1e8);border-radius:14px}.smm-board-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.smm-board-heading h2{font-size:15px;margin:0}.smm-board-heading>b{background:var(--surface,#fff);border-radius:20px;padding:3px 9px}.smm-board-card{background:var(--surface,#fff);padding:14px;border:1px solid var(--border,#e1e1e8);border-radius:10px;margin:10px 0;overflow-wrap:anywhere}.smm-board-card h3{font-size:15px;margin:10px 0}.smm-board-card small{display:block}.smm-board-excerpt{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.5}.smm-board-card .smm-actions button{font-size:12px;padding:7px 10px}.smm-idea-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:12px}.smm-idea-grid>article,.smm-recommendation{border:1px solid var(--border,#e1e1e8);padding:16px;border-radius:12px;overflow-wrap:anywhere}.smm-idea-grid>article>p{margin:8px 0}.smm-recommendation{margin:12px 0}.smm-recommendation h4{margin:0 0 8px}.smm-metric-button{text-align:left;white-space:normal;display:flex;flex-direction:column;gap:5px;padding:16px}.smm-metric-button b{font-size:24px}.smm-marketing-results small{display:block}.smm-daily-bars{display:flex;align-items:end;gap:8px;overflow:auto;padding:20px 0;max-width:100%;min-height:165px}.smm-daily-bars>div{flex:0 0 36px;text-align:center;font-size:11px}.smm-daily-bars i{display:block;width:18px;margin:auto;background:var(--accent,#c90016);border-radius:4px 4px 0 0}.smm-import-values{display:grid;grid-template-columns:1fr auto;gap:8px 20px}.smm-import-values dd{margin:0;font-weight:600}.smm-mailing-import{padding:16px;background:var(--surface-2,#f5f5f7);border:1px solid var(--border,#e1e1e8);border-radius:12px;margin:12px 0 20px}.smm-mailing-import pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}.smm-history-compare{display:grid;grid-template-columns:1fr 1fr;gap:20px}.smm-history-compare>article{min-width:0;overflow-wrap:anywhere}.smm-section-tabs,.smm-marketing-results,.smm-ideas{min-width:0}.smm-marketing-results .smm-result-table{max-width:100%;overflow:auto}
@media(max-width:700px){.smm-board{grid-template-columns:repeat(4,minmax(275px,85vw))}.smm-history-compare{grid-template-columns:1fr}.smm-section-tabs button{flex:1 1 42%;font-size:13px}.smm-mailing-import{padding:12px}.smm-idea-grid{grid-template-columns:1fr}}

.smm-workbench-intro>details{margin:8px 0 14px}.smm-filter-fields{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));align-items:end;margin-top:12px}.smm-filter-fields input,.smm-filter-fields select{max-width:100%;width:100%;min-width:0}.smm-filter-fields>label{min-width:0}.smm-ideas>details>summary{padding:10px 0}.smm-ideas .smm-campaign-heading h2{margin-top:0}.smm-workbench-intro>small{display:block;margin-top:8px}
@media(max-width:700px){.smm-filter-fields{grid-template-columns:1fr 1fr}.smm-filter-fields button{font-size:12px}.smm-workbench-intro .row>small{font-size:11px}}

.smm-crop-area{position:relative;touch-action:none;user-select:none;border:1px solid var(--border,#ddd);cursor:crosshair}.smm-crop-area img{width:100%;display:block;pointer-events:none}.smm-crop-area i{position:absolute;border:3px solid #c90016;background:#ff00001a;pointer-events:none;box-sizing:border-box}

.smm-lead-workspace {min-width:0}.smm-lead-url{overflow-wrap:anywhere}.smm-lead-item{margin:14px 0}.smm-lead-item h4{margin:0}.smm-lead-item .smm-copy{overflow-wrap:anywhere;padding:0;margin:8px 0}.smm-lead-workspace fieldset{min-width:0}

.mail-attachment-check{border:1px solid var(--line);background:var(--surface-2);padding:12px;border-radius:10px;margin:10px 0;min-width:0}.mail-attachment-check p{margin:6px 0;overflow-wrap:anywhere}.mail-attachment-check .row{flex-wrap:wrap;gap:8px}.mx-conversation-load{margin:8px;max-width:calc(100% - 16px)}

.mail-files-overview{align-self:flex-start;max-width:100%;white-space:normal;overflow-wrap:anywhere;margin:4px 0 10px;font-size:12px}

.overlay:has(>.conference-setup),.overlay:has(>.conference-effect-dialog){z-index:155}

.conference-setup-toggles input[type=checkbox]{width:18px!important;height:18px!important;min-height:18px!important;max-width:18px;margin:0;flex:0 0 18px;padding:0}
.conference-setup-toggles label{justify-content:flex-start;line-height:1.5}
.conference-live .conference-stage{background:#111c2e;border-radius:16px;margin:10px 0;padding:12px}.conference-live .conference-tile{border:1px solid #344153;border-radius:14px}.conference-live .conference-controls{gap:8px;padding:14px 0 8px;border-top:1px solid var(--line)}.conference-controls>button{min-height:44px;border-radius:12px}.conference-controls>button.on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}.conference-footnote{font-size:12px;color:var(--muted);line-height:1.5}.conference-live .conference-grid{gap:12px}
@media(max-width:700px){.conference-live .conference-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.conference-controls>button{white-space:normal;overflow-wrap:anywhere}.conference-controls>p{grid-column:1/-1}.conference-controls>.internal-call-decline{grid-column:1/-1}.conference-live .conference-stage{padding:8px}}

.conference-effect-preview{width:100%;max-height:240px;aspect-ratio:16/9;border-radius:14px;object-fit:cover;background:#192334}

.deep-background-option{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-start;gap:12px}.deep-background-option img{width:84px;height:48px;object-fit:cover;border:1px solid var(--line);border-radius:6px}

.purchase-resume-fieldset{border:0;padding:0;margin:0;min-width:0;width:100%}.purchase-resume-fieldset:disabled .procurement-plan-line{opacity:.75}

/* Contextual learning stays in the page flow, without covering work controls. */
.learning-panel{margin:10px 0 16px;border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:12px;background:var(--surface);color:var(--content);overflow-wrap:anywhere}
.learning-panel summary{display:flex;gap:12px;align-items:flex-start;padding:12px 16px;cursor:pointer;list-style:none}
.learning-panel summary::-webkit-details-marker{display:none}.learning-badge{font-size:23px;flex:0 0 30px}.learning-panel summary>span:last-child{min-width:0;flex:1}
.learning-purpose{display:block;color:var(--muted);font-size:13px;line-height:1.5;margin-top:4px}.learning-more{display:inline-block;font-size:12px;color:var(--accent);margin-top:5px}
.learning-body{padding:0 16px 14px 58px;font-size:14px;line-height:1.55}.learning-body ol{padding-left:20px}.learning-body li{margin-bottom:7px}.learning-body .row{flex-wrap:wrap;gap:12px}
.learning-settings{padding:10px 14px;border-bottom:1px solid var(--line);background:var(--surface);color:var(--content)}.learning-settings p{margin:7px 0 0;line-height:1.45}.learning-settings input[role=switch]{width:18px;height:18px;flex:0 0 18px}.learning-launcher{white-space:nowrap;flex-shrink:0}
@media(max-width:700px){.learning-panel{margin:8px 0 12px}.learning-panel summary{padding:10px;gap:8px}.learning-body{padding:0 12px 12px}.learning-badge{flex-basis:23px;font-size:20px}.learning-launcher span{display:none}.learning-settings{padding:8px 10px}.learning-settings p{font-size:11px}}
@media print{.learning-panel,.learning-launcher,.learning-settings{display:none!important}}

.learning-assistant{padding:8px 14px;border-bottom:1px solid var(--line);font-size:12px;line-height:1.5;max-height:35vh;overflow:auto;background:var(--surface)}.learning-assistant summary{cursor:pointer;color:var(--accent);font-weight:600}.learning-assistant ol{padding-left:20px}

/* Assistant opens with a short welcome and useful choices, rather than settings or old history. */
.deep-pop{width:min(440px,calc(100vw - 36px));height:min(680px,calc(100dvh - 120px));box-shadow:0 16px 48px rgb(20 28 40 / .19)}
.assist-head{padding:12px 14px;gap:10px;flex-shrink:0}.assist-identity{min-width:0;flex:1}.assist-identity>b{font-size:14px}.assist-identity>.muted{white-space:normal;line-height:1.4;font-size:11px}.assist-options{font-size:24px;line-height:1;width:34px;height:34px;padding:0;flex-shrink:0}
.learning-welcome{padding:8px 2px 16px;width:100%;max-width:500px;margin:0 auto;overflow-wrap:anywhere}.learning-welcome-kicker{font-size:10px;letter-spacing:.08em;font-weight:700;color:var(--accent)}.learning-welcome h2{font-family:inherit;font-size:24px;line-height:1.2;margin:10px 0 12px}.learning-welcome-context{font-size:13px;line-height:1.5;margin:0 0 8px}.learning-welcome>.muted{font-size:12px;line-height:1.5;margin-bottom:18px}.learning-hint-list{display:grid;gap:8px}.learning-hint-list>button{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-weight:500;font-size:13px;color:var(--content)}.learning-hint-list>button:hover,.learning-hint-list>button.on{border-color:var(--accent);background:var(--accent-soft)}.learning-hint-list>button>span:last-child{color:var(--accent);font-size:17px}.learning-hint-answer{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font-size:13px;line-height:1.55}.learning-hint-answer ol{padding-left:20px;margin:10px 0}.learning-hint-answer li{margin-bottom:7px}.learning-welcome-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.learning-welcome-actions>button{font-size:12px;min-height:36px}
.deep-learning-nudge{position:fixed;right:22px;bottom:106px;z-index:3490;display:grid;grid-template-columns:minmax(0,1fr) 40px;width:min(320px,calc(100vw - 36px));border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:0 8px 28px rgb(20 28 40 / .14);overflow:hidden}.deep-learning-open{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere;border:0;background:none;padding:14px 8px 14px 16px;color:var(--content)}.deep-learning-open>b{display:block;max-width:100%;font-size:14px;line-height:1.45;margin:0}.deep-learning-open>span{display:block;color:var(--muted);font-size:12px;line-height:1.4}.deep-learning-dismiss{display:grid;place-items:center;align-self:start;width:32px;height:32px;min-width:32px;margin:6px 8px 0 0;background:none;border:0;color:var(--muted);font-size:20px;line-height:1;padding:0}
@media(max-width:900px){.deep-learning-nudge{bottom:calc(104px + env(safe-area-inset-bottom));right:12px;width:min(280px,calc(100vw - 24px))}.learning-welcome h2{font-size:22px}.learning-welcome{padding-top:6px}}
@media print{.deep-learning-nudge{display:none!important}}

/* Shared required fields: a visible label, clear validation and a keyboard focus target. */
.field-label{display:block}.required-mark{color:var(--danger,#bd2538);font-weight:700}.field-error{display:block;color:var(--danger,#bd2538);font-size:12px;line-height:1.45;margin:5px 0}.field-hint{display:block;font-size:12px;line-height:1.45;margin-top:5px}.field-invalid input,.field-invalid textarea,.field-invalid select,input[aria-invalid=true],textarea[aria-invalid=true],select[aria-invalid=true]{border-color:var(--danger,#bd2538);box-shadow:0 0 0 1px var(--danger,#bd2538)}
label:not(.field):has(>input[required])::after,label:not(.field):has(>select[required])::after,label:not(.field):has(>textarea[required])::after{content:' * Обязательное поле';display:block;color:var(--danger,#bd2538);font-size:11px}
@supports selector(input:user-invalid){input:user-invalid,textarea:user-invalid,select:user-invalid{border-color:var(--danger,#bd2538)}}

/* Field feedback stays next to the action and remains readable at browser zoom. */
.form-action{display:inline-flex;flex-direction:column;align-items:stretch;gap:5px;min-width:0;max-width:100%;vertical-align:top}.form-action>button{max-width:100%;white-space:normal;justify-content:center}.form-action-reason{display:block;max-width:340px;font-size:12px;line-height:1.45;font-weight:400;color:var(--muted);white-space:normal;overflow-wrap:anywhere}.form-feedback-summary{padding:12px 14px;border:1px solid var(--accent);border-radius:9px;background:var(--surface);margin:0 0 14px;color:var(--content);font-size:13px}.form-feedback-summary ul{margin:7px 0 0;padding-left:18px}.form-feedback-summary li{margin:3px 0}.form-feedback-summary button{padding:2px 0;font-weight:400;text-align:left;white-space:normal}.form-feedback-error{white-space:normal;overflow-wrap:anywhere}[data-form-invalid=true]{border-color:var(--accent)!important;outline:1px solid var(--accent)}

.form-draft-shelf{border:1px solid var(--border,#dce0e8);border-radius:12px;padding:12px 16px;margin:12px 0;background:var(--card,#fff)}
.form-draft-shelf summary{cursor:pointer;font-weight:600}.form-draft-shelf p,.form-draft-notice p{font-size:13px;line-height:1.5;margin:8px 0}
.form-draft-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--border,#dce0e8);flex-wrap:wrap}.form-draft-row span{flex:1;min-width:160px}.form-draft-row small{display:block;color:var(--muted,#666);margin-top:4px}
.form-draft-notice{border:1px solid var(--border,#dce0e8);border-left:3px solid var(--accent,#008bc4);border-radius:8px;padding:12px;margin-bottom:14px;font-size:13px;line-height:1.5}.form-draft-notice .row{flex-wrap:wrap;gap:8px}

@media(max-width:600px){.smm-metrics-table table,.smm-metrics-table tbody{display:block}.smm-metrics-table thead{display:none}.smm-metrics-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--line);border-radius:10px;margin:12px 0;padding:8px}.smm-metrics-table td{display:block;min-width:0;overflow-wrap:anywhere;border:0;padding:8px}.smm-metrics-table td:first-child,.smm-metrics-table td:last-child{grid-column:1/-1}.smm-metrics-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;margin-bottom:5px}.smm-metrics-table td:last-child button{white-space:normal}}

/* TenChat: large image workspace and compact controls. */
.tenchat-login-modal.modal.wide{width:calc(100vw - 24px);max-width:none;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);display:flex;flex-direction:column;overflow:hidden;padding:10px}
.tenchat-login-modal>.modal-head{padding:12px 16px}.tenchat-login-modal>.modal-head h2{font-size:17px}
.tenchat-workspace{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;gap:10px;padding:12px;overflow:hidden}
.tenchat-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex:none}.tenchat-toolbar label{display:flex;align-items:center;gap:7px;font-size:13px}.tenchat-toolbar select{width:auto;min-width:120px}.tenchat-toolbar>span{flex:1;min-width:180px}
.tenchat-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:12px;flex:1;min-height:0;min-width:0}.tenchat-layout.image-only{grid-template-columns:minmax(0,1fr)}
.tenchat-screen{overflow:auto;min-height:0;min-width:0;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--app);overscroll-behavior:contain}
.tenchat-controls{min-width:0;overflow:auto;align-content:start;padding:12px;border:1px solid var(--line);border-radius:10px}.tenchat-controls p{margin:0 0 8px}.tenchat-controls details{font-size:12px}.tenchat-status{flex:none;margin:0;font-size:13px}
@media(max-width:800px){.tenchat-login-modal.modal.wide{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.tenchat-workspace{padding:8px;gap:8px}.tenchat-toolbar{gap:6px}.tenchat-toolbar>span{display:none}.tenchat-toolbar button,.tenchat-toolbar select{font-size:12px;padding:8px}.tenchat-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(120px,1fr) auto;gap:8px}.tenchat-layout.image-only{grid-template-rows:minmax(0,1fr)}.tenchat-controls{max-height:32dvh;padding:10px}.tenchat-controls p{font-size:12px}}
.conference-protocol-transfer{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:1300;width:min(560px,calc(100vw - 32px));padding:14px 18px;background:var(--surface,#fff);color:var(--text,#222);border:1px solid var(--line,#ddd);border-radius:12px;box-shadow:0 6px 24px #0002}
@media(max-width:700px){.task-create-dialog>.modal-foot{display:grid;grid-template-columns:minmax(90px,1fr) minmax(0,2fr);align-items:start}.task-create-dialog>.modal-foot>.form-action{width:100%}.task-create-dialog>.modal-foot>.form-action>button{width:100%}.task-create-dialog .form-action-reason{max-width:none}}
.task-detail-dialog>.modal-foot{flex-wrap:wrap;align-items:flex-start}.task-detail-dialog>.modal-foot>.form-action{flex:1 1 180px}

@media(max-width:600px){.recording-recovery-dialog .modal-foot{display:grid;grid-template-columns:1fr;gap:8px}.recording-recovery-dialog .modal-foot button{width:100%;white-space:normal}}

@media(max-width:600px){.voice-job-dialog .modal-foot{display:grid;grid-template-columns:1fr;gap:8px}.voice-job-dialog .modal-foot button{width:100%;white-space:normal}}

.conference-draft-fields{border:0;padding:0;margin:0;min-width:0}.conference-create .form-draft-notice{margin-bottom:12px}
.conference-create .card-inline-error button{white-space:normal;max-width:100%;margin-top:6px}
.recording-vault-banner{position:fixed;bottom:12px;left:12px;z-index:80;max-width:calc(100vw - 100px)}.recording-vault-banner button{box-shadow:0 3px 16px #0002;white-space:normal}.recording-vault-dialog .row{flex-wrap:wrap}@media(max-width:600px){.recording-vault-banner{bottom:68px}.recording-vault-dialog .row button{white-space:normal;flex:1 1 140px}}
.recording-vault-banner{z-index:145}.overlay:has(>.recording-vault-dialog){z-index:170}
/* Required confirmations keep the checkbox compact and stop flagging a completed choice. */
.check:has(>input[type=checkbox][required])::after{content:' *';flex:none;align-self:center;font-weight:700}
.check:has(>input[type=checkbox][required]:checked)::after{content:none}
.check>input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;align-self:center}
.employee-workspace-tabs{gap:8px;flex-wrap:wrap;margin-bottom:18px}.employee-workspace-tabs>a{white-space:normal;text-align:center}@media(max-width:600px){.employee-workspace-tabs>a{flex:1 1 160px;min-height:42px;justify-content:center}}
.employee-workspace-tabs>a[aria-current=page]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.employee-accounts.table-wrap{overflow-x:auto}
.employee-accounts input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;vertical-align:middle}
.delivery-editor{scroll-margin-top:80px}

/* Keep recipe tables scrollable without stretching the editor on phones. */
.production-card-editor,.production-card-editor .prod-sec,.production-card-editor .form-2{min-width:0;max-width:100%}
.production-card-editor .table-wrap{width:100%;min-width:0;overflow-x:auto}
.production-card-editor .psel,.production-card-editor .psel-input{min-width:0;max-width:100%}
.production-card-editor .prod-plan{min-width:440px}
.production-card-editor .production-operation{flex-wrap:wrap}
.production-card-editor .production-operation input{min-width:0}
@media(max-width:600px){.production-card-editor .form-2{grid-template-columns:minmax(0,1fr)}.production-card-editor .production-operation input[placeholder="Операция"]{flex-basis:calc(100% - 32px)!important}.production-card-editor .prod-sec-h{overflow-wrap:anywhere}}

/* Office editing keeps the workspace visible without squeezing the editor into a card. */
.drive-office-modal.modal.wide{width:calc(100vw - 24px);max-width:1600px;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);display:flex;flex-direction:column;overflow:hidden;padding:10px}
.drive-office-surface{flex:1;min-height:0;overflow:hidden}
.drive-office-modal .modal-head,.drive-office-modal .modal-foot{flex:none}
.drive-office-modal .modal-head{margin:0;padding:4px 8px 10px}
.drive-office-modal .modal-foot{margin:0;padding:10px 4px 0}
.drive-office-modal .modal-foot{flex-wrap:wrap;gap:8px}
@media(max-width:700px){.drive-office-modal.modal.wide{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.drive-office-modal .modal-head{padding:8px 12px}.drive-office-modal .modal-head h2{font-size:16px}.drive-office-modal .modal-foot{padding:8px}.drive-office-modal .modal-foot span{width:100%}}

.customer-return-lines{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px}.customer-return-lines .card{margin:0}
