/* Ares CRM. Только тёмная тема (цвета по образцу kargulstudio/sales-crm).
   Стекло только там, где под ним что-то есть: меню, верхняя панель, карточки поверх экрана, поиск, окна.
   Шаг отступов 4: 4, 8, 12, 16, 20, 24, 32, 40. */

@font-face { font-family: "Geist"; src: url("fonts/geist.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #161616; --bg-raise: #1b1d20; --bg-raise-2: #202226; --bg-sunk: #121212;
  --row-hover: rgba(255, 255, 255, 0.035); --row-active: rgba(255, 255, 255, 0.065);
  --fg: #f9fbff; --soft: #a4a4a4; --muted: #7f7f7f; --faint: #454545;
  --line: #232323; --line-strong: #393939; --input: #1f2124; --chip: #2a2a2a;
  --accent: #d87756; --accent-ink: #1a0f0a; --accent-soft: rgba(216, 119, 86, 0.14); --accent-line: rgba(216, 119, 86, 0.38);
  --ok: #22c55e; --bad: #f97373;
  --glass: rgba(26, 26, 28, 0.6); --glass-heavy: rgba(22, 22, 24, 0.8); --glass-edge: rgba(255, 255, 255, 0.07); --glass-top: rgba(255, 255, 255, 0.055);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -16px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --glow-a: rgba(216, 119, 86, 0.10); --glow-b: rgba(88, 120, 200, 0.07);
  --t-blue-bg: #1d2b3e; --t-blue-line: #23354c; --t-blue: #bfdbfe;
  --t-purple-bg: #231f3a; --t-purple-line: #4b437b; --t-purple: #b7aee9;
  --t-green-bg: #1f3a2d; --t-green-line: #275137; --t-green: #b1ebc5;
  --t-red-bg: #3e1d1e; --t-red-line: #4c2324; --t-red: #febfc6;
  --t-orange-bg: #3e291d; --t-orange-line: #764d35; --t-orange: #eeb390;
  --t-teal-bg: #102a27; --t-teal-line: #2b5048; --t-teal: #8fe0cf;
  --t-gray-bg: #2a2a2a; --t-gray-line: #363636; --t-gray: #cfcfcf;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --side-w: 248px;
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(900px 600px at 8% -10%, var(--glow-a), transparent 70%), radial-gradient(800px 700px at 100% 110%, var(--glow-b), transparent 70%), var(--bg);
  background-attachment: fixed; color: var(--fg); overflow: hidden;
}
::selection { background: var(--accent-soft); color: var(--fg); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; border-radius: var(--r-sm); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--faint); }
h1, h2, h3, p { margin: 0; }
.num, time, .tab-n, .count, .due { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.xs { width: 12px; height: 12px; }
svg.i.flip { transform: rotate(180deg); }
[hidden] { display: none !important; }
.min { min-width: 0; }
.muted { color: var(--muted); }
.sp { flex: 1; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); border: 1px solid var(--glass-edge); box-shadow: 0 1px 0 var(--glass-top) inset; }
.glass-heavy { background: var(--glass-heavy); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }

/* ---------- знак ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); }
.brand .mark { width: 18px; height: 20px; color: var(--accent); flex: none; overflow: visible; }
.brand .word { font-size: 15px; font-weight: 600; letter-spacing: 0.3em; margin-right: -0.15em; line-height: 1; flex: none; }
.brand .crm { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 5px; }
.brand.big .mark { width: 26px; height: 29px; }
.brand.big .word { font-size: 22px; }
.brand.big .crm { font-size: 12.5px; padding: 2px 6px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
.side { margin: 10px 0 10px 10px; border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; }
.side-brand { display: flex; padding: 4px 10px 18px; text-decoration: none; }
.nav { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-group { padding: 2px 0 10px; }
.nav-title { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; font-weight: 500; }
.nav a, .side-foot a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--soft);
  text-decoration: none; border: 1px solid transparent; transition: background-color 120ms ease, color 120ms ease;
}
.nav a:hover, .side-foot a:hover { background: var(--row-hover); color: var(--fg); }
.nav a[aria-current="page"], .side-foot a[aria-current="page"] { color: var(--fg); background: var(--row-active); border-color: var(--line-strong); box-shadow: 0 1px 0 var(--glass-top) inset; }
.nav .lbl, .side-foot .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; background: var(--chip); color: var(--soft); border: 1px solid var(--line-strong); }
.count.hot { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-foot .me { height: auto; padding: 8px 10px; margin-top: 4px; gap: 10px; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-weight: 550; color: var(--fg); }
.me .who span { font-size: 12px; color: var(--muted); }

main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { margin: 10px 10px 0; border-radius: var(--r-lg); height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 20px; position: relative; z-index: 2; }
.top h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--soft); font-size: 12px; background: var(--row-hover); white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.live.off i { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.iconbtn {
  position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong); background: var(--row-hover); color: var(--soft);
  transition: color 120ms ease, background-color 120ms ease, transform 120ms var(--ease-out);
}
.iconbtn.sm { width: 28px; height: 28px; }
.iconbtn:hover { color: var(--fg); background: var(--row-active); }
.iconbtn:disabled { opacity: 0.4; cursor: default; }
.dotbadge { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.searchbtn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: 18px; min-width: 240px; border: 1px solid var(--line-strong); background: var(--row-hover); color: var(--muted); transition: color 120ms ease; }
.searchbtn:hover { color: var(--soft); }
.searchbtn span { flex: 1; text-align: left; }
kbd { display: inline-flex; align-items: center; gap: 2px; font: 500 11px/1 "Geist", system-ui, sans-serif; color: var(--soft); background: var(--chip); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 4px 6px; }
.view { flex: 1; overflow-y: auto; padding: 24px 28px 48px; }
.view-in { max-width: 1280px; margin: 0 auto; }
.view-in.v-leads, .view-in.v-projects, .view-in.v-chats { max-width: none; }

/* ---------- кнопки, поля, метки ---------- */
.btn {
  height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg-raise-2); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out);
}
.btn:hover { background: var(--row-active); }
.btn:active, .iconbtn:active, .seg button:active, .tile:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.armed, .switch.armed { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent-line); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--soft); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn:hover { color: var(--fg); }
.chipbtn { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--chip); color: var(--soft); font-size: 13px; }
.chipbtn:hover { color: var(--fg); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid; background: var(--t-gray-bg); border-color: var(--t-gray-line); color: var(--t-gray); flex: none; }
.tag.sm { height: 20px; padding: 0 7px; font-size: 11.5px; }
.tag.blue { background: var(--t-blue-bg); border-color: var(--t-blue-line); color: var(--t-blue); }
.tag.purple { background: var(--t-purple-bg); border-color: var(--t-purple-line); color: var(--t-purple); }
.tag.green { background: var(--t-green-bg); border-color: var(--t-green-line); color: var(--t-green); }
.tag.red { background: var(--t-red-bg); border-color: var(--t-red-line); color: var(--t-red); }
.tag.orange { background: var(--t-orange-bg); border-color: var(--t-orange-line); color: var(--t-orange); }
.tag.teal { background: var(--t-teal-bg); border-color: var(--t-teal-line); color: var(--t-teal); }
.tag.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; background: var(--t-gray-bg); color: var(--t-gray); border: 1px solid var(--t-gray-line); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xs { width: 18px; height: 18px; font-size: 8.5px; }
.av.sm { width: 20px; height: 20px; font-size: 9px; }
.av.sm svg.i { width: 11px; height: 11px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.xl { width: 88px; height: 88px; font-size: 28px; }
.av.co { border-radius: 8px; }
.av.co.lg { border-radius: 12px; }
.av.co.xs, .av.co.sm { border-radius: 5px; }
.av.claude { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.av.blue { background: var(--t-blue-bg); color: var(--t-blue); border-color: var(--t-blue-line); }
.av.purple { background: var(--t-purple-bg); color: var(--t-purple); border-color: var(--t-purple-line); }
.av.green { background: var(--t-green-bg); color: var(--t-green); border-color: var(--t-green-line); }
.av.red { background: var(--t-red-bg); color: var(--t-red); border-color: var(--t-red-line); }
.av.orange { background: var(--t-orange-bg); color: var(--t-orange); border-color: var(--t-orange-line); }
.av.teal { background: var(--t-teal-bg); color: var(--t-teal); border-color: var(--t-teal-line); }
.who-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--soft); white-space: nowrap; min-width: 0; }
.who-chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.who-chip.muted { color: var(--muted); }

