/* Оформление как у веб-интерфейса ПланФикса: узкая тёмная полоса разделов, тёмная панель списков, белая шапка,
   светлое поле; таблица задач и доска по статусам; карточка — лента слева, «Детали» справа. Без сборки — обычный CSS.
   На телефоне: список → карточка, внизу панель вкладок, кнопки не мельче 44px. */
:root {
  --bg: #eef0f3; --panel: #fff; --ink: #262b31; --muted: #5d6670; --line: #e2e5e9; --soft: #f5f6f8;
  --rail: #2a2f36; --rail-ink: #a3abb5; --rail-on: #3a414a; --sub: #343a42; --sub-ink: #d5dae0; --sub-hover: #3e454e;
  --green: #1b8653; --green-h: #166f45; --accent: #1f6fbf; --accent-ink: #fff; --accent-bg: #1f6fbf;
  --err: #c0392b; --ok: #18834f; --warn: #e67e22; --radius: 6px;
  --field-line: #d3d8de; --hover: #f4f8fd; --mixink: #15191e; --side-bg: #f8f9fa; --bubble: #f1f3f6; --col: #e4e7eb; --row-line: #edf0f2; --head-bg: #fbfbfc; --note-bg: #fff7e6; --note-ink: #8a5a00; --err-bg: #fdecea; --digest-bg: #fffaf0; --digest-line: #f0d9a8; --mark-bg: #fff1e6; --mark-ink: #9a4a00; --mark-line: #f6c9a3; --on-bg: #eefaf2; --on-line: #a6dcbc; --seg-on: #e9f6ef; --focus: #cde3f7; --pale: #eef4fe; --spam-bg: #fff5f4; --dot: #c8ced6; --zero: #858e99; --pillbg: rgba(255,255,255,.75); --sys-ink: #59636f; --who-ink: #56606d; --orange: #f39c12;
  --rail-hover: #333941; --seg-on-ink: #157a49; --tab-on: #18834f; --img-op: 1; --menu-bg: #2b2f34; --menu-hover: #3a3f45;
  --bubble-shadow: 0 1px 1px rgba(20, 30, 40, .07); --pop-shadow: 0 10px 30px rgba(15, 20, 25, .18);
  --card-shadow: 0 1px 2px rgba(20, 30, 40, .1); --card-shadow-h: 0 2px 8px rgba(20, 30, 40, .16);
  --th-moon: inline-flex; --th-sun: none; --map-ctrl: none; --cnt-bg: #d0392b; --orange-bg: #b35600; --chip-ink: 55%; --tt-ink: 58%; --sub-mut: #a3adb8;
  --score-good: #18834f; --score-mid: #96631a; --score-bad: #d0392b; --hot-bg: #fff1e6; --hot-ink: #9a4a00; --tr-m: #eef4fe; --tr-c: #f5f6f8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 "Segoe UI", "Open Sans", -apple-system, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 400; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn { cursor: pointer; border: 1px solid var(--field-line); background: var(--panel); border-radius: 4px; padding: 6px 12px;
  min-height: 34px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); justify-content: center;
  text-decoration: none !important; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); background: var(--soft); }
button.primary, .btn.primary { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--green-h); border-color: var(--green-h); }
.btn.ghost, button.ghost { background: transparent; }
.btn.sm, button.sm { min-height: 28px; padding: 2px 9px; font-size: 13px; }
button:disabled { opacity: .5; }
input, select, textarea { width: 100%; border: 1px solid var(--field-line); border-radius: 4px; padding: 6px 9px; background: var(--panel); min-height: 34px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--green); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); border-color: var(--accent); }
.err { background: var(--err-bg); color: var(--err); padding: 8px 10px; border-radius: 4px; }
.note { background: var(--note-bg); color: var(--note-ink); padding: 8px 10px; border-radius: 4px; }
.hint, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ic { flex: none; }
.lbl { color: var(--muted); font-size: 12px; }
.ava { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: hsl(var(--h, 210) 42% 60%); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.ava.sm { width: 22px; height: 22px; font-size: 10px; margin-right: 6px; vertical-align: middle; }
.pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px;
  padding: 2px 9px 2px 3px; margin: 2px 4px 2px 0; background: var(--soft); }
label.pill { padding: 3px 10px; cursor: pointer; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
  color: color-mix(in srgb, var(--c) var(--chip-ink), var(--mixink)); background: color-mix(in srgb, var(--c) 16%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--panel)); }
.tt { color: color-mix(in srgb, var(--c) var(--tt-ink), var(--mixink)); font-weight: 600; }
.sq { display: inline-block; width: 13px; height: 13px; border-radius: 3px; background: var(--c); margin-right: 7px;
  vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); flex: none; }

/* ---------- каркас: полоса разделов, панель списков, шапка ---------- */
body.app { display: flex; min-height: 100vh; }
.rail { width: 56px; flex: none; background: var(--rail); display: flex; flex-direction: column; align-items: center;
  position: sticky; top: 0; height: 100vh; z-index: 6; padding: 8px 0; }
.rail-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--green);
  color: #fff !important; font-weight: 800; font-size: 17px; margin-bottom: 14px; text-decoration: none !important; }
