/* Шрифты — свои (web/fonts, вариативные: один файл на все начертания), без Google Fonts. */
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/literata-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/literata-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/literata-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/literata-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/literata-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/literata-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* latin */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f2f0ea;
  --surface: #fbfaf6;
  --sunken: #ece9e1;
  --ink: #16150f;
  --ink-2: #3b3934;
  --muted: #6b6861;
  --faint: #9a968c;
  --line: #ddd8cc;
  --line-2: #e9e5dc;
  --grid: #efece4;
  --accent: #2b55c0;
  --accent-rgb: 43, 85, 192;
  --accent-ink: #1e3f94;
  --accent-soft: #e1e7f6;
  --on-accent: #ffffff;
  --hot: #a64a14;
  --hot-bar: #c8703a;
  --hot-ink: #8a3a0e;
  --hot-soft: #f5e2d4;
  --ok: #2f7d4f;
  --ok-ink: #22603b;
  --ok-soft: #e3f0e7;
  --warn: #b07a0b;
  --warn-ink: #7f5700;
  --warn-soft: #f6ecd0;
  --off: #c9c4b8;
  --shadow: 0 1px 2px rgba(22, 21, 15, 0.12);
  --pop: 0 24px 64px rgba(22, 21, 15, 0.18);
  --scrim: rgba(22, 21, 15, 0.32);
  --serif: "Literata", Georgia, serif;
  --sans: "Onest", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141412; --surface: #1b1a18; --sunken: #262521; --ink: #f3f1ea; --ink-2: #d6d3ca; --muted: #9d998f; --faint: #6f6c64;
    --line: #312f2b; --line-2: #292825; --grid: #23221f;
    --accent: #7096f0; --accent-rgb: 112, 150, 240; --accent-ink: #a9c0f7; --accent-soft: #1e2842; --on-accent: #0e1424;
    --hot: #e08a55; --hot-bar: #d0804f; --hot-ink: #f0a878; --hot-soft: #3a2519;
    --ok: #5fb583; --ok-ink: #8fd0a8; --ok-soft: #1c2e22; --warn: #e0b04f; --warn-ink: #f0cd82; --warn-soft: #362b14; --off: #4a4843; --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --pop: 0 24px 64px rgba(0, 0, 0, 0.55); --scrim: rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141412; --surface: #1b1a18; --sunken: #262521; --ink: #f3f1ea; --ink-2: #d6d3ca; --muted: #9d998f; --faint: #6f6c64;
  --line: #312f2b; --line-2: #292825; --grid: #23221f;
  --accent: #7096f0; --accent-rgb: 112, 150, 240; --accent-ink: #a9c0f7; --accent-soft: #1e2842; --on-accent: #0e1424;
  --hot: #e08a55; --hot-bar: #d0804f; --hot-ink: #f0a878; --hot-soft: #3a2519;
  --ok: #5fb583; --ok-ink: #8fd0a8; --ok-soft: #1c2e22; --warn: #e0b04f; --warn-ink: #f0cd82; --warn-soft: #362b14; --off: #4a4843; --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --pop: 0 24px 64px rgba(0, 0, 0, 0.55); --scrim: rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink-2); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 900px) { .wrap { padding: 0 16px; } }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.brand { font-weight: 600; }
