/* ec-components.css — Reusable component styles */

/* ──────────────────────────────────────────────
   SKIP LINK
────────────────────────────────────────────── */
.ec-skip-link {
  position: absolute;
  top: -100%;
  left: var(--ec-space-4);
  z-index: var(--ec-z-toast);
  padding: var(--ec-space-2) var(--ec-space-4);
  background: var(--ec-accent);
  color: var(--ec-white);
  border-radius: var(--ec-radius-sm);
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-medium);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-skip-link {
    transition: top var(--ec-transition);
  }
}

.ec-skip-link:focus {
  top: var(--ec-space-2);
}

/* ──────────────────────────────────────────────
   HEADER
────────────────────────────────────────────── */
.ec-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.ec-header__logo-text {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-accent);
  letter-spacing: -0.01em;
}


/* Hamburger toggle */
.ec-header__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: var(--ec-space-1);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-sm);
  background: transparent;
  color: var(--ec-text-primary);
  flex-shrink: 0;
  position: relative;
  z-index: calc(var(--ec-z-overlay) + 1);
  margin-left: auto;
}

.ec-header__toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--ec-text-primary);
  border-radius: var(--ec-radius-full);
}

@media (prefers-reduced-motion: no-preference) {
  .ec-header__toggle-bar {
    transition: background-color var(--ec-transition), transform var(--ec-transition), opacity var(--ec-transition);
  }
}

.ec-header__toggle[aria-expanded="true"] .ec-header__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ec-header__toggle[aria-expanded="true"] .ec-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.ec-header__toggle[aria-expanded="true"] .ec-header__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.ec-header__toggle:hover .ec-header__toggle-bar {
  background-color: var(--ec-accent);
}

/* Navigation — mobile first (hidden on mobile) */
.ec-header__nav {
  position: fixed;
  inset: 0 0 0 30%;
  z-index: var(--ec-z-overlay);
  background-color: var(--ec-bg-primary);
  box-shadow: var(--ec-shadow-lg);
  padding: var(--ec-space-12) var(--ec-space-6);
  transform: translateX(100%);
  visibility: hidden;
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-header__nav {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  }
}

.ec-header__nav.ec-header__nav--open {
  transform: translateX(0);
  visibility: visible;
}

.ec-header__nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}

.ec-header__nav-link {
  display: block;
  padding: var(--ec-space-3) var(--ec-space-4);
  color: var(--ec-text-primary);
  font-weight: var(--ec-font-medium);
  font-size: var(--ec-font-lg);
  border-radius: var(--ec-radius-md);
  text-decoration: none;
  text-align: left;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-header__nav-link {
    transition: background-color var(--ec-transition), color var(--ec-transition);
  }
}

.ec-header__nav-link:hover,
.ec-header__nav-link--active {
  background-color: var(--ec-accent-light);
  color: var(--ec-accent);
}

/* Overlay backdrop */
.ec-header__overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ec-z-sticky) - 1);
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-header__overlay {
    transition: opacity 0.4s ease, visibility 0.4s;
  }
}

.ec-header__overlay.ec-header__overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Tablet and above — show nav inline */
@media (min-width: 768px) {
  .ec-header__toggle {
    display: none;
  }


  .ec-header__nav {
    position: static;
    inset: auto;
    z-index: auto;
    background: none;
    box-shadow: none;
    padding: 0;
    transform: none;
    visibility: visible;
    margin-left: auto;
  }

  .ec-header__nav-list {
    flex-direction: row;
    gap: var(--ec-space-1);
  }

  .ec-header__nav-link {
    font-size: var(--ec-font-md);
    padding: var(--ec-space-2) var(--ec-space-3);
  }
}

/* ──────────────────────────────────────────────
   HERO
────────────────────────────────────────────── */
.ec-hero__heading {
  font-size: var(--ec-font-3xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-4);
}

.ec-hero__subheading {
  font-size: var(--ec-font-lg);
  color: var(--ec-text-secondary);
  max-width: 38rem;
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .ec-hero__heading {
    font-size: var(--ec-font-4xl);
  }
}

/* ──────────────────────────────────────────────
   CALCULATOR FORM
────────────────────────────────────────────── */
.ec-calculator {
  background-color: var(--ec-bg-primary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-8);
  box-shadow: var(--ec-shadow-md);
}

.ec-calculator__fieldset {
  margin-bottom: var(--ec-space-8);
}

.ec-calculator__fieldset:last-of-type {
  margin-bottom: 0;
}

.ec-calculator__legend {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  padding-bottom: var(--ec-space-4);
  margin-bottom: var(--ec-space-4);
  border-bottom: 1px solid var(--ec-border-light);
  width: 100%;
  display: block;
}

.ec-calculator__legend-note {
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-normal);
  color: var(--ec-text-muted);
  margin-left: var(--ec-space-2);
}

.ec-calculator__field {
  margin-bottom: var(--ec-space-5);
}

