/* A lead audit that pairs a broken step with its TECHMEN correction. */
html body main#top #system.lead-repair {
  --repair-ink: #21192d;
  --repair-line: #e6ddea;
  --repair-violet: #6137a3;
  --repair-gradient: linear-gradient(100deg, #a01d47 8%, #b72240 55%, #bd3225 98%);
  color: var(--repair-ink) !important;
  background: #fff !important;
}

html body main#top #system.lead-repair::before,
html body main#top #system.lead-repair::after { content: none !important; }

#system .repair-intro {
  max-width: 740px;
  margin: 0 auto clamp(24px, 4vw, 42px);
  text-align: center;
}

html[lang] body[data-tm-page="home"] main#top #system .repair-intro h2 {
  color: var(--repair-ink) !important;
  font-size: clamp(26px, 3.45vw, 47px) !important;
  font-weight: 420 !important;
  line-height: 1.04 !important;
  text-align: center;
}

html[dir="rtl"] body[data-tm-page="home"] main#top #system .repair-intro h2 {
  line-height: 1.24 !important;
}

#system .repair-intro h2 > span {
  display: block;
  margin-block-start: .08em;
  color: #a01d47;
  font-weight: 850;
}

#system .repair-intro h2 > span::after {
  content: "";
  display: inline-block;
  inline-size: 1.03em;
  block-size: .95em;
  margin-inline-start: .27em;
  vertical-align: -.08em;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 32' fill='none' stroke='%23b72240' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8v15h18M8 18v-6m6 6v-3m6 3v-1M5 5l9 3 6-1 10 8m-6 0h6V9'/%3E%3Cpath d='M30 20c-1 2-4 4.6-4 6.5a4 4 0 0 0 8 0c0-1.9-3-4.5-4-6.5Z' fill='%23fce3e7'/%3E%3C/svg%3E");
}

@supports (background-clip: text) {
  #system .repair-intro h2 > span {
    background: var(--repair-gradient);
    background-clip: text;
    color: transparent;
  }
}

#system .repair-console {
  width: min(100%, 980px);
  box-sizing: border-box;
  margin-inline: auto;
  text-align: start;
}

#system .repair-switch {
  display: none;
  min-inline-size: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

#system .repair-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
}

#system .repair-option { position: relative; min-inline-size: 0; }

#system .repair-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

#system .repair-option-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-block-size: 64px;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--repair-line);
  border-radius: 13px;
  background: #fff;
  color: var(--repair-ink);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}

#system .repair-option-face > svg {
  flex-shrink: 0;
  color: var(--repair-violet);
}

#system .repair-option input:checked + .repair-option-face {
  border-color: #b595d6;
  background: linear-gradient(115deg, #f4ebff, #fff5ed);
  color: #492774;
  box-shadow: inset 0 -2px #b595d6;
}

@media (hover: hover) and (pointer: fine) {
  #system .repair-option:hover input:not(:checked) + .repair-option-face {
    border-color: #c9b0ea;
    background: #f2eafd;
    color: #4c2878;
    box-shadow: 0 4px 11px #34205218;
  }

  #system .repair-option:hover input:checked + .repair-option-face {
    box-shadow: inset 0 -2px #b595d6, 0 5px 15px #63388b20;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #system .repair-option-face {
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  }

  #system .repair-option:hover .repair-option-face { transform: translateY(-2px); }
}

#system .repair-option input:focus-visible + .repair-option-face {
  outline: 2px solid var(--repair-violet);
  outline-offset: 2px;
}

#system .repair-panels {
  display: grid;
  gap: 12px;
}

#system .repair-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  min-inline-size: 0;
  padding: clamp(12px, 2.4vw, 23px);
  border: 1px solid #e7deee;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 30px #2413370b;
}

#system .repair-state {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-inline-size: 0;
  margin: 0;
  padding: clamp(13px, 2.5vw, 25px);
  border: 1px solid var(--state-chip);
  border-radius: 17px;
  background: linear-gradient(145deg, var(--state-wash), #fff);
}

#system .repair-error {
  --state-wash: #fdf6f7;
  --state-accent: #952b40;
  --state-chip: #f8d8de;
}

#system .repair-fix {
  --state-wash: #f3faf6;
  --state-accent: #196542;
  --state-chip: #d0ebd9;
}

#system .repair-fix::after {
  content: "";
  position: absolute;
  inset-block-end: 8px;
  inset-inline-end: 12px;
  width: clamp(52px, 9vw, 112px);
  height: 74px;
  background: center / contain no-repeat url('/assets/techmen-logo.webp');
  opacity: .085;
  pointer-events: none;
}

#system .repair-fix > * { position: relative; z-index: 1; }

#system .repair-state-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--state-accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

#system .repair-state-icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  inline-size: 26px;
  block-size: 26px;
  border-radius: 50%;
  background: var(--state-chip);
}

html[lang] body[data-tm-page="home"] main#top #system .repair-state h3 {
  margin: 0 !important;
  color: var(--state-accent) !important;
  font-size: clamp(17px, 1.9vw, 23px) !important;
  font-weight: 750 !important;
  line-height: 1.24 !important;
  text-transform: none !important;
  text-wrap: balance;
}

#system .repair-bridge {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--repair-violet);
}

#system .repair-bridge::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 50%;
  block-size: 1px;
  background: linear-gradient(90deg, #ad8ad6, #e3a891);
}

#system .repair-bridge > span {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border: 1px solid #e1d0ee;
  border-radius: 50%;
  background: linear-gradient(130deg, #f4ecfe, #fef1e8);
}

html[dir="rtl"] #system .repair-bridge svg { scale: -1 1; }

/* Native radios work with keyboard navigation. Older browsers see every pair. */
@supports selector(:has(input:checked)) {
  #system .repair-switch { display: block; }
  #system .repair-panels { gap: 0; }
  #system .repair-panel { grid-area: 1 / 1; visibility: hidden; }
  #system .repair-console:has(#leak-content:checked) #repair-content,
  #system .repair-console:has(#leak-creative:checked) #repair-creative,
  #system .repair-console:has(#leak-ads:checked) #repair-ads,
  #system .repair-console:has(#leak-website:checked) #repair-website,
  #system .repair-console:has(#leak-followup:checked) #repair-followup { visibility: visible; }
}

@media (max-width: 600px) {
  html[lang] body[data-tm-page="home"] main#top #system .repair-intro h2 {
    font-size: clamp(24px, 6.8vw, 34px) !important;
  }

  #system .repair-option-face {
    flex-direction: column;
    gap: 5px;
    min-block-size: 56px;
    font-size: 12px;
    line-height: 1.25;
  }

  #system .repair-panel { grid-template-columns: minmax(0, 1fr); }
  #system .repair-bridge { min-block-size: 31px; }
  #system .repair-bridge::before {
    inset-block: 0;
    inset-inline-start: 50%;
    inset-inline-end: auto;
    inline-size: 1px;
    block-size: auto;
    background: linear-gradient(#ad8ad6, #e3a891);
  }
  #system .repair-bridge > span { inline-size: 25px; block-size: 25px; }
  #system .repair-bridge svg,
  html[dir="rtl"] #system .repair-bridge svg { scale: none; rotate: 90deg; }
}

@media (max-width: 410px) {
  #system .repair-options { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #system .repair-option { grid-column: span 2; }
  #system .repair-option:nth-last-child(-n + 2) { grid-column: span 3; }
}
