/* ==========================================================================
   /tools/cvet-glaz-rebenka — цвет глаз ребёнка
   Блоки статьи и результата — общие с «Семейной выплатой» (sv-*), элементы формы —
   общие для инструментов (tool-form.css, tf-*): оба подключаются через CSS_DEPS.
   Здесь — голубой акцент, выбор цвета глаз «радужками», полоски вероятностей, таблица.
   ========================================================================== */
.ec-page {
  --tf-accent: #3b6fb6;
  --tf-accent-soft: #e2ebf8;
  --tf-line: #dde5f0;
}

.ec-page [hidden] {
  display: none !important;
}

/* Фон шапки на компьютере: светлая детская, центр пустой под заголовок */
.ec-page .sv-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(226, 235, 248, 0.7) 100%),
    url("/assets/images/cvet-glaz-rebenka-hero-bg.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #e2ebf8 100%) !important;
}

/* ---------- Радужка: зрачок, цветное кольцо, блик ---------- */
.ec-swatch {
  position: relative;
  flex: none;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #161616 0 23%, var(--ec1) 25%, var(--ec2) 62%, var(--ec3) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.14);
}

.ec-swatch::after {
  content: "";
  position: absolute;
  top: 26%;
  left: 54%;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

[data-eye="brown"] { --ec1: #a5682f; --ec2: #6e4220; --ec3: #3c2311; }
[data-eye="green"] { --ec1: #a9b866; --ec2: #6e8a3e; --ec3: #3d5828; }
[data-eye="gray"]  { --ec1: #bcc4cc; --ec2: #8a95a1; --ec3: #59636d; }
[data-eye="blue"]  { --ec1: #93c6ee; --ec2: #4f8fca; --ec3: #2b5b8d; }

[data-eye="unknown"] .ec-swatch {
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1.5px #d5dce6;
}

[data-eye="unknown"] .ec-swatch::after {
  content: "?";
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: none;
  font: 800 13px/26px "Montserrat", sans-serif;
  text-align: center;
  color: #7a8696;
}

/* ---------- Родители: четыре плашки ---------- */
.ec-pick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.ec-pick input,
.ec-dots input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ec-pick label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 11px;
  border: 1.5px solid var(--tf-line);
  border-radius: 14px;
  background: var(--tf-field);
  font: 700 13.5px/1.2 "Montserrat", sans-serif !important;
  color: var(--dark-text-color);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.ec-pick label .ec-swatch {
  width: 36px;
  height: 36px;
}

.ec-pick input:checked + label {
  border-color: var(--tf-accent);
  background: #fff;
  color: var(--main-bg-color);
  box-shadow: 0 0 0 3px var(--tf-accent-soft);
}

.ec-pick input:focus-visible + label {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* у кружков фокус — тёмная обводка снаружи кольца выбора, чтобы их не путать */
.ec-dots input:focus-visible + label {
  outline: 2px solid var(--main-bg-color);
  outline-offset: 5px;
}

.ec-page .ec-pick-hint {
  margin: -4px 4px 14px !important;
}

/* на компьютере мама и папа, стороны бабушек и дедушек — рядом */
@media (min-width: 900px) {
  .ec-parents,
  .ec-gp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }
  .ec-gp-grid {
    gap: 0 28px;
  }
}

/* ---------- Бабушки и дедушки: раскрывашка с кружками ---------- */
.ec-more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 800 16px/1.2 "Montserrat", sans-serif;
  color: var(--main-bg-color);
  list-style: none;
  cursor: pointer;
}

.ec-more summary::-webkit-details-marker {
  display: none;
}

.ec-more summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin: -4px 4px 0 auto;
  border-right: 2px solid var(--tf-accent);
  border-bottom: 2px solid var(--tf-accent);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.ec-more[open] summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.ec-more summary .tf-dot,
.ec-more summary::after {
  flex: none;
}

.ec-more-count {
  font: 600 13px "Montserrat", sans-serif;
  white-space: nowrap;
  color: var(--tf-accent);
}

.ec-gp-side {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf1f6;
}

.ec-gp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.ec-gp-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--main-bg-color);
}

.ec-gp-val {
  margin-left: 4px;
  font-style: normal;
  font-weight: 500;
  color: #5d6876;
}

.ec-dots {
  display: flex;
  gap: 10px;
}

/* подпись кружка — только для экранного диктора, на экране видно title и цвет */
.ec-dots .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ec-dots label {
  position: relative;
  flex: none;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.ec-dots input:checked + label {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--tf-accent);
}

/* ---------- Результат ---------- */
.ec-card,
.ec-notes {
  padding: 20px 22px;
  border: 1px solid var(--tf-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
}

.ec-page .ec-title {
  margin: 0 !important;
  font: 800 22px/1.25 "Montserrat", sans-serif !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  color: var(--main-bg-color);
}

.ec-page .ec-title:focus {
  outline: none;
}

.ec-page .ec-lead {
  margin: 6px 0 0 !important;
  font-size: 14px !important;
  line-height: 1.5;
  color: #5d6876;
}

.ec-page .ec-bars {
  margin: 18px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.ec-page .ec-bar {
  display: grid;
  grid-template-columns: 30px 190px minmax(0, 1fr) minmax(56px, auto);
  align-items: center;
  column-gap: 14px;
  margin: 0 !important;
  padding: 9px 0 !important;
  font-size: 15px !important;
  list-style: none;
}

.ec-bar + .ec-bar {
  border-top: 1px solid #eef2f7;
}

.ec-bar-name {
  font-weight: 700;
  color: var(--main-bg-color);
}

.ec-bar-name small {
  font-size: 12.5px;
  font-weight: 500;
  color: #5d6876;
}

.ec-bar-track {
  height: 12px;
  border-radius: 99px;
  background: #edf1f6;
  overflow: hidden;
}

.ec-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ec2), var(--ec1));
  transition: width 0.4s ease;
}

.ec-bar-pct {
  font: 800 17px "Montserrat", sans-serif;
  text-align: right;
  color: var(--main-bg-color);
  font-variant-numeric: tabular-nums;
}

.ec-page .ec-base {
  margin: 12px 0 0 !important;
  padding-top: 12px;
  border-top: 1px dashed var(--tf-line);
  font-size: 13px !important;
  line-height: 1.5;
  color: #5d6876;
}

.ec-page .ec-notes .sv-block-title {
  margin: 0 !important;
}

.ec-page .ec-notes-list {
  margin: 12px 0 0 !important;
  padding: 0 !important;
}

.ec-page .ec-notes-list li {
  position: relative;
  margin: 0 0 8px !important;
  padding-left: 16px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--dark-text-color);
  list-style: none;
}