.ec-calculator__field:last-child {
  margin-bottom: 0;
}

.ec-calculator__label {
  display: block;
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-primary);
  font-size: var(--ec-font-sm);
  margin-bottom: var(--ec-space-2);
}

.ec-calculator__select {
  display: block;
  width: 100%;
  padding: var(--ec-space-3) var(--ec-space-4);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  background-color: var(--ec-bg-primary);
  color: var(--ec-text-primary);
  font-size: var(--ec-font-md);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--ec-space-3) center;
  padding-right: var(--ec-space-10);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-calculator__select {
    transition: border-color var(--ec-transition), box-shadow var(--ec-transition);
  }
}

.ec-calculator__select:hover {
  border-color: var(--ec-accent);
}

.ec-calculator__select:focus {
  outline: none;
  border-color: var(--ec-accent);
  box-shadow: var(--ec-focus-ring);
}

.ec-calculator__error {
  display: block;
  font-size: var(--ec-font-sm);
  color: var(--ec-error);
  margin-top: var(--ec-space-1);
  min-height: 1.25rem;
}

.ec-calculator__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ec-space-3);
  margin-top: var(--ec-space-8);
  padding-top: var(--ec-space-6);
  border-top: 1px solid var(--ec-border-light);
}

/* ──────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────── */
.ec-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ec-space-3) var(--ec-space-6);
  font-size: var(--ec-font-md);
  font-weight: var(--ec-font-medium);
  border-radius: var(--ec-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-button {
    transition: background-color var(--ec-transition), border-color var(--ec-transition), color var(--ec-transition), box-shadow var(--ec-transition);
  }
}

.ec-button--primary {
  background-color: var(--ec-accent);
  color: var(--ec-white);
  border-color: var(--ec-accent);
  flex: 1;
}

.ec-button--primary:hover {
  background-color: var(--ec-accent-hover);
  border-color: var(--ec-accent-hover);
  color: var(--ec-white);
}

.ec-button--secondary {
  background-color: transparent;
  color: var(--ec-text-secondary);
  border-color: var(--ec-border);
}

.ec-button--secondary:hover {
  background-color: var(--ec-bg-secondary);
  border-color: var(--ec-accent);
  color: var(--ec-accent);
}

/* ──────────────────────────────────────────────
   RESULT DISPLAY
────────────────────────────────────────────── */
.ec-result {
  display: none;
  margin-top: var(--ec-space-8);
  background-color: var(--ec-bg-primary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-6);
  box-shadow: var(--ec-shadow-sm);
}

.ec-result--visible {
  display: block;
}

.ec-result__heading {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-5);
}

.ec-result__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-4);
}

.ec-result__item {
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-1);
  margin-bottom: 0;
}

.ec-result__bar-track {
  height: 1.5rem;
  background-color: var(--ec-bg-tertiary);
  border-radius: var(--ec-radius-full);
  overflow: hidden;
  width: 100%;
}

.ec-result__bar {
  height: 100%;
  width: var(--ec-bar-width, 0%);
  border-radius: var(--ec-radius-full);
  background-color: var(--ec-gray-400);
  min-width: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-result__bar {
    transition: width 0.4s ease-out;
  }
}

.ec-result__bar[data-eye="brown"] {
  background-color: var(--ec-eye-brown);
}

.ec-result__bar[data-eye="blue"] {
  background-color: var(--ec-eye-blue);
}

.ec-result__bar[data-eye="green"] {
  background-color: var(--ec-eye-green);
}

.ec-result__bar[data-eye="hazel"] {
  background-color: var(--ec-eye-hazel);
}

.ec-result__bar[data-eye="gray"] {
  background-color: var(--ec-eye-gray);
}

.ec-result__bar[data-eye="amber"] {
  background-color: var(--ec-eye-amber);
}

.ec-result__bar--heterochromia {
  background: linear-gradient(90deg, var(--ec-eye-brown) 0%, var(--ec-eye-blue) 50%, var(--ec-eye-green) 100%);
}

.ec-result__label {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-secondary);
  font-weight: var(--ec-font-medium);
}

/* ──────────────────────────────────────────────
   CONTENT SECTIONS
────────────────────────────────────────────── */
.ec-section__heading {
  font-size: var(--ec-font-2xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-5);
  padding-bottom: var(--ec-space-3);
  border-bottom: 2px solid var(--ec-border-light);
}

.ec-section__subheading {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-top: var(--ec-space-6);
  margin-bottom: var(--ec-space-3);
}

.ec-section__text {
  color: var(--ec-text-secondary);
  margin-bottom: var(--ec-space-4);
  line-height: var(--ec-leading-relaxed);
}

.ec-section__list {
  color: var(--ec-text-secondary);
  padding-left: var(--ec-space-6);
  margin-bottom: var(--ec-space-4);
}

.ec-section__list li {
  margin-bottom: var(--ec-space-2);
  line-height: var(--ec-leading-relaxed);
}


