/* Портал Sales Drive, направление A «Отчёт».
   Раскладка: белая навигационная колонка слева, справа страница-отчёт на холодной бумаге;
   данные живут в белых карточках с тонкой линией, заголовки набраны антиквой. */
:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --sunken: #e9ebf3;
  --line: #e4e6ef;
  --line-soft: #eef0f5;
  --line-strong: #c9cddb;
  --ink: #151936;
  --ink-2: #454a66;
  --muted: #6a6f88;
  --accent: #2b357a;
  --accent-hover: #1d2560;
  --accent-soft: #eef0fa;
  --on-accent: #ffffff;
  --off: #4450c4;
  --ready: #e8703a;
  --muted-series: #8e93a6;
  --tier-1: #2a8f86;
  --tier-2: #4450c4;
  --tier-3: #b07a1e;
  /* Ценовые сегменты на плитках с белым текстом: темнее линейных, контраст текста не ниже 4,6:1 */
  --tier-1-tile: #00836e;
  --tier-2-tile: #4450c4;
  --tier-3-tile: #8f6214;
  /* Изменение объёма на плитках: падение — красные, рост — зелёные, в пределах ±10% — серый */
  --chg-1: #b42318;
  --chg-2: #d9776d;
  --chg-3: #d3d6df;
  --chg-4: #5fb488;
  --chg-5: #0f7b45;
  --up: #0f7b45;
  --down: #b42318;
  --warn: #8f5600;
  --up-soft: #e6f4ec;
  --down-soft: #fbeceb;
  --warn-soft: #fdf2dd;
  --scrim: rgba(21, 25, 54, 0.42);
  --shadow-pop: 0 10px 30px rgba(21, 25, 54, 0.16);
  --shadow-ctl: 0 1px 2px rgba(21, 25, 54, 0.14);
  /* Тень плиток — та же, что под столбцами графиков (.bars-sh) */
  --shadow-tile: 3px 4px 5px rgba(21, 25, 54, 0.30);
  --shadow-tile-hover: 4px 6px 10px rgba(21, 25, 54, 0.36);
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-card: 16px;
  --r-ctl: 11px;
  --r-sm: 8px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --nav-w: 248px;
  --tabbar-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--off); outline-offset: 2px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.serif { font-family: var(--font-display); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--ink); }
.brand img { display: block; width: 34px; height: 34px; }
.brand-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 12.5px; color: var(--muted); line-height: 1.2; }

.search-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted);
  font-size: 13.5px; text-align: left;
}
.search-btn:hover { border-color: var(--line-strong); }
.search-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--surface); }

