/* Отчёт (задача 4): классы .rep-. Размеры и цвета — из макетов desktop-06…16, 22 и phone-13…23, 29, 32.
   Макет считает высоту без внутренних отступов и рамок (content-box), сайт — с ними (border-box), поэтому
   «min-height: 64px; padding: 12px» макета здесь записано как min-height 88px. Межстрочный интервал,
   которого макет не задаёт, — normal, как в макете.
   Цвета шкал (#D3ECDF, #BCE6D0 → #E2F2E9), условия «Можно дешевле» (#3D5A4F) и стрелок сводки (#A0A7B0) взяты
   из макета: в общих переменных их нет */
.rep, .rep-pane { line-height: normal; }

/* ---------- Общие куски строк ---------- */
.rep-item { display: block; min-width: 0; }
.rep-item-name { display: block; font-size: 15px; font-weight: 600; line-height: 20px; }
.rep-item-sub { display: block; font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.rep-okline { display: flex; align-items: center; gap: 8px; }
.rep-okline .ic { color: var(--c-ok); }

.rep-chips { display: flex; gap: 8px; }

.rep-sum { border-radius: var(--r-24); background: var(--c-surface); }
.rep-sum-label { font-size: 14px; color: var(--c-text-2); }
.rep-sum-total { margin-top: 4px; font-size: 44px; font-weight: 700; line-height: 50px; letter-spacing: -.025em; white-space: nowrap; }
.rep-sum-bar { --bar3-h: 12px; margin: 6px 0 4px; }
.rep-sum-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 49px; border-bottom: 1px solid var(--c-border-2); }
.rep-sum-row .dot { width: 10px; height: 10px; }
.rep-sum-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rep-sum-title { font-size: 15px; font-weight: 600; }
.rep-sum-sub { font-size: 13px; color: var(--c-text-2); }
.rep-sum-sum { margin-left: auto; font-size: 16px; font-weight: 700; white-space: nowrap; }

.rep-deal { display: block; width: 100%; border-radius: var(--r-24); background: var(--c-ok-bg); }
.rep-deal.is-active { box-shadow: inset 0 0 0 2px var(--c-ok-text); }
.rep-deal-title { display: block; font-size: 21px; font-weight: 700; line-height: 26px; color: var(--c-ok-text); }
.rep-deal-desc { display: block; font-size: 15px; line-height: 21px; }

/* Группа: заголовок сворачивает её, стрелка вверх у открытой и вниз у свёрнутой */
.rep-groups { display: flex; flex-direction: column; gap: 14px; }
.rep-group { display: flex; flex-direction: column; gap: 8px; }
.rep-group-h { font-size: 16px; font-weight: 400; }
/* Узкий экран переносит заголовок и подпись группы по словам («2 / работы»), а не посреди слова: общий
   overflow-wrap: anywhere разрешил бы сжать подпись до буквы */
.rep-group-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; margin-top: 4px; overflow-wrap: break-word; }
.rep-group-head .dot { width: 10px; height: 10px; }
.rep-group-title { font-size: 20px; font-weight: 700; }
.rep-group-sub { font-size: 14px; color: var(--c-text-2); }
.rep-group-sum { margin-left: auto; font-size: 18px; font-weight: 700; white-space: nowrap; }
.rep-group-head > .ic { color: var(--c-text-2); transition: transform .2s; }
.rep-group-head[aria-expanded='false'] > .ic { transform: rotate(180deg); }
.rep-group-body { display: flex; flex-direction: column; gap: 8px; }
.rep-desk .rep-nowork { padding: 14px 18px; }

/* Подробный отчёт и подвал */
.rep-more { display: flex; flex-direction: column; gap: 10px; border-radius: var(--r-24); background: var(--c-surface); }
.rep-more-text { flex: 1; min-width: 0; }
.rep-more-title { display: flex; align-items: baseline; font-size: 17px; font-weight: 700; }
.rep-more-title > span + span { margin-left: auto; }
.rep-more-desc { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--c-muted-4); }
.rep-more-done { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.rep-more-done .ic { color: var(--c-ok); }
.rep-more-note { font-size: 13px; color: var(--c-text-2); }
.rep-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; font-size: 13px; color: var(--c-text-2); }
/* Ссылка макета — поля 10 px и строка Onest 14 px, всего 38 px. Кнопка нажимается на 44 px, а лишние 3 px сверху
   и снизу уходят в отрицательные поля, как у .rep-back: строка с ценами и низ отчёта стоят там же, где в макете */