/* Eye color description cards */
.ec-eye-card {
  background-color: var(--ec-bg-secondary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ec-space-4);
}

@media (min-width: 480px) {
  .ec-eye-card {
    flex-direction: row;
  }
}

.ec-eye-card__image {
  flex-shrink: 0;
  border-radius: var(--ec-radius-md);
  object-fit: cover;
}

.ec-eye-card__body {
  flex: 1;
}

.ec-eye-card__title {
  font-size: var(--ec-font-lg);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-3);
}

.ec-eye-card__list {
  list-style-type: disc;
  padding-left: var(--ec-space-5);
}

.ec-eye-card__list li {
  color: var(--ec-text-secondary);
  font-size: var(--ec-font-sm);
  margin-bottom: var(--ec-space-1);
}

/* Eye color description grid */
.ec-eye-descriptions {
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-5);
  margin-top: var(--ec-space-6);
}

/* Table */
.ec-table {
  min-width: 40rem;
}

.ec-table caption {
  text-align: center;
  margin-bottom: var(--ec-space-4);
}

.ec-table thead th {
  background-color: var(--ec-accent);
  color: var(--ec-white);
  font-weight: var(--ec-font-bold);
  text-align: center;
  white-space: nowrap;
  padding: var(--ec-space-2) var(--ec-space-4);
}

.ec-table tbody td {
  text-align: center;
  vertical-align: middle;
  padding: var(--ec-space-2) var(--ec-space-4);
}

.ec-table tbody tr:nth-child(even) td {
  background-color: var(--ec-bg-secondary);
}

.ec-table tbody tr:hover td {
  background-color: var(--ec-accent-light);
}

/* Notes callout */
.ec-callout {
  background-color: var(--ec-bg-secondary);
  border-left: 4px solid var(--ec-accent);
  border-radius: 0 var(--ec-radius-md) var(--ec-radius-md) 0;
  padding: var(--ec-space-4) var(--ec-space-5);
  margin-top: var(--ec-space-6);
  margin-bottom: var(--ec-space-6);
}

.ec-callout__heading {
  font-size: var(--ec-font-md);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-3);
}

.ec-callout__list {
  padding-left: var(--ec-space-5);
  list-style-type: decimal;
}

.ec-callout__list li {
  color: var(--ec-text-secondary);
  font-size: var(--ec-font-sm);
  margin-bottom: var(--ec-space-2);
}

/* FAQ section */
.ec-faq {
  margin-top: var(--ec-space-6);
}

.ec-faq__item {
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  margin-bottom: var(--ec-space-3);
  overflow: hidden;
  background-color: var(--ec-bg-primary);
}

.ec-faq__question {
  padding: var(--ec-space-4) var(--ec-space-5);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ec-space-4);
  font-size: var(--ec-font-md);
}

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

.ec-faq__question::after {
  content: '+';
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-normal);
  color: var(--ec-accent);
  flex-shrink: 0;
  line-height: 1;
}

.ec-faq__item[open] .ec-faq__question::after {
  content: '−';
}

.ec-faq__item[open] .ec-faq__question {
  border-bottom: 1px solid var(--ec-border-light);
  color: var(--ec-accent);
}

.ec-faq__answer {
  padding: var(--ec-space-4) var(--ec-space-5);
  color: var(--ec-text-secondary);
  line-height: var(--ec-leading-relaxed);
}

.ec-faq__answer p {
  margin-bottom: 0;
}

/* References */
.ec-references {
  counter-reset: ref-counter;
}

.ec-references__list {
  list-style: none;
  padding: 0;
}

.ec-references__item {
  counter-increment: ref-counter;
  display: flex;
  gap: var(--ec-space-3);
  margin-bottom: var(--ec-space-4);
  padding: var(--ec-space-4);
  background-color: var(--ec-bg-secondary);
  border-radius: var(--ec-radius-md);
  border: 1px solid var(--ec-border-light);
  color: var(--ec-text-secondary);
  font-size: var(--ec-font-sm);
}

.ec-references__item cite {
  display: block;
  margin-top: var(--ec-space-1);
  overflow-wrap: anywhere;
}

.ec-references__item::before {
  content: counter(ref-counter) '.';
  font-weight: var(--ec-font-bold);
  color: var(--ec-accent);
  flex-shrink: 0;
  min-width: 1.5rem;
}

/* ──────────────────────────────────────────────
   BREADCRUMBS
────────────────────────────────────────────── */
.ec-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ec-space-2);
  list-style: none;
  padding: 0;
}

.ec-breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: var(--ec-space-2);
  font-size: var(--ec-font-sm);
  margin-bottom: 0;
}

.ec-breadcrumbs__item+.ec-breadcrumbs__item::before {
  content: '/';
  color: var(--ec-text-muted);
  flex-shrink: 0;
}

.ec-breadcrumbs__link {
  color: var(--ec-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ec-breadcrumbs__current {
  color: var(--ec-text-muted);
  font-weight: var(--ec-font-medium);
}

/* ──────────────────────────────────────────────
   FOOTER
────────────────────────────────────────────── */
.ec-footer__nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ec-space-4);
  list-style: none;
  padding: 0;
  justify-content: center;
}

.ec-footer__nav-link {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-footer__nav-link {
    transition: color var(--ec-transition);
  }
}

.ec-footer__nav-link:hover {
  color: var(--ec-accent);
}

.ec-footer__copyright {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  display: block;
}

@media (min-width: 768px) {
  .ec-footer__nav-list {
    justify-content: flex-start;
  }
}

/* ──────────────────────────────────────────────
   BACK-TO-TOP (created by JS)
────────────────────────────────────────────── */
.ec-back-to-top {
  position: fixed;
  bottom: var(--ec-space-6);
  right: var(--ec-space-6);
  z-index: var(--ec-z-overlay);
  width: 3rem;
  height: 3rem;
  border-radius: var(--ec-radius-full);
  background-color: var(--ec-accent);
  color: var(--ec-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ec-shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-back-to-top {
    transition: opacity var(--ec-transition), visibility var(--ec-transition), background-color var(--ec-transition), transform var(--ec-transition);
  }
}

.ec-back-to-top--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ec-back-to-top:hover {
  background-color: var(--ec-accent-hover);
  transform: translateY(-2px);
}

/* ──────────────────────────────────────────────
   LEGAL PAGES
────────────────────────────────────────────── */
.ec-legal__heading {
  font-size: var(--ec-font-4xl);
  margin-bottom: var(--ec-space-2);
}

.ec-legal__date {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  display: block;
  margin-bottom: var(--ec-space-10);
}

.ec-legal__section-heading {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-top: var(--ec-space-10);
  margin-bottom: var(--ec-space-4);
  padding-bottom: var(--ec-space-2);
  border-bottom: 1px solid var(--ec-border-light);
}

.ec-legal__text {
  color: var(--ec-text-secondary);
  line-height: var(--ec-leading-relaxed);
  margin-bottom: var(--ec-space-4);
}

.ec-legal__list {
  padding-left: var(--ec-space-6);
  margin-bottom: var(--ec-space-4);
  list-style-type: disc;
}

.ec-legal__list li {
  color: var(--ec-text-secondary);
  margin-bottom: var(--ec-space-2);
}

/* ──────────────────────────────────────────────
   CONTACT PAGE
────────────────────────────────────────────── */
.ec-contact__card {
  background-color: var(--ec-bg-secondary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-8);
  margin-top: var(--ec-space-6);
}

.ec-contact__heading {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-4);
}

/* ──────────────────────────────────────────────
   ABOUT PAGE
────────────────────────────────────────────── */
.ec-about__intro {
  font-size: var(--ec-font-lg);
  color: var(--ec-text-secondary);
  line-height: var(--ec-leading-relaxed);
  margin-bottom: var(--ec-space-8);
  max-width: 45rem;
}

/* ──────────────────────────────────────────────
   CALCULATOR WIDGET SUBTITLE
────────────────────────────────────────────── */
.ec-calculator__subtitle {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-6);
  padding-bottom: var(--ec-space-4);
  border-bottom: 1px solid var(--ec-border-light);
}

.ec-calculator__intro {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  margin-top: calc(-1 * var(--ec-space-4));
  margin-bottom: var(--ec-space-6);
}

/* ──────────────────────────────────────────────
   RARITY RESULT CARD
────────────────────────────────────────────── */
.ec-rarity-result {
  display: none;
  margin-top: var(--ec-space-8);
}

.ec-rarity-result--visible {
  display: block;
}

.ec-rarity-result__card {
  background-color: var(--ec-bg-secondary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-6);
  margin-bottom: var(--ec-space-6);
}

.ec-rarity-result__headline {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-3);
  line-height: var(--ec-leading-tight);
}

.ec-rarity-badge {
  display: inline-block;
  padding: var(--ec-space-1) var(--ec-space-3);
  border-radius: var(--ec-radius-full);
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-bold);
  margin-bottom: var(--ec-space-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ec-rarity-badge--common {
  background-color: var(--ec-success-light);
  color: var(--ec-success);
}

.ec-rarity-badge--uncommon {
  background-color: var(--ec-accent-light);
  color: var(--ec-accent);
}

.ec-rarity-badge--rare {
  background-color: var(--ec-warning-light);
  color: var(--ec-text-primary);
}

.ec-rarity-badge--very-rare {
  background-color: var(--ec-error-light);
  color: var(--ec-error);
}

.ec-rarity-result__stat {
  font-size: var(--ec-font-lg);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-3);
}

.ec-rarity-result__note {
  color: var(--ec-text-secondary);
  line-height: var(--ec-leading-relaxed);
  margin-bottom: var(--ec-space-3);
}

.ec-rarity-result__disclaimer {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  margin-bottom: 0;
  font-style: italic;
}

/* ──────────────────────────────────────────────
   RARITY COMPARISON CHART
────────────────────────────────────────────── */
.ec-rarity-chart {
  background-color: var(--ec-bg-primary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-6);
  box-shadow: var(--ec-shadow-sm);
}

.ec-rarity-chart__heading {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-5);
  padding-bottom: var(--ec-space-3);
  border-bottom: 1px solid var(--ec-border-light);
}

.ec-rarity-chart__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-4);
}

.ec-rarity-chart__item {
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-1);
  border-radius: var(--ec-radius-md);
  padding: var(--ec-space-2) var(--ec-space-3);
}

.ec-rarity-chart__item--active {
  background-color: var(--ec-accent-light);
}

.ec-rarity-chart__item--active .ec-rarity-chart__label {
  color: var(--ec-accent);
  font-weight: var(--ec-font-bold);
}

.ec-rarity-chart__item--active .ec-rarity-chart__value {
  color: var(--ec-accent);
  font-weight: var(--ec-font-medium);
}

.ec-rarity-chart__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ec-rarity-chart__label {
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-secondary);
}

.ec-rarity-chart__value {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
}

.ec-rarity-chart__bar-track {
  height: 1.25rem;
  background-color: var(--ec-bg-tertiary);
  border-radius: var(--ec-radius-full);
  overflow: hidden;
  width: 100%;
}

.ec-rarity-chart__bar {
  height: 100%;
  width: var(--ec-rarity-bar-width, 0%);
  border-radius: var(--ec-radius-full);
  background-color: var(--ec-gray-400);
  min-width: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-rarity-chart__bar {
    transition: width 0.4s ease-out;
  }
}

.ec-rarity-chart__bar[data-eye="brown"]  { background-color: var(--ec-eye-brown); }
.ec-rarity-chart__bar[data-eye="blue"]   { background-color: var(--ec-eye-blue); }
.ec-rarity-chart__bar[data-eye="green"]  { background-color: var(--ec-eye-green); }
.ec-rarity-chart__bar[data-eye="hazel"]  { background-color: var(--ec-eye-hazel); }
.ec-rarity-chart__bar[data-eye="gray"]   { background-color: var(--ec-eye-gray); }
.ec-rarity-chart__bar[data-eye="amber"]  { background-color: var(--ec-eye-amber); }

.ec-rarity-chart__bar--heterochromia {
  background: linear-gradient(90deg, var(--ec-eye-brown) 0%, var(--ec-eye-blue) 50%, var(--ec-eye-green) 100%);
}

/* ──────────────────────────────────────────────
   CONTENT LINK OVERFLOW
────────────────────────────────────────────── */
.ec-content a,
.ec-references a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ──────────────────────────────────────────────
   HETEROCHROMIA PROBABILITY — RISK TIER BADGES
────────────────────────────────────────────── */
.ec-rarity-badge--low {
  background-color: var(--ec-success-light);
  color: var(--ec-success);
}

.ec-rarity-badge--slightly-elevated {
  background-color: var(--ec-warning-light);
  color: var(--ec-text-primary);
}

.ec-rarity-badge--elevated {
  background-color: var(--ec-error-light);
  color: var(--ec-error);
}

/* ──────────────────────────────────────────────
   HETEROCHROMIA PROBABILITY — FORM FIELDSET
────────────────────────────────────────────── */
.ec-calculator__gp-group {
  margin-bottom: var(--ec-space-8);
}

/* ──────────────────────────────────────────────
   HETEROCHROMIA PROBABILITY — RESULT METER
────────────────────────────────────────────── */
.ec-hetero-meter {
  margin-bottom: var(--ec-space-5);
}

.ec-hetero-meter__track {
  height: 1.5rem;
  background-color: var(--ec-bg-tertiary);
  border-radius: var(--ec-radius-full);
  overflow: hidden;
}

.ec-hetero-meter__fill {
  height: 100%;
  width: var(--ec-hetero-fill-width, 0%);
  border-radius: var(--ec-radius-full);
  min-width: 2px;
  background-color: var(--ec-accent);
}

@media (prefers-reduced-motion: no-preference) {
  .ec-hetero-meter__fill {
    transition: width 0.4s ease-out;
  }
}

.ec-hetero-meter__fill--low {
  background-color: var(--ec-success);
}

.ec-hetero-meter__fill--slightly-elevated {
  background-color: var(--ec-warning);
}

.ec-hetero-meter__fill--elevated {
  background-color: var(--ec-error);
}

.ec-hetero-meter__label {
  font-size: var(--ec-font-xs);
  color: var(--ec-text-muted);
  margin-top: var(--ec-space-1);
  text-align: right;
}

/* ──────────────────────────────────────────────
   HETEROCHROMIA PROBABILITY — RESULT CTA
────────────────────────────────────────────── */
.ec-hetero-cta {
  margin-top: var(--ec-space-5);
  padding-top: var(--ec-space-5);
  border-top: 1px solid var(--ec-border-light);
}

/* 404 page */
.ec-notfound {
  padding: var(--ec-space-16) var(--ec-space-4);
  text-align: center;
}

.ec-notfound__code {
  font-size: 6rem;
  font-weight: var(--ec-font-bold);
  color: var(--ec-accent);
  line-height: 1;
  display: block;
  margin-bottom: var(--ec-space-4);
}

.ec-notfound__heading {
  font-size: var(--ec-font-3xl);
  margin-bottom: var(--ec-space-4);
}

.ec-notfound__text {
  color: var(--ec-text-muted);
  margin-bottom: var(--ec-space-8);
  max-width: 30rem;
  margin-right: auto;
  margin-left: auto;
}

/* ──────────────────────────────────────────────
   RELATED TOOLS
────────────────────────────────────────────── */
.ec-related-tools {
  background: var(--ec-bg-secondary);
  padding: var(--ec-space-10) 0;
}

.ec-related-tools__container {
  max-width: var(--ec-content-max);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--ec-space-4);
  padding-left: var(--ec-space-4);
}

.ec-related-tools__heading {
  font-size: var(--ec-font-2xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-6);
}

.ec-related-tools__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ec-space-3);
}

.ec-related-tools__link {
  color: var(--ec-accent);
  font-size: var(--ec-font-md);
  font-weight: var(--ec-font-medium);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-related-tools__link {
    transition: color var(--ec-transition);
  }
}

.ec-related-tools__link:hover,
.ec-related-tools__link:focus {
  color: var(--ec-accent-hover);
  text-decoration: underline;
}

.ec-related-tools__link:focus {
  outline: 2px solid var(--ec-accent);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────
   CALCULATOR NUMBER + UNIT INPUT GROUP
────────────────────────────────────────────── */
.ec-calculator__input-group {
  display: flex;
  gap: var(--ec-space-3);
  align-items: stretch;
}

.ec-calculator__input {
  display: block;
  flex: 1;
  min-width: 0;
  padding: var(--ec-space-3) var(--ec-space-4);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  background-color: var(--ec-bg-primary);
  color: var(--ec-text-primary);
  font-size: var(--ec-font-md);
  font-family: var(--ec-font-sans);
  -moz-appearance: textfield;
}

.ec-calculator__input::-webkit-outer-spin-button,
.ec-calculator__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-calculator__input {
    transition: border-color var(--ec-transition), box-shadow var(--ec-transition);
  }
}

.ec-calculator__input:hover {
  border-color: var(--ec-accent);
}

.ec-calculator__input:focus {
  outline: none;
  border-color: var(--ec-accent);
  box-shadow: var(--ec-focus-ring);
}

.ec-calculator__select--unit {
  flex: 0 0 auto;
  width: auto;
  min-width: 7rem;
}

/* ──────────────────────────────────────────────
   BABY EYE COLOR CHANGE TIMELINE VISUAL
────────────────────────────────────────────── */
.ec-timeline {
  margin: var(--ec-space-6) 0;
}

.ec-timeline__track {
  position: relative;
  height: 1.5rem;
  background-color: var(--ec-bg-tertiary);
  border-radius: var(--ec-radius-full);
  overflow: visible;
}

.ec-timeline__highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ec-timeline-hl-left, 16.67%);
  width: var(--ec-timeline-hl-width, 8.33%);
  background-color: rgba(249, 171, 0, 0.28);
  border-radius: var(--ec-radius-full);
}

.ec-timeline__dot {
  position: absolute;
  top: 50%;
  left: var(--ec-timeline-dot-left, 0%);
  transform: translate(-50%, -50%);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--ec-radius-full);
  background-color: var(--ec-accent);
  border: 3px solid var(--ec-white);
  box-shadow: var(--ec-shadow-md);
  z-index: 2;
}

.ec-timeline__dot--early        { background-color: var(--ec-gray-500); }
.ec-timeline__dot--active       { background-color: var(--ec-warning); }
.ec-timeline__dot--stabilizing  { background-color: var(--ec-accent); }
.ec-timeline__dot--likely-final { background-color: var(--ec-success); }
.ec-timeline__dot--final        { background-color: var(--ec-success); }

.ec-timeline__milestones {
  position: relative;
  height: 2.75rem;
  margin-top: var(--ec-space-2);
}

.ec-timeline__milestone {
  position: absolute;
  left: var(--ec-timeline-ms-left, 0%);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.ec-timeline__milestone-marker {
  width: 2px;
  height: 0.5rem;
  background-color: var(--ec-gray-400);
}

.ec-timeline__milestone-label {
  font-size: var(--ec-font-xs);
  color: var(--ec-text-muted);
  white-space: nowrap;
}

.ec-timeline__stage-row {
  margin-top: var(--ec-space-4);
  text-align: center;
}

.ec-timeline-stage {
  display: inline-block;
  padding: var(--ec-space-1) var(--ec-space-3);
  border-radius: var(--ec-radius-full);
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ec-timeline-stage--early        { background-color: var(--ec-bg-tertiary);   color: var(--ec-text-secondary); }
.ec-timeline-stage--active       { background-color: var(--ec-warning-light); color: var(--ec-gray-900); }
.ec-timeline-stage--stabilizing  { background-color: var(--ec-accent-light);  color: var(--ec-accent); }
.ec-timeline-stage--likely-final { background-color: var(--ec-success-light); color: var(--ec-success); }
.ec-timeline-stage--final        { background-color: var(--ec-success-light); color: var(--ec-success); }

/* ──────────────────────────────────────────────
   LIKELY FINAL COLOR CHIPS
────────────────────────────────────────────── */
.ec-color-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ec-space-2);
  margin-top: var(--ec-space-2);
  margin-bottom: var(--ec-space-4);
}

.ec-color-chip {
  display: inline-block;
  padding: var(--ec-space-1) var(--ec-space-3);
  border-radius: var(--ec-radius-full);
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-medium);
}

.ec-color-chip--brown { background-color: var(--ec-eye-brown); color: var(--ec-white); }
.ec-color-chip--blue  { background-color: var(--ec-eye-blue);  color: var(--ec-white); }
.ec-color-chip--green { background-color: var(--ec-eye-green); color: var(--ec-white); }
.ec-color-chip--hazel { background-color: var(--ec-eye-hazel); color: var(--ec-white); }
.ec-color-chip--gray  { background-color: var(--ec-gray-700);  color: var(--ec-white); }
.ec-color-chip--amber { background-color: var(--ec-eye-amber); color: var(--ec-gray-900); }

.ec-timeline__chips-label {
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-primary);
  margin-top: var(--ec-space-4);
  margin-bottom: var(--ec-space-2);
}

/* ──────────────────────────────────────────────
   HERITAGE TRACER — RESULT LABELS
────────────────────────────────────────────── */
.ec-heritage-result__label {
  display: inline-block;
  padding: var(--ec-space-1) var(--ec-space-3);
  border-radius: var(--ec-radius-full);
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--ec-accent-light);
  color: var(--ec-accent);
  margin-bottom: var(--ec-space-3);
}

/* ──────────────────────────────────────────────
   HERITAGE TRACER — FAMILY TREE VISUAL
────────────────────────────────────────────── */
.ec-heritage-tree__heading {
  font-size: var(--ec-font-lg);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-top: var(--ec-space-6);
  margin-bottom: var(--ec-space-2);
}

.ec-heritage-tree__caption {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  margin-bottom: var(--ec-space-4);
}

.ec-heritage-tree {
  overflow-x: auto;
  padding-bottom: var(--ec-space-2);
}

.ec-heritage-tree__row {
  display: flex;
  justify-content: center;
  gap: var(--ec-space-4);
}

.ec-heritage-tree__row--gp {
  gap: var(--ec-space-8);
}

.ec-heritage-tree__side {
  display: flex;
  gap: var(--ec-space-3);
}

.ec-heritage-tree__connectors {
  display: flex;
  justify-content: center;
  height: var(--ec-space-8);
  position: relative;
}

.ec-heritage-tree__connectors--gp::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  width: 50%;
  height: 50%;
  border-top: 2px solid var(--ec-border);
  border-left: 2px solid var(--ec-border);
  border-right: 2px solid var(--ec-border);
  border-radius: var(--ec-radius-sm) var(--ec-radius-sm) 0 0;
}

.ec-heritage-tree__connectors--you::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background-color: var(--ec-border);
}

.ec-heritage-tree__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ec-space-1);
  padding: var(--ec-space-3) var(--ec-space-4);
  border: 2px solid var(--ec-border);
  border-radius: var(--ec-radius-md);
  background-color: var(--ec-bg-primary);
  min-width: 7rem;
  text-align: center;
}

.ec-heritage-tree__node--match {
  border-color: var(--ec-accent);
  background-color: var(--ec-accent-light);
}

.ec-heritage-tree__node--you {
  border-color: var(--ec-gray-700);
  background-color: var(--ec-bg-tertiary);
}

.ec-heritage-tree__node--unknown {
  border-color: var(--ec-border-light);
  background-color: var(--ec-bg-secondary);
  opacity: 0.6;
}

.ec-heritage-tree__node-name {
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-muted);
  white-space: nowrap;
}

.ec-heritage-tree__node--match .ec-heritage-tree__node-name {
  color: var(--ec-accent);
}

.ec-heritage-tree__node--you .ec-heritage-tree__node-name {
  color: var(--ec-text-primary);
  font-weight: var(--ec-font-bold);
}

.ec-heritage-tree__node-color {
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
}

.ec-heritage-tree__node-color--brown        { color: var(--ec-eye-brown); }
.ec-heritage-tree__node-color--blue         { color: var(--ec-eye-blue); }
.ec-heritage-tree__node-color--green        { color: var(--ec-eye-green); }
.ec-heritage-tree__node-color--hazel        { color: var(--ec-eye-hazel); }
.ec-heritage-tree__node-color--gray         { color: var(--ec-gray-600); }
.ec-heritage-tree__node-color--amber        { color: #b07d00; }
.ec-heritage-tree__node-color--heterochromia { color: var(--ec-accent); }

.ec-heritage-tree__node-star {
  color: var(--ec-accent);
}

@media (min-width: 480px) {
  .ec-heritage-tree__row--gp {
    gap: var(--ec-space-12);
  }
}

/* ──────────────────────────────────────────────
   EYE COLOR DOMINANCE VISUALIZER — BAR VISUAL
────────────────────────────────────────────── */
.ec-dom-vis__heading {
  font-size: var(--ec-font-lg);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-top: var(--ec-space-6);
  margin-bottom: var(--ec-space-4);
}

.ec-dom-vis__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ec-space-2);
  margin-bottom: var(--ec-space-3);
}

.ec-dom-vis__label {
  font-size: var(--ec-font-sm);
  font-weight: var(--ec-font-medium);
  color: var(--ec-text-secondary);
  flex: 1;
  line-height: var(--ec-leading-normal);
}

.ec-dom-vis__label--a {
  text-align: left;
}

.ec-dom-vis__label--b {
  text-align: right;
}

.ec-dom-vis__vs {
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.ec-dom-vis__track {
  display: flex;
  height: 2.25rem;
  border-radius: var(--ec-radius-full);
  overflow: hidden;
  background-color: var(--ec-bg-tertiary);
  margin-bottom: var(--ec-space-6);
}

.ec-dom-vis__fill {
  height: 100%;
  min-width: 4px;
}

.ec-dom-vis__fill--a {
  width: var(--ec-dom-a-width, 50%);
}

.ec-dom-vis__fill--b {
  flex: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .ec-dom-vis__fill--a {
    transition: width 0.5s ease-out;
  }
}

.ec-dom-vis__fill[data-eye="brown"] { background-color: var(--ec-eye-brown); }
.ec-dom-vis__fill[data-eye="blue"]  { background-color: var(--ec-eye-blue); }
.ec-dom-vis__fill[data-eye="green"] { background-color: var(--ec-eye-green); }
.ec-dom-vis__fill[data-eye="hazel"] { background-color: var(--ec-eye-hazel); }
.ec-dom-vis__fill[data-eye="gray"]  { background-color: var(--ec-eye-gray); }
.ec-dom-vis__fill[data-eye="amber"] { background-color: var(--ec-eye-amber); }

/* ──────────────────────────────────────────────
   EYE COLOR DOMINANCE VISUALIZER — RESULT CARD
────────────────────────────────────────────── */
.ec-dom-result {
  display: none;
  margin-top: var(--ec-space-8);
}

.ec-dom-result--visible {
  display: block;
}

.ec-dom-result__card {
  background-color: var(--ec-bg-secondary);
  border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius-lg);
  padding: var(--ec-space-6);
}

.ec-dom-result__badge {
  display: inline-block;
  padding: var(--ec-space-1) var(--ec-space-3);
  border-radius: var(--ec-radius-full);
  font-size: var(--ec-font-xs);
  font-weight: var(--ec-font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--ec-accent-light);
  color: var(--ec-accent);
  margin-bottom: var(--ec-space-3);
}

.ec-dom-result__badge--tie {
  background-color: var(--ec-warning-light);
  color: var(--ec-gray-800);
}

.ec-dom-result__headline {
  font-size: var(--ec-font-xl);
  font-weight: var(--ec-font-bold);
  color: var(--ec-text-primary);
  margin-bottom: var(--ec-space-3);
  line-height: var(--ec-leading-tight);
}

.ec-dom-result__note {
  color: var(--ec-text-secondary);
  line-height: var(--ec-leading-relaxed);
  margin-bottom: var(--ec-space-4);
}

.ec-dom-result__callout {
  background-color: var(--ec-accent-light);
  border-left: 4px solid var(--ec-accent);
  border-radius: 0 var(--ec-radius-md) var(--ec-radius-md) 0;
  padding: var(--ec-space-3) var(--ec-space-4);
  margin-bottom: var(--ec-space-4);
  color: var(--ec-text-secondary);
  font-size: var(--ec-font-sm);
  line-height: var(--ec-leading-relaxed);
}

.ec-dom-result__disclaimer {
  font-size: var(--ec-font-sm);
  color: var(--ec-text-muted);
  font-style: italic;
  margin-bottom: 0;
}