.field { height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--input); padding: 0 12px; outline: none; min-width: 0; transition: border-color 120ms ease; }
.field:focus { border-color: var(--accent-line); }
.field::placeholder { color: var(--muted); }
textarea.field { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }
select.field { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f7f7f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
.field.sm { height: 30px; font-size: 13px; border-radius: 8px; }
input[type="date"].field { padding-right: 8px; }
.search-in { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--input); color: var(--muted); min-width: 300px; }
.search-in input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; color: var(--fg); }
.search-in:focus-within { border-color: var(--accent-line); }
.search-in.flat { border-radius: 0; border-width: 0 0 1px; background: transparent; height: 46px; padding: 0 16px; min-width: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-sunk); border: 1px solid var(--line); gap: 2px; flex: none; }
.seg button { height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; transition: color 120ms ease, background-color 160ms ease; }
.seg button:hover { color: var(--soft); }
.seg button[aria-pressed="true"] { background: var(--bg-raise-2); color: var(--fg); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.switch { position: relative; width: 38px; height: 22px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--chip); padding: 0; flex: none; transition: background-color 160ms ease, border-color 160ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--soft); transition: transform 220ms var(--ease-out), background-color 160ms ease; }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--accent-ink); }
.switch:disabled { opacity: 0.55; cursor: default; }

