/* WOW PADEL CRM. Палитра — как в приложении WOW PADEL: графит, белый текст, лайм для ключевых действий.
   Боковая панель и шапка на телефоне всегда тёмные (как шапка с логотипом в приложении). */
:root {
  --bg: #0b0d0c; --surface: #131715; --surface-2: #1b201d; --surface-3: #252b27;
  --ink: #f3f5f1; --muted: #949c96; --line: #242a26;
  --lime: #a6f01e; --on-lime: #0b0c0b; --accent-ink: #a6f01e; --lime-rgb: 166, 240, 30;
  --ok: #4cd08a; --warn: #e3a33a; --bad: #ff6b5e;
  --side: #060707; --side-ink: #f3f5f1; --side-muted: #8b938d; --side-line: #1c211e;
  --st-new: #949c96; --st-contacted: #6ea8ff; --st-negotiating: #e3a33a; --st-agreed: #a6f01e;
  --st-published: #4cd08a; --st-declined: #ff6b5e; --st-unfit: #6b736d;
  --st-partner: #3ad6c8; --st-later: #b59cff;
  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px; --r-s: 12px;
  --shadow: 0 0 0 1px var(--line);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f4f1; --surface: #ffffff; --surface-2: #eef1ec; --surface-3: #e1e6df;
  --ink: #121614; --muted: #5b645d; --line: #dce2da; --accent-ink: #4a7a00;
  --ok: #17924f; --warn: #b26b00; --bad: #d8402f;
  --st-new: #6f7871; --st-contacted: #2563d8; --st-negotiating: #b26b00; --st-agreed: #4a7a00;
  --st-published: #17924f; --st-declined: #d8402f; --st-unfit: #8a938c;
  --st-partner: #0d8a80; --st-later: #6c4ad6;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px var(--line);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f4f1; --surface: #ffffff; --surface-2: #eef1ec; --surface-3: #e1e6df;
    --ink: #121614; --muted: #5b645d; --line: #dce2da; --accent-ink: #4a7a00;
    --ok: #17924f; --warn: #b26b00; --bad: #d8402f;
    --st-new: #6f7871; --st-contacted: #2563d8; --st-negotiating: #b26b00; --st-agreed: #4a7a00;
    --st-published: #17924f; --st-declined: #d8402f; --st-unfit: #8a938c;
  --st-partner: #0d8a80; --st-later: #6c4ad6;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px var(--line);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
h1 { font: 700 26px/1.15 var(--f-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h2 .ic { width: 18px; height: 18px; color: var(--muted); }
p { margin: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-s); border: 1px solid transparent; font: 600 14px/1 var(--f-body); cursor: pointer;
  background: var(--surface-2); color: var(--ink); white-space: nowrap; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.lime { background: var(--lime); color: var(--on-lime); }
.btn.lime:hover { background: #b8ff36; }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.icon-only { width: 40px; padding: 0; }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--muted); font: 500 13px var(--f-body);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link-btn:hover { color: var(--ink); }
.link-btn.bad:hover { color: var(--bad); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

input, select, textarea { font: 15px var(--f-body); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; width: 100%; min-height: 42px; }
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(var(--lime-rgb), .18); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"] { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type="date"] { flex: 1 1 150px; width: auto; }

.seg { display: inline-flex; border: 0; padding: 4px; margin: 0 0 16px; gap: 4px; background: var(--surface-2);
  border-radius: 14px; max-width: 100%; overflow-x: auto; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted);
  cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--lime); }

/* ---------- каркас ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--side-line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand img { display: block; height: 22px; width: auto; }
/* Логотип — исходный файл на чёрном фоне; «lighten» растворяет чёрный фон в тёмной подложке, сам знак не меняется */
.brand img, .login-logo { mix-blend-mode: lighten; }
.brand span { font: 700 11px var(--f-display); letter-spacing: .08em; color: var(--on-lime); background: var(--lime);
  padding: 3px 6px; border-radius: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--side-muted);
  font-weight: 600; }
.nav a:hover { background: #121614; color: var(--side-ink); }
.nav a.on { background: rgba(var(--lime-rgb), .12); color: var(--lime); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; }
.me:hover { background: #121614; }
.me b { display: block; font-size: 14px; }
.me small { color: var(--side-muted); font-size: 12px; }
.ava { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--lime); color: var(--on-lime); font: 700 13px var(--f-display); }
.ava.small { width: 26px; height: 26px; font-size: 10px; }
.ava.big { width: 56px; height: 56px; font-size: 18px; }
.main { margin-left: 240px; padding: 28px 36px 48px; max-width: 1320px; }
.mtop, .tabbar, .mobile-only { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sub { color: var(--muted); margin-top: 6px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.back .ic { width: 16px; height: 16px; }
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }

.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-s); font-weight: 500;
  background: rgba(var(--lime-rgb), .12); color: var(--ink); border: 1px solid rgba(var(--lime-rgb), .35); transition: opacity .4s; }
.flash .ic { color: var(--accent-ink); }
.flash.error { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.flash.error .ic { color: var(--bad); }
.flash.hide { opacity: 0; }

/* ---------- этапы: цвета ---------- */
.st-new { --st: var(--st-new); } .st-contacted { --st: var(--st-contacted); } .st-negotiating { --st: var(--st-negotiating); }
.st-agreed { --st: var(--st-agreed); } .st-published { --st: var(--st-published); } .st-declined { --st: var(--st-declined); }
.st-unfit { --st: var(--st-unfit); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--ink); }
.pill i, .chip i, .stage-select i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); flex: none; }

