@font-face { font-family: "Onest"; src: url("/static/fonts/onest.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
:root {
  /* Вид KÓLEM (он же Aura CRM), цвета Sonata: бежевая бумага, шоколадный текст, акцент какао; зелёный ателье и сиреневый Kids — метки брендов */
  --bg: #F5F1EB;
  --surface: #FFFFFF;
  --surface-2: #FAF7F3;
  --surface-3: #EFE9E2;
  --line: #E9E2D9;
  --line-2: #DCD3C8;
  --text: #231E1B;
  --text-2: #4A413B;
  --muted: #7B716A;
  --faint: #A3988F;

  /* акцент светло-красный, в тон божьей коровки (Дин-Ислам 02.11); просрочка — тёмно-красный, «сегодня» — синий, чтобы не путать */
  --accent: #D93D35;
  --accent-ink: #FFFFFF;
  --accent-soft: #FCEAE7;
  --grad: linear-gradient(135deg, #F5A39A, #E0493F);
  --violet: #5B4C86;
  --violet-bg: #EFEBF7;

  --atelier: #2E8B4A;
  --atelier-ink: #245E35;
  --atelier-bg: #E4F0E6;
  --kids: #7462A4;
  --kids-ink: #56477F;
  --kids-bg: #EEEAF6;

  --red: #B42330;
  --red-bg: #FBE9EA;
  --amber: #9A6310;
  --amber-bg: #FBF0DC;
  --green: #2B7A4B;
  --green-bg: #E5F2E9;
  --blue: #2F5F9E;
  --blue-bg: #E7EEF8;

  --hover: #FCFAF7;
  --chat-bg: var(--chat-bg);
  --msg-out: var(--msg-out);
  --radius: 12px;
  --radius-sm: 8px;
  --r: 16px;
  --shadow: 0 1px 2px rgba(35, 30, 27, .04), 0 6px 20px rgba(35, 30, 27, .05);
  --shadow-lg: 0 24px 70px rgba(35, 30, 27, .22);
  --side-w: 248px;
  /* шрифт Onest (выбор Дин-Ислама 02.11): один на всё, заголовки плотнее; файл свой, урезан до 400–700, кириллица, казахские буквы и ₸ */
  --font: "Onest", system-ui, sans-serif;
  --serif: "Onest", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161311; --surface: #1F1B18; --surface-2: #26211D; --surface-3: #2F2924; --line: #3A332D; --line-2: #4A423B;
    --text: #F3EEE8; --text-2: #D6CDC4; --muted: #A69B91; --faint: #7F756C;
    --accent: #FF8077; --accent-ink: #1F1B18; --accent-soft: #3E201D; --grad: linear-gradient(135deg, #FF9F96, #D93D35); --violet: #B3A5E0; --violet-bg: #2B2640;
    --atelier: #5CB97A; --atelier-ink: #8ED1A4; --atelier-bg: #1D3325; --kids: #A493D6; --kids-ink: #C3B6EA; --kids-bg: #2B2640;
    --red: #EC7A70; --red-bg: #3D2220; --amber: #E0A84E; --amber-bg: #382B17; --green: #6CC191; --green-bg: #1B3226; --blue: #8CB8DE; --blue-bg: #1F2C38;
    --hover: #2A2420; --chat-bg: #1A1714; --msg-out: #23382A; --shadow: none; --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161311; --surface: #1F1B18; --surface-2: #26211D; --surface-3: #2F2924; --line: #3A332D; --line-2: #4A423B;
  --text: #F3EEE8; --text-2: #D6CDC4; --muted: #A69B91; --faint: #7F756C;
  --accent: #FF8077; --accent-ink: #1F1B18; --accent-soft: #3E201D; --grad: linear-gradient(135deg, #FF9F96, #D93D35); --violet: #B3A5E0; --violet-bg: #2B2640;
  --atelier: #5CB97A; --atelier-ink: #8ED1A4; --atelier-bg: #1D3325; --kids: #A493D6; --kids-ink: #C3B6EA; --kids-bg: #2B2640;
  --red: #EC7A70; --red-bg: #3D2220; --amber: #E0A84E; --amber-bg: #382B17; --green: #6CC191; --green-bg: #1B3226; --blue: #8CB8DE; --blue-bg: #1F2C38;
  --hover: #2A2420; --chat-bg: #1A1714; --msg-out: #23382A; --shadow: none; --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num, .money { font-variant-numeric: lining-nums proportional-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
[hidden] { display: none !important; }

/* ─────────── оболочка ─────────── */
.shell { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.logo img { width: 34px; height: 34px; object-fit: contain; }
.logo b { font: 22px/1 var(--serif); letter-spacing: .01em; }
.logo small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.side .add-btn { margin: 0 4px 14px; justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.nav a.on svg { color: var(--text); }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--red); color: #fff; border-radius: 20px; padding: 0 7px; line-height: 19px; }
.nav a .dot { width: 8px; height: 8px; border-radius: 50%; margin: 0 5px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-weight: 600; }
.side-foot .who span { font-size: 12px; color: var(--muted); }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font: 26px/1.15 var(--serif); margin: 0; font-weight: 400; white-space: nowrap; }
.top .sub { color: var(--muted); font-size: 13px; }
.top .spacer { flex: 1; }
.page { padding: 8px 28px 60px; }

/* поиск */
.search { position: relative; width: min(360px, 38vw); }
.search input {
  width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface);
  padding: 0 64px 0 36px; outline: none;
}
.search input:focus { border-color: var(--text-2); }
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 9px; font: 11px var(--font); color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.search-pop {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow: auto; z-index: 40;
}
.search-pop .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px 4px; }
.search-pop a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.search-pop a:hover, .search-pop a.hl { background: var(--surface-2); }
.search-pop a span { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.search-pop .empty { padding: 14px 10px; color: var(--muted); }

/* ─────────── кнопки и поля ─────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--red); }
.btn.wa { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn.wa:hover { background: #17964a; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.inp, select.inp, textarea.inp {
  width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  padding: 0 11px; outline: none; transition: border-color .15s;
}
textarea.inp { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.inp:focus { border-color: var(--text-2); }
.inp.bare { border-color: transparent; background: transparent; padding: 0 6px; margin-left: -6px; }
.inp.bare:hover { background: var(--surface-2); }
.inp.bare:focus { background: var(--surface); border-color: var(--line-2); }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B716A' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.b { font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* чипсы-переключатели */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2);
}
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 13px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* метки */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag.atelier { background: var(--atelier-bg); color: var(--atelier-ink); }
.tag.kids { background: var(--kids-bg); color: var(--kids-ink); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.outline-red { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px #EBC0C3; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); flex: none; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }

/* карточки-панели */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 84px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; }
.panel-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-h .count { font-size: 13px; color: var(--muted); font-weight: 500; }
.panel-b { padding: 0 18px 16px; }
.empty-state { text-align: center; color: var(--muted); padding: 34px 20px; }
.empty-state b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ─────────── «Сегодня» ─────────── */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.today-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.progress { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.stat-pill { display: flex; align-items: baseline; gap: 7px; padding: 9px 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.stat-pill b { font-size: 18px; font-weight: 600; font-variant-numeric: lining-nums proportional-nums; }
.stat-pill.red b { color: var(--red); }
.stat-pill.green b { color: var(--green); }
.stat-pill.amber b { color: var(--amber); }

.task { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.task:hover { background: var(--hover); }
.task .check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.8px solid var(--line-2); background: var(--surface); flex: none;
  display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0;
}
.task .check:hover { border-color: var(--green); color: var(--green); }
.task .check.done { background: var(--green); border-color: var(--green); color: #fff; }
.task .when { width: 92px; flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: lining-nums proportional-nums; }
.task .when.red { color: var(--red); }
.task .body { flex: 1; min-width: 0; }
.task .body .t { font-weight: 500; }
.task .body .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .side-r { display: flex; align-items: center; gap: 6px; flex: none; }
.task.done-row .t { text-decoration: line-through; color: var(--muted); }

/* ─────────── воронка ─────────── */
.board-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.board-bar .sum { color: var(--muted); font-size: 13px; margin-left: 4px; }
.board-bar .filter { height: 34px; width: 200px; }
.board {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start;
  scroll-snap-type: x proximity; min-height: calc(100vh - 236px);
}
.col { flex: 0 0 272px; background: var(--surface-2); border-radius: 13px; display: flex; flex-direction: column; max-height: calc(100vh - 236px); scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
.col.drop { background: var(--surface-3); box-shadow: inset 0 0 0 2px var(--line-2); }
.col-h { padding: 11px 13px 8px; }
.col-h .name { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.col-h .name .n { color: var(--muted); font-weight: 500; }
.col-h .meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.col-body { padding: 2px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; min-height: 60px; }
.col.closed { flex-basis: 232px; opacity: .92; }
.card {
  background: var(--surface); border-radius: 10px; padding: 10px 11px 9px; cursor: pointer; position: relative;
  box-shadow: 0 1px 2px rgba(35, 30, 27, .06); border: 1px solid transparent; transition: box-shadow .15s, border-color .15s;
}
.card:hover { border-color: var(--line-2); }
.card.dragging { opacity: .4; }
.card .l1 { display: flex; gap: 8px; align-items: baseline; }
.card .l1 .name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .l1 .money { font-size: 13px; font-weight: 600; color: var(--text-2); }
.card .l2 { font-size: 13px; color: var(--muted); margin: 1px 0 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .l3 { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.card .l3 .avatar { margin-left: auto; width: 22px; height: 22px; font-size: 10px; }
.card .pay { position: absolute; left: 11px; right: 11px; bottom: 0; height: 2px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.card .pay i { display: block; height: 100%; background: var(--green); }
.card.stale { background: var(--surface); }
.dropbar {
  position: fixed; left: calc(var(--side-w) + 28px); right: 28px; bottom: 18px; display: flex; gap: 12px; z-index: 30;
  pointer-events: none; opacity: 0; transform: translateY(12px); transition: .18s;
}
.dropbar.show { opacity: 1; transform: none; pointer-events: auto; }
.dropzone {
  flex: 1; height: 64px; border-radius: 14px; border: 2px dashed var(--line-2); background: var(--surface);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; box-shadow: var(--shadow);
}
.dropzone.won { color: var(--green); border-color: #9FCDAE; }
.dropzone.lost { color: var(--red); border-color: #E5A9AD; }
.dropzone.over.won { background: var(--green-bg); }
.dropzone.over.lost { background: var(--red-bg); }

/* ─────────── ящик сделки ─────────── */
.backdrop { position: fixed; inset: 0; background: rgba(35, 30, 27, .28); z-index: 50; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); z-index: 51;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-h { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 20px 14px; }
.drawer-h .top-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.drawer-h h2 { font: 24px/1.2 var(--serif); margin: 0; font-weight: 400; }
.drawer-h h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.drawer-h .contacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.sect { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.sect > h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sect > h4 .r { margin-left: auto; text-transform: none; letter-spacing: 0; }
.hint { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: #6E4A0E; font-size: 13.5px; }
.hint.blue { background: var(--blue-bg); color: #24497A; }
.hint.red { background: var(--red-bg); color: #8E2229; }
.hint svg { margin-top: 1px; }

.stages { display: flex; gap: 3px; }
.stages button {
  flex: 1; min-width: 0; border: 0; height: 34px; background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 500;
  color: var(--muted); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stages button:first-child { border-radius: 8px 0 0 8px; }
.stages button:last-child { border-radius: 0 8px 8px 0; }
.stages button.past { background: var(--surface-3); color: var(--text-2); }
.stages button.cur { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.stages button:hover:not(.cur) { background: var(--line-2); color: var(--text); }
.stage-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.closed-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.closed-banner.won { background: var(--green-bg); color: var(--green); }
.closed-banner.lost { background: var(--red-bg); color: var(--red); }

.money3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.money3 > div { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; }
.money3 span { display: block; font-size: 12px; color: var(--muted); }
.money3 b { font-size: 17px; font-weight: 600; font-variant-numeric: lining-nums proportional-nums; }
.money3 input { font-size: 17px; font-weight: 600; width: 100%; border: 0; background: transparent; outline: none; padding: 0; font-variant-numeric: lining-nums proportional-nums; }
.paybar { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 0 0 10px; }
.paybar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.list-row:first-child { border-top: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; background: var(--surface-2); padding: 10px; border-radius: 10px; margin-top: 8px; }
.inline-form .inp { height: 34px; }

.timeline { display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.ev .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.ev .ic.payment { background: var(--green-bg); color: var(--green); }
.ev .ic.stage { background: var(--blue-bg); color: var(--blue); }
.ev .ic.comment { background: var(--amber-bg); color: var(--amber); }
.ev .txt { flex: 1; min-width: 0; }
.ev .txt .meta { font-size: 12px; color: var(--faint); }
.ev .ic.message { background: var(--green-bg); color: var(--green); }
.ev.message .txt .body { background: #EFF7F1; border: 1px solid #D6EADC; padding: 7px 10px; border-radius: 10px; margin-top: 3px; white-space: pre-wrap; }
.ev.comment .txt .body { background: #FFF9EE; border: 1px solid #F3E6CC; padding: 7px 10px; border-radius: 10px; margin-top: 3px; white-space: pre-wrap; }
.comment-box { display: flex; gap: 8px; margin-bottom: 8px; }
.comment-box textarea { min-height: 40px; height: 40px; }

.tpl-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-row button { font-size: 12.5px; }

/* ─────────── модалки ─────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(35, 30, 27, .32); animation: fade .15s; }
.modal { background: var(--bg); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.modal.sm { width: min(420px, 100%); }
.modal-h { display: flex; align-items: center; padding: 16px 20px 6px; }
.modal-h h3 { margin: 0; font: 21px/1.2 var(--serif); font-weight: 400; flex: 1; }
.modal-b { padding: 10px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; }
.found { padding: 10px 12px; border-radius: 10px; background: var(--blue-bg); color: #24497A; font-size: 13.5px; }
.found b { color: var(--text); }
.more-toggle { color: var(--muted); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-align: left; }

/* ─────────── клиенты ─────────── */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--hover); }
.tbl .r { text-align: right; }
.tbl td.num, .tbl td.r { white-space: nowrap; }
.funnels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 28px; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.client-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kv > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.kv span { font-size: 12px; color: var(--muted); display: block; }
.kv b { font-size: 17px; font-weight: 600; }
.deal-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.deal-row:first-child { border-top: 0; }
.deal-row.locked { cursor: default; opacity: .75; }
.child { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.child:first-child { border-top: 0; }

/* ─────────── календарь ─────────── */
.day-group { margin-bottom: 14px; }
.day-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px 2px; font-weight: 600; }
.day-group h3.today { color: var(--text); }
.appt { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.appt:first-child { border-top: 0; }
.appt:hover { background: var(--hover); }
.appt .time { font-weight: 600; width: 48px; font-variant-numeric: lining-nums proportional-nums; }
.appt.done { opacity: .5; }
.appt.done .t { text-decoration: line-through; }

/* ─────────── сводка ─────────── */
.dash-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.dash-filters input[type=date] { height: 32px; width: 140px; }
.fire { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fire a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.fire a b { font-size: 16px; font-variant-numeric: lining-nums proportional-nums; }
.fire a.hot { background: var(--red-bg); border-color: #F1CDD0; color: #8E2229; }
.fire a.warm { background: var(--amber-bg); border-color: #F0DDB8; color: #6E4A0E; }
.fire a.ok { color: var(--green); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-size: 26px; font-weight: 600; letter-spacing: -.01em; margin: 3px 0 2px; font-variant-numeric: lining-nums proportional-nums; }
.kpi .delta { font-size: 12.5px; color: var(--muted); }
.kpi .delta b.up { color: var(--green); }
.kpi .delta b.down { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .wide { grid-column: 1 / -1; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 9px; padding: 8px 11px;
  font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; z-index: 5;
}
.chart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.chart .tip .tip-row { display: flex; gap: 14px; justify-content: space-between; }
.hbar { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar .track { height: 12px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.hbar .track i { display: block; height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .v { font-variant-numeric: lining-nums proportional-nums; white-space: nowrap; color: var(--text-2); }
.hbar .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.tbl-view summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.feed .ev { padding: 6px 0; }

/* ─────────── вход ─────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); }
.login .box img { width: 52px; display: block; margin: 0 auto 10px; }
.login h1 { font: 30px/1 var(--serif); text-align: center; margin: 0 0 4px; font-weight: 400; }
.login p { text-align: center; color: var(--muted); margin: 0 0 22px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .err { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; }

/* тост */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 80; opacity: 0; transition: .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }

/* нижняя панель на телефоне */
.tabbar { display: none; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(35, 30, 27, .32); display: flex; align-items: flex-end; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; border-radius: 18px 18px 0 0; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); }
.sheet a, .sheet button.item { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 10px; font-weight: 500; width: 100%; border: 0; background: none; cursor: pointer; font-size: 15px; }
.sheet a:hover, .sheet button.item:hover { background: var(--surface-2); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .today-grid, .client-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --side-w: 0px; }
  .side { display: none; }
  .main { margin-left: 0; }
  .top { padding: 12px 16px; gap: 10px; }
  .top h1 { font-size: 22px; }
  .top .search { display: none; }
  .top .top-add { display: none; }
  .page { padding: 4px 16px 96px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px);
  }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); border: 0; background: none; padding: 4px 0; cursor: pointer; position: relative; }
  .tabbar a.on { color: var(--text); }
  .tabbar .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; margin-top: -14px; box-shadow: var(--shadow); }
  .tabbar .badge { position: absolute; top: 0; left: 50%; margin-left: 6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; border-radius: 10px; padding: 0 5px; line-height: 16px; }
  .board { margin: 0 -16px; padding: 0 16px 16px; scroll-snap-type: x mandatory; min-height: calc(100vh - 230px); }
  .col { flex-basis: 84vw; max-height: none; }
  .col-body { overflow: visible; }
  .board-bar .filter { width: 100%; order: 5; }
  .drawer { width: 100vw; }
  .drawer-h { padding: 12px 16px; }
  .drawer-b { padding: 12px 12px 40px; }
  .money3 b, .money3 input { font-size: 15px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
  .kpi .val { font-size: 22px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }  /* не 1fr: длинная строка в таблице растягивала колонку шире экрана */
  .task { padding: 10px 14px; gap: 10px; align-items: flex-start; }
  .task .when { width: auto; min-width: 58px; font-size: 12.5px; }
  .task .side-r .tag { display: none; }
  .hide-m { display: none !important; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .tbl.cards td { padding: 0; border: 0; }
  .tbl.cards td:first-child { width: 100%; }
  .dropbar { left: 16px; right: 16px; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; }
}

.m-only { display: none !important; }
@media (max-width: 820px) { .m-only { display: inline-grid !important; } }

/* ─────────── чаты ─────────── */
.nav a .count.green, .tabbar .badge.green { background: #1FA855; }
.chats { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 92px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list-h { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.chat-list-h .inp { height: 34px; }
.chat-items { overflow-y: auto; flex: 1; }
.chats.two { grid-template-columns: 640px minmax(0, 1fr); }
.chat-cols { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.chat-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.chat-col:last-child { border-right: 0; }
.chat-col-h { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.chat-col-h .dot { width: 8px; height: 8px; border-radius: 50%; }
.chat-col-h .badge { margin-left: auto; background: #1FA855; color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.chats.two .ci-3 .tag.atelier, .chats.two .ci-3 .tag.kids { display: none; }
.m-brand { display: none !important; }
@media (max-width: 1280px) { .chats.two { grid-template-columns: 540px minmax(0, 1fr); } }
.chat-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-item:hover { background: var(--hover); }
.chat-item.on { background: var(--surface-2); }
.chat-item .avatar { position: relative; }
.chat-item .avatar .ch { position: absolute; right: -4px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: #1FA855; box-shadow: 0 0 0 1px var(--line); }
.chat-item .avatar .ch svg { width: 11px; height: 11px; }
.avatar.atelier { background: var(--atelier-bg); color: var(--atelier-ink); }
.avatar.kids { background: var(--kids-bg); color: var(--kids-ink); }
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-1, .ci-2 { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.ci-1 b { flex: 1; font-weight: 600; }
.ci-time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.ci-2 { font-size: 13px; color: var(--muted); }
.ci-2 .ellipsis { flex: 1; }
.chat-item.unread .ci-2 { color: var(--text); font-weight: 500; }
.chat-item.unread .ci-time { color: #1FA855; font-weight: 600; }
.ci-2 .badge { background: #1FA855; color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 6px; line-height: 18px; }
.ci-3 { display: flex; gap: 5px; align-items: center; margin-top: 2px; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ci-3 .tag { height: 19px; font-size: 11px; padding: 0 6px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-pane > .empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: center; flex: 1; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-h a:hover { text-decoration: underline; }
.thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.more-msgs { align-self: center; margin-bottom: 6px; }
.day-sep { text-align: center; margin: 10px 0 6px; }
.day-sep span { background: rgba(255, 255, 255, .85); color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.msg { max-width: min(78%, 520px); padding: 7px 10px 5px; border-radius: 12px; background: var(--surface); align-self: flex-start; box-shadow: 0 1px 1px rgba(35, 30, 27, .06); overflow-wrap: anywhere; }
.msg.out { align-self: flex-end; background: var(--msg-out); }
.msg.failed { background: var(--red-bg); }
.msg + .msg.in, .msg + .msg.out { margin-top: 2px; }
.m-text { white-space: normal; line-height: 1.4; }
.m-text a { color: var(--blue); text-decoration: underline; }
.m-meta { font-size: 11px; color: var(--faint); text-align: right; margin-top: 2px; display: flex; gap: 4px; justify-content: flex-end; }
.m-meta .st.read { color: #2F8FE0; }
.m-meta .st.failed { color: var(--red); font-weight: 700; }
.m-err { font-size: 12px; color: var(--red); }
.m-img { display: block; max-width: 100%; max-height: 300px; border-radius: 8px; margin-bottom: 4px; }
.m-img.sticker { max-width: 140px; }
.m-story { margin-bottom: 6px; padding-left: 8px; border-left: 3px solid var(--line-2); }
.m-story img, .m-story video { display: block; max-width: 160px; max-height: 240px; border-radius: 8px; }
.m-story-cap, .m-quote { font-size: 12px; color: var(--muted); margin-top: 3px; }
.m-quote { margin-bottom: 4px; padding: 4px 8px; border-left: 3px solid var(--line-2); background: var(--surface-2); border-radius: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-said { font-size: 13px; font-style: italic; margin: 2px 0 4px; white-space: pre-wrap; }
.m-seen { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.msg audio { width: 260px; max-width: 100%; height: 40px; }
.msg video { max-width: 100%; max-height: 320px; border-radius: 8px; }
.m-doc { display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.composer { padding: 8px 12px 12px; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.composer .tpl-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.composer .tpl-row .chip { flex: none; height: 26px; font-size: 12px; padding: 0 9px; }
.comp-row { display: flex; gap: 8px; align-items: flex-end; }
.comp-row textarea { min-height: 40px; max-height: 160px; resize: none; padding: 9px 11px; }
.comp-row .send { height: 40px; width: 44px; justify-content: center; padding: 0; flex: none; }
.comp-row .attach { height: 40px; width: 40px; flex: none; cursor: pointer; }
.chat-sect { padding: 0; overflow: hidden; flex-shrink: 0; }  /* в колонке карточки блок с overflow:hidden иначе сжимался в полоску, и переписку с заметками на телефоне не было видно */
.chat-sect > h4 { padding: 14px 16px 0; }
.chat-sect .thread { max-height: 380px; background: var(--chat-bg); margin-top: 10px; }
.chat-sect .composer { border-radius: 0 0 13px 13px; }

/* ИИ и реклама */
.ai-sect { border-left: 3px solid var(--line-2); }
.ai-sect .r { display: inline-flex; gap: 6px; align-items: center; }
.ai-next { display: flex; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); }
.ai-why { margin-top: 8px; }
.ai-why summary { cursor: pointer; }
.ai-why > div { margin-top: 4px; }
.tag.q-junk { background: var(--surface-3); color: var(--muted); }
.ad-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 9px; flex: none; background: var(--surface-2); }
.ad-thumb.sm { width: 40px; height: 40px; border-radius: 7px; }
.ad-thumb.ph { display: grid; place-items: center; color: var(--faint); }
.qbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.qbar i { display: block; height: 100%; }
.qbar i.hot { background: var(--red); }
.qbar i.warm { background: #D9952B; }
.qbar i.cold { background: #7EA3D6; }
.qbar i.junk { background: #B9AFA6; }
.qbar i.none { background: var(--surface-3); }
.wa-row { padding: 10px 0; border-top: 1px solid var(--line); }
.wa-row:first-of-type { border-top: 0; }
.qr-box { width: 270px; height: 270px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

@media (max-width: 820px) {
  .chats { grid-template-columns: 1fr; height: calc(100vh - 150px); margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .chats.has-sel .chat-list { display: none; }
  .chats.two { grid-template-columns: 1fr; }
  .chats.two .m-brand { display: inline-flex !important; align-self: flex-start; }
  .chats.two .chat-col:not(.m-on) { display: none; }
  .chats.two .chat-col-h { display: none; }
  .chat-cols { grid-auto-flow: row; }
  .chats:not(.has-sel) .chat-pane { display: none; }
  .msg { max-width: 88%; }
  .wa-row { flex-wrap: wrap; }
}

/* ждут ответа, ИИ в чате, колокольчик */
.seg.scroll { overflow-x: auto; max-width: 100%; scrollbar-width: none; flex: 1; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg .n { font-weight: 600; color: var(--red); }
.icon-btn.on { color: #1FA855; }
.chat-ai { margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 3px solid var(--line-2); padding: 8px 14px; }
.chat-ai summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; min-width: 0; }
.chat-ai summary::-webkit-details-marker { display: none; }
.chat-ai summary .ellipsis { flex: 1; min-width: 0; }
.chat-ai-b { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.chat-ai.none { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-3 .tag svg { width: 12px; height: 12px; }

/* выбор направления */
.brand-switch { display: flex; flex-direction: column; gap: 2px; margin: -6px 4px 14px; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.brand-switch button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--text-2); text-align: left; position: relative; }
.brand-switch button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.brand-switch button.all { font-size: 12px; color: var(--muted); padding: 4px 9px; }
.brand-switch .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: #1FA855; margin-left: auto; display: inline-block; }
.brand-pill { border: 0; background: var(--surface-2); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; cursor: pointer; align-items: center; gap: 6px; }
body[data-brand=atelier] .brand-pill { background: var(--atelier-bg); color: var(--atelier-ink); }
body[data-brand=kids] .brand-pill { background: var(--kids-bg); color: var(--kids-ink); }
body[data-brand=atelier] .nav a.on { background: var(--atelier-bg); color: var(--atelier-ink); }
body[data-brand=kids] .nav a.on { background: var(--kids-bg); color: var(--kids-ink); }
body[data-brand=atelier] .nav a.on svg { color: var(--atelier); }
body[data-brand=kids] .nav a.on svg { color: var(--kids); }
.box.picker { width: min(460px, 100%); }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 16px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; min-height: 120px; }
.pick b { font: 20px/1.15 var(--serif); font-weight: 400; }
.pick span { font-size: 13px; color: var(--muted); }
.pick.atelier { background: var(--atelier-bg); border-color: #BBD8C3; }
.pick.kids { background: var(--kids-bg); border-color: #D3CBE8; }
.pick:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
@media (max-width: 820px) { .pick-grid { grid-template-columns: 1fr; } .pick { min-height: 0; } }

/* мелочи удобства */
.composer .tpl-row { flex-wrap: nowrap; scrollbar-width: none; }
.composer .tpl-row::-webkit-scrollbar { display: none; }
.msg .st.pending { opacity: .6; }
.drop-file { outline: 2px dashed #1FA855; outline-offset: -6px; }
.deal-btn { flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-h > div { min-width: 0; }
@media (max-width: 820px) {
  body.chat-open .top, body.chat-open .tabbar { display: none; }
  body.chat-open .page { padding: 0; }
  body.chat-open .chats { height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  body.chat-open .chat-h { padding-top: calc(10px + env(safe-area-inset-top)); }
  body.chat-open .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .chat-h .avatar { display: none; }
  .chat-ai { padding: 8px 12px; }
}
.chats { grid-template-columns: 390px minmax(0, 1fr); }
.chat-list-h .seg button { padding: 0 10px; font-size: 13px; }
.chats:not(.two) .chat-col-h { display: none; }
@media (max-width: 820px) { .chats { grid-template-columns: 1fr; } }
.chat-list-h .seg button { padding: 0 8px; }

/* канал заявки, путь, факты о клиентке */
.tag.ch-ig { background: #fdf0f6; color: #c13584; }
.tag.ch-wa { background: #e9f8ef; color: #1f9d55; }
.ig-ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.facts span { display: block; font-size: 11.5px; color: var(--faint); }
.journey { display: flex; flex-direction: column; }
.jr { display: flex; gap: 10px; padding: 6px 0; position: relative; }
.jr:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 32px; bottom: -6px; width: 2px; background: var(--line); }
.jr .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); z-index: 1; }
.jr.ad .ic, .jr.story .ic { background: var(--blue-bg); color: var(--blue); }
.jr.instagram .ic { background: #fdf0f6; color: #c13584; }
.jr.whatsapp .ic { background: #e9f8ef; color: #1f9d55; }
.jr.payment .ic { background: var(--green-bg); color: var(--green); }
.jr.slow .ic { background: var(--amber-bg); color: var(--amber); }
.jr.slow b { color: var(--amber); }
.jr .txt { flex: 1; min-width: 0; font-size: 13.5px; }
.hint.green { background: var(--green-bg); color: #1d6b3d; }

/* ИИ-дежурный */
.duty-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.duty-mode { text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.duty-mode.on { border-color: var(--text); background: var(--surface-2); }
.duty-ex { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.duty-ex .msg { max-width: 640px; }

/* ─────────── первый экран собственницы ─────────── */
.brand-switch .dot.both { background: linear-gradient(90deg, var(--atelier) 50%, var(--kids) 50%); }
.pick.both { grid-column: 1 / -1; min-height: 0; background: var(--surface-2); }
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 14px; margin: 4px 0 16px; }
.hero-main { display: flex; gap: 18px; align-items: center; }
.hero-num { font: 58px/1 var(--serif); letter-spacing: -.02em; flex: none; font-variant-numeric: lining-nums proportional-nums; }
.hero-title { font-size: 19px; font-weight: 600; line-height: 1.3; }
.hero-sub { color: var(--muted); margin-top: 3px; }
.hero-note { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 16px; }
.hero-stats > div { background: var(--surface-2); border-radius: 11px; padding: 10px 13px; }
.hero-stats span { display: block; font-size: 12px; color: var(--muted); }
.hero-stats b { display: block; font-size: 19px; font-weight: 600; margin: 1px 0; }
.hero-stats small { display: block; font-size: 12px; color: var(--muted); }
.hero-night { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); }
.hero-night > span { flex: 1; min-width: 0; }
.hero-night small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.hero-night > svg { color: var(--muted); }
.owner-cards { margin-bottom: 16px; }
.big-num { font: 40px/1 var(--serif); margin-bottom: 6px; font-variant-numeric: lining-nums proportional-nums; }
.note-line { display: flex; align-items: center; gap: 8px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.dash-period { margin: -6px 0 12px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.list-modal .task { padding: 10px 4px; }
.list-modal .task .s { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ads-panel { margin-bottom: 16px; }
.ads-panel .panel-h { flex-wrap: wrap; }
.ads-panel tr.total td { background: var(--surface-2); }
.ads-panel tr.faded td { color: var(--muted); }
.dot-b { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot-b.atelier { background: var(--atelier); }
.dot-b.kids { background: var(--kids); }
.ads-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-top: 14px; }
.ads-h { font-weight: 600; margin-bottom: 4px; }
.ads-h .faint { font-weight: 400; font-size: 12.5px; }
.ad-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ad-line .r { text-align: right; white-space: nowrap; }
.ads-foot { margin-top: 12px; }
.ads-foot a { margin-left: 6px; }
@media (max-width: 820px) {
  .hero { padding: 14px 14px 12px; }
  .hero-main { gap: 12px; align-items: flex-start; }
  .hero-num { font-size: 44px; }
  .hero-title { font-size: 16px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-stats b { font-size: 16px; }
  .hero-night { flex-wrap: wrap; }
  .kpis.three { grid-template-columns: 1fr 1fr; }
  .ads-cols { grid-template-columns: 1fr; }
  /* переключатели периода: кнопки переносятся на вторую строку, а не уезжают за край без подсказки */
  .ads-panel .panel-h .seg { order: 5; width: 100%; }
  .dash-filters input[type=date] { width: calc(50% - 20px); }
  .dash-filters .seg, .ads-panel .panel-h .seg { display: flex; flex-wrap: wrap; max-width: 100%; }
  .dash-filters .seg button, .ads-panel .panel-h .seg button { flex: 1 1 auto; padding: 0 9px; }
  .list-modal .task .side-r .tag.st { display: inline-flex; }  /* статус в списке нужен и на телефоне */
  .list-modal .task .side-r { flex-direction: column; align-items: flex-end; }
  /* таблица карточкой: у каждой цифры своя подпись, первая ячейка — заголовок карточки */
  .tbl.cards td[data-l]::before { content: attr(data-l) " "; color: var(--faint); font-size: 12px; }
  .tbl.cards td.r { text-align: left; }
  .tbl.cards, .tbl.cards tbody { display: block; width: 100%; }
  .tbl.cards td:first-child { min-width: 0; }
  .tbl.cards td:first-child .ellipsis { max-width: calc(100vw - 120px) !important; }
  .tbl.cards tr.total { background: var(--surface-2); }
}

/* ─────────── Проект: база знаний ─────────── */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.kb-body { font-size: 14px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.kb-body a, .kb-card .small a { text-decoration: underline; }
@media (max-width: 820px) { .kb-grid { grid-template-columns: minmax(0, 1fr); } }

/* доска: качество заявок по ИИ */
.qfilter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.qfilter .chip b { font-weight: 600; margin-left: 2px; }
.qfilter .q-hot:not(.on) b { color: var(--red, #d33); }
.qfilter .q-warm:not(.on) b, .qfilter .q-good:not(.on) b { color: var(--amber, #c80); }
.qfilter .q-cold:not(.on) b { color: var(--blue, #36c); }
.col-h .q-n { color: var(--amber, #c80); font-weight: 600; }
@media (max-width: 760px) { .qfilter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; } .qfilter .chip { flex: none; } .qfilter > span { display: none; } }

/* ───────── фото и видео ───────── */
.lib-crumbs { font-size: 14px; color: var(--text-2); margin-bottom: 14px; overflow-wrap: anywhere; }
.lib-crumbs a { text-decoration: underline; }
.lib-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.lib-folder { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s, transform .15s; }
.lib-folder:hover { border-color: var(--text-2); transform: translateY(-1px); }
.lib-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); display: grid; place-items: center; color: var(--text-2); }
.lib-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.lib-cap { padding: 10px 12px 12px; display: grid; gap: 3px; }
.lib-cap b { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.lib-cap span { font-size: 12.5px; color: var(--text-2); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lib-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--line); cursor: zoom-in; }
.lib-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.lib-play { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; display: grid; place-items: center; }
.modal.lib-modal { width: min(1100px, 100%); }
.lib-view { position: relative; background: #111; display: grid; place-items: center; min-height: 240px; }
.lib-view img, .lib-view video { max-width: 100%; max-height: calc(100vh - 190px); display: block; }
.lib-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); display: grid; place-items: center; cursor: pointer; }
.lib-nav.prev { left: 10px; } .lib-nav.next { right: 10px; }
@media (max-width: 820px) {
  .lib-folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .lib-tile { border-radius: 6px; }
  .lib-view img, .lib-view video { max-height: calc(92vh - 150px); }
  .modal.lib-modal .modal-f { flex-wrap: wrap; }
}

/* ═══════════ Вид KÓLEM (02.11): меню, плитки, строки, карточки, главная ═══════════ */
body { background: var(--bg); color: var(--text); }
h1, h2, h3 { color: var(--text); }

/* боковое меню: логотип и сворачивание, большая «Новая заявка», группы «Работа · Цифры · Ещё» */
.side { padding: 16px 12px 12px; gap: 4px; overflow: hidden auto; background: var(--surface); transition: width .2s; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 12px; min-height: 48px; }
.side-top .logo { padding: 0; gap: 10px; min-width: 0; }
.logo small { letter-spacing: .06em; text-transform: none; font-size: 12px; margin-top: 2px; }
.side-collapse { width: 30px; height: 30px; flex: none; }
.side-collapse svg { transition: transform .2s; }
.side-new { justify-content: center; margin: 2px 2px 10px; height: 44px; border-radius: 12px; font-size: 14.5px; gap: 8px; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 25%, transparent); }
.nav { gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 4px; }
.nav a, .nav-more {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; border: 0; background: none; cursor: pointer; width: 100%; text-align: left; transition: background .15s, color .15s;
}
.nav a:hover, .nav-more:hover { background: var(--surface-3); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.on svg { color: var(--accent); }
.nav a svg.i, .nav-more svg.i, .side-act svg.i { width: 20px; height: 20px; stroke-width: 1.6; }
.nav a .count { margin-left: auto; font-size: 11px; line-height: 18px; min-width: 18px; text-align: center; background: var(--red-bg); color: var(--red); padding: 0 6px; }
.nav a .count.green { background: var(--green-bg); color: var(--green); }
.nav-more { margin-top: 10px; color: var(--muted); font-size: 13.5px; min-height: 38px; }
.nav-more .nav-chev { margin-left: auto; width: 15px; height: 15px; transition: transform .2s; }
.nav-more[aria-expanded="true"] .nav-chev { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
.nav-sub.closed { display: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-act { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 7px 12px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-size: 13.5px; cursor: pointer; text-align: left; }
.side-act:hover { background: var(--surface-3); color: var(--text); }
.me-btn { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 12px; padding: 8px; margin-top: 6px; background: var(--surface-2); cursor: pointer; text-align: left; color: var(--text); }
.me-btn:hover { background: var(--surface-3); }
.me-btn .who { display: flex; flex-direction: column; min-width: 0; }
.me-btn .who b { font-weight: 600; font-size: 13.5px; }
.me-btn .who span { font-size: 11.5px; color: var(--muted); }
.avatar.lg { background: var(--grad); color: #fff; }

/* переключатель брендов в меню — одна строка */
.brand-switch { flex-direction: row; flex-wrap: wrap; margin: 0 2px 10px; padding: 3px; gap: 2px; background: var(--surface-3); }
.brand-switch button { flex: 1 1 auto; justify-content: center; padding: 6px 8px; font-size: 12.5px; }
.brand-switch button.all, .brand-switch button.both { font-size: 12.5px; color: var(--text-2); padding: 6px 8px; }
.brand-switch button.on { background: var(--surface); }
.brand-switch .dot-new { margin-left: 4px; }

/* свёрнутое меню: только значки */
body.side-mini { --side-w: 76px; }
body.side-mini .side .nav-l, body.side-mini .side .logo div, body.side-mini .brand-switch, body.side-mini .nav a .count, body.side-mini .nav-more .nav-chev { display: none; }
body.side-mini .side-top { flex-direction: column; gap: 8px; padding-inline: 0; }
body.side-mini .side-collapse svg { transform: rotate(180deg); }
body.side-mini .nav-label { height: 1px; padding: 0; margin: 10px 10px; background: var(--line); font-size: 0; }
body.side-mini .nav a, body.side-mini .nav-more, body.side-mini .side-act, body.side-mini .me-btn { justify-content: center; padding-inline: 0; }
body.side-mini .side-new { padding: 0; }
body.side-mini .me-btn { background: none; }
body.side-mini .dropbar { left: calc(76px + 28px); }

/* шапка страницы: дата мелко, заголовок засечками, справа поиск */
.top { padding: 22px 32px 14px; align-items: flex-end; }
.top h1 { font-size: 30px; line-height: 1.15; }
.top .sub { font-size: 14px; color: var(--text-2); margin-top: 4px; white-space: normal; }
.top .sub b { color: var(--text); font-weight: 600; }
.kicker { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.red-t { color: var(--red); }
.top .top-add { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.top .top-add:hover { background: var(--surface-2); filter: none; }
.page { padding: 10px 32px 64px; }
body[data-page="home"] .top h1 { font-size: 0; height: 0; }
body[data-page="home"] .top { padding-top: 18px; padding-bottom: 6px; }

/* плитки цифр: белые карточки с мягкой тенью; цвет только у статуса, полос по краю нет (10.11) */
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; display: block; color: inherit; }
/* наполнение 10.11: ноль словом, длинное свёрнуто, период одной кнопкой */
.kpi .val-word { display: block; font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: 0; margin: 8px 0 4px; color: var(--text-2); }
.fin-tiles > .kpi:only-child { grid-column: 1 / -1; }  /* одна плитка «Выручка», когда расходов нет */
.fin-nocost-line { margin-bottom: 12px; }
.dot-n { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--faint); flex: none; }
.dot-n.atelier { background: var(--atelier); }
.dot-n.kids { background: var(--kids); }
.more-rest:not([hidden]) { display: contents; }
.more-all { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.more-all:hover { color: var(--text); background: var(--hover); }
.more-all:focus-visible, .kb-more:focus-visible, .period-sel:focus-visible, .dots-menu > summary:focus-visible, .fin-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-rest:focus { outline: none; }
.exp-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; }
.exp-empty b { font-size: 16px; font-weight: 600; }
.exp-empty p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.kb-body.kb-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-more { margin-top: 6px; padding: 6px 0; min-height: 32px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.kb-more:hover { color: var(--text); }
.period-sel { height: 36px; width: auto; min-width: 0; padding: 0 30px 0 12px; font-weight: 600; }
.dash-filters .period-sel { display: none; }
.dots-menu { position: relative; }
.dots-menu > summary { list-style: none; display: inline-grid; place-items: center; width: 40px; height: 36px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.dots-menu > summary::-webkit-details-marker { display: none; }
.dots-menu > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.dots-menu > div a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.dots-menu > div a:hover { background: var(--surface-2); }
.fin-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 18px; list-style: none; cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500; }
.fin-fold > summary::-webkit-details-marker { display: none; }
.fin-fold > summary:hover { color: var(--text); }
.fin-fold > summary h3 { color: var(--text); }
.fin-fold > summary h3 .count { margin-left: 6px; font-weight: 400; white-space: nowrap; }
.fin-fold[open] > summary .fin-due-chev { transform: rotate(90deg); }
.sales-more { margin-bottom: 16px; }
.sales-more > .panel, .sales-more > .kpis { margin-top: 12px; }
@media (max-width: 820px) {
  .dash-filters .period-sel { display: inline-block; width: auto; flex: 0 1 auto; }  /* select.inp растягивал на всю ширину, «⋯» уезжал вниз */
  .dash-filters.m-compact { gap: 8px; margin-bottom: 10px; }
  .dash-filters.m-compact input[type=date], .dash-filters.m-compact > .muted, .dash-filters.m-compact .brand-seg { display: none; }
  .dash-filters.m-compact.custom input[type=date], .dash-filters.m-compact.custom > .muted { display: inline-block; }
  .dash-filters.m-compact.branded .brand-seg { display: inline-flex; }
}
.kpi .lbl { font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 32px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 2px; }
.kpi.bad .val { color: var(--red); }
a.kpi { transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.story { font-size: 18px; line-height: 1.6; color: var(--text-2); margin: 4px 0 18px; max-width: 980px; }
.story b { color: var(--text); font-weight: 600; }
.story .bad { color: var(--red); }

/* группы строк на «Сегодня» */
.group { margin-bottom: 22px; }
.group-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 4px 8px; }
.group-h h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.group-h .n { font-size: 12px; font-weight: 600; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.group.urgent .group-h .n { background: var(--red-bg); color: var(--red); }
.group-h .hint-t { color: var(--muted); font-size: 13.5px; }
.group-b { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.group-b > .empty-state { padding: 26px 20px; }
.task.row-k { gap: 14px; padding: 14px 18px; align-items: center; position: relative; border-top: 1px solid var(--line); }
.group-b > .task.row-k:first-child { border-top: 0; }
.task.row-k .body .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.task.row-k .body .t b { font-weight: 600; font-size: 15px; }
.task.row-k .what { margin-top: 2px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.task.row-k .body .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.task.row-k .side-r { gap: 8px; }
.task.row-k .when { font-size: 13.5px; color: var(--text-2); white-space: nowrap; margin-right: 4px; }
.task.row-k .when.red { color: var(--red); font-weight: 600; }
.task.row-k .btn.wa { background: transparent; color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.task.row-k .btn.wa:hover { background: var(--green-bg); }
.task.row-k .check { width: 30px; height: 30px; }
.more-row { justify-content: center; color: var(--muted); font-size: 13.5px; padding: 12px; gap: 6px; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill.st-new { background: var(--amber-bg); color: var(--amber); }
.pill.st-work { background: var(--blue-bg); color: var(--blue); }
.pill.st-visit { background: var(--accent-soft); color: var(--accent); }
.pill.st-win { background: var(--green-bg); color: var(--green); }
.pill.st-lost { background: var(--red-bg); color: var(--red); }
.ava { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; color: #fff; background: var(--grad); }
.ava.atelier { background: linear-gradient(135deg, #8CC79E, #2E8B4A); }
.ava.kids { background: linear-gradient(135deg, #B9ABDF, #6A58A0); }

/* главная */
.home-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; margin: 6px 0 18px; padding: 26px 28px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: linear-gradient(135deg, color-mix(in srgb, #F5A39A 18%, var(--surface)) 0%, var(--surface) 62%); }
.hh-hello { font: 34px/1.15 var(--serif); margin: 4px 0 10px; }
.hh-sub { margin: 0; color: var(--text-2); font-size: 15px; }
.hh-pulse { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; color: var(--text-2); }
.hh-pulse i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.hh-pulse i.wait { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.hh-weather { border-left: 1px solid var(--line); padding-left: 22px; display: grid; gap: 10px; align-content: center; }
.w-now { display: flex; align-items: center; gap: 14px; }
.w-ico { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.w-now .w-ico { width: 46px; height: 46px; }
.w-t { font-size: 38px; font-weight: 500; line-height: 1; }
.w-c { font-size: 13px; color: var(--text-2); }
.w-meta { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.w-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.w-days div { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 12px; }
.w-days .w-ico { width: 20px; height: 20px; grid-row: span 2; }
.w-days span { color: var(--muted); }
.w-days em { font-style: normal; color: var(--muted); margin-left: 4px; font-weight: 400; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.hcard h2 { font-size: 12px; margin: 0; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.hcard h4 { font-size: 11px; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.link { color: var(--accent); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.h-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border: 0; border-top: 1px solid var(--line); width: 100%; background: none; text-align: left; cursor: pointer; color: var(--text); font-size: 14px; }
.h-list .h-item:first-child { border-top: 0; }
.h-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.tg-dot.late { background: var(--red); }
.tg-dot.today { background: var(--accent); }
.due { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.due.late { background: var(--red-bg); color: var(--red); }
.due.today { background: var(--accent-soft); color: var(--accent); }
.wk-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.wk-strip div { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.wk-strip b { font-size: 17px; color: var(--text); font-weight: 600; }
.wk-strip div.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.wk-strip i { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 600 10.5px/18px var(--font); font-style: normal; text-align: center; }
.vis-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--text); }
.vt { font-size: 17px; font-weight: 600; color: var(--accent); font-variant-numeric: lining-nums proportional-nums; }
.vb { display: flex; flex-direction: column; min-width: 0; }
.vb small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.h-tiles > * { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; color: inherit; }
.h-tiles b { font-size: 22px; font-weight: 500; line-height: 1.15; font-variant-numeric: lining-nums proportional-nums; }
.h-tiles span { font-size: 12px; color: var(--muted); }
.hf + .hf { margin-top: 14px; }
.hf-n { font-weight: 600; margin-bottom: 6px; }
.hf-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.hf-row b { text-align: right; font-variant-numeric: lining-nums proportional-nums; color: var(--text); }
.hf-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hf-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); min-width: 2px; }
.hf-bar i.atelier, .hf-bar i.kids { background: var(--faint); }  /* бренд точкой у названия, полосы нейтральные (10.11) */

/* воронка: колонки с плашкой этапа, карточки как у KÓLEM */
.board-bar .pipes button { display: inline-flex; align-items: center; gap: 7px; }
.board-bar .filter { width: 230px; }
.board { gap: 14px; }
.col { flex: 0 0 292px; background: var(--surface-3); border-radius: var(--r); }
.col.lost { background: color-mix(in srgb, var(--red-bg) 55%, var(--surface-3)); }
.col.won { background: color-mix(in srgb, var(--green-bg) 55%, var(--surface-3)); }
.col.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.col-h { padding: 14px 14px 8px; }
.col-h .name { justify-content: space-between; }
.col-h .name .n { font-size: 13px; }
.col-body { padding: 2px 8px 10px; gap: 8px; }
.col-empty { border: 1px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.card { border-radius: 14px; padding: 14px 14px 12px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card.stale { background: var(--surface); }
.c-top { display: flex; align-items: flex-start; gap: 10px; }
.c-top .ava { width: 34px; height: 34px; font-size: 11.5px; }
.c-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-who b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-who span { font-size: 12.5px; color: var(--muted); font-variant-numeric: lining-nums proportional-nums; }
.c-src { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sd { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.sd.ig { background: #D9539A; } .sd.wa { background: #2F9D64; } .sd.ads { background: var(--blue); } .sd.site { background: var(--faint); }
.c-what { font-size: 13.5px; color: var(--text-2); margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-what .money { color: var(--text); font-weight: 600; }
.c-next { display: flex; gap: 7px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text); }
.c-next svg { color: var(--accent); margin-top: 1px; }
.c-next b { font-weight: 600; }
.c-next b.red { color: var(--red); }
.c-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.c-tags { display: flex; gap: 4px; flex: none; }
.c-tags .tag { height: 20px; font-size: 11.5px; padding: 0 7px; }
.card .pay { bottom: -1px; }
.stage-chips { display: none; }

/* доска 02.11: колонка ровно 272 px и не растягивается под длинную строку, на большом экране видно пять этапов.
   Источник под телефоном, вместо «без описания» последнее сообщение, вместо красного «нет шага» серая «+ шаг» */
@media (min-width: 821px) {
  .board { gap: 12px; }
  .board .col { flex: 0 0 272px; min-width: 0; }
  .board .col.closed { flex-basis: 232px; }
}
.card { padding: 12px 12px 11px; }
.c-who .sub { display: block; }
.c-who .sub .c-src { display: inline; max-width: none; margin: 0; font-size: inherit; }
.c-who .sub .sd { display: inline-block; vertical-align: 1px; margin-right: 4px; }
.c-what { margin-top: 8px; overflow-wrap: anywhere; }
.c-msg { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.c-msg p { margin: 0; flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.c-msg.in p { color: var(--text); }
.c-msg time { flex: none; font-size: 11.5px; color: var(--faint); margin-top: 1px; font-variant-numeric: lining-nums proportional-nums; }
.c-next { margin-top: 8px; }
.c-next span { min-width: 0; overflow-wrap: anywhere; }
.c-next b { white-space: nowrap; }
.c-next b.blue { color: var(--blue); }
.c-foot { flex-wrap: wrap; row-gap: 6px; }
.c-tags { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.tag.add-step { border: 0; cursor: pointer; font-family: inherit; background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); gap: 2px; }
.tag.add-step:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--muted); }
.tag.add-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.c-tags .tag svg { width: 12px; height: 12px; }
/* активный пункт меню без красной заливки: красный остаётся у «Новой заявки» и у опозданий */
.nav a.on, body[data-brand] .nav a.on { background: var(--surface-3); color: var(--text); }

/* таблицы, панели, ящик — мягче, как у KÓLEM */
.panel, .sect, .kv > div, .hero { border-radius: var(--r); box-shadow: var(--shadow); }
.panel-h h3 { font-size: 15.5px; }
.drawer { background: var(--bg); }
.drawer-h { background: var(--surface); }
.sheet { background: var(--surface); }
.sheet-me { display: flex; align-items: center; gap: 12px; padding: 8px 12px 6px; }
.sheet-me > div { display: flex; flex-direction: column; }
.sheet-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 4px; }
.sheet .sheet-grid a { flex-direction: column; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--surface-2); font-size: 12.5px; text-align: center; justify-content: center; }
.sheet .sheet-grid a svg { color: var(--accent); }
.sheet.pop { position: fixed; left: 12px; bottom: 12px; width: 300px; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; }
.sheet-wrap:has(.sheet.pop) { background: rgba(35, 30, 27, .12); }

/* тёмная тема: подсказки и пузыри, где были светлые цвета */
:root[data-theme="dark"] .hint, :root[data-theme="dark"] .fire a.warm { color: var(--amber); }
:root[data-theme="dark"] .hint.red, :root[data-theme="dark"] .fire a.hot { color: var(--red); border-color: transparent; }
:root[data-theme="dark"] .hint.blue, :root[data-theme="dark"] .found { color: var(--blue); }
:root[data-theme="dark"] .hint.green { color: var(--green); }
:root[data-theme="dark"] .ev.message .txt .body { background: var(--msg-out); border-color: transparent; }
:root[data-theme="dark"] .ev.comment .txt .body { background: var(--amber-bg); border-color: transparent; }
:root[data-theme="dark"] .tag.ch-ig { background: #3a1f2d; color: #f08cc0; }
:root[data-theme="dark"] .tag.ch-wa { background: var(--green-bg); color: var(--green); }
:root[data-theme="dark"] .day-sep span { background: var(--surface-2); }
:root[data-theme="dark"] .msg { box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hint, :root:not([data-theme="light"]) .fire a.warm { color: var(--amber); }
  :root:not([data-theme="light"]) .hint.red, :root:not([data-theme="light"]) .fire a.hot { color: var(--red); border-color: transparent; }
  :root:not([data-theme="light"]) .hint.blue, :root:not([data-theme="light"]) .found { color: var(--blue); }
  :root:not([data-theme="light"]) .hint.green { color: var(--green); }
  :root:not([data-theme="light"]) .ev.message .txt .body { background: var(--msg-out); border-color: transparent; }
  :root:not([data-theme="light"]) .ev.comment .txt .body { background: var(--amber-bg); border-color: transparent; }
  :root:not([data-theme="light"]) .tag.ch-ig { background: #3a1f2d; color: #f08cc0; }
  :root:not([data-theme="light"]) .day-sep span { background: var(--surface-2); }
}

@media (max-width: 1180px) {
  .home-hero, .home-grid { grid-template-columns: 1fr; }
  .hh-weather { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
}
@media (max-width: 820px) {
  .top { padding: 12px 16px 8px; align-items: center; }
  .top h1 { font-size: 24px; }
  .top .sub { font-size: 13px; }
  .top .seg { display: none; }
  .kicker { font-size: 12px; margin-bottom: 2px; }
  .page { padding: 6px 16px 100px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpi .val { font-size: 26px; }
  .story { font-size: 15.5px; }
  .group-h .hint-t { width: 100%; font-size: 12.5px; }
  .task.row-k { padding: 12px 14px; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .task.row-k .ava { width: 34px; height: 34px; font-size: 11.5px; }
  .task.row-k .body { flex: 1 1 calc(100% - 60px); }
  .task.row-k .side-r { width: 100%; padding-left: 46px; flex-wrap: wrap; }
  .task.row-k .side-r .tag { display: inline-flex; }
  .task.row-k .when { margin-right: auto; }
  .home-hero { padding: 18px; border-radius: 18px; }
  .hh-hello { font-size: 26px; }
  .h-tiles { grid-template-columns: 1fr 1fr; }
  .hf-row { grid-template-columns: 104px minmax(0, 1fr) 24px; }
  .tabbar { align-items: flex-end; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(16px); }
  .tabbar a.on, .tabbar button.on { color: var(--accent); }
  .tabbar .plus { width: 52px; height: 52px; margin-top: -22px; background: var(--grad); color: #fff; box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
  .stage-chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
  .stage-chips::-webkit-scrollbar { display: none; }
  .stage-chips .chip { flex: none; }
  .stage-chips .chip b { color: var(--muted); font-weight: 600; }
  .stage-chips .chip.on b { color: inherit; }
  .board .col { flex-basis: calc(100vw - 32px); background: transparent; }
  .board .col-h { display: none; }
  .board .col-body { padding: 0; }
  .board-bar .pipes { width: 100%; }
  .board-bar .pipes button { flex: 1 0 auto; }
  .sheet { max-height: 88vh; overflow-y: auto; }
  .sheet .item { font-size: 15px; }
}

/* правки после снимков 02.11 */
.top .top-add { display: none; }
.dash-filters .m-seg { display: none; }
.c-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-switch { flex-wrap: nowrap; }
.brand-switch button { gap: 6px; }
@media (max-width: 820px) {
  .dash-filters .m-seg { display: flex; }
  .kpis > .kpi:first-child { grid-column: auto; }
  .task.row-k .side-r { flex-wrap: nowrap; gap: 6px; }
  .task.row-k .check { width: 28px; height: 28px; }
  .board-bar .pipes { flex: 1 0 100%; }
  .board-bar .pipes button { flex: 1 0 auto; padding: 0 10px; }
}
@media (max-width: 360px) {
  .task.row-k .btn.wa { width: 34px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
}
@media (max-width: 820px) {
  .board { scroll-padding-inline: 16px; }
  .board .col { scroll-snap-align: start; }
}
@media (max-width: 820px) {
  .board .col { min-width: 0; max-width: calc(100vw - 32px); }
  .board .col-body, .board .card { min-width: 0; }
  .c-tags { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
}
.col-body { min-width: 0; }
.card { min-width: 0; }
.c-foot > .ellipsis { min-width: 0; }

.kpi .val { overflow-wrap: anywhere; }
.kpi.text .val { font-size: 22px; line-height: 1.25; margin-top: 8px; }

/* Onest вместо Prata: заголовки полужирные и плотнее, цифры ровные */
.top h1, .logo b, .drawer-h h2, .modal-h h3, .login h1, .pick b, .hh-hello { font-weight: 600; letter-spacing: -.025em; }
.hero-num, .big-num { font-weight: 600; letter-spacing: -.03em; }
.kpi .val, .h-tiles b, .w-t, .wk-strip b, .vt, .hero-num, .big-num, .stat-pill b, .money3 b, .money3 input, .w-days b, .fire a b { letter-spacing: -.02em; font-variant-numeric: lining-nums proportional-nums; }
/* у Onest моноширинная «1» стоит с дырой рядом: в крупных цифрах и суммах цифры обычные */
.c-what .money, .card .money, .vt, .when { font-variant-numeric: lining-nums proportional-nums; }
.nav-label, .hcard h2, .hcard h4, .sheet-h, .sect > h4 { letter-spacing: .08em; }

/* при красном акценте: «сегодня» синим, визиты сиреневым, чтобы не путать с просрочкой */
.due.today { background: var(--blue-bg); color: var(--blue); }
.tg-dot.today { background: var(--blue); }
.pill.st-visit { background: var(--violet-bg); color: var(--violet); }

/* ───── Продажи по фото кассовой тетради (#/sales) ───── */
.story .warn { color: var(--amber); }
.pay-rows { display: grid; gap: 14px; margin-top: 4px; }
.pay-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 40px; align-items: center; gap: 12px; font-size: 14px; }
.pay-n { display: flex; flex-direction: column; font-weight: 500; line-height: 1.25; }
.pay-n small { font-size: 12px; color: var(--muted); font-weight: 400; }
.pay-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.pay-track i { display: block; height: 100%; border-radius: 5px; }
.pay-row b { font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums proportional-nums; }
.pay-row em { font-style: normal; color: var(--muted); text-align: right; font-size: 13px; }
.kdays-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.kdays-h h2 { margin: 0; font-size: 18px; font-weight: 600; }
.kdays { display: grid; gap: 12px; }
.kday-h { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px 12px; }
.kday-t { flex: 1; min-width: 0; }
.kday-d { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kday-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.kday-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.kday-sum b { font-size: 20px; font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums proportional-nums; }
.kday-chk { margin: 0 18px 12px; padding: 10px 14px; border-radius: 10px; background: var(--amber-bg); color: var(--text); font-size: 13.5px; }
.kday-chk ul { margin: 0; padding: 0; list-style: none; }
.kday-chk li + li { margin-top: 4px; }
.kday-more { border-top: 1px solid var(--line); }
.kday-more > summary { cursor: pointer; padding: 11px 18px; font-size: 13.5px; color: var(--text-2); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.kday-more > summary:hover { color: var(--text); }
.kday-more > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin: 0 12px 0 2px; transition: transform .15s; flex: none; }
.kday-more[open] > summary::before { transform: rotate(45deg); }
.kday-more > summary::-webkit-details-marker { display: none; }
@media (prefers-reduced-motion: reduce) { .kday-more > summary::before { transition: none; } }
.kday-sum-t { margin: 0 18px 10px; color: var(--text-2); font-size: 13.5px; }
.ktbl { width: 100%; border-collapse: collapse; }
.ktbl td { vertical-align: top; }
.ktbl .k-n { display: inline-block; min-width: 20px; color: var(--faint); font-size: 12px; }
.ktbl tr.k-other td { color: var(--muted); }
.ktbl tr.k-other b { font-weight: 500; }
.kday-foot { padding: 12px 18px 16px; display: grid; gap: 10px; }
.kday-notes { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
.kphotos { display: flex; gap: 10px; flex-wrap: wrap; }
.kphotos a { position: relative; display: block; width: 132px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.kphotos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kphotos span { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 5px; }
@media (max-width: 820px) {
  .kday-h { padding: 14px 14px 10px; }
  .kday-chk { margin: 0 14px 10px; }
  .kday-more > summary { padding: 10px 14px; }
  .kday-sum-t { margin: 0 14px 8px; }
  .kday-foot { padding: 10px 14px 14px; }
  .ktbl tr { padding: 10px 14px !important; }
  .ktbl td[data-l=""]::before { content: none; }
  .ktbl td.r { margin-left: auto; }
  .kphotos a { width: calc(50% - 5px); height: 110px; }
  .kpis.three > :first-child { grid-column: 1 / -1; }
}

/* ───── деньги собственника: «Итоги» и «Расходы» (с 03.11) ───── */
.fin-bar .month-nav button:disabled { opacity: .35; cursor: default; }
.fin-grid { margin-bottom: 16px; }
.fin-list { display: grid; }
.fin-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.fin-row:not(:has(> .fin-when)) { grid-template-columns: minmax(0, 1fr) auto auto; }
.fin-row:first-child { border-top: 0; }
.panel > .fin-list .fin-row:first-child { border-top: 1px solid var(--line); }
.fin-row.click { cursor: pointer; }
.fin-row.click:hover { background: var(--hover); }
.fin-row.done { opacity: .6; }
.fin-when { font-size: 13px; color: var(--muted); font-variant-numeric: lining-nums proportional-nums; white-space: nowrap; }
.fin-when.late { color: var(--red); font-weight: 600; }
.fin-when small { display: block; font-weight: 400; font-size: 11.5px; }
.fin-what { min-width: 0; }
.fin-what > b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-what > span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-what .tag { font-size: 11.5px; vertical-align: 1px; }
.fin-sum { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: lining-nums proportional-nums; }
.fin-sum small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.fin-debts { display: grid; gap: 18px; }
.fin-debt .fin-list { margin: 0 -18px; }
.fin-debt .fin-row { padding: 9px 18px; }
.fin-debt-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 13.5px; color: var(--text-2); }
.fin-debt-h b { font-size: 18px; color: var(--text); font-variant-numeric: lining-nums proportional-nums; }
.fin-form .k { display: none; font-style: normal; }
.fin-form[data-kind="expense"] .k-expense, .fin-form[data-kind="planned"] .k-planned,
.fin-form[data-kind="debt"] .k-debt, .fin-form[data-kind="owed"] .k-owed { display: inline; }
.fin-form:not([data-kind="planned"]) .only-planned { display: none; }
.fin-kinds input, .fin-brands input { position: absolute; opacity: 0; pointer-events: none; }
.fin-kinds .chip:has(input:checked) { background: var(--text); border-color: var(--text); color: var(--bg); }
.fin-kinds .chip:has(input:focus-visible), .fin-brands label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fin-brands { display: flex; }
.fin-brands label { flex: 1; height: 32px; display: grid; place-items: center; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--text-2); font-size: 13px; position: relative; }
.fin-brands label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.mkt-money { margin-bottom: 16px; }
@media (max-width: 820px) {
  .fin-bar .seg { flex: 1 1 auto; }
  .fin-row { grid-template-columns: 58px minmax(0, 1fr) auto; padding: 10px 14px; }
  .fin-row > .btn { grid-column: 2 / -1; justify-self: start; }
  .fin-row:not(:has(> .fin-when)) { grid-template-columns: minmax(0, 1fr) auto; }
  .fin-row:not(:has(> .fin-when)) > .btn { grid-column: 1 / -1; }
  .fin-what > span, .fin-what > b { white-space: normal; }
  .fin-list-h { flex-wrap: wrap; }
  .fin-list-h h3 { white-space: nowrap; }
  .fin-debt .fin-list { margin: 0 -18px; }
  .fin-kinds { gap: 6px; }
}
@media (max-width: 420px) {
  .fin-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 10px; }
  .fin-when small { font-size: 11px; }
}
details.fin-due > summary { list-style: none; cursor: pointer; flex-wrap: wrap; }
details.fin-due > summary::-webkit-details-marker { display: none; }
details.fin-due > summary h3 { margin-right: 2px; }
.fin-due-chev { margin-left: auto; color: var(--muted); transition: transform .15s; display: inline-flex; }
details.fin-due[open] .fin-due-chev { transform: rotate(90deg); }
details.fin-due:not([open]) > summary { padding-bottom: 14px; }
details.fin-due > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .fin-due-chev { transition: none; } }
.fin-bar .fin-add { order: 9; margin-left: auto; }
@media (max-width: 820px) { .fin-bar .fin-add { order: -1; width: 100%; justify-content: center; height: 40px; margin-left: 0; } }

/* ───── система Марии (05.11): Итоги, Зарплаты, Продажи, Расходы. Только принятые токены; числа денег вправо и табличными цифрами ───── */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.green-t { color: var(--green); }
.amber-t { color: var(--amber); }
/* столбцы денег: цифры одной ширины. У Onest табличная «1» стоит с зазором, поэтому пробел между разрядами шире: «125 400» не читается как «1 25 400» */
.fin-sum, .fin-t td.num, .lc .num, .dir-v, .exp-s, .exp-part b, .fin-dl dd { font-variant-numeric: lining-nums tabular-nums; word-spacing: .1em; }
.nw { white-space: nowrap; }
.month-nav:focus-within { outline: 0; }
.month-nav button:focus-visible, .fin-link-row:focus-visible, .fin-paycard:focus-visible, .fin-tile:focus-visible, .exp-brand:focus-visible, .tbl-wrap:focus-visible,
.exp-group > summary:focus-visible, .pay-card > summary:focus-visible, .pay-noterms > summary:focus-visible, .fin-more > summary:focus-visible, .lc-lines > summary:focus-visible,
.fin-row[role=button]:focus-visible, .mgr-upload:focus-visible, #imp-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* месяц */
.fin-bar { margin-bottom: 14px; }
.month-nav { align-items: stretch; }
.seg.month-nav button { width: 38px; padding: 0; display: grid; place-items: center; color: var(--text); }
.month-cur { min-width: 112px; display: grid; place-items: center; padding: 0 10px; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 600; white-space: nowrap; }

/* четыре плитки: полная сумма, без обрезки */
.fin-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.fin-tiles .kpi { padding: 14px 16px; min-width: 0; }
.fin-tiles .kpi .lbl { font-size: 13.5px; color: var(--text-2); }
.fin-tiles .kpi .val { white-space: nowrap; overflow-wrap: normal; font-size: clamp(22px, 2.05vw, 30px); font-weight: 600; margin: 4px 0 0; }
.fin-tiles .kpi .delta { margin-top: 3px; font-size: 13px; }
.fin-tiles .kpi .delta:empty { display: none; }
.fin-tiles .kpi.good .val { color: var(--green); }
.fin-going { margin: -4px 0 14px; color: var(--text-2); font-size: 14px; }
.fin-top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.fin-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fin-why { margin: 0; font-size: 13px; color: var(--muted); }

/* по направлениям */
.dir-list { list-style: none; margin: 0; display: grid; gap: 14px; }
.dir-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.dir-n { font-weight: 500; }
.dir-v { font-weight: 600; white-space: nowrap; }
.dir-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.dir-track i { display: block; height: 100%; border-radius: 5px; }
.dir-note { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* строка-ссылка */
.fin-link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-2); font-size: 14px; text-align: left; cursor: pointer; }
.fin-link-row b { color: var(--text); font-weight: 600; white-space: nowrap; }
.fin-link-row:hover { background: var(--hover); }
.fin-link-row svg { flex: none; color: var(--muted); }
.fin-link-row.inset { border-width: 1px 0; border-radius: 0; padding-inline: 18px; font-weight: 500; color: var(--text); }

/* карточка зарплат на Итогах */
.fin-paycard { display: block; color: inherit; }
.fin-paycard:hover { background: var(--hover); }
.fin-paycard .panel-h { justify-content: space-between; }
.fin-go { display: inline-flex; color: var(--muted); }
.fin-dl { margin: 0; display: grid; gap: 6px; }
.fin-dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14.5px; }
.fin-dl dt { color: var(--text-2); }
.fin-dl dd { margin: 0; font-weight: 600; white-space: nowrap; }

/* таблицы денег: подпись слева, числа вправо; строки итогов весом и линией */
.tbl-wrap { overflow-x: auto; }
.fin-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin-t th, .fin-t td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: baseline; }
.fin-t td.num, .fin-t th.r, .fin-t td.r { text-align: right; white-space: nowrap; }
.fin-t th:first-child, .fin-t td:first-child { padding-left: 18px; }
.fin-t th:last-child, .fin-t td:last-child { padding-right: 18px; }
.fin-t thead th { border-top: 0; padding-top: 2px; font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; vertical-align: bottom; }
.fin-t thead th.cur { color: var(--text); font-weight: 600; }
.fin-t thead small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.fin-t tbody tr.sum th, .fin-t tbody tr.sum td, .fin-t tfoot th, .fin-t tfoot td { font-weight: 600; }
.fin-t tr.sub td { padding-top: 2px; padding-bottom: 6px; border-top: 0; font-size: 13px; color: var(--muted); }
.fin-t small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.fin-t sup { color: var(--muted); font-size: 11px; line-height: 0; margin-right: 1px; }
.fin-t tbody td.red-t { color: var(--red); }
.fin-stmt { padding-bottom: 4px; }
.stmt th[scope=row], .stmt thead th:first-child, .mgr-t tbody th, .mgr-t thead th:first-child { position: sticky; left: 0; background: var(--surface); }
.stmt tr.row-revenue th, .stmt tr.row-revenue td, .stmt tr.row-spent th, .stmt tr.row-spent td, .stmt tr.row-profit th, .stmt tr.row-profit td { border-top-color: var(--line-2); }
.stmt-notes { padding-top: 10px; padding-bottom: 12px; }
.fin-costs .panel-h { flex-wrap: wrap; }
.fin-costs .fin-t { margin-bottom: 4px; }
.fin-costs tbody tr.sum th, .fin-costs tbody tr.sum td { background: var(--surface-2); }

/* «Подробнее» */
.fin-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 16px; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; }
.fin-more > summary::-webkit-details-marker { display: none; }
.fin-more > summary:hover { background: var(--hover); }
.fin-more[open] > summary { margin-bottom: 12px; color: var(--text); }
.fin-more[open] > summary .fin-due-chev { transform: rotate(90deg); }
.fin-more-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fin-more .panel { margin-bottom: 0; }

/* чего не хватает */
.fin-gaps { margin-top: 18px; }
.fin-gaps h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.fin-gaps ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }

/* продажи */
.fin-h2 { margin: 26px 0 12px; font-size: 18px; font-weight: 600; }
.mgr { margin-bottom: 14px; }
.page > .fin-dirs { margin-bottom: 14px; }
.mgr-t th.plain { font-weight: 500; }
.mgr-t tr.grp th, .mgr-t tr.grp td { background: var(--surface-2); }
.mgr-empty { margin: 0; font-size: 14px; color: var(--text-2); }
.mgr-foot { padding-top: 12px; }
.mgr-upload { min-height: 44px; justify-content: center; }
.chk { margin-bottom: 14px; }
.chk-row { display: grid; gap: 6px; padding: 0 16px 12px; }
.chk-row .lc-list { margin: 0; }
.chk-row .lc-lines li.lc-item { display: block; }
.chk-row .pay-verdict { font-weight: 500; }
svg.rot180 { transform: rotate(180deg); }
.imp-file { height: auto; padding: 9px 11px; }
.imp-err { padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 14px; }
.imp-ok { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--green-bg); color: var(--green); font-weight: 600; }
.imp-text { margin: 0; white-space: pre-line; font-size: 14.5px; }

/* зарплаты */
.pay-cards { columns: 2; column-gap: 14px; }
.pay-cards .pay-card { break-inside: avoid; margin-bottom: 14px; }
.pay-empty { margin-bottom: 14px; }
.pay-card > summary, .pay-noterms > summary { list-style: none; cursor: pointer; }
.pay-card > summary::-webkit-details-marker, .pay-noterms > summary::-webkit-details-marker, .lc-lines > summary::-webkit-details-marker, .exp-group > summary::-webkit-details-marker { display: none; }
.pay-card > summary { display: grid; gap: 8px; padding: 14px 16px; }
.pay-who { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pay-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.pay-name b { font-size: 16px; font-weight: 600; }
.pay-role { font-size: 13px; color: var(--muted); }
.pay-big { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pay-big > span { font-size: 14px; color: var(--text-2); }
.pay-big b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.pay-verdict { display: flex; align-items: flex-start; gap: 7px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.pay-verdict svg { margin-top: 2px; }
.pay-verdict.bad { background: var(--red-bg); color: var(--red); }
.pay-verdict.ok { background: var(--green-bg); color: var(--green); }
.pay-verdict.neutral { background: var(--surface-2); color: var(--text-2); }
.pay-verdict.warn { background: var(--amber-bg); color: var(--text); }
.pay-verdict.warn svg { color: var(--amber); }
.pay-hint { font-size: 13.5px; color: var(--amber); }
.pay-card[open] .closed-only { display: none; }
.pay-card[open] .pay-who .fin-due-chev, .pay-noterms[open] .fin-due-chev { transform: rotate(90deg); }
.pay-body { display: grid; gap: 12px; padding: 0 0 14px; }
.pay-body > .pay-verdict { margin: 0 16px; }
.pay-calc th:first-child, .pay-calc td:first-child { padding-left: 16px; }
.pay-calc th:last-child, .pay-calc td:last-child { padding-right: 16px; }
.pay-calc td:first-child, .pay-calc th:first-child { overflow-wrap: anywhere; }
.pay-src { padding: 0 16px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pay-src .tag { height: 20px; font-size: 12px; }
.pay-noterms { margin-bottom: 14px; }
.pay-noterms > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 16px; font-size: 14px; color: var(--text-2); }
.pay-nodata { margin-bottom: 14px; }
.lc { display: grid; gap: 6px; padding: 12px 16px 0; border-top: 1px solid var(--line); }
.lc h4 { margin: 0; font-size: 14.5px; font-weight: 600; }
.lc-list { list-style: none; margin: 4px 0 0; padding: 0; }
.lc-item { padding: 9px 0; border-top: 1px solid var(--line); }
.lc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.lc-top b { font-weight: 600; }
.lc-top .num { white-space: nowrap; }
.lc-what { font-size: 13px; color: var(--muted); }
.lc-text { margin-top: 2px; font-size: 14px; font-weight: 500; }
.lc-sim { margin-top: 3px; font-size: 13px; color: var(--text-2); }
.lc-lines > summary { display: flex; align-items: center; min-height: 44px; font-size: 13.5px; color: var(--text-2); cursor: pointer; list-style: none; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.lc-lines ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.lc-lines li { display: flex; justify-content: space-between; gap: 12px; }
.lc-line-t { min-width: 0; overflow-wrap: anywhere; }
.lc-lines .num { white-space: nowrap; }
.lc-lines .tag { height: 19px; font-size: 11.5px; padding: 0 6px; }

/* расходы */
.exp-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14.5px; color: var(--text-2); }
.exp-total b { font-size: 20px; font-weight: 600; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.exp-brands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.exp-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.exp-brand span { font-size: 13.5px; color: var(--text-2); }
.exp-brand b { font-size: 16px; font-weight: 600; white-space: nowrap; }
.exp-brand:hover { background: var(--hover); }
.exp-brand.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.exp-brand.on span { color: inherit; }
.exp-part { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 9px 44px 9px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 14.5px; font-weight: 600; }
.exp-part b { font-weight: 600; white-space: nowrap; }
.exp-h { padding-bottom: 12px; }
.exp-group { border-top: 1px solid var(--line); }
.exp-group > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; min-height: 54px; padding: 8px 16px 8px 18px; cursor: pointer; list-style: none; }
.exp-group > summary:hover { background: var(--hover); }
.exp-group[open] > summary .fin-due-chev { transform: rotate(90deg); }
.exp-n { min-width: 0; font-weight: 500; font-size: 14.5px; }
.exp-n small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.exp-s { font-weight: 600; white-space: nowrap; }
.exp-group .fin-list { padding-bottom: 4px; background: var(--surface-2); }
.exp-group .fin-row { border-top-color: var(--line); }
.exp-group.credit .exp-s { color: var(--muted); }
.exp-list { overflow: hidden; margin-bottom: 16px; }

@media (min-width: 1181px) {
  .pay-cards { margin-bottom: 14px; }
}
@media (max-width: 1180px) {
  .fin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-top-grid, .fin-more-b { grid-template-columns: minmax(0, 1fr); }
  .pay-cards { columns: 1; }
}
@media (max-width: 820px) {
  .fin-bar .month-nav { flex: 0 1 auto; flex-wrap: nowrap; }
  .fin-bar .month-nav button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; }
  .fin-bar .month-cur { flex: 1 1 auto; min-width: 92px; }
  .fin-bar .fin-add { order: 9; width: auto; height: 50px; margin-left: auto; padding: 0 14px; }
  .fin-tiles { gap: 8px; margin-bottom: 10px; }
  .fin-tiles .kpi { padding: 12px; }
  .fin-tiles .kpi .val { font-size: clamp(16px, 5.2vw, 30px); }
  .fin-going { margin: 0 0 12px; }
  .fin-top-grid { gap: 12px; margin-bottom: 12px; }
  .fin-t th:first-child, .fin-t td:first-child { padding-left: 14px; }
  .fin-t th:last-child, .fin-t td:last-child { padding-right: 14px; }
  .pay-calc th:first-child, .pay-calc td:first-child { padding-left: 14px; }
  .pay-calc th:last-child, .pay-calc td:last-child { padding-right: 14px; }
  .fin-t th, .fin-t td { padding-inline: 7px; }
  .pay-card > summary { padding: 12px 14px; }
  .pay-body > .pay-verdict, .pay-src { margin-inline: 0; padding-inline: 14px; }
  .pay-body > .pay-verdict { margin-inline: 14px; padding-inline: 10px; }
  .lc { padding-inline: 14px; }
  .pay-big b { font-size: 21px; }
  .mgr-upload { width: 100%; }
  .exp-brand { padding: 9px 10px; }
  .exp-brand b { font-size: clamp(13px, 3.75vw, 16px); }
  .exp-group > summary { padding-left: 14px; padding-right: 12px; }
  .exp-part { padding-left: 14px; padding-right: 38px; }
  .fin-row.click { min-height: 44px; }
  /* один левый край у заголовка панели, строк и таблиц; кнопки денежных экранов под палец */
  body:is([data-page=summary], [data-page=expenses], [data-page=payroll], [data-page=sales]) :is(.panel-h, .panel-b) { padding-inline: 14px; }
  body:is([data-page=summary], [data-page=expenses], [data-page=payroll]) .fin-debt .fin-list { margin-inline: -14px; }
  body:is([data-page=summary], [data-page=expenses]) .fin-debt .fin-row { padding-inline: 14px; }
  .fin-link-row, .fin-link-row.inset, .fin-more > summary { padding-inline: 14px; }
  body:is([data-page=summary], [data-page=expenses]) .btn.sm, .kday-foot .btn.sm { min-height: 44px; padding-inline: 12px; }
  .kdays-h .seg button { height: 44px; }
  .modal .modal-f .btn { min-height: 44px; }
  .modal input.inp { min-height: 44px; }
}
@media (max-width: 420px) {
  .mgr-t th, .mgr-t td { padding-inline: 4px; }
}
@media (max-width: 385px) {
  .mgr-t { font-size: 13.5px; }
  .mgr-t thead th { font-size: 12.5px; }
  .mgr-t th, .mgr-t td { padding-inline: 3px; }
}
@media (max-width: 370px) {
  .mgr-t { font-size: 13px; }
  .mgr-t th, .mgr-t td { padding-inline: 2.5px; }
  .mgr-t th:first-child, .mgr-t td:first-child { padding-left: 12px; }
  .mgr-t th:last-child, .mgr-t td:last-child { padding-right: 12px; }
}
@media (max-width: 359px) {
  .fin-bar { gap: 6px; }
  .exp-brands { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .exp-brand { flex-direction: row; justify-content: space-between; align-items: center; min-height: 44px; }
  .exp-brand b { font-size: 15px; }
  .fin-t { font-size: 13.5px; }
  .fin-t th, .fin-t td { padding-inline: 5px; }
  .fin-t th:first-child, .fin-t td:first-child { padding-left: 12px; }
  .fin-t th:last-child, .fin-t td:last-child { padding-right: 12px; }
  body:is([data-page=summary], [data-page=expenses], [data-page=payroll], [data-page=sales]) :is(.panel-h, .panel-b) { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { .fin-due-chev { transition: none; } }

/* ───── прогон crm-ux 10.11: телефон, первое дело и первая карточка на первом экране ─────
   Компьютер не меняется: всё новое ниже скрыто вне телефона или живёт внутри @media (max-width: 820px) */
.board-views, .c-urg, .c-step, .sub-m, .today-counts, .w-line { display: none; }
@media (max-width: 820px) {
  /* воронка: одна строка цифр, переключатель воронок ужат, один ряд видов, ряд этапов; поиск лупой в шапке */
  body[data-page="board"] .top .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub-m { display: inline; }
  .board-bar { gap: 8px; margin-bottom: 8px; }
  .board-bar .seg.pipes { padding: 2px; }
  .board-bar .pipes button { height: 28px; font-size: 13px; }
  .board-bar .filter { display: none; }
  .board-bar .filter.q-open { display: block; width: 100%; height: 40px; font-size: 16px; }
  .qfilter { display: none; }
  .board-views { display: flex; gap: 6px; overflow-x: auto; flex: 1 0 calc(100% + 32px); max-width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; order: 6; }
  .board-views::-webkit-scrollbar { display: none; }
  .board-views .chip { flex: none; height: 32px; padding: 0 12px; }
  .board-views .chip b { font-weight: 600; color: var(--muted); }
  .board-views .chip.on b { color: inherit; }
  .board-views .q-hot:not(.on) b { color: var(--red); }
  .board-views .q-warm:not(.on) b, .board-views .q-good:not(.on) b { color: var(--amber); }
  .board-views .q-cold:not(.on) b { color: var(--blue); }
  .stage-chips { margin-bottom: 10px; }
  .stage-chips .chip { height: 32px; }

  /* карточка в три строки: имя и срочность; заказ и сумма; шаг со сроком */
  .board .col-body { gap: 8px; }
  .board .card { padding: 10px 12px 11px; border-radius: 14px; }
  .board .c-top { align-items: center; gap: 8px; }
  .board .c-top .ava { width: 28px; height: 28px; font-size: 10.5px; }
  .board .c-who b { font-size: 15px; }
  .board .c-who .sub, .board .card > .c-msg, .board .card > .c-next, .board .card .c-foot { display: none; }
  .c-urg { display: flex; flex: none; max-width: 48%; min-width: 0; }
  .c-urg .tag { height: 22px; font-size: 12px; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .c-urg .tag svg { width: 12px; height: 12px; }
  .board .c-what { margin-top: 5px; font-size: 13.5px; -webkit-line-clamp: 1; line-clamp: 1; }
  .c-step { display: flex; align-items: center; gap: 8px; margin-top: 7px; min-width: 0; }
  .c-step .c-next { flex: 1; min-width: 0; margin: 0; padding: 6px 9px; align-items: center; gap: 6px; font-size: 13px; }
  .c-step .c-next svg { margin-top: 0; }
  .c-step .c-t { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }  /* на 320 действие переносится, а не обрезается (приёмка 10.11) */
  .c-step .c-when { flex: none; white-space: nowrap; color: var(--text-2); font-variant-numeric: lining-nums proportional-nums; }
  .c-step .c-when b { font-weight: 600; }
  .c-step .c-when b.red { color: var(--red); }
  .c-step .c-when b.blue { color: var(--blue); }
  .c-step .c-next.none { color: var(--muted); padding-block: 3px; }
  .c-step .c-next.none svg { color: var(--muted); }
  .c-step .add-step { height: 26px; padding: 0 9px; font-size: 12.5px; flex: none; }
  .c-step-who { flex: none; font-style: normal; font-size: 11.5px; color: var(--muted); max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 820px) {
  /* строка цифр воронки во всю ширину: лупа уходит в угол, к названию бренда */
  body[data-page="board"] .top > div:first-child { flex: 1 1 100%; }
  body[data-page="board"] .top .icon-btn.m-only { position: absolute; top: 8px; right: 10px; }
  /* заказ и сумма в одну строку: длинное название сокращается, сумма видна всегда */
  .board .c-what { display: flex; align-items: baseline; min-width: 0; }
  .board .c-wt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .board .c-dot, .board .c-what .money { flex: none; white-space: pre; }
}
@media (max-width: 360px) {
  body[data-page="board"] .top .sub { font-size: 12px; }
  .c-step-who { display: none; }
}
@media (max-width: 820px) {
  /* «Сегодня»: четыре плитки строкой счётчиков, первое дело на первом экране */
  body[data-page="today"] .kpis { display: none; }
  .today-counts { display: flex; gap: 6px; overflow-x: auto; margin: 2px -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
  .today-counts::-webkit-scrollbar { display: none; }
  .tc { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2);
    background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: lining-nums proportional-nums; }
  button.tc, a.tc { cursor: pointer; }
  .tc.bad { background: var(--red-bg); border-color: transparent; color: var(--red); font-weight: 600; }
  .tc.ok { color: var(--green); }
  .tc.zero { color: var(--muted); }
  .tc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  body[data-page="today"] :is(.group, .task) { scroll-margin-top: 140px; }
}
/* плитки «Последние 7 дней» и «Деньги»: вместо нуля и прочерка слово, тише цифры */
.h-tiles b.h-zero { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--text-2); letter-spacing: 0; padding: 3px 0 2px; }
@media (max-width: 820px) {
  /* «Главная» на телефоне: погода одной строкой, «Сегодня у вас» на первом экране */
  .home-hero { gap: 12px; margin-bottom: 14px; }
  .hh-hello { margin: 2px 0 6px; }
  .hh-sub { font-size: 14px; }
  .hh-pulse { margin-top: 10px; }
  .hh-weather { padding-top: 12px; gap: 0; }
  .hh-weather .w-now, .hh-weather .w-meta, .hh-weather .w-days { display: none; }
  .w-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); min-width: 0; }
  .w-line .w-ico { width: 26px; height: 26px; flex: none; }
  .w-line b { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -.02em; font-variant-numeric: lining-nums proportional-nums; }
  .w-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .w-line .w-tom { margin-left: auto; flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: lining-nums proportional-nums; }
}
/* путь заявки в сделке свёрнут до трёх последних событий */
.jr-more { margin: 6px 0 0 36px; }

/* вкладки раздела (меню 10.11): сегмент-контрол под шапкой, активная тёмная, на узком телефоне листаются вбок */
.sec-row { padding: 2px 32px 6px; min-width: 0; }
.sec-row[hidden] { display: none; }
.sec-tabs { position: relative; display: flex; gap: 4px; width: max-content; max-width: 100%; overflow-x: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.sec-tabs a:hover { background: var(--surface-2); color: var(--text); }
.sec-tabs a.on { background: var(--text); color: var(--bg); font-weight: 600; }
.sec-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 820px) {
  .sec-row { padding: 0 16px 6px; }
  .sec-tabs a { height: 38px; padding: 0 13px; font-size: 14px; }
}
/* «Записи сегодня» и «Ближайшая запись» */
.group-h .group-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.group-h .group-link:hover { color: var(--text); }
.group-h .group-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.next-appt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; margin: 0 0 16px; padding: 11px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; font-size: 14px; color: var(--text); text-align: left; }
.next-appt:hover { border-color: var(--line-2); }
.next-appt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.next-appt .lbl { color: var(--muted); }
.next-appt .tag { margin-right: 2px; }

/* ─────────── «Вернуть сегодня» (11.11): замолчавшие клиентки, готовый текст и отправка одной кнопкой ─────────── */
.rv-card { display: grid; grid-template-columns: minmax(190px, 280px) minmax(0, 1fr); gap: 6px 24px; padding: 16px 18px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.group-b > .rv-card:first-child { border-top: 0; }
.rv-card:focus { outline: none; }
.rv-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rv-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.rv-head .dot-n { margin-right: 0; }
.rv-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.rv-said { color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-k { color: var(--muted); }
.rv-meta { color: var(--muted); font-size: 13px; font-variant-numeric: lining-nums proportional-nums; }
.rv-work { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
/* поле с подсветкой: под прозрачным textarea лежит копия текста, где «[…]» подсвечено; высота растёт по тексту без скрипта */
.rv-field { display: grid; position: relative; }
.rv-back, .rv-text { grid-area: 1 / 1; margin: 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px;
  font: 15px/1.5 var(--font); letter-spacing: normal; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 4; }
.rv-back { color: transparent; background: var(--surface-2); pointer-events: none; }
.rv-back mark { color: transparent; background: color-mix(in srgb, var(--amber) 24%, var(--surface)); border-radius: 4px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 24%, var(--surface)), inset 0 -2px 0 var(--amber); }
.rv-text { width: 100%; min-height: 66px; background: transparent; border-color: var(--line-2); color: var(--text); resize: none; overflow: hidden; outline: none; transition: border-color .15s; }
.rv-text:hover { border-color: var(--muted); }
.rv-text:focus-visible, .rv-text:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.rv-hint { color: var(--amber); font-size: 13px; font-weight: 500; }
.rv-hint:empty { display: none; }
.rv-ig { display: flex; align-items: flex-start; gap: 6px; color: var(--text-2); font-size: 13px; }
.rv-ig svg { margin-top: 2px; color: var(--muted); }
.rv-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-acts .btn { justify-content: center; }
.rv-acts .rv-off { margin-left: auto; color: var(--muted); border-color: transparent; background: transparent; }
.rv-acts .rv-off:hover { color: var(--text); background: var(--surface-2); }
.rv-acts .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-acts .btn[aria-busy="true"] { cursor: progress; }
.rv-stat > span { flex: 1; min-width: 0; color: var(--text-2); }
.rv-stat > svg { align-self: flex-start; margin-top: 2px; }
.rv-stat .link { margin-left: auto; white-space: nowrap; }
@media (max-width: 820px) {
  /* телефон: всё в одну колонку, поле во всю ширину, кнопки 44 px: главная отдельной строкой, три остальные поровну */
  .rv-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .rv-back, .rv-text { font-size: 16px; }  /* 16 px: iPhone не увеличивает страницу при вводе */
  .rv-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rv-acts .btn { height: 44px; padding: 0 6px; font-size: 14px; white-space: normal; line-height: 1.15; text-align: center; }
  .rv-acts .rv-main { grid-column: 1 / -1; font-size: 15px; }
  .rv-acts .rv-off { margin-left: 0; border-color: var(--line-2); background: var(--surface); color: var(--text-2); }
  .rv-stat .link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .rv-text { transition: none; } }

/* ─────────── «Закрытие дня» (16.11, макет Б): одна клиентка на экран, вопрос и шесть ответов без прокрутки ─────────── */
.zd { max-width: 560px; margin: 0 auto; padding: 4px 0 24px; }
.zd button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.zd [data-calm]:disabled { opacity: 1; cursor: default; }
.zd-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.zd-prog { display: grid; gap: 4px; }
.zd-prog i { height: 4px; border-radius: 4px; background: var(--line-2); }
.zd-prog i.d { background: var(--text); }
.zd-prog i.c { background: var(--accent); }
.zd-prog.bar { display: block; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.zd-prog.bar i { display: block; height: 100%; background: var(--text); border-radius: 4px; }
.zd-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: -6px 0 -8px; color: var(--muted); font-size: 13.5px; font-variant-numeric: lining-nums proportional-nums; min-width: 0; }
.zd-line > span { min-width: 0; }
.zd-link { flex: none; min-height: 44px; min-width: 44px; padding: 0 2px 0 10px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.zd-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.zd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.zd-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.zd-who .ava { width: 52px; height: 52px; font-size: 16px; }
.zd-who-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zd-who-t b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }  /* длинное двойное имя: две строки и многоточие, полное имя в заявке */
.zd-who-t span { color: var(--muted); font-size: 13px; font-variant-numeric: lining-nums proportional-nums; }
.zd-open { flex: none; width: 44px; height: 44px; align-self: flex-start; margin: -4px -6px 0 0; }
.zd-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.zd-sum { margin: 0; font-size: 15px; line-height: 1.42; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.zd-recent { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.zd-recent li { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zd-dir { color: var(--muted); font-weight: 500; }
.zd-quote, .zd-said { margin: 0; background: var(--surface-2); border-radius: 12px; padding: 8px 12px 9px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.zd-qt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }  /* обрезка по целой строке: зажим на самой плашке показывал половину следующей строки в отступе */
.zd-quote i, .zd-said i { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; margin-bottom: 1px; }
.zd-said { background: var(--amber-bg); color: var(--text); }
.zd-said i { color: var(--amber); font-weight: 600; }
.zd-q { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 18px 0 10px; }
.zd-q:focus { outline: none; }
.zd-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.zd-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.zd-opt { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; transition: transform .12s ease-out, background-color .12s, border-color .12s; }
.zd-opt.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.zd-opt:active { transform: scale(.98); }
.zd-opt:focus-visible, .zd .chip:focus-visible, .zd-voice-btn:focus-visible, .zd-next:focus-visible, .zd-mic:focus-visible, .zd-rec-stop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .zd-opt:not(.on):hover { border-color: var(--muted); } }
.zd-voice { margin-top: 12px; }
.zd-voice:empty { display: none; }
.zd-voice-btn { width: 100%; height: 48px; justify-content: center; border-radius: 14px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.zd-rec { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text); }
.zd-rec.wait { padding-right: 14px; color: var(--text-2); }
.zd-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: zd-pulse 1.2s ease-in-out infinite; }
.zd-rec-l { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; }
.zd-rec-l time { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.zd-rec-stop { height: 44px; border-radius: 12px; font-weight: 600; }
@keyframes zd-pulse { 50% { opacity: .35; } }
.zd-vmsg { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.zd-vmsg:empty { display: none; }
.zd-fail { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-size: 14px; font-weight: 500; }
.zd-fail > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.zd-fail .btn { height: 40px; border-radius: 10px; color: var(--text); }
/* второй экран */
.zd-body { display: flex; flex-direction: column; }
.zd-body > .zd-q:first-child { margin-top: 8px; }
.zd-chips { gap: 8px; }
.zd .chip { height: 40px; padding: 0 15px; font-size: 14.5px; }
.zd-sub { margin: 14px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.zd-lbl { display: flex; align-items: center; gap: 6px; margin: 18px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.zd-lbl svg { color: var(--accent); }
.zd-ta { font-size: 16px; line-height: 1.45; min-height: 0; resize: none; border-radius: 12px; padding: 10px 12px; }
.zd-inp { height: 48px; font-size: 18px; font-weight: 600; border-radius: 12px; font-variant-numeric: lining-nums proportional-nums; }
.zd-ta:focus, .zd-inp:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.zd-hint { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.zd-hint svg { margin-top: 1px; color: var(--accent); }
.zd-draft { display: flex; flex-direction: column; }
.zd-note { margin: 0; font-size: 15px; color: var(--text-2); }
.zd-com { position: relative; }
.zd-com .zd-ta { padding-right: 52px; }
.zd-mic { position: absolute; right: 3px; bottom: 3px; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); }
.zd-body .zd-voice { margin-top: 8px; }
.zd-foot { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 14px); }
@media (max-width: 360px) { .zd-sum { -webkit-line-clamp: 3; } }
.zd-next { width: 100%; height: 54px; justify-content: center; border-radius: 16px; font-size: 16px; font-weight: 600; white-space: normal; text-align: center; line-height: 1.2; }
/* финал и пустая очередь */
.zd-end { text-align: center; display: flex; flex-direction: column; align-items: center; }
.zd-end .zd-head { width: 100%; margin-bottom: 28px; }
.zd-end-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-top: 28px; }
.zd-end .zd-head + .zd-end-ic, .zd-end .zd-fail + .zd-end-ic { margin-top: 0; }
.zd-end-ic.ok { background: var(--green-bg); color: var(--green); }
.zd-end-ic svg { width: 26px; height: 26px; }
.zd-end .zd-q { font-size: 22px; margin: 14px 0 6px; }
.zd-end-t { margin: 0 0 20px; font-size: 15.5px; color: var(--text-2); max-width: 34ch; }
.zd-end .btn { width: 100%; max-width: 340px; height: 48px; justify-content: center; border-radius: 14px; font-size: 15px; font-weight: 600; margin-top: 8px; }
.zd-end .zd-fail { width: 100%; text-align: left; }
/* тост с «Отменить»: тёмный, над нижней панелью, несколько секунд */
.zd-toast { position: fixed; z-index: 70; left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); bottom: 24px; transform: translate(-50%, 16px); width: min(520px, calc(100vw - var(--side-w) - 32px));
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 14px; min-height: 52px; border-radius: 14px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500; line-height: 1.3; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .18s ease-out, transform .18s ease-out; }
.zd-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.zd-toast > span { flex: 1; min-width: 0; }
.zd-toast button { flex: none; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.zd-toast button:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* плитка в «Сегодня» */
.zd-tile { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 10px 12px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--text); box-shadow: var(--shadow); min-width: 0; }
.zd-tile-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.zd-tile.calm .zd-tile-ic { background: var(--surface-3); color: var(--muted); }
.zd-tile-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.zd-tile-t b { font-size: 15px; font-weight: 600; }
.zd-tile-t span { font-size: 13.5px; color: var(--text-2); font-variant-numeric: lining-nums proportional-nums; }
.zd-tile.calm .zd-tile-t span { color: var(--muted); }
.zd-tile > svg { color: var(--muted); }
.zd-tile-go { flex: none; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; }
.zd-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .zd-tile:hover { border-color: var(--line-2); } }
/* заметка команды в ленте переписки (вариант В): жёлтая плашка, клиентке не уходит */
.msg-note { align-self: stretch; margin: 6px 0; padding: 8px 12px 9px; border-radius: 12px; background: var(--amber-bg); color: var(--text); overflow-wrap: anywhere; }
.msg-note .mn-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--amber); margin-bottom: 2px; }
.msg-note .mn-t { font-size: 14px; line-height: 1.42; white-space: pre-wrap; }
@media (max-width: 820px) {
  body[data-page="close"] .top { display: none; }
  .zd { padding-top: calc(10px + env(safe-area-inset-top)); }
  .zd-foot { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .zd-toast { left: 50%; width: calc(100vw - 24px); bottom: calc(70px + env(safe-area-inset-bottom)); }
  .zd .chip { height: 44px; }
  body.zd-has[data-page="today"] .top .sub { display: none; }  /* плитка «Закрытие дня» встаёт вместо строки-подсказки: первое дело остаётся на первом экране */
}
@media (max-width: 379px) { .tabbar .tb-more { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .zd-rec-dot { animation: none; }
  .zd-opt, .zd-toast { transition: none; }
}