.label { font: 10.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pill { display: inline-block; font: 10.5px/1.2 var(--mono); letter-spacing: 0.05em; padding: 3px 8px; border-radius: 99px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.hot { background: var(--hot-soft); color: var(--hot-ink); }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); }
svg.i { width: 12px; height: 12px; flex-shrink: 0; }
svg.i-search { width: 14px; height: 14px; flex-shrink: 0; }
kbd { font: 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.55); outline-offset: 2px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { height: 60px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--ink); letter-spacing: -0.01em; text-decoration: none; flex-shrink: 0; }
.vsep { width: 1px; height: 24px; background: var(--line); flex-shrink: 0; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumb { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
a.crumb:hover { color: var(--ink); }
.crumb[aria-current="page"] { color: var(--ink); font-weight: 500; }
.grow { flex-grow: 1; }
.search-btn { height: 36px; display: inline-flex; align-items: center; gap: 10px; min-width: 240px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-size: 13px; cursor: pointer; flex-shrink: 0; transition: border-color 150ms, color 150ms; }
.search-btn:hover { color: var(--ink); border-color: var(--faint); }
.search-btn kbd { margin-left: auto; }
@media (max-width: 900px) { .search-btn { min-width: 0; } }
@media (max-width: 640px) {
  .brand-name, a.crumb, .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .topbar .wrap { gap: 12px; }
  a.crumb.tab { display: inline; }
}

.btn { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 150ms, transform 150ms; }
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primary:hover { opacity: 0.88; }
.linkish { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; }
.linkish:hover { color: var(--accent-ink); }

/* hero */
.hero { padding-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 24px 48px; align-items: end; }
@media (max-width: 1100px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero.solo { grid-template-columns: minmax(0, 1fr); }
.lede { margin: 0; max-width: 860px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.lede b { color: var(--ink); font-weight: 600; }
h1 { margin: 12px 0; font: 500 clamp(38px, 5.2vw, 68px)/1.02 var(--serif); letter-spacing: -0.03em; color: var(--ink); overflow-wrap: anywhere; }
.meta { display: flex; gap: 6px 20px; flex-wrap: wrap; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

/* KPI */
.kpis { margin-top: 32px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line-2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; }
.kpi-value span:first-child { font: 40px/1 var(--serif); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value span + span { color: var(--muted); }
.kpi-foot { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n + 1) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px; border-left: 1px solid var(--line-2) !important; }
  .kpi:nth-child(2n + 1) { border-left: 0 !important; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .kpi-value span:first-child { font-size: 30px; }
}

.kpis.four { margin-top: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.four .kpi { border-left: 1px solid var(--line-2); border-top: 0; }
  .kpis.four .kpi:nth-child(2n + 1) { border-left: 0; }
  .kpis.four .kpi:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
}

/* период и строка «что изменилось» (страница ЖК) */
.period-bar { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.status-line { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; font-size: 14px; }
.st { display: inline-flex; align-items: center; gap: 8px; }
.st > svg { width: 16px; height: 16px; flex-shrink: 0; }
.st b { color: var(--ink); font-weight: 500; }
.st b.down { color: var(--accent); }
.st.dim { color: var(--muted); }

/* изменения цен: группы по ЖК, строка квартиры, массовая переоценка */
.mv-name { min-width: 0; }
.mv-rows { display: flex; flex-direction: column; }
.mv-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px 96px 76px 52px; column-gap: 12px; align-items: center; min-height: 44px; margin: 0 -8px; padding: 0 8px; border-radius: 8px; color: inherit; text-decoration: none; transition: background 120ms; }
.mv-row + .mv-row { box-shadow: inset 0 1px 0 var(--line-2); }
.mv-row:hover { background: var(--paper); box-shadow: none; }
.mv-row:hover + .mv-row { box-shadow: none; }
.mv-flat { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-flat b { font-weight: 500; color: var(--ink); }
.mv-price { font-size: 13px; text-align: right; white-space: nowrap; color: var(--faint); }
.mv-price b { color: var(--ink); font-weight: 500; }
.mv-diff { font-size: 12.5px; text-align: right; white-space: nowrap; }
.mv-pct { text-align: right; }
.mv-date { font-size: 12px; text-align: right; white-space: nowrap; }
.mv-go { display: flex; justify-content: flex-end; color: var(--faint); }
.mv-row:hover .mv-go { color: var(--ink); }
.mv-event { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--paper); font-size: 13px; line-height: 1.45; }
.mv-event > svg { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }
.mv-event b { color: var(--ink); font-weight: 500; }
a.mv-event { color: inherit; text-decoration: none; transition: background 120ms; }
a.mv-event:hover, .mv-event-d > summary:hover { background: var(--sunken); }
a.mv-event .mv-go, .mv-toggle { margin-left: auto; padding-left: 8px; align-self: center; white-space: nowrap; font-size: 12px; }
.mv-event-d > summary { cursor: pointer; list-style: none; }
.mv-event-d > summary::-webkit-details-marker { display: none; }
.mv-toggle::after { content: " ↓"; }
.mv-event-d[open] .mv-toggle::after { content: " ↑"; }
.mv-event-d > .mv-rows { margin: 0 0 8px; }
.mv-more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; }
.mv-more:hover { color: var(--accent-ink); }
.mv-skel { height: 140px; margin-bottom: 12px; border-radius: 10px; }

/* страница «Подешевели» (drops.js) */
.dr-kpis { margin-top: 28px; }
.kpi-value.down span:first-child { color: var(--accent); }
.kpi-value.up span:first-child { color: var(--hot-ink); }
.kpi-foot { min-width: 0; }
.dr-tools { display: flex; flex-direction: column; gap: 10px; }
.dr-tools-row { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.dr-tools .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.dr-regions { flex: 1; }
.dr-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.dr-sort .field { height: 34px; font-size: 13px; padding: 0 8px; }
.dr-results { display: flex; flex-direction: column; gap: 16px; }
.dr-results .pane-head { align-items: center; }
.dr-flats { padding: 8px 20px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.dr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dr-card { display: flex; flex-direction: column; padding: 18px 20px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); min-width: 0; }
/* в карточке ЖК дата не помещается — она есть в виде «Все квартиры» */
@media (min-width: 641px) { .dr-card .mv-row { grid-template-columns: minmax(0, 1fr) auto 84px 64px; } }
.dr-card .mv-date { display: none; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.dr-head .zk b { font-size: 16px; }
.dr-count { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.dr-count b { font: 500 24px/1 var(--serif); letter-spacing: -0.02em; }
.dr-bar { height: 3px; margin: 12px 0 8px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--w), var(--line-2) var(--w)); }
.dr-bar.up { background: linear-gradient(90deg, var(--hot-bar) var(--w), var(--line-2) var(--w)); }
.dr-card .mv-more { margin-top: auto; padding-top: 8px; }
@media (min-width: 641px) { .dr-flat .mv-row { grid-template-columns: minmax(0, 1fr) auto 84px 70px 48px; } }
.dr-flat { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.dr-flat + .dr-flat { box-shadow: inset 0 1px 0 var(--line-2); }
.dr-flat .mv-row { margin: 0; box-shadow: none !important; }
.dr-zk { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--ink); font-size: 13px; line-height: 1.3; }
.dr-zk b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-zk .muted { font-size: 12px; }
.dr-zk:hover b { color: var(--accent); }
@media (max-width: 1100px) { .dr-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .dr-flat { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .dr-tools .filter, .dr-tools .filter input { width: 100%; }
  .dr-tools .chip-sep { display: none; }
  .dr-card { padding: 14px 14px 10px; }
  .dr-flats { padding: 4px 14px; }
}

/* главная: плашка «Подешевели» */
.drops-teaser { display: flex; align-items: center; gap: 16px 32px; flex-wrap: wrap; padding: 18px 24px; color: inherit; text-decoration: none; transition: border-color 150ms, box-shadow 150ms; }
.drops-teaser:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.dt-main { display: flex; flex-direction: column; gap: 6px; }
.dt-num { display: flex; align-items: baseline; gap: 10px; color: var(--muted); }
.dt-num b { font: 500 36px/1 var(--serif); letter-spacing: -0.03em; }
.dt-top { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; flex: 1; font-size: 13px; color: var(--ink-2); }
.dt-top li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.dt-go { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--accent); white-space: nowrap; }
@media (max-width: 640px) {
  .mv-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "flat pct" "price diff"; row-gap: 2px; padding-top: 8px; padding-bottom: 8px; }
  .mv-flat { grid-area: flat; } .mv-pct { grid-area: pct; } .mv-price { grid-area: price; text-align: left; } .mv-diff { grid-area: diff; }
  .mv-date, .mv-go, .mv-why { display: none; }
  .lede { font-size: 15.5px; }
}
.chip-sep { width: 1px; margin: 6px 4px; background: var(--line); }

/* sections */
.grid-main { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 24px; }
.grid-two { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1100px) { .grid-main, .grid-two { grid-template-columns: minmax(0, 1fr); } }
.block { margin-top: 24px; }
section[id] { scroll-margin-top: 76px; }
.pane { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 640px) { .pane { padding: 16px; } }
.pane-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.pane-head > div:first-child { display: flex; flex-direction: column; gap: 4px; }
h2.t { margin: 0; font: 500 26px/1.15 var(--serif); letter-spacing: -0.02em; color: var(--ink); }
@media (max-width: 640px) { h2.t { font-size: 22px; } }
.note { font-size: 12.5px; color: var(--muted); max-width: 640px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.sw-min { width: 2px; height: 12px; background: var(--hot); }
.sw-med { height: 12px; border-left: 1px dashed var(--muted); }
/* Есть подешевевшие за период — они яркие, остальные приглушены. */
.sw-dot.faded { opacity: 0.3; }
.strip.has-cut .splot .dot:not(.cut) { opacity: 0.25; }
.strip.has-cut .splot .dot:not(.cut):hover { opacity: 1; }
.more-row { display: flex; align-items: center; gap: 12px; padding-top: 4px; font-size: 13px; }

.seg { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunken); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg button span { font: 11px var(--mono); opacity: 0.7; margin-left: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.sm button { height: 28px; padding: 0 9px; font-size: 12.5px; }

/* strip plot */
.strip { position: relative; }
.srow { display: flex; height: 64px; border-top: 1px solid var(--line-2); }
.srow-label { width: 140px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.srow-label b { font-size: 14px; font-weight: 500; color: var(--ink); }
.srow-label span { font: 11px var(--mono); color: var(--muted); }
.srow.off .srow-label b { color: var(--faint); }
.splot { position: relative; flex-grow: 1; }
.splot .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.splot .med { position: absolute; top: 16px; height: 32px; border-left: 1px dashed var(--muted); }
.splot .min { position: absolute; top: 10px; height: 44px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--hot); pointer-events: none; }
.splot .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); opacity: 0.78; box-shadow: 0 0 0 1.5px var(--surface); transition: transform 120ms, opacity 120ms; }
.splot .dot:hover, .splot .dot:focus-visible { transform: scale(1.6); opacity: 1; outline: none; z-index: 2; }
.splot .dot.cut { opacity: 0.95; z-index: 1; }
.srow.off .dot { background: var(--off); opacity: 0.6; }
.srow.off .min, .srow.off .med { opacity: 0.35; }
.saxis { display: flex; height: 28px; border-top: 1px solid var(--line); }
.saxis .splot span { position: absolute; top: 8px; transform: translateX(-50%); font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .srow-label span { font-size: 10.5px; }
}

/* structure */
.mixbar { display: flex; height: 14px; gap: 2px; border-radius: 4px; overflow: hidden; }
.mixbar span { transition: opacity 150ms; }
.mix-t td { height: 56px; transition: opacity 150ms; }
.mix-t .type { display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.mix-t .type i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.mix-t .type small { display: block; font-size: 12px; color: var(--muted); }

/* dynamics */
.dyn-cap { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.dyn-cap b { font-size: 20px; font-weight: 500; color: var(--ink); }

/* yield */
.ysum { text-align: right; margin-left: auto; }
.ysum div:first-child { font: 34px/1 var(--serif); color: var(--ink); }
.ysum div + div { font-size: 12px; color: var(--muted); margin-top: 4px; }
.yrow { display: grid; grid-template-columns: 76px minmax(120px, 300px) minmax(0, 1fr); column-gap: 16px; align-items: center; min-height: 56px; border-top: 1px solid var(--line-2); }
.yrow > b { font-weight: 500; color: var(--ink); }
.ybar { position: relative; height: 22px; }
.ybar .track, .ybar .fill { position: absolute; left: 0; top: 7px; height: 8px; border-radius: 4px; }
.ybar .track { right: 0; background: var(--sunken); }
.ybar .fill { background: var(--accent); }
.ybar .fill.few { background: repeating-linear-gradient(135deg, var(--accent) 0 3px, rgba(var(--accent-rgb), 0.25) 3px 6px); }
.ybar .alt { position: absolute; top: 1px; width: 2px; height: 20px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.yval { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yval div { display: flex; flex-direction: column; line-height: 1.25; }
.yval div span:first-child { font-size: 14px; color: var(--ink); }
.yval div span + span { font-size: 11px; color: var(--muted); }
.yrow.yaxis { border-top: 1px solid var(--line); padding-top: 8px; min-height: 0; }
.yaxis .ticks { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--muted); }
.yaxis .key { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.yaxis .key i { width: 2px; height: 12px; background: var(--ink); }
@media (max-width: 640px) { .yrow { grid-template-columns: 64px minmax(0, 1fr) 84px; } .yval .pill { display: none; } }

/* tables */
.tbl-scroll { overflow: auto; border-top: 1px solid var(--line); }
@media (min-width: 1101px) { .tbl-scroll.tall { overflow: visible; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 0 8px; height: 44px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; height: 40px; background: var(--surface); border-bottom-color: var(--line); font: 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
/* При прокрутке страницы заголовок таблицы — под верхней панелью. */
@media (min-width: 1101px) { .tbl-scroll.tall th { top: 60px; } }
th.r, td.r { text-align: right; }
td.num { font-size: 13px; }
th button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
th button:hover, th button[data-active] { color: var(--ink); }
tr.lot { transition: background 120ms; }
tr.lot:hover { background: var(--paper); }
td b { font-weight: 500; color: var(--ink); }
.go { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted); flex-shrink: 0; }
.go:hover { background: var(--sunken); color: var(--ink); }
.go.sm { width: 24px; height: 24px; }
.dbar { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.dbar .trk { position: relative; width: 64px; height: 8px; border-radius: 2px; background: var(--sunken); }
.dbar .trk::before { content: ""; position: absolute; left: 32px; top: -2px; width: 1px; height: 12px; background: var(--faint); }
.dbar .trk i { position: absolute; top: 0; height: 8px; border-radius: 2px; }
.dbar .v { width: 56px; text-align: right; font-size: 12.5px; }
.down { color: var(--accent); }
.up { color: var(--hot-ink); }

/* overview */
.ov-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ov-tools .chips { margin-right: auto; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.filter { position: relative; display: flex; align-items: center; color: var(--muted); }
.filter svg { position: absolute; left: 12px; pointer-events: none; }
.filter input { width: 300px; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 14px var(--sans); }
.filter input::placeholder { color: var(--faint); }
.filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
@media (max-width: 640px) { .filter, .filter input { width: 100%; } }
table.ov td { height: 64px; }
tr.zrow { cursor: pointer; transition: background 120ms; }
tr.zrow:hover { background: var(--paper); }
td.zcell { white-space: normal; min-width: 200px; }
.zk { text-decoration: none; }
.zk b { font-size: 15px; }
.zk:hover b { color: var(--accent); }
.sub { margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.sub.num { font-size: 11.5px; }
.sub.down { color: var(--accent); }
.sub.up { color: var(--hot-ink); }
tr.grp td { height: 36px; background: var(--paper); border-bottom-color: var(--line); }
tr.grp:not(:first-child) td { border-top: 1px solid var(--line); }
.spark { display: inline-block; vertical-align: middle; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); }
.badges { display: inline-flex; gap: 4px; justify-content: flex-end; }
mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 1px; }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 640px) { .hide-sm { display: none; } td.zcell { min-width: 0; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--sunken); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip span { font: 11px var(--mono); opacity: 0.65; }

details.more summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; font-family: var(--mono); color: var(--muted); }
details.more[open] summary::before { content: "−"; }
details.more .tbl-scroll { margin-top: 12px; }

.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 28px; color: var(--muted); text-align: center; }

/* line charts */
svg.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
svg.chart text { font: 11px var(--mono); fill: var(--muted); }
svg.chart .gridline { stroke: var(--grid); }
svg.chart .axis { stroke: var(--line); }
svg.chart .area { fill: rgba(var(--accent-rgb), 0.07); }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.chart .pt.hot { stroke: var(--ink); }
svg.chart .cross { stroke: var(--faint); stroke-dasharray: 3 3; }

/* footer */
footer { margin-top: 40px; border-top: 1px solid var(--line); }
footer .wrap { padding-top: 32px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 24px 48px; }
@media (max-width: 900px) { footer .wrap { grid-template-columns: minmax(0, 1fr); } }
.foot-note { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: flex-start; font-size: 13px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* хлебные крошки, «Кратко», вопросы-ответы, текстовые страницы */
.bc ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 24px 0 0; list-style: none; font-size: 13px; color: var(--muted); }
.bc li + li::before { content: "/"; margin: 0 8px; color: var(--faint); }
.bc a { color: var(--muted); text-decoration: none; }
.bc a:hover { color: var(--ink); }
.hero h1, .prose h1 { font-size: clamp(30px, 3.8vw, 52px); }
.bc + .hero { padding-top: 8px; }
.brief p, .lede p { margin: 0 0 6px; max-width: 860px; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.brief p:last-child, .lede p:last-child { margin-bottom: 0; }
.faq h3 { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.faq p { margin: 0; max-width: 860px; }
.faq a, .prose a { color: var(--accent-ink); }
.prose { max-width: 860px; }
.prose h2 { margin: 32px 0 8px; font: 500 24px/1.2 var(--serif); color: var(--ink); }
.prose p { font-size: 16px; line-height: 1.6; }
a.linkish { text-decoration: none; }
.jobs { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }

/* palette */
.palette { width: min(640px, calc(100vw - 32px)); max-width: none; height: fit-content; max-height: min(600px, calc(100vh - 20vh - 24px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); box-shadow: var(--pop); overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; }
.palette::backdrop { background: var(--scrim); }
.pal-search { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); flex-shrink: 0; }
.pal-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font: 16px var(--sans); }
.pal-search input::placeholder { color: var(--faint); }
.pal-close { padding: 0; border: 0; background: none; cursor: pointer; }
.pal-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pal-group { padding: 10px 10px 4px; font: 10.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pal-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; min-height: 48px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.pal-item[aria-selected="true"] { background: var(--sunken); }
.pal-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pal-name b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-name small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-badges { display: inline-flex; gap: 4px; }
.pal-price { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pal-rest { display: block; width: 100%; padding: 6px 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-size: 12.5px; text-align: left; cursor: pointer; }
.pal-rest:hover { background: var(--sunken); }
.pal-empty, .pal-more { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.pal-more { padding: 10px; }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-shrink: 0; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) {
  .palette { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .pal-foot, .pal-price { display: none; }
}

/* tooltip */
.tip { position: fixed; z-index: 20; pointer-events: none; opacity: 0; min-width: 200px; padding: 10px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12.5px; line-height: 1.5; transform: translate(-50%, calc(-100% - 12px)); transition: opacity 120ms; }
.tip.on { opacity: 1; }
.tip .tt { font-weight: 500; margin-bottom: 4px; }
.tip .tr { display: flex; justify-content: space-between; gap: 16px; font: 11.5px var(--mono); }
.tip .tr span:first-child { opacity: 0.7; }
.tip .down, .tip .up { color: inherit; }

/* motion */
.skel { border: 0; background: var(--sunken); animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

.skeleton { padding: 120px 0; color: var(--muted); font: 13px var(--mono); }
.error { margin: 40px 0; padding: 20px; border-radius: 12px; background: var(--hot-soft); color: var(--hot-ink); font: 13px var(--mono); white-space: pre-wrap; }

/* -------------------------------------------------------------- админка: навигация, формы ---- */
.sections { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.section-link { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background 150ms, color 150ms; }
.section-link:hover { color: var(--ink); background: var(--sunken); }
.section-link.active { color: var(--ink); background: var(--sunken); }
@media (max-width: 640px) { .logout-label { display: none; } }

.field { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: 14px var(--sans); }
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.field-num { width: 84px; }
.field-time { width: 96px; }
.field-date { width: 150px; }
.field-url { width: 220px; font-size: 12.5px; }
.field.saved { border-color: var(--ok-ink); box-shadow: 0 0 0 3px var(--ok-soft); }
select.field { padding-right: 28px; }
textarea.field { height: auto; padding: 8px 12px; resize: vertical; font: 13px var(--mono); }
.btn.danger { color: var(--hot-ink); border-color: var(--hot-soft); }
.btn.danger:hover { background: var(--hot-soft); }
.btn:disabled { opacity: 0.55; cursor: default; }
.linkish.sm { font-size: 12px; margin-left: 8px; }
.chip span { margin-left: 2px; font: 11px var(--mono); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 16px; align-items: end; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-wide { grid-column: span 2; }
.form-check { flex-direction: row; align-items: center; gap: 8px; height: 36px; font-size: 13px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-error { color: var(--hot-ink); font-size: 12.5px; }
.inline-error.ok { color: var(--ok-ink); }
h2.t.sm { font-size: 20px; }
.mt-s { margin-top: 8px; }
.mt-m { margin-top: 12px; }
td.wrap-cell { white-space: normal; }
td.err-cell { white-space: normal; max-width: 420px; }

.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--sunken); font-size: 13px; }
#jobs-bulk { margin: 12px 0 4px; }
.bulk-scope { flex-basis: 100%; }
.bulk-group { display: inline-flex; gap: 6px; align-items: center; }
table.queue th.cb, table.queue td.cb { width: 28px; padding-right: 0; }
.add-form { display: flex; gap: 8px; align-items: flex-start; }
.add-form textarea { flex: 1; min-width: 0; }
.add-result { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.add-result:empty { display: none; }
.url-cell { display: flex; align-items: center; gap: 2px; }
tr.selected td { background: var(--paper); }
table.catalog td { height: 56px; padding-top: 6px; padding-bottom: 6px; }
table.catalog th.cb, table.catalog td.cb { width: 28px; padding-right: 0; }
table.catalog td.zcell { min-width: 220px; }
table.catalog td.plan { white-space: normal; min-width: 150px; }
table.catalog td.plan .sub { white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.icon-btn { min-width: 36px; justify-content: center; padding-left: 0; padding-right: 0; }
.icon-btn svg.i { width: 14px; height: 14px; }
.icon-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
table.catalog .sub a { color: var(--accent); }
/* Строка «Настроить» под ЖК: город, частота, ссылки. */
table.catalog tr.edit-row > td { height: auto; padding: 4px 8px 16px; background: var(--paper); white-space: normal; }
tr.edit-row + tr td, tr:has(+ tr.edit-row) td { border-bottom-color: transparent; }
table.catalog tr:has(+ tr.edit-row) > td { background: var(--paper); }
table.catalog tr.edit-row > td:last-child { position: static; box-shadow: none; }
.edit-grid { display: grid; grid-template-columns: 170px 150px 150px minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; align-items: end; }
.edit-grid .field-url { width: 100%; min-width: 0; }
.edit-grid .url-cell { min-width: 0; }
.edit-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; }
@media (max-width: 900px) { .edit-grid { grid-template-columns: 1fr 1fr; } .edit-wide { grid-column: 1 / -1; } }
/* Узкий экран: строка каталога — карточка (название; продажа | аренда; квартиры | действия). */
@media (max-width: 900px) {
  table.catalog, table.catalog tbody { display: block; }
  table.catalog thead { display: none; }
  table.catalog tr[data-id] { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "cb name name" ". sale rent" ". lots act"; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  table.catalog tr[data-id] > td { display: block; height: auto; padding: 0; border: 0; white-space: normal; min-width: 0; position: static; box-shadow: none; background: none; text-align: left; }
  table.catalog tr[data-id] > td:nth-child(1) { grid-area: cb; }
  table.catalog tr[data-id] > td:nth-child(2) { grid-area: name; }
  table.catalog tr[data-id] > td:nth-child(3) { grid-area: sale; }
  table.catalog tr[data-id] > td:nth-child(4) { grid-area: rent; }
  table.catalog tr[data-id] > td:nth-child(5) { grid-area: lots; align-self: center; }
  table.catalog tr[data-id] > td:nth-child(6) { grid-area: act; align-self: center; }
  table.catalog td.plan::before, table.catalog td.num::before { display: block; margin-bottom: 4px; font: 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  table.catalog td[data-kind="sale"]::before { content: "Продажа"; }
  table.catalog td[data-kind="rent"]::before { content: "Аренда"; }
  table.catalog td.num::before { content: "Квартир · срез"; }
  table.catalog td.num .sub { display: inline; margin-left: 6px; }
  table.catalog td.plan .sub { white-space: normal; }
  table.catalog tr.edit-row { display: block; }
  table.catalog tr.edit-row > td { display: block; }
  table.catalog tr.edit-row > td:first-child { display: none; }
  table.catalog tr:has(+ tr.edit-row) { border-bottom-color: transparent; background: var(--paper); }
  #catalog-table { overflow: visible; }
}
@media (max-width: 480px) {
  table.catalog tr[data-id] { grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "cb name" ". sale" ". rent" ". lots" ". act"; }
  table.catalog .row-actions { justify-content: flex-start; }
  .edit-grid { grid-template-columns: 1fr; }
}

.meter { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter.hot > i { background: var(--hot); }
.hrow-meter { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(88px, auto); align-items: center; gap: 10px; font-size: 12.5px; }
.hrow-meter .num { text-align: right; }
.alerts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--hot-soft); color: var(--hot-ink); font-size: 13.5px; }

.egress-card { margin-bottom: 16px; }
a.egress-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
a.egress-link:hover { border-color: var(--accent); }
@media (max-width: 900px) { .form-wide { grid-column: auto; } }
.egress-stats { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.bars { display: block; margin-top: 6px; }
.bars rect { fill: var(--accent); }
.bars line { stroke: var(--hot); stroke-width: 1; stroke-dasharray: 3 3; }
.bars rect.blk { fill: var(--hot); }
.bars text { font: 10px var(--mono); fill: var(--muted); text-anchor: middle; }
.legend-blk { display: inline-block; width: 10px; height: 6px; border-radius: 2px; background: var(--hot); vertical-align: middle; }
/* Состояние выхода: одна главная строка и проверки цепочки агент → Chrome → прокси → ЦИАН. */
.st-block { display: flex; flex-direction: column; gap: 10px; }
.st-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 17px; }
.st-main .dot { width: 10px; height: 10px; align-self: center; margin-right: 0; }
.st-main.tone-ok b { color: var(--ok-ink); } .st-main.tone-hot b { color: var(--hot-ink); }
.st-main.tone-warn b { color: var(--warn-ink); } .st-main.tone-accent b { color: var(--accent-ink); }
.st-main.tone-muted b { color: var(--muted); }
.st-detail { font-size: 13.5px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.st-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.st-check { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.st-check .muted { margin-right: 4px; }
.egress-card .st-block { margin: 6px 0 14px; }
.egress-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.proxy-add { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: center; }
.proxy-add .field { flex: 1 1 260px; width: auto; min-width: 0; font-family: var(--mono); }
.proxy-add .inline-error { flex-basis: 100%; }
.proxy-now { margin-bottom: 10px; font-size: 14px; }

.progress { display: flex; height: 14px; margin: 16px 0 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress > i { display: block; height: 100%; transition: width .6s ease; }
.progress .done { background: var(--ok); }
.progress .failed { background: var(--hot); }
.progress .running { background: var(--accent); }
.progress .running { background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); background-size: 200% 100%; animation: progress-run 1.6s linear infinite; }
@keyframes progress-run { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .progress .running { animation: none; } }
.progress-warn { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--hot-ink); }
.progress-warn li::before { content: "! "; font-weight: 600; }
.launch { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.launch select { min-width: 240px; max-width: 100%; }

/* Полоса сбора под меню — на всех разделах, кроме «Сбора»; прилипает под верхней панелью. */
.collect-strip { position: sticky; top: 61px; z-index: 9; background: var(--surface); border-bottom: 1px solid var(--line); }
.strip-link { display: flex; align-items: center; gap: 14px; min-height: 38px; padding: 6px 0; color: var(--ink-2); font-size: 12.5px; text-decoration: none; }
.strip-link:hover .strip-title { color: var(--accent); }
.strip-title { font-weight: 600; color: var(--ink); white-space: nowrap; }
.strip-bar { flex: 0 1 220px; min-width: 80px; }
.strip-bar .progress { height: 6px; margin: 0; }
.strip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .strip-text { white-space: normal; } .strip-link { flex-wrap: wrap; gap: 4px 10px; } .strip-bar { flex-basis: 100%; } }

/* Каталог: панель «Собрать … через …», пояснение к дублям, меню «⋯» в строке. */
.collect-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; }
.collect-bar[hidden] { display: none; }
.collect-bar select { height: 32px; max-width: 100%; }
.bulkbar { margin-top: 12px; }
#cat-msg { margin-top: 10px; font-size: 13px; }
.dup-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--hot-soft); color: var(--hot-ink); font-size: 13px; }
/* Действия строки видны всегда: широкая таблица прокручивается под ними. */
table.catalog th:last-child, table.catalog td:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(0, 0, 0, .25); }
table.catalog tr.selected td:last-child { background: var(--paper); }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; position: relative; }
.row-actions .inline-error { position: absolute; right: 0; top: 100%; white-space: nowrap; z-index: 2; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.menu { position: relative; }
/* Закреплённая ячейка — свой слой (sticky + z-index): с открытым меню она должна быть выше соседних строк. */
table.catalog td:has(details.menu[open]) { z-index: 4; }
.menu > summary { list-style: none; cursor: pointer; min-width: 36px; justify-content: center; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: fixed; z-index: 40; min-width: 170px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--pop); display: flex; flex-direction: column; }
.menu-item { text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 13px var(--sans); cursor: pointer; }
.menu-item:hover { background: var(--sunken); }
.menu-item.danger { color: var(--hot-ink); }
.t-summary { cursor: pointer; font: 500 18px/1.2 var(--serif); color: var(--ink); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(360px, 100%); }
.login-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }

/* ---------------------------------------------------------------- пульт сбора (админка) ---- */
.tone-text-ok { color: var(--ok-ink); } .tone-text-accent { color: var(--accent-ink); } .tone-text-warn { color: var(--warn-ink); }
.tone-text-hot { color: var(--hot-ink); } .tone-text-muted { color: var(--muted); }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--faint); vertical-align: 1px; }
.dot.tone-ok { background: var(--ok); } .dot.tone-accent { background: var(--accent); } .dot.tone-warn { background: var(--warn); }
.dot.tone-hot { background: var(--hot); } .dot.tone-muted { background: var(--faint); }
.dot.live { box-shadow: 0 0 0 0 currentColor; color: var(--ok); animation: dot-live 1.8s ease-out infinite; }
@keyframes dot-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

.pulse { margin-top: 32px; padding: 28px 28px 22px; }
.pulse-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; }
.pulse-title { display: flex; align-items: center; font: 500 34px/1.1 var(--serif); letter-spacing: -0.02em; }
.pulse-title .dot { width: 12px; height: 12px; margin-right: 14px; }
.pulse-sub { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }
.pulse-pct { font: 64px/0.9 var(--serif); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pulse-pct span { font-size: inherit; }
.progress.thick { height: 18px; margin: 22px 0 6px; }
.pulse-kpis { margin-top: 18px; border-top: 1px solid var(--line-2); }
.pulse-kpis .kpi { padding: 16px 18px 6px; }
.pulse-kpis .kpi-value span:first-child { font-size: 32px; }
.kpi-value.tone-text-hot span:first-child { color: var(--hot-ink); } .kpi-value.tone-text-warn span:first-child { color: var(--warn-ink); }
.pulse .progress-warn { margin-top: 14px; }
.pulse .progress-warn li { color: var(--warn-ink); }

.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lane { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; color: inherit; text-decoration: none; border-top: 3px solid var(--line); transition: border-color .2s, transform .2s; }
.lane:hover { transform: translateY(-1px); border-color: var(--accent); }
.lane.tone-ok { border-top-color: var(--ok); } .lane.tone-warn { border-top-color: var(--warn); }
.lane.tone-hot { border-top-color: var(--hot); } .lane.tone-accent { border-top-color: var(--accent); }
.lane-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.lane-state { font-size: 13.5px; min-height: 2.6em; }
.lane-meters { display: flex; flex-direction: column; gap: 6px; }
.bars.mini { width: 100%; height: 40px; }
.lane-foot { font-size: 12px; }

.feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 44px auto minmax(0, 1fr); align-items: baseline; gap: 0 4px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.feed-item:first-child { border-top: 0; }
.feed-item.new { animation: feed-in .6s ease-out; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-6px); background: var(--accent-soft); } to { opacity: 1; transform: none; background: transparent; } }
.feed-time { color: var(--muted); font-size: 12px; }
.feed-body { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.feed-error { flex-basis: 100%; color: var(--hot-ink); font-size: 12.5px; }
.all-clear { display: flex; align-items: center; padding: 14px 0; color: var(--ok-ink); font-size: 15px; }

table.queue .dot { margin-right: 6px; }
.nowrap { white-space: nowrap; }
details.err summary { cursor: pointer; color: var(--muted); list-style: none; }
details.err summary::-webkit-details-marker { display: none; }
details.err[open] summary { color: var(--ink-2); }
details.err > div { margin-top: 4px; color: var(--hot-ink); font-size: 12.5px; }
.chip .dot { margin-right: 2px; width: 7px; height: 7px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--ok);
  background: var(--surface); box-shadow: var(--pop); font-size: 13.5px; animation: toast-in .25s ease-out; }
.toast.tone-hot { border-left-color: var(--hot); } .toast.tone-warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast-body { flex: 1; min-width: 0; }
.toast-close { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

td.flash { animation: cell-flash 1.6s ease-out; }
@keyframes cell-flash { from { background: var(--accent-soft); } to { background: transparent; } }

@media (max-width: 640px) {
  .pulse { padding: 20px 16px 16px; }
  .pulse-title { font-size: 26px; }
  .pulse-pct { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.live, .feed-item.new, .toast, td.flash, .progress .running { animation: none; }
  .progress > i, .lane { transition: none; }
}

/* Лента «Только что»: через какой выход шёл сбор и сколько занял. */
.feed-meta { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.etag { display: inline-block; padding: 2px 8px; border-radius: 99px; font: 11px/1.4 var(--mono); white-space: nowrap; }
.etag-home { background: var(--sunken); color: var(--ink-2); }
.etag-proxy { background: var(--accent-soft); color: var(--accent-ink); }
.took { font: 11.5px var(--mono); color: var(--muted); white-space: nowrap; }

/* хабы: список метро / застройщиков */
.hub-list { list-style: none; margin: 0; padding: 4px 0; columns: 3 240px; column-gap: 32px; }
.hub-list li { padding: 7px 0; break-inside: avoid; }