.rep-foot-rules { flex: none; min-height: 44px; margin-block: -3px; font-size: 14px; font-weight: 600; color: var(--c-primary); }

/* ---------- Компьютер: отчёт слева, липкая панель справа (460 px, от 1024 до 1279 px — 380 px) ---------- */
.rep-desk { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 32px; align-items: start; }
.rep-main { min-width: 0; padding-bottom: 32px; }

/* Шапка отчёта. Кнопки — справа на уровне строки цен, подпись про пример — сразу под строкой цен. Строке цен нужно
   около 440 px; где рядом с ней кнопкам места нет (окно уже 1400 px), кнопки встают под подпись про пример.
   Отступ 22 px сверху и 18 px снизу — часть шапки: прилипшая шапка стоит там же, где без прокрутки, а строки
   скрываются там же, где в макете. Поля на 8 px шире колонки — для белого фона прилипшей шапки, см. ниже */
.rep-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'text actions' 'note note';
  align-items: end;
  column-gap: 16px;
  margin: 0 -8px;
  padding: 22px 8px 18px;
}
.rep-head-text { grid-area: text; min-width: 0; }
.rep-head .rep-demo-note { grid-area: note; }
.rep-head-actions { grid-area: actions; display: flex; gap: 16px; }
.rep-head-actions .rep-share { padding: 0 18px; }

@media (max-width: 1399.98px) {
  .rep-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'text' 'note' 'actions'; }
  .rep-head-actions { margin-top: 14px; }
}

/* Фокус с клавиатуры окно прокручивает ниже шапки сайта, а где шапка отчёта прилипла — ниже обеих */
html:has(.rep-head) { scroll-padding-top: var(--hdr-h); }

/* На высоком окне шапка отчёта прилипает под шапкой сайта и строки уходят под неё — как в макете, где под шапкой
   прокручивается только левая колонка. Ниже 860 px (ноутбуки 1366×768 и 1536×864 за вычетом панелей браузера)
   две шапки заняли бы 40–45 % окна, поэтому там шапка отчёта уезжает вместе со страницей. Белый фон прилипшей
   шапки на 8 px шире колонки с каждой стороны: кольцо фокуса строки под ней не выглядывает сбоку.
   Шапка отчёта — 152 px в одну строку с кнопками и до 230 px, когда кнопки и подпись встают в столбик */
@media (min-width: 1024px) and (min-height: 860px) {
  .rep-head { position: sticky; top: var(--hdr-h); z-index: 2; background: #fff; }
  html:has(.rep-head) { scroll-padding-top: calc(var(--hdr-h) + 160px); }
}
@media (min-width: 1024px) and (max-width: 1399.98px) and (min-height: 860px) {
  html:has(.rep-head) { scroll-padding-top: calc(var(--hdr-h) + 240px); }
}
/* Ссылка «‹ Главная» в макете 26 px высотой: область нажатия 44 px, лишнее съедают отрицательные поля */
.rep-back { display: flex; align-items: center; gap: 4px; width: max-content; min-height: 44px; margin: -9px 0; font-size: 14px; color: var(--c-text-2); }
.rep-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.rep-title { font-size: 30px; font-weight: 700; line-height: 36px; letter-spacing: -.02em; }
.rep-meta { margin-top: 4px; font-size: 14px; color: var(--c-text-2); }
.rep-demo-note { margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--c-text-2); }

.rep-desk .rep-flow { display: flex; flex-direction: column; gap: 14px; }

.rep-desk .rep-sum { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; padding: 22px 24px 6px; }
.rep-desk .rep-sum-ok { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--c-text-2); }

.rep-desk .rep-deal { display: flex; align-items: center; gap: 24px; padding: 18px 24px; }
.rep-deal-text { flex: 1; min-width: 0; }
.rep-desk .rep-deal-desc { margin-top: 4px; }
.rep-deal-go {
  display: flex;
  flex: none;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-14);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-ok-text);
}

.rep-desk .rep-chips .chip { padding: 0 18px; }