.ec-page .ec-notes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-accent);
}

/* «Когда установится»: возраст слева, пояснение справа, точки на общей линии */
.ec-page .ec-when {
  position: relative;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.ec-page .ec-when::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  background: #e3e9f1;
}

.ec-page .ec-when li {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0 !important;
  padding: 0 0 12px 24px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  list-style: none;
}

.ec-page .ec-when li::before {
  content: "";
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--tf-accent);
}

.ec-when b {
  font: 700 14px/1.5 "Montserrat", sans-serif;
  color: var(--main-bg-color);
}

.ec-when span {
  color: var(--dark-text-color);
}

.ec-page .ec-when-note {
  margin: 4px 0 0 !important;
  font-size: 13.5px !important;
  line-height: 1.5;
  color: var(--main-bg-color);
  font-weight: 600;
}

.ec-page .ec-disclaimer {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.5;
  color: #5d6876;
}

/* ---------- Таблица в статье ---------- */
.ec-table-wrap {
  margin: 16px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.ec-table th,
.ec-table td {
  padding: 11px 14px;
  text-align: center;
  border-bottom: 1px solid #eef2f7;
}

.ec-table th {
  font: 700 12.5px "Montserrat", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5d6876;
  background: #f3f6fa;
}

.ec-table th:first-child,
.ec-table td:first-child {
  text-align: left;
}

.ec-table td:first-child {
  font-weight: 700;
  color: var(--main-bg-color);
}

.ec-table td.is-top {
  font-weight: 800;
  color: var(--main-bg-color);
}

.ec-table tr:last-child td {
  border-bottom: 0;
}

.ec-table-rules td:first-child {
  font-weight: 500;
  color: var(--dark-text-color);
}

.ec-table-rules td:last-child {
  font-weight: 700;
  white-space: nowrap;
  color: var(--main-bg-color);
}

.ec-page .ec-table-note {
  margin-top: -6px !important;
  font-size: 13px !important;
  line-height: 1.5;
  color: #5d6876;
}

/* список поводов к врачу — точки акцента, без плашек */
.ec-page .sv-article .ec-list {
  margin: 0 0 14px !important;
  padding: 0 !important;
}

.ec-page .sv-article .ec-list li {
  position: relative;
  margin: 0 0 8px !important;
  padding-left: 18px !important;
  font-size: inherit !important;
  line-height: 1.6;
  list-style: none;
}

.ec-page .sv-article .ec-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-accent);
}

/* Ссылки в тексте статьи — как в статьях других инструментов */
.ec-page .sv-article a {
  color: var(--gold-color);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(189, 160, 0, 0.35);
  text-underline-offset: 3px;
}

.ec-page .sv-article a:hover {
  color: var(--main-bg-color);
  text-decoration-color: currentColor;
}

/* Примечание под источниками: строка с иконкой «i», как у единого пособия */
.ec-page .sr-sources-note {
  display: flex;
  gap: 10px;
  margin: 18px 0 0 !important;
  padding: 16px 0 0 !important;
  border: 0 !important;
  border-top: 1px dashed #e6dfc6 !important;
  border-radius: 0 !important;
  background: none !important;
  font-style: normal !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #6b6555;
}

.ec-page .sr-sources-note::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--gold-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* заголовок на компьютере сразу в две строки — без сдвига вёрстки, когда догрузится Montserrat */
@media (min-width: 640px) {
  .ec-page .mb-hero-title span {
    display: block;
  }
}

/* ---------- Телефон ---------- */
@media (max-width: 639px) {
  .ec-form {
    padding: 0 !important;
  }
  .ec-form .sv-form-sub {
    margin-bottom: 14px !important;
  }
  .ec-pick {
    gap: 6px;
  }
  .ec-pick label {
    padding: 10px 4px 9px;
    font-size: 12.5px !important;
  }
  .ec-pick label .ec-swatch {
    width: 32px;
    height: 32px;
  }
  .ec-card {
    padding: 18px 16px;
  }
  .ec-notes {
    padding: 0;
    border: 0;
    background: none;
  }
  /* полоска уходит под название и процент */
  .ec-page .ec-bar {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .ec-bar-pct {
    grid-column: 3;
    grid-row: 1;
  }
  .ec-bar-track {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .ec-page .ec-when li {
    grid-template-columns: minmax(0, 1fr);
  }
  /* таблица помещается в экран: мельче шрифт и поля, шапка без капса */
  .ec-table {
    font-size: 13px;
  }
  .ec-table th,
  .ec-table td {
    padding: 9px 6px;
  }
  .ec-table th:first-child,
  .ec-table td:first-child {
    padding-left: 12px;
  }
  .ec-table th {
    font-size: 11.5px;
    letter-spacing: 0;
    text-transform: none;
  }
  .ec-page section.sv-article,
  .ec-page section.sv-related,
  .ec-page section.faq-section,
  .ec-page section.sv-results {
    padding: 0 !important;
    margin: 0 0 30px !important;
  }
  .ec-page section.sr-sources-block {
    margin: 0 0 30px !important;
  }
  .ec-page .sv-results {
    gap: 12px;
  }
  .ec-page .calc-share {
    margin: 14px 0 26px;
  }
  .ec-page .sv-results > .th-flat {
    margin-top: 16px !important;
  }
}

/* на самых узких экранах — плашки родителей по две в ряд */
@media (max-width: 359px) {
  .ec-pick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