.rail nav { display: flex; flex-direction: column; gap: 2px; flex: 1; width: 100%; }
.rail nav a { position: relative; display: grid; place-items: center; height: 46px; color: var(--rail-ink); text-decoration: none; }
.rail nav a span { display: none; }
.rail nav a:hover { color: #fff; background: var(--rail-hover); }
.rail nav a.on { color: #fff; background: var(--rail-on); box-shadow: inset 3px 0 0 var(--green); }
.rail .cnt { position: absolute; top: 6px; right: 8px; }
.rail-me { margin-top: auto; text-decoration: none !important; }
.cnt { background: var(--cnt-bg); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 5px; line-height: 17px; font-weight: 700; }
.cnt:empty { display: none; }
.subnav { width: var(--sn-w, 236px); flex: none; background: var(--sub); color: var(--sub-ink); position: sticky; top: 0; height: 100vh;
  overflow-y: auto; padding: 10px 8px 20px; }
.sn-head { color: #fff; font-size: 16px; font-weight: 600; padding: 6px 10px 10px; }
.sn-sec { color: var(--sub-mut); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 4px; }
.sn-list { display: flex; flex-direction: column; gap: 1px; }
.sn-list a, .sn-item { display: flex; align-items: center; gap: 8px; color: var(--sub-ink); border-radius: 6px; text-decoration: none !important; }
.sn-list > a, .sn-item > a:first-child { padding: 7px 10px; flex: 1; min-width: 0; }
.sn-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sn-list a .ic { color: var(--sub-mut); }
.sn-list > a:hover, .sn-item:hover { background: var(--sub-hover); color: #fff; }
.sn-list > a.on, .sn-item.on { background: var(--green); color: #fff; }
.sn-list > a.on .ic, .sn-item.on .ic, .sn-item.on > a, .sn-item.on .ed { color: #fff; }
.sn-item .ucnt { font-size: 12px; font-weight: 600; color: inherit; opacity: .8; }
.sn-item .ed { color: var(--sub-mut); padding: 0 8px; min-height: 28px; border: 0; background: none; display: none; }
.sn-item:hover .ed { display: inline-flex; align-items: center; }
.sn-item form { margin: 0; display: flex; }
.sn-add { color: var(--sub-mut) !important; }
.wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 18px;
  height: 48px; position: sticky; top: 0; z-index: 5; }
.brand { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; text-decoration: none !important; }
.top .new { border-radius: 16px; min-height: 30px; padding: 2px 12px 2px 9px; color: var(--muted); }
.gsearch { margin-left: auto; width: 280px; display: flex; align-items: center; gap: 6px; background: var(--soft);
  border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; color: var(--muted); }
.gsearch input { border: 0; background: transparent; padding-left: 0; min-height: 30px; }
.gsearch input:focus { outline: none; }
.top .who { display: flex; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.presence { display: flex; gap: 6px; }
.tog { white-space: nowrap; background: var(--panel); color: var(--muted); border-color: var(--line); padding: 2px 11px; min-height: 30px; border-radius: 16px; font-size: 13px; }
.tog i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.tog.on { color: var(--ok); border-color: var(--on-line); background: var(--on-bg); }
.tog.on i { background: var(--ok); }
.tabbar, .vtabs.mob { display: none; }

/* ---------- список заявок: таблица и доска ---------- */
.listpage { padding: 18px 24px 30px; min-width: 0; }
.lp-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.lp-top h1 { font-size: 26px; margin: 0; }
.lp-top h1 small { font-size: 14px; color: var(--muted); margin-left: 4px; }
.lp-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: 4px; overflow: hidden; background: var(--panel); }
.seg a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; color: var(--muted); text-decoration: none !important; }
.seg a + a { border-left: 1px solid var(--field-line); }
.seg a.on { background: var(--seg-on); color: var(--seg-on-ink); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.fsearch { flex: 0 1 280px; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--field-line);
  border-radius: 4px; padding: 0 9px; color: var(--muted); }
.fsearch input { border: 0; padding-left: 0; }
.fsearch input:focus { outline: none; }
.filters > select { flex: 0 1 220px; width: auto; }
.fpanel summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 0 12px; border: 1px solid var(--field-line); border-radius: 4px; background: var(--panel); color: var(--ink); }
.fpanel summary::-webkit-details-marker { display: none; }
.fpanel[open] { flex: 1 1 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.fpanel[open] summary { border: 0; padding: 0; min-height: 0; margin-bottom: 6px; font-weight: 600; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.fbtns { display: flex; gap: 6px; margin: 8px 0 2px; }
.savef { display: flex; gap: 8px; margin: -4px 0 12px; max-width: 520px; }
.savef input { flex: 1; }
.tbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.tasks { width: 100%; border-collapse: collapse; }
table.tasks th { font-size: 12.5px; color: var(--muted); font-weight: 400; text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; text-decoration: underline dotted var(--field-line); text-underline-offset: 3px; background: var(--head-bg); }
table.tasks td { padding: 8px 10px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
table.tasks tbody tr { cursor: pointer; }
table.tasks tbody tr:hover { background: var(--hover); }
table.tasks td.num, table.tasks th.num { width: 70px; color: var(--muted); white-space: nowrap; }
table.tasks td.ttl { min-width: 240px; }
table.tasks td.ttl .tt { text-decoration: none; }
table.tasks td.ttl small { display: block; margin-left: 20px; }
table.tasks td.ttl .mark, table.tasks td.ttl .bad { margin: 3px 0 0 6px; }
table.tasks td.who { white-space: nowrap; }
table.tasks tr.empty td { padding: 30px 10px; color: var(--muted); text-align: center; cursor: default; }
.late { color: var(--err); font-weight: 600; }
.more { display: block; text-align: center; padding: 12px; }
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.bcol { flex: 0 0 var(--bw, 264px); background: var(--col); border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 190px); position: relative; }
.bcol header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px;
  border-radius: var(--radius) var(--radius) 0 0; background: color-mix(in srgb, var(--c) 30%, var(--panel));
  border-top: 4px solid var(--c); font-weight: 600; }
.bcol header b { font-size: 12px; background: var(--pillbg); border-radius: 9px; padding: 0 7px; }
.bcards { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bcard { display: flex; flex-direction: column; gap: 3px; background: var(--panel); border-radius: var(--radius); padding: 9px 11px;
  box-shadow: var(--card-shadow); color: var(--ink); text-decoration: none !important; }
.bcard:hover { box-shadow: var(--card-shadow-h); }
.bcard small { color: var(--muted); font-size: 12px; }
.bcard .tt { font-size: 14.5px; line-height: 1.3; }
.bcard .kv { font-size: 13px; }
.bcard .kv em { font-style: normal; color: var(--muted); }
.bcard .who { font-size: 13px; margin-top: 3px; display: flex; align-items: center; }
.bempty { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0; }

/* ---------- карточка заявки: лента слева, «Детали» справа ---------- */
.cardpage { min-width: 0; }
.card { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w, 380px); grid-template-areas: "head side" "feed side";
  grid-template-rows: auto 1fr; min-height: calc(100vh - 48px); background: var(--panel); }
.card-head { grid-area: head; padding: 16px 28px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.card .back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 4px; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.card-head h1 { font-size: 24px; margin: 2px 0 10px; overflow-wrap: anywhere; }
.card-head h1 .sq { width: 18px; height: 18px; vertical-align: -2px; }
.head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-row form { margin: 0; }
.status-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 2px 13px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, var(--panel)); background: color-mix(in srgb, var(--c) 14%, var(--panel)); font-size: 13px; font-weight: 600; }
.status-btn i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.accept { min-width: 150px; min-height: 36px; font-size: 15px; }
.rulebtn { border-color: var(--green); color: var(--green-h); }
.marks { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-head .err, .card-head .note, .spambox { margin: 10px 0 0; }
.spambox { border-left: 4px solid var(--err); background: var(--spam-bg); padding: 8px 12px; border-radius: 4px; }
.card-side { grid-area: side; background: var(--side-bg); border-left: 1px solid var(--line); padding: 14px 20px 30px;
  position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; min-width: 0; }
.side-title { font-size: 22px; margin-bottom: 6px; }
.drow { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.drow > span:last-child { overflow-wrap: anywhere; }
.related { padding: 8px 0; border-bottom: 1px solid var(--line); }
.related h2 { font-size: 13px; margin: 0 0 4px; color: var(--muted); font-weight: 600; }
.related .hint { margin: 0 0 4px; }
.relrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 5px 0; }
.relrow + .relrow { border-top: 1px dashed var(--line); }
.relrow .relnum { font-weight: 600; }
.relrow small { flex-basis: 100%; }
.pill.sm { font-size: 11px; padding: 0 7px; font-weight: 500; }
.enter-save { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rrule { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.rr-head { display: flex; align-items: center; gap: 8px; }
.rr-head input { flex: 1; min-width: 0; font-weight: 600; }
.rr-move { display: inline-flex; gap: 4px; margin-left: auto; }
.rr-move button { min-width: 36px; min-height: 36px; padding: 0 8px; }
.rr-reason { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rr-reason b { flex: 1 1 160px; }
.rr-reason select { flex: 1 1 240px; min-width: 0; max-width: 100%; }
.stv { color: color-mix(in srgb, var(--c) var(--tt-ink), var(--mixink)); font-weight: 600; }
.statusbox { padding: 8px 0; border-bottom: 1px solid var(--line); }
.statusbox summary, .pr-edit summary { cursor: pointer; color: var(--accent); }
.statuses { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.st-opt input { display: none; }
.st-opt span { display: inline-block; padding: 4px 11px; border: 1px solid color-mix(in srgb, var(--c) 60%, var(--panel)); color: var(--ink);
  background: var(--panel); border-radius: 16px; cursor: pointer; font-size: 13px; }
.st-opt input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; text-shadow: 0 0 2px rgba(0,0,0,.35); }
.pr.inline { display: flex; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pr.inline select { flex: 1; min-width: 0; }
.pr-edit { padding: 6px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.fields { margin-top: 4px; }
.fblock h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 18px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.card-side .grid2 { grid-template-columns: 1fr; }
.grid2 .wide { grid-column: 1 / -1; }
.fld { display: block; margin: 6px 0; color: var(--muted); font-size: 12.5px; }
.fld input, .fld select, .fld textarea { margin-top: 3px; color: var(--ink); font-size: 14px; }
.fld .check { display: flex; align-items: center; gap: 6px; min-height: 34px; color: var(--ink); }
.fld .check input { width: 18px; height: 18px; }
.phone-row { display: flex; gap: 6px; align-items: center; }
.phone-row input { flex: 1; }
.savefields { margin: 12px 0 0; width: 100%; }
dl.kv { display: grid; grid-template-columns: 1fr; gap: 0; margin: 4px 0 0; }
dl.kv dt { color: var(--muted); font-size: 12px; }
dl.kv dd { margin: 0 0 8px; overflow-wrap: anywhere; }
.feed { grid-area: feed; padding: 14px 28px 0; display: flex; flex-direction: column; min-width: 0; }
.feed > ul { list-style: none; padding: 0; margin: 0 0 12px; flex: 1; }
.feed-empty { padding: 20px 0; }
.ev { display: flex; gap: 10px; padding: 7px 0; }
.ev-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev .ava { width: 34px; height: 34px; font-size: 12.5px; }
.ev-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.ev .when { color: var(--muted); font-size: 12px; }
.bubble { display: inline-block; max-width: 760px; margin-top: 3px; background: var(--bubble); border-radius: 4px 12px 12px 12px; padding: 8px 12px; }
.ev-comment .txt p { margin: 0 0 4px; }
.ev-comment .txt p:last-child { margin: 0; }
.ev-comment .txt ul, .ev-comment .txt ol { margin: 4px 0; padding-left: 20px; }
.ev .to { color: var(--muted); font-size: 12px; margin-top: 4px; }
.ev:not(.ev-comment) { color: var(--muted); font-size: 13px; }
.ev-dot { width: 34px; flex: none; display: flex; justify-content: center; }
.ev-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); margin-top: 6px; }
.ev:not(.ev-comment) .who { color: var(--who-ink); font-weight: 600; }
.ev .sys { color: var(--sys-ink); }
.digest { margin-top: 6px; background: var(--digest-bg); border: 1px solid var(--digest-line); border-radius: 8px; padding: 8px 12px; color: var(--ink); font-size: 14px; max-width: 760px; }
.dg { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 4px 0; }
.dg .lbl { width: 100%; }
.dg .txt { width: 100%; }
.composer { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 0 14px;
  display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.composer textarea { border-radius: 8px; min-height: 44px; resize: vertical; background: var(--soft); }
.composer textarea:focus { background: var(--panel); }
.toolbar { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.toolbar button { min-height: 28px; min-width: 30px; padding: 1px 7px; border-color: transparent; background: transparent; color: var(--muted); }
.toolbar button:hover { background: var(--soft); border-color: var(--line); }
.toolbar .emoji { display: flex; flex-wrap: wrap; gap: 0; }
.toolbar .emoji button { padding: 0 3px; min-width: 28px; }
.recips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.recips .lbl { margin-right: 4px; }
.composer .send { align-self: flex-start; }

/* ---------- страницы-листы ---------- */
.sheet { max-width: 900px; margin: 20px auto; background: var(--panel); padding: 20px; border-radius: 10px; border: 1px solid var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.notif { list-style: none; padding: 0; margin: 0; }
.notif a { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif li.new a { background: var(--pale); font-weight: 600; }
.notif .when { color: var(--muted); white-space: nowrap; font-weight: 400; }
.notif .empty { padding: 20px 6px; color: var(--muted); }
.menu a { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.adduser { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 6px; margin-bottom: 14px; }
.ulist { border-top: 1px solid var(--line); }
.urow { border-bottom: 1px solid var(--line); }
.urow summary { display: flex; align-items: center; gap: 10px; padding: 10px 4px; cursor: pointer; list-style: none; }
.urow summary::-webkit-details-marker { display: none; }
.urow .un { display: flex; flex-direction: column; }
.urow .un small { color: var(--muted); }
.urow.off { opacity: .55; }
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 0 4px 10px 44px; }
.profile .fld:nth-child(3), .profile button { grid-column: 1 / -1; justify-self: start; }
.uact { display: flex; gap: 8px; padding: 0 4px 12px 44px; flex-wrap: wrap; }
.testsum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--note-bg); color: var(--note-ink);
  padding: 8px 10px; border-radius: var(--radius); }
.testsum form { margin-left: auto; }
.newcard.testlead { margin-top: 14px; }
.newcard.testlead select { width: auto; min-width: 200px; }
.linkbox { background: var(--pale); padding: 10px; border-radius: 6px; margin-bottom: 12px; }
.linkbox input { margin-top: 6px; }
.newcard .grid2 { margin-bottom: 12px; }

body.guest { background: var(--rail); min-height: 100vh; padding: 12vh 16px 0; }
.auth-logo span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--green); color: #fff; font-weight: 800; }
.auth { max-width: 360px; margin: 0 auto; background: var(--panel); padding: 24px; border-radius: 12px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 14px; }
.auth label { display: block; margin: 10px 0; color: var(--muted); }
.auth button { width: 100%; margin-top: 8px; min-height: 44px; }
/* «глаз» в поле пароля: показать / скрыть введённое */
.auth .pw { position: relative; display: block; }
.auth .pw input { width: 100%; padding-right: 44px; }
.auth .pw .pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; min-height: 40px; margin: 0;
  padding: 0; display: grid; place-items: center; background: transparent; border: 0; color: var(--muted); }
.auth .pw .pw-eye[aria-pressed="true"] { color: var(--tab-on); }
.auth input[readonly] { color: var(--muted); }

.attach { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.attach input { flex: 1 1 200px; border-style: dashed; }
.file { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.file img { display: block; max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--line); }
.file > a:first-child:has(img) { flex-basis: 100%; }

/* ---------- кабинет, таблицы, настройки ---------- */
.sheet.wide { max-width: 1180px; }
.tscroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; margin: 6px 0 16px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: middle; }
table.grid th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--soft); }
table.grid td.n { text-align: center; font-variant-numeric: tabular-nums; }
table.grid td.c { text-align: center; }
table.grid td.sm { width: 90px; }
table.grid tr.off td { opacity: .55; }
table.grid a.zero { color: var(--zero); }
.bad { color: var(--err); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); margin-right: 6px; }
.dot.ok { background: var(--ok); } .dot.on { background: var(--accent); }
.pres { white-space: nowrap; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tot { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tot .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tot .nums a { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 6px; background: var(--soft); color: var(--ink); }
.tot .nums a:hover { background: var(--pale); }
.tot .nums b { font-size: 22px; }
.tot .nums span { font-size: 12px; color: var(--muted); }
.waitlist, .nowlist { list-style: none; padding: 0; margin: 0 0 10px; }
.waitlist li, .nowlist li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.settings .vtabs { padding: 0; margin-bottom: 12px; }
.settings h2.stitle { font-size: 18px; margin: 0 0 10px; }
.typepick { margin: 0 0 12px; }   /* v0.30: выбор типа заявок сверху раздела настроек */
.typepick select { margin-left: 6px; min-height: 36px; }   /* подраздел настроек со своей страницей (v0.29.1) */
.tgbox { background: var(--pale); border-radius: 6px; padding: 10px; margin-bottom: 10px; }
.qgrid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 14px; }
.queue { margin: 4px 0 0; padding-left: 20px; }
.queue li.muted { list-style: none; margin-left: -20px; }
.big { font-size: 28px; font-weight: 700; }
.big-check { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.okmsg { background: var(--on-bg); color: var(--ok); padding: 8px 10px; border-radius: 6px; }
.inline-add { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.inline-add input:not([type=color]) { flex: 1 1 220px; }
.inline-add input[type=color] { width: 60px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 12px; }
.st-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
code { font-size: 12px; background: var(--soft); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }

/* этап 2 распределения: спам, экран очереди, голод */
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btnrow form { margin: 0; }
.spambox { border-left: 4px solid var(--err); }
.spambox .btnrow { margin-top: 10px; }
.tospam { margin: 0 0 10px; }
.spamhead { margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.spamhead .hint { margin: 0; font-size: 13px; }
.screenlink { word-break: break-all; }
.qbox .tscroll { margin-top: 14px; }
/* ---------- конструктор: правила, списки, раскладка ---------- */
.ruleform .box h2 { margin-bottom: 8px; }
.rows-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.crow { display: grid; grid-template-columns: 28px minmax(140px, 1.1fr) minmax(130px, .9fr) minmax(0, 2fr) 36px; gap: 6px;
  align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.crow.arow { grid-template-columns: 28px minmax(160px, 1fr) minmax(0, 3fr) 36px; }
.crow .cnum { font-weight: 700; padding-top: 8px; color: var(--muted); }
.crow .cval { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crow .cval > span { display: flex; flex-direction: column; gap: 6px; }
.crow .x, .lay-bhead .x { min-height: 36px; padding: 0 8px; }
.picks { display: flex; flex-wrap: wrap; gap: 2px 12px; max-height: 150px; overflow: auto; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.picks.inline { max-height: none; border: 0; background: none; padding: 2px 0; }
.picks label { white-space: nowrap; cursor: pointer; }
input.num { max-width: 120px; }
.fld.logic { margin-top: 10px; }
[hidden] { display: none !important; }
.rule.off { opacity: .65; }
.rule-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.rule .btnrow { margin-top: 8px; }
.testres { padding-left: 20px; }
.testres .yes { color: var(--ok); }
.testres .no { color: var(--err); }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.rulebtn { border-color: var(--accent); color: var(--accent); }
.marks { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; padding: 1px 8px; border-radius: 10px;
  background: var(--mark-bg); color: var(--mark-ink); border: 1px solid var(--mark-line); }
.mark form { margin: 0; }
.live { display: inline-block; font-size: 11px; padding: 0 6px; margin-right: 4px; border-radius: 8px; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.mark button { min-height: 0; border: 0; background: none; padding: 0 2px; color: inherit; }
.ulists { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0; padding: 0 12px; }
.ul { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 13px; }
.ul a { padding: 3px 10px; }
.ul a.ed { padding: 3px 8px 3px 0; color: var(--muted); }
.ul.on { border-color: var(--accent); background: var(--pale); }
.ul .ucnt { font-weight: 700; color: var(--ink); margin-left: 2px; }
.ul.add { color: var(--accent); padding: 3px 10px; border-style: dashed; }
.fblock .grid2 { margin-bottom: 4px; }
.savefields { margin: 0 0 10px; }
details.trans { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.trans summary { cursor: pointer; color: var(--accent); }
.lay-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 8px; }
.lay-block { border: 1px solid var(--line); border-radius: 6px; background: var(--soft); padding: 8px; min-width: 0; }
.lay-free { border-style: dashed; }
.lay-bhead { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.lay-list { list-style: none; margin: 0; padding: 0; min-height: 40px; display: flex; flex-direction: column; gap: 4px; }
.lay-list.over { outline: 2px dashed var(--accent); }
.lay-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 6px; cursor: grab; }
.lay-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.lay-tools { display: flex; gap: 2px; flex: none; }
.lay-tools button { min-height: 30px; padding: 0 6px; }
.lay-tools select { width: 34px; min-height: 30px; padding: 0 2px; }
@media (max-width: 820px) {
  .crow, .crow.arow { grid-template-columns: 24px minmax(0, 1fr) 40px; }
  .crow > select, .crow .cval { grid-column: 2; }
  .crow .x { grid-column: 3; grid-row: 1; }
  .lay-tools button, .lay-tools select { min-height: 40px; }
  .lay-tools select { width: 44px; }
}


/* ---------- общие блоки страниц настроек и кабинета ---------- */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0; }
.vtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.vtabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.vtabs a.on { color: var(--ink); border-color: var(--green); font-weight: 600; }
.sheet h1 { font-size: 24px; }

.attach input[type=file] { border: 0; padding: 0; min-height: 0; background: none; font-size: 13px; color: var(--muted); }
.attach input[type=file]::file-selector-button { border: 1px solid var(--field-line); background: var(--panel); border-radius: 4px; padding: 5px 12px;
  margin-right: 8px; cursor: pointer; font: inherit; color: var(--ink); }
/* ---------- тёмная тема (ночь): «Как в системе» — по настройке системы, «Ночь» — всегда, «День» — никогда.
   Один и тот же набор токенов дважды (CSS не умеет объединить @media и атрибут) — test_theme сверяет, что они
   одинаковые. Новые тёмные цвета — только токенами здесь, не отдельными правилами. ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1d2126; --panel: #262b31; --ink: #e2e5e9; --muted: #9ea8b3; --line: #363c44; --soft: #2c3238;
    --rail: #16191d; --rail-on: #2c3239; --sub: #20242a; --sub-hover: #2c3239; --accent: #5ea6f0; --accent-bg: #2f6fb3;
    --err: #f28b82; --ok: #3ccf7f;
    --field-line: #434a53; --hover: #2d343d; --mixink: #ffffff; --side-bg: #22262c; --bubble: #323840; --col: #1f2328;
    --row-line: #30353c; --head-bg: #2a2f35; --note-bg: #3b3222; --note-ink: #f0c674; --err-bg: #46292b;
    --digest-bg: #322e26; --digest-line: #5c4f33; --mark-bg: #3d2f22; --mark-ink: #f0b27a; --mark-line: #6b4a2e;
    --on-bg: #1d3a2b; --on-line: #2f6b4a; --seg-on: #1d3a2b; --focus: #2b4a6b; --pale: #24344a; --spam-bg: #3a2526;
    --dot: #59626c; --zero: #7f8994; --chip-ink: 58%; --tt-ink: 62%; --pillbg: rgba(0,0,0,.35); --sys-ink: #aab3bd; --who-ink: #c3cad2;
    --rail-hover: #22262b; --seg-on-ink: #4fd18b; --tab-on: #4fd18b; --img-op: .92; --menu-bg: #1b1e22; --menu-hover: #2c3239;
    --bubble-shadow: none; --pop-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .4); --card-shadow-h: 0 2px 8px rgba(0, 0, 0, .55);
    --th-moon: none; --th-sun: inline-flex; --map-ctrl: invert(1) hue-rotate(180deg) brightness(.9);
    --score-good: #23804f; --score-mid: #93641c; --score-bad: #c0473b; --hot-bg: #3d2f22; --hot-ink: #f0b27a; --tr-m: #24344a; --tr-c: #2c3238;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d2126; --panel: #262b31; --ink: #e2e5e9; --muted: #9ea8b3; --line: #363c44; --soft: #2c3238;
  --rail: #16191d; --rail-on: #2c3239; --sub: #20242a; --sub-hover: #2c3239; --accent: #5ea6f0; --accent-bg: #2f6fb3;
  --err: #f28b82; --ok: #3ccf7f;
  --field-line: #434a53; --hover: #2d343d; --mixink: #ffffff; --side-bg: #22262c; --bubble: #323840; --col: #1f2328;
  --row-line: #30353c; --head-bg: #2a2f35; --note-bg: #3b3222; --note-ink: #f0c674; --err-bg: #46292b;
  --digest-bg: #322e26; --digest-line: #5c4f33; --mark-bg: #3d2f22; --mark-ink: #f0b27a; --mark-line: #6b4a2e;
  --on-bg: #1d3a2b; --on-line: #2f6b4a; --seg-on: #1d3a2b; --focus: #2b4a6b; --pale: #24344a; --spam-bg: #3a2526;
  --dot: #59626c; --zero: #7f8994; --chip-ink: 58%; --tt-ink: 62%; --pillbg: rgba(0,0,0,.35); --sys-ink: #aab3bd; --who-ink: #c3cad2;
  --rail-hover: #22262b; --seg-on-ink: #4fd18b; --tab-on: #4fd18b; --img-op: .92; --menu-bg: #1b1e22; --menu-hover: #2c3239;
  --bubble-shadow: none; --pop-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .4); --card-shadow-h: 0 2px 8px rgba(0, 0, 0, .55);
  --th-moon: none; --th-sun: inline-flex; --map-ctrl: invert(1) hue-rotate(180deg) brightness(.9);
  --score-good: #23804f; --score-mid: #93641c; --score-bad: #c0473b; --hot-bg: #3d2f22; --hot-ink: #f0b27a; --tr-m: #24344a; --tr-c: #2c3238;
}
:root[data-theme="light"] { color-scheme: light; }
img { opacity: var(--img-op); }

/* ---------- телефон ---------- */
@media (max-width: 820px) {
  body.app { display: block; padding-bottom: 62px; }
  .rail, .subnav, .top .who, .top .new { display: none; }
  .top { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .brand { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .gsearch { flex: 1 1 100%; width: auto; margin: 0; order: 3; }
  .gsearch input { min-height: 38px; }
  .tog { min-height: 36px; }
  .listpage { padding: 10px 10px 20px; }
  .lp-top { gap: 8px; }
  .lp-top h1 { font-size: 21px; flex: 1 1 100%; }
  .lp-actions { margin-left: 0; width: 100%; }
  .lp-actions .seg { margin-left: auto; }
  .vtabs.mob { display: flex; gap: 6px; overflow-x: auto; margin: 0 -10px 10px; padding: 0 10px 2px; scrollbar-width: none; }
  .vtabs.mob a { flex: none; padding: 7px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink);
    white-space: nowrap; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
  .vtabs.mob a.on { background: var(--green); border-color: var(--green); color: #fff; }
  .fsearch, .filters > select { flex: 1 1 100%; }
  .fpanel { flex: 1 1 100%; }
  .fpanel summary { width: 100%; justify-content: center; }
  .savef { flex-direction: column; }
  .tbox { background: transparent; border: 0; }
  table.tasks, table.tasks tbody { display: block; }
  table.tasks thead { display: none; }
  table.tasks tr { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num chip" "ttl ttl" "who who";
    gap: 4px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
  table.tasks td { display: block; padding: 0; border: 0; min-width: 0; }
  table.tasks td.num { grid-area: num; width: auto; }
  table.tasks td:nth-child(3) { grid-area: chip; justify-self: end; }
  table.tasks td.ttl { grid-area: ttl; min-width: 0; font-size: 15px; }
  table.tasks td.who { grid-area: who; font-size: 13px; }
  table.tasks td.opt { display: none; }
  table.tasks tr.empty { display: block; }
  .board { margin: 0 -10px; padding: 0 10px 10px; scroll-snap-type: x mandatory; }
  .bcol { flex-basis: 82vw; scroll-snap-align: start; max-height: none; }
  .card { display: flex; flex-direction: column; min-height: 0; }
  .card-head { padding: 10px 12px; }
  .card-head h1 { font-size: 20px; }
  .card-side { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); padding: 4px 12px 14px; }
  .side-title { font-size: 18px; margin-top: 8px; }
  .feed { padding: 10px 12px 0; }
  .composer { bottom: 60px; }
  .bubble { max-width: 100%; }
  .accept { width: 100%; min-height: 44px; }
  .head-row form:has(.accept) { width: 100%; }
  .grid2, .profile, .adduser { grid-template-columns: 1fr; }
  .profile, .uact { padding-left: 4px; }
  button, .btn, input, select { min-height: 44px; }
  .btn.sm, button.sm, .toolbar button, .seg a { min-height: 40px; }
  .gsearch input, .fsearch input { min-height: 40px; }
  .sheet { margin: 0; border-radius: 0; border: 0; padding: 14px 12px; }
  .totals { grid-template-columns: 1fr; }
  .fgrid, .grid3, .qgrid { grid-template-columns: 1fr; }
  table.grid td.sm { width: 70px; }
  table.set input[name=value], table.set input[name=name] { min-width: 170px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--panel); border-top: 1px solid var(--line);
    z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted);
    font-size: 11px; position: relative; text-decoration: none; }
  .tabbar a.on { color: var(--tab-on); }
  .tabbar .cnt { position: absolute; top: 6px; left: 55%; margin: 0; }
}

/* ---------- Блок 3: контроль, рейтинг, кабинет менеджера, сводка ---------- */
.rcbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 10px 16px 0;
  padding: 10px 12px; border-radius: var(--radius); background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--digest-line); }
.rcbar > span:first-of-type { flex: 1 1 260px; }
.rcbar svg { flex: none; }
.recheckbox { border-left: 4px solid var(--warn); }
.rcrow { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.totals.two { grid-template-columns: 2fr 1fr; }
.totals.two .tot:first-child .nums { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.totals.two .tot:last-child .nums { grid-template-columns: repeat(3, 1fr); }
.ratingline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.periods { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin-bottom: 10px; }
.periods .pp input { width: auto; max-width: 160px; }
.presets { margin-bottom: 14px; }
.summary td.up { color: var(--ok); font-weight: 600; } .summary td.down { color: var(--err); font-weight: 600; }
.snoozebtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.snoozebtns form { margin: 0; } .snoozebtns button { width: 100%; min-height: 52px; display: flex; flex-direction: column; align-items: center; }
.snoozebtns small { color: var(--muted); font-size: 12px; }
.mtot { margin-bottom: 10px; }
.ctlbox h3 { font-size: 15px; margin: 12px 0 6px; }
@media (max-width: 820px) {
  .totals.two { grid-template-columns: 1fr; }
  .periods .pp input { max-width: 140px; }
  .rcbar { margin: 8px 8px 0; }
  .sheet-head { flex-wrap: wrap; }
}

/* модуль «Документы»: форма преддоговора */
.predd .from { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; background: var(--on-bg); color: var(--ok); }
.predd .from.none { background: var(--err-bg); color: var(--err); }
.predd .from.manual { background: var(--line); color: var(--ink); }
.warnmsg { background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--digest-line); padding: 8px 10px; border-radius: 6px; margin: 6px 0; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; }
ul.plain li { padding: 3px 0; overflow-wrap: anywhere; }
details.box summary { cursor: pointer; list-style: revert; }
h2.inline { display: inline; font-size: inherit; }
.predd .sticky-actions { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0; border-top: 1px solid var(--line); }

/* ---------- v0.9.3: телефон как приложение ПланФикса — хроника, заявка-чат, шторки снизу ---------- */
.mbar, .mdet, .fcards, .maccept, .cmp-plus, .det-back, .side-title .mclose, .mtitle, .att-opt, .attach .m-lbl { display: none; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button.status-btn { color: var(--ink); cursor: pointer; }
button.status-btn:hover { background: color-mix(in srgb, var(--c) 24%, var(--panel)); border-color: var(--c); }
.status-btn .ic { margin-left: 1px; opacity: .6; }
.mclose { border: 0; background: none; min-height: 36px; padding: 0 6px; color: var(--muted); }
.mclose:hover { background: var(--soft); }
.mfoot { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 0 14px; z-index: 2; }
.mfoot .composer { position: static; border-top: 0; padding: 0; background: transparent; }
.composer .cmp-extra, .composer .cmp-extra .bs-panel { display: contents; }
.cmp-extra .bs-back, .cmp-extra .bs-head, .cmp-extra .bs-done { display: none; }
.files { margin-top: 6px; }
.filerow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 5px 0; }
.filerow a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }

/* шторки: на компьютере — окно по центру, на телефоне — снизу */
.bsheet { display: none; position: fixed; inset: 0; z-index: 50; }
.bsheet.open { display: flex; align-items: center; justify-content: center; }
.bs-back { position: absolute; inset: 0; background: rgba(15, 20, 25, .45); }
.bs-panel { position: relative; background: var(--panel); border-radius: 12px; width: min(480px, 100%); max-height: 86vh;
  overflow-y: auto; padding: 12px 16px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.bs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 16px; }
.st-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.st-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 48px; }
.st-row input { position: absolute; opacity: 0; pointer-events: none; }
.st-row i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.st-row:hover { background: var(--soft); }
.st-row:has(input:checked) { background: color-mix(in srgb, var(--c) 15%, var(--panel)); font-weight: 600; }
.st-row:has(input:checked)::after { content: "✓"; margin-left: auto; color: color-mix(in srgb, var(--c) 75%, var(--mixink)); font-weight: 700; }
.st-row:has(input:focus-visible) { outline: 2px solid var(--focus); }
.stsheet .need { color: var(--ink); font-weight: 600; }
.bs-save { width: 100%; min-height: 46px; margin-top: 8px; }
.bs-menu .bs-panel { background: var(--menu-bg); color: #e9ecef; padding: 6px 0; }
.bs-menu .bs-panel > * { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 22px; border: 0; border-radius: 0;
  background: none; color: inherit; text-transform: uppercase; font-size: 13.5px; letter-spacing: .04em; min-height: 52px;
  justify-content: flex-start; text-decoration: none !important; }
.bs-menu .bs-panel > *:hover { background: var(--menu-hover); }
.bs-menu .bs-panel .ic { color: #aab2bb; }

/* хроника событий */
.chronicle { max-width: 760px; margin: 0 auto; padding: 16px 16px 30px; }
.chr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chr-top h1 { margin: 0; }
.chr { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, .06); color: var(--ink); overflow: hidden; text-decoration: none !important; }
.chr-main { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 10px; color: var(--ink); text-decoration: none !important; }
.chr-sys { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.chr-head { display: flex; align-items: center; gap: 10px; }
.chr-head .ava { width: 40px; height: 40px; font-size: 14px; }
.ava.sys { background: var(--orange-bg); }
.chr-who { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.chr-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chr-who small { color: var(--muted); font-size: 12px; }
.chr-cnt { display: none; min-width: 20px; height: 20px; border-radius: 10px; background: var(--orange-bg); color: #fff; font-size: 11.5px;
  text-align: center; line-height: 20px; padding: 0 6px; flex: none; }
.chr.is-new .chr-cnt { display: inline-block; }
.chr-title { font-size: 15.5px; line-height: 1.3; margin-top: 5px; overflow-wrap: anywhere; }
.chr-sub { font-size: 12px; color: var(--muted); }
.chr-text { font-size: 14px; color: var(--ink); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; }
.chr-acts { display: flex; gap: 2px; border-top: 1px solid var(--row-line); padding: 2px 6px; }
.chr-acts > a:first-child { margin-right: auto; }
.chr-acts a, .chr-acts button { display: inline-grid; place-items: center; width: 44px; height: 40px; min-height: 40px; color: var(--muted);
  border: 0; background: none; padding: 0; border-radius: 8px; }
.chr-acts a:hover, .chr-acts button:hover { background: var(--soft); color: var(--ink); }
.chr-acts form { margin: 0; }
.chr-read { display: none; }
.chr.is-new .chr-read { display: block; }
.chr-empty { color: var(--muted); text-align: center; padding: 30px 10px; }

@media (max-width: 820px) {
  .d-only { display: none !important; }
  input, select, textarea { font-size: 16px; }   /* меньше 16px — iPhone увеличивает страницу при вводе */
  body.app { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  body.noscroll { overflow: hidden; }
  .top { padding-top: calc(8px + env(safe-area-inset-top)); }
  .top .brand { display: none; }
  .mtitle { display: block; flex: 1; min-width: 0; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { height: calc(60px + env(safe-area-inset-bottom)); }
  .tabbar .cnt { background: var(--orange-bg); }
  .chronicle { padding: 10px 10px 20px; }
  .chr-top h1 { display: none; }
  .chr-top .seg { width: 100%; }
  .chr-top .seg a { flex: 1; justify-content: center; }

  /* заявка: свой верх «← название», без общей шапки и нижних вкладок */
  body.cardview { padding-bottom: 0; }
  body.cardview .tabbar, body.cardview .top { display: none; }
  .card { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
  .mbar { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 8; background: var(--panel);
    border-bottom: 1px solid var(--line); padding: calc(4px + env(safe-area-inset-top)) 4px 4px; min-height: 54px; }
  .mback, .mico { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; color: var(--ink);
    border: 0; background: none; padding: 0; flex: none; }
  .mbar-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
  .mbar-tt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar-tt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-head { padding: 8px 12px; background: var(--panel); }
  .card-head .back, .card-head .crumbs, .card-head > h1 { display: none; }
  .head-row { gap: 6px; }
  .status-btn { min-height: 38px; padding: 2px 14px; border-radius: 19px; }
  .mdet { display: inline-flex; margin-left: auto; min-height: 38px; border-radius: 19px; padding: 2px 12px; color: var(--accent); border-color: var(--line); }
  .card-head .note { font-size: 13px; margin-top: 8px; }

  /* «Детали» — шторка снизу: поля белыми карточками на сером, подпись серым, значение синим */
  .card-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; max-height: 88vh; max-height: 88dvh; z-index: 31;
    border: 0; border-radius: 14px 14px 0 0; background: var(--bg); padding: 0 12px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; overflow-y: auto; }
  .card.det-open .card-side { transform: none; visibility: visible; transition: transform .22s ease; }
  .det-back { display: none; position: fixed; inset: 0; background: rgba(15, 20, 25, .45); z-index: 30; }
  .card.det-open .det-back { display: block; }
  .side-title { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 14px 0 6px; margin: 0; font-size: 18px; font-weight: 600; }
  .side-title::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--dot); }
  .side-title .mclose { display: inline-grid; place-items: center; min-height: 40px; }
  .card-side .statusbox, .card-side form.fields { display: none; }
  .card-side .drow, .card-side .pr.inline, .card-side .pr-edit, .card-side .related { background: var(--panel); border: 0; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; }
  .fcards { display: block; }
  .fcards .fblock h2, .files h2 { margin: 14px 2px 6px; }
  .fcard { display: block; background: var(--panel); border-radius: 8px; margin-bottom: 6px; }
  .fcard > summary, .fcard.ro { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 8px 12px; min-height: 52px; list-style: none; cursor: pointer; }
  .fcard.ro { cursor: default; }
  .fcard > summary::-webkit-details-marker { display: none; }
  .fcard .val { color: var(--accent); font-size: 15px; overflow-wrap: anywhere; }
  .fcard.ro .val { color: var(--ink); }
  .fcard[open] > summary .val { display: none; }
  .fcard form { padding: 0 12px 12px; }
  .fcard .fld { margin: 0; }
  .fc-btns { display: flex; gap: 8px; margin-top: 8px; }
  .fc-btns .primary { flex: 1; }
  .filerow { padding: 8px 12px; }

  /* лента — чат: пузыри на сером, строка комментария всегда внизу */
  .feed { flex: 1; padding: 10px 10px 0; background: var(--bg); }
  .feed > ul { margin-bottom: 8px; }
  .ev { padding: 5px 0; }
  .ev .ava { width: 32px; height: 32px; font-size: 12px; }
  .ev-dot { width: 32px; }
  .ev-comment .bubble { background: var(--panel); border-radius: 4px 14px 14px 14px; box-shadow: var(--bubble-shadow); }
  .ev:not(.ev-comment) { font-size: 12.5px; }
  .mfoot { margin: 0 -10px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 9; }
  .maccept { display: block; margin: 2px 0 6px; }
  .maccept .accept { width: 100%; min-height: 52px; font-size: 17px; border-radius: 10px; }
  .composer { flex-direction: row; align-items: flex-end; gap: 6px; }
  .cmp-plus { display: inline-grid; place-items: center; position: relative; width: 44px; height: 44px; border-radius: 50%; padding: 0; flex: none; color: var(--muted); }
  .cmp-plus .fcount { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--green);
    color: #fff; font-size: 11px; line-height: 18px; padding: 0 4px; }
  .cmp-plus .fcount:empty { display: none; }
  .composer textarea { flex: 1; min-width: 0; min-height: 44px; height: 44px; max-height: 140px; border-radius: 22px; padding: 10px 14px; resize: none; }
  .composer .send { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; }
  .composer .send span { display: none; }
  .composer .cmp-extra { display: none; }
  .composer .cmp-extra.open { display: flex; }
  .cmp-extra .bs-back { display: block; }
  .cmp-extra .bs-head { display: flex; }
  .composer .cmp-extra .bs-panel { display: flex; flex-direction: column; gap: 10px; }
  .cmp-extra .bs-done { display: inline-flex; width: 100%; min-height: 46px; }
  .att-opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
  .att-opt input, .cmp-extra .attach input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .cmp-extra .attach { position: relative; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); font-size: 14px; gap: 10px; }
  .cmp-extra .attach > span:not(.m-lbl) { display: none; }
  .cmp-extra .attach .m-lbl { display: inline; }
  .recips { gap: 6px; }

  /* шторки на телефоне — снизу */
  .bsheet.open { align-items: flex-end; }
  .bs-panel { width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 14px 14px 0 0; padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); animation: bsup .2s ease; }
  .bs-menu .bs-panel { padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
}
@keyframes bsup { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
/* модуль calls: звонки, сообщения и разбор в ленте */
.calls-audio { display: block; width: 100%; max-width: 420px; height: 36px; margin-top: 6px; }
.calls-msg.out { border-left: 3px solid var(--ok); }
.calls-tr { margin-top: 6px; max-width: 760px; }
.calls-tr summary, .calls-check summary { cursor: pointer; color: var(--muted); min-height: 28px; }
.calls-tr .txt { white-space: pre-wrap; font-size: 14px; }
.calls-note { font-size: 13px; margin-top: 4px; }
.calls-ai .ck { display: inline-block; width: 1.2em; font-weight: 700; }
.calls-ai .ck.ok { color: var(--ok); } .calls-ai .ck.no { color: var(--err); } .calls-ai .ck.na { color: var(--muted); }
.calls-prop { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--digest-line); }
/* v0.32 (голосовое заказчика 29.10): на компьютере верх заявки (адрес, статус, кнопки) закреплён — лента комментариев
   прокручивается под ним. Липкий элемент сетки держится в пределах всей карточки (.card), а не своей клетки. */
@media (min-width: 821px) {
  .card-head { position: sticky; top: 48px; z-index: 4; background: var(--panel); align-self: start;
    max-height: 60vh; overflow-y: auto; box-shadow: 0 6px 8px -8px rgba(20, 30, 40, .25); }
  .card-head .back { margin-bottom: 0; }
  .card-head h1 { margin-bottom: 8px; }
}
/* v0.32: доска (канбан) — свернуть столбец, ширина мышью, перетаскивание */
.bcol header .bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bfold { border: 0; background: transparent; min-height: 24px; width: 24px; padding: 0; color: inherit; transform: rotate(90deg); flex: none; }
.bfold:hover { background: var(--pillbg); }
.bcol.folded { flex-basis: 46px; max-width: 46px; }
.bcol.folded header { flex-direction: column; justify-content: flex-start; padding: 8px 4px; height: 100%; border-radius: var(--radius); }
.bcol.folded header .bname { writing-mode: vertical-rl; white-space: nowrap; overflow: visible; }
.bcol.folded .bfold { transform: none; }
.bcol.folded .bcards, .bcol.folded .bcrs { display: none; }
.bcrs { position: absolute; top: 0; right: -7px; width: 10px; height: 100%; cursor: col-resize; z-index: 2; }
.bcrs:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 4px; }
.bcard[draggable="true"] { cursor: grab; }
.bcard.dragging { opacity: .45; }
.bcol.dropok { outline: 2px dashed var(--accent); outline-offset: -2px; }
.bcol.folded.dropok { max-width: 120px; }
/* v0.32.1: карточку тянут пальцем — копия под пальцем («поднята»), страница под ней не двигается, доска без «прилипания» */
.bghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; margin: 0; opacity: .96; will-change: transform;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28); touch-action: none; }
.bdragging, .bdragging body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bdragging .board { scroll-snap-type: none; }
@media (pointer: coarse) { .bcard[data-bmove] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
@media (max-width: 820px) { .bcrs { display: none; } .bcol.folded { flex-basis: 46px; scroll-snap-align: none; }
  .bfold { min-height: 36px; width: 36px; } }
/* v0.32 (фото заказчика 29.10): левая полоса на компьютере — подписи при наведении, у «Заявок» и «Кабинета» —
   выпадающий список разделов (как «Ещё» на телефоне), внизу «Ещё» */
.rail-it { position: relative; }
.rail nav > a:hover > span, .rail nav > a:focus-visible > span { display: block; position: absolute; left: calc(100% + 6px);
  top: 50%; transform: translateY(-50%); background: var(--menu-bg); color: #fff; font-size: 13px; padding: 5px 10px;
  border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: var(--pop-shadow); z-index: 20; }
.rail-fly { display: none; position: absolute; left: 100%; top: 0; z-index: 20; min-width: 250px; padding: 6px 0 6px;
  background: var(--menu-bg); border-radius: 0 8px 8px 0; box-shadow: var(--pop-shadow); }
.rail-it:hover > .rail-fly, .rail-it:focus-within > .rail-fly { display: block; }
.rail-fly > b { display: block; color: #fff; font-size: 14px; padding: 6px 16px 8px; }
.rail nav .rail-fly a { display: flex; align-items: center; gap: 10px; height: auto; min-height: 36px; padding: 6px 16px;
  color: #e3e7ec; box-shadow: none; place-items: initial; }
.rail nav .rail-fly a span { display: inline; }
.rail nav .rail-fly a:hover { background: var(--menu-hover); color: #fff; }
.rail nav .rail-fly .ic { color: #aab2bb; }
/* v0.32: справочники как в ПланФиксе — папки слева, таблица записей справа */
.dgrid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.dtree { display: flex; flex-direction: column; gap: 2px; background: var(--soft); border-radius: var(--radius); padding: 8px; }
.dtree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none !important; }
.dtree a:hover { background: var(--hover); }
.dtree a.on { background: var(--green); color: #fff; }
.dtree a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfolder > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 4px 2px; text-transform: uppercase; letter-spacing: .04em; }
.dfolder > a { padding-left: 18px; }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dhead h2 { margin: 0; font-size: 18px; }
table.drt th, table.drt td { vertical-align: middle; }
table.drt .dfrow th { padding-top: 0; }
table.drt .dfrow input, table.drt .dfrow select { min-height: 30px; padding: 3px 7px; font-weight: 400; }
table.drt tr.off td { color: var(--muted); text-decoration: line-through; }
table.drt tfoot td { border-top: 2px solid var(--line); background: var(--soft); }
.dnew .colform { width: 320px; }
.req { color: var(--err); }
.drecs, .bform > * { min-width: 0; }
@media (max-width: 820px) {
  .dgrid { grid-template-columns: 1fr; }
  table.drt .dfrow input, table.drt .dfrow select { min-height: 40px; min-width: 90px; }
}
/* v0.32: доска уведомлений */
.bform { display: grid; gap: 10px; }
.bwhen { display: flex; flex-wrap: wrap; gap: 10px; }
.bwhen .fld { flex: 1 1 180px; }
.bform input.num { width: 56px; display: inline-block; text-align: center; }
.bstaff summary { cursor: pointer; color: var(--accent); margin-top: 6px; }
form.inl { display: inline; }
/* v0.32: «Исполнитель» в «Деталях» — нажатием (передать / назначить) */
details.asgbox { display: block; }
details.asgbox > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
details.asgbox > summary::-webkit-details-marker { display: none; }
.asg-ed { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; color: var(--accent); font-size: 12.5px; }
details.asgbox[open] .asg-ed { display: none; }
details.asgbox > form { margin-top: 6px; }
/* v0.32: разбор звонка свёрнут в одну строку — резюме и «Подробнее» */
.calls-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; min-height: 28px; }
.calls-fold > summary::-webkit-details-marker { display: none; }
.calls-fold .cf-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls-fold .cf-more { flex: none; color: var(--accent); font-size: 13px; }
.calls-fold .cf-more::after { content: " ▾"; }
.calls-fold[open] .cf-more { display: none; }
.calls-fold[open] > summary { margin-bottom: 6px; }
.calls-fold[open] .cf-line { white-space: normal; }
.calls-fold:not([open]) { padding-top: 6px; padding-bottom: 6px; }
.calls-prop .btnrow { margin-top: 6px; }
.calls-prop input[type=datetime-local] { width: auto; min-height: 36px; }

/* отклик на нажатие (аудит 18.10): полоса сверху, пока грузится следующая страница; строки и карточки темнеют под пальцем */
.leaving body::after { content: ""; position: fixed; top: 0; left: 0; z-index: 9999; height: 3px; width: 100%;
  background: var(--accent); transform-origin: left; animation: leaving 1.2s ease-out forwards; pointer-events: none; }
@keyframes leaving { from { transform: scaleX(.05); } to { transform: scaleX(.85); } }
tr[data-href]:active td, .bcard:active, .chr:active { background: var(--pale); }

/* ---------- v0.12: экран «Новая заявка» во весь экран (поверх страницы) и блок включения push ---------- */
.offer-full, .pask { position: fixed; inset: 0; z-index: 1000; background: var(--panel); display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; }
.offer-full.offer-page { position: static; min-height: calc(100vh - 140px); background: transparent; }
.offer-in { width: 100%; max-width: 440px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.offer-lbl { font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.offer-num { font-size: 56px; font-weight: 700; line-height: 1.05; }
.offer-num.sm { font-size: 26px; font-weight: 600; }
.offer-sub { color: var(--muted); font-size: 15px; }
.offer-timer { font-size: 64px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tab-on); line-height: 1; margin-top: 14px; }
.offer-timer.low { color: var(--err); }
.offer-in form { width: 100%; margin-top: 18px; }
.offer-btn { width: 100%; min-height: 96px; font-size: 32px; font-weight: 700; border-radius: 18px;
  background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 20px rgba(27, 134, 83, .35); }
.offer-btn:hover { background: var(--green-h); border-color: var(--green-h); }
.offer-hide { margin-top: 8px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; }
.offer-gone { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.offer-gone[hidden] { display: none; }
body:has(.offer-full:not(.offer-page)), body:has(.pask:not([hidden])) { overflow: hidden; }
.pushbox .btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pushbox .pstate { margin: 0 0 8px; }
.pushbox .pstate.on { color: var(--ok); }
@media (max-width: 820px) {
  .pushbox .btnrow button { flex: 1 1 100%; min-height: 44px; }
  .offer-full.offer-page { min-height: calc(100vh - 160px); }
}

/* ---------- v0.12.1: массовое изменение в списке, пауза распределения в кабинете ---------- */
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; margin: 0 0 10px;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.bulkbar.on { background: var(--pale); border-color: var(--accent); }
.bulkbar select, .bulkbar input:not([type=checkbox]) { width: auto; max-width: 260px; }
.bulkbar .bfld .fld { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.bulkbar .bcount { color: var(--muted); }
.tasks th.sel, .tasks td.sel { width: 34px; text-align: center; cursor: pointer; }
.tasks td.sel input, .tasks th.sel input { width: 18px; height: 18px; }
.bulkmsg { margin: 0 0 10px; }
.qpause { margin: 0 0 12px; }
.qpause .note { margin: 0 0 8px; }
@media (max-width: 820px) {
  .bulkbar { flex-direction: column; align-items: stretch; }
  .bulkbar select, .bulkbar input:not([type=checkbox]), .bulkbar button { max-width: none; width: 100%; min-height: 44px; }
  .bulkbar .bfld .fld { display: flex; flex-direction: column; align-items: stretch; }
  .qpause .btnrow { flex-direction: column; }
  .qpause button { width: 100%; min-height: 44px; }
}

/* ---------- v0.12.2: уведомления почти сами — плашка «на экран „Домой“» и экран «Включите уведомления» ---------- */
.pask[hidden], .pinstall[hidden], .pin-android[hidden], .pin-ios[hidden] { display: none; }
.pask { z-index: 999; }
.pask-ic { width: 72px; height: 72px; color: var(--tab-on); }
.pinstall { position: relative; margin: 10px 12px 0; padding: 12px 40px 12px 14px; border-radius: 10px;
  background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--digest-line); }
.pinstall > b { display: block; margin-bottom: 6px; }
.pinstall ol { margin: 0; padding-left: 20px; }
.pinstall li { margin: 4px 0; }
.pin-ic { width: 20px; height: 20px; vertical-align: -4px; margin-left: 4px; color: var(--accent); }
.pin-x { position: absolute; top: 4px; right: 4px; min-height: 36px; min-width: 36px; border: 0; background: transparent;
  color: inherit; font-size: 22px; }
.pin-android .primary { width: 100%; min-height: 44px; margin: 4px 0; }
.pushsum { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius); }
.pushsum.warn { background: var(--note-bg); color: var(--note-ink); }
.pushsum.ok { background: var(--on-bg); }
.pbadge { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; padding: 2px 8px;
  border-radius: 12px; white-space: nowrap; }
.pbadge.on { background: var(--on-bg); color: var(--ok); }
.pbadge.off { background: var(--note-bg); color: var(--note-ink); }
.pask .offer-in { min-width: 0; }
.pask .offer-btn { white-space: normal; font-size: 24px; min-height: 76px; padding: 10px 16px; }
.pask .offer-num.sm { overflow-wrap: anywhere; }

/* ---------- v0.15: механизмы ПланФикса — столбцы и сортировка, массовое изменение, отметки, прозвон, уведомления ---------- */
.colpick { position: relative; }
.colpick > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.colpick > summary::-webkit-details-marker { display: none; }
.colform { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: min(520px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.colform .hint { margin: 0 0 8px; }
.colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; margin-bottom: 10px; }
.colgrid label { display: flex; gap: 6px; align-items: center; min-height: 28px; }
a.sorth { color: inherit; text-decoration: none; white-space: nowrap; }
a.sorth:hover { color: var(--ink); text-decoration: underline; }
a.sorth.on { color: var(--ink); font-weight: 600; }
table.tasks td.n { text-align: right; font-variant-numeric: tabular-nums; }
.bulkbar .ball { display: inline-flex; gap: 6px; align-items: center; }
.bulkbar .bfld.wide { flex: 1 1 100%; }
.bulkbar .bfld.wide textarea { width: 100%; }
.bulkbar .checks { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.qmarks { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 8px; scrollbar-width: none; }
.qmarks form { flex: none; margin: 0; }
.qm { min-height: 32px; padding: 3px 12px; border-radius: 16px; font-size: 13px; background: var(--soft); white-space: nowrap; }
.recallbox { margin: 10px 0 0; border-left: 4px solid var(--accent); background: var(--pale); padding: 8px 12px; border-radius: 4px; }
.recallbox .btnrow { margin-top: 8px; }
.recall .tabs { margin: 4px 0 12px; flex-wrap: wrap; }
.recall .tabs b { font-weight: 600; margin-left: 4px; }
.recall .ract .btnrow { flex-wrap: nowrap; gap: 6px; }
.recall .ract form { margin: 0; }
.nprefs summary { cursor: pointer; font-weight: 600; }
.nprefs form { margin-top: 8px; }
label.chk { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.okmsg.inline { display: inline-block; padding: 4px 8px; margin-left: 8px; }
.money .mtot { margin: 4px 0 8px; flex-wrap: wrap; }
@media (max-width: 820px) {
  table.tasks td.ttl:nth-child(3) { grid-area: ttl; justify-self: stretch; }
  table.tasks td.who:nth-child(3) { grid-area: who; justify-self: stretch; }
  table.tasks td.stc { grid-area: chip; justify-self: end; }
  .colpick { display: none; }
  .qm { min-height: 36px; font-size: 14px; }
  .qmarks { padding: 2px 0 6px; }
  .recall .ract .btnrow { flex-wrap: wrap; }
  .recall .ract .btn { min-height: 40px; }
  .recall .opt { display: none; }
}
.bs-menu .bs-panel > form { padding: 0; margin: 0; }
.bs-menu .bs-panel > form button { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 22px; border: 0;
  border-radius: 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit;
  text-align: left; min-height: 52px; }
.bs-menu .bs-panel > form button:hover { background: var(--menu-hover); }
/* ---------- v0.17: правка в списке, меню заголовка, импорт ---------- */
table.tasks td.ed { cursor: pointer; }
table.tasks td.ed:hover { box-shadow: inset 0 0 0 1px var(--accent); background: var(--pale); }
table.tasks td.ed.busy { opacity: .55; }
.edc { color: var(--muted); margin-left: 4px; font-size: 11px; }
table.tasks tr.flash td { animation: rowflash 1.6s ease-out; }
@keyframes rowflash { from { background: var(--on-bg); } to { background: transparent; } }
button.hbtn { border: 0; background: transparent; padding: 2px 0; min-height: 26px; color: inherit; font-size: inherit; gap: 4px; }
button.hbtn:hover { background: transparent; color: var(--ink); text-decoration: underline; }
button.hbtn.on { color: var(--ink); font-weight: 600; }
.hmenus { display: none; }
.popwrap { position: fixed; inset: 0; z-index: 60; }
.pop-back { position: absolute; inset: 0; background: transparent; }
.pop { position: absolute; width: 320px; max-width: calc(100vw - 16px); max-height: min(70vh, 520px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px;
  box-shadow: var(--pop-shadow); }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pop-head b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pop-head .mclose { border: 0; background: transparent; min-height: 30px; min-width: 30px; padding: 0; color: var(--muted); }
.pop .hint { margin: 6px 0; font-size: 12.5px; }
.pop .st-row { min-height: 40px; padding: 6px 10px; }
.pop .req .fld { margin: 6px 0; }
.pop .psave { margin-top: 10px; width: 100%; }
.pop .btnrow { display: flex; gap: 8px; margin-top: 10px; }
.pop input[type=search] { margin-bottom: 6px; }
.picks { display: flex; flex-direction: column; gap: 1px; max-height: 300px; overflow: auto; margin: 2px -4px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; min-height: 34px; }
.pick:hover { background: var(--soft); }
.pick:has(input:checked) { background: var(--seg-on); font-weight: 600; }
.pick .ava { margin-right: 0; }
.newval { display: flex; gap: 6px; margin-top: 8px; }
.newval input { flex: 1; min-width: 0; }
.qdates { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.hsort { display: flex; gap: 6px; margin-bottom: 8px; }
.hsort .btn { flex: 1; }
.hsort .btn.on { border-color: var(--green); background: var(--seg-on); }
.seg.op { display: flex; gap: 14px; margin: 2px 0 8px; }
.seg.op label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 30px; }
.hrange { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hform .btnrow { margin-top: 10px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; background: var(--seg-on);
  border: 1px solid var(--on-line); color: var(--ink); font-size: 13px; text-decoration: none !important; }
.fchip b { color: var(--muted); font-weight: 400; }
.fchip:hover b { color: var(--err); }
.colfilt { display: none; }
.imp .impopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 6px; }
.imp label.chk { min-height: 32px; }
.impbox { margin-top: 8px; }
table.imptab { margin: 0; font-size: 13px; }
table.imptab th { white-space: nowrap; }
table.imptab .impmap th { background: var(--panel); }
table.imptab .impmap select { min-width: 170px; font-size: 13px; }
table.imptab .impmap select.on { border-color: var(--green); background: var(--seg-on); }
table.imptab td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.imptab td.off { color: var(--zero); }
.impplan { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 8px; }
.impplan .ok b { color: var(--ok); }
.impplan .bad b { color: var(--err); }
.impplan.lg { font-size: 16px; gap: 8px 24px; margin: 8px 0 14px; }
.impplan.lg b { font-size: 22px; margin-left: 4px; }
.imperr { margin: 6px 0; }
.imperr summary { cursor: pointer; color: var(--muted); }
.impbtns { margin-top: 12px; gap: 8px; display: flex; }
.impres .btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 820px) {
  .colfilt.mob { display: flex; gap: 6px; overflow-x: auto; margin: -2px -10px 10px; padding: 0 10px 2px; scrollbar-width: none; }
  .colfilt .hbtn { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 5px 12px; min-height: 36px; text-decoration: none; }
  .colfilt .hbtn.on { border-color: var(--green); background: var(--seg-on); }
  .popwrap.sheetpop .pop-back { background: rgba(15, 20, 25, .45); }
  .popwrap.sheetpop .pop { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; max-height: 82vh;
    border-radius: 14px 14px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
  .popwrap.sheetpop .pick { min-height: 44px; }
  .popwrap.sheetpop .st-row { min-height: 46px; }
  .popwrap.sheetpop .picks { max-height: 50vh; }
  .popwrap.sheetpop button, .popwrap.sheetpop .btn { min-height: 40px; }
  body.popopen { overflow: hidden; }
  table.tasks td.stc.ed .chip { padding-top: 6px; padding-bottom: 6px; }
  table.tasks td.ed:hover { box-shadow: none; background: transparent; }
  .imp .impbtns { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
}

/* ---------- карта (v0.18, modules/maps): мини-карта в карточке, режим «Карта» у списка, крупная карта поверх ---------- */
.minimap { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mm-map { height: 150px; border-radius: 6px; overflow: hidden; border: 1px solid var(--field-line); background: var(--soft);
  cursor: zoom-in; }
.mm-map:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mm-map.mm-off { cursor: default; }
.mm-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.mapmodal { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .45); display: flex; padding: 32px; }
.mm-big { flex: 1; border-radius: 8px; overflow: hidden; background: var(--soft); }
.mm-close { position: absolute; top: 40px; right: 40px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--panel); color: var(--ink); font-size: 24px; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.mm-title { position: absolute; left: 50%; transform: translateX(-50%); top: 40px; max-width: calc(100% - 200px);
  background: var(--panel); color: var(--ink); padding: 6px 12px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.listmap { display: flex; flex-direction: column; gap: 6px; }
.lm-map { height: calc(100vh - 230px); min-height: 380px; border: 1px solid var(--field-line); border-radius: 6px;
  overflow: hidden; background: var(--soft); }
.lm-info { margin: 0; font-size: 13px; }
.lm-pop { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px; color: var(--ink); }
.lm-pop .btn { margin-top: 4px; }
.lm-pop .lm-tt { font-size: 15px; line-height: 1.3; padding-right: 18px; overflow-wrap: anywhere; }   /* v0.21: крупно адрес */
/* стиль MapLibre подключается после app.css — с «body» наши цвета темы сильнее */
body .maplibregl-popup-content { border-radius: 8px; padding: 10px 12px; background: var(--panel); color: var(--ink);
  box-shadow: var(--pop-shadow); }
body .maplibregl-popup-anchor-top .maplibregl-popup-tip, body .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
body .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel); }
body .maplibregl-popup-anchor-bottom .maplibregl-popup-tip, body .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
body .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel); }
body .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel); }
body .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel); }
body .maplibregl-popup-close-button { color: var(--muted); }
body .maplibregl-ctrl-group { background: var(--panel); }
body .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
body .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: var(--map-ctrl); }
body .maplibregl-ctrl.maplibregl-ctrl-attrib { background: var(--pillbg); color: var(--muted); }
body .maplibregl-ctrl-attrib a { color: var(--muted); }
body .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--panel); color: var(--ink); }
body .maplibregl-ctrl-attrib-button { filter: var(--map-ctrl); }
@media (max-width: 820px) {
  .mapmodal { padding: 0; }
  .mm-big { border-radius: 0; }
  .mm-close { top: 12px; right: 12px; }
  .mm-title { top: 12px; left: 64px; transform: none; max-width: calc(100% - 128px); }
  .card-side .minimap { background: var(--panel); border: 0; border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; }
  .lm-map { height: calc(100vh - 260px); min-height: 320px; margin: 0 -10px; border-radius: 0; border-left: 0; border-right: 0; }
}
.maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 20px; }
/* модуль calls: расшифровка репликами, оценка разговора, НейроРОП */
.tr-lines { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-width: 760px; }
.tr-lines p { margin: 0; padding: 6px 10px; border-radius: 8px; font-size: 14px; max-width: 92%; }
.tr-lines p b { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.tr-lines .tr-m { background: var(--tr-m); align-self: flex-end; }
.tr-lines .tr-c, .tr-lines .tr-x { background: var(--tr-c); align-self: flex-start; border: 1px solid var(--line); }
.ai-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.score { display: inline-block; padding: 1px 8px; border-radius: 10px; font-weight: 600; font-size: 13px; white-space: nowrap; color: #fff; }
.score small { font-weight: 400; opacity: .9; }
.score.good { background: var(--score-good); } .score.mid { background: var(--score-mid); } .score.bad { background: var(--score-bad); }
.flag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.flag.ok { color: var(--ok); border-color: var(--on-line); background: var(--on-bg); }
.flag.no { color: var(--err); border-color: var(--err); background: var(--err-bg); }
.flag.hot { color: var(--hot-ink); border-color: var(--mark-line); background: var(--hot-bg); }
.calls-ai .advice ul { margin: 0; padding-left: 18px; list-style: disc; }
.ev[id] { scroll-margin-top: 120px; }
.ev.hl > .ev-body { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.nrop-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0; }
.nrop-filter .fld { width: auto; min-width: 150px; }
.nrop .totals { display: block; }
.nrop .nums.nrop-nums { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nrop .nums.nrop-nums span { text-align: center; }
.nrop .nums a.warnbox b, .nrop-teaser .nums a.warnbox b { color: var(--err); }
.nrop-teaser .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nrop-teaser .nums a { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 6px; background: var(--soft); color: var(--ink); }
.nrop-teaser .nums b { font-size: 20px; } .nrop-teaser .nums span { font-size: 12px; color: var(--muted); text-align: center; }
.nrop h2 { margin-top: 18px; } .nrop h3 { font-size: 14px; margin: 0 0 6px; }
.nrop td.fails div { white-space: nowrap; font-size: 13px; }
.nrop td.sum { min-width: 260px; font-size: 13px; }
.nrop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nrop-list li { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel); display: grid; gap: 6px; justify-items: start; }
.nrop-list .nl-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.nrop-list .nl-why { display: flex; flex-wrap: wrap; gap: 4px; }
.nrop-list .nl-sum, .nrop-list .nl-adv { font-size: 13px; }
.nrop-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-bottom: 10px; }
.nrop-digest ul li { margin: 3px 0; }
@media (max-width: 820px) {
  .nrop .nums.nrop-nums { grid-template-columns: repeat(2, 1fr); }
  .nrop-teaser .nums { grid-template-columns: repeat(2, 1fr); }
  .nrop-two { grid-template-columns: 1fr; }
  .nrop-filter .fld { flex: 1 1 140px; min-width: 0; }
  .nrop-filter button { flex: 1 1 100%; min-height: 44px; }
  .nrop-list .btn.sm { min-height: 36px; }
  .tr-lines p { max-width: 100%; }
}

/* ---------- v0.20: тема «Как в системе / День / Ночь» — меню профиля у аватара, «Ещё» на телефоне, кнопка в шапке ---------- */
.rail-me { margin-top: auto; position: relative; }
.rail-me > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.rail-me > summary::-webkit-details-marker { display: none; }
.rail-me > summary:hover .ava, .rail-me[open] > summary .ava { box-shadow: 0 0 0 2px var(--green); }
.rail-me > summary:focus-visible { outline: 2px solid var(--focus); }
.me-menu { position: absolute; left: 50px; bottom: 2px; width: 268px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--pop-shadow); padding: 6px 0; z-index: 70; }
.me-head { display: flex; flex-direction: column; padding: 8px 14px 10px; border-bottom: 1px solid var(--line); }
.me-head b { font-weight: 600; overflow-wrap: anywhere; }
.me-head .muted { font-size: 12.5px; }
.me-menu .thpick { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.me-out { display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: var(--ink) !important; text-decoration: none !important; }
.me-out:hover { background: var(--soft); }
.thpick { margin: 0; }
.thpick .lbl { margin-bottom: 6px; }
.seg3 { display: flex; border: 1px solid var(--field-line); border-radius: 6px; overflow: hidden; background: var(--panel); }
.seg3 button { flex: 1 1 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 36px; padding: 4px 6px;
  gap: 5px; font-size: 13px; white-space: nowrap; }
.seg3 button + button { border-left: 1px solid var(--field-line); }
.seg3 button:hover { background: var(--soft); color: var(--ink); }
.seg3 button.on { background: var(--seg-on); color: var(--seg-on-ink); font-weight: 600; }
.thq { margin: 0; display: flex; }
.thbtn { border: 0; background: transparent; color: var(--muted); width: 34px; min-height: 34px; padding: 0; border-radius: 50%; }
.thbtn:hover { background: var(--soft); color: var(--ink); }
.thbtn .th-moon { display: var(--th-moon); }
.thbtn .th-sun { display: var(--th-sun); }
.menu .thpick { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 820px) {
  .thbtn { width: 40px; min-height: 40px; }
  /* на телефоне — во второй строке, справа от поиска: в первой место нужно заголовку и «Онлайн / В офисе» */
  .top .thq { order: 4; }
  .top .gsearch { flex: 1 1 calc(100% - 48px); }
  .seg3 button { min-height: 44px; font-size: 14px; }
}
/* в меню профиля три варианта — списком (в узкое меню рядом не помещаются) */
.me-menu .seg3 { flex-direction: column; border: 0; border-radius: 0; background: transparent; gap: 2px; }
.me-menu .seg3 button { justify-content: flex-start; gap: 10px; padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--ink); }
.me-menu .seg3 button + button { border-left: 0; }
.me-menu .seg3 button.on::after { content: "✓"; margin-left: auto; font-weight: 700; }
.me-menu .thpick { padding: 8px 6px 8px; }
.me-menu .thpick .lbl { padding: 0 8px; }

/* ---------- v0.21: видео заказчика 22.10 — «Действие» кнопкой, ширина мышью, сортировка на время, онлайн ---------- */
/* ширина мышью: полоска у правого края заголовка столбца и у края панелей; двойной щелчок — как было */
.panrs { position: absolute; top: 0; bottom: 0; right: 0; width: 7px; cursor: col-resize; z-index: 3; touch-action: none; }
.panrs.side { right: auto; left: 0; }
.panrs:hover, .resizing .panrs { background: color-mix(in srgb, var(--accent) 35%, transparent); }
table.tasks thead th { position: relative; }
.colrs { position: absolute; top: 4px; bottom: 4px; right: -1px; width: 9px; cursor: col-resize; touch-action: none; }
.colrs::after { content: ""; position: absolute; top: 2px; bottom: 2px; left: 4px; width: 1px; background: var(--line); }
.colrs:hover::after, .resizing .colrs::after { background: var(--accent); width: 2px; }
html.resizing, html.resizing * { cursor: col-resize !important; user-select: none; }
@media (min-width: 821px) {   /* на телефоне таблица — карточки, ширина столбцов не действует */
  table.tasks.sized { table-layout: fixed; width: var(--tw); }   /* v0.25: без растяжки на всю ширину — иначе тянутся все */
  table.tasks.sized td { overflow: hidden; overflow-wrap: anywhere; }
  table.tasks.sized td.ttl { min-width: 0; }
}
.thw { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.thw a.sorth { overflow: hidden; text-overflow: ellipsis; }
button.hbtn.hm { min-height: 22px; padding: 0 3px; opacity: .55; text-decoration: none; }
button.hbtn.hm:hover, button.hbtn.hm.on { opacity: 1; color: var(--accent); }
.tsnote { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.hmenu .hsort-t, .pop .hsort-t { margin: 0 0 6px; font-size: 12px; }

/* «Действие» — в ряд с «Создать / Импорт / Экспорт»; на кнопке число отмеченных */
.bulkpick > summary .bnum:not(:empty) { background: var(--panel); color: var(--green-h); border-radius: 9px; padding: 0 6px;
  font-size: 12px; line-height: 18px; }
.bulkform { width: min(420px, 92vw); display: flex; flex-direction: column; gap: 8px; }
.bulkform .pop-head { margin-bottom: 0; }
.bulkform .bsel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0; }
.bulkform .bsel .ball { display: inline-flex; gap: 6px; align-items: center; }
.bulkform .bcount { color: var(--muted); }
.bulkform > .hint { margin: 0; }
.bulkform select, .bulkform input:not([type=checkbox]):not([type=radio]), .bulkform textarea { width: 100%; max-width: none; }
.bulkform .bfld { display: block; }
.bulkform .bfld .fld { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.bulkform .checks { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.bulkform .mclose { border: 0; background: transparent; min-height: 30px; padding: 0 4px; }

/* «Сейчас в онлайне» в шапке */
.onl { position: relative; }
.onl > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 30px;
  padding: 2px 11px; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.onl > summary::-webkit-details-marker { display: none; }
.onl > summary i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.onl > summary b { color: var(--ink); }
.onl > summary:hover, .onl[open] > summary { border-color: var(--muted); }
.onl-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; max-height: 70vh; overflow: auto; background: var(--panel);
  color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--pop-shadow); padding: 6px 0; z-index: 70; }
.onl-head { display: flex; justify-content: space-between; gap: 8px; padding: 6px 14px 8px; border-bottom: 1px solid var(--line); }
.onl-row { display: flex; align-items: center; gap: 4px; padding: 7px 14px; }
.onl-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.onl-n small { font-size: 12px; }
.onl-s { font-size: 12px; color: var(--ok); background: var(--on-bg); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.onl-all { display: block; padding: 8px 14px 4px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 13px; }

/* уведомления: «Прочитано» у каждого */
.notif li { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.notif li > a { flex: 1; min-width: 0; border-bottom: 0; }
.notif .nread { display: flex; align-items: center; margin: 0; padding: 0 4px; }
.notif li.new .nread { background: var(--pale); }
.notif .nread button { color: var(--accent); white-space: nowrap; }

/* «Последняя активность» у сотрудника */
.urow .seen { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.urow .seen.now { color: var(--ok); }
.urow .seen + .pbadge { margin-left: 8px; }

@media (max-width: 820px) {
  .panrs, .colrs { display: none; }
  .bulkpick { display: block; }
  .bulkpick > summary { min-height: 40px; }
  .bulkform { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 85vh; max-height: 85dvh;
    overflow-y: auto; border-radius: 14px 14px 0 0; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); z-index: 40; }
  .bulkform select, .bulkform input:not([type=checkbox]):not([type=radio]), .bulkform button { min-height: 44px; }
  .onl-t { display: none; }
  .onl > summary { min-height: 36px; }
  .onl-menu { position: fixed; left: 8px; right: 8px; top: auto; width: auto; margin-top: 6px; }
  .notif .nread span { display: none; }
  .notif .nread button { min-height: 40px; min-width: 40px; }
  .urow summary { flex-wrap: wrap; }
  .urow .seen { margin-left: 44px; }
}
/* ---------- v0.21: настройка списка, столбцы, группы, карточка на доске ---------- */
.lsq { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.lp-top h1 .lsq, .listset h1 .lsq { width: 16px; height: 16px; margin-right: 9px; vertical-align: 1px; }
.lp-top h1 .lset { font-size: 13px; font-weight: 400; vertical-align: 4px; margin-left: 6px; }
.ltabs { margin: 4px 0 14px; }
.ltabs a { cursor: pointer; }
.listset section[data-pane] > .fld, .listset .grid2 { margin-bottom: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; }
.sw i { display: block; width: 30px; height: 30px; border-radius: 7px; background: var(--c); border: 2px solid transparent; }
.sw.none i { background: var(--soft); border: 1px dashed var(--field-line); }
.sw input:checked + i { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.sw input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 3px; }
.radios { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.accpick { max-width: 520px; }
.accpick .picks { max-height: 320px; }
.pickh { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 6px 2px; }
.lcrows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.lcrow, .colrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); }
.lcrow select { width: auto; min-width: 0; }
.lcrow select[name^=card_c_] { min-width: 180px; }
.lcmove { margin-left: auto; display: inline-flex; gap: 2px; }
.lcmove .x { min-height: 32px; min-width: 32px; padding: 0 6px; }
.lcprev { margin-top: 12px; }
.bcard.demo { max-width: 264px; pointer-events: none; }
.colform { min-width: 420px; }
.colrows { display: flex; flex-direction: column; gap: 4px; max-height: 56vh; overflow: auto; margin: 6px 0 10px; }
.colrow { padding: 3px 6px; gap: 8px; flex-wrap: nowrap; }
.colrow.off { opacity: .62; }
.colrow .cn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colrow .cw { width: 64px; min-height: 30px; padding: 2px 6px; }
.pinck { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; white-space: nowrap; font-size: 13px; }
/* закреплённые столбцы липнут к левому краю при прокрутке таблицы вбок (позиция — из <style> страницы) */
table.tasks.pinned tbody td, table.tasks.pinned thead th { background-clip: padding-box; }
table.tasks.pinned tbody tr:not(.grp) > td { background: var(--panel); }
table.tasks.pinned tbody tr:not(.grp):hover > td { background: var(--hover); }
table.tasks.pinned thead th { background: var(--head-bg); }
table.tasks tr.grp td { background: var(--soft); padding: 7px 10px; font-size: 13.5px; cursor: default; border-bottom: 1px solid var(--line); }
table.tasks tr.grp:hover { background: transparent; }
table.tasks tr.grp .gl { position: sticky; left: 10px; }   /* подпись группы видна при прокрутке таблицы вбок */
table.tasks.sized tr.grp td { overflow: visible; }          /* иначе .sized td (overflow: hidden) держит подпись в ячейке */
@media (min-width: 821px) {   /* строка таблицы — в одну строку, как в ПланФиксе: длинное обрезается, целиком — в заявке */
  table.tasks td.opt { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
}
table.tasks th.addc, table.tasks td.addc { width: 40px; padding: 4px 6px; }
.addbtn { min-height: 28px; width: 28px; padding: 0; justify-content: center; }
.addpicks .pick { border: 0; background: none; text-align: left; width: 100%; justify-content: flex-start; color: var(--ink); font: inherit; }
.addpicks .pick:hover { background: var(--soft); }
.bcard.cfg { gap: 2px; }
.bcard .bf { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bcard .bf.wr { white-space: normal; overflow-wrap: anywhere; }
.bcard .bf.sz-s { font-size: 12px; color: var(--muted); }
.bcard .bf.sz-l { font-size: 15px; line-height: 1.3; }
.bcard .bf.b { font-weight: 700; }
.bcard .bf em { font-style: normal; color: var(--muted); }
.bcard .bf .tt { font-weight: inherit; font-size: inherit; }
@media (max-width: 820px) {
  .colform { min-width: 0; }
  table.tasks tr.grp { display: block; padding: 8px 2px 2px; }
  table.tasks tr.grp td { display: block; background: transparent; border: 0; padding: 0; }
  .lp-top h1 .lset span { display: none; }
  .lcrow select[name^=card_c_] { min-width: 0; flex: 1 1 100%; }
  .lcmove .x { min-height: 40px; min-width: 40px; }
  .colrow .cw { min-height: 40px; }
}

/* ---------- v0.21: глобальный поиск — панель справа ---------- */
.gsearch input { cursor: text; }
.gsp { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 60; background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.gsp[hidden] { display: none; }
.gsp-form { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.gsp-form .fsearch { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 6px; padding: 0 10px; }
.gsp-form .fsearch input { border: 0; background: transparent; padding-left: 0; min-height: 36px; width: 100%; }
.gsp-form .fsearch input:focus { outline: none; }
.gsp-form .mclose { min-height: 36px; width: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.gsp-res { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }
.gsp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.gsp-tabs a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--field-line);
  border-radius: 6px; color: var(--muted); text-decoration: none !important; font-size: 13px; min-height: 30px; }
.gsp-tabs a b { font-weight: 600; font-size: 12px; }
.gsp-tabs a.on { background: var(--seg-on); color: var(--seg-on-ink); border-color: var(--on-line); font-weight: 600; }
.gsp-sub { font-size: 12.5px; margin: 0 0 6px; }
.gsp-empty { padding: 18px 4px; }
.gsp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gsp-row { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink) !important; text-decoration: none !important; }
.gsp-row:hover { background: var(--hover); }
.gsp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gsp-row .tt { font-size: 14.5px; line-height: 1.3; }
.gsp-snip { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.gsp-snip em { font-style: normal; color: var(--ink); }
.gsp mark, .gsp-page mark { background: var(--mark-bg); color: var(--mark-ink); border-radius: 2px; padding: 0 1px; }
.gsp-page .gsp-form { border: 0; padding: 0 0 10px; }
@media (max-width: 820px) {
  .gsp { width: 100vw; border-left: 0; box-shadow: none; }
  body.gspopen { overflow: hidden; }
  .gsp-form .fsearch input { min-height: 44px; font-size: 16px; }
  .gsp-form .mclose { min-height: 44px; width: 44px; }
  .gsp-tabs a { min-height: 38px; }
}

/* ---------- v0.21: избранное ---------- */
.card-head h1 .fav { display: inline-block; position: relative; vertical-align: 1px; margin-left: 6px; font-weight: 400; }
.fav > summary { list-style: none; cursor: pointer; font-size: 20px; color: var(--muted); min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.fav > summary::-webkit-details-marker { display: none; }
.fav > summary:hover { background: var(--soft); }
.favmenu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; display: flex; gap: 2px; padding: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); white-space: nowrap; }
.favmenu form { margin: 0; }
.favmenu button { min-height: 36px; min-width: 36px; padding: 0 6px; font-size: 18px; border: 0; background: transparent; border-radius: 6px; }
.favmenu button.on, .favmenu button:hover { background: var(--seg-on); }
.favmenu .unfav { font-size: 13px; color: var(--muted); }
.favi { margin-right: 4px; }
.mbar .fav { position: relative; }
.mbar .favmenu { left: auto; right: 0; }
@media (max-width: 820px) { .fav > summary { min-width: 40px; min-height: 40px; } .favmenu button { min-height: 44px; min-width: 44px; } }

/* ---------- v0.24: видео заказчика 22.10, блок D — подключения сотрудника, сотрудники в Манго ---------- */
.ibadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ibadge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--muted); background: var(--soft); white-space: nowrap; }
.ibadge.on { color: var(--ok); border-color: var(--on-line); background: var(--panel); }
.ibadge.used { color: var(--ok); border-color: var(--on-line); background: var(--on-bg); font-weight: 600; }
.ibadge small { font-weight: 400; opacity: .8; margin-left: 2px; }
.pbadge.used { font-weight: 600; }
.adduser .mcreate { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mprof { align-items: end; }
.mprof .mform { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; grid-column: 1 / -1; }
.mprof .mform .fld { margin: 0; max-width: 240px; }
.mprof > p { margin: 0; align-self: center; }
@media (max-width: 820px) {
  .ibadge { min-height: 28px; }
  .mprof .mform .fld { max-width: none; flex: 1 1 100%; }
  .mprof .mform button { min-height: 44px; }
}

/* ---------- v0.25: видео заказчика 23.10 ---------- */
/* «Добавить столбец»: поля столбиком, прокрутка вниз, вбок — нет */
.addpicks { overflow-x: hidden; overflow-y: auto; max-height: min(50vh, 360px); margin: 2px 0; }
.addpicks .pick { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; border: 0;
  background: transparent; min-height: 34px; font-weight: 400; }
.addpicks .pick:hover { background: var(--soft); }
/* фильтр списка — поля всех видов (карта и доска без заголовков столбцов) */
.fgrid .frange { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* v0.28: «Создать сотрудника» — кнопка рядом с заголовком, форма на своей странице */
.uhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.uhead h1 { margin: 0; }
.newuser { max-width: 720px; }
.newuser .mcreate small { display: block; margin-top: 2px; }
.newuser button.primary { margin-top: 6px; }
details.linkbox summary { cursor: pointer; }

/* v0.28 (видео заказчика 26.10): разделы настроек — списком слева (на компьютере) */
@media (min-width: 821px) {
  .sheet.settings:has(> nav.vtabs) { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .sheet.settings:has(> nav.vtabs) > * { grid-column: 2; }
  .sheet.settings:has(> nav.vtabs) > h1 { grid-column: 1 / -1; }
  .sheet.settings > nav.vtabs { grid-column: 1; grid-row: 2 / span 60; align-self: start; position: sticky; top: 70px;
    flex-direction: column; gap: 2px; border-bottom: 0; border-right: 1px solid var(--line); padding-right: 10px; overflow: visible; }
  .sheet.settings > nav.vtabs a { border-bottom: 0; border-radius: 6px; white-space: normal; }
  .sheet.settings > nav.vtabs a.on { background: var(--pale); }
  .sheet.settings > nav.vtabs a:hover { color: var(--ink); background: var(--pale); }
}
/* статус — одной строкой, «обязательно» и «куда перейти» раскрываются под ней */
.box.st { padding: 8px 12px; margin-bottom: 6px; }
.strow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.strow > .chip { display: none; }   /* название и цвет — в полях рядом, значок дублировал бы их */
.strow .stname { flex: 1 1 140px; min-width: 110px; }
.strow details.trans { margin: 0; border-top: 0; padding: 0; }
.strow details.trans summary { color: inherit; }
.strow .stcolor { width: 36px; height: 36px; padding: 2px; flex: none; }
.strow .storder { width: 64px; flex: none; }
.strow .stpop > summary { list-style: none; cursor: pointer; }
.strow .stpop > summary::-webkit-details-marker { display: none; }
.strow .stpop[open] { flex-basis: 100%; order: 10; }
.strow .stpop[open] > summary { background: var(--pale); }
.strow .stpop .checks { margin-top: 8px; }
.strow .stpop.trans .tscroll { margin-top: 8px; }


/* v0.31 — «Сотрудники | Группы» (видео заказчика 28.10) */
.uhead .utabs { margin-right: auto; }
.uhead .utabs small { color: var(--muted); font-weight: 400; }
.uhead .ubtns { gap: 6px; }
.grow .gava { background: var(--pale); color: var(--ink); }
.grow summary .un { flex: 1; min-width: 0; }
.gcount { min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
.gbody { padding: 0 4px 12px 44px; }
.gmembers { list-style: none; margin: 0 0 6px; padding: 0; }
.gmembers li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--row-line); }
.gmembers li .un { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gmembers li .un small { color: var(--muted); }
.gmembers li.off { opacity: .55; }
.gadd select { flex: 1 1 220px; min-width: 0; }
.gdel { margin-top: 4px; }
.newgroup { max-width: 720px; display: grid; gap: 12px; }
.gpick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 820px) {
  .uhead { align-items: stretch; }
  .uhead h1 { width: 100%; }
  .uhead .utabs { width: 100%; }
  .uhead .utabs a { flex: 1; justify-content: center; }
  .uhead .ubtns { width: 100%; }
  .uhead .ubtns .btn { flex: 1 1 140px; justify-content: center; }
  .gbody { padding-left: 4px; }
}
/* v0.31 — порядок правил: ↑ ↓ (выше — раньше) */
.rule-head .rmove { display: inline-flex; gap: 4px; }
.rule-head .rmove button { min-width: 36px; padding: 2px 8px; }
.rule-head .rmove button:disabled { opacity: .35; cursor: default; }
h3.rkind { margin: 14px 0 6px; font-size: 15px; color: var(--muted); }
/* v0.31 — кабинет: блок распределения по каждой группе */
.qbox h3.qgroup { margin: 14px 0 6px; font-size: 15px; }

/* ---------- v0.32 (голосовое заказчика 29.10): узкие шапки на телефоне — рабочее место максимальное ----------
   Верх — одна строка: название страницы (+ число заявок), «Онлайн / В офисе», «В онлайне», лупа поиска. Тема — в «Ещё».
   Список: вкладки и значки действий (Создать, Экспорт, Таблица / Доска / Карта) — одной строкой, поиск-лупа, статус,
   «Фильтр» и фильтры столбцов — второй строкой с прокруткой вбок. Заголовки листов переезжают в верхнюю строку (.h1up). */
.gs-ico { display: none; }
.lp-actions .ib .ic { flex: none; }
.fpanel summary .fp-n { font-weight: 600; }
.fpanel summary .fp-n::before { content: "· "; font-weight: 400; }
@media (max-width: 820px) {
  .top { flex-wrap: nowrap; height: 52px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 12px; gap: 6px; }
  .top .thq { display: none; }
  .top .gsearch { flex: none; width: auto; order: 0; margin: 0; padding: 0; border: 0; background: none; }
  .top .gsearch > .ic, .top .gsearch input { display: none; }
  .gs-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0;
    background: none; color: var(--ink); border-radius: 50%; }
  .gs-ico:hover { background: var(--soft); }
  .top .tog { min-height: 36px; padding: 2px 9px; font-size: 12.5px; }
  .top .presence { gap: 4px; }
  .mtitle { font-size: 16px; }
  .h1up { display: none !important; }
  .sheet-head:has(> .h1up:only-child) { display: none; }
  .sheet-head { margin-bottom: 8px; }
  .sheet-head:has(> .h1up) { justify-content: flex-end; }

  /* список заявок */
  .listpage { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; padding: 8px 10px 20px; }
  .listpage > * { flex: 1 1 100%; min-width: 0; }
  .listpage > .vtabs.mob { order: 1; flex: 1 1 140px; margin: 0 0 8px; padding: 0 0 2px; }
  .listpage > .lp-top { order: 2; flex: 0 1 auto; margin: 0 0 8px; }
  .listpage > :not(.vtabs):not(.lp-top) { order: 3; }
  .lp-top h1 { display: none; }
  .lp-top:has(.lset) h1 { display: block; flex: none; font-size: 0; }
  .lp-top h1 small, .lp-top h1 .lsq { display: none; }
  .lp-top .lset { font-size: 14px; }
  .lp-top .lset span { display: none; }
  .lp-actions { width: auto; gap: 6px; flex-wrap: nowrap; }
  .lp-actions .ib { width: 40px; min-height: 40px; padding: 0; }
  .lp-actions .ib span, .lp-actions .colpick:not(.bulkpick), .seg.mode a span, .lp-actions a[href="/import"] { display: none; }
  .lp-actions .bulkpick > summary span { display: none; }
  .lp-actions .bulkpick > summary { width: 40px; padding: 0; }
  .seg.mode a { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .vtabs.mob a { min-height: 36px; padding: 5px 11px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 8px; padding: 0 10px 2px; gap: 6px; align-items: center; }
  .filters::-webkit-scrollbar, .vtabs.mob::-webkit-scrollbar { display: none; }
  .filters:has(.fpanel[open]) { flex-wrap: wrap; overflow: visible; }
  .filters .fsearch { flex: none; width: 40px; height: 40px; padding: 0 11px; overflow: hidden; transition: width .15s; }
  .filters .fsearch input { width: 0; min-width: 0; padding: 0; }
  .filters .fsearch:focus-within, .filters .fsearch.has { width: 210px; }
  .filters .fsearch:focus-within input, .filters .fsearch.has input { width: 100%; }
  .filters > select { flex: none; width: 150px; min-height: 40px; padding: 4px 8px; }
  .filters .fpanel { flex: none; }
  .filters .fpanel summary { width: auto; min-height: 40px; padding: 0 11px; }
  .filters .fpanel:not([open]) summary .fp-t { display: none; }
  .filters .fpanel[open] { flex: 1 1 100%; }
  .filters .freset { flex: none; width: 40px; min-height: 40px; padding: 0; }
  .filters .freset span { display: none; }
  .filters .colfilt.mob { display: flex; flex: none; margin: 0; padding: 0; overflow: visible; }
  .filters .colfilt .hbtn { min-height: 40px; }
  .fchips { margin-bottom: 8px; }

  /* остальные страницы: строки отбора — одной строкой с прокруткой вбок */
  .nrop-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: flex-end; }
  .nrop-filter .fld { flex: none; width: 140px; min-width: 0; font-size: 12px; }
  .nrop-filter button { flex: none; width: auto; min-height: 44px; }
  .presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
  .presets .btn { flex: none; }
  .periods { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .periods > * { flex: none; }
  .chr-top { margin-bottom: 8px; }
  .chronicle { padding-top: 8px; }

  /* заявка: шапка поплотнее */
  .card-head { padding: 6px 10px; }
  .card-head .note { margin-top: 6px; padding: 5px 9px; font-size: 12.5px; }
  .status-btn, .mdet { min-height: 36px; }
}

/* v0.33.2: карточка «Общих заявок» — весь блок в цвет статуса. Цвет (--c) задан на самом блоке, как у .chip: светлый
   фон = цвет статуса на панели (в тёмной теме панель тёмная — фон тоже тёмный), цветная полоса слева; текст — обычный
   --ink, поэтому читается и в светлой, и в тёмной теме. */
.shared-card .shcard { background: color-mix(in srgb, var(--c) 13%, var(--panel)); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--c) 38%, var(--panel)); border-left: 6px solid var(--c);
  border-radius: var(--radius); padding: 12px 18px 6px; max-width: 640px; margin: 6px 0 10px; }
.shared-card .shcard h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.shared-card .shcard .drow { border-bottom-color: color-mix(in srgb, var(--c) 24%, var(--line)); }
.shared-card .shcard .drow:last-child { border-bottom: 0; }
.shared-card .shcard .stv { font-size: 15px; }
.shared-card .shnote { max-width: 640px; margin: 8px 0 12px; }
@media (max-width: 820px) {
  .shared-card .shcard { padding: 10px 14px 4px; border-left-width: 5px; }
}

/* v0.34: кабинет руководителя на один экран (1366×768 — с небольшой прокруткой). Лист прозрачный, панели — блоки; порядок
   блоков — по важности, на телефоне тот же, столбиком. Цвета — только токенами: тёмная тема работает сама. */
.sheet.wide.cabx { max-width: none; margin: 8px 12px 16px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.cabx .sheet-head { margin-bottom: 6px; flex-wrap: wrap; }
.cabx .sheet-head h1 { font-size: 20px; margin: 0; }
.cabx-more { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 14px; font-size: 13px; margin-left: auto; }
.cabx-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.cb { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; min-width: 0; }
.cb-money { grid-column: 1 / -1; }
.cb-leads { grid-column: span 7; }
.cb-calls { grid-column: span 5; }
.cb-chats { grid-column: span 4; }
.cb-people { grid-column: span 8; }
.cb-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; margin-bottom: 6px; }
.cb-h h2 { margin: 0; font-size: 15px; font-weight: 600; }
.cb-h .btnrow, .cb-h > .btn { margin-left: auto; }
.cb-at { font-size: 12px; }
.cb-off { margin: 4px 0; font-size: 13px; color: var(--muted); }
.cb-note { margin: 4px 0 0; font-size: 12px; }
.cb-dist { margin-left: auto; font-size: 13px; }
.cb-wait { font-size: 13px; }
.cb-wait a { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.cb a.zero { color: var(--zero); }
.cb-money-in { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.baltiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }
.bal { display: flex; flex-direction: column; min-width: 0; padding: 5px 9px 6px; border-radius: 4px; background: var(--soft); }
.bal-t { font-size: 12px; color: var(--muted); }
.bal b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bal small { font-size: 11px; line-height: 1.25; color: var(--muted); }
.bal.low { background: var(--err-bg); }
.bal.low .bal-t, .bal.low b, .bal.low small { color: var(--err); }
.bal.berr { background: var(--note-bg); }
.bal.berr .bal-t, .bal.berr b, .bal.berr small { color: var(--note-ink); }
.spend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-top: 8px; }
.spend-t { font-size: 12px; font-weight: 600; color: var(--muted); }
.spend a { color: var(--ink); white-space: nowrap; }
.spend a b { font-size: 15px; font-variant-numeric: tabular-nums; }
.spend a span { margin-left: 4px; font-size: 12px; color: var(--muted); }
.pays { padding-left: 14px; border-left: 1px solid var(--line); min-width: 0; }
.pays-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; font-size: 13px; }
.pays-h h3 { margin: 0; font-size: 13px; font-weight: 600; }
.plist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.plist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 8px; padding: 2px 0; border-bottom: 1px solid var(--row-line); }
.plist li:last-child { border-bottom: 0; }
.plist .p-name { overflow-wrap: anywhere; }
.plist .p-name small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.plist .p-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.plist li.over .p-name, .plist li.over .p-name small, .plist li.over .p-when { color: var(--err); font-weight: 600; }
.plist button { min-height: 24px; padding: 0 7px; font-size: 12px; }
table.plist-t tr.over td { color: var(--err); font-weight: 600; }
.lp { display: grid; grid-template-columns: minmax(104px, 1.5fr) repeat(6, minmax(0, 1fr)); align-items: center; padding: 3px 0; border-bottom: 1px solid var(--row-line); }
.lp:last-child { border-bottom: 0; }
.lp-head { padding: 2px 0; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; background: var(--soft); }
.lp-t { font-weight: 600; }
.lp-t small { font-weight: 400; font-size: 12px; }
.lp a { font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.lp a span { display: none; }
table.grid.cbt { margin: 0; }
table.grid.cbt th, table.grid.cbt td { padding: 3px 6px; }
table.grid.cbt th:not(:first-child) { text-align: center; }
table.grid.cbt td.n { font-size: 14px; }
.cb-line { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 6px 0 0; }
.cb-line a { color: var(--ink); }
.cb-line a.bad { color: var(--err); }
.cb-line b { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 1140px) {
  .cb-leads, .cb-calls, .cb-chats, .cb-people { grid-column: 1 / -1; }
  .cb-money-in { grid-template-columns: minmax(0, 1fr); }
  .pays { padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .sheet.wide.cabx { margin: 0; padding: 8px 8px 12px; }
  .cabx-more { flex-wrap: nowrap; justify-content: flex-start; width: 100%; margin: 0; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .cb-dist { margin-left: 0; width: 100%; }
  .baltiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bal b { white-space: normal; }
  .spend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
  .spend-t { grid-column: 1 / -1; }
  .spend a { display: flex; flex-direction: column; white-space: normal; min-height: 44px; }
  .spend a span { margin-left: 0; }
  .plist li { grid-template-columns: minmax(0, 1fr) auto; padding: 5px 0; }
  .plist .p-when { grid-column: 1; grid-row: 2; }
  .plist form { grid-column: 2; grid-row: 1 / span 2; }
  .plist button { min-height: 40px; padding: 0 10px; font-size: 13px; }
  .lp-head { display: none; }
  .lp { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 4px; padding: 6px 0; }
  .lp-t { grid-column: 1 / -1; }
  .lp a { display: flex; flex-direction: column; justify-content: center; min-height: 44px; border-radius: 4px; background: var(--soft); line-height: 1.2; }
  .lp a span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
  table.grid.cbt { table-layout: fixed; }
  table.grid.cbt th, table.grid.cbt td { padding: 3px; overflow-wrap: anywhere; }
  table.grid.cbt th { font-size: 11px; line-height: 1.2; }
  table.grid.cbt td.n a { display: block; min-height: 36px; line-height: 36px; }
  table.ppl th:first-child { width: 34%; }
  table.ppl .pres { width: 28px; }
  table.ppl th:nth-child(2) { width: 34px; font-size: 0; }
  table.ppl .pres-t { display: none; }
  table.ppl .dot { margin-right: 0; }
}
/* «Настройки → Балансы»: одна строка на счёт, на телефоне столбиком */
.balform { display: grid; gap: 8px; margin-top: 10px; justify-items: stretch; }
.balform > button { justify-self: start; }
.balrow { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(130px, 1fr) 120px minmax(0, 3fr); gap: 6px 14px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.balrow-t, .balrow-v { display: flex; flex-direction: column; min-width: 0; }
.balrow-v small { overflow-wrap: anywhere; }
.balrow.low .balrow-v b { color: var(--err); }
.balrow-l { margin: 0; }
.balrow-w { min-width: 0; font-size: 13px; }
.bpay { align-items: flex-end; }
.bpay .check { padding-bottom: 8px; white-space: nowrap; }
@media (max-width: 820px) { .balrow { grid-template-columns: minmax(0, 1fr); } }
/* «Оплаты» на телефоне: строка таблицы — карточка без прокрутки вбок, кнопка «Оплачено» всегда видна */
@media (max-width: 820px) {
  table.plist-t tr:first-child { display: none; }
  table.plist-t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.plist-t td { grid-column: 1; padding: 0; border: 0; }
  table.plist-t td:last-child { grid-column: 2; grid-row: 1 / span 5; }
  table.plist-t td:empty { display: none; }
  table.plist-t button { min-height: 40px; }
}
