/* ENP: панель управления */

@font-face { font-family: "SF Pro Text"; src: url("assets/fonts/SF-Pro-Text-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SF Pro Text"; src: url("assets/fonts/SF-Pro-Text-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "SF Pro Text"; src: url("assets/fonts/SF-Pro-Text-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "SF Pro Display"; src: url("assets/fonts/SF-Pro-Display-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0b0b0c;
  --surface: #131315;
  --surface-2: #19191c;
  --surface-3: #202024;
  --hover: #ffffff08;
  --press: #ffffff0f;
  --line: #222226;
  --line-2: #2d2d32;
  --line-3: #3a3a40;

  --text: #ececee;
  --text-2: #a4a4ac;
  --text-3: #6f6f78;

  --primary: #ececee;
  --primary-hover: #ffffff;
  --on-primary: #0b0b0c;

  --ok: #4cc38a;
  --warn: #e7b04e;
  --bad: #f2555a;
  --info: #8ea6f7;
  --brand: #e5484d;

  --r-xs: 6px;
  --r-s: 8px;
  --r-m: 10px;
  --r-l: 12px;
  --sidebar: 240px;
  --gutter: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-pop: 0 1px 0 #ffffff0a inset, 0 16px 48px #000000b3, 0 2px 8px #00000080;

  --sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 14px/20px var(--sans); -webkit-font-smoothing: antialiased; }
body.lock, body.menu-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }
svg.i { flex: none; width: 18px; height: 18px; fill: currentColor; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.005em; }
:focus-visible { outline: 2px solid #ececee99; outline-offset: 2px; border-radius: var(--r-s); }
::selection { background: #ececee33; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.t1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-3); }
.t2.bad, .bad-text { color: var(--bad); }
.t2 .link { display: inline; font-size: inherit; color: inherit; }
.t2 .link:hover { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.spin, .spin svg.i { animation: spin .8s linear infinite; }

/* ---------- каркас ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px;
  border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; font: 600 16px/1 var(--display); }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.side-search {
  display: flex; align-items: center; gap: 10px; height: 34px; margin: 12px 0 10px; padding: 0 8px 0 10px;
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--text-3);
  transition: border-color .12s, color .12s;
}
.side-search:hover { border-color: var(--line-2); color: var(--text-2); }
.side-search svg.i { width: 16px; height: 16px; }
.side-search span { flex: 1; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-2); font: 400 11px/1 var(--sans); color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; border-radius: var(--r-s);
  color: var(--text-2); transition: background-color .12s, color .12s;
}
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.on { color: var(--text); background: var(--surface-3); }
.nav-item svg.i { width: 18px; height: 18px; }
.nav-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--surface-3); }
.nav-item.on .nav-count { background: var(--line-3); }
.nav-count.bad { color: #fff; background: #b8333a; }
.nav-sep { height: 1px; margin: 10px 10px; background: var(--line); flex: none; }
.nav-spacer { flex: 1; }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 500; }
.me-text { flex: 1; min-width: 0; line-height: 16px; }
.me-text .t2 { font-size: 12px; }

.main { margin-left: var(--sidebar); min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
body.scrolled .topbar { border-bottom-color: var(--line); }
.topbar h1 { flex: 1; min-width: 0; font-size: 20px; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.topbar .icon-btn { margin-left: 4px; }
.view { width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px var(--gutter) 72px; }
.mobile-only { display: none !important; }

.banner {
  display: flex; align-items: center; gap: 12px; margin: 0 var(--gutter) 8px; padding: 10px 14px;
  border-radius: var(--r-m); border: 1px solid #e7b04e33; background: #e7b04e0f; color: var(--text);
}
.banner svg.i { color: var(--warn); }
.banner span { flex: 1; color: var(--text-2); }
.banner b { color: var(--text); font-weight: 500; }

/* ---------- кнопки ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-s); white-space: nowrap; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: background-color .12s, border-color .12s, color .12s, opacity .12s;
}
.btn svg.i { width: 16px; height: 16px; color: var(--text-2); }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { background: #26262b; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary svg.i { color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: #d6d6da; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--bad); }
.btn-danger svg.i { color: var(--bad); }
.btn-danger:hover { background: #f2555a14; border-color: #f2555a40; }
.btn-danger-solid { background: #d63a40; border-color: #d63a40; color: #fff; }
.btn-danger-solid:hover { background: #e2474d; border-color: #e2474d; }
.btn-sm { height: 30px; padding: 0 10px; gap: 6px; font-size: 13px; border-radius: 7px; }
.btn-sm svg.i { width: 15px; height: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] > *:not(.btn-spinner) { visibility: hidden; }
.btn-spinner { position: absolute; inset: 0; display: grid; place-items: center; }
.btn-spinner svg.i { animation: spin .8s linear infinite; }

.icon-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--r-s); color: var(--text-3); transition: color .12s, background-color .12s; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn:disabled { opacity: .4; pointer-events: none; }
.icon-btn.danger:hover { color: var(--bad); background: #f2555a14; }
.icon-btn svg.i { width: 18px; height: 18px; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; transition: color .12s; }
.link:hover { color: var(--text); }
.link svg.i { width: 14px; height: 14px; }

/* ---------- блоки ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; line-height: 20px; }
.card-head .meta { color: var(--text-3); font-size: 13px; }
.card-pad { padding: 16px 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hint { color: var(--text-3); font-size: 13px; line-height: 18px; }

/* показатели */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; transition: background-color .12s; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
a.kpi:hover { background: var(--hover); }
.kpi-label { color: var(--text-2); font-size: 13px; }
.kpi-value { font: 600 28px/34px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-value small { font: 400 14px/1 var(--sans); color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.kpi-sub { font-size: 12px; color: var(--text-3); }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.metrics span { display: inline-flex; align-items: center; gap: 7px; }
.metrics svg.i { width: 15px; height: 15px; color: var(--text-3); }
.metrics b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

/* требует действия */
.notice { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px 10px 20px; }
.notice + .notice { border-top: 1px solid var(--line); }
a.notice { transition: background-color .12s; }
a.notice:hover { background: var(--hover); }
.notice > svg.i:first-child { color: var(--warn); }
.notice.bad > svg.i:first-child { color: var(--bad); }
.notice-text { flex: 1; min-width: 0; }
.notice-text span { display: block; color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 16px !important; height: 16px !important; color: var(--text-3); }

/* состояние */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; white-space: nowrap; font-size: 13px; color: var(--text-2); background: var(--surface-3); width: max-content; max-width: 100%; }
.badge svg.i { width: 14px; height: 14px; }
.badge.ok { color: #7fd8ad; background: #4cc38a1a; }
.badge.warn { color: #f0c779; background: #e7b04e1a; }
.badge.bad { color: #ff8a8e; background: #f2555a1c; }
.badge.info { color: #b0c2fb; background: #8ea6f71c; }
.badge.mute { color: var(--text-2); background: var(--surface-3); }

/* ---------- списки ---------- */
.row { display: grid; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 10px 20px; border-top: 1px solid var(--line); transition: background-color .12s; }
.card > .row:first-child, .card-head + .row, .row-head + .row { border-top: 0; }
.row-head + .row { border-top: 1px solid var(--line); }
button.row:hover, a.row:hover { background: var(--hover); }
.row:focus-visible { outline-offset: -2px; border-radius: 0; }
.row-head { min-height: 38px; padding-block: 0; color: var(--text-3); font-size: 12px; background: var(--surface); }
.cols-listing { grid-template-columns: minmax(0, 3fr) 150px minmax(0, 1.2fr) 120px 140px 100px 16px; }
.cols-account { grid-template-columns: minmax(0, 1.4fr) 128px minmax(0, 1.6fr) 120px 16px; }
.cols-mini { grid-template-columns: minmax(0, 1fr) auto 96px; }
.cols-admin { grid-template-columns: minmax(0, 1.4fr) 220px minmax(0, 1fr) auto; }
.right { text-align: right; justify-self: end; }
.obj { display: flex; align-items: center; gap: 12px; min-width: 0; }
.obj > div { min-width: 0; }
.thumb { position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 42px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-3); overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb svg.i { width: 18px; height: 18px; }
.thumb.sm { width: 36px; height: 36px; border-radius: 50%; }
.thumb.sq { width: 40px; height: 32px; }
.price { text-align: right; white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.price small { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-3); }
.stats { display: flex; gap: 12px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.stats span { display: inline-flex; align-items: center; gap: 5px; }
.stats svg.i { width: 14px; height: 14px; color: var(--text-3); }

.job { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 12px 20px; border-top: 1px solid var(--line); }
.card-head + .job { border-top: 0; }
.job > svg.i { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); }
.job.done > svg.i { color: var(--ok); }
.job.failed > svg.i { color: var(--bad); }
.job.active > svg.i { color: var(--warn); }
.job > div { flex: 1; min-width: 0; }
.job time { font-size: 12px; color: var(--text-3); white-space: nowrap; line-height: 20px; }
.job .why { font-size: 13px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job .icon-btn { width: 28px; height: 28px; margin: -4px 0; }

/* ---------- фильтры ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .end { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg button { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 28px; padding: 0 11px; border-radius: 7px; color: var(--text-2); font-size: 13px; transition: background-color .12s, color .12s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 2px #0006; }
.seg .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); min-width: 220px; transition: border-color .12s; }
.searchbox:focus-within { border-color: var(--line-3); }
.searchbox svg.i { width: 16px; height: 16px; }
.searchbox input { flex: 1; min-width: 0; height: 100%; outline: 0; color: var(--text); }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox input::-webkit-search-cancel-button { display: none; }

/* выпадающий список: меню в верхнем слое, края карточек его не обрезают */
.select { min-width: 0; }
.select-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px 0 12px;
  border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: background-color .12s, border-color .12s;
}
.select-trigger > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger svg.i { width: 15px; height: 15px; color: var(--text-3); }
.select-trigger .select-chevron { transition: transform .15s; }
.select-trigger:hover { background: var(--surface-3); border-color: var(--line-3); }
.select-trigger[aria-expanded="true"] { border-color: var(--line-3); background: var(--surface-3); }
.select-trigger[aria-expanded="true"] .select-chevron { transform: rotate(180deg); }
.select-trigger:disabled { opacity: .5; cursor: default; }
.select-menu {
  position: fixed; inset: auto; margin: 0; padding: 4px; overflow: auto;
  border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  box-shadow: var(--shadow-pop);
}
.select-menu:popover-open { display: grid; gap: 1px; animation: pop .12s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.select-menu button { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 34px; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.select-menu button > span { overflow-wrap: anywhere; }
.select-menu button svg.i { opacity: 0; height: 15px; width: 15px; }
.select-menu button[aria-selected="true"] svg.i { opacity: 1; }
.select-menu button:hover, .select-menu button:focus-visible { background: var(--surface-3); outline: 0; }
.toolbar .select { width: 196px; }

/* ---------- пустые состояния и загрузка ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 52px 24px; text-align: center; }
.empty > svg.i { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 8px; }
.empty h3 { font-size: 15px; line-height: 20px; }
.empty p { color: var(--text-3); max-width: 380px; font-size: 13px; line-height: 18px; }
.empty .btn { margin-top: 14px; }
.sk { border-radius: var(--r-l); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) 0 0 / 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- парсер ---------- */
.search-summary { display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 20px; margin-bottom: 16px; }
.search-summary .crit { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; color: var(--text-2); }
.search-summary .crit span { display: inline-flex; align-items: center; gap: 7px; }
.search-summary .crit svg.i { width: 15px; height: 15px; color: var(--text-3); }
.search-summary .run { display: inline-flex; align-items: center; gap: 8px; color: var(--warn); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ptile { position: relative; }
.pcard { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); overflow: hidden; transition: border-color .12s, transform .12s; }
.pcard:hover { border-color: var(--line-3); }
.ptile.picked .pcard { border-color: var(--text-2); }
.shot { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-3); color: var(--text-3); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; background: #0b0b0cd9; color: var(--text); backdrop-filter: blur(6px); }
.tag svg.i { width: 13px; height: 13px; }
.tag.tl { top: 10px; left: 10px; }
.tag.br { right: 10px; bottom: 10px; }
.tag.tr { top: 10px; right: 10px; }
.pbody { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; flex: 1; }
.ptitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 19px; }
.pline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.pprice { font-weight: 500; font-variant-numeric: tabular-nums; }
.pprice small { font-weight: 400; font-size: 12px; color: var(--text-3); }
.pick {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #0b0b0cd9; border: 1.5px solid #ffffff66; color: transparent; transition: background-color .12s, border-color .12s;
}
.pick svg.i { width: 15px; height: 15px; }
.pick[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.selection-bar {
  position: sticky; bottom: 20px; z-index: 10; display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; margin: 20px auto 0;
  padding: 8px 8px 8px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: var(--shadow-pop);
}
.selection-bar > span { margin-right: 6px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- аккаунты ---------- */
.acc-block + .acc-block { border-top: 1px solid var(--line); }
.acc-head { border-top: 0 !important; }
.row-head + .acc-block { border-top: 1px solid var(--line); }
.acc-head .chev { transition: transform .15s; }
.acc-block.open .acc-head .chev { transform: rotate(180deg); }
.acc-block.open { background: var(--surface-2); }
.acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 20px 16px; }
.acc-actions .sep { flex: 1; }
.audit { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; }
.audit svg.i { color: var(--text-3); }
.audit .bar { flex: 0 0 160px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.audit .bar i { display: block; height: 100%; background: var(--text-2); }
.audit span { flex: 1; color: var(--text-2); }

/* ---------- сделки ---------- */
.deal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.deal-summary .kpi { cursor: default; }
.deal { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 16px 14px 20px; border-top: 1px solid var(--line); }
.card > .deal:first-child { border-top: 0; }
.deal-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 56px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); line-height: 1; }
.deal-date b { font: 600 20px/22px var(--display); font-variant-numeric: tabular-nums; }
.deal-date span { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.deal-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.deal-main .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--text-2); font-size: 13px; }
.deal-main .line > * { display: inline-flex; align-items: center; gap: 6px; }
.deal-main .line svg.i { width: 14px; height: 14px; color: var(--text-3); }
.deal-main .notes { color: var(--text-3); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.deal-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.deal-side .amount { font-weight: 500; font-variant-numeric: tabular-nums; }
.deal-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.drawer .deal { grid-template-columns: 56px minmax(0, 1fr) auto; padding: 12px 0; }
.drawer .deal-date { height: 50px; }

/* ---------- админ-панель ---------- */
.member-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--text-3); }
.member-sub span { display: inline-flex; align-items: center; gap: 5px; }
.member-sub svg.i { width: 13px; height: 13px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.preview-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; margin-bottom: 16px; border-radius: var(--r-m); border: 1px dashed var(--line-3); color: var(--text-2); }
.preview-bar span { flex: 1; }

/* ---------- диалоги ---------- */
body[data-page="dialogs"] .view { padding-bottom: 16px; }
.chat-workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - 88px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--surface); }
body.has-banner .chat-workspace { height: calc(100dvh - 88px - 52px); }
.chat-inbox { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.chat-inbox-head { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.chat-inbox-head .top { display: flex; gap: 6px; }
.chat-inbox-head .select { flex: 1; }
.chat-inbox-head .tools { display: flex; gap: 6px; }
.chat-inbox-head .searchbox { flex: 1; min-width: 0; height: 32px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.chat-item { display: flex; gap: 10px; width: 100%; padding: 10px; border-radius: var(--r-s); transition: background-color .12s; }
.chat-item:hover { background: var(--hover); }
.chat-item.on { background: var(--surface-3); }
.chat-person { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-weight: 500; }
.chat-item.on .chat-person { background: var(--line-3); }
.chat-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-item-top { display: flex; align-items: center; gap: 8px; }
.chat-item-top .t1 { flex: 1; }
.chat-item-top time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.chat-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.chat-item.unread .t1 { font-weight: 500; }
.chat-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; background: var(--primary); color: var(--on-primary); font-variant-numeric: tabular-nums; }
.chat-more { display: block; width: calc(100% - 12px); margin: 6px; height: 32px; border-radius: var(--r-s); color: var(--text-2); font-size: 13px; text-align: center; }
.chat-more:hover { background: var(--hover); color: var(--text); }
.chat-load { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 32px 16px; color: var(--text-3); font-size: 13px; }
.chat-load svg.i { animation: spin .8s linear infinite; width: 16px; height: 16px; }
.chat-inline-error { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px; padding: 8px 12px; border-radius: var(--r-s); background: #f2555a14; color: #ff8a8e; font-size: 13px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-pane-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); min-height: 61px; }
.chat-pane-head .chat-back { display: none; }
.chat-context { flex: 1; min-width: 0; }
.chat-context h2 { font-size: 15px; line-height: 20px; }
.chat-context .link { max-width: 100%; }
.chat-context .link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.bubbles { display: flex; flex-direction: column; gap: 4px; }
.chat-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.chat-day span { font-size: 12px; color: var(--text-3); }
.bubble { max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 14px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { display: block; margin-top: 2px; font-size: 11px; text-align: right; opacity: .6; }
.bubble.their { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.bubble.mine { align-self: flex-end; background: #ececee; color: #111; border-bottom-right-radius: 4px; }
.chat-compose { border-top: 1px solid var(--line); padding: 10px 12px 12px; }
.chat-reply { display: flex; align-items: flex-end; gap: 8px; }
.chat-reply textarea { flex: 1; min-height: 40px; max-height: 180px; resize: none; padding: 9px 12px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface-2); outline: 0; line-height: 20px; field-sizing: content; }
.chat-reply textarea:focus { border-color: var(--line-3); }
.chat-reply textarea:disabled { opacity: .5; }
.chat-reply .btn { height: 40px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; }
.chat-empty svg.i { width: 32px; height: 32px; color: var(--text-3); margin-bottom: 6px; }
.chat-empty h2 { font-size: 15px; }
.chat-empty p { color: var(--text-3); font-size: 13px; }

/* ---------- настройки ---------- */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; height: 40px; color: var(--text-2); white-space: nowrap; transition: color .12s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 1px; background: var(--text); }
.settings { display: flex; flex-direction: column; gap: 32px; max-width: 860px; }
.sect { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.sect-info h2 { font-size: 15px; line-height: 20px; }
.sect-info p { margin-top: 4px; color: var(--text-3); font-size: 13px; line-height: 18px; }
.form { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.form-foot .err { flex: 1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row > div { flex: 1; min-width: 0; }
.setting-row h3 { font: 400 14px/20px var(--sans); }
.setting-row p { font-size: 13px; color: var(--text-3); line-height: 18px; overflow-wrap: anywhere; }
button.setting-row { width: 100%; transition: background-color .12s; }
button.setting-row:hover { background: var(--hover); }
button.setting-row.danger h3 { color: var(--bad); }
.props { display: grid; }
.prop { display: flex; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.prop + .prop { border-top: 1px solid var(--line); }
.prop dt { color: var(--text-2); }
.prop dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.providers > div + div { border-left: 1px solid var(--line); }
.providers h3 { padding: 14px 20px 4px; font-size: 14px; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; color: var(--text-2); }
.field input:not([type="checkbox"]):not([type="hidden"]):not([type="file"]), .field textarea, .input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-2);
  outline: 0; transition: border-color .12s, background-color .12s;
}
.field textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 20px; min-height: 84px; }
.field input:hover, .field textarea:hover { border-color: var(--line-3); }
.field input:focus, .field textarea:focus { border-color: #ececee80; background: var(--surface-3); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:disabled { opacity: .5; }
.field input[type="date"], .field input[type="time"] { color-scheme: dark; }
.field input[type="file"] { padding: 8px; border-radius: var(--r-s); border: 1px dashed var(--line-3); color: var(--text-2); font-size: 13px; }
.field input[type="file"]::file-selector-button { margin-right: 10px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font: inherit; cursor: pointer; }
.mhint { font-size: 12px; line-height: 16px; color: var(--text-3); }
.err { color: #ff8a8e; font-size: 13px; min-height: 0; }
.err:empty { display: none; }
.pw { position: relative; }
.pw input { padding-right: 42px !important; }
.pw .icon-btn { position: absolute; right: 2px; top: 2px; }
.checklist { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface-2); }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.checklist label + label { border-top: 1px solid var(--line); }
.checklist label:first-child { color: var(--text-2); }
input[type="checkbox"] { appearance: none; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-3); display: grid; place-items: center; cursor: pointer; }
input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--on-primary); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.date-options { display: flex; gap: 6px; grid-column: 1 / -1; }
.date-options .btn[aria-pressed="true"] { border-color: var(--text-2); }

/* ---------- карточка объекта ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: #00000080; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(560px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-2); transform: translateX(100%); transition: transform .25s var(--ease); outline: 0;
}
.drawer.open { transform: none; box-shadow: -24px 0 64px #00000080; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px 24px; }
.drawer-body > h2 { font-size: 19px; line-height: 25px; margin-top: 18px; }
.place { color: var(--text-2); margin-top: 4px; }
.bigprice { font: 600 22px/28px var(--display); margin-top: 12px; font-variant-numeric: tabular-nums; }
.bigprice small { font: 400 14px/1 var(--sans); color: var(--text-3); }
.gallery { position: relative; display: grid; place-items: center; margin: 0 -20px; aspect-ratio: 16 / 10; background: var(--surface-3); color: var(--text-3); overflow: hidden; }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gnav { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #0b0b0cbf; color: #fff; opacity: 0; transition: opacity .15s; backdrop-filter: blur(6px); }
.gallery:hover .gnav, .gnav:focus-visible { opacity: 1; }
.gnav.prev { left: 12px; }
.gnav.next { right: 12px; }
.strip { display: flex; gap: 6px; margin: 10px -20px 0; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; width: 64px; height: 46px; border-radius: 6px; overflow: hidden; opacity: .5; transition: opacity .12s; outline-offset: -2px; }
.strip button.on, .strip button:hover { opacity: 1; }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.alert { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-m); background: #f2555a12; border: 1px solid #f2555a30; color: #ffb3b5; font-size: 13px; line-height: 18px; }
.alert svg.i { width: 16px; height: 16px; margin-top: 1px; color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-m); }
.tiles > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.tiles > div + div { border-left: 1px solid var(--line); }
.tiles b { font: 600 20px/24px var(--display); font-variant-numeric: tabular-nums; }
.tiles span { font-size: 12px; color: var(--text-3); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-top: 16px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact dt { color: var(--text-3); white-space: nowrap; }
.fact dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.desc { margin-top: 24px; }
.desc h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.desc > p { color: var(--text-2); white-space: pre-line; line-height: 21px; }
.drawer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.drawer-foot .push { margin-left: auto; }
.drawer-foot .icon-btn { width: 36px; height: 36px; }

/* ---------- модальные окна ---------- */
.modal-host { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: #000000a6; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; display: flex; flex-direction: column; width: min(460px, 100%); max-height: calc(100dvh - 32px); border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: rise .18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-wide { width: min(640px, 100%); }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 4px 20px; }
.modal-head h2 { font-size: 17px; line-height: 24px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 20px; overflow-y: auto; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.modal-grid > .modal-text, .modal-grid > .modal-targets, .modal-grid > .err, .field-wide { grid-column: 1 / -1; }
.modal-text { color: var(--text-2); line-height: 20px; white-space: pre-line; }
.modal-targets { list-style: none; max-height: 220px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--r-s); }
.modal-targets li { padding: 8px 12px; font-size: 13px; }
.modal-targets li + li { border-top: 1px solid var(--line); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }

/* ---------- поиск-палитра ---------- */
.palette { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-box { position: relative; width: min(600px, 100%); border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); overflow: hidden; animation: rise .15s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-input input { flex: 1; height: 100%; outline: 0; font-size: 15px; color: var(--text); }
.palette-input input::placeholder { color: var(--text-3); }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-list { max-height: min(420px, 60dvh); overflow-y: auto; padding: 6px; }
.result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: var(--r-s); }
.result > div { min-width: 0; flex: 1; }
.result.on { background: var(--surface-3); }
.result .kind { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.results-empty { padding: 28px; text-align: center; color: var(--text-3); }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px 10px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-3); box-shadow: var(--shadow-pop);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg.i { width: 18px; height: 18px; color: var(--ok); }
.toast.error svg.i { color: var(--bad); }
.toast.info svg.i { color: var(--text-2); }
.toast span { line-height: 19px; }

/* ---------- вход ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-card img { width: 44px; height: 44px; border-radius: 11px; }
.auth-card h1 { font-size: 22px; line-height: 28px; margin: 6px 0 6px; }
.auth-card .btn { height: 40px; margin-top: 4px; }

/* ---------- мобильное меню ---------- */
.mobile-menu { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 14px 12px; border: 0; border-right: 1px solid var(--line-2); background: var(--bg); color: var(--text); flex-direction: column; gap: 6px; }
.mobile-menu[open] { display: flex; animation: slide .2s var(--ease); }
@keyframes slide { from { transform: translateX(-100%); } }
.mobile-menu::backdrop { background: #000000a6; }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; }
.mobile-menu .nav { margin-top: 8px; }
.mobile-menu .nav-item { height: 42px; font-size: 15px; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .cols-listing { grid-template-columns: minmax(0, 3fr) 150px 120px 100px 16px; }
  .cols-listing > .c-acc, .cols-listing > .c-dates { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sect { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cols-admin { grid-template-columns: minmax(0, 1fr) 180px auto; }
  .cols-admin > .c-login { display: none; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .mobile-only { display: grid !important; }
  .topbar { height: 56px; }
  .topbar h1 { font-size: 18px; }
  .page-actions .btn .lbl { display: none; }
  .page-actions .btn { width: 36px; padding: 0; }
  .page-actions .btn > svg.i { margin: 0; }
  .topbar h1 { min-width: 64px; }
  .kpis:not(.deal-summary) { grid-template-columns: 1fr 1fr; }
  .kpis:not(.deal-summary) .kpi:nth-child(3) { border-left: 0; }
  .kpis:not(.deal-summary) .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .cols-listing { grid-template-columns: minmax(0, 1fr) auto; }
  .cols-listing > :not(.obj):not(.badge) { display: none; }
  .row-head.cols-listing { display: none; }
  .cols-account { grid-template-columns: minmax(0, 1fr) auto 16px; }
  .cols-account > .c-obj, .cols-account > .c-date { display: none; }
  .row-head.cols-account { display: none; }
  .cols-mini { grid-template-columns: minmax(0, 1fr) auto; }
  .cols-mini > .price { display: none; }
  .cols-admin { grid-template-columns: minmax(0, 1fr) auto; }
  .cols-admin > .select { grid-column: 1 / -1; grid-row: 2; }
  .row-head.cols-admin { display: none; }
  .toolbar .end { margin-left: 0; width: 100%; }
  .toolbar .select { flex: 1; width: auto; }
  .searchbox { min-width: 0; flex: 1; }
  .deal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deal-summary .kpi { padding: 14px; }
  .deal-summary .kpi-value { font-size: 22px; line-height: 28px; }
  .deal { grid-template-columns: 52px minmax(0, 1fr); padding: 14px 16px; }
  .deal-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .chat-workspace { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 80px); }
  .chat-workspace.thread-open .chat-inbox { display: none; }
  .chat-workspace:not(.thread-open) .chat-pane { display: none; }
  .chat-pane-head .chat-back { display: grid; }
  .pair, .modal-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
  .banner { margin: 0 var(--gutter) 8px; }
  .providers > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .search-summary { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- движение и ход операций ---------- */
/* Полоса под шапкой, пока панель ждёт ответ воркера. */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #ececee 50%, transparent 100%) 0 0 / 40% 100% no-repeat; transition: opacity .2s; }
body.working .topbar::after { opacity: .9; animation: sweep 1.1s var(--ease) infinite; }
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.btn { transition: background-color .12s, border-color .12s, color .12s, opacity .12s, transform .08s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.icon-btn:active { transform: scale(.94); }
.btn[aria-busy="true"] { background: var(--surface-3); border-color: var(--line-3); }
.btn-primary[aria-busy="true"] { background: #cfcfd4; }

/* Вход в раздел: блоки поднимаются по очереди. */
.view.enter > *, .view.enter .stack > *, .view.enter .split > * > * { animation: rise-in .42s var(--ease) both; }
.view.enter > :nth-child(2), .view.enter .stack > :nth-child(2) { animation-delay: .05s; }
.view.enter > :nth-child(3), .view.enter .stack > :nth-child(3) { animation-delay: .1s; }
.view.enter > :nth-child(4), .view.enter .stack > :nth-child(4) { animation-delay: .15s; }
.view.enter .row, .view.enter .ptile, .view.enter .deal, .view.enter .acc-block, .view.enter .job { animation: rise-in .4s var(--ease) both; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(2) { animation-delay: .04s; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(3) { animation-delay: .08s; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(4) { animation-delay: .12s; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(5) { animation-delay: .16s; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(6) { animation-delay: .2s; }
.view.enter :is(.row, .ptile, .deal, .acc-block, .job):nth-child(n + 7) { animation-delay: .24s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
.acc-actions { animation: unfold .22s var(--ease); transform-origin: top; }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
.nav-item svg.i { transition: transform .2s var(--ease); }
.nav-item:hover svg.i { transform: translateX(1px) scale(1.06); }
.nav-count { animation: pop .3s var(--ease); }
.badge { transition: background-color .2s, color .2s; animation: fade .25s; }
.pcard { transition: border-color .15s, transform .2s var(--ease); }
.pcard:hover { transform: translateY(-2px); }
.pcard img { transition: transform .5s var(--ease); }
.pcard:hover img { transform: scale(1.03); }
.toast.show svg.i { animation: pop-in .35s var(--ease); }
@keyframes pop-in { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Давность проверки в списке объявлений. */
.state-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.fresh { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fresh.stale { color: var(--warn); }
.fresh.live { color: var(--text-2); }
.fresh svg.i { width: 12px; height: 12px; }

/* Полоса прогресса. */
.bar { position: relative; display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--text); transition: width .6s var(--ease); }
.bar.indeterminate i { width: 35% !important; animation: slide-bar 1.3s var(--ease) infinite; }
@keyframes slide-bar { from { left: -35%; } to { left: 100%; } }

/* Идущий поиск в парсере. */
.scan { padding: 16px 20px 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.scan::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #ffffff08 50%, transparent 70%) 0 0 / 250% 100%; animation: sheen 2.4s linear infinite; pointer-events: none; }
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.scan-top { display: flex; align-items: center; gap: 14px; }
.scan-top > div { flex: 1; min-width: 0; }
.scan-top time { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 13px; }
.scan-ic { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); flex: none; }
.scan-ic::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid #ececee; opacity: 0; animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.scan-ic svg.i { animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(2px, -2px); } 50% { transform: translate(-1px, 2px); } 75% { transform: translate(-2px, -1px); } }
.ghost-tile { display: flex; flex-direction: column; gap: 10px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); padding-bottom: 16px; overflow: hidden; animation: fade .3s both; }
.ghost-tile span, .ghost-tile i { display: block; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%) 0 0 / 200% 100%; animation: sk 1.4s linear infinite; }
.ghost-tile span { aspect-ratio: 4 / 3; }
.ghost-tile i { height: 12px; margin: 0 14px; border-radius: 6px; }
.ghost-tile i:last-child { width: 45%; }

/* Док операций. */
.dock { position: fixed; right: 20px; bottom: 20px; z-index: 75; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.dock-item { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop); animation: dock-in .35s var(--ease) both; transition: border-color .2s, background-color .2s; }
.dock-item:hover { border-color: var(--line-3); }
@keyframes dock-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.dock-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); flex: none; }
.dock-ic svg.i { width: 16px; height: 16px; }
.dock-item.ok .dock-ic { background: #4cc38a24; color: var(--ok); }
.dock-item.ok .dock-ic svg.i, .dock-item.fail .dock-ic svg.i { animation: pop-in .4s var(--ease); }
.dock-item.fail .dock-ic { background: #f2555a24; color: var(--bad); }
.dock-item.fail { border-color: #f2555a40; }
.dock-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dock-body .t2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dock-body .bar { margin-top: 6px; }
.dock-item time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; align-self: flex-start; }
.toast { bottom: 24px; }
body:has(.dock-item) .toast { left: auto; right: 20px; transform: translate(0, 16px); bottom: auto; top: 76px; }
body:has(.dock-item) .toast.show { transform: none; }
@media (max-width: 860px) {
  .dock { right: 12px; left: 12px; width: auto; bottom: 12px; }
  body:has(.dock-item) .toast { left: 12px; right: 12px; top: 64px; }
}

/* вход */
.auth-card { animation: rise-in .5s var(--ease) both; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { height: 42px; }
.auth-form .btn.loading svg.i { animation: spin .8s linear infinite; }
.auth-switch { align-self: flex-start; font-size: 13px; }
.auth-sent { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--surface); animation: rise-in .35s var(--ease) both; }
.auth-sent h2 { font-size: 16px; }
.sent-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); margin-bottom: 4px; }
.sent-ic svg.i { animation: fly 1.6s var(--ease) infinite; }
@keyframes fly { 0% { transform: translate(-6px, 6px); opacity: 0; } 30% { opacity: 1; } 70% { transform: translate(4px, -4px); opacity: 1; } 100% { transform: translate(8px, -8px); opacity: 0; } }