/* Строка: имя, мини-шкала или сноска, цена */
.rep-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 100px;
  gap: 28px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 12px 20px;
  border-radius: var(--r-18);
  background: var(--c-surface);
}
.rep-row.is-selected { background: #fff; box-shadow: inset 0 0 0 2px var(--c-dark); }
.rep-row-note { font-size: 13px; line-height: 18px; color: var(--c-muted-4); }
.rep-row-price { font-size: 16px; font-weight: 700; text-align: right; white-space: nowrap; }

.rep-mini { position: relative; display: block; height: 40px; margin: 0 6px; }
.rep-mini > span { position: absolute; }
.rep-mini-track { left: 0; right: 0; top: 8px; height: 6px; border-radius: 3px; background: #D3ECDF; }
.rep-mini-tick {
  left: var(--at);
  top: 6px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--c-ok);
}
.rep-mini-tick.is-low { background: var(--c-ok); }
.rep-mini-knob { left: var(--at); top: 1px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--c-dark); }
.rep-mini-end { left: -6px; top: 24px; font-size: 12px; color: var(--c-text-2); white-space: nowrap; }
.rep-mini-end.is-max { left: auto; right: -6px; }

.rep-desk .rep-more { flex-direction: row; align-items: center; gap: 20px; margin-top: 6px; padding: 18px 24px; }
.rep-desk .rep-more-done { gap: 20px; }

/* Панель: на высоту окна под шапкой сайта, прокручивается сама. Прилипает одинаково, прилипла шапка отчёта или
   уехала: шапка стоит в левой колонке сетки, панель — в правой, они не пересекаются, и верх панели — вровень
   с «‹ Главная», как в desktop-06 */
.rep-panel {
  position: sticky;
  top: calc(var(--hdr-h) + 22px);
  height: calc(100dvh - var(--hdr-h) - 46px);
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--r-28);
  background: var(--c-surface);
  overflow-y: auto;
  scrollbar-width: thin;
}