/* ---------- база контактов ---------- */
.filters { display: grid; gap: 10px; margin-bottom: 12px; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 44px; min-height: 48px; font-size: 16px; background: var(--surface); border-radius: 14px; }
.filter-row, .toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row select { width: auto; min-width: 150px; background-color: var(--surface); }
.toggles { margin-bottom: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.toggle .ic { width: 15px; height: 15px; }
.toggle:hover { color: var(--ink); }
.toggle.on { background: rgba(var(--lime-rgb), .14); color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(var(--lime-rgb), .45); }

.pipeline { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.pipeline::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); flex: none;
  border-top: 3px solid var(--st, var(--line)); }
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--ink); }
.chip.on { background: color-mix(in srgb, var(--st, var(--lime)) 16%, var(--surface)); color: var(--ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st, var(--lime)) 60%, transparent); }
.count { color: var(--muted); font-size: 13px; margin: 4px 2px 10px; }

.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.list-head, .row { display: grid; grid-template-columns: minmax(220px, 2.3fr) 178px 150px minmax(110px, 1fr) 96px minmax(130px, 1fr);
  gap: 14px; align-items: center; padding: 0 18px; }
.list-head { min-height: 42px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); }
.row { min-height: 64px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; border-radius: 0 0 var(--r) var(--r); }
.row:hover { background: var(--surface-2); }
.row.need { box-shadow: inset 3px 0 0 var(--warn); }
.r-name { min-width: 0; }
.r-name a { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-name a:hover { color: var(--accent-ink); }
.r-name small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need-tag { font-style: normal; color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.need-tag .ic { width: 13px; height: 13px; }
.kind { font-weight: 600; }
.k-club { color: var(--st-contacted); } .k-organizer { color: var(--st-negotiating); } .k-community { color: var(--muted); }
.r-city, .r-members, .r-resp { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.r-members { font-variant-numeric: tabular-nums; color: var(--muted); }
.r-members .ic { width: 15px; height: 15px; }
.r-resp span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-select { position: relative; display: inline-flex; align-items: center; border-radius: 999px; max-width: 100%;
  background: color-mix(in srgb, var(--st) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 35%, transparent); }
.stage-select i { position: absolute; left: 12px; pointer-events: none; }
.stage-select select { background-color: transparent; border: 0; min-height: 34px; padding: 6px 30px 6px 28px; font-size: 13px;
  font-weight: 600; border-radius: 999px; width: auto; max-width: 100%; }
.stage-select select:focus { box-shadow: 0 0 0 2px var(--st); }
.date { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.date .ic { width: 15px; height: 15px; }
.date.overdue { color: var(--bad); } .date.today { color: var(--warn); } .date.later { color: var(--ink); }
.date.big { font: 700 22px var(--f-display); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  display: grid; justify-items: center; gap: 8px; }
.empty > .ic { width: 36px; height: 36px; color: var(--muted); }
.empty .btn { margin-top: 8px; }

/* ---------- карточка ---------- */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.title-wrap { min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.meta > * { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 15px; height: 15px; }
.meta a:hover { color: var(--accent-ink); }
.src { color: var(--muted); } .src.warn { color: var(--warn); }

.stepper-form { margin-bottom: 16px; }
.stepper { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1 0 128px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 0;
  padding: 0 18px 0 24px; margin-left: -8px; background: var(--surface-2); color: var(--muted); font: 600 14px var(--f-body);
  cursor: pointer; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); }
.step:first-child { margin-left: 0; padding-left: 16px; border-radius: 12px 0 0 12px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.step:last-child { border-radius: 0 12px 12px 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); }
.step .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px;
  background: var(--surface-3); color: var(--ink); flex: none; }
.step .n .ic { width: 13px; height: 13px; }
.step:hover { background: var(--surface-3); color: var(--ink); }
.step.done { background: color-mix(in srgb, var(--lime) 16%, var(--surface-2)); color: var(--ink); }
.step.done .n { background: var(--lime); color: var(--on-lime); }
.step.cur { background: var(--lime); color: var(--on-lime); }
.step.cur .n { background: var(--on-lime); color: var(--lime); }
.stepper.closed .step { opacity: .45; }
.close-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }

.alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r);
  background: color-mix(in srgb, var(--warn) 13%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.alert > .ic { color: var(--warn); width: 22px; height: 22px; }
.alert > div { flex: 1; min-width: 0; }
.alert p { color: var(--muted); font-size: 14px; }

.card-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-areas: "next feed" "details feed"; grid-template-rows: auto 1fr; gap: 0 16px; align-items: start; }
.next-panel { grid-area: next; } .details-panel { grid-area: details; } .feed-panel { grid-area: feed; }
.mt { margin-top: 20px; }
.next-panel h2 + form, .next-panel h2 + form select { margin-top: 12px; }
.next-now { margin: 12px 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 7px 12px;
  font: 600 13px var(--f-body); cursor: pointer; }
.chip-btn:hover { border-color: var(--lime); }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 12px 0 0; }
.facts dt { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); }
.facts dd a .ic { width: 15px; height: 15px; }
.desc { margin-top: 14px; }
.desc summary { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.desc p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.composer { display: grid; gap: 10px; margin-bottom: 20px; }
.composer button { justify-self: end; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.add-pl { margin-left: auto; }
.add-pl[open] { flex-basis: 100%; margin-left: 0; }
.add-pl[open] > summary { display: none; }
.pl-cancel { justify-self: start; }
.pl-form { display: grid; gap: 12px; padding: 14px; margin: 4px 0 12px; border-radius: var(--r-s); background: var(--surface-2); }
.pl-form input, .pl-form select, .pl-form textarea { background-color: var(--surface); }
.pl-form .btn { justify-self: start; }
.placements { margin-bottom: 22px; }
.pl { border-radius: var(--r-s); padding: 12px 14px; margin-bottom: 8px; background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--st-contacted); }
.pl-discussing { box-shadow: inset 3px 0 0 var(--st-negotiating); } .pl-agreed { box-shadow: inset 3px 0 0 var(--st-agreed); }
.pl-published { box-shadow: inset 3px 0 0 var(--st-published); } .pl-declined { box-shadow: inset 3px 0 0 var(--st-unfit); opacity: .75; }
.pl .free { color: var(--accent-ink); font-size: 13px; } .pl .paid { color: var(--warn); font-size: 13px; }
.pl-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.pl-status { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pl-links { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.pl-links a { display: inline-flex; gap: 4px; align-items: center; color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.pl-links .ic { width: 14px; height: 14px; }
.pl details > summary { margin-top: 6px; }

.history h2 { margin-bottom: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.ev { display: flex; gap: 12px; padding: 6px 0; position: relative; }
.ev-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; z-index: 1;
  background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 4px var(--surface); }
.ev-ic .ic { width: 15px; height: 15px; }
.ev-note .ev-ic { background: rgba(var(--lime-rgb), .16); color: var(--accent-ink); }
.ev-stage .ev-ic { background: color-mix(in srgb, var(--st-contacted) 18%, transparent); color: var(--st-contacted); }
.ev-handoff .ev-ic, .ev-ic.ai { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.ev-placement .ev-ic { background: color-mix(in srgb, var(--st-published) 18%, transparent); color: var(--st-published); }
.ev-body { min-width: 0; padding-top: 5px; }
.ev-meta { font-size: 12.5px; color: var(--muted); }
.ev-meta b { color: var(--ink); font-weight: 600; }
.ev-text { overflow-wrap: anywhere; white-space: pre-line; }
.ev-text.note { background: var(--surface-2); padding: 10px 12px; border-radius: 4px 12px 12px 12px; margin-top: 4px; }

/* ---------- формы, пользователи, профиль ---------- */
.form { max-width: 760px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form > .muted { margin-top: 12px; }
.users { list-style: none; margin: 0; padding: 0; }
.users li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.users li:last-child { border-bottom: 0; }
.users li.off { opacity: .55; }
.u-main { flex: 1; min-width: 160px; display: grid; }
.u-main small { color: var(--muted); font-size: 13px; }
.u-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.pw form { margin-top: 8px; }
.pw input { width: 200px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile b { display: block; font-size: 17px; }
.profile small { color: var(--muted); }
.link-row { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.link-row .go { margin-left: auto; color: var(--muted); font-size: 22px; line-height: 1; }
.link-row:hover { background: var(--surface-2); }
.panel > h2 { margin-bottom: 14px; }
.panel .form { max-width: none; }

/* ---------- вход и ошибки ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(800px 420px at 50% -10%, rgba(var(--lime-rgb), .14), transparent 70%), var(--side); color-scheme: dark;
  --bg: #0b0d0c; --surface: #131715; --surface-2: #1b201d; --ink: #f3f5f1; --muted: #949c96; --line: #242a26; color: var(--ink); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; padding: 32px 26px; border-radius: 22px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0,0,0,.5); }
.login-logo { width: 210px; height: auto; justify-self: center; margin-bottom: 2px; }
.login-sub { text-align: center; color: var(--muted); margin-top: -8px; }
.hint { color: var(--muted); font-size: 12.5px; text-align: center; }
.err-title { text-align: center; font-size: 22px; }


/* ---------- мобильная раскладка: элементы, скрытые на компьютере ---------- */
.h-count { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font: 600 14px/1.3 var(--f-body); letter-spacing: 0; }
.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row .search { flex: 1; min-width: 0; }
.stage-static, .filters-btn, .quick-f, .fp-label, .mobile-inline, .mobile-block, .stage-pick, .m-resp { display: none; }
.fpanel { display: grid; gap: 10px; margin-bottom: 4px; }
.fpanel .toggles { margin-bottom: 0; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--lime); color: var(--on-lime); font: 700 12px var(--f-body); }
.badge[hidden] { display: none; }
.details-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.details-panel > summary h2 { margin: 0; }
.d-chev { color: var(--muted); transition: transform .2s; }
.details-panel[open] > summary .d-chev { transform: rotate(180deg); }
.details-panel[open] > summary { margin-bottom: 2px; }

/* ---------- телефон ---------- */
@media (max-width: 959px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 16px calc(96px + var(--safe-b)); }
  .mtop { display: flex; position: sticky; top: 0; z-index: 15; align-items: center; justify-content: space-between;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--side); border-bottom: 1px solid var(--side-line); }
  .mtop .brand { padding: 0; }
  .mtop .brand img { height: 18px; }
  .mtop .btn.ghost { background: #121614; border-color: #242a26; color: #f3f5f1; }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--side); border-top: 1px solid var(--side-line); padding: 6px 6px calc(6px + var(--safe-b)); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--side-muted); font-size: 11px; font-weight: 600; border-radius: 12px; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--lime); }
  .mobile-only { display: block; margin-top: 8px; }
  .hide-m { display: none !important; }
  h1 { font-size: 22px; }
  .page-head { align-items: center; margin-bottom: 12px; }
  .page-head .sub { font-size: 14px; }
  .list-page .page-head .sub { display: none; }
  .head-actions .btn span { display: none; }
  .head-actions .btn { width: 44px; padding: 0; }
  /* iOS увеличивает страницу, если шрифт поля меньше 16px */
  input, select, textarea, .stage-select select { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .filter-row select { flex: 1 1 140px; min-width: 0; }
  .toggles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px 2px; }
  .toggles::-webkit-scrollbar { display: none; }
  .toggle { flex: none; }
  .pipeline { margin: 0 -16px 4px; padding: 2px 16px 8px; }

  .list { background: none; box-shadow: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .list-head { display: none; }
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px; min-height: 0;
    background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border-bottom: 0; }
  .row:last-child { border-radius: var(--r); }
  .row.need { box-shadow: var(--shadow), inset 3px 0 0 var(--warn); }
  .r-name { flex: 1 0 100%; }
  .r-name a { white-space: normal; font-size: 16px; }
  .r-name small { white-space: normal; }
  .row { min-width: 0; }
  .r-city:has(.muted), .r-members:has(.muted), .r-next:has(.muted) { display: none; }
  .r-city, .r-members { font-size: 13px; color: var(--muted); }
  .r-resp { margin-left: auto; }

  .card-head h1 { font-size: 21px; }
  .stepper { margin: 0 -16px; padding: 0 16px 2px; }
  .step { flex: 1 0 auto; min-height: 46px; font-size: 13px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "next" "details" "feed"; }
  .panel { padding: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .composer button { justify-self: stretch; }
  .alert { flex-wrap: wrap; }
  .alert form { width: 100%; }
  .alert .btn { width: 100%; }
  .pw input { width: 100%; flex: 1 1 160px; }

  /* Список: заголовок с числом, поиск + «Фильтры», три быстрых фильтра, сразу контакты */
  .list-page .page-head { margin-bottom: 10px; }
  .h-count { font-size: 13px; padding: 2px 9px; }
  .filters { margin-bottom: 8px; gap: 0; }
  .filters-btn { display: inline-flex; min-height: 48px; padding: 0 14px; border-radius: 14px; gap: 6px; }
  .filters-btn[aria-expanded="true"] { border-color: var(--lime); color: var(--accent-ink); }
  .js .fpanel:not(.open) { display: none; }
  .fpanel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; gap: 12px; }
  .fpanel .filter-row select { background-color: var(--surface-2); }
  .fpanel .toggles { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .fpanel .toggle { background: var(--surface-2); }
  .fpanel .pipeline { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .fpanel .chip { background: var(--surface-2); padding: 7px 10px; }
  .fp-label { display: block; margin: 2px 0 -4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .mobile-inline { display: inline-flex; }
  .reset { justify-self: start; }
  .quick-f { display: flex; gap: 6px; margin-bottom: 10px; }
  .quick-f a { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; color: var(--muted); }
  .quick-f a.on { background: var(--lime); color: var(--on-lime); box-shadow: none; }
  .list-page .count { display: none; }
  .row { padding: 12px 14px; gap: 8px 10px; }
  .r-name small .kind, .r-name small .s-user { display: none; }
  .r-name small:not(:has(.need-tag)) { display: none; }
  .r-name small { margin-top: 2px; }
  .r-members, .r-resp { display: none; }
  .r-city { gap: 4px; }
  .r-city .ic { width: 14px; height: 14px; }
  .stage-form { display: none; }
  .stage-static { display: inline-flex; font-size: 13px; padding: 4px 10px; }
  .row { gap: 6px 12px; }
  .r-next .date { font-size: 13px; }

  /* Карточка: этап одной плашкой, ответственный рядом, затем заметка → дата → договорённости → история → данные */
  .card-head { margin-bottom: 12px; }
  .meta { margin-top: 8px; gap: 6px 14px; }
  .tg-link { color: var(--accent-ink); font-weight: 600; }
  .stepper, .close-row { display: none; }
  .stepper-form { margin-bottom: 10px; }
  .stage-pick { display: block; }
  .sp-now { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; min-height: 56px;
    background: color-mix(in srgb, var(--st) 16%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st) 55%, transparent); }
  .sp-now i { width: 11px; height: 11px; border-radius: 50%; background: var(--st); flex: none; }
  .sp-now b { font-size: 18px; }
  .sp-cap { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .sp-chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
  .stage-pick[open] .sp-chev { transform: rotate(180deg); }
  .sp-menu { margin-top: 8px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: grid; }
  .sp-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px;
    background: none; color: var(--ink); font: 600 16px var(--f-body); text-align: left; cursor: pointer; }
  .sp-item i { width: 10px; height: 10px; border-radius: 50%; background: var(--st); flex: none; }
  .sp-item.cur { background: var(--surface-2); }
  .sp-check { margin-left: auto; color: var(--accent-ink); }
  .sp-sep { margin: 6px 12px 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .m-resp { display: block; margin-bottom: 12px; }
  .m-resp label { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px;
    background: var(--surface); box-shadow: var(--shadow); color: var(--muted); font-size: 14px; font-weight: 600; }
  .m-resp select { flex: 1; min-width: 0; width: auto; min-height: 40px; background-color: var(--surface-2); color: var(--ink); font-weight: 600; }
  .card-grid { display: flex; flex-direction: column; align-items: stretch; }
  .feed-panel { display: contents; }
  .composer, .placements, .history { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
  .composer { order: 1; gap: 8px; }
  .next-panel { order: 2; }
  .placements { order: 3; }
  .history { order: 4; }
  .details-panel { order: 5; }
  .resp-block { display: none; }
  .next-now { margin: 8px 0 10px; }
}
@media (max-width: 380px) {
  .step .l { font-size: 12px; }
  .seg span { padding: 9px 10px; font-size: 13px; }
}
#results.loading { opacity: .55; transition: opacity .2s; }

/* ================= Панель ================= */
.seg-links { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.seg-links a { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-links a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--st, var(--lime)); }
.tile:hover { background: var(--surface-2); }
.t-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.t-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.t-label em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.t-num { font: 700 30px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-sub { font-size: 12.5px; color: var(--muted); }
.block { margin-top: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2 { font-size: 17px; }
.tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.task { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.task header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.task h3 { margin: 0; font-size: 15px; }
.t-count { min-width: 28px; padding: 3px 9px; border-radius: 999px; text-align: center; font-size: 13px;
  background: rgba(var(--lime-rgb), .16); color: var(--accent-ink); }
.t-overdue .t-count { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.t-human .t-count { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist a { display: grid; gap: 5px; padding: 11px 0; border-top: 1px solid var(--line); }
.tlist li:first-child a { border-top: 0; }
.tlist a:hover b { color: var(--accent-ink); }
.tlist b { font-size: 14.5px; overflow-wrap: anywhere; }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.tl-meta .pill { font-size: 12px; padding: 3px 9px; }
.tl-reason { font-size: 13px; color: var(--warn); }
.t-empty { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; color: var(--muted); font-size: 14px; }
.t-empty .ic { color: var(--accent-ink); }
.t-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.t-more .ic, .col-more .ic { width: 15px; height: 15px; }
.money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-card { display: grid; gap: 6px; padding: 18px; border-radius: var(--r); background: var(--surface); }
.m-plan { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-negotiating) 60%, transparent); border: 0; outline: 1px dashed color-mix(in srgb, var(--st-negotiating) 70%, transparent); outline-offset: -6px; }
.m-plan .t-label em { background: color-mix(in srgb, var(--st-negotiating) 18%, transparent); color: var(--st-negotiating); }
.m-fact { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-published) 60%, transparent); }
.m-fact .t-label em { background: color-mix(in srgb, var(--st-published) 18%, transparent); color: var(--st-published); }
.m-card .t-num { font-size: 32px; }
.warn-t { color: var(--warn); font-weight: 600; }
.m-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.sub-h { margin: 20px 0 8px; font-size: 14px; }
.upcoming { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.upcoming a { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px;
  border-top: 1px solid var(--line); }
.upcoming li:first-child a { border-top: 0; }
.upcoming a:hover { background: var(--surface-2); }
.u-date { font-weight: 700; font-size: 13.5px; }
.u-date.overdue { color: var(--bad); } .u-date.today { color: var(--warn); }
.u-main { display: grid; min-width: 0; }
.u-main b, .u-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-main small { color: var(--muted); }
.u-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ================= Воронка ================= */
.f-tabs { display: none; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 12px; align-items: start;
  overflow-x: auto; padding-bottom: 8px; }
.col { border-radius: var(--r); padding: 10px; background: color-mix(in srgb, var(--surface) 55%, var(--bg)); box-shadow: var(--shadow); }
.col-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 6px 10px; margin-bottom: 10px; border-bottom: 3px solid var(--st); }
.col-head h2 { font-size: 14px; gap: 7px; }
.col-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.col-count { color: var(--muted); font-size: 13px; }
.col-sum { margin-left: auto; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.col-sum em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.col-body { display: grid; gap: 8px; }
.fcard { background: var(--surface); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; min-width: 0; }
.fcard:hover { box-shadow: 0 0 0 1px rgba(var(--lime-rgb), .55); }
.fcard.need { box-shadow: var(--shadow), inset 3px 0 0 var(--warn); }
.fc-name { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.fc-name:hover { color: var(--accent-ink); }
.fc-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.fcard .need-tag { margin-top: 4px; font-size: 12.5px; }
.fc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; min-height: 26px; }
.fc-stage { margin-top: 10px; }
.fc-stage .stage-select select { font-size: 12.5px; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.col-empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; }
.col-more { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px 2px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.closed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.closed-row a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }

@media (max-width: 1279px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 959px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 14px; }
  .t-num { font-size: 26px; }
  .tasks, .money { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .block { margin-top: 20px; }
  .upcoming a { grid-template-columns: 70px minmax(0, 1fr) auto; padding: 12px 14px; gap: 10px; }
  .funnel-page .page-head .sub { display: none; }
  .f-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px 6px; }
  .f-tabs::-webkit-scrollbar { display: none; }
  .board { display: block; overflow: visible; padding: 0; }
  .js .col:not(.sel) { display: none; }
  .col { background: none; box-shadow: none; padding: 0; margin-bottom: 12px; }
  .col-head { display: none; }
  .col-head:has(.col-sum) { display: flex; border: 0; padding: 0 2px 8px; margin: 0; }
  .col-head:has(.col-sum) h2, .col-head:has(.col-sum) .col-count { display: none; }
  .fc-stage { display: none; }   /* на телефоне этап меняется только в карточке контакта */
  .fcard { padding: 14px; border-radius: var(--r); }
  .fc-name { font-size: 16px; }
}
@media (max-width: 359px) {
  .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .t-num { font-size: 22px; }
}

/* ================= ИИ-менеджер ================= */
.aud-community { --aud: var(--lime); }
.aud-club { --aud: var(--st-contacted); } .aud-organizer { --aud: var(--st-negotiating); } .aud-player { --aud: var(--st-published); }
.aud { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--aud, var(--muted)) 16%, transparent); color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aud, var(--muted)) 45%, transparent); white-space: nowrap; }
.aud.extra { opacity: .85; }
.aud-tile { --st: var(--aud); }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mode-bar { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); margin-bottom: 16px; font-size: 14px; }
.mode-bar .ic { margin-top: 1px; }
.mode-bar.test { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.mode-bar.test .ic { color: var(--warn); }
.mode-bar.blocked { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.mode-bar.blocked .ic { color: var(--bad); }
.mode-bar.live { background: rgba(var(--lime-rgb), .10); box-shadow: inset 0 0 0 1px rgba(var(--lime-rgb), .4); }
.mode-bar.live .ic { color: var(--accent-ink); }
.test-tag { color: var(--warn); font-weight: 700; }
.ai-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow), inset 3px 0 0 var(--lime); }
.ai-bar:hover { background: var(--surface-2); }
.ai-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: rgba(var(--lime-rgb), .14); color: var(--accent-ink); }
.ai-bar-main { flex: 1; min-width: 0; display: grid; }
.ai-bar-main b { font-size: 14.5px; }
.ai-bar-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.funnel-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.funnel-steps li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.funnel-steps li.target { background: rgba(var(--lime-rgb), .14); font-weight: 600; }
.funnel-steps li.declined { color: var(--muted); }
.usage p { margin-bottom: 6px; }
.who-line { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 6px; }
.ai-who h2, .ai-analysis h2, .ai-draft h2, .ai-props h2, .ai-chat h2 { margin-bottom: 10px; }
.aud-form { display: grid; gap: 10px; margin-top: 10px; }
.aud-form .btn { justify-self: start; }
.seg-radio { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-radio label { position: relative; }
.seg-radio input { position: absolute; opacity: 0; }
.seg-radio span { display: inline-block; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.seg-radio input:checked + span { background: rgba(var(--lime-rgb), .16); box-shadow: inset 0 0 0 1px var(--lime); color: var(--ink); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--lime); }
.fp-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ai-page .fp-label { display: block; }
.ai-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; }
.ai-facts dt { color: var(--muted); font-size: 13px; }
.ai-facts dd { margin: 0; font-weight: 600; }
.warn-box { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border-radius: var(--r-s);
  background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: 14px; }
.warn-box .ic { color: var(--warn); }
.warn-box ul { margin: 6px 0 0; padding-left: 18px; }
.ai-draft textarea { min-height: 140px; font-size: 15px; line-height: 1.5; }
.ai-draft p { margin: 8px 0 12px; }
.props { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.props label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); cursor: pointer; }
.props input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--lime); flex: none; }
.props span { display: grid; min-width: 0; }
.props small { color: var(--muted); font-size: 12px; }
.props b { font-weight: 600; overflow-wrap: anywhere; }
.dismiss { margin-top: 8px; }
.regen { margin-bottom: 16px; }
.ai-empty p { margin-bottom: 12px; }
.chat { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; }
.msg p { white-space: pre-line; overflow-wrap: anywhere; }
.msg small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.msg.in { background: var(--surface-2); border-radius: 4px 14px 14px 14px; justify-self: start; }
.msg.out { background: rgba(var(--lime-rgb), .14); border-radius: 14px 4px 14px 14px; justify-self: end; }
.incoming { display: grid; gap: 8px; }
.incoming .btn { justify-self: start; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--lime); }
.kb.needs_check { box-shadow: var(--shadow), inset 3px 0 0 var(--warn); }
.kb-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.kb-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-status { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.kb.needs_check .kb-status { color: var(--warn); }
.kb > p.pre { margin-bottom: 8px; }
.kb-form { margin-top: 10px; display: grid; gap: 10px; }
.kb-form .btn { justify-self: start; }
@media (max-width: 1279px) { .results { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 959px) {
  .tabbar { grid-template-columns: repeat(6, 1fr); }
  .tabbar a { font-size: 10.5px; }
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-bar { margin-bottom: 12px; }
  .ai-bar .btn { min-height: 36px; }
  .ai-draft .inline .btn { flex: 1 1 auto; }
  .msg { max-width: 92%; }
}

/* ---------- продвижение предложений ---------- */
.promo-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.promo-filters .field { flex: 1 1 180px; max-width: 280px; }
.promo-tabs { margin-bottom: 14px; }
.promo-tabs .chip.g-prepared, .promo-tabs .chip.g-agreement { --st: var(--warn); }
.promo-tabs .chip.g-published { --st: var(--ok); }
.promo-tabs .chip.g-problems { --st: var(--bad); }
.promo-tabs .chip.g-scheduled, .promo-tabs .chip.g-digest { --st: var(--st-contacted); }
.pgroup { margin-bottom: 22px; }
.pgroup .block-head { display: grid; gap: 4px; margin-bottom: 10px; }
.pgroup .h-count { font: 600 13px var(--f-body); color: var(--muted); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; }
.pcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.pcard h3 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.pcard.errors { border-left: 3px solid var(--bad); }
.pc-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-city { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.pc-city .ic, .pc-sub .ic { width: 15px; height: 15px; color: var(--muted); }
.pc-title { overflow-wrap: anywhere; }
.pc-title a:hover { text-decoration: underline; }
.pc-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pc-sub span { display: inline-flex; align-items: center; gap: 4px; }
.pc-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pc-note .ic { width: 16px; height: 16px; color: var(--warn); margin-top: 1px; }
.pc-note.ok { background: var(--surface-2); }
.pc-note.ok .ic { color: var(--muted); }
.pkind, .pstat, .ptype { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pkind.k-digest { background: color-mix(in srgb, var(--st-contacted) 16%, transparent); color: var(--st-contacted); }
.pkind.k-urgent { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pkind.k-single { background: rgba(var(--lime-rgb), .14); color: var(--accent-ink); }
.pstat.s-needs_approval, .pstat.s-for_admin, .pstat.s-agreement, .pstat.s-waiting, .pstat.c-negotiating { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.pstat.s-published, .pstat.s-posted, .pstat.c-agreed_auto, .pstat.c-agreed_admin { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pstat.s-cancelled, .pstat.s-error, .pstat.s-closed, .pstat.s-incomplete, .pstat.c-paid_only, .pstat.c-declined { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.pstat.s-waiting_limit, .pstat.s-scheduled { color: var(--st-contacted); background: color-mix(in srgb, var(--st-contacted) 12%, transparent); }
.po-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.po { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px;
  border-radius: 10px; background: var(--surface-2); }
.po.bad { opacity: .6; }
.ptype { background: var(--surface); font-size: 11px; margin-top: 1px; }
.ptype.t-tournament { color: var(--st-negotiating); }
.po-main { display: grid; gap: 2px; min-width: 0; }
.po-main > b { font-weight: 600; overflow-wrap: anywhere; }
.po-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.po-meta span { display: inline-flex; align-items: center; gap: 4px; }
.po-meta .ic { width: 14px; height: 14px; }
.disc { color: var(--accent-ink); }
.po-link { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.po-link:hover { color: var(--ink); background: var(--surface); }
.pc-text summary, .journal summary { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 4px 0; }
.pc-text summary .ic { width: 16px; height: 16px; color: var(--muted); }
.pc-text .d-chev, .journal .d-chev, .comm-row .d-chev { margin-left: auto; transition: transform .15s; }
details[open] > summary .d-chev { transform: rotate(180deg); }
.pc-text form, .pc-text > textarea { display: grid; gap: 8px; margin-top: 8px; }
.pc-text textarea { min-height: 150px; font-size: 14.5px; line-height: 1.5; }
.pc-text > .btn { margin-top: 8px; }
.pc-body { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.pc-actions { display: grid; gap: 8px; }
.pc-actions > form:not(.pub-form) .btn.lime { width: 100%; }
.pub-form { display: flex; gap: 8px; }
.pub-form input { flex: 1 1 auto; min-width: 0; }
.pub-form .btn { flex: none; }
.pc-cancel { justify-self: start; }
.ext { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.journal summary h2 { width: 100%; }
.ev-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.ev-list small { color: var(--muted); margin-right: 6px; white-space: nowrap; }
.ev-list .lv-error { color: var(--bad); }
.ev-list .lv-warn { color: var(--warn); }
.promo-settings fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.chk.big { font-size: 15px; color: var(--ink); font-weight: 600; }
.comm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.comm-list > li > details { background: var(--surface-2); border-radius: var(--r-s); }
.comm-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.cr-name { display: grid; min-width: 0; flex: 1 1 auto; }
.cr-name b { overflow-wrap: anywhere; font-weight: 600; }
.cr-name small { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; }
.cr-name small .ic { width: 13px; height: 13px; }
.comm-form { display: grid; gap: 10px; padding: 4px 12px 14px; }
.promo-entry { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.promo-entry .pe-nums { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 959px) {
  .promo-filters .field { max-width: none; flex: 1 1 140px; }
  .pcard { padding: 12px 14px; }
  .comm-row .pstat { max-width: 46%; white-space: normal; text-align: right; }
}
.btn.wrap { white-space: normal; text-align: center; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }

/* ---------- четыре направления ---------- */
.sp-1 { --st: var(--st-new); } .sp-2 { --st: var(--st-contacted); } .sp-3 { --st: var(--st-negotiating); }
.sp-4 { --st: var(--st-agreed); } .sp-5 { --st: var(--st-published); } .sp-6 { --st: var(--st-partner); }
.cl-declined { --st: var(--st-declined); } .cl-unfit { --st: var(--st-unfit); } .cl-later { --st: var(--st-later); }
.pt-club { --pt: var(--st-contacted); } .pt-organizer { --pt: var(--st-negotiating); } .pt-player { --pt: var(--st-published); }
.pt-community { --pt: var(--accent-ink); }
.ptag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  color: var(--pt); background: color-mix(in srgb, var(--pt) 13%, transparent); white-space: nowrap; }
.pill .pp { font-style: normal; font-weight: 700; opacity: .75; margin-right: 2px; }
.pill .pp::after { content: " ·"; }
.unconf { font-size: 10px; font-weight: 700; color: var(--warn); margin-left: 4px; vertical-align: super; }
.ptabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; padding: 2px; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-weight: 600;
  font-size: 14px; color: var(--muted); background: var(--surface); box-shadow: var(--shadow); }
.ptabs a b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 13px; }
.ptabs a.on { background: var(--lime); color: var(--on-lime); box-shadow: none; }
.ptabs a.on b { color: var(--on-lime); }
.ptabs a:not(.on):hover { color: var(--ink); }
.goal-line { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.goal-line b { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { position: relative; display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pt); }
.kpi .t-sub { font-size: 12.5px; }
.pcols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.pcol { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow); }
.pcol:hover { background: var(--surface-2); }
.pcol h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcol .goal { font-size: 12.5px; color: var(--muted); }
.mini-funnel { display: grid; gap: 4px; }
.mini-funnel div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.mini-funnel span { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.mini-funnel span i { width: 7px; height: 7px; border-radius: 50%; background: var(--st); flex: none; }
.mini-funnel span em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-funnel b { font-variant-numeric: tabular-nums; }
.pcol-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.closed-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; font-size: 13px; }
.closed-sum a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.closed-sum a i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.fc-track { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fc-next { font-size: 12.5px; color: var(--muted); }
.fc-next b { color: var(--ink); font-weight: 600; }
.fc-result { font-size: 12px; color: var(--st-published); display: inline-flex; gap: 4px; align-items: center; }
.fc-result .ic { width: 14px; height: 14px; }
.r-tracks { display: flex; flex-wrap: wrap; gap: 4px; }
.r-tracks .pill { font-size: 12px; padding: 3px 8px; }
.tracks { display: grid; gap: 12px; margin-bottom: 16px; }
.track { padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow), inset 3px 0 0 var(--pt); }
.track.is-closed { opacity: .92; }
.tr-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.tr-head h2 { gap: 10px; }
.tr-goal { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tr-result { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--st-published); }
.tr-result.wait { color: var(--muted); font-weight: 500; }
.tr-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.tr-box { display: grid; gap: 8px; align-content: start; }
.tr-box h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tr-box .inline input[type="text"], .tr-box .inline input[type="url"] { flex: 1 1 200px; width: auto; }
.tr-close { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 13px; }
.tr-close details { display: inline-block; }
.tr-close details[open] { display: block; width: 100%; }
.tr-close .inline { margin-top: 8px; }
.tr-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-add select { width: auto; flex: 1 1 200px; max-width: 320px; }
.proof-hint { font-size: 12.5px; color: var(--muted); }
.step.cur .n, .step.done .n { }
.dir-check { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1279px) { .pcols, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 959px) {
  .tr-grid { grid-template-columns: minmax(0, 1fr); }
  .track { padding: 14px; }
  .ptabs { margin: 0 -16px 12px; padding: 2px 16px; }
  .ptabs a { padding: 8px 12px; font-size: 13.5px; }
  .tiles-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) { .pcols, .kpis { grid-template-columns: minmax(0, 1fr); } }
.chip[class*="pt-"] { --st: var(--pt); }
.closed-sum .tile-like { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow); }
.list-head, .row { grid-template-columns: minmax(200px, 2fr) minmax(200px, 1.6fr) 150px minmax(110px, 1fr) 96px minmax(130px, 1fr); }
fieldset.seg { min-inline-size: 0; min-width: 0; }
@media (max-width: 959px) { fieldset.seg { display: flex; flex-wrap: wrap; } }
.board-6 { grid-auto-columns: minmax(158px, 1fr); gap: 10px; }
.board-6 .stage-select select { font-size: 12.5px; }
.pcol h3 { flex-wrap: wrap; } .pcol h3 .small-text { white-space: nowrap; }
.closed-sum { margin: 12px 0 18px; }
.fc-track .pill, .r-tracks .pill, .tl-meta .pill { max-width: 100%; flex-wrap: nowrap; white-space: normal; align-items: center; }
.pill .pl-t { min-width: 0; }

/* ---------- рабочее время и очередь сообщений ---------- */
.send-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); margin: 10px 0 4px; font-size: 14px;
  background: var(--surface-2); box-shadow: inset 3px 0 0 var(--sb, var(--line)); }
.send-box .ic { margin-top: 2px; color: var(--sb, var(--muted)); }
.send-box p { margin: 4px 0 0; }
.send-box.ok { --sb: var(--ok); } .send-box.wait { --sb: var(--warn); } .send-box.bad { --sb: var(--bad); }
.outbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ob { padding: 12px 14px; border-radius: var(--r-s); background: var(--surface); box-shadow: var(--shadow), inset 3px 0 0 var(--ob); display: grid; gap: 6px; }
.ai-draft .ob { background: var(--surface-2); }
.ob-due { --ob: var(--lime); } .ob-queued { --ob: var(--warn); }
.ob-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ob-text { font-size: 14px; max-height: 6.5em; overflow: hidden; }
.ob .inline form { display: inline; }
.hours-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hours-bar h2 { margin-bottom: 4px; }
.hours-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }

/* ---------- Connect: сообщения, поиск партнёров, каналы ---------- */
.nav a .badge { margin-left: auto; }
.tabbar a { position: relative; }
.tabbar a .dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip.bad b { color: var(--bad); }
.inbox-search { display: flex; gap: 8px; margin-bottom: 14px; }
.inbox-search .search { flex: 1 1 auto; }
.inbox-search select { width: auto; max-width: 45%; }
.threads, .leads, .channels, .outq, .msgs, .handles, .lead-contacts { list-style: none; margin: 0; padding: 0; }
.threads { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.thread-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--surface-2); }
.thread-row.need { box-shadow: inset 3px 0 0 var(--warn); }
.thread-row.unread .tr-top b, .thread-row.unread .tr-last { color: var(--ink); font-weight: 700; }
.tr-main { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.tr-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tr-top a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.tr-top time { color: var(--muted); font-size: 12.5px; flex: none; }
.tr-last { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ch-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-2);
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.ch-email { color: #5aa9ff; } .ch-vk { color: #4c8dff; } .ch-max { color: #b78cff; } .ch-sandbox { color: var(--warn); }
.ch-telegram { color: #37b5ea; } .ch-manual { color: var(--muted); }
.st-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink); }
.st-tag.lime { background: rgba(var(--lime-rgb), .16); color: var(--accent-ink); }
.st-tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.st-tag.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.st-tag.muted { color: var(--muted); }
.bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.badge.lime { background: var(--lime); }
.empty-state { text-align: center; padding: 28px 18px; }
.empty-state p + p { margin-top: 6px; }

.ix-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ix-main, .ix-side { min-width: 0; }
.msgs { display: grid; gap: 10px; }
.msg-subj { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.msg small .ch-tag { margin-right: 4px; padding: 0 6px; }
.msg-file { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.msg-file .ic { width: 16px; height: 16px; flex: none; }
.oq { padding: 14px; margin-bottom: 10px; }
.oq.approval { box-shadow: var(--shadow), inset 3px 0 0 var(--warn); }
.oq.failed { box-shadow: var(--shadow), inset 3px 0 0 var(--bad); }
.oq-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.oq-text { white-space: pre-line; overflow-wrap: anywhere; }
.oq-form, .compose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.oq-actions { margin-top: 8px; }
.compose .seg-radio { margin-bottom: 2px; }
.file-pick { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.file-pick input { width: auto; max-width: 100%; padding: 6px; }
.ai-draft-btn { margin-top: 12px; }
.handles li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.handles li:last-child { border-bottom: 0; }
.h-addr { overflow-wrap: anywhere; min-width: 0; }
.ix-side details { margin-top: 10px; }
.ix-side .compose { margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }

.lead-url input { flex: 1 1 240px; }
.lead-test { margin-top: 10px; }
.panel > p.small-text + p.small-text { margin-top: 8px; }
.lead { padding: 16px; }
.lead-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lead-head h3 { font-size: 17px; margin-bottom: 4px; overflow-wrap: anywhere; }
.lead .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.lead .meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.lead-site { overflow-wrap: anywhere; }
.lead-contacts { display: grid; gap: 4px; margin: 10px 0; }
.lead-contacts li { display: flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.lead-contacts .ic, .lead .meta .ic { width: 15px; height: 15px; flex: none; }
.lead-actions { margin-top: 10px; }
.lead-actions select { width: auto; }
.lead.rejected, .lead.imported { opacity: .75; }
.channel { padding: 16px; }
.channel .inline { margin-top: 10px; }
.channel .inline select { width: auto; }
.channel p + p { margin-top: 6px; }

@media (max-width: 1100px) { .ix-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 959px) {
  .tabbar a { font-size: 10px; }
  .inbox-page .page-head .head-actions .btn span { display: none; }
  .thread-row { padding: 12px; }
  .lead-actions, .lead-actions form, .channel .inline { width: 100%; }
  .lead-actions form.inline select, .channel .inline select { flex: 1 1 140px; }
}
/* поля и кнопки при прокрутке к ним не прячутся под верхней и нижней панелями телефона */
@media (max-width: 959px) { html { scroll-padding-top: 72px; scroll-padding-bottom: calc(84px + var(--safe-b, 0px)); } }
@media (max-width: 959px) { .page-head.stack-m { flex-direction: column; align-items: stretch; } .page-head.stack-m form .btn { width: 100%; } }
