/* Самописный CSS без сборки (§11). */
:root {
  --fg: #1a1a2b; --muted: #6b7280; --bg: #f7f7fa; --card: #ffffff;
  --accent: #1565c0; --good: #2e7d32; --bad: #c62828; --warn: #e65100;
  --border: #e3e4ea;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header.site {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.2rem; display: flex; gap: 1.2rem; align-items: baseline;
}
header.site a { color: var(--fg); text-decoration: none; }
header.site .brand { font-weight: 700; font-size: 1.1rem; }
header.site nav a { color: var(--muted); margin-right: 0.9rem; }
main { max-width: 1000px; margin: 1.2rem auto; padding: 0 1rem; }
h1 { font-size: 1.5rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.7rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr; } }
.kpis { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.kpi .v { font-size: 1.45rem; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 0.82rem; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.factor { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.35rem 0; }
.factor .bar-wrap { flex: 0 0 140px; background: #eef0f4; border-radius: 4px; height: 8px; }
.factor .bar { height: 8px; border-radius: 4px; background: var(--accent); }
.factor.neg .bar { background: var(--bad); }
.badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 20px;
  font-size: 0.78rem; background: #eef0f4; color: var(--muted);
}
.badge.reno { background: #fdecea; color: var(--bad); }
form.inline input, form.inline select {
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem;
}
button, .btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 0.5rem 1rem; font-size: 0.95rem; cursor: pointer; text-decoration: none;
  display: inline-block;
}
button.secondary { background: #eef0f4; color: var(--fg); }
#map { width: 100%; height: 420px; border-radius: 10px; background: #e9edf2; }
.map-placeholder {
  display: flex; align-items: center; justify-content: center; height: 420px;
  color: var(--muted); text-align: center; padding: 1rem;
}
.layer-toggles { margin: 0.6rem 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.layer-toggles button { background: #eef0f4; color: var(--fg); padding: 0.3rem 0.8rem; }
.layer-toggles button.active { background: var(--accent); color: #fff; }
.layer-toggles button.active::before { content: "✓ "; }
.progress-steps { list-style: none; padding: 0; }
.progress-steps li { padding: 0.3rem 0; color: var(--muted); }
.progress-steps li.done::before { content: "✓ "; color: var(--good); }
.progress-steps li.current::before { content: "⏳ "; }
.checklist li { margin: 0.3rem 0; }
.disclaimer { font-size: 0.82rem; color: var(--muted); }

/* --- История дома (ЦИАН): попап загрузки, маркеры, полноэкранная таблица --- */
[hidden] { display: none !important; }
.hh-marker { width: 11px; height: 11px; border-radius: 50%; cursor: pointer;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,.45); }
.hh-marker:hover { transform: scale(1.4); }

.hh-popup { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 900; background: #fff; border-radius: 10px; padding: 1rem 1.2rem;
  box-shadow: 0 6px 28px rgba(0,0,0,.25); max-width: min(560px, calc(100vw - 2rem)); }
.hh-popup-addr { font-weight: 600; margin-bottom: .35rem; }
.hh-popup-actions { display: flex; gap: .5rem; margin-top: .7rem; }
.hh-spinner { display: inline-block; width: .85em; height: .85em; vertical-align: -0.1em;
  border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  animation: hh-spin .7s linear infinite; }
@keyframes hh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hh-spinner { animation: none; } }

.hh-modal { position: fixed; inset: 0; z-index: 1000; background: #fff;
  display: flex; flex-direction: column; }
.hh-modal[hidden] { display: none; }
.hh-modal-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid #e3e6ec; }
.hh-badge { padding: .1rem .5rem; border-radius: 99px; font-size: .8em; white-space: nowrap; }
.hh-badge.on { background: #e3f4e6; color: #1b7a2f; }
.hh-badge.off { background: #eef0f4; color: #5a6272; }

/* фильтры-чипсы, как в попапе ЦИАН */
.hh-filters { display: flex; gap: 2rem; flex-wrap: wrap; padding: .7rem 1.4rem;
  border-bottom: 1px solid #e3e6ec; }
.hh-chipgroup .cap { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
/* контейнер кнопок — inline-flex: убирает пробелы между переключателями
   от переносов строк в разметке, границы соседних кнопок смыкаются */
#hh-f-status, #hh-f-rooms { display: inline-flex; }
.hh-chipgroup button { background: #fff; color: var(--fg); border: 1px solid #d5d9e2;
  padding: .3rem .9rem; margin-right: -1px; border-radius: 0; }
.hh-chipgroup button:first-of-type { border-radius: 6px 0 0 6px; }
.hh-chipgroup button:last-of-type { border-radius: 0 6px 6px 0; }
.hh-chipgroup button.active { background: #eaf2fd; color: var(--accent);
  border-color: var(--accent); position: relative; z-index: 1; }

/* список слева + карточка справа */
.hh-split { display: flex; flex: 1; min-height: 0; }
.hh-list { flex: 1.4; overflow-y: auto; padding: .5rem 0; }
.hh-row { display: grid; grid-template-columns: 96px 1fr auto; gap: .9rem;
  align-items: center; padding: .7rem 1.4rem; cursor: pointer;
  border-bottom: 1px solid #f0f2f6; }
.hh-row:hover { background: #f6f8fb; }
.hh-row.selected { background: #eef4fd; }
.hh-thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }
.hh-noimg { display: flex; align-items: center; justify-content: center;
  background: #eef0f4; color: var(--muted); font-size: .75rem; }
.hh-row-title { color: var(--accent); font-weight: 600; margin-bottom: .2rem; }
.hh-row-mid .hh-badge { display: inline-block; margin-bottom: .2rem; }
.hh-row-dates { font-size: .85rem; }
.hh-row-price { text-align: right; font-variant-numeric: tabular-nums; }
.hh-row-price b { font-size: 1.05rem; }
.hh-row-price .muted { font-size: .85rem; }

.hh-detail { flex: 1; overflow-y: auto; border-left: 1px solid #e3e6ec;
  padding: 1.2rem 1.4rem; }
.hh-photo { width: 100%; height: 300px; object-fit: contain; border-radius: 8px;
  background: #0e1116; cursor: zoom-in; display: block; }
.hh-photo.hh-noimg { cursor: default; }
div.hh-photo { height: 200px; }
.hh-d-price { font-size: 1.7rem; font-weight: 700; margin-top: .8rem; }
.hh-ext { display: inline-flex; vertical-align: middle; margin-left: .35rem;
  color: var(--muted, #888); opacity: .75; text-decoration: none;
  transition: color .12s, opacity .12s; }
.hh-ext:hover { color: var(--accent, #2d7ff9); opacity: 1; }
.hh-ext svg { display: block; }
.hh-d-title { font-size: 1.05rem; margin-top: .5rem; }
.hh-d-attrs { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem;
  margin: 1rem 0; }
.hh-d-attrs dt { color: var(--muted); }
.hh-d-attrs dd { margin: 0; }
.hh-d-link { display: inline-block; background: #eaf2fd; color: var(--accent);
  padding: .55rem 1.1rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.hh-d-link:hover { background: #dce9fb; }

/* кнопка «← К списку» — только на мобиле */
.hh-back { display: none; margin-bottom: .8rem; }

@media (max-width: 800px) {
  .hh-modal-head { padding: .6rem .9rem; gap: .6rem; align-items: center; }
  .hh-modal-head b { font-size: .95rem; }
  .hh-close-txt { display: none; }              /* на мобиле только крестик */
  #hh-modal-close { padding: .4rem .6rem; }

  /* статус + комнаты одной строкой с горизонтальным скроллом */
  .hh-filters { gap: .8rem; padding: .5rem .9rem; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hh-chipgroup { flex: none; }
  .hh-chipgroup .cap { white-space: nowrap; }
  .hh-chipgroup button { padding: .3rem .7rem; white-space: nowrap; }

  /* список — основной экран; карточка выезжает поверх по клику */
  .hh-split { position: relative; }
  .hh-list { flex: 1; }
  .hh-row { grid-template-columns: 84px 1fr; gap: .3rem .8rem;
    padding: .6rem .9rem; align-items: start; }
  .hh-thumb { grid-row: 1 / span 2; width: 84px; height: 62px; }
  .hh-row-mid { grid-column: 2; }
  .hh-row-price { grid-column: 2; text-align: left; }
  .hh-row-price b { font-size: 1rem; }

  .hh-detail { position: absolute; inset: 0; background: #fff; z-index: 5;
    border: none; padding: 1rem 1rem 2rem;
    transform: translateX(100%); transition: transform .22s ease; }
  .hh-modal.detail-open .hh-detail { transform: translateX(0); }
  .hh-back { display: inline-block; }
  .hh-photo { height: 240px; }
  .hh-d-price { font-size: 1.5rem; }

  /* мини-бар и попап карты компактнее */
  .hh-mapbar { padding: .35rem .55rem; gap: .5rem; }
  .hh-popup { left: .6rem; right: .6rem; bottom: .6rem; transform: none;
    max-width: none; padding: .8rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hh-detail { transition: none; }
}

/* плавающий мини-бар на полноэкранной карте истории */
.hh-mapbar { position: fixed; right: 12px; top: 60px; z-index: 800;
  display: flex; align-items: center; gap: .7rem; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: .4rem .7rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.hh-mapbar select { border: none; font: inherit; background: none; }
.hh-mapbar a { color: var(--muted); font-size: .85rem; }

/* лента миниатюр в карточке объявления */
.hh-strip { display: flex; gap: .4rem; margin-top: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.hh-strip img { width: 72px; height: 48px; object-fit: cover; border-radius: 4px;
  cursor: pointer; flex: none; opacity: .85; }
.hh-strip img:hover { opacity: 1; }
.hh-strip img.cur { outline: 2px solid var(--accent); opacity: 1; }

/* кнопка ⓘ с версией сборки в шапке */
.buildinfo { margin-left: auto; position: relative; }
.buildinfo summary { list-style: none; cursor: pointer; color: var(--muted);
  font-size: 1rem; user-select: none; }
.buildinfo summary::-webkit-details-marker { display: none; }
.buildinfo[open] summary { color: var(--accent); }
.bi-pop { position: absolute; right: 0; top: 1.8rem; z-index: 1200;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: .6rem .9rem; min-width: 260px; box-shadow: 0 4px 18px rgba(0,0,0,.15);
  font-size: .85rem; white-space: normal; }

/* полноэкранный лайтбокс галереи (стрелки поверх фото, как в Fancybox) */
.hh-lb { position: fixed; inset: 0; z-index: 1100; background: rgba(8,10,14,.96);
  display: flex; flex-direction: column; }
.hh-lb[hidden] { display: none; }
.hh-lb-stage { position: relative; flex: 1; min-height: 0; display: flex;
  align-items: center; justify-content: center; padding: 3rem .5rem .5rem; }
.hh-lb-stage img#hh-lb-img { max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 6px; }
.hh-lb-nav { position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(20,24,30,.5); color: #fff; border: none; width: 48px; height: 48px;
  border-radius: 50%; font-size: 1.9rem; line-height: 1; cursor: pointer; z-index: 2; }
.hh-lb-nav:hover { background: rgba(20,24,30,.8); }
.hh-lb-nav.prev { left: .6rem; } .hh-lb-nav.next { right: .6rem; }
.hh-lb-close { position: fixed; top: .8rem; right: 1rem; z-index: 3; background: none;
  border: none; color: #fff; font-size: 1.7rem; cursor: pointer; opacity: .85; }
.hh-lb-close:hover { opacity: 1; }
.hh-lb-count { position: fixed; top: 1.1rem; left: 1.2rem; z-index: 3; color: #cfd6df;
  font-variant-numeric: tabular-nums; }
.hh-lb-strip { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem;
  justify-content: safe center; flex: none; }
.hh-lb-strip img { width: 84px; height: 56px; object-fit: cover; border-radius: 4px;
  cursor: pointer; flex: none; opacity: .55; }
.hh-lb-strip img:hover { opacity: .85; }
.hh-lb-strip img.cur { opacity: 1; outline: 2px solid #fff; }
@media (max-width: 640px) {
  .hh-lb-stage { padding: 3rem 0 .3rem; }        /* фото во всю ширину */
  .hh-lb-nav { width: 42px; height: 42px; font-size: 1.6rem;
    background: rgba(20,24,30,.4); }
  .hh-lb-nav.prev { left: .3rem; } .hh-lb-nav.next { right: .3rem; }
  .hh-lb-strip img { width: 64px; height: 44px; }
}

/* свой поиск по адресу на карте истории */
.hh-search { position: fixed; left: 12px; z-index: 810; width: min(340px, calc(100vw - 24px)); }
.hh-search input { width: 100%; padding: .6rem .8rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; background: #fff; color: var(--fg);
  box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.hh-search input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.hh-suggest { margin-top: 4px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.16); overflow: hidden;
  max-height: 60vh; overflow-y: auto; }
.hh-sg { padding: .55rem .8rem; cursor: pointer; border-bottom: 1px solid #f0f2f6;
  font-size: .92rem; }
.hh-sg:last-child { border-bottom: none; }
.hh-sg:hover, .hh-sg.on { background: #eef4fd; }

@media (max-width: 800px) {
  .hh-search { width: calc(100vw - 165px); }  /* оставить место мини-бару справа */
  .hh-search input { padding: .5rem .7rem; }
}

/* цепочка квартиры и детекция флипа в карточке истории */
.hh-chain { margin-top: 1.1rem; border-top: 1px solid #e3e6ec; padding-top: .9rem; }
.hh-chain-h { font-weight: 600; margin-bottom: .5rem; }
.hh-chain-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0;
  border-bottom: 1px solid #f0f2f6; font-size: .9rem; }
.hh-chain-row:last-of-type { border-bottom: none; }
.hh-chain-row .d { color: var(--muted); flex: 1; }
.hh-chain-row .p { font-variant-numeric: tabular-nums; min-width: 6.8em; text-align: right; }
.hh-chain-row.cur { background: #eef4fd; margin: 0 -.5rem; padding: .35rem .5rem; border-radius: 6px; }
.hh-flip { margin-top: .9rem; background: #f0f7ff; border: 1px solid #cfe1fb;
  border-radius: 10px; padding: .8rem 1rem; }
.hh-flip-h { font-weight: 700; margin-bottom: .4rem; }
.hh-flip-kpis { margin-top: .3rem; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hh-flip-note { font-size: .8rem; margin-top: .4rem; }
.hh-flip-pick { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hh-flip-pick button { background: #fff; color: var(--fg); border: 1px solid #cfe1fb;
  border-radius: 6px; padding: .25rem .6rem; font-size: .85rem; }
.hh-flip-pick button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* подсветка строк, входящих во флип-пары */
.hh-row.flip { box-shadow: inset 3px 0 0 var(--accent); }
.hh-badge.flip { background: #e7f0ff; color: var(--accent); }

/* таблица «было → стало» в флип-плашке */
.hh-flip-tab { width: 100%; margin: .5rem 0 .3rem; border-collapse: collapse; font-size: .9rem; }
.hh-flip-tab thead th { text-align: right; font-weight: 600; padding: .2rem .4rem; color: var(--muted); }
.hh-flip-tab thead th:first-child { text-align: left; }
.hh-flip-tab tbody th { text-align: left; font-weight: 600; padding: .3rem .4rem; vertical-align: top; }
.hh-flip-tab td { text-align: right; padding: .3rem .4rem; font-variant-numeric: tabular-nums; }
.hh-flip-tab tbody tr { border-top: 1px solid #dce7f6; }
.hh-flip-tab tr.d th, .hh-flip-tab tr.d td { border-top: 2px solid #cfe1fb; padding-top: .4rem; }
.hh-flip-tab .muted { font-weight: 400; font-size: .82em; }

.hh-flip-tab .hh-pct { font-size: .8em; margin-top: 1px; }

/* кликабельные звенья цепочки + подсветка текущего в флип-таблице */
.hh-chain-row[data-goto] { cursor: pointer; }
.hh-chain-row[data-goto]:hover { background: #f6f8fb; margin: 0 -.5rem; padding: .35rem .5rem; border-radius: 6px; }
.hh-flip-tab tr.sel th, .hh-flip-tab tr.sel td { background: #dbeafe; }
.hh-flip-tab tr.sel th { border-radius: 6px 0 0 6px; }
.hh-flip-tab .hh-badge.flip { padding: 0 .3rem; }

/* Пул прокси (/proxies) */
.proxy-summary { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 1rem; }
.proxy-summary .ok b { color: #16a34a; }
.proxy-summary .warn b { color: #dc2626; }
.proxy-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.proxy-add { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 340px; }
.proxy-add textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.proxy-table { width: 100%; border-collapse: collapse; }
.proxy-table code { font-size: .82rem; }
.proxy-table tr.dead { opacity: .6; }
.proxy-row-actions { display: flex; gap: .35rem; }
.proxy-row-actions form { margin: 0; }
.proxy-row-actions button { padding: .15rem .5rem; font-size: .8rem; }

/* Флип-маркеры на карте (/house-history) */
.hh-flip-pin {
  transform: translate(-50%, -50%);
  background: #2563eb; color: #fff; font-size: .8rem; font-weight: 700;
  padding: 1px 7px; border-radius: 11px; white-space: nowrap; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.hh-flip-pin:hover { background: #1d4ed8; }
.hh-flips-note { font-size: .85rem; color: #555; }
#hh-flips-btn { padding: .2rem .6rem; cursor: pointer; }

/* Сканирование района: кнопка/радиус/прогресс */
#hh-scan-btn { padding: .2rem .6rem; cursor: pointer; }
#hh-scan-btn.on { background: #2563eb; color: #fff; }
.hh-scan-r { font-size: .85rem; color: #333; }
.hh-scan-r input { width: 4.5rem; }
.hh-scan-panel {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1200;
  background: rgba(17,24,39,.92); color: #fff; padding: .5rem .9rem; border-radius: 8px;
  font-size: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.4); max-width: 90vw;
}

/* Кнопки ручной разметки флипа (Супер/Брехня) */
.hh-flip-label { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
.hh-lbl { padding: .25rem .6rem; cursor: pointer; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; }
.hh-lbl.good:hover { background: #dcfce7; border-color: #16a34a; }
.hh-lbl.bad:hover { background: #fee2e2; border-color: #dc2626; }
.hh-lbl-note { font-size: .85rem; color: #555; }
.hh-flip-label.done-good { outline: 2px solid #16a34a33; }
.hh-flip-label.done-bad { outline: 2px solid #dc262633; }

/* Кластер флипов на карте */
.hh-cluster {
  transform: translate(-50%, -50%);
  background: #1d4ed8; color: #fff; font-weight: 700; font-size: .85rem;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45);
}
.hh-cluster:hover { background: #1e40af; }
.hh-toggle { font-size: .9rem; cursor: pointer; user-select: none; }
/* Панель настройки сканирования — под мини-баром */
.hh-scan-ctl {
  position: fixed; z-index: 1100; left: 10px; top: 92px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: .5rem .7rem; display: flex; gap: .6rem; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); font-size: .9rem; flex-wrap: wrap; max-width: 92vw;
}
.hh-scan-ctl input { width: 4.5rem; }

/* ---------- Ревью флипов («тиндер») ---------- */
.fr-wrap { max-width: 860px; margin: 0 auto; padding: 1rem; }
.fr-top { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.fr-progress { font-size: .95rem; }
.fr-progress b { font-size: 1.15rem; }
.fr-link { color: var(--muted); font-size: .88rem; }
.fr-empty { text-align: center; color: var(--fg); padding: 3rem 1rem; font-size: 1.05rem; }
.fr-card { background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1rem 1.1rem 1.2rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.fr-card-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.fr-addr { font-weight: 600; font-size: 1.02rem; }
.fr-verdict { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.fr-m { font-weight: 700; font-size: 1.05rem; padding: .1rem .5rem; border-radius: 7px;
  background: #eef0f4; color: var(--fg); }
.fr-m.up { background: #dcfce7; color: var(--good); }
.fr-m.down { background: #fee2e2; color: var(--bad); }
.fr-m.sub { font-weight: 600; font-size: .9rem; background: none; color: var(--muted); }
.fr-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.fr-side { border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; }
.fr-side-cap { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: .45rem .7rem; background: #f3f4f7; font-weight: 600; }
#fr-side-sell .fr-side-cap { background: #eaf5ec; color: var(--good); }
.fr-photo { aspect-ratio: 4/3; background: #eef0f4; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
.fr-photo img { width: 100%; height: 100%; object-fit: cover; }
.fr-noimg { color: var(--muted); font-size: .85rem; }
.fr-strip { display: flex; gap: .3rem; overflow-x: auto; padding: .35rem .4rem;
  background: #f3f4f7; scrollbar-width: thin; }
.fr-strip:empty { display: none; }
.fr-strip img { width: 54px; height: 40px; flex: 0 0 auto; object-fit: cover;
  border-radius: 4px; cursor: pointer; opacity: .6; transition: opacity .1s; }
.fr-strip img:hover { opacity: .9; }
.fr-strip img.cur { opacity: 1; outline: 2px solid var(--accent); }
.fr-side-body { padding: .6rem .7rem .75rem; }
.fr-price { font-size: 1.3rem; font-weight: 700; }
.fr-specs { margin-top: .3rem; font-size: .9rem; }
.fr-dates { margin-top: .2rem; font-size: .85rem; color: var(--muted); }
.fr-title { margin-top: .35rem; font-size: .85rem; color: var(--fg); line-height: 1.3; }
.fr-expo { margin-top: .25rem; font-size: .78rem; }
/* Досье дома: все данные из наших баз */
.hh-head-actions { display: flex; gap: .5rem; align-items: center; }
.hh-dossier { position: fixed; inset: 0; z-index: 1050; background: var(--bg);
  display: flex; flex-direction: column; }
.hh-dossier[hidden] { display: none; }
.hh-dossier-head { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); background: var(--card); }
.hh-dossier-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem;
  max-width: 900px; margin: 0 auto; width: 100%; }
.hh-dos-addr { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
/* плитки ключевых показателей (иконки) — стиль карточки ЦИАН */
.hh-hl { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.3rem 1.6rem; margin: .3rem 0 2rem; }
.hh-hl-item { display: flex; align-items: center; gap: .85rem; }
.hh-hl-ic { flex: 0 0 auto; width: 38px; height: 38px; color: #98a2b3; }
.hh-hl-ic svg { width: 100%; height: 100%; display: block; }
.hh-hl-t { display: flex; flex-direction: column; min-width: 0; }
.hh-hl-cap { color: var(--muted); font-size: .9rem; line-height: 1.1; }
.hh-hl-val { font-size: 1.15rem; font-weight: 700; line-height: 1.15; margin-top: 1px; }
.hh-dos-sec { margin-bottom: 1.3rem; }
.hh-dos-sec h3 { font-size: .95rem; margin: 0 0 .5rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--border); }
.hh-dos-dl { display: grid; grid-template-columns: minmax(150px, 40%) 1fr;
  gap: .3rem 1rem; margin: 0; }
.hh-dos-dl dt { color: var(--muted); }
.hh-dos-dl dd { margin: 0; font-variant-numeric: tabular-nums;
  text-align: right; word-break: break-word; }
/* две колонки «как у ЦИАН»: подпись слева, значение справа, разделитель под строкой */
.hh-dos-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; }
.hh-dos-row { display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.hh-dos-row .k { color: var(--muted); }
.hh-dos-row .v { text-align: right; font-variant-numeric: tabular-nums;
  word-break: break-word; }
@media (max-width: 620px) { .hh-dos-cols { grid-template-columns: 1fr; gap: 0; } }
.hh-dos-empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.hh-dos-fold { margin-bottom: 1.3rem; }
.hh-dos-fold > summary { font-size: .95rem; font-weight: 700; cursor: pointer;
  padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.hh-dos-fold > summary::marker { color: var(--muted); }
.hh-dos-fold .hh-dos-dl { margin-top: .6rem; }
.hh-dos-raw { margin-top: .8rem; }
.hh-dos-raw summary { cursor: pointer; color: var(--accent); font-size: .88rem; }
.hh-dos-raw pre { background: #0e1116; color: #cfd6df; padding: .8rem; border-radius: 8px;
  overflow-x: auto; font-size: .78rem; margin-top: .5rem; max-height: 320px; }
@media (max-width: 520px) { .hh-dos-dl { grid-template-columns: 1fr; gap: 0 0; }
  .hh-dos-dl dt { margin-top: .5rem; } }

.fr-table { margin-top: .9rem; }

/* поп-ап причины для «Брехня» */
.fr-modal { position: fixed; inset: 0; z-index: 1100; background: rgba(8,10,14,.5);
  display: flex; align-items: center; justify-content: center; padding: 1rem; }
.fr-modal[hidden] { display: none; }
.fr-modal-card { background: var(--card); border-radius: 14px; padding: 1.2rem 1.3rem;
  width: min(520px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.fr-modal-h { font-weight: 700; font-size: 1.1rem; margin-bottom: .8rem; }
.fr-modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .9rem; }
.fr-modal-hint { font-size: .8rem; margin-top: .5rem; text-align: right; }
.fr-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.fr-chip { padding: .28rem .65rem; border-radius: 999px; border: 1px solid #cbd5e1;
  background: #fff; cursor: pointer; font-size: .85rem; color: var(--fg); }
.fr-chip:hover { border-color: var(--accent); }
.fr-chip.on { background: #eaf2fd; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fr-custom { display: flex; gap: .4rem; margin-top: .5rem; }
.fr-custom input { flex: 1; padding: .35rem .55rem; border: 1px solid var(--border);
  border-radius: 7px; font-size: .88rem; }
.fr-note { width: 100%; margin-top: .5rem; padding: .45rem .6rem; border: 1px solid var(--border);
  border-radius: 7px; font-size: .88rem; resize: vertical; font-family: inherit; }
.fr-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.fr-btn { padding: .7rem .5rem; border-radius: 10px; border: 1px solid #cbd5e1;
  background: #fff; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--fg); }
.fr-btn.good:hover { background: #dcfce7; border-color: var(--good); color: var(--good); }
.fr-btn.bad:hover { background: #fee2e2; border-color: var(--bad); color: var(--bad); }
.fr-btn.skip:hover { background: #f3f4f7; }
.fr-hint { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: .6rem; font-size: .8rem; flex-wrap: wrap; }
.fr-undo { background: none; border: 0; color: var(--accent); cursor: pointer;
  font-size: .85rem; padding: .2rem 0; }
.fr-undo:disabled { color: var(--muted); cursor: default; opacity: .6; }
@media (max-width: 620px) {
  .fr-sides { grid-template-columns: 1fr; }
  .fr-actions { grid-template-columns: 1fr; }
}

/* /flip-labels: что сделали бы нынешние правила с разметкой */
.fl-rules { margin: .5rem 0 1rem; padding: .75rem 1rem; background: #f7f8fa; border-radius: 10px; }
.fl-rules-head { font-weight: 600; margin-bottom: .4rem; }
.fl-rules-head .muted { font-weight: 400; }
.fl-rules-tbl { width: auto; margin: .3rem 0 .5rem; }
.fl-rules-tbl td, .fl-rules-tbl th { padding: .25rem .7rem; text-align: right; }
.fl-rules-tbl td:first-child, .fl-rules-tbl th:first-child { text-align: left; }
.fl-rules-tbl td.cut { color: #16a34a; }
.fl-rules-tbl td.lost { color: var(--bad); }
tr.fl-cut td { background: #f3fbf5; }
tr.fl-cut.fl-lost td { background: #fdf0ee; }
.fl-verdict .badge { margin: 0 .2rem .2rem 0; white-space: nowrap; }
.badge.cut { background: #dcfce7; color: #15803d; }
.badge.lost { background: #fdecea; color: var(--bad); }
.badge.keep { background: #eef0f4; color: var(--muted); }

/* авторизация */
.site-user { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.site-user a { color: inherit; text-decoration: none; }
.site-user .linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; border-radius: 0; }
.site-user .linkish:hover { color: var(--accent); }
.auth-box { max-width: 380px; margin: 3rem auto; padding: 1.5rem; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; }
.auth-box h1 { margin-top: 0; }
.auth-form label { display: block; margin: .6rem 0; font-size: .9rem; }
.auth-form input, .auth-form select { display: block; width: 100%; box-sizing: border-box; margin-top: .25rem;
  padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.auth-form button { margin-top: .8rem; padding: .5rem 1.1rem; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.auth-form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.auth-form-row label { margin: 0; min-width: 200px; }
.auth-form-row button { margin-top: 0; }
.auth-error { color: var(--bad); background: #fdecea; padding: .5rem .75rem; border-radius: 8px; }
.auth-ok { color: #15803d; background: #dcfce7; padding: .5rem .75rem; border-radius: 8px; }
.auth-note { color: var(--muted); }
.auth-temp { margin: .5rem 0 1rem; padding: .75rem 1rem; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; }
.auth-temp-pw { display: inline-block; margin: .4rem 0; padding: .3rem .6rem; font-size: 1.15rem; background: #fff; border-radius: 6px; user-select: all; }
.users-tbl { width: 100%; border-collapse: collapse; }
.users-tbl th, .users-tbl td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.users-tbl tr.users-off td { color: var(--muted); }
.users-actions form { display: inline; margin-right: .4rem; }
.users-actions { white-space: nowrap; }
.users-actions button { font: inherit; font-size: .85rem; padding: .25rem .6rem; border: 1px solid var(--border);
  background: #fff; color: var(--fg); border-radius: 6px; cursor: pointer; }
.users-actions button:hover { border-color: var(--accent); color: var(--accent); }

/* страница пользователя */
.ud-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; }
@media (max-width: 900px) { .ud-cols { grid-template-columns: 1fr; } }
.ud-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: .3rem 0 1rem; }
.ud-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.ud-bar-fill { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.ud-bar span { font-size: .6rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.ud-events td { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* /flips/audit — разбор размеченных пар */
.fa-wrap { max-width: 960px; margin: 0 auto; padding: 1rem; }
.fa-filters { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; margin-bottom: .9rem; }
.fa-filters label { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; }
.fa-filters select { padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; }
.fa-nav { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.fa-nav button { width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.fa-nav button:disabled { opacity: .35; cursor: default; }
.fa-nav span { min-width: 5.5rem; text-align: center; font-weight: 600; }
.fa-card { max-width: none; }
.fa-label { margin-top: .25rem; font-size: .9rem; }
.fa-verdict { font-weight: 700; padding: .1rem .5rem; border-radius: 7px; background: #eef0f4; }
.fa-verdict.good { background: #dcfce7; color: var(--good); }
.fa-verdict.bad { background: #fee2e2; color: var(--bad); }
.fa-outcome { text-align: right; }
.fa-outcome .badge { font-size: .9rem; padding: .25rem .7rem; }
.fa-lost-note { font-size: .78rem; margin-top: .2rem; }
.fa-checks { width: 100%; border-collapse: collapse; margin: .8rem 0 1rem; font-size: .92rem; }
.fa-checks th, .fa-checks td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.fa-checks th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.fa-checks tr.ok .fa-mark { color: var(--good); }
.fa-checks tr.fail .fa-mark { color: var(--bad); font-weight: 600; }
.fa-checks tr.fail td { background: #fff5f5; }
.fa-checks tr.na .fa-mark { color: var(--muted); }
.fa-note { font-size: .75rem; margin-top: .1rem; }
.fa-thumb { position: relative; flex: 0 0 auto; cursor: pointer; opacity: .65; border-radius: 4px; }
.fa-thumb img { width: 54px; height: 40px; object-fit: cover; border-radius: 4px; display: block; }
.fa-thumb:hover { opacity: .9; }
.fa-thumb.cur { opacity: 1; outline: 2px solid var(--accent); }
.fa-thumb.match { outline: 2px solid #f59e0b; opacity: 1; }
.fa-thumb.match.cur { outline-color: var(--accent); box-shadow: 0 0 0 2px #f59e0b; }
.fa-thumb.twin { outline: 2px solid #2563eb; opacity: 1; }
/* подпись типа/стиля на миниатюре и строка под большим кадром */
.fa-fk { position: absolute; left: 0; right: 0; bottom: 0; font-size: .58rem; line-height: 1.1; padding: 1px 2px;
  background: rgba(17,24,39,.72); color: #fff; border-radius: 0 0 4px 4px; white-space: nowrap; overflow: hidden; font-weight: 600; }
.fa-fk.skip { background: rgba(107,114,128,.6); }
.fa-fk.st-fresh { background: rgba(22,101,52,.8); }
.fa-fk.st-old { background: rgba(180,83,9,.85); }
.fa-fk.st-bare { background: rgba(153,27,27,.85); }
.fa-frame-line { font-size: .82rem; margin-top: .3rem; }
.fa-frame-line .st-fresh, .fa-fsum .st-fresh { color: var(--good); }
.fa-frame-line .st-old, .fa-fsum .st-old { color: #b45309; }
.fa-frame-line .st-bare, .fa-fsum .st-bare { color: var(--bad); }
.fa-twin-note { color: #2563eb; }
.fa-fsum { font-size: .82rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px dashed var(--border); }
.fa-ids { font-size: .82rem; font-weight: normal; margin-top: .15rem; }
.fa-ids code { background: #eef0f4; padding: 0 .3rem; border-radius: 4px; }
.fa-thumb i { position: absolute; top: -4px; right: -4px; background: #f59e0b; color: #fff; font-style: normal;
  font-size: .62rem; font-weight: 700; border-radius: 999px; padding: 0 .3rem; line-height: 1.3; }
.fr-photo { position: relative; }
.fa-match-badge.big { position: absolute; left: .5rem; bottom: .5rem; background: #f59e0b; color: #fff;
  font-size: .78rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.fa-matches { margin-top: .9rem; }
.fa-matches-h { font-weight: 600; }
.fa-matches-h.ok { color: var(--good); }
.fa-matches-h.warn { color: #b45309; }
.fa-matches-h.fail { color: var(--bad); }
.fa-pairs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.fa-pair { display: flex; align-items: center; gap: .3rem; padding: .3rem .45rem; background: #fff7ed;
  border: 1px solid #fed7aa; border-radius: 8px; font-size: .78rem; }
.fa-pair img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; }
.fa-pair-n { font-weight: 700; color: #b45309; }
.fa-pair-eq { color: #b45309; font-weight: 700; }
.fa-reasons { margin-top: 1rem; }
.fa-reasons-h { font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.fa-note-text { margin-top: .5rem; padding: .5rem .7rem; background: #f7f8fa; border-radius: 8px; font-size: .9rem; white-space: pre-wrap; }

/* геометрия галерей в разборе */
.fa-geo { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.fa-geo-h { font-weight: 600; margin-bottom: .3rem; }
.fa-geo-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fa-geo-btn { font-size: .85rem; padding: .35rem .8rem; }
.fa-geo-verdict { font-weight: 700; padding: .15rem .55rem; border-radius: 7px; background: #eef0f4; }
.fa-geo-verdict.same { background: #dcfce7; color: var(--good); }
.fa-geo-verdict.diff { background: #fee2e2; color: var(--bad); }
.fa-geo-verdict.unsure { background: #fef3c7; color: #b45309; }
.fa-pair.geo { background: #eef6ff; border-color: #bfdbfe; }
.fa-geo-reasons { margin: .3rem 0 .2rem 1.1rem; padding: 0; font-size: .9rem; }
.fa-pair.geo.weak { opacity: .7; }
.fa-pair.geo .fa-pair-eq { color: #1d4ed8; }
.fa-geo-wait { margin-top: .4rem; }

/* смена решения в таблице оценок */
.fl-verdict-cell { white-space: nowrap; }
.fl-cur { font-size: 1.1rem; margin-right: .3rem; }
.fl-switch { display: inline-flex; gap: .15rem; opacity: .45; transition: opacity .15s; }
tr:hover .fl-switch { opacity: 1; }
.fl-sw { padding: .1rem .35rem; font-size: .9rem; line-height: 1.3; border: 1px solid #cbd5e1;
  border-radius: 6px; background: #fff; color: #111; cursor: pointer; }
.fl-sw:hover { border-color: var(--accent); }
.fl-sw-x { color: var(--muted); }
.fl-sw-x:hover { border-color: var(--bad); color: var(--bad); }
/* переоценка в разборе */
.fa-relabel { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.fa-relabel-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; margin: .4rem 0 .6rem; }
.fa-relabel .fr-btn.sel.bad { background: #fee2e2; border-color: var(--bad); color: var(--bad); }
.fa-relabel .fr-btn.sel.good { background: #dcfce7; border-color: var(--good); color: var(--good); }
.fa-relabel .fr-btn.sel.skip { background: #e5e7eb; }
.fa-relabel-foot { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }

/* что если: пороги на /flip-labels */
.fl-whatif { margin: .8rem 0; padding: .7rem .9rem; border: 1px dashed var(--border); border-radius: 10px; background: #fafbfc; }
.fl-whatif.changed { border-color: var(--accent); background: #f3f7fd; }
.fl-whatif-head { font-weight: 600; margin-bottom: .5rem; }
.fl-whatif-head .badge { margin: 0 .3rem; }
.fl-whatif-grid { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: flex-end; }
.fl-whatif-grid label { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; color: var(--muted); }
.fl-whatif-grid input { width: 6.5rem; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.fl-whatif-grid input.diff { border-color: var(--accent); background: #eaf2fd; font-weight: 600; }
.fl-whatif-grid button { padding: .4rem .9rem; }
.fa-th-note { margin: 0 0 .6rem; font-size: .85rem; }

.fl-rules-tbl tr.fl-prec td { border-top: 2px solid var(--border); padding-top: .4rem; }
.fl-rules-tbl tr.fl-prec b.up { color: #16a34a; }
.fl-rules-tbl tr.fl-prec b.down { color: var(--bad); }
.fl-filters { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; margin: .6rem 0; }
.fl-fgroup { white-space: nowrap; }
.fl-filters a.active { font-weight: 700; text-decoration: none; }

/* галереи под строками таблицы оценок */
.fl-galopts { display: flex; gap: 1.2rem; align-items: center; margin: .2rem 0 .6rem; font-size: .9rem; }
.fl-galopts label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
tr.fl-gal td { background: #fafbfc; padding: .4rem .6rem .6rem; border-bottom: 2px solid var(--border); }
.fl-gal-side { margin: .2rem 0; }
.fl-gal-cap { display: block; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
/* width:0 + min-width:100% — лента не участвует в расчёте ширины таблицы
   (иначе ячейка растягивается под все кадры), а занимает ширину ячейки и скроллится сама */
.fl-gal-strip { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .25rem; width: 0; min-width: 100%; box-sizing: border-box; }
tr.fl-gal td { max-width: 0; overflow: hidden; }
#fl-table-box > table { width: 100%; max-width: 100%; }
.fl-gal-strip img { height: 88px; width: auto; flex: 0 0 auto; border-radius: 6px; cursor: zoom-in; background: #eee; }
.fl-gal-strip img:hover { outline: 2px solid var(--accent); }

.fl-reasons-head { margin-top: .9rem; }
.fa-pair.skip { opacity: .45; }
.llm-pct.hi { color: var(--bad); }
.llm-pct.mid { color: var(--warn); }
.llm-pct.lo { color: var(--good); }
.llm-dist .llm-bar { display: flex; align-items: center; gap: .25rem; }
.llm-dist .llm-bar span.g { background: var(--good); height: 10px; border-radius: 2px; }
.llm-dist .llm-bar span.b { background: var(--bad); height: 10px; border-radius: 2px; }
tr.llm-good td { background: #f3fbf5; }
.fa-llm { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.fa-llm-pct { font-size: 1.15rem; }
.fa-llm-pct.hi { color: var(--bad); }
.fa-llm-pct.mid { color: var(--warn); }
.fa-llm-pct.lo { color: var(--good); }
.fa-llm-frames { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.fa-llm-frame { position: relative; }
.fa-llm-frame img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; display: block; }
.fa-llm-frame.hi i { background: rgba(198,40,40,.85); }
.fa-llm-frame.mid i { background: rgba(230,81,0,.85); }
.fa-llm-frame.lo i { background: rgba(46,125,50,.85); }
.fa-llm-frame.err i { background: rgba(107,114,128,.85); }
.fa-llm-run { display: inline-flex; align-items: center; gap: .4rem; }
.fa-llm-frame i { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: .7rem;
  text-align: center; background: rgba(17,24,39,.75); color: #fff; border-radius: 0 0 4px 4px; }
.fl-working { font-size: .8rem; margin-top: .4rem; }
.fl-geo-why { font-size: .8em; white-space: nowrap; font-weight: normal; }
.fl-geo-why a { color: inherit; text-decoration: underline dotted; }
.fl-reasons-tbl td a { text-decoration: none; }
.fl-reasons-tbl td a:hover { text-decoration: underline; }
.fl-reasons-tbl tr.active td { background: #eaf2fd; }
.fl-why { font-size: .78rem; max-width: 14rem; }

/* режим одной пары в ревью */
.fr-pairmode { margin: .4rem 0 .8rem; padding: .55rem .8rem; border: 1px solid var(--accent); background: #f3f7fd; border-radius: 10px; font-size: .92rem; }
.fr-pm-verdict { font-weight: 700; padding: .05rem .45rem; border-radius: 6px; background: #eef0f4; }
.fr-pm-verdict.good { background: #dcfce7; color: var(--good); }
.fr-pm-verdict.bad { background: #fee2e2; color: var(--bad); }
.fr-pm-saved { color: #16a34a; font-weight: 600; }
.fr-btn.sel.good { background: #dcfce7; border-color: var(--good); color: var(--good); }
.fr-btn.sel.bad { background: #fee2e2; border-color: var(--bad); color: var(--bad); }
.fr-btn.sel.skip { background: #e5e7eb; }

/* /runs — прогресс прогонов */
.run { margin: .7rem 0; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.run.running { border-color: var(--accent); }
.run.stale { border-color: #f59e0b; }
.run.failed { border-color: var(--bad); }
.run-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.run-bar { height: 8px; background: #eef0f4; border-radius: 4px; margin: .5rem 0 .4rem; overflow: hidden; }
.run-fill { height: 100%; background: var(--accent); transition: width .4s; }
.run.done .run-fill { background: #16a34a; }
.run-nums { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.run-last { font-size: .82rem; margin-top: .3rem; font-family: ui-monospace, monospace; white-space: pre-wrap; }

/* /scene/frames — галерея типов кадров */
.sf-counts { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin: .5rem 0 1rem; }
.sf-matrix td a { text-decoration: none; }
.sf-filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.sf-filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); }
.sf-filters input, .sf-filters select { padding: .3rem .45rem; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.sf-filters input[type=number] { width: 5.5rem; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.sf-item { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.sf-item img { width: 100%; height: 160px; object-fit: cover; cursor: zoom-in; display: block; background: #eee; }
.sf-item figcaption { padding: .35rem .5rem; font-size: .8rem; line-height: 1.35; }
.sf-item.kind-interior { border-color: #bfdbfe; }
.sf-item.kind-plan, .sf-item.kind-document { border-color: #fde68a; }
.sf-item.kind-exterior, .sf-item.kind-window { border-color: #fecaca; }
/* матрица сходства в разборе */
.fa-matrix-wrap { margin-top: .6rem; overflow-x: auto; }
.fa-matrix { border-collapse: collapse; font-size: .72rem; }
.fa-matrix th, .fa-matrix td { padding: 0; border: 1px solid #fff; text-align: center; }
.fa-matrix th img, .fa-matrix td.hdr img { width: 44px; height: 33px; object-fit: cover; display: block; }
.fa-matrix th.skip img, .fa-matrix td.hdr.skip img { opacity: .35; }
.fa-matrix td.cell { width: 44px; height: 33px; cursor: pointer; color: #111; }
.fa-matrix td.cell.skip { color: #999; background: #f3f4f6 !important; cursor: default; }
.fa-matrix td.cell.twin { outline: 2px solid var(--bad); outline-offset: -2px; font-weight: 700; }
.fa-matrix td.cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.fa-match-view { margin-top: .6rem; padding: .6rem; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.fa-match-view img { max-width: 100%; display: block; margin-top: .4rem; border-radius: 6px; }
.fa-match-stats { font-size: .88rem; display: flex; gap: 1rem; flex-wrap: wrap; }

tr.llm-live > td { background: var(--accent-bg, rgba(120,160,255,.12)); }
tr.llm-live > td:first-child { box-shadow: inset 3px 0 0 var(--good); }

/* Мягкая оценка пары: водопад вкладов (разбор). Полоса — относительный вес
   довода, чтобы глазом было видно, что решило, а не только итоговый процент. */
.fa-score { margin: .6rem 0 1rem; padding: .7rem .9rem; border-radius: 8px;
  background: var(--card-bg, rgba(127,127,127,.06)); }
.fa-score-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.fa-score-pct { font-size: 1.6rem; }
.fa-score-pct.hi { color: var(--good); }
.fa-score-pct.mid { color: var(--warn); }
.fa-score-pct.lo { color: var(--bad); }
.fa-score-rows { margin-top: .5rem; display: flex; flex-direction: column; gap: .2rem; }
.fa-score-row { display: grid; grid-template-columns: 90px 52px 1fr; align-items: center;
  gap: .5rem; font-size: .92rem; }
.fa-score-bar { display: block; height: 10px; border-radius: 3px;
  background: rgba(127,127,127,.15); position: relative; }
.fa-score-bar i { display: block; height: 100%; border-radius: 3px; }
.fa-score-row.up .fa-score-bar i { background: var(--good); }
.fa-score-row.down .fa-score-bar i { background: var(--bad); float: right; }
.fa-score-pts { text-align: right; font-variant-numeric: tabular-nums; }
.fa-score-row.up .fa-score-pts { color: var(--good); }
.fa-score-row.down .fa-score-pts { color: var(--bad); }
.fa-score-idle { margin-top: .4rem; font-size: .85rem; }
/* старт и стягивание — не сигналы, а устройство шкалы: столбик полый */
.fa-score-row.edge .fa-score-bar i { background: none; border: 1px solid var(--bad); }
.fa-score-row.edge.up .fa-score-bar i { background: none; border: 1px solid var(--good); }
.fa-score-sum { border-top: 1px solid rgba(127,127,127,.25); padding-top: .35rem; }
/* проверено, но довода нет: строка остаётся видимой — это результат работы,
   а не отсутствие данных, и путать их нельзя */
.fa-score-row.zero .fa-score-pts, .fa-score-row.zero .fa-score-txt { opacity: .6; }
.fa-chk { font-size: .8em; padding: 0 .3rem; border-radius: 3px;
  border: 1px solid rgba(127,127,127,.35); white-space: nowrap; }
@media (max-width: 520px) {
  .fa-score-row { grid-template-columns: 60px 48px 1fr; }
}
.hh-score input[type=range] { width: 110px; vertical-align: middle; margin-left: .3rem; }
.hh-score b { font-variant-numeric: tabular-nums; }

/* Балльная карта на /flips/score: корзины признака таблицей — значение
   показателя, сколько таких пар в разметке, доля флипов и итоговый балл.
   Бейджами это не читалось: нельзя было сравнить корзины между собой. */
.fs-tbl { width: 100%; font-size: .9rem; margin-top: .3rem; }
.fs-tbl th { font-weight: 600; text-align: right; white-space: nowrap; }
.fs-tbl th:first-child, .fs-tbl th:last-child { text-align: left; }
.fs-tbl td { padding: .18rem .4rem; }
.fs-tbl tr.up td { background: color-mix(in srgb, var(--good) 9%, transparent); }
.fs-tbl tr.down td { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.fs-range { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-cnt, .fs-pts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs-tbl tr.up .fs-pts { color: var(--good); }
.fs-tbl tr.down .fs-pts { color: var(--bad); }
@media (max-width: 720px) { .fs-tbl { font-size: .82rem; } }

/* Прежний вид бейджами — остался для узких мест. */
.fs-feat { margin: .8rem 0; padding-bottom: .6rem; border-bottom: 1px solid rgba(127,127,127,.15); }
.fs-feat.off { opacity: .55; }
.fs-feat-head { font-weight: 600; margin-bottom: .3rem; }
.fs-smooth { margin: 0 0 .35rem; font-size: .85em; }
.fs-bins { display: flex; flex-wrap: wrap; gap: .3rem; }
.fs-bin { display: flex; align-items: baseline; gap: .35rem; padding: .15rem .45rem;
  border-radius: 5px; font-size: .85rem; background: rgba(127,127,127,.08); }
.fs-bin.up { background: color-mix(in srgb, var(--good) 16%, transparent); }
.fs-bin.down { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.fs-bin-pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.fs-bin.up .fs-bin-pts { color: var(--good); }
.fs-bin.down .fs-bin-pts { color: var(--bad); }
.fs-bin-note { opacity: .8; }
/* Таблица порогов: две группы колонок — что показываем и чем за это платим. */
.fs-cuts thead tr:first-child th[colspan] { text-align: center; font-weight: 600;
  border-bottom: 1px solid rgba(127,127,127,.25); }
.fs-cuts td.lost { color: var(--good); }
.fs-cuts td.cut { color: var(--bad); }
.fl-score-tbl td.cut { color: var(--bad); }
.fl-score-tbl td.lost { color: var(--good); }
.fl-score-why { font-size: .85rem; }
.fl-score-note { margin: .3rem 0 1.2rem; }
.fl-legacy-head { margin-top: 1.4rem; opacity: .75; }
th.fl-off { opacity: .6; }
/* Числа в сводке — ссылки на срез таблицы ниже. */
.fl-rules-tbl a { border-bottom: 1px dashed currentColor; text-decoration: none; }
.fl-rules-tbl a:hover { border-bottom-style: solid; }
.fl-score-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-votes { font-size: .75rem; }

/* Ревью: метка второй руки и раскрытие чужой оценки ПОСЛЕ ответа. */
.fr-second { font-size: .75rem; padding: .1rem .4rem; border-radius: 4px; vertical-align: middle;
  background: color-mix(in srgb, var(--warn) 22%, transparent); }
.fr-score { font-size: .8rem; vertical-align: middle; font-variant-numeric: tabular-nums; }
.fr-score.hi { color: var(--good); }
.fr-score.lo { color: var(--bad); }
.fr-others { margin: .4rem 0 .6rem; padding: .5rem .8rem; border-radius: 8px; font-size: .9rem; }
.fr-others.ok { background: color-mix(in srgb, var(--good) 14%, transparent); }
.fr-others.clash { background: color-mix(in srgb, var(--bad) 16%, transparent); }
/* Строка таблицы оценок: главные доводы оценки вместо вердикта старых правил. */
.fl-why { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.fl-w { font-size: .78rem; padding: .05rem .35rem; border-radius: 4px;
  white-space: nowrap; background: rgba(127,127,127,.1); }
.fl-w.up { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.fl-w.down { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

/* Рейка разделов (карта флипов, отчёт «флипы вокруг») */
:root { --rail: 104px; }
  /* рейка */
.fm-rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 1000;
  background: #0f1117; color: #e5e7eb; display: flex; flex-direction: column;
  align-items: center; padding: 14px 0; gap: 6px; }
.fm-rail .logo { width: 56px; height: 56px; border-radius: 14px; background: #2563eb;
  display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 10px; }
.fm-rail a { color: #9ca3af; text-decoration: none; display: flex; flex-direction: column;
  align-items: center; gap: 4px; width: 92px; padding: 10px 0; border-radius: 12px;
  font-size: .78rem; }
.fm-rail a .ic { font-size: 20px; line-height: 1; }
.fm-rail a:hover { color: #fff; background: #1a1d26; }
.fm-rail a.on { color: #fff; background: #1a1d26; font-weight: 600; }
.fm-rail .spacer { flex: 1; }
.fm-rail .who { width: 40px; height: 40px; border-radius: 50%; background: #1a1d26;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }

