/* A shared index for real process steps. The links work as ordinary page fragments. */
[data-steps] {
  --ys-rail: #93aebe;
  --ys-mark: #185477;
  --ys-paper: #e9f2f7;
  --ys-current: #174e6e;
  --ys-current-ink: #fff;
  --ys-ring: #247ba6;
}
[data-steps="legacy"], [data-steps="home"], [data-steps="registry"], [data-steps="registry-summary"] {
  --ys-rail: #63879f;
  --ys-current: #a7e5ff;
  --ys-current-ink: #12334d;
  --ys-ring: #58b6da;
}
[data-steps] > [data-step] {
  position: relative;
  scroll-margin-block-start: calc(115px + var(--preview-inset, 0px));
}
body [data-steps] > [data-step] > a.ys-step-link {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  margin: 0;
  border: 1px solid var(--ys-rail) !important;
  border-radius: 50%;
  background: var(--ys-paper) !important;
  color: var(--ys-mark) !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
  z-index: 1;
}
body [data-steps] > [data-step]:is(:target, :focus-within) > a.ys-step-link,
body [data-steps] > [data-step] > a.ys-step-link:hover {
  background: var(--ys-current) !important;
  color: var(--ys-current-ink) !important;
  border-color: var(--ys-current) !important;
}
body [data-steps] a.ys-step-link:focus-visible {
  outline: 3px solid var(--ys-ring) !important;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  body [data-steps] a.ys-step-link { transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
}
@media (prefers-reduced-motion: reduce) {
  html:has([data-steps]) { scroll-behavior: auto !important; }
}

/* Short service processes run along one continuous line at a generous viewport. */
body[data-service-pair] #main .page-section .process[data-steps="service"] {
  display: grid;
  border-top: 0 !important;
  box-shadow: none !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}
body[data-service-pair] #main .page-section .process[data-steps="service"] > .process-step[data-step] {
  display: block;
  min-width: 0;
  padding: 0 clamp(14px,1.6vw,27px) 0 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
body[data-service-pair] #main .page-section .process[data-steps="service"] > .process-step[data-step]::before {
  content: none !important;
}
body[data-service-pair] #main .page-section .process[data-steps="service"] > [data-step]:not(:last-child)::after {
  content: "";
  display: block;
  position: absolute;
  inset: 22px 5px auto 49px;
  height: 1px;
  background: var(--ys-rail);
}
body[data-service-pair] #main .page-section .process[data-steps="service"] .process-step h3 {
  margin: 18px 0 8px;
  color: #193a51 !important;
  font-size: clamp(17px, 1.25vw, 21px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}
body[data-service-pair] #main .page-section .process[data-steps="service"] .process-step p {
  margin: 0;
  color: #385469 !important;
  font-size: 16px;
  line-height: 1.58;
}
@media (max-width: 1000px) {
  body[data-service-pair] #main .page-section .process[data-steps="service"] {
    grid-template-columns: 1fr;
  }
  body[data-service-pair] #main .page-section .process[data-steps="service"] > .process-step[data-step] {
    padding: 1px 0 22px 62px;
    min-height: 62px;
  }
  body[data-service-pair] #main .page-section .process[data-steps="service"] > [data-step]:last-child { padding-bottom: 0; }
  body[data-service-pair] #main .page-section .process[data-steps="service"] > [data-step] > a.ys-step-link {
    position: absolute;
    inset: 0 auto auto 0;
  }
  body[data-service-pair] #main .page-section .process[data-steps="service"] > [data-step]:not(:last-child)::after {
    inset: 48px auto 4px 22px;
    width: 1px;
    height: auto;
  }
  body[data-service-pair] #main .page-section .process[data-steps="service"] .process-step h3 { margin-top: 0; }
}

/* Longer descriptions get room to read beside a vertically aligned index and titles. */
body .process[data-steps="legacy"] {
  display: block;
  padding: 0;
  margin-inline: 0;
}
body .process[data-steps="legacy"] > .step[data-step] {
  display: grid;
  grid-template-columns: 44px minmax(160px, .62fr) minmax(0, 1.5fr);
  column-gap: clamp(16px, 3vw, 44px);
  align-items: start;
  margin: 0 !important;
  padding: 20px 0;
  border: 0 !important;
  border-top: 1px solid var(--ys-rail) !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
body .process[data-steps="legacy"] > .step[data-step]::before,
body .process[data-steps="legacy"] > .step[data-step]::after { content: none !important; }
body .process[data-steps="legacy"] > .step[data-step] > h3 {
  grid-column: 2;
  padding: 0;
  margin: 6px 0 0;
  font-size: clamp(17px,1.5vw,23px);
  line-height: 1.3;
}
body .process[data-steps="legacy"] > .step[data-step] > p {
  grid-column: 3;
  margin: 5px 0 0;
  max-width: 75ch;
  line-height: 1.56;
}
@media (max-width: 700px) {
  body .process[data-steps="legacy"] > .step[data-step] {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 15px;
    row-gap: 5px;
    padding: 16px 0;
  }
  body .process[data-steps="legacy"] > .step[data-step] > a.ys-step-link { grid-row: 1 / span 2; }
  body .process[data-steps="legacy"] > .step[data-step] > p { grid-column: 2; margin: 0; }
}

/* Ordered guidance remains an ordered list; the number is also its shareable address. */
body ol[data-steps="prose"] {
  list-style: none;
  margin-inline: 0;
  padding-inline-start: 0;
}
body ol[data-steps="prose"] > li[data-step] {
  min-height: 60px;
  list-style: none;
  margin: 0;
  padding: 13px 0 15px 61px;
  border: 0;
  border-bottom: 1px solid var(--ys-rail);
  background: transparent;
}
body ol[data-steps="prose"] > li[data-step]:first-child { border-top: 1px solid var(--ys-rail); }
body ol[data-steps="prose"] > li[data-step]::before { content: none !important; }
body ol[data-steps="prose"] > li[data-step] > a.ys-step-link {
  position: absolute;
  left: 0;
  top: 6px;
}
body [data-steps="registry-summary"] > [data-step] { padding-inline-start: 58px; }
body [data-steps="registry-summary"] > [data-step]::before { content: none !important; }
body [data-steps="registry-summary"] > [data-step] > a.ys-step-link { position:absolute; left:0; top:0; }
body [data-steps="registry"] > [data-step] { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }

/* The homepage already has an editorial list: seat the anchors on its existing rail. */
html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step] > a.process-number.ys-step-link {
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid #80b5d1 !important;
  border-radius: 50%;
  background: #21496a !important;
  color: #ddf3ff !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: none !important;
}
html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step]:is(:target,:focus-within) > a.process-number.ys-step-link,
html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step] > a.process-number.ys-step-link:hover {
  background: #a7e5ff !important;
  color: #12334d !important;
  border-color: #a7e5ff !important;
}
@media (max-width: 760px) {
  html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step] {
    grid-template-columns: 44px minmax(0,1fr);
    column-gap: 16px;
  }
  html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step] > a.process-number.ys-step-link {
    width: 44px;
    height: 44px;
    font-size: 15px;
  }
  html body.yas-theme-unified #steps[data-process-refined] .process-route[data-steps="home"] .process-stage[data-step]::before {
    left: 21px;
  }
}

/* The older catalogue link rules and the registry's native ol have their own theme. */
body[data-service-pair] #main .page-section .process[data-steps] [data-step] > a.ys-step-link {
  color: var(--ys-mark) !important;
}
body[data-service-pair] #main .page-section .process[data-steps] [data-step]:is(:target, :focus-within) > a.ys-step-link,
body[data-service-pair] #main .page-section .process[data-steps] [data-step] > a.ys-step-link:hover {
  color: var(--ys-current-ink) !important;
}
body[data-registry-workspace] .rl-review-steps[data-steps="registry-summary"] {
  padding-inline-start: 0;
  list-style: none;
}
body[data-registry-workspace] .rl-review-steps[data-steps="registry-summary"] > li[data-step] {
  padding: 14px 0 16px 60px;
  min-height: 66px;
  list-style: none;
}
body[data-registry-workspace] .rl-review-steps[data-steps="registry-summary"] > li[data-step] > a.ys-step-link { top: 8px; }
@media (max-width: 800px) {
  body .home-tz__certificate-points[data-steps="prose"] > li[data-step] {
    padding: 7px 0 15px 61px !important;
  }
}

/* Article sections with their own numbered heading reuse their original URL. */
[data-step-heading] {
  position: relative;
  padding-inline-end: 49px;
  scroll-margin-top: 120px;
}
[data-step-heading] .ys-step-permalink {
  position: absolute;
  inset: 0 0 auto auto;
  width: 44px;
  height: 44px;
  color: inherit !important;
}
[data-step-heading] .ys-step-permalink::before, [data-step-heading] .ys-step-permalink::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 7px;
  border: 1.6px solid currentColor;
  border-radius: 5px;
  transform: rotate(-35deg);
}
[data-step-heading] .ys-step-permalink::before { top: 17px; left: 12px; }
[data-step-heading] .ys-step-permalink::after { top: 13px; left: 20px; }
[data-step-heading] .ys-step-permalink:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
