/* Расширение mvp.css для разделов «Болезни», «Препараты» и рейтинга участников.
   Подключается после assets/mvp.css. Новых переменных не вводит. */

/* ---------- Расширенный фильтр каталога ---------- */
.filter-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}
.filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 200px));
  gap: 10px;
}
.filter-row.pair { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.filter-more {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  display: grid;
  gap: 14px;
}
.filter-group > small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  border: 0;
  padding: 0;
  color: var(--coral);
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}
.filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.filter-range { display: flex; align-items: center; gap: 10px; }
.filter-range input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--coral); }
.filter-range output { min-width: 74px; color: var(--text); font-weight: 650; font-size: 13px; }

/* чипы-переключатели (светлая версия check-chips) */
.pick-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pick-chips label { position: relative; cursor: pointer; }
.pick-chips input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.pick-chips span {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: #514c48; background: #fff;
  font-size: 12px; font-weight: 600;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.pick-chips span:hover { border-color: #cfc7c1; }
.pick-chips input:checked + span {
  border-color: var(--coral); color: var(--coral-dark); background: var(--coral-soft);
}
.pick-chips input:focus-visible + span { outline: 3px solid #f5c775; outline-offset: 2px; }

/* активные фильтры */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 13px; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 0 6px 0 12px;
  border: 1px solid var(--coral); border-radius: 999px;
  color: var(--coral-dark); background: var(--coral-soft);
  font-size: 12px; font-weight: 650;
}
.filter-pill button {
  display: grid; place-items: center;
  width: 20px; height: 20px; border: 0; border-radius: 50%;
  color: inherit; background: rgba(237, 101, 71, .16);
  font-size: 13px; line-height: 1; cursor: pointer;
}
.filter-clear { color: var(--muted); font-size: 12px; text-decoration: underline; }

/* ---------- Карточка болезни ---------- */
.entity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.entity-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); overflow: hidden; }
.entity-cover { min-height: 100%; background: #ddd center / cover no-repeat; }
.entity-body { min-width: 0; padding: 17px 18px; }
.entity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entity-head h2 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.entity-latin { color: var(--muted); font-size: 12px; font-style: italic; }
.entity-body p { margin: 9px 0 0; color: #504b47; font-size: 13px; }
.entity-meta {
  display: flex; flex-wrap: wrap; gap: 7px 14px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.entity-meta strong { color: var(--text); }

/* уровень опасности / эффективности */
.level {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.level::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.level.low { color: var(--green); background: var(--green-soft); }
.level.mid { color: #8b6117; background: var(--amber-soft); }
.level.high { color: var(--coral-dark); background: var(--coral-soft); }
.level.quarantine { color: #fff; background: #171513; }
.level.quarantine::before { background: #ffc229; }

/* ---------- Страница болезни / препарата ---------- */
.entity-hero { padding: 26px; }
.entity-hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.entity-hero h1 { margin: 8px 0 4px; font-size: 34px; line-height: 1.08; letter-spacing: -.03em; }
.entity-hero-lead { margin: 12px 0 0; max-width: 62ch; color: #504b47; }
.spec-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px;
  margin-top: 20px;
}
.spec {
  padding: 12px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft);
}
.spec small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.spec strong { font-size: 14px; font-weight: 650; }

.symptom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.symptom figure { margin: 0; }
.symptom img, .symptom .ph {
  display: block; width: 100%; height: 130px;
  border-radius: 14px; object-fit: cover; background: #ddd8d3;
}
.symptom figcaption { margin-top: 7px; color: var(--muted); font-size: 12px; }

.dose-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dose-table th, .dose-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.dose-table th { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.dose-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

.link-list { display: grid; gap: 9px; }
.link-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.link-row:hover { border-color: var(--line-strong); }
.link-row .link-main { min-width: 0; flex: 1; }
.link-row strong { display: block; font-size: 14px; }
.link-row .micro { color: var(--muted); }

.timeline { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.timeline i {
  display: block; height: 26px; border-radius: 6px; background: var(--line);
  font-style: normal; font-size: 9px; color: var(--muted); text-align: center; line-height: 26px;
}
.timeline i.on { background: var(--amber-soft); color: #8b6117; font-weight: 700; }
.timeline i.peak { background: var(--coral-soft); color: var(--coral-dark); font-weight: 700; }

.safety-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.safety-list li { display: flex; gap: 9px; align-items: flex-start; }
.safety-list b { flex: 0 0 auto; width: 22px; text-align: center; }

/* ---------- Рейтинг участников ---------- */
.rank-list { display: grid; gap: 9px; }
.rank-row {
  display: grid; grid-template-columns: 46px 44px minmax(0, 1fr) auto auto;
  align-items: center; gap: 14px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
}
.rank-row.me { border-color: var(--coral); background: var(--coral-soft); }
.rank-place { font-size: 18px; font-weight: 750; color: var(--muted); text-align: center; }
.rank-row:nth-child(1) .rank-place { color: #a8801b; }
.rank-row .avatar { width: 44px; height: 44px; border-radius: 50%; background: #ddd center / cover no-repeat; }
.rank-name { min-width: 0; }
.rank-name strong { display: block; font-size: 15px; }
.rank-delta { font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }
.rank-delta.down { color: var(--coral); }
.rank-points { font-size: 17px; font-weight: 750; white-space: nowrap; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.badge {
  display: grid; gap: 4px; padding: 14px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); text-align: center;
}
.badge span { font-size: 26px; line-height: 1; }
.badge strong { font-size: 13px; }
.badge small { color: var(--muted); font-size: 11px; }
.badge.locked { opacity: .45; }

.level-track { display: grid; gap: 10px; }
.level-step {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.level-step.done { background: var(--green-soft); border-color: #d3e2d0; }
.level-step.current { border-color: var(--coral); background: var(--coral-soft); }
.level-step b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; font-size: 13px; }
.level-step small { display: block; color: var(--muted); font-size: 12px; }

.points-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.points-table th, .points-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.points-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.points-table td:last-child, .points-table th:last-child { text-align: right; white-space: nowrap; }
.points-plus { color: var(--green); font-weight: 700; }
.points-minus { color: var(--coral); font-weight: 700; }

@media (max-width: 1100px) {
  .entity-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .filter-row, .filter-row.pair { grid-template-columns: minmax(0, 1fr); }
  .entity-card { grid-template-columns: minmax(0, 1fr); }
  .entity-cover { min-height: 130px; }
  .entity-hero { padding: 20px; }
  .entity-hero h1 { font-size: 26px; }
  .rank-row { grid-template-columns: 34px 40px minmax(0, 1fr) auto; row-gap: 8px; }
  .rank-delta { grid-column: 3 / -1; }
  .timeline i { font-size: 8px; }
}

/* нейтральное информационное уведомление (в mvp.css есть только .error/.success) */
.alert.info {
  color: #6b5a2e;
  background: var(--amber-soft);
  border: 1px solid #f0dcae;
  font-size: 13px;
}

/* ---------- Каталог препаратов: компактная строка (без обложки) ---------- */
.catalog-summary { flex-wrap: wrap; row-gap: 4px; }
.treat-list { display: grid; gap: 9px; }
.treat-row { padding: 13px 16px; }
.treat-row-top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
}
.treat-row-top h2 { margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.treat-row-top h2 a { color: inherit; }
.treat-row-form { color: var(--muted); font-size: 12.5px; font-style: italic; margin-right: auto; }
.treat-row-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px;
  margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.treat-row-meta strong { color: var(--text); }

/* ---------- Тултип ориентировочной цены ---------- */
.price-block { position: relative; display: inline-flex; }
.price-value {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; padding: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.info-dot {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--muted); font-style: normal; font-size: 10px; line-height: 1;
}
.price-value:hover .info-dot, .price-value:focus-visible .info-dot {
  border-color: var(--coral); color: var(--coral-dark);
}
.price-block .tooltip {
  position: absolute; left: 0; bottom: calc(100% + 9px); z-index: 20;
  width: 230px; padding: 10px 12px; border-radius: 12px;
  background: #171513; color: #f4f1ee; font-size: 12px; line-height: 1.45;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.price-block .tooltip::after {
  content: ""; position: absolute; top: 100%; left: 12px;
  border: 6px solid transparent; border-top-color: #171513;
}
.price-block.is-open .tooltip,
.price-block:focus-within .tooltip {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* ---------- Вкладки регламента (СХ / ЛПХ) — без JS, на радиокнопках ---------- */
.reg-tabs { margin-top: 4px; }
.reg-tabs input[type="radio"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.reg-tabs-nav { display: flex; gap: 6px; margin-bottom: 12px; }
.reg-tabs-nav label {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer;
}
#reg-tab-sh:checked ~ .reg-tabs-nav label[for="reg-tab-sh"],
#reg-tab-lph:checked ~ .reg-tabs-nav label[for="reg-tab-lph"] {
  border-color: var(--coral); color: var(--coral-dark); background: var(--coral-soft);
}
#reg-tab-sh:focus-visible ~ .reg-tabs-nav label[for="reg-tab-sh"],
#reg-tab-lph:focus-visible ~ .reg-tabs-nav label[for="reg-tab-lph"] {
  outline: 3px solid #f5c775; outline-offset: 2px;
}
.reg-tab-panel { display: none; }
#reg-tab-sh:checked ~ .reg-tab-panel.panel-sh,
#reg-tab-lph:checked ~ .reg-tab-panel.panel-lph { display: block; }

/* ---------- Блок «Данные производителя» и прочие пустые состояния карточки ---------- */
.mfr-note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.mfr-note a { color: inherit; text-decoration: underline; }
.field-empty { color: var(--muted); font-weight: 500; font-style: italic; }
.field-empty strong { display: none; }
.block-empty {
  padding: 16px; border: 1px dashed var(--line-strong); border-radius: 14px;
  color: var(--muted); font-size: 13px; text-align: center;
}

/* ---------- Опциональное фото препарата в шапке ---------- */
.entity-hero-media {
  flex: 0 0 auto; width: 96px; height: 96px; border-radius: 16px;
  background: #ddd center / cover no-repeat; margin-right: 4px;
}

/* ---------- Состав: действующие вещества со ссылкой на карточку вещества ---------- */
.substance-list { display: grid; gap: 8px; }
.substance-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.substance-row a.substance-name { font-weight: 650; color: var(--text); }
.substance-row a.substance-name:hover { color: var(--coral-dark); }
.substance-row .micro { color: var(--muted); margin-right: auto; }

/* ---------- Список препаратов на веществе (substance-single.html) ---------- */
.origin-note { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .treat-row-top h2 { flex: 1 1 100%; }
  .treat-row-form { margin-right: 0; flex: 1 1 100%; }
  .reg-tabs-nav { flex-wrap: wrap; }
  .entity-hero-media { width: 72px; height: 72px; }
}