@media (min-width: 1024px) and (max-width: 1279.98px) {
  .rep-desk { grid-template-columns: minmax(0, 1fr) 380px; }
  .rep-desk .rep-sum { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
  .rep-desk .rep-sum-name { flex-direction: column; align-items: flex-start; gap: 0; }
  .rep-row { gap: 20px; }
}

@media (hover: hover) {
  .rep-row:hover { background: var(--c-surface-hover); }
  .rep-row.is-selected:hover { background: #fff; }
}

/* ---------- Подробности строки: панель компьютера и шторки ---------- */
/* В панели плашки белые на сером, в шторке и окне — серые на белом */
.rep-pane { --rep-box: var(--c-surface); --rep-rule: var(--c-border-2); display: flex; flex-direction: column; gap: 14px; }
.rep-panel .rep-pane { --rep-box: #fff; --rep-rule: var(--c-border-3); }
/* Над первой строкой шторки и окна — крестик оболочки */
.layer-body .rep-pane-top { padding-right: 40px; }
.rep-box { border-radius: var(--r-20); background: var(--rep-box); }

.rep-pane-title { margin-top: 10px; font-size: 22px; font-weight: 700; line-height: 27px; letter-spacing: -.01em; }
.rep-panel .rep-pane-title { font-size: 24px; line-height: 29px; }
.rep-pane-sub { margin-top: 2px; font-size: 14px; color: var(--c-text-2); }
.rep-pane-heading { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.rep-pane-h { font-size: 17px; font-weight: 700; }
.rep-sellers-h { margin-top: 4px; }
.rep-panel .rep-sellers-h { margin-top: 2px; }
.rep-pane-text { font-size: 15px; line-height: 21px; }
.rep-pane-note2 { margin-top: -6px; font-size: 14px; line-height: 20px; color: var(--c-text-2); }
.rep-pane-when { margin-top: -4px; font-size: 13px; color: var(--c-text-2); }

.rep-inorder { display: flex; align-items: center; min-height: 52px; padding: 0 16px; border-radius: var(--r-16); }
.rep-inorder span { font-size: 15px; }
.rep-inorder b { margin-left: auto; font-size: 18px; font-weight: 700; white-space: nowrap; }

/* Ползунок: в панели и шторке — в плашке, на телефоне — в карточке строки */
.rep-scale-box { padding: 6px 4px 8px; }
.rep-scale { position: relative; display: block; height: 100px; margin: 10px 18px 0; }
.rep-panel .rep-scale { margin: 10px 20px 0; }
.rep-scale > span { position: absolute; }
.rep-scale-label {
  left: var(--at);
  top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-primary-hover);
  white-space: nowrap;
  transform: translateX(-50%);
}
.rep-scale-track { left: 0; right: 0; top: 34px; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #BCE6D0, #E2F2E9); }
.rep-scale-tick { left: var(--at); top: 30px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: var(--c-primary); }
.rep-scale-knob {
  left: var(--at);
  top: 27px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: var(--c-primary-hover);
  box-shadow: 0 0 0 4px #fff, 0 4px 12px rgba(7, 60, 52, .35);
}
.rep-scale-end { left: -12px; top: 62px; line-height: 18px; white-space: nowrap; }
.rep-scale-end.is-max { left: auto; right: -12px; text-align: right; }
.rep-scale-end b { display: block; font-size: 14px; font-weight: 700; }
.rep-scale-end span { display: block; font-size: 12px; color: var(--c-text-2); }

/* Списки продавцов, городов и «Можно дешевле» */
.rep-list { padding: 0 16px; }
.rep-line { display: flex; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid var(--rep-rule); }
.rep-line:last-child { border-bottom: 0; }
.rep-line-text { flex: 1; min-width: 0; padding: 6px 0; }
.rep-line-price { font-size: 16px; font-weight: 700; white-space: nowrap; }
.rep-list-sellers { padding: 0 4px 0 16px; }
.rep-seller { min-height: 63px; }
.rep-seller .rep-line-text { padding: 8px 0; }
.rep-panel .rep-seller { min-height: 59px; }
.rep-panel .rep-seller .rep-line-text { padding: 7px 0; }
.rep-ext { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-12); color: var(--c-primary); }
.rep-list-local .rep-line { min-height: 58px; }
.rep-list-local .rep-line-text { padding: 0; }
.rep-list-deal .rep-line { min-height: 61px; }
.rep-list-deal .rep-line-text { padding: 0; }
.rep-list-deal .rep-deal-total { min-height: 62px; }
.rep-deal-both { flex: 1; font-size: 15px; font-weight: 700; }
.rep-deal-sum { text-align: right; }
.rep-deal-sum b { display: block; font-size: 19px; font-weight: 700; }
.rep-deal-sum span { display: block; font-size: 13px; color: var(--c-text-2); }

.rep-question { display: block; width: 100%; padding: 16px; border-radius: var(--r-20); background: var(--c-dark); color: #fff; }
.rep-panel .rep-question { padding: 16px 18px; }
.rep-question-head { display: flex; align-items: center; font-size: 13px; color: var(--c-muted-2); }
.rep-question-show { display: flex; align-items: center; gap: 2px; margin-left: auto; font-weight: 600; color: #fff; }
.rep-question-text { display: block; margin-top: 8px; font-size: 18px; font-weight: 600; line-height: 24px; }

/* «Почему такой вывод»: стрелка вправо у свёрнутого, вниз у раскрытого */
.rep-why {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 6px 14px;
  border-radius: var(--r-16);
  box-shadow: inset 0 0 0 1.5px var(--c-border-2);
}
.rep-panel .rep-why { padding: 6px 16px; background: #fff; box-shadow: none; }
.rep-why-text { flex: 1; font-size: 14px; line-height: 19px; }
.rep-why > .ic { color: var(--c-text-2); transition: transform .2s; }
.rep-why[aria-expanded='true'] > .ic { transform: rotate(90deg); }

.rep-deal-heading { line-height: 29px; color: var(--c-ok-text); }
.rep-deal-warn { gap: 10px; padding: 12px 14px; border-radius: var(--r-16); font-size: 14px; line-height: 20px; }
.rep-deal-warn .ic { margin-top: 2px; }
.rep-deal-ok { font-size: 14px; color: var(--c-muted-4); }

/* ---------- Телефон ---------- */
/* Верхняя полоса прилипает к верху; компактная шапка висит под ней и появляется после прокрутки */
.rep-top { position: sticky; top: 0; z-index: 10; background: #fff; }
/* Фокус с клавиатуры не прячется под полосой с компактной шапкой (56 + 102 px) и под кнопкой над навигацией */
html:has(.rep-phone) { scroll-padding: 168px 0 calc(var(--nav-h) + 104px); }
.rep-bar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px; }
.rep-round { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-surface); }
.rep-bar-text { flex: 1; min-width: 0; text-align: center; }
.rep-bar-title { font-size: 17px; font-weight: 700; line-height: 22px; }
.rep-bar-sub { font-size: 13px; line-height: 17px; color: var(--c-text-2); }

.rep-compact {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: 8px 16px 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 20, 24, .08);
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.rep-compact.is-shown { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.rep-compact-row { display: flex; align-items: center; gap: 10px; }
.rep-compact-total { font-size: 22px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.rep-compact-bar { flex: 1; gap: 2px; min-width: 24px; }
/* Плашка 30 px высотой, область нажатия — 44 px */
.rep-compact-deal {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  background: var(--c-ok-bg);
  color: var(--c-ok-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.rep-compact-deal::after { content: ''; position: absolute; inset: -7px 0; }

/* Чипы листаются вбок; поля по 4 px сверху и снизу — место для кольца фокуса */
.rep-phone .rep-chips { margin: -4px -16px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; }
.rep-phone .rep-chips .chip { flex: none; }
.rep-phone .rep-compact-chips { margin: 6px -16px -4px; }

.rep-phone .rep-flow { display: flex; flex-direction: column; gap: 12px; padding: 6px 16px 0; }

.rep-phone .rep-sum { padding: 18px 18px 2px; }
.rep-sum-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.rep-sum-at { margin-left: auto; font-size: 12px; color: var(--c-text-2); }
.rep-demo { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.rep-phone .rep-demo-chip { flex: none; background: #fff; }
.rep-phone .rep-demo-note { margin-top: 0; font-size: 12px; line-height: 17px; }
.rep-phone .rep-sum-total { margin-top: 10px; font-size: 40px; line-height: 46px; }
.rep-phone .rep-sum-bar { margin: 14px 0 4px; }
.rep-phone .rep-sum-row { min-height: 53px; }
.rep-phone .rep-sum-name { flex: 1; flex-direction: column; align-items: flex-start; gap: 0; }
.rep-phone .rep-sum-title { line-height: 19px; }
.rep-phone .rep-sum-sub { line-height: 17px; }
.rep-phone .rep-sum-row > .ic { color: #A0A7B0; }
.rep-phone .rep-sum-ok { min-height: 42px; font-size: 13px; color: var(--c-text-2); }

.rep-phone .rep-deal { padding: 16px 18px; }
.rep-deal-head { display: flex; align-items: center; gap: 8px; }
.rep-deal-head .rep-deal-title { flex: 1; }
.rep-deal-head .ic { color: var(--c-ok-text); }
.rep-phone .rep-deal-desc { margin-top: 6px; line-height: 20px; text-wrap: pretty; }
.rep-deal-cond { display: block; margin-top: 6px; font-size: 13px; line-height: 17px; color: #3D5A4F; }

.rep-phone .rep-groups { gap: 10px; }
.rep-phone .rep-group-head { min-height: 48px; }

.rep-card { display: block; width: 100%; padding: 16px 16px 0; border-radius: var(--r-20); background: var(--c-surface); }
.rep-card-top { display: flex; gap: 12px; }
.rep-card-top .rep-item { flex: 1; }
.rep-card .rep-item-name { font-size: 16px; line-height: 21px; }
.rep-card-price { font-size: 17px; font-weight: 700; line-height: 21px; white-space: nowrap; }
.rep-card .rep-scale { margin: 10px 12px 0; }
.rep-card-note { display: block; margin-top: 8px; font-size: 14px; line-height: 20px; }
.rep-card-note2 { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.rep-card-foot { display: flex; align-items: center; min-height: 47px; margin-top: 12px; border-top: 1px solid var(--c-border-2); font-size: 14px; }
.rep-card-hint { color: var(--c-text-2); }
.rep-card-more { display: flex; align-items: center; gap: 2px; margin-left: auto; font-weight: 600; color: var(--c-primary); }

.rep-phone .rep-more { margin-top: 8px; padding: 16px 18px; }
.rep-phone .rep-more-desc { margin-top: 10px; }
.rep-phone .rep-more .btn { min-height: 48px; }

/* «Как мы считаем» в 12 px от подписи, как в макете: свои лишние 3 px кнопка прячет в отрицательные поля (выше) */
.rep-phone .rep-foot { flex-direction: column; gap: 12px; padding: 0; }
.rep-phone .rep-foot-text { padding: 4px 12px 0; font-size: 12px; line-height: 18px; text-align: center; }
.rep-phone .rep-foot-rules { padding: 0 14px; }