.nav-groups { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; color: var(--muted); padding: 0 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 14.5px;
}
.nav-item svg { color: var(--muted); }
.nav-item:hover { background: #f3f4f9; color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item span { flex: 1; min-width: 0; }
.tag { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; }
.nav-item[aria-current="page"] .tag { background: var(--surface); }

.nav-foot { display: flex; flex-direction: column; gap: 12px; }
.fresh {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 11px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2);
}
.fresh:hover { border-color: var(--line-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-top: 6px; flex-shrink: 0; }
.dot.warn { background: #c97a00; }
.dot.bad { background: var(--down); }
.fresh-t { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.fresh-s { display: block; font-size: 12px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: none; background: transparent; border-radius: 10px; text-align: left; }
.me:hover { background: #f3f4f9; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.me-n { display: block; font-size: 14px; font-weight: 600; }
.me-r { display: block; font-size: 12px; color: var(--muted); }

.main { min-width: 0; overflow-x: clip; }
.topbar { display: none; }
.tabbar { display: none; }
.page { max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); padding-block: 34px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-narrow { max-width: 980px; }

/* ---------- шапка страницы ---------- */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.ph-t { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.h1 { font-family: var(--font-display); font-size: clamp(27px, 2.7vw, 38px); line-height: 1.08; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.ph-sub { font-size: 14px; color: var(--muted); }
.ph-c { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; min-width: 0; max-width: 100%; }
.ph-c > .seg, .toolbar > .seg, .card-c > .seg { min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; min-width: 0; }
.toolbar .grow { flex: 1; min-width: 0; }

/* ---------- элементы управления ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--sunken); border-radius: var(--r-ctl); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  height: 36px; padding: 0 13px; border: none; border-radius: 8px; background: transparent;
  font-size: 13.5px; color: var(--ink-2); white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-ctl); font-weight: 600; color: var(--ink); }
.seg.sm button { height: 30px; padding: 0 10px; font-size: 13px; }
.seg.sm { padding: 3px; border-radius: 9px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px;
  border: 1px solid #d9dce8; border-radius: var(--r-ctl); background: var(--surface); color: var(--ink);
  font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); color: var(--ink); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); font-weight: 500; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 12px; color: var(--ink-2); }
.icon-btn:hover { background: #eceef5; color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input, .select {
  height: 44px; width: 100%; padding: 0 12px; border: 1px solid #d9dce8; border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); font-size: 14.5px; min-width: 0;
}
.input::placeholder { color: var(--muted); }
.input:hover, .select:hover { border-color: var(--line-strong); }
.input:focus, .select:focus { outline: 2px solid var(--off); outline-offset: 0; border-color: var(--off); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6f88' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 14px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.suffix { position: relative; }
.suffix .input { padding-right: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.suffix em { position: absolute; right: 12px; top: 0; height: 44px; display: flex; align-items: center; font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; text-align: left; font-size: 14px; color: var(--ink-2); background: none; border: none; padding: 6px 0; min-height: 44px; }
.switch i { width: 38px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; transition: background 0.15s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-ctl); transition: transform 0.15s; }
.switch[aria-checked="true"] i { background: var(--accent); }
.switch[aria-checked="true"] i::after { transform: translateX(16px); }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 28px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.flush { padding: 0; gap: 0; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; }
.card-ht { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-c { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-left: auto; min-width: 0; max-width: 100%; }
.h2 { font-family: var(--font-display); font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.005em; text-wrap: balance; }
.h3 { font-size: 15px; font-weight: 600; }
.cap { font-size: 13.5px; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); }
.more { font-size: 14px; font-weight: 500; white-space: nowrap; }
.grid { display: grid; gap: 24px; }
.g-17-10 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* показатели */
.kpi-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 24px; flex-wrap: wrap; padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 18px 24px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: none; }
.kpi-l { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.kpi-v { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.kpi-v small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-d { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.kpi-s { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.kpi-s svg { display: block; width: 100%; height: auto; max-width: 260px; }
/* Линия в плитке: круг слева — окно «было», справа — текущее; подсказка над линией. */
.spk { position: relative; max-width: 260px; cursor: crosshair; touch-action: pan-y; border-radius: 6px; }
.spk:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.spk .spk-a { fill: var(--surface); stroke: var(--spark); stroke-width: 1.6; }
.spk .spk-b { fill: var(--accent); }
.spk .spk-h { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.spk .spk-g { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.spk-tip { top: auto; bottom: calc(100% + 8px); width: max-content; min-width: 170px; max-width: 300px; }
.spk-tip .tip-t { white-space: nowrap; }
.kpi-x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); max-width: 260px; }
.kpis.plain .kpi-v { font-size: 28px; }

.d-up { color: var(--up); font-weight: 600; white-space: nowrap; }
.d-down { color: var(--down); font-weight: 600; white-space: nowrap; }
.d-flat { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

.legend { display: flex; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.line { width: 16px; height: 2px; border-radius: 1px; }

/* графики */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; }
.chart text { font-family: var(--font-body); }
.chart:focus-visible { outline-offset: 4px; }
.tip {
  position: absolute; z-index: 5; min-width: 150px; max-width: 240px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
  padding: 9px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px;
}
.tip-t { font-size: 12.5px; color: var(--muted); }
.tip-r { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tip-r b { font-weight: 600; }
.tip-r span:last-child { color: var(--muted); }
.tip-sum { border-top: 1px solid var(--line-soft); padding-top: 5px; }

/* таблицы */
.tw { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 8px 0 8px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.tbl td { text-align: right; padding: 13px 0 13px 18px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; }
.tbl td:first-child { font-weight: 500; }
.tbl td.wrap { white-space: normal; overflow-wrap: anywhere; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .l { text-align: left; }
.tbl b { font-weight: 600; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.th-s { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.th-s:hover { color: var(--ink); }
.th-s[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.tbl.dense td { padding-top: 9px; padding-bottom: 9px; }
/* длинные подписи колонок в две строки (раздел «Земля») */
.tbl.hw th:not(:first-child) { white-space: normal; min-width: 72px; max-width: 132px; line-height: 1.25; }
.tbl.hw .th-s { text-align: right; justify-content: flex-end; }
.tbl.hw td.proj { min-width: 120px; max-width: 200px; }
.land-cap { margin-top: -10px; }
/* сноска к оценкам со звёздочкой (цена за фут² GFA, FAR) */
.fn { margin: 14px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.fn.pad { margin: 0; padding: 10px 24px 14px; border-top: 1px solid var(--line-soft); }
@media (max-width: 719px) { .fn.pad { padding: 10px 16px 12px; } }
/* кварталы в блоке динамики земли: плитки в рамке внутри карточки; правила сильнее общих правил .kpi на узких экранах */
.kpis.plain.kq { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); margin: 4px 0 18px; border: 1px solid var(--line-soft); border-radius: 12px; }
.kpis.plain.kq .kpi:nth-child(n) { padding: 14px 18px 12px; gap: 6px; border-top: none; border-left: 1px solid var(--line-soft); grid-column: auto; }
.kpis.plain.kq .kpi:first-child { border-left: none; }
.kpis.plain.kq .kpi:nth-child(n) .kpi-v { font-size: 26px; }
.kpis.plain.kq .kpi:nth-child(n) .kpi-v small { font-size: 14px; }
.kpis.plain.kq .kpi:nth-child(n) .kpi-l { font-size: 13px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 719px) {
  .kpis.plain.kq { grid-template-columns: minmax(0, 1fr); }
  .kpis.plain.kq .kpi:nth-child(n) { border-left: none; border-top: 1px solid var(--line-soft); padding: 12px 14px; gap: 3px; }
  .kpis.plain.kq .kpi:first-child { border-top: none; }
  .kpis.plain.kq .kpi:nth-child(n) .kpi-v { font-size: 22px; }
  .kpis.plain.kq .kpi:nth-child(n) .kpi-v small { font-size: 13px; }
  .kpis.plain.kq .kpi:nth-child(n) .kpi-was { display: inline; }
}
.rank { display: inline-flex; width: 22px; color: var(--muted); font-weight: 400; }

/* списки-строки (телефон и боковые колонки) */
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: inherit; min-width: 0; }
.row:last-child { border-bottom: none; }
a.row:hover, button.row:hover { color: inherit; }
.row-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-t { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.row-s { font-size: 12.5px; color: var(--muted); }
.row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-v { font-size: 15px; font-weight: 600; }
.row-v small { font-size: 12.5px; font-weight: 400; color: var(--muted); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; background: var(--surface); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill.a { background: var(--accent-soft); color: var(--accent); }
.pill.g { background: var(--up-soft); color: var(--up); }
.pill.r { background: var(--down-soft); color: var(--down); }
.pill.w { background: var(--warn-soft); color: var(--warn); }
.pill.n { background: var(--sunken); color: var(--ink-2); }

.bar { height: 8px; border-radius: 4px; background: var(--off); min-width: 2px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.hr { height: 1px; background: var(--line-soft); border: none; margin: 0; }

/* лончи */
.launch { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.launch:last-child { border-bottom: none; }
.launch-d { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.launch-d b { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1; }
.launch-d span { font-size: 12px; color: var(--muted); }
.launch-b { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.launch-n { font-size: 15px; font-weight: 600; }
.launch-m { font-size: 13px; color: var(--muted); }

/* всплывающие слои */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; }
.modal { width: min(640px, 100%); max-height: 80vh; overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-soft); }
.modal-h .input { border: none; height: 40px; padding-left: 4px; font-size: 16px; }
.modal-h .input:focus { outline: none; }
.modal-b { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.res { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--ink); border: none; background: none; width: 100%; text-align: left; min-height: 44px; }
.res:hover, .res.on { background: var(--accent-soft); color: var(--ink); }
.res-k { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.res-t { font-weight: 500; }
.res-s { font-size: 12.5px; color: var(--muted); }
.res-g { font-size: 12px; color: var(--muted); padding: 10px 10px 4px; }

.pop { position: absolute; z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.pop-i { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; border: none; background: none; text-align: left; font-size: 14px; color: var(--ink); }
.pop-i:hover { background: #f3f4f9; color: var(--ink); }
.pop-t { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; }
.pop-b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-2); }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-pop); padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 86vh; overflow: auto; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  max-width: min(520px, calc(100vw - 32px)); background: var(--ink); color: #ffffff; border-radius: 12px; padding: 11px 16px;
  font-size: 14px; box-shadow: var(--shadow-pop); text-align: center;
}

/* вкладки */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 44px; padding: 0 14px; border: none; background: none; font-size: 14.5px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1180px) {
  .g-17-10 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: none; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 1023px) {
  .app { display: block; }
  .nav { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    height: 56px; padding: 0 6px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .topbar img { display: block; width: 28px; height: 28px; }
  .topbar-t { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tabbar a, .tabbar button {
    height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11.5px; border: none; background: none;
  }
  .tabbar [aria-current="page"] { color: var(--accent); font-weight: 600; }
  .page { padding-block: 18px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .ph .h1 { display: none; }
  .ph.keep .h1 { display: block; font-size: 26px; }
  .grid, .stack { gap: 16px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  body { font-size: 15px; }
  .card { padding: 16px 16px 16px; border-radius: 16px; }
  .h2 { font-size: 18px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .kpi-h { padding: 14px 16px 12px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { padding: 12px 12px; gap: 3px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
  .kpi:first-child { grid-column: 1 / -1; border-top: none; border-left: none; padding: 14px 16px 14px; gap: 4px; }
  .kpi:nth-child(odd) { border-left: 1px solid var(--line-soft); }
  .kpi:nth-child(2) { border-left: none; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .kpi:first-child .kpi-v { font-size: 46px; line-height: 1.05; letter-spacing: -0.02em; }
  .kpi:not(:first-child) .kpi-l { font-size: 12px; font-weight: 400; color: var(--muted); }
  .kpi:not(:first-child) .kpi-v { font-size: 20px; }
  .kpi:not(:first-child) .kpi-v small { font-size: 12px; }
  .kpi:not(:first-child) .kpi-d { font-size: 12.5px; }
  .kpi:not(:first-child) .kpi-was, .kpi:not(:first-child) .kpi-s { display: none; }
  .kpis.plain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.plain .kpi:first-child { grid-column: auto; }
  .kpis.plain .kpi:first-child .kpi-v { font-size: 24px; }
  .kpis.plain .kpi .kpi-v { font-size: 24px; }
  .input, .select { font-size: 16px; }
  .seg button { height: 40px; }
  .btn { height: 44px; }
  .hide-m { display: none !important; }
  .scrim { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-height: none; border-radius: 0; }
}
@media (min-width: 720px) { .only-m { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- дополнительные токены ---------- */
:root {
  --spark: #a3a8bf;
  --lt-launch: #4450c4; --lt-launch-soft: #eceefa;
  --lt-upcoming: #b07a1e; --lt-upcoming-soft: #f8f0dd;
  --lt-presale: #2a8f86; --lt-presale-soft: #e2f2f0;
  --lt-new: #8d4aa8; --lt-new-soft: #f2e9f7;
  /* Цвета проектов 7–10 в сравнении (07.11.2026): подобраны по различимости с первыми шестью, в том числе при дальтонизме; их линии ещё и пунктирные */
  --cmp-7: #3a9bd9; --cmp-8: #e05a9a; --cmp-9: #5d6b1a; --cmp-10: #7a3f1d;
}

/* ---------- лончи: календарь ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.cal-w { padding: 7px 8px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.cal-d { min-height: 104px; padding: 6px; border: none; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--surface); text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); }
button.cal-d:hover { background: var(--surface-2); }
.cal-d.out { background: var(--surface-2); }
.cal-d.war { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--sunken) 6px 7px); color: var(--muted); }
.cal-d[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font-size: 12.5px; font-weight: 500; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-n.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-c { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; min-width: 0; }
.cal-c span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 2px; }
.cal-dots { display: none; gap: 3px; align-items: center; flex-wrap: wrap; }
.lc-list { display: flex; flex-direction: column; gap: 8px; }
.lc-list.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; align-items: start; }
.lc { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.lc-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 12px 12px 14px; border: none; background: none; text-align: left; border-radius: 12px; }
.lc-h:hover { background: var(--surface-2); }
.lc-h .row-m { gap: 4px; flex: 1; }
.lc-b { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-soft); }
.lc-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 10px 0 0; }
.lc-dl dt { font-size: 12px; color: var(--muted); }
.lc-dl dd { font-size: 14px; overflow-wrap: anywhere; }
.lc-u { display: flex; flex-direction: column; gap: 6px; }
.war-h { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; width: 100%; border: none; background: none; padding: 0; text-align: left; flex-wrap: wrap; }
.war-h .card-ht { flex: 1; min-width: 200px; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; display: flex; flex-direction: column; gap: 20px; }
body[data-route="login"] .nav, body[data-route="login"] .topbar, body[data-route="login"] .tabbar { display: none; }
body[data-route="login"] .app { display: block; }

@media (max-width: 719px) {
  .cal-d { min-height: 52px; padding: 4px; align-items: center; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-w { text-align: center; padding: 6px 2px; }
  .lc-list.two { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- раскрытие строки таблицы ---------- */
.drill { margin: 0 0 0 22px; padding: 10px 14px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.drill .tw { width: 100%; }
.tbl tr[aria-expanded="true"] td { border-bottom-color: transparent; }

/* ---------- карта проектов ----------
   Сама карта — блок .mx-box (MapLibre, ниже); здесь раскладка экрана, чип над картой и списки боковой панели. */
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.map-top { position: absolute; z-index: 3; left: 12px; top: 12px; right: 68px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; box-shadow: var(--shadow-ctl); }
.mp-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* Списки районов и проектов района: ими пользуются клавиатура и экранный диктор, они же работают без WebGL. */
.mp-list { max-height: 480px; overflow-y: auto; margin: -4px -8px 0; padding: 0 8px; overscroll-behavior: contain; }
.mp-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 2px; border: none; border-bottom: 1px solid var(--line-soft); background: none; color: inherit; text-align: left; }
.mp-list li:last-child .mp-row { border-bottom: none; }
.mp-row .row-m { flex: 1; }
.mp-row .row-t { font-size: 14px; }
.mp-row:hover .row-t { color: var(--accent); }

/* горизонтальные столбики и диапазоны */
.hb { display: flex; flex-direction: column; gap: 10px; }
.hb-r { display: grid; grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 10px; border-radius: 5px; background: var(--line-soft); display: block; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 5px; }
.rg { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rg:first-of-type { border-top: none; padding-top: 0; }
.rg-t { font-size: 13px; font-weight: 600; }
.rg-r { display: grid; grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.rg-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rg-b { position: relative; height: 8px; border-radius: 4px; background: var(--line-soft); display: block; }
.rg-b i { position: absolute; top: 0; height: 8px; border-radius: 4px; opacity: 0.55; }
.rg-b em { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.rg-v { white-space: nowrap; color: var(--ink-2); }
.rg-v b { color: var(--ink); font-weight: 600; }
.pbar { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s; }

/* текст отчётов и ответов SDrive */
.md { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.55; }
.md > p, .md > ul, .md > ol, .md > blockquote, .md > h2, .md > h3, .md > h4, .md > h5 { max-width: 78ch; }
.md h2, .md h3, .md h4, .md h5 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin-top: 8px; text-wrap: balance; }
.md h2 { font-size: 21px; } .md h3 { font-size: 18px; } .md h4, .md h5 { font-size: 16px; }
.md ul, .md ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.md ul { list-style: disc; } .md ol { list-style: decimal; }
.md blockquote { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }
.md hr { border: none; height: 1px; background: var(--line); width: 100%; }
.md code { font-size: 13px; background: var(--sunken); padding: 1px 5px; border-radius: 5px; }
.md-t td, .md-t th { text-align: left; padding-left: 0; padding-right: 18px; white-space: normal; }
.md-t td.r, .md-t th.r { text-align: right; white-space: nowrap; padding-right: 0; padding-left: 18px; }
/* колонки таблиц отчёта (md.js): номер — узкая, первая текстовая (проект, район) — с запасом ширины */
.md-t th.rk, .md-t td.rk { width: 1%; white-space: nowrap; color: var(--muted); padding-right: 10px; }
.md-t th.tx1, .md-t td.tx1 { min-width: 200px; }
.md-t th.tx, .md-t td.tx { min-width: 110px; }
.md-t th.dt, .md-t td.dt, .md-t td.nw { white-space: nowrap; }
.md-t td.r + td.tx, .md-t th.r + th.tx, .md-t td.r + td.dt, .md-t th.r + th.dt { padding-left: 18px; }
/* Графики в отчётах OSDrive (блок ```chart, md.js): статичный SVG — тот же на экране, в PDF и по ссылке */
.mdc { margin: 4px 0; padding: 14px 16px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); break-inside: avoid; page-break-inside: avoid; max-width: 860px; }
.mdc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 6px; }
.mdc-t { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.mdc-u { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mdc-leg { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 4px; font-size: 13px; color: var(--ink-2); }
.mdc-leg span { display: inline-flex; align-items: center; gap: 7px; }
.mdc-leg i { display: inline-block; flex-shrink: 0; width: 11px; height: 11px; border-radius: 3px; }
.mdc-leg i.ln { width: 16px; height: 3px; border-radius: 2px; }
.mdc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.md-pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--sunken); overflow: auto; font-size: 12.5px; white-space: pre; }
@media (max-width: 720px) { .mdc { padding: 12px 10px 8px; } }

/* Ответ OSDrive с отчётом — как экран портала (выбор Олега 04.10.2026): шапка с кнопками, плитки с главными цифрами,
   разделы в карточках (графики, таблицы), «Вывод». Без рамки с прокруткой и без абзацев-пересказов. */
.msg.ans-m { display: block; }
.ans { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1080px; }
.ans-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; padding: 4px 2px 0; }
.ans-ht { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 360px; }
.ans-t { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--ink); text-wrap: balance; }
.ans-s { font-size: 13px; color: var(--muted); }
.ans-a { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.md-cards { gap: 12px; }
.md-cards > p, .md-cards > ul, .md-cards > ol, .md-cards > blockquote { max-width: none; }
.card.mds { padding: 18px 22px 16px; gap: 12px; }
.mds-h { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.25; margin: 0; }
.md .mds-h { margin-top: 0; }
.mds .mdc { border: none; padding: 0; margin: 0; max-width: none; background: none; }
.mds .mdc-t { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.mds > p { font-size: 13px; color: var(--muted); max-width: none; }
.card.mdo { background: var(--accent-soft); border-color: transparent; }
.mdo ul, .mdo ol { gap: 6px; }
.mdk .kpi-v { font-size: 26px; }
.mdk .kpi-v.long { font-size: 19px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 1024px) { .mdk .kpis { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); } }
.rep-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rep-chip .row-m { flex: 1; min-width: 0; }
.rep-chip .row-t, .rep-chip .row-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub.note { background: transparent; border-style: dashed; color: var(--muted); }
.pub-r.pub-cards { padding: 0; }
/* таблицы с длинными подписями (раздел «Земля»: что не вошло) — подпись переносится, числа нет */
.tbl.wrap td.l, .tbl.wrap th.l { white-space: normal; min-width: 260px; }
@media (max-width: 719px) {
  .ans-t { font-size: 19px; }
  .ans-a { width: 100%; }
  .card.mds { padding: 14px 14px 12px; }
  .md-t th.tx1, .md-t td.tx1 { min-width: 160px; }
}

@media (min-width: 1181px) { .kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kpis.k5 .kpi-v { font-size: 26px; } }
@media (max-width: 1180px) { .map-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 719px) { .hb-r, .rg-r { grid-template-columns: minmax(0, 1fr) auto; } .hb-t, .rg-b { grid-column: 1 / -1; order: 3; } }

/* ---------- анализ проекта ---------- */
.bigtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bigtabs button { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.bigtabs button:hover { border-color: var(--line-strong); }
.bigtabs button[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.recent { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.rc { display: flex; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 230px; flex-shrink: 0; }
.rc-b { flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; border: none; background: none; padding: 10px 4px 10px 12px; color: var(--ink); min-width: 0; border-radius: 12px; }
.rc-b:hover { background: var(--surface-2); }
.sugg { display: flex; flex-direction: column; gap: 2px; max-height: 268px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.steps { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--ink-2); }
.banner { border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.banner.w { background: var(--warn-soft); color: var(--warn); }
.banner.r { background: var(--down-soft); color: var(--down); }

/* ---------- калькулятор ---------- */
.calc-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.input.cell { height: 36px; width: 80px; text-align: right; padding: 0 8px; font-variant-numeric: tabular-nums; font-size: 14px; }
.suffix .input.cell { padding-right: 8px; }
.tbl .suffix { display: inline-flex; align-items: center; gap: 8px; }
.tbl .suffix .input { width: 96px; padding-right: 8px; }
.tbl .suffix em { position: static; height: auto; white-space: nowrap; font-size: 12.5px; }
.ppbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.ppbar i { display: block; height: 100%; }
.cf td, .cf th { padding-left: 12px; }
.cf td.ho, .cf th.ho { background: var(--accent-soft); }
.cf td:first-child { position: sticky; left: 0; background: var(--surface); white-space: nowrap; padding-right: 12px; }
.jv-split { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.jv-split span { display: flex; flex-direction: column; gap: 2px; }
.jv-split input[type="range"] { width: 100%; accent-color: var(--accent); height: 44px; }
.mass { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg); padding: 8px; }

/* ---------- SDrive ---------- */
.sd-page { height: calc(100vh - var(--cities-h, 0px)); height: calc(100dvh - var(--cities-h, 0px)); display: flex; flex-direction: column; gap: 14px; padding: 24px var(--gutter) 20px; max-width: 1320px; margin-inline: auto; }
.sd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sd-main { flex: 1; min-height: 0; display: flex; gap: 16px; }
.sd-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sd-feed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 8px; }
.sd-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; max-width: 760px; }
.sd-starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.sd-starters .btn { height: auto; min-height: 44px; padding: 10px 14px; white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.35; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.msg.link { padding-left: 4px; }
.bub { max-width: min(820px, 94%); padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.msg.me .bub { background: var(--accent); border-color: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.msg.me .chip { background: transparent; color: var(--on-accent); border-color: rgba(255, 255, 255, 0.45); }
.bub.think { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--off); animation: pulse 1.1s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
.rep { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; max-width: min(900px, 100%); }
.rep-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.rep-b { max-height: 460px; overflow: auto; padding: 16px 18px; }
.sd-comp { display: flex; flex-direction: column; gap: 8px; }
.sd-fchips[hidden] { display: none; }   /* значки приложенных файлов: пусто — без лишнего отступа */
.sd-row { display: flex; gap: 6px; align-items: flex-end; border: 1px solid #d9dce8; border-radius: 14px; background: var(--surface); padding: 6px; }
.sd-row:focus-within { border-color: var(--off); box-shadow: 0 0 0 1px var(--off); }
.sd-ta { flex: 1; border: none; resize: none; overflow-y: hidden; height: 44px; min-height: 44px; max-height: 120px; padding: 11px 8px; line-height: 1.45; font-size: 15px; background: transparent; }
.sd-ta:focus { outline: none; border: none; }
.sd-ta::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-panel { width: 320px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sd-panel .rc { min-width: 0; }
.sd-full { position: fixed; inset: 0; z-index: 35; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.sd-full-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sd-full-b { flex: 1; min-height: 0; display: flex; }
.sd-toc { width: 260px; flex-shrink: 0; overflow: auto; padding: 16px 10px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.sd-toc button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.sd-toc button:hover { background: var(--accent-soft); color: var(--ink); }
.sd-full-c { flex: 1; min-width: 0; overflow: auto; padding: 28px var(--gutter) 48px; }
.sd-full-c .md { max-width: 980px; }
.sdw-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: none; box-shadow: var(--shadow-pop); z-index: 25; display: flex; align-items: center; justify-content: center; }
.sdw-fab:hover { background: var(--accent-hover); }
.sdw { position: fixed; right: 24px; bottom: 24px; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); z-index: 26; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; }
.sdw-h { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sdw .sd-feed { padding: 12px; }
.sdw .sd-comp { padding: 0 10px 10px; }
.sdw .sd-starters { grid-template-columns: minmax(0, 1fr); }
.sdw .bub { max-width: 100%; }

@media (min-width: 1181px) {
  .kpis.k7, .kpis.k8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.k7 .kpi:nth-child(n+5), .kpis.k8 .kpi:nth-child(n+5) { border-top: 1px solid var(--line); }
  .kpis.k7 .kpi:nth-child(4n+1), .kpis.k8 .kpi:nth-child(4n+1) { border-left: none; }
}
@media (max-width: 1180px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) {
  .sd-page { height: calc(100dvh - 56px - var(--tabbar-h) - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px) - var(--cities-h, 0px)); padding: 12px 16px 10px; gap: 10px; }
  .sd-head .h1 { display: none !important; }
  .sd-panel { position: fixed; inset: 0; z-index: 34; width: auto; border-radius: 0; border: none; padding-top: env(safe-area-inset-top, 0px); }
  .sd-toc { display: none; position: absolute; z-index: 2; left: 0; right: 0; width: auto; max-height: 60%; border-right: none; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-pop); }
  .sd-toc.open { display: flex; }
  .sd-full-b { position: relative; }
  #sdw { display: none !important; }
}
@media (max-width: 719px) { .bigtabs { grid-template-columns: minmax(0, 1fr); } .sd-starters { grid-template-columns: minmax(0, 1fr); } .sd-ta { font-size: 16px; } .jv-split { grid-template-columns: minmax(0, 1fr); } }

.card > .pill { align-self: flex-start; }
.tbl.cmp th, .tbl.cmp td { padding-left: 26px; }
.tbl.cmp th:first-child, .tbl.cmp td:first-child { padding-left: 0; }

/* трёхколоночные плитки: на телефоне в столбик */
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis.k3 .kpi:nth-child(odd) { border-left: 1px solid var(--line); } .kpis.k3 .kpi:first-child { border-left: none; } .kpis.k3 .kpi:nth-child(n+3) { border-top: none; } }
@media (max-width: 719px) {
  .kpis.plain.k3 { grid-template-columns: minmax(0, 1fr); }
  .kpis.plain.k3 .kpi { border-left: none !important; border-top: 1px solid var(--line-soft) !important; }
  .kpis.plain.k3 .kpi:first-child { border-top: none !important; }
  .kpis.plain .kpi-v { white-space: normal; }
}

/* Внутренние прокрутки не должны расширять страницу на телефоне. */
.tw, .seg, .tabs, .recent, .sugg, .rep-b, .sd-feed, .modal-b { contain: paint; }
@media (max-width: 719px) {
  .kpi:not(:first-child) .kpi-v { white-space: normal; }
  .cal + * { min-width: 0; }
}

/* Карта на телефоне: фильтры свёрнуты в одну строку, карта видна сразу. */
.mp-ft { display: none; }
@media (max-width: 719px) {
  .mp-ft { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: -8px 0; padding: 0; border: none; background: none; color: var(--ink); text-align: left; }
  .mp-ft-t { font-weight: 600; }
  .mp-ft .cap { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-f:not(.open) .toolbar { display: none; }
  .mp-f.open .toolbar { margin-top: 18px; }
  /* Переключатель периода занимает всю ширину, а не прижимается вправо. */
  .ph-c { margin-left: 0; width: 100%; }
  .ph-c > .seg { width: 100%; }
  .ph-c > .seg > button { flex: 1 0 auto; }
}

/* Телефон: «было N» видно у каждой плитки; плитки без графика одинаковые. */
@media (max-width: 719px) {
  .kpi:not(:first-child) .kpi-was { display: inline; font-size: 12px; }
  .kpi:not(:first-child) .kpi-d { gap: 1px 6px; }
  .kpis.plain .kpi:first-child { padding: 12px 12px; gap: 3px; }
  .kpis.plain .kpi:first-child .kpi-l { font-size: 12px; font-weight: 400; color: var(--muted); }
  .kpis.plain .kpi:first-child .kpi-d { font-size: 12.5px; gap: 1px 6px; }
  .kpis.plain .kpi:first-child .kpi-was { font-size: 12px; }
}
@media (max-width: 719px) {
  .kpis:not(.plain) .kpi:not(:first-child) { padding: 12px 10px; }
  .kpis:not(.plain) .kpi:not(:first-child) .kpi-v small { display: block; margin-top: 1px; line-height: 1.3; }
  .kpi-was { white-space: nowrap; }
}
.sd-full-h .row-m { min-width: 0; }
.sd-full-h .row-t, .sd-full-h .row-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-form { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; }
@media (max-width: 719px) { .pa-form { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.sugg > *, .recent > * { flex-shrink: 0; }
@media (max-width: 719px) { .sugg .res { flex-wrap: wrap; gap: 2px 12px; } .sugg .res-t { flex: 1; min-width: 0; } .sugg .res-k { flex-basis: 100%; margin-left: 28px; } }
/* Таблица «показатель — значения по проектам»: на телефоне первая колонка узкая и переносится. */
@media (max-width: 719px) {
  .tbl.kv th, .tbl.kv td { padding-left: 12px; white-space: normal; }
  .tbl.kv th:first-child, .tbl.kv td:first-child { padding-left: 0; width: 38%; font-size: 13px; line-height: 1.3; }
  .tbl.kv th span { align-items: flex-start !important; text-align: right; }
}
@media (max-width: 719px) {
  .tbl th { padding-left: 12px; }
  .tbl td { padding: 12px 0 12px 12px; }
}
@media (max-width: 719px) { .cf td:first-child { white-space: normal; min-width: 128px; max-width: 148px; font-size: 13px; line-height: 1.3; } }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.input:disabled, .select:disabled { background: var(--sunken); color: var(--muted); cursor: not-allowed; }

/* Варианты графика: цветовые пары и виды «Сделок по месяцам». */
.vr-ctl { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 16px 28px; }
.pal-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pal { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; }
.pal:hover { border-color: var(--line-strong); }
.pal[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pal-sw { display: inline-flex; gap: 3px; flex-shrink: 0; }
.pal-sw i { display: block; width: 14px; height: 26px; border-radius: 4px; }
.pal-t { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.pal-t small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.vr-h { font-size: 18px; display: flex; align-items: baseline; gap: 10px; }
.vr-l { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; }
.vr-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vr-card .card-h > .btn, .vr-card .card-h > .pill { flex-shrink: 0; }
@media (min-width: 720px) { .vr-card .card-h { flex-wrap: nowrap; } }
.mv-part { display: flex; flex-direction: column; gap: 6px; }
.mv-part + .mv-part { margin-top: 4px; }
@media (max-width: 719px) { .pal { flex: 1 1 calc(50% - 4px); } .vr-ctl { gap: 14px; } }
/* Метка проекта в подписях блоков анализа: цвет проекта и название. */
.pa-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.pa-tag .sw { width: 8px; height: 8px; border-radius: 50%; }
/* Поле для файла: перетащить или нажать. */
.drop { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-t b { color: var(--ink); font-weight: 600; }
/* Мягкая тень под столбцами больших графиков (решение Олега 01.10.2026 по варианту А). */
.bars-sh { filter: drop-shadow(3px 4px 5px rgba(21, 25, 54, 0.30)); }
/* Вход в новую версию портала */
.lg-err { margin: 0; color: var(--down); font-size: 13.5px; }
#gate .login { min-height: 100vh; }
/* Печать отчёта OSDrive: только сам отчёт */
/* Печать открытого отчёта OSDrive: прячем всё, кроме него, — только когда он открыт. Раньше правило действовало на любой странице,
   и «Печать или PDF» на странице отчёта по ссылке /r/… и PDF обзора рынка печатали пустые листы (09.10.2026). */
@media print {
  body:has(.sd-full) * { visibility: hidden !important; }
  body.sd-print * { visibility: hidden !important; }   /* то же для браузеров без :has() — класс ставит s-sdrive.js на время печати */
  .sd-full, .sd-full * { visibility: visible !important; }
  .sd-full { position: absolute; inset: 0; display: block; background: #fff; }
  .sd-full-h, .sd-toc { display: none !important; }
  .sd-full-c { overflow: visible; padding: 0; }
}
/* Выбор района: поле со списком */
.pick { position: relative; width: 340px; max-width: 100%; }
.pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 360px; overflow: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.pick .input { padding-right: 44px; }
.pick-tg { position: absolute; right: 2px; top: 2px; width: 40px; height: calc(100% - 4px); display: flex; align-items: center; justify-content: center; border: none; background: none; color: var(--muted); border-radius: 8px; }
.pick-tg:hover { color: var(--ink); background: var(--accent-soft); }
.pick-list .res[aria-selected="true"] { background: var(--accent-soft); }
.pick-list .empty { padding: 12px; }
.pick-h { display: flex; justify-content: space-between; gap: 12px; position: sticky; top: -4px; margin: -4px -4px 2px; padding: 10px 14px 6px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }

/* Районы графикой: рейтинг, рост и падение, цена и спрос, доля объёма */
.dv-seg { flex-shrink: 0; }
.dv-cap { flex: 1 1 300px; }
.dv { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.dv-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; }
.dv-ht { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dv-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.dvr-list { display: flex; flex-direction: column; }
.dvr { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 124px; gap: 14px; align-items: center; min-height: 36px; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.dvr:hover, .dvr:focus-visible { background: var(--surface-2); color: var(--ink); }
.dvr-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dvr-t { position: relative; display: block; height: 14px; }
.dvr-t i { position: absolute; top: 0; left: 0; height: 100%; background: var(--off); border-radius: 0 4px 4px 0; box-shadow: 0 2px 3px rgba(21, 25, 54, 0.16); }
.dvr-t i.up { background: var(--up); }
.dvr-t i.dn { background: var(--down); border-radius: 4px 0 0 4px; }
.dvr-z::before { content: ''; position: absolute; left: var(--z); top: -15px; bottom: -15px; width: 1px; background: var(--line-strong); }
.dvr-v { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dvr-v b { font-weight: 600; }
.dvr-v > span { font-size: 12.5px; min-width: 52px; text-align: right; }
.dvr-g { font-size: 12.5px; color: var(--muted); padding: 14px 0 4px; }
.dvr-g:first-child { padding-top: 0; }
/* «Рост и падение»: у числа подпись «сделок» — колонка шире (09.10.2026) */
.dvr-list.chg .dvr { grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 196px; }
.dvr-u { font-size: 12.5px; color: var(--muted); margin-left: -6px; }
.dv-more { align-self: flex-start; margin-left: -12px; }
.tip.dv-tip { max-width: none; z-index: 12; }
.tip-g { display: grid; grid-template-columns: auto auto auto; gap: 3px 10px; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-g span { color: var(--muted); font-size: 12.5px; }
.tip-g b { font-weight: 600; text-align: right; }
.sw.dot { border-radius: 50%; background: var(--off); opacity: 0.6; }
.sw.dash { background: repeating-linear-gradient(90deg, var(--ink-2) 0 4px, transparent 4px 7px); }
.dv-sc { touch-action: pan-y; }
.tm { position: absolute; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; overflow: hidden; border-radius: 6px; background: var(--off); color: var(--on-accent); font-size: 12px; line-height: 1.25; box-shadow: var(--shadow-tile); }
.tm.t1 { background: var(--tier-1-tile); }
.tm.t2 { background: var(--tier-2-tile); }
.tm.t3 { background: var(--tier-3-tile); }
.tm.c1 { background: var(--chg-1); }
.tm.c2 { background: var(--chg-2); }
.tm.c3 { background: var(--chg-3); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-tile); }
.tm.c4 { background: var(--chg-4); }
.tm.c5 { background: var(--chg-5); }
.sw.c3 { box-shadow: inset 0 0 0 1px var(--line-strong); }
a.tm:hover, a.tm:focus-visible { filter: brightness(0.86); box-shadow: var(--shadow-tile-hover); }
a.tm.c3:hover, a.tm.c3:focus-visible { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-tile-hover); }
.tm.dk, a.tm.dk:hover, a.tm.dk:focus-visible { color: var(--on-accent); }
.tm.lt, a.tm.lt:hover, a.tm.lt:focus-visible { color: var(--ink); }
.tm b { font-size: 13px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tm.big b { font-size: 15px; }
.tm.sm { padding: 6px 7px; font-size: 11.5px; }
.tm.sm b { font-size: 12px; display: block; white-space: nowrap; text-overflow: ellipsis; }
.tm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.88; font-variant-numeric: tabular-nums; }
.tm-rest { flex-direction: row; align-items: center; gap: 10px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--sunken) 6px 7px); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 719px) {
  .dvr, .dvr-list.chg .dvr { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 8px; }
  .dvr-t { grid-column: 1 / -1; order: 3; height: 10px; }
  .dvr-z::before { top: -3px; bottom: -3px; }
}

/* Вход: регистрация */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rg-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chk { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.chk input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.chk .off { color: var(--muted); text-decoration: line-through; }
.input.otp { text-align: center; font-size: 26px; letter-spacing: 0.4em; font-weight: 600; font-variant-numeric: tabular-nums; height: 56px; }
.rg-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linkbtn { background: none; border: none; padding: 10px 0; min-height: 44px; color: var(--accent); font-size: 14px; font-weight: 500; }
.linkbtn[disabled] { color: var(--muted); cursor: default; }
/* Отчёт по ссылке */
.pub { min-height: 100vh; background: var(--bg); }
.pub-h { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-b { max-width: 1112px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 12px; }
.pub-t { font-size: clamp(24px, 3vw, 34px); }
.pub-r { padding: 20px 22px; }
.pub-f { line-height: 1.6; }
.pub-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30vh 16px 0; }
.pub-miss { max-width: 520px; margin: 0 auto; padding: 22vh 16px 0; text-align: center; display: flex; flex-direction: column; gap: 10px; }
@media print { .pub-h { position: static; border: none; } .pub-h .btn { display: none; } .pub-r { border: none; box-shadow: none; padding: 0; } .pub { background: #fff; } }
/* «Печать или PDF» на странице отчёта по ссылке (09.10.2026): белый лист без серого фона, таблицы целиком в ширину листа
   (обёртка .tw с contain: paint обрезала правые колонки), длинные заголовки колонок переносятся, массинг не рвётся между страницами. */
@media print {
  html.pub-doc, html.pub-doc body { background: #fff; }
  .pub .tw { overflow: visible; contain: none; }
  .pub .md-t { font-size: 11px; }
  .pub .md-t th { font-size: 10px; white-space: normal; word-break: normal; }
  .pub .md-t th, .pub .md-t td { padding-left: 6px; padding-right: 6px; }
  .pub .md-t th.tx1, .pub .md-t td.tx1 { min-width: 0; }
  .pub .md-t td.nw { white-space: normal; }
  .pub-cards .card.mds { break-inside: avoid; page-break-inside: avoid; }
  .pub-cards .mds-h, .pub-cards .card > h2 { break-after: avoid; page-break-after: avoid; }
  .pub .md p, .pub .md li { overflow-wrap: anywhere; }
}
/* Импорт и администрирование */
.dlg { width: min(480px, 100%); }
.dlg-b { padding: 22px 22px 8px; display: flex; flex-direction: column; gap: 14px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; flex-wrap: wrap; }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; font-weight: 600; }
.btn.danger:hover { filter: brightness(0.92); color: #fff; }
.btn.danger-t { color: var(--down); }
.banner.g { background: var(--up-soft); color: var(--up); }
.banner.ic { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; }
.banner.ic svg { flex-shrink: 0; margin-top: 1px; }
.up-prog { display: flex; flex-direction: column; gap: 6px; }
.up-bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.2s; }
.more-d summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.steps { margin: 4px 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }   /* четыре роли с «Демо» (09.10.2026) */
.role-c { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.u-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 12px; align-items: end; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.u-form-b { display: flex; gap: 10px; grid-column: 1 / -1; }
.u-form .lg-err { grid-column: 1 / -1; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; }
.icon-btn.on { color: var(--accent); }
.acts { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.rc-row { padding: 2px 0; }
.rc-row .chk { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-add { display: flex; gap: 10px; }
.rc-add .input { flex: 1; min-width: 0; }
@media (max-width: 719px) {
  .pub-r { padding: 16px; }
  .roles { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .role-c { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border: none; border-radius: 0; }
  .u-form { grid-template-columns: minmax(0, 1fr); }
  .u-row { flex-wrap: wrap; }
  .u-row .acts { width: 100%; justify-content: flex-start; }
}
@media (max-width: 400px) { .rg-2 { grid-template-columns: minmax(0, 1fr); } }

/* Калькулятор по шагам */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.st { width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); min-height: 58px; }
.st:hover { border-color: var(--line-strong); }
.st.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); color: var(--ink); }
.st-n { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--sunken); color: var(--ink-2); }
.st.cur .st-n { background: var(--accent); color: var(--on-accent); }
.st.done .st-n { background: var(--up); color: #fff; }
.st-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-t b { font-size: 14px; font-weight: 600; color: var(--ink); }
.st-s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.step-f { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0 4px; border-top: 1px solid var(--line-soft); }
.step-why { text-align: right; }
.kvl { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.kvl dt { color: var(--muted); }
.kvl dd { margin: 0; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.doc-read { background: var(--accent-soft); color: var(--ink); align-items: center; }
.tl { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 2px; }
.tl-q { flex: 1 0 34px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.tl-q i { display: block; width: 100%; height: 14px; border-radius: 3px; background: var(--line-soft); }
.tl-q.pre i { background: var(--sunken); }
.tl-q.bld i { background: var(--off); }
.tl-q.sale i { box-shadow: inset 0 -4px 0 var(--up); }
.tl-q.ho i { background: var(--ready); }
.tl-q em { font-style: normal; font-size: 11px; color: var(--muted); }
.tbl tr.chg td:first-child { font-weight: 600; }
@media (max-width: 1180px) { .stepper { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; scrollbar-width: none; } }
@media (max-width: 719px) {
  .stepper { display: flex; overflow-x: auto; gap: 6px; scroll-snap-type: x proximity; }
  .stepper li { flex: 0 0 auto; scroll-snap-align: start; }
  .st { min-height: 48px; padding: 8px 10px; }
  .st-s { max-width: 120px; }
  .step-f { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); background: var(--bg); z-index: 4; padding: 12px 0; }
  .step-f .grow { display: none; }
  .step-why { flex-basis: 100%; text-align: left; order: -1; }
  .step-f .btn.primary { flex: 1; justify-content: center; }
  .kvl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kvl dd { margin-bottom: 8px; }
}
.land-hint { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.land-t { display: flex; flex-direction: column; gap: 3px; flex: 1 1 320px; min-width: 0; color: var(--ink-2); }
.land-t b { color: var(--ink); }
.land-t .land-fn { font-size: 12.5px; color: var(--muted); }
/* таблица затрат калькулятора: длинные названия статей переносятся (Hotel Management Company и т. п.) */
.tbl.ct td:first-child { white-space: normal; min-width: 190px; max-width: 270px; line-height: 1.3; }
/* кабинет расчётов калькулятора (08.10.2026): расчёты по датам, открытый расчёт подсвечен */
.cab-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--ink-2); }
.cab-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.cab-g .card-h + .cab-i { border-top: none; }
.cab-i.on { background: var(--accent-soft); margin: 0 -14px; padding: 14px; border-radius: 10px; border-top-color: transparent; }
.cab-m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cab-t { border: none; background: none; padding: 0; text-align: left; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cab-t:hover { color: var(--accent); text-decoration: underline; }
.cab-s { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.cab-s.muted { color: var(--muted); }
.cab-s a { color: var(--accent); }
.cab-r { display: flex; align-items: center; gap: 8px; }
@media (max-width: 719px) { .cab-i { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Продукт: библиотека, конкуренты, агенты, массинг ---------- */
.pr-mx th, .pr-mx td { vertical-align: top; }
.pr-mx thead th { min-width: 150px; }
.pr-th-s { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.pr-grp th { background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink); text-align: left; padding-top: 10px; }
.pr-par { font-weight: 500; color: var(--ink-2); text-align: left; white-space: nowrap; }
.pr-cell { padding: 4px 6px !important; }
.pr-empty { color: var(--muted); text-align: center; }
.pr-v { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.pr-v:hover { border-color: var(--line-strong); }
.pr-v:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-v.pr-approved { border-color: #b9dcc7; background: var(--up-soft); }
.pr-v.pr-rejected { opacity: 0.7; }
.pr-vt { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: normal; }
.pr-vs { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-st { font-size: 11px; padding: 2px 8px; }
.pr-st.pr-draft { background: var(--sunken); color: var(--ink-2); }
.pr-st.pr-approved { background: var(--up-soft); color: var(--up); }
.pr-st.pr-rejected { background: var(--down-soft); color: var(--down); }
.pr-st.pr-superseded { background: var(--sunken); color: var(--muted); }
.pr-mcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.pr-mrow { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.pr-dlg { width: min(860px, 100%); max-height: 88vh; }
.pr-big { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-bigv { font-size: 24px; font-weight: 600; color: var(--ink); }
.pr-why { font-size: 14.5px; color: var(--ink-2); }
.pr-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.pr-hist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.pr-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-rooms .chip { white-space: normal; }
.pr-sub td { background: var(--surface-2); }
.pr-rs { font-size: 11.5px; }
.pr-rs-new { background: var(--sunken); color: var(--ink-2); }
.pr-rs-queued { background: var(--accent-soft); color: var(--accent); }
.pr-rs-running { background: var(--warn-soft); color: var(--warn); }
.pr-rs-done { background: var(--up-soft); color: var(--up); }
.pr-rs-failed { background: var(--down-soft); color: var(--down); }
.ag-tabs { display: inline-flex; flex-wrap: wrap; }
.ag-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.ag-av { background: var(--accent); }
.ag-chip { cursor: pointer; }
.ag-chip:hover { border-color: var(--accent); }
.ag-note { border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; font-size: 13.5px; background: var(--surface-2); }
.ag-note summary { cursor: pointer; color: var(--ink-2); }
.ms-form { gap: 10px 14px; }
.ms-brief { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.ms-svg { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); padding: 8px; overflow: auto; }
.ms-svg svg { display: block; width: 100%; height: auto; }
.ms-plan svg { min-width: 560px; }
.ms-3d { border: 1px solid var(--line-soft); border-radius: 12px; background: linear-gradient(#dfe9f4 0%, #f3f5f8 55%, #ebe8e1 100%); min-height: 340px; overflow: hidden; }
.ms-3d canvas { display: block; cursor: grab; }
.ms-3d canvas:active { cursor: grabbing; }
.ms-card { text-decoration: none; color: inherit; }
.ms-floors { flex-wrap: wrap; }
@media (max-width: 1023px) { .ms-form.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) { .ms-form.g-4 { grid-template-columns: minmax(0, 1fr); } .ms-form .field[style] { grid-column: auto !important; } .pr-dlg { max-height: none; } }
.pr-fact { display: flex; flex-direction: column; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }
.pr-fact a { color: var(--accent); }
.rv-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); }
td.rv-chk input { width: 18px; height: 18px; cursor: pointer; }
.ms-warn ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }

/* ---------- «Студия продукта»: карточки решений, дуэли, конструктор, варианты ---------- */
.studio { --st-rival: var(--muted-series); --st-plan-line: #2b2f3d; --st-plan-fill: #fbfaf7; --st-plan-furn: #a5aabb; --st-water: #7cc0e2; --st-shadow: 0 1px 2px rgba(21, 25, 54, .05), 0 6px 22px rgba(21, 25, 54, .06); }
.studio .card { box-shadow: var(--st-shadow); }
.st-tn { font-variant-numeric: tabular-nums; }
.st-tabs { align-self: flex-start; }
.st-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.st-cnt { font-size: 11.5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.st-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0; }
.st-h { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; margin: 4px 0 0; text-wrap: balance; }
.st-lede { color: var(--ink-2); font-size: 16px; max-width: 56ch; margin: 10px 0 18px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.st-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.studio .btn.st-lg { height: auto; min-height: 48px; padding: 12px 20px; font-size: 15.5px; border-radius: 13px; }
.studio .btn.st-good { background: var(--up); border-color: var(--up); color: #fff; font-weight: 600; }
.studio .btn.st-good:hover { filter: brightness(1.06); color: #fff; }
.studio .pill { background: var(--sunken); color: var(--ink-2); }
.studio .pill.st-own { background: var(--accent-soft); color: var(--accent); }
.studio .pill.st-ok { background: var(--up-soft); color: var(--up); }
.studio .pill.st-warn { background: var(--warn-soft); color: var(--warn); }
/* Сегодня */
.st-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.st-hero .st-h { font-size: clamp(30px, 4vw, 44px); }
.st-rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.st-ring { display: flex; gap: 12px; align-items: center; }
.st-ring svg { flex: none; }
.st-ring b { display: block; font-size: 15px; }
.st-ring span { color: var(--muted); font-size: 13px; }
.st-disc-l { display: flex; flex-direction: column; gap: 6px; }
.st-disc-i { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; text-align: left; color: var(--ink); cursor: pointer; }
.st-disc-i:hover { border-color: var(--line-strong); }
.st-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.st-agent { gap: 12px; }
.st-agent-h { display: flex; gap: 10px; align-items: center; }
.st-ava { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--on-accent); background: var(--accent); flex: none; }
.st-ava.c { background: #3d6f8f; } .st-ava.p { background: #7a5a2b; }
.st-big { font: 600 30px/1 var(--font-display); }
.st-big span { font: 500 15px var(--font-body); color: var(--muted); }
.st-row { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--ink-2); font-size: 13.5px; }
.st-act { margin-top: auto; }
.st-pools { display: flex; flex-direction: column; gap: 5px; }
.st-pool { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; align-items: center; font-size: 12.5px; }
.st-pool > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-pool > span:last-child { display: flex; align-items: center; gap: 6px; }
.st-pool i { display: block; height: 10px; background: var(--st-water); border-radius: 3px; }
.st-minis { display: flex; flex-wrap: wrap; gap: 4px; }
.studio .btn.st-mini { height: auto; padding: 4px; flex-direction: column; gap: 2px; }
.st-teaser { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.st-thumbs { display: flex; gap: 10px; align-items: center; }
.st-thumbs img { width: 78px; height: 104px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
/* Решения */
.st-deck { gap: 0; }
.st-deck-h { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 14px; }
.st-steps { display: flex; gap: 5px; flex: 1; min-width: 160px; }
.st-steps i { height: 6px; flex: 1; border-radius: 99px; background: var(--sunken); transition: background .3s; }
.st-steps i.cur { background: var(--off); }
.st-steps i.st-approve, .st-steps i.st-vote { background: var(--up); } .st-steps i.st-discuss { background: var(--warn); } .st-steps i.st-later { background: var(--line-strong); }
.st-q { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; margin: 4px 0 18px; text-wrap: balance; }
.st-dgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; }
.st-viz, .st-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.st-plan, .st-strip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.st-strip { padding: 10px 12px 6px; }
.st-plan svg, .st-strip svg { display: block; width: 100%; height: auto; }
.st-plan svg { max-height: 440px; }
.st-plan-strip { padding: 20px 12px 10px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.st-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.st-legend i.st-lg-n { background: var(--down); border-radius: 2px; height: 3px; vertical-align: 3px; }
.st-prop { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: end; }
.st-lab { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.st-val { font: 600 44px/1 var(--font-display); white-space: nowrap; }
.st-val small { font: 500 18px var(--font-body); color: var(--muted); margin-left: 4px; }
.st-range { color: var(--ink-2); font-size: 14px; padding-bottom: 6px; }
.studio input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.st-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-facts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.st-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.st-ic.ok { background: var(--up-soft); color: var(--up); } .st-ic.bad { background: var(--down-soft); color: var(--down); } .st-ic.info { background: var(--sunken); color: var(--ink-2); }
.st-why { font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 10px; }
.st-why summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.st-acts { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; }
.st-acts .btn { white-space: nowrap; }
.st-deck.st-out { animation: st-out .24s ease forwards; }
.st-deck.st-in { animation: st-in .3s ease; }
@keyframes st-out { to { transform: translateX(-24px); opacity: 0; } }
@keyframes st-in { from { transform: translateX(24px); opacity: 0; } }
.st-sum { gap: 16px; }
.st-sumgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.st-sumgrid div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink-2); }
.st-sumgrid b { font: 600 30px/1 var(--font-display); display: block; color: var(--ink); margin-bottom: 4px; }
.st-sumlist { display: flex; flex-direction: column; }
.st-sumlist div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 8px 0; font-size: 14.5px; }
/* Дуэли */
.st-dhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; align-items: flex-end; }
.st-versus { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.st-vs { display: grid; place-items: center; font: 600 18px var(--font-display); color: var(--muted); }
.st-cand { padding: 14px; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.st-cand.won { border-color: var(--up); box-shadow: 0 0 0 3px var(--up-soft), var(--st-shadow); }
.st-cand.lost { opacity: .6; }
.st-cand-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.st-imgbox { background: #fff; border-radius: 10px; border: 1px solid var(--line); height: 430px; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; padding: 0; width: 100%; }
.st-imgbox img { max-height: 420px; max-width: 100%; object-fit: contain; }
.st-mt { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-mt td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.st-mt td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.st-reasons { gap: 12px; }
.st-votes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.st-zoom { display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.st-zoom img { max-width: min(1000px, 100%); max-height: 92vh; background: #fff; border-radius: 12px; }
/* Конструктор */
.st-bgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.st-bplan svg { width: 100%; height: auto; display: block; }
.studio [data-h] { touch-action: none; }
.st-ctrls { gap: 14px; }
.st-ctrl label { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.st-ctrl label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.st-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.st-kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.st-kpi span { color: var(--muted); font-size: 12.5px; display: block; }
.st-kpi b { display: block; font: 600 24px/1.15 var(--font-display); font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.st-kpi small { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.st-posbar { position: relative; height: 34px; margin-top: 6px; }
.st-posbar > div { position: absolute; }
/* Варианты */
.st-vgrid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.st-vlist { display: flex; flex-direction: column; gap: 10px; }
.st-vitem { padding: 12px; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; cursor: pointer; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--ink); }
.st-vitem[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st-vitem b { font-size: 14px; line-height: 1.3; display: block; }
.st-vitem span span { font-size: 12.5px; color: var(--muted); }
.st-viewers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.st-viewers.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-viewer { padding: 14px; gap: 10px; }
.st-three { border-radius: 12px; overflow: hidden; background: linear-gradient(#dde8f4, #f2f4f8 60%, #e9e6df); min-height: 300px; }
.st-three canvas { display: block; cursor: grab; }
.st-vk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.st-viewers.two .st-vk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-vk div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.st-vk span { color: var(--muted); font-size: 12px; display: block; }
.st-vk b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-mix { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; }
.st-mixkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.st-mixkey i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
@media (max-width: 1100px) {
  .st-agents { grid-template-columns: minmax(0, 1fr); }
  .st-vgrid { grid-template-columns: minmax(0, 1fr); }
  .st-viewers.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .st-hero, .st-dgrid, .st-bgrid { grid-template-columns: minmax(0, 1fr); }
  /* телефон и планшет: ползунок и кнопки сразу под чертежом, замеры ниже */
  .st-dgrid { display: flex; flex-direction: column; gap: 12px; }
  .st-viz, .st-side { display: contents; }
  .st-dgrid .st-plan { order: 1; } .st-dgrid .st-prop { order: 2; } .st-dgrid .st-side > label.note { order: 3; } .st-dgrid #st-sl { order: 4; } .st-dgrid .st-facts { order: 5; } .st-dgrid .st-acts { order: 6; }
  .st-dgrid .st-viz > .st-strip { order: 7; } .st-dgrid .st-legend { order: 8; } .st-dgrid .st-why { order: 9; } .st-dgrid .st-side > p.note { order: 10; }
}
@media (max-width: 640px) {
  .st-versus { grid-template-columns: minmax(0, 1fr); }
  .st-vs { display: none; }
  .st-imgbox { height: 300px; } .st-imgbox img { max-height: 290px; }
  .st-acts { grid-template-columns: minmax(0, 1fr); }
  .st-sumgrid { grid-template-columns: minmax(0, 1fr); }
  .st-vk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-teaser { grid-template-columns: minmax(0, 1fr); }
  .st-rings { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .st-deck.st-out, .st-deck.st-in { animation: none; } }

/* ---------- города: закладки над страницей (Дубай · Абу-Даби) ---------- */
.cities { position: sticky; top: 0; z-index: 12; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cities-in { max-width: 1320px; margin-inline: auto; padding: 10px var(--gutter) 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cities-in button { border: 1px solid transparent; border-bottom: none; background: none; padding: 9px 18px 10px; border-radius: 12px 12px 0 0; font: 600 14.5px var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap; position: relative; top: 1px; }
.cities-in button:hover { color: var(--ink); background: var(--surface-2); }
.cities-in button[aria-selected="true"] { color: var(--ink); background: var(--bg); border-color: var(--line); box-shadow: inset 0 3px 0 var(--accent); }
.cities-in button:focus-visible { outline: 2px solid var(--off); outline-offset: -2px; }
/* высота полосы городов — чтобы экран OSDrive (во всю высоту окна) не уходил под нижнее меню */
body:has(#cities:not([hidden])) { --cities-h: 50px; }
@media (max-width: 1023px) { body:has(#cities:not([hidden])) { --cities-h: 46px; } }
@media (max-width: 1023px) { .cities { top: calc(56px + env(safe-area-inset-top, 0px)); } .cities-in { padding-top: 8px; } .cities-in button { padding: 8px 14px 9px; font-size: 14px; } }
/* Метка «BETA» у вкладки Абу-Даби (Олег, 12.10.2026): синяя «таблетка», мелкий, но читаемый белый шрифт */
.city-beta { display: inline-block; margin-left: 7px; padding: 2px 7px 2px; border-radius: 999px; background: var(--off); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.35; white-space: nowrap; vertical-align: 2px; }
@media (max-width: 719px) { .city-beta { margin-left: 5px; padding: 2px 6px; } }
/* та же метка у раздела «Земля»: в меню и у заголовка (12.10.2026) */
em.city-beta { font-style: normal; flex: none; }
.nav-item .city-beta, .row .city-beta { margin-left: 8px; vertical-align: 0; }
.h1 .h1-beta { margin-left: 12px; font-family: var(--font-body); font-size: 11px; vertical-align: 6px; }

/* ---------- карта проектов: векторная подложка MapLibre ----------
   Олег, 12.10.2026: основная карта переведена на MapLibre в облике прототипа: светлая тёплая подложка, районы «шампань → бронза»,
   плавающие панели на белом с мягкой тенью; всё, что поверх карты, помещается в ширину телефона. */
.mx-box { position: relative; height: 620px; border-radius: var(--r-card); overflow: hidden; background: #f4f2ee; isolation: isolate; }
/* Стиль MapLibre ставит контейнеру position: relative — двойной класс сильнее, контейнер остаётся во весь блок. */
.mx-box .mx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mx-canvas canvas:focus-visible { outline: 2px solid var(--off); outline-offset: -2px; }
.mx-ctl, .mx-legend, .mx-card {
  background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(21, 25, 54, 0.08);
  box-shadow: 0 8px 28px rgba(21, 25, 54, 0.10), 0 1px 2px rgba(21, 25, 54, 0.06);
}
@supports (backdrop-filter: blur(8px)) { .mx-legend { background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(12px) saturate(1.2); } }
.mx-ctl { position: absolute; right: 12px; top: 12px; z-index: 3; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--surface); }
.mx-ctl button { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--ink-2); font: 700 12.5px var(--font-body); letter-spacing: 0.03em; }
.mx-ctl button + button { border-top: 1px solid var(--line-soft); }
.mx-ctl button:hover { background: #f3f4f9; color: var(--ink); }
.mx-ctl button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.mx-ctl button:focus-visible { outline-offset: -3px; }
/* Легенда стоит над строкой подписи источников: на узком блоке карты (меньше ~730 px) она иначе закрывала
   «© OpenStreetMap contributors» — условие ODbL и OpenFreeMap (Олег, 12.10.2026). */
.mx-legend { position: absolute; left: 12px; bottom: 30px; z-index: 3; width: 372px; max-width: calc(100% - 90px); padding: 11px 14px 12px; border-radius: 14px; font-size: 12.5px; color: var(--ink-2); }
.mx-legend summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; cursor: pointer; font-weight: 600; color: var(--ink); font-size: 13px; }
.mx-legend summary::-webkit-details-marker { display: none; }
.mx-legend summary svg { color: var(--muted); transition: transform 0.15s ease; }
.mx-legend:not([open]) summary svg { transform: rotate(180deg); }
.mx-ramp { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 2px; margin-top: 9px; }
.mx-ramp i { height: 11px; }
.mx-ramp i:first-child { border-radius: 4px 0 0 4px; }
.mx-ramp i:last-child { border-radius: 0 4px 4px 0; }
.mx-ticks { position: relative; height: 15px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.mx-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.mx-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.mx-keys + .mx-keys { margin-top: 6px; padding-top: 0; border-top: none; }
.mx-keys span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mx-sw { display: inline-block; width: 16px; height: 11px; border-radius: 3px; flex: none; }
/* «мало сделок» — та же нейтральная заливка, что на карте (MK.NEUTRAL) */
.mx-sw.nd { background: #e2ded6; box-shadow: inset 0 0 0 1px rgba(21, 25, 54, 0.08); }
.mx-sw.ap { background: #ddb872; outline: 1.5px dashed #ffffff; outline-offset: -3px; }
.mx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--off); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(21, 25, 54, 0.14); }
.mx-dot.ring { background: #fff; box-shadow: inset 0 0 0 2.2px var(--off); }
.mx-dot.sel { background: var(--ready); }
.mx-lg-n { margin-top: 8px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
/* Карточка: при наведении — подсказка (сквозь неё проходит мышь), закреплённая — с кнопками. */
.mx-card { position: absolute; z-index: 4; width: 272px; max-width: calc(100% - 20px); padding: 13px 15px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; background: var(--surface); box-shadow: 0 16px 44px rgba(21, 25, 54, 0.18), 0 2px 6px rgba(21, 25, 54, 0.08); }
.mx-card.pin { pointer-events: auto; }
.mx-card.pin > .mx-k { padding-right: 30px; }
/* На телефоне и без карты закреплённая карточка прижата к низу блока. */
.mx-card.dock { left: 10px; right: 10px; top: auto; bottom: 12px; width: auto; max-width: none; z-index: 6; max-height: calc(100% - 24px); overflow-y: auto; }
.mx-x { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 9px; }
.mx-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mx-k { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mx-k > i:not(.mx-dot) { width: 11px; height: 11px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(21, 25, 54, 0.12); }
.mx-k .mx-dot { width: 9px; height: 9px; }
.mx-t { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.mx-s { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.mx-v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mx-v b { font-size: 25px; font-weight: 600; color: var(--ink); letter-spacing: -0.015em; line-height: 1.15; }
.mx-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.mx-dl dt { color: var(--muted); }
.mx-dl dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.mx-note { font-size: 12px; line-height: 1.4; color: var(--warn); margin-top: 2px; }
.mx-f { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-top: 4px; }
/* «N проектов здесь»: несколько проектов в одной точке */
.mx-list { display: flex; flex-direction: column; max-height: 228px; overflow-y: auto; margin: 2px -6px 0; padding: 0 6px; overscroll-behavior: contain; }
.mx-li { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 6px 2px; border: none; border-bottom: 1px solid var(--line-soft); background: none; color: var(--ink); text-align: left; font-size: 13.5px; }
.mx-list li:last-child .mx-li { border-bottom: none; }
.mx-li-t { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.mx-li-v { color: var(--muted); font-size: 12.5px; }
.mx-li:hover .mx-li-t { color: var(--accent); }
/* Подсказка про колесо: без Ctrl/⌘ колесо прокручивает страницу, а не масштабирует карту. */
.mx-hint { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: rgba(21, 25, 54, 0.8); color: #fff; font-size: 14px; text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; }
.mx-hint.on { opacity: 1; }
.mx-attr { position: absolute; right: 8px; bottom: 6px; z-index: 2; max-width: calc(100% - 16px); padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.8); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-attr a { color: inherit; }
.mx-attr a:hover { color: var(--ink); }
/* Карта грузится или не открылась: сообщение закрывает блок, но чип с «Все районы» остаётся над ним — из района можно выйти. */
.mx-box:has(> .mx-status:not([hidden])) > .map-top { z-index: 6; }
.mx-status { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; align-content: center; justify-content: center; flex-wrap: wrap; gap: 10px 12px; padding: 24px; text-align: center; background: #f4f2ee; color: var(--ink-2); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .mx-hint, .mx-legend summary svg { transition: none; } }
/* Пальцем: кнопки карты и карточки не меньше 44 px. */
@media (pointer: coarse) {
  .mx-ctl button { width: 44px; height: 44px; }
  .mx-card .btn, .mx-li { min-height: 44px; }
  .mx-x { width: 44px; height: 44px; top: 0; right: 0; }
  .mx-card.pin > .mx-k { padding-right: 36px; }
}
@media (max-width: 719px) {
  .mx-box { height: 440px; border-radius: 14px; }
  .map-top { left: 10px; top: 10px; right: 64px; }
  .mx-ctl { right: 10px; top: 10px; }
  .mx-ctl button { width: 44px; height: 44px; }
  /* Легенда не заходит под кнопки справа: на 375 px они не перекрываются. */
  .mx-legend { left: 10px; right: 64px; bottom: 24px; width: auto; max-width: none; padding: 9px 12px 10px; }
  .mx-attr { right: 10px; bottom: 4px; font-size: 10px; }
  .mx-card { width: 260px; }
}