/* ---------- панели и списки ---------- */
.panel { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 1px 0 var(--glass-top) inset; min-width: 0; }
.panel + .panel, .panel + section, section + .panel, .grid2 + .panel, .panel + .grid2, .stat-row + .panel, .stat-row + .grid2 { margin-top: 16px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; min-height: 50px; }
.panel-h h2 { font-size: 14px; font-weight: 600; }
.panel-h .hint { color: var(--muted); font-size: 13px; }
.empty { padding: 20px 16px 24px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.empty b { color: var(--soft); font-weight: 550; }
.empty.pad { padding: 28px 20px; }
.empty.center { align-items: center; justify-content: center; text-align: center; height: 100%; gap: 8px; }
.empty.center svg.i { width: 28px; height: 28px; color: var(--faint); }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.note.pad { padding: 4px 16px 16px; }
.page-head { display: flex; align-items: flex-end; gap: 20px; margin: 0 2px 18px; }
.page-head p { color: var(--muted); max-width: 760px; flex: 1; }
.page-head p b { color: var(--fg); font-weight: 550; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.page-note { color: var(--muted); margin: -4px 2px 16px; }
.rows { display: flex; flex-direction: column; padding: 0 6px 6px; }
.row { display: grid; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; border: 1px solid transparent; transition: background-color 120ms ease; }
.row[data-a] { cursor: pointer; }
.row[data-a]:hover, .row:focus-visible { background: var(--row-hover); }
.row .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .name.wrap { white-space: normal; font-weight: 450; }
.row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex: none; }
.msg, .cell-msg { color: var(--soft); display: flex; gap: 6px; align-items: center; min-width: 0; }
.msg span, .cell-msg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg svg.i, .cell-msg svg.i { color: var(--muted); }
.msg.in svg.i, .cell-msg.in svg.i { color: var(--accent); }
.msg.none, .cell-msg.none { color: var(--muted); }
.due { font-size: 13px; color: var(--soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.due.today { color: var(--accent); }
.due.late { color: var(--bad); }
.due.none { color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--soft); }
.tabs a[aria-current="page"] { color: var(--fg); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--fg); }
.tab-n { font-size: 12px; color: var(--muted); background: var(--chip); border-radius: 9px; padding: 1px 7px; font-weight: 500; }
.tab-n.hot { background: var(--accent-soft); color: var(--accent); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.subtabs a { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.subtabs a span { color: var(--faint); }
.subtabs a[aria-current="page"] { color: var(--fg); background: var(--row-active); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select.field { max-width: 200px; }
.more { display: flex; justify-content: center; padding: 16px; }
.skeleton-page { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.skeleton-page i { display: block; height: 56px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--bg-raise) 0%, var(--row-active) 50%, var(--bg-raise) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-page i:first-child { height: 34px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 0 var(--glass-top) inset; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.stat b.accent { color: var(--accent); }
.stat b.bad, .bad { color: var(--bad); }
.good { color: var(--ok); display: inline-flex; gap: 4px; align-items: center; }
.stat em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.meter-l { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; margin: 4px 0; }
.meter-l i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 400ms var(--ease-out); }
.grid2 > *, .accounts > *, .people-grid > *, .stat-row > * { margin-top: 0 !important; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.ctable { padding: 0 6px 8px; }
.ct-h, .ct-r { display: grid; gap: 12px; align-items: center; padding: 0 10px; grid-template-columns: minmax(200px, 2fr) repeat(5, minmax(64px, 1fr)); }
.ct-h { height: 34px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.ct-r { min-height: 46px; border-bottom: 1px solid var(--line); }
.ct-r:last-child { border-bottom: 0; }
.ct-r.clickable { cursor: pointer; border-radius: 8px; }
.ct-r.clickable:hover { background: var(--row-hover); }
.ct-r.dim { opacity: 0.55; }
.ct-r .min b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-r em { font-style: normal; color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-t .ct-h, .pay-t .ct-r { grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(90px, 1fr)); }
.pays-t .ct-h, .pays-t .ct-r { grid-template-columns: minmax(180px, 2fr) 80px 120px 100px 140px 110px; }
.agents-t .ct-h, .agents-t .ct-r { grid-template-columns: 1fr 1.4fr 1fr 1fr 110px; }
.mini-list { display: flex; flex-direction: column; }
.mini-list.x > div { grid-template-columns: minmax(0, 1fr) auto 100px 28px; }
.mini-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto 100px; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.mini-list > div:last-child { border-bottom: 0; }
.mini-list .num { text-align: right; }
.mini-list.pad { padding: 0 16px 8px; }
.mini-list em { font-style: normal; }
.feed { list-style: none; margin: 0; padding: 0 16px 12px; }
.feed li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 8px 0; font-size: 13px; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--muted); }
.feed .t { color: var(--soft); }
.month { display: inline-flex; align-items: center; gap: 6px; }
.month b { min-width: 118px; text-align: center; font-weight: 550; }
.sw-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.panel-h + .sw-row { border-top: 0; }
.sw-row b { font-weight: 550; display: block; }
.sw-row span { color: var(--muted); font-size: 13px; }
.sw-banner { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 16px; }
.sw-banner > div { flex: 1; }
.sw-banner b { display: block; font-weight: 550; }
.sw-banner span { color: var(--muted); font-size: 13px; }
.sw-banner.on { border-color: var(--accent-line); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--bg-raise); }

/* ---------- главная ---------- */
.v-home { max-width: 1120px; }
.home { padding: 3vh 0 24px; display: flex; flex-direction: column; gap: 32px; }
.home-head { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.home-day { color: var(--muted); font-size: 13.5px; }
.home-head h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
.home-line { color: var(--soft); font-size: 16px; max-width: 640px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; min-height: 176px; border-radius: var(--r-xl);
  text-decoration: none; color: var(--fg); overflow: hidden; isolation: isolate;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-edge); box-shadow: 0 1px 0 var(--glass-top) inset;
  transition: transform 200ms var(--ease-out), border-color 160ms ease, background-color 160ms ease;
}
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 100% 0%, var(--row-active), transparent 60%); opacity: 0; transition: opacity 200ms ease; }
.tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tile:hover::before { opacity: 1; }
.tile.hot { border-color: var(--accent-line); }
.tile.hot::after { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(90% 70% at 0% 100%, var(--accent-soft), transparent 70%); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.tile-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--row-active); border: 1px solid var(--line-strong); color: var(--soft); }
.tile.hot .tile-ico { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tile-go { color: var(--faint); transition: color 160ms ease, transform 200ms var(--ease-out); }
.tile:hover .tile-go { color: var(--soft); transform: translateX(2px); }
.tile-title { font-weight: 550; color: var(--soft); margin-top: 18px; }
.tile-n { font-size: 34px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.tile-n small { font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tile.hot .tile-n { color: var(--accent); }
.tile-n.empty-n { display: none; }
.tile-cap { min-height: 2.8em; color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-status { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--soft); font-size: 13px; padding: 0 4px; }
.st-item { display: inline-flex; align-items: center; gap: 7px; }
.st-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.st-item i.ok { background: var(--ok); }
.st-item i.bad { background: var(--bad); }
.st-sep { width: 1px; height: 14px; background: var(--line-strong); }

/* ---------- дела ---------- */
.group + .group { margin-top: 20px; }
.group-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--soft); margin: 0 4px 8px; }
.group-h span { color: var(--muted); font-weight: 500; }
.group-h.late { color: var(--bad); }
.group-h.today { color: var(--accent); }
.group .rows { padding: 6px; }
.task-row { grid-template-columns: 30px minmax(0, 1.2fr) minmax(0, 1fr) 128px 150px; }
.task-row > .tag { justify-self: start; }
.task-row > .due { justify-self: end; }
.task-row .name { font-weight: 500; }
.tick { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: transparent; display: grid; place-items: center; color: transparent; transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease; }
.tick:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tick.ghost { border-style: dashed; color: var(--faint); }
.task-msg { min-width: 0; }

/* ---------- переписка ---------- */
.chats { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.chat-list { display: flex; flex-direction: column; overflow: hidden; }
.chat-list .rows { overflow-y: auto; padding: 6px; flex: 1; }
.chat-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 10px; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; transition: background-color 120ms ease; }
.chat-item .av { width: 32px; height: 32px; }
.chat-item:hover { background: var(--row-hover); }
.chat-item.on { background: var(--row-active); }
.chat-item .ci-top { display: flex; gap: 8px; align-items: baseline; }
.chat-item .ci-top b { flex: 1; min-width: 0; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item time { color: var(--muted); font-size: 12px; flex: none; }
.chat-item.wait time { color: var(--accent); }
.chat-item .txt { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.wait .txt { color: var(--soft); }
.chat-item .me { color: var(--faint); }
.wait-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chat-pane { display: flex; flex-direction: column; overflow: hidden; }
.pane-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pane-h .min { flex: 1; }
.pane-h b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-h .min span { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pane-actions:empty { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* ---------- лиды ---------- */
.table { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-raise); overflow: hidden; }
.thead, .trow { display: grid; grid-template-columns: minmax(220px, 1.3fr) 128px 136px minmax(200px, 1.5fr) minmax(160px, 1.1fr) 150px; gap: 14px; align-items: center; padding: 0 16px; }
.thead { height: 40px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.trow { height: 56px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color 120ms ease; }
.trow:last-child { border-bottom: 0; }
.trow:hover, .trow:focus-visible { background: var(--row-hover); }
.cell-co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-co b { font-weight: 550; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-co span { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-step { min-width: 0; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-grid { grid-template-columns: minmax(220px, 1.4fr) 160px 140px minmax(160px, 1fr) 190px; }
.ext { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ext:hover { color: var(--fg); text-decoration: underline; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--bg-raise); border: 1px solid var(--line); cursor: pointer; box-shadow: 0 1px 0 var(--glass-top) inset; transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.lcard:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.lcard-h { display: flex; gap: 10px; align-items: center; }
.lcard-h .av { width: 36px; height: 36px; }
.lcard-h b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-h span { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.lcard-step { display: flex; flex-direction: column; gap: 2px; }
.lcard-step span:first-child { color: var(--muted); font-size: 12px; }
.lcard-step b { font-weight: 500; }
.lcard-f { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.lcard-f .who-chip { flex: 1; }
.score { width: 56px; height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.score i { display: block; height: 100%; background: var(--soft); }
.dups { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--t-orange-line); background: var(--t-orange-bg); color: var(--t-orange); margin-top: 4px; }

/* ---------- проекты ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; min-height: 200px; }
.col-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 550; color: var(--soft); padding: 4px 6px 10px; }
.col-b { display: flex; flex-direction: column; gap: 8px; }
.col-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 20px 0; border: 1px dashed var(--line-strong); border-radius: 10px; }
.pcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg-raise); border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.pcard:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pcard.late { border-color: var(--t-red-line); }
.pcard-h { display: flex; align-items: center; gap: 8px; }
.pcard-h b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-t { color: var(--soft); font-size: 13px; }
.pcard-m { display: flex; gap: 6px; align-items: baseline; }
.pcard-m .num { font-weight: 600; }
.pcard-m .muted { font-size: 12.5px; }
.pcard-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.paybar { height: 5px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.paybar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

/* ---------- рассылки и парсер ---------- */
.accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.acc { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.acc-h { display: flex; align-items: center; gap: 12px; }
.acc-h .av { width: 34px; height: 34px; }
.acc-h .min { flex: 1; }
.acc-h b { display: block; font-weight: 600; }
.acc-h span { color: var(--muted); font-size: 13px; }
.acc-n { display: flex; align-items: baseline; gap: 8px; }
.acc-n b { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.acc-n span { color: var(--muted); }
.acc-n .linkbtn { margin-left: auto; }
.acc .btn { align-self: flex-start; }
.queue-row { grid-template-columns: minmax(0, 1fr) auto 20px; }
.trash-row { grid-template-columns: minmax(0, 1fr) auto; }
.row-act { display: flex; justify-content: flex-end; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 180px; padding: 8px 16px 16px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar i { display: block; width: 100%; max-width: 34px; min-height: 3px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); }
.bar span { font-size: 12px; color: var(--soft); min-height: 16px; }
.bar em { font-style: normal; font-size: 12px; color: var(--muted); }
.plan-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); margin-right: 10px; vertical-align: 1px; }
.plan-dot.on { background: var(--accent); }

/* ---------- аналитика ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 18px; }
.f-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px 48px; gap: 14px; align-items: center; }
.f-name { color: var(--soft); }
.f-bar { height: 26px; border-radius: 7px; background: var(--bg-sunk); overflow: hidden; }
.f-bar i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, transparent), var(--accent)); transition: width 500ms var(--ease-out); }
.f-bar.muted i { background: var(--line-strong); }
.f-row b, .hb b { text-align: right; font-weight: 600; }
.f-conv { color: var(--muted); font-size: 12.5px; text-align: right; }
.hbars { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 18px; }
.hb { display: grid; grid-template-columns: 150px minmax(0, 1fr) 48px; gap: 14px; align-items: center; }
.hb span { color: var(--soft); }
.hb .f-bar { height: 18px; }

/* ---------- сотрудники и настройки ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.person { padding: 16px 16px 8px; }
.person.off { opacity: 0.6; }
.person-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.person-h b { display: block; font-weight: 600; font-size: 15px; }
.person-h span { color: var(--muted); font-size: 13px; }
.prop-row { grid-template-columns: minmax(0, 1fr) auto; }
.secret code { font: 600 18px/1.4 ui-monospace, "Cascadia Mono", monospace; background: var(--chip); padding: 8px 12px; border-radius: 8px; display: inline-block; letter-spacing: 0.04em; }
.set { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.set .panel + .panel { margin-top: 0; }
.set-row { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 14px 16px; align-items: center; border-top: 1px solid var(--line); }
.panel-h + .set-row { border-top: 0; }
.set-row > div:first-child b { display: block; font-weight: 550; }
.set-row > div:first-child span { color: var(--muted); font-size: 13px; }
.set-row .seg { justify-self: start; }
.ava-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- панель карточки ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.34); opacity: 0; transition: opacity 220ms ease; z-index: 20; }
.scrim.on { opacity: 1; }
.scrim.proj { z-index: 22; }
.sheet {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(640px, calc(100vw - 20px)); z-index: 21; border-radius: var(--r-xl);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-heavy); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  transform: translateX(28px) scale(0.985); opacity: 0; filter: blur(6px);
  transition: transform 340ms var(--ease-drawer), opacity 220ms var(--ease-out), filter 260ms var(--ease-out);
}
.sheet.proj { z-index: 23; width: min(600px, calc(100vw - 20px)); }
.sheet.on { transform: none; opacity: 1; filter: none; }
.sheet-h { padding: 18px 16px 14px 20px; display: flex; gap: 14px; align-items: flex-start; border-bottom: 1px solid var(--line); flex: none; }
.sheet-h .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sheet-h h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.sheet-h .sub { color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sheet-h .sub .sep { color: var(--faint); }
.sheet-h .sub svg.i { color: var(--soft); }
.sheet-h .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.sheet-h .tags:empty { display: none; }
.sheet-b { flex: 1; overflow-y: auto; min-height: 0; }
.blocks { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 6px; }
.block { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; background: color-mix(in srgb, var(--bg-raise) 60%, transparent); }
.block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.block-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 22px; }
.block-h h3 { font-size: 13px; font-weight: 550; color: var(--soft); }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-sunk); border: 1px solid var(--line); }
.stages.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stages .st { height: 32px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); font-weight: 500; font-size: 13px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 120ms ease, background-color 160ms ease; }
.stages .st:hover { color: var(--fg); }
.stages .st[aria-pressed="true"] { background: var(--bg-raise-2); color: var(--fg); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.stages .st.blue[aria-pressed="true"] { color: var(--t-blue); }
.stages .st.purple[aria-pressed="true"] { color: var(--t-purple); }
.stages .st.orange[aria-pressed="true"] { color: var(--t-orange); }
.stages .st.green[aria-pressed="true"] { color: var(--t-green); }
.outs { display: flex; flex-wrap: wrap; gap: 4px 2px; margin-top: 8px; }
.outs-l { color: var(--muted); font-size: 13px; padding: 0 6px 0 2px; display: inline-flex; align-items: center; }
.outs button { height: 28px; padding: 0 10px; border-radius: 7px; background: none; border: 1px solid transparent; color: var(--muted); font-size: 13px; }
.outs button:hover { color: var(--fg); background: var(--row-hover); }
.outs button[aria-pressed="true"] { color: var(--fg); border-color: var(--line-strong); background: var(--row-active); }
.step-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nowrap { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.step-row .min { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.step-row b { font-weight: 550; font-size: 15px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lead-row .owner { margin-left: auto; }
.lbl-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.block .note { margin-top: 8px; }
.link-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 8px; color: var(--fg); text-decoration: none; }
.link-row a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover, a.link-row:hover { text-decoration: underline; }
.proj-link { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg-raise-2); text-align: left; }
.proj-link span:first-child { flex: 1; font-weight: 500; }
.proj-link:hover { background: var(--row-active); }
.sheet-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; padding: 0 12px; margin-top: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--glass-heavy); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.sheet-tabs button { position: relative; background: none; border: 0; padding: 12px 10px; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.sheet-tabs button:hover { color: var(--soft); }
.sheet-tabs button[aria-selected="true"] { color: var(--fg); }
.sheet-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--fg); border-radius: 2px; }
.tab-body { min-height: 200px; }
.sheet-end { display: flex; align-items: center; gap: 12px; padding: 16px 20px 20px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 12.5px; }
.chat { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; }
.chat-day { display: flex; justify-content: center; padding: 10px 0 4px; }
.chat-day span { color: var(--muted); font-size: 12px; background: var(--row-hover); padding: 2px 10px; border-radius: 10px; }
.bub { max-width: 82%; padding: 8px 12px 6px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bub.in { align-self: flex-start; background: var(--chip); border-bottom-left-radius: 5px; }
.bub.out { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--accent-line); border-bottom-right-radius: 5px; }
.bub.out.queued { opacity: 0.75; border-style: dashed; }
.bub.out.failed { border-color: var(--bad); }
.bub.auto { opacity: 0.7; }
.bub .meta { display: flex; gap: 5px; align-items: center; justify-content: flex-end; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.chat-note { align-self: center; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; padding: 6px 0; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: none; background: var(--glass-heavy); }
.composer textarea { width: 100%; resize: none; min-height: 60px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); padding: 10px 12px; outline: none; line-height: 1.45; }
.composer textarea:focus { border-color: var(--accent-line); }
.composer .act { display: flex; align-items: center; gap: 12px; }
.composer .hint { color: var(--muted); font-size: 12.5px; flex: 1; }
.problems { color: var(--bad); font-size: 13px; margin: 0; padding-left: 18px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); padding: 4px 20px 12px; margin: 0; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.kv dd a { color: var(--fg); text-decoration: none; }
.kv dd a:hover { text-decoration: underline; }
.kv.compact { padding: 0; grid-template-columns: 150px minmax(0, 1fr); }
.kv.compact dt, .kv.compact dd { padding: 7px 0; font-size: 13px; }
.kv.compact dt:last-of-type, .kv.compact dd:last-of-type { border-bottom: 0; }
.sub-h { font-size: 13px; font-weight: 550; color: var(--soft); padding: 16px 20px 8px; }
.modal-b .sub-h { padding: 4px 0 0; }
.reviews { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }
.reviews blockquote { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--row-hover); color: var(--soft); font-size: 13px; line-height: 1.5; }
.stars { display: block; color: var(--accent); letter-spacing: 1px; margin-bottom: 4px; font-size: 12px; }
.stars i { color: var(--faint); font-style: normal; }
.quote.flat { margin: 0 0 8px; border-style: solid; }
.first-text { width: 100%; min-height: 96px; margin-bottom: 8px; }
.btnrow.end { align-items: center; }
.btnrow.end .note { margin: 0; }
.seg.small button { height: 24px; padding: 0 9px; font-size: 12.5px; }
.lcard-h .site { display: inline-flex; align-items: center; gap: 5px; color: var(--soft); }
.cell-co span svg.i { vertical-align: -1px; }
.quote { margin: 0 20px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--soft); white-space: pre-wrap; }
.note-form { display: flex; gap: 8px; padding: 0 20px 16px; align-items: flex-start; }
.note-form textarea { flex: 1; }
.journal { list-style: none; margin: 0; padding: 8px 20px 16px; }
.journal li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.journal.flat { padding: 0; }
.journal.flat li { grid-template-columns: 1fr; }
.journal .t { color: var(--soft); overflow-wrap: anywhere; }
.journal .m { color: var(--muted); font-size: 12px; margin-top: 2px; }
.journal li.undone .t { text-decoration: line-through; color: var(--muted); }
.creds { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.creds > .btn { align-self: flex-start; }
.cred { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.cred .min { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cred b { font-weight: 550; }
.cred span { color: var(--muted); font-size: 13px; }
.cred code { font: 500 13px/1.4 ui-monospace, "Cascadia Mono", monospace; color: var(--fg); background: var(--chip); padding: 2px 6px; border-radius: 5px; align-self: flex-start; }
.pays { display: flex; flex-direction: column; margin-top: 10px; }
.pay { display: grid; grid-template-columns: 22px 110px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pay .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--chip); color: var(--soft); }
.pay.paid .n { background: var(--t-green-bg); color: var(--t-green); }
.pay.late .n { background: var(--t-red-bg); color: var(--t-red); }
.num.big { font-size: 15px; font-weight: 600; }
.num.big .muted { font-weight: 500; font-size: 13px; }

/* ---------- окна ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.42); opacity: 0; transition: opacity 180ms ease; }
.modal-wrap.on { opacity: 1; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden;
  background: var(--glass-heavy); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  transform: scale(0.97) translateY(6px); filter: blur(4px); transition: transform 240ms var(--ease-out), filter 200ms var(--ease-out); }
.modal.wide { width: min(760px, 100%); }
.modal-wrap.on .modal { transform: none; filter: none; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 18px 6px 22px; }
.modal-h h2 { flex: 1; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.modal-b > .btn { align-self: flex-start; }
.modal-b { padding: 12px 22px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.fld { display: flex; flex-direction: column; gap: 6px; color: var(--soft); font-size: 13px; min-width: 0; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 13.5px; cursor: pointer; }
.chk input, .chip input { accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); color: var(--soft); font-size: 13px; transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.chip span em { font-style: normal; color: var(--muted); font-size: 12px; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent-line); color: var(--fg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps i { height: 3px; border-radius: 2px; background: var(--line-strong); }
.steps i.on { background: var(--accent); }
.wave-list { display: flex; flex-direction: column; gap: 10px; }
.wave-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.wave-h { display: flex; align-items: center; gap: 10px; }
.wave-h .min { flex: 1; }
.wave-h b { display: block; font-weight: 550; }
.wave-h span { color: var(--muted); font-size: 12.5px; }
.plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-big { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.plan-big b { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.plan-big span { color: var(--muted); font-size: 13px; }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--row-hover); }
.picked b { display: block; font-weight: 550; }
.picked span { color: var(--muted); font-size: 13px; }
.np-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.np-list:empty { display: none; }
.np-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; border: 1px solid transparent; background: none; text-align: left; }
.np-item:hover { background: var(--row-hover); }
.np-item.on { border-color: var(--accent-line); background: var(--accent-soft); }
.np-item b { display: block; font-weight: 550; }
.np-item .min span { color: var(--muted); font-size: 12.5px; }
.np-pays { display: flex; flex-direction: column; gap: 6px; }
.np-pay { display: grid; grid-template-columns: 22px 1fr 1fr auto; gap: 8px; align-items: center; }
.np-pay .n { width: 22px; height: 22px; border-radius: 50%; background: var(--chip); color: var(--soft); display: grid; place-items: center; font-size: 11px; }

/* ---------- поиск, уведомления, меню на телефоне ---------- */
.pal-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding-top: 12vh; background: rgba(0, 0, 0, 0.34); opacity: 0; transition: opacity 160ms ease; }
.pal-wrap.on { opacity: 1; }
.pal { width: min(720px, calc(100vw - 24px)); border-radius: var(--r-xl); overflow: hidden; background: var(--glass-heavy); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); transform: scale(0.97) translateY(-6px); filter: blur(4px); transition: transform 220ms var(--ease-out), filter 200ms var(--ease-out); }
.pal-wrap.on .pal { transform: none; filter: none; }
.pal-in { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-in input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--fg); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pal-row:hover { background: var(--row-hover); }
.pal-row.kb { background: var(--row-active); }
.pal-row .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-foot { display: flex; gap: 16px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.pal-foot span { display: inline-flex; gap: 6px; align-items: center; }
.pop { position: fixed; z-index: 35; width: min(400px, calc(100vw - 20px)); max-height: 70vh; display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right; transition: opacity 160ms ease, transform 220ms var(--ease-out); }
.pop.on { opacity: 1; transform: none; }
.pop-h { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.pop-h span { font-size: 12.5px; }
.pop-b { overflow-y: auto; padding: 6px; }
.pop-row { padding: 10px; border-radius: 10px; }
.pop-row + .pop-row { border-top: 1px solid var(--line); border-radius: 0; }
.pop-row p { color: var(--soft); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.pop-row span { color: var(--muted); font-size: 12px; }
.mobile-nav { display: none; }
.msheet-wrap { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 180ms ease; }
.msheet-wrap.on { opacity: 1; }
.msheet { position: fixed; left: 10px; right: 10px; bottom: 80px; border-radius: var(--r-xl); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transform: translateY(12px); transition: transform 240ms var(--ease-drawer); }
.msheet-wrap.on .msheet { transform: none; }
.msheet a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; color: var(--soft); text-decoration: none; }
.msheet a:active { background: var(--row-active); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(380px, 100%); border-radius: 20px; padding: 30px 26px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.login .brand { align-self: center; margin-bottom: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--soft); font-size: 13px; }
.login .field { height: 40px; }
.login .btn { height: 40px; margin-top: 4px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 18px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 12px); opacity: 0; padding: 10px 16px; border-radius: 12px; max-width: min(560px, calc(100vw - 32px)); background: var(--glass-heavy); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); transition: transform 260ms var(--ease-out), opacity 200ms ease; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { color: var(--bad); }

/* ---------- узкий экран ---------- */
@media (max-height: 820px) and (min-width: 761px) {
  .side { padding-top: 10px; }
  .side-brand { padding-bottom: 10px; }
  .nav a, .side-foot a { height: 30px; }
  .nav-group { padding-bottom: 4px; }
  .nav-title { padding-top: 4px; padding-bottom: 2px; }
  .side-foot .me { padding: 6px 10px; margin-top: 2px; }
  .side-foot .me .av { width: 26px; height: 26px; }
}
@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thead, .trow { grid-template-columns: minmax(200px, 1.4fr) 124px minmax(180px, 1.4fr) 130px; }
  .thead > :nth-child(3), .trow > :nth-child(3), .thead > :nth-child(5), .trow > :nth-child(5) { display: none; }
  .task-row { grid-template-columns: 30px minmax(0, 1fr) 128px 140px; }
  .task-row .task-msg { display: none; }
  .stat-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .chats { grid-template-columns: 1fr; height: auto; }
  .chat-pane { display: none; }
  .grid2, .grid2.wide-left, .accounts { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .demo-grid { grid-template-columns: minmax(0, 1fr) 140px; }
  .demo-grid > :nth-child(n+3) { display: none; }
  .pays-t .ct-h, .pays-t .ct-r { grid-template-columns: minmax(0, 1fr) 110px 110px; }
  .pays-t .ct-h > :nth-child(2), .pays-t .ct-r > :nth-child(2), .pays-t .ct-h > :nth-child(4), .pays-t .ct-r > :nth-child(4) { display: none; }
  .ct-h, .ct-r { grid-template-columns: minmax(120px, 1.4fr) repeat(5, minmax(50px, 1fr)); font-size: 13px; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: 100dvh; }
  .side { display: none; }
  .top { margin: 8px 8px 0; padding: 0 8px 0 16px; }
  .live { display: none; }
  .searchbtn { min-width: 0; width: 36px; padding: 0; justify-content: center; border-radius: 50%; }
  .searchbtn span, .searchbtn kbd { display: none; }
  .view { padding: 16px 12px 100px; }
  .home { padding-top: 8px; gap: 24px; }
  .tiles { gap: 10px; }
  .tile { min-height: 148px; padding: 14px; }
  .tile-n { font-size: 28px; }
  .task-row { grid-template-columns: 30px minmax(0, 1fr); row-gap: 4px; }
  .task-row > .tag { display: none; }
  .task-row > .due { grid-column: 2; justify-self: start; }
  .thead { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 12px 14px; row-gap: 6px; }
  .trow > :nth-child(2), .trow > :nth-child(3), .trow > :nth-child(5) { display: none; }
  .trow > .cell-msg { grid-column: 1 / -1; grid-row: 2; }
  .filters .search-in { min-width: 0; flex: 1 1 100%; }
  .filters select.field { flex: 1; max-width: none; }
  .filters .sp { display: none; }
  .sheet, .sheet.proj { inset: 0; width: 100%; border-radius: 0; }
  .block.two { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); padding: 4px 16px 12px; }
  .fld-row, .plan { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .f-row { grid-template-columns: 100px minmax(0, 1fr) 44px; }
  .f-conv { display: none; }
  .hb { grid-template-columns: 110px minmax(0, 1fr) 40px; }
  .ct-h { display: none; }
  .ct-r { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 10px; }
  .ct-r > :nth-child(n+3):not(:last-child) { display: none; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .mobile-nav { display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 15; height: 62px; border-radius: 20px; justify-content: space-around; align-items: center; padding: 0 4px; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 12px; min-width: 56px; }
  .mobile-nav a[aria-current="page"] { color: var(--fg); }
  .mobile-nav .svg-wrap { position: relative; display: inline-flex; }
  .mobile-nav .badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; display: grid; place-items: center; }
  .pal-wrap { padding-top: 8px; }
  .pop { left: 10px; right: 10px !important; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .sheet, .pal, .modal { filter: none !important; }
}

/* ---------- движение: вход в приложение, смена разделов и вкладок ---------- */
@keyframes in-left { from { opacity: 0; transform: translateX(-28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes in-top { from { opacity: 0; transform: translateY(-16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes in-bottom { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes soft { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.app.enter .side { animation: in-left 720ms var(--ease-out) both; }
.app.enter .top { animation: in-top 640ms var(--ease-out) 90ms both; }
.app.enter ~ .mobile-nav { animation: in-bottom 620ms var(--ease-out) 160ms both; }
.a-rise { animation: rise 560ms var(--ease-out) both; animation-delay: calc(var(--d, 0ms) + var(--i, 0) * 42ms); }
.a-soft { animation: soft 300ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
.side .nav a, .side-foot a { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }

/* бегунок: подсветка выбранного пункта меню, вкладки и переключателя переезжает, а не мигает */
.nav { position: relative; }
.nav-ink { position: absolute; left: 0; right: 0; top: 0; height: 34px; border-radius: 9px; background: var(--row-active); border: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 var(--glass-top) inset; pointer-events: none; opacity: 0; z-index: 0;
  transition: transform 420ms var(--ease-drawer), height 420ms var(--ease-drawer), opacity 200ms ease; }
.nav-ink.on { opacity: 1; }
.nav a { position: relative; z-index: 1; }
.nav.inked a[aria-current="page"] { background: transparent; border-color: transparent; box-shadow: none; }
.tabs { position: relative; }
.tabs.inked a[aria-current="page"]::after { display: none; }
.tab-ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: var(--fg); pointer-events: none;
  transition: transform 380ms var(--ease-drawer), width 380ms var(--ease-drawer); }
.seg { position: relative; }
.seg-ink { position: absolute; top: 3px; left: 0; height: calc(100% - 6px); width: 0; border-radius: 7px; background: var(--bg-raise-2);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); pointer-events: none; z-index: 0;
  transition: transform 340ms var(--ease-drawer), width 340ms var(--ease-drawer), opacity 160ms ease; }
.seg.inked button { position: relative; z-index: 1; }
.seg.inked button[aria-pressed="true"] { background: transparent; border-color: transparent; box-shadow: none; }
.no-ink-anim .nav-ink, .no-ink-anim .tab-ink, .no-ink-anim .seg-ink, .nav-ink.jump, .tab-ink.jump, .seg-ink.jump { transition: none !important; }

/* ---------- свои выпадающие списки ---------- */
select.dd-native { display: none !important; }
.dd { display: inline-flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; justify-content: space-between; min-width: 0;
  transition: border-color 140ms ease, background-color 140ms ease; }
.dd .dd-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd .dd-v.ph { color: var(--muted); }
.dd svg.i { color: var(--muted); transition: transform 260ms var(--ease-out); }
.dd[aria-expanded="true"] { border-color: var(--line-strong); background: var(--bg-raise-2); }
.dd[aria-expanded="true"] svg.i { transform: rotate(180deg); }
.dd:disabled { opacity: 0.5; cursor: default; }
.dd-pop { position: fixed; z-index: 60; min-width: 180px; max-height: min(320px, 60vh); overflow-y: auto; padding: 5px; border-radius: 12px;
  opacity: 0; transform: translateY(-4px) scale(0.97); transform-origin: top center; transition: opacity 140ms ease, transform 220ms var(--ease-out); }
.dd-pop.up { transform-origin: bottom center; transform: translateY(4px) scale(0.97); }
.dd-pop.on { opacity: 1; transform: none; }
.dd-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--soft); text-align: left; font-size: 13.5px; transition: background-color 100ms ease, color 100ms ease; }
.dd-opt .ck { width: 14px; height: 14px; margin-left: auto; color: var(--accent); opacity: 0; }
.dd-opt[aria-selected="true"] { color: var(--fg); }
.dd-opt[aria-selected="true"] .ck { opacity: 1; }
.dd-opt.kb, .dd-opt:hover { background: var(--row-active); color: var(--fg); }
.dd-opt:disabled { opacity: 0.45; cursor: default; }
.dd-group { padding: 8px 10px 4px; font-size: 11.5px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .app.enter .side, .app.enter .top, .app.enter ~ .mobile-nav, .a-rise, .a-soft { animation: none !important; }
  .nav-ink, .tab-ink, .seg-ink { transition: none !important; }
}

/* ---------- главная: «Ход за вами» ---------- */
.attn { padding-bottom: 4px; overflow: hidden; }
.attn-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); cursor: pointer; transition: background-color 120ms ease; }
.attn-row:hover { background: var(--row-hover); }
.attn-act { display: flex; gap: 6px; justify-content: flex-end; }
.attn-row .min b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-row .min span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.attn-dot.need { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 16%, transparent); }
@media (max-width: 760px) {
  .attn-row { grid-template-columns: 10px minmax(0, 1fr); padding: 12px 14px; }
  .attn-row > .av, .attn-row > .tag { display: none; }
  .attn-act { grid-column: 2; justify-content: flex-start; }
}

/* ---------- графики рассылки ---------- */
.chart { display: flex; flex-direction: column; }
.ch-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 18px 4px; font-size: 12.5px; color: var(--muted); }
.ch-k { display: inline-flex; align-items: center; gap: 6px; }
.ch-k b { color: var(--fg); font-weight: 600; }
.ch-k i { width: 8px; height: 8px; border-radius: 2px; }
.s-firsts { background: var(--accent); }
.s-reminders { background: #6f8fd0; }
.s-dialog { background: #5b5b5b; }
.s-replies { background: var(--ok); }
.chb { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; height: 200px; padding: 10px 16px 14px; align-items: end; }
.chb.dense { gap: 3px; }
.chc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.chc > span { font-size: 11.5px; color: var(--soft); min-height: 15px; }
.chb.dense .chc > span { font-size: 10px; }
.chc em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.chb.dense .chc em { font-size: 10px; }
.chc.now em, .chc.now > span { color: var(--fg); font-weight: 600; }
.chs { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; min-height: 0; }
.stk { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 2px 2px; overflow: hidden; min-height: 2px; background: var(--line);
  transform-origin: bottom; animation: grow 620ms var(--ease-out) both; }
.stk i { display: block; min-height: 2px; }
.chs .rep { width: 4px; border-radius: 3px; min-height: 0; transform-origin: bottom; animation: grow 620ms var(--ease-out) 80ms both; }
.chb.dense .chs .rep { width: 2px; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (max-width: 760px) { .chb.dense .chc:nth-child(odd) em { visibility: hidden; } }

/* ---------- парсер: города до цели ---------- */
.city-list { display: flex; flex-direction: column; padding: 2px 18px 14px; }
.city { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.city:first-child { border-top: 0; }
.city.off { opacity: 0.5; }
.city-h { display: flex; align-items: baseline; gap: 10px; }
.city-h b { font-weight: 550; }
.city-h .num { font-weight: 600; }
.city-s { font-size: 12px; }
.toast.on { pointer-events: auto; }
.toast-act { margin-left: 14px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--row-active); color: var(--fg); font-weight: 550; }
.toast-act:hover { background: var(--bg-raise-2); }
.dd-pop:focus, .dd-pop:focus-visible { outline: none; }

/* ---------- рассылки: графики столбиком слева, очередь справа ---------- */
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.col-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-stack > .panel, .mail-grid > .panel { margin-top: 0 !important; }
.queue-panel .rows { max-height: 1060px; overflow-y: auto; }
@media (max-width: 980px) {
  .mail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ch-sum { gap: 4px 12px; font-size: 12px; padding: 0 14px 2px; }
  .chb { padding: 8px 10px 12px; gap: 4px; height: 170px; }
  .chb.dense { gap: 2px; }
  .chb.dense .chc > span { display: none; }
  .chc > span { font-size: 10px; }
  .chc em { font-size: 10px; }
  .stk { max-width: 22px; }
}

/* ---------- переписка на телефоне: чат поверх списка ---------- */
.pane-back { display: none; }
@media (max-width: 980px) {
  .chats.open .chat-pane { display: flex; position: fixed; inset: 0; z-index: 30; border-radius: 0; border: 0; margin: 0;
    background: var(--bg); padding-bottom: env(safe-area-inset-bottom); animation: in-right 300ms var(--ease-out) both; }
  .chats.open .pane-back { display: grid; }
  body.chat-open .mobile-nav { display: none; }
  .chats.open .pane-h { padding: 10px 12px; gap: 10px; }
  .chats.open .pane-actions { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
}
@media (max-width: 760px) {
  .chats.open .pane-h .tag, .chats.open .pane-h .who-chip { display: none; }
}
@keyframes in-right { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- карточка: поле ответа в конце переписки, на телефоне низкая шапка ---------- */
.tab-body .composer { border-top: 0; background: none; padding: 10px 16px 6px; }
.sheet-meta { display: none; }
@media (max-width: 760px) {
  .sheet.card .sheet-h { padding: 10px 10px 10px 16px; align-items: center; gap: 8px; }
  .sheet.card .sheet-h .sub, .sheet.card .sheet-h .tags { display: none; }
  .sheet.card .sheet-h h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet.card .sheet-h .btn .lbl { display: none; }
  .sheet.card .sheet-h .btn { width: 34px; padding: 0; }
  .sheet.card .sheet-meta { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 0; }
  .sheet-meta .sub { color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
  .sheet-meta .sub .sep { color: var(--faint); }
  .sheet-meta .tags { display: flex; gap: 6px; flex-wrap: wrap; }
  .sheet-meta .tags:empty { display: none; }
}

/* ---------- телефон: шапка разделов без горизонтальной прокрутки, «Ещё» с выделением ---------- */
@media (max-width: 760px) {
  .page-head .actions { flex-wrap: wrap; flex: initial; margin-left: 0; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .page-head .actions .seg { flex: 1 1 100%; }
  .page-head .actions .seg button { flex: 1; justify-content: center; }
  .view-in { overflow-x: clip; }
}
.msheet a[aria-current="page"] { background: var(--row-active); color: var(--fg); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.mobile-nav a.on-more { color: var(--fg); }
@media (max-width: 760px) {
  .link-row { flex-wrap: wrap; min-width: 0; }
  .link-row a { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btnrow { flex-wrap: wrap; }
  .sheet-b { overflow-x: hidden; }
}

/* ---------- уведомления ---------- */
.nt { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); }
.nt:first-child { border-top: 0; }
.nt-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; }
.nt.unread .nt-dot { background: var(--accent); }
.nt.crit .nt-dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 16%, transparent); }
.nt.cleared { opacity: 0.55; }
.nt p { color: var(--fg); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt.cleared p, .nt:not(.unread) p { color: var(--soft); }
.nt p a, .pop-row p a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); }
.nt-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.nt-go { display: inline-flex; align-items: center; gap: 2px; color: var(--soft); text-decoration: none; font-weight: 550; }
.nt-go:hover { color: var(--fg); }
.nt-list { padding: 4px 0; }
.pop .nt { padding: 10px 8px; }
.pop-t { display: flex; align-items: center; gap: 8px; }
.pop-f { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 11px; border-top: 1px solid var(--line); color: var(--soft); text-decoration: none; font-weight: 550; font-size: 13px; }
.pop-f:hover { color: var(--fg); background: var(--row-hover); }

/* значки брендов: залитые векторы и круглые цветные картинки */
svg.i.fill { fill: currentColor; stroke: none; }
img.chi { width: 16px; height: 16px; flex: none; border-radius: 50%; display: inline-block; vertical-align: middle; }
img.chi.sm { width: 15px; height: 15px; }
img.chi.xs { width: 12px; height: 12px; }
img.chi.lg { width: 28px; height: 28px; }
.sw-row b img.chi { margin-right: 6px; vertical-align: -2px; }
.bub .meta img.chi { opacity: .9; }
.acc-ico { position: relative; display: inline-grid; flex: none; }
.acc-ico::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg-raise); background: var(--t-green); }
.acc-ico.off::after { background: var(--t-red); }
.av.claude svg.i { width: 62%; height: 62%; }
.av.sm.claude svg.i { width: 12px; height: 12px; }
.av.face { background: #1c1c1c; border-color: transparent; }

/* безопасность: входы, доступ сотрудника, код при входе */
.sess-list { display: flex; flex-direction: column; }
.sess { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color 200ms ease; }
.sess-i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); border: 1px solid var(--line-strong); color: var(--soft); }
.sess b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 550; }
.sess .min > span { color: var(--muted); font-size: 13px; display: block; }
.sess .btns { display: flex; gap: 6px; }
.sess.flag { background: var(--t-red-bg); }
.sess-warn { display: block; margin-top: 4px; color: var(--t-red); font-size: 13px; }
.person-f { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.staff { display: flex; flex-direction: column; gap: 20px; }
.staff h3 { font-size: 13px; font-weight: 600; color: var(--soft); margin: 0 0 10px; }
.staff .note { margin-top: 8px; }
.staff .sess-list { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.staff .sess-list .sess:first-child { border-top: 0; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; margin-bottom: 10px; }
.perm { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.perm input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.perm.base { color: var(--muted); cursor: default; }
.perm em { font-style: normal; color: var(--muted); font-size: 12px; }
.disable-box { margin-top: 14px; padding: 12px; border: 1px solid var(--t-red-line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.disable-box .fld { width: 100%; max-width: 360px; }
.login-note { color: var(--soft); font-size: 14px; line-height: 1.5; margin: 0; }
.login .field.code-in { font: 600 22px/1 ui-monospace, "Cascadia Mono", monospace; letter-spacing: 0.3em; text-align: center; height: 48px; }
@media (max-width: 720px) {
  .sess { grid-template-columns: 32px 1fr; padding: 12px; }
  .sess .btns { grid-column: 2; }
  .sess-i { width: 32px; height: 32px; }
}

/* парсер: города и ниши правятся на странице */
.iconbtn.xs { width: 24px; height: 24px; border-radius: 6px; }
.ord { display: inline-flex; gap: 2px; margin-left: 4px; }
.tgl { position: relative; display: inline-flex; flex: none; width: 30px; height: 18px; cursor: pointer; }
.tgl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.tgl i { width: 30px; height: 18px; border-radius: 9px; background: var(--line-strong); transition: background-color 160ms ease; position: relative; }
.tgl i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg); transition: transform 160ms cubic-bezier(.2,.8,.2,1); }
.tgl input:checked + i { background: var(--accent); }
.tgl input:checked + i::after { transform: translateX(12px); }
.tgl input:focus-visible + i { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.city-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.city-h .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city.off b, .niche.off b { color: var(--muted); }
.city.off .meter-l { opacity: .4; }
.niche-list { display: flex; flex-direction: column; padding: 2px 18px 14px; }
.niche { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.niche:first-child, .city:first-child { border-top: 0; }
.niche-b { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.niche-b:disabled { cursor: default; }
.niche-b .muted { font-size: 12px; }
.geo-list { max-height: 46vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.geo-rh { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.geo-rh .muted { font-size: 12px; }
.chip-b { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px dashed var(--line-strong); background: none; color: var(--soft); font: inherit; font-size: 13px; cursor: pointer; }
.chip-b:hover { color: var(--fg); border-color: var(--accent-line); }
.modal-f .sp { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.mset h3 { font-size: 13px; font-weight: 600; color: var(--soft); margin: 18px 0 8px; }
.mset h3:first-child { margin-top: 0; }
.tgt-line { display: flex; gap: 8px; align-items: flex-start; color: var(--soft); font-size: 13px; line-height: 1.45; }
.tgt-line > .i { flex: none; margin-top: 2px; }
.tgt-line > span { flex: 1; min-width: 0; }
.mset .chips { margin-bottom: 12px; }
.mset .fld-row, .mset > .fld { margin-bottom: 10px; }
.mset .note { margin: 4px 0 6px; }
.fld-row > .btn { align-self: end; flex: none; width: auto; }
.tgt-line { margin: -6px 0 14px; }
.tgt-line .i { color: var(--muted); }
