/* ============================================================
   Возраст сердца QRISK — уникальные блоки поверх calc-phenoage.css
   (общий pa-каркас грузится первым; здесь только hq-* специфика)
   ============================================================ */

:root {
  --hq-low:    #10b981;
  --hq-border: #f59e0b;
  --hq-inter:  #f97316;
  --hq-high:   #ef4444;
}

/* Медтермины — графит, как на страницах биовозраста (дефолт v2 оранжевый).
   Подчёркивание-аффорданс и hover/active оставляем глобальные. */
.v2-after-hero .med-term { color: var(--v2-ink); }

/* ── Select внутри pa-field__inputwrap ─────────────────────── */
.pa-field__inputwrap select {
  flex: 1;
  width: 100%;
  padding: 13px 16px;
  font-size: 15.5px;
  font-family: var(--v2-font);
  font-weight: 500;
  color: var(--v2-ink);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2370738f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

/* ── Mechanism flow ────────────────────────────────────────── */
.hq-mechanism {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  padding: 26px 28px;
  margin: 8px 0 16px;
}
.hq-mechanism__title {
  font-family: var(--v2-font);
  font-size: 12px; font-weight: 700;
  color: var(--v2-ink-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 16px;
}
.hq-mechanism__flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
}
.hq-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 100rem;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.hq-chip--1 { background: rgba(220,38,38,.10);  color: #dc2626; }
.hq-chip--2 { background: rgba(249,115,22,.12); color: #f97316; }
.hq-chip--3 { background: rgba(239,68,68,.12);  color: #ef4444; }
.hq-chip--4 { background: rgba(127,29,29,.14);  color: #991b1b; }
.hq-chip__arrow {
  color: var(--v2-ink-3);
  opacity: .55;
  font-size: 20px !important;
  font-variation-settings: 'wght' 300;
}
@media (max-width: 600px) {
  .hq-chip__arrow { transform: rotate(90deg); }
  .hq-mechanism__flow { flex-direction: column; align-items: flex-start; }
}

/* ── 9 risk factors grid ───────────────────────────────────── */
.hq-factors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 16px;
}
@media (max-width: 860px) { .hq-factors { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .hq-factors { grid-template-columns: 1fr; } }
.hq-factor {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  padding: 18px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.hq-factor:hover {
  border-color: rgba(42,52,238,.28);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(19,20,31,.20);
}
.hq-factor__icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 11px;
  background: rgba(42,52,238,.08);
  color: var(--v2-brand-2);
  font-size: 22px !important;
  font-variation-settings: 'wght' 400;
}
.hq-factor__icon--red   { background: rgba(220,38,38,.10);  color: #dc2626; }
.hq-factor__icon--gold  { background: rgba(217,119,6,.12);  color: #d97706; }
.hq-factor__icon--green { background: rgba(16,185,129,.12); color: #059669; }
.hq-factor__title {
  font-family: var(--v2-font-display);
  font-size: 15px; font-weight: 700;
  color: var(--v2-ink);
  margin-bottom: 4px;
  letter-spacing: -.005em;
}
.hq-factor__desc {
  font-size: 13px;
  color: var(--v2-ink-3);
  line-height: 1.5;
}

/* ── Toggles (checkbox cards) ──────────────────────────────── */
.hq-toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 520px) { .hq-toggles { grid-template-columns: 1fr; } }
.hq-toggle { position: relative; display: block; cursor: pointer; }
.hq-toggle input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.hq-toggle__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  min-height: 104px;
  background: var(--v2-bg-alt);
  border: 1.5px solid var(--v2-border);
  border-radius: 14px;
  text-align: center;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
}
.hq-toggle__icon {
  font-size: 26px !important;
  color: var(--v2-ink-3);
  transition: color .18s;
}
.hq-toggle__label {
  font-family: var(--v2-font);
  font-size: 13.5px; font-weight: 600;
  color: var(--v2-ink-2);
  line-height: 1.25;
}
.hq-toggle input:checked + .hq-toggle__box {
  border-color: var(--v2-ink-2);
  background: var(--v2-surface);
  box-shadow: 0 0 0 3px rgba(67,69,85,.10);
}
.hq-toggle input:checked + .hq-toggle__box .hq-toggle__icon { color: var(--hq-high); }
.hq-toggle input:focus-visible + .hq-toggle__box {
  border-color: var(--v2-ink-2);
  box-shadow: 0 0 0 3px rgba(67,69,85,.16);
}

/* ── 4 risk categories ─────────────────────────────────────── */
.hq-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 16px;
}
@media (max-width: 720px) { .hq-cats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .hq-cats { grid-template-columns: 1fr; } }
.hq-cat {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-left: 4px solid var(--v2-ink-3);
  border-radius: var(--v2-radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hq-cat--low    { border-left-color: var(--hq-low); }
.hq-cat--border { border-left-color: var(--hq-border); }
.hq-cat--inter  { border-left-color: var(--hq-inter); }
.hq-cat--high   { border-left-color: var(--hq-high); }
.hq-cat__val {
  font-family: var(--v2-font-display);
  font-size: 26px; font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}
.hq-cat--low    .hq-cat__val,
.hq-cat--low    .hq-cat__name { color: var(--hq-low); }
.hq-cat--border .hq-cat__val,
.hq-cat--border .hq-cat__name { color: var(--hq-border); }
.hq-cat--inter  .hq-cat__val,
.hq-cat--inter  .hq-cat__name { color: var(--hq-inter); }
.hq-cat--high   .hq-cat__val,
.hq-cat--high   .hq-cat__name { color: var(--hq-high); }
.hq-cat__name {
  font-family: var(--v2-font-display);
  font-size: 15px; font-weight: 700;
}
.hq-cat__desc {
  font-size: 12.5px;
  color: var(--v2-ink-3);
  line-height: 1.5;
}

/* ── Population distribution ───────────────────────────────── */
.hq-pop {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  padding: 26px 28px;
  margin: 8px 0 16px;
}
.hq-pop__title {
  font-family: var(--v2-font);
  font-size: 12px; font-weight: 700;
  color: var(--v2-ink-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 18px;
}
.hq-pop-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.hq-pop-bar__label {
  flex-shrink: 0;
  min-width: 84px;
  text-align: right;
  font-size: 12.5px;
  color: var(--v2-ink-3);
  font-variant-numeric: tabular-nums;
}
.hq-pop-bar__track {
  flex: 1;
  height: 12px;
  background: var(--v2-bg-alt);
  border-radius: 99px;
  overflow: hidden;
}
.hq-pop-bar__fill {
  height: 100%;
  border-radius: 99px;
  transition: width .8s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.hq-pop-bar--low    .hq-pop-bar__fill { background: var(--hq-low); }
.hq-pop-bar--border .hq-pop-bar__fill { background: var(--hq-border); }
.hq-pop-bar--inter  .hq-pop-bar__fill { background: var(--hq-inter); }
.hq-pop-bar--high   .hq-pop-bar__fill { background: var(--hq-high); }
.hq-pop-bar__val {
  flex-shrink: 0;
  min-width: 46px;
  font-family: var(--v2-font-display);
  font-size: 13px; font-weight: 700;
  color: var(--v2-ink);
  font-variant-numeric: tabular-nums;
}
.hq-pop__note {
  font-size: 12px;
  color: var(--v2-ink-3);
  line-height: 1.5;
  margin-top: 14px;
}
@media (max-width: 520px) {
  .hq-pop { padding: 22px 18px; }
  .hq-pop-bar__label { min-width: 70px; font-size: 11.5px; }
  .hq-pop-bar__val { min-width: 42px; font-size: 12px; }
}

/* ── Statin indications + table ────────────────────────────── */
.hq-statin-groups {
  background: var(--v2-bg-alt);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  padding: 22px 26px 22px 28px;
  margin: 8px 0 20px;
}
.hq-statin-groups ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hq-statin-groups li {
  font-size: 14px;
  color: var(--v2-ink-2);
  line-height: 1.5;
}
.hq-statin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
}
.hq-statin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 520px;
}
.hq-statin-table th {
  background: var(--v2-ink-2);
  color: #fff;
  padding: 13px 16px;
  text-align: left;
  font-family: var(--v2-font);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hq-statin-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--v2-border);
  color: var(--v2-ink-2);
  vertical-align: middle;
}
.hq-statin-table tbody tr:hover td { background: var(--v2-bg-alt); }
.hq-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100rem;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.hq-badge--high { background: rgba(239,68,68,.12);  color: #dc2626; }
.hq-badge--mod  { background: rgba(249,115,22,.12); color: #ea580c; }

/* ── Limitations list ──────────────────────────────────────── */
.hq-limits {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hq-limits li {
  position: relative;
  padding: 16px 18px 16px 48px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius);
  font-size: 14px;
  color: var(--v2-ink-2);
  line-height: 1.55;
}
.hq-limits li::before {
  content: '!';
  position: absolute;
  left: 16px; top: 15px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(245,158,11,.16);
  color: var(--hq-border);
  font-family: var(--v2-font-display);
  font-weight: 700;
  font-size: 12px;
  display: grid; place-items: center;
}
.hq-limits li strong { color: var(--v2-ink); font-weight: 700; }
