.quick-check-card {
  --qc-green: #176d57;
  --qc-green-dark: #105744;
  --qc-green-soft: #e8f4ee;
  --qc-navy: #10233f;
  position: relative;
  isolation: isolate;
  scroll-margin-top: calc(var(--app-shell-sticky-offset, 6.5rem) + 0.75rem);
  margin-bottom: 1.9rem;
  border: 1px solid rgba(23, 109, 87, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 12%, rgba(79, 147, 104, 0.16), transparent 27%) padding-box,
    linear-gradient(118deg, #f6fbf8 0%, #fff 57%, #f0f7f4 100%) padding-box,
    linear-gradient(90deg, #176d57, #4f9368 68%, #83b898) border-box;
  box-shadow: 0 18px 44px rgba(31, 35, 56, 0.08), 0 2px 8px rgba(23, 109, 87, 0.05);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.quick-check-content {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* The check now sits inside the rendered markdown immediately after Summary.
   Keep the article's heading and paragraph rules from leaking into the tool. */
.md-body .quick-check-card {
  margin-top: 1.9rem;
}

.md-body .quick-check-card h2 {
  margin-top: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.md-body .quick-check-card h2::after {
  content: none;
}

.md-body .quick-check-card p {
  margin-bottom: 0;
}

.quick-check-card.quick-check-loading > .quick-check-content {
  min-height: 20rem;
  padding: 1.7rem 2rem 1.85rem;
}

.quick-check-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.quick-check-skeleton {
  display: flex;
  min-height: 16.45rem;
  flex-direction: column;
}

.quick-check-skeleton-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.quick-check-skeleton-line {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #dfe9e4 25%, #f1f5f3 40%, #dfe9e4 65%);
  background-size: 400% 100%;
  animation: quick-check-skeleton-shimmer 1.45s ease-in-out infinite;
}

.quick-check-skeleton-kicker {
  width: 8.25rem;
  height: 0.7rem;
}

.quick-check-skeleton-meta {
  width: 11rem;
  height: 0.7rem;
}

.quick-check-skeleton-progress {
  width: 100%;
  height: 6px;
  margin-bottom: 1.35rem;
}

.quick-check-skeleton-body {
  display: flex;
  flex-direction: column;
}

.quick-check-skeleton-question {
  width: min(31rem, 58%);
  height: 1.25rem;
  margin-bottom: 0.75rem;
}

.quick-check-skeleton-copy {
  width: min(43rem, 78%);
  height: 0.72rem;
  margin-bottom: 0.45rem;
}

.quick-check-skeleton-copy-short {
  width: min(29rem, 53%);
  height: 0.72rem;
}

.quick-check-skeleton-control {
  width: 100%;
  height: 3rem;
  margin-top: 1.05rem;
  border-radius: 10px;
}

.quick-check-skeleton-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(23, 109, 87, 0.11);
}

.quick-check-skeleton-button {
  width: 8.5rem;
  height: 2.75rem;
}

@keyframes quick-check-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.quick-check-card > .quick-check-content > h2,
.quick-check-card.quick-check-match h2,
.quick-check-card.quick-check-no-match h2 {
  margin: 0 0 0.55rem;
  color: var(--qc-navy);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 680;
  line-height: 1.22;
  letter-spacing: -0.018em;
}

.quick-check-card > .quick-check-content > p,
.quick-check-card.quick-check-match p,
.quick-check-card.quick-check-no-match p {
  max-width: 39rem;
  margin: 0;
  color: #526174;
  font-size: 0.98rem;
  line-height: 1.58;
}

.quick-check-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.68rem 1.2rem;
  border: 1px solid var(--qc-green);
  border-radius: 999px;
  background: var(--qc-green);
  box-shadow: 0 8px 18px rgba(23, 109, 87, 0.18);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.quick-check-card .btn:hover {
  background: var(--qc-green-dark);
  border-color: var(--qc-green-dark);
  box-shadow: 0 10px 22px rgba(23, 109, 87, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

.quick-check-card .btn:focus-visible {
  outline: 3px solid rgba(23, 109, 87, 0.22);
  outline-offset: 3px;
}

.quick-check-card .btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

/* In-progress and result states retain the card's visual weight while
   giving the shared question renderer the full interior width. */
.quick-check-card.quick-check-active,
.quick-check-card.quick-check-match,
.quick-check-card.quick-check-no-match {
  background:
    linear-gradient(135deg, #fbfdfc, #fff 70%) padding-box,
    linear-gradient(90deg, #176d57, #4f9368 68%, #83b898) border-box;
}

.quick-check-card.quick-check-active > .quick-check-content,
.quick-check-card.quick-check-match > .quick-check-content,
.quick-check-card.quick-check-no-match > .quick-check-content {
  padding: 1.7rem 2rem 1.85rem;
}

.quick-check-flow-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.quick-check-flow-heading span {
  color: var(--qc-green);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.quick-check-flow-heading strong {
  color: #526174;
  font-size: 0.78rem;
  font-weight: 650;
}

.quick-check-flow-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.quick-check-security {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(23, 109, 87, 0.18);
  border-radius: 999px;
  background: var(--qc-green-soft);
  color: var(--qc-green-dark);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.quick-check-security svg {
  flex-shrink: 0;
  color: var(--qc-green);
}

.quick-check-progress {
  width: 100%;
  height: 6px;
  margin-bottom: 1.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 109, 87, 0.12);
}

.quick-check-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #176d57, #65a47a);
  transition: width 240ms ease-out;
}

/* Compact stage mode uses the production question factories and custom
   selects, with only the surrounding full-page stage chrome restyled here. */
.quick-check-stage-host .stage-renderer {
  min-height: 13rem;
  padding: 0;
}

.quick-check-stage-host .sr-fields {
  min-height: 8.5rem;
}

.quick-check-stage-host .stage-renderer-field {
  margin: 0;
  padding-left: 0;
}

.quick-check-stage-host .stage-renderer-field > label {
  margin: 0 0 0.45rem;
  color: var(--qc-navy);
  font-size: 1.08rem;
  font-weight: 680;
  line-height: 1.42;
}

.quick-check-stage-host .stage-renderer-field > label::before {
  display: none;
}

.quick-check-stage-host .stage-renderer-field > label .req {
  display: none;
}

.quick-check-stage-host .stage-renderer-field .field-desc {
  margin-bottom: 1rem;
  color: #5d6978;
  font-size: 0.9rem;
  line-height: 1.55;
}

.quick-check-stage-host .stage-renderer-field .field-help {
  color: #7b8490;
}

.quick-check-stage-host input[type="radio"],
.quick-check-stage-host input[type="checkbox"] {
  accent-color: var(--qc-green);
}

.quick-check-stage-host .stage-renderer-field .radio-group label {
  align-items: flex-start;
}

.quick-check-stage-host .stage-renderer-field .radio-group input[type="radio"] {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  margin: 0.225rem 0 0;
}

.quick-check-stage-host .stage-renderer-field input[type="text"],
.quick-check-stage-host .stage-renderer-field input[type="number"],
.quick-check-stage-host .stage-renderer-field textarea,
.quick-check-stage-host .sr-filter-wrap input.sr-filter-input,
.quick-check-stage-host .sr-multi-input {
  min-height: 2.8rem;
  border-color: #cbd8d2;
  border-radius: 10px;
  font-size: 0.9rem;
}

.quick-check-stage-host .stage-renderer-field.sr-field-active:has(.sr-filter-wrap.open, .sr-multi.open)::after {
  inset: -0.75rem;
  border-color: #b5cfc1;
  background: #f5faf7;
}

.quick-check-stage-host .sr-filter-wrap .sr-dropdown,
.quick-check-stage-host .sr-multi .sr-dropdown {
  border-color: #cbd8d2;
}

/* The Quick Check's 10px closed-input radius is declared after the shared
   renderer and would otherwise win over its downward-open shape. Reassert the
   joined-control geometry here: a flat shared edge with the input's solid
   bottom border remaining visible above the anchored menu. */
.quick-check-stage-host .sr-filter-wrap.open:not(.open-up) input.sr-filter-input,
.quick-check-stage-host .sr-multi.open:not(.open-up) .sr-multi-input {
  border-radius: 6px 6px 0 0;
}

.quick-check-stage-host .sr-filter-wrap.open:not(.open-up) .sr-dropdown,
.quick-check-stage-host .sr-multi.open:not(.open-up) .sr-dropdown {
  top: 100%;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.quick-check-stage-host .sr-actions {
  container: quick-check-actions / inline-size;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.45rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(23, 109, 87, 0.11);
}

.quick-check-stage-host .sr-next-btn,
.quick-check-stage-host .sr-back-btn {
  min-width: 8rem;
  min-height: 2.75rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 680;
}

.quick-check-stage-host .sr-next-btn {
  position: relative;
  margin-left: auto;
  padding: 0.68rem 1.35rem;
  background: var(--qc-green);
  box-shadow: 0 8px 18px rgba(23, 109, 87, 0.16);
}

.quick-check-stage-host .sr-next-btn:hover {
  background: var(--qc-green-dark);
}

/* Keep clicks on the button while input validation refreshes its label. */
.quick-check-stage-host .sr-next-label { white-space: nowrap; pointer-events: none; }
.quick-check-stage-host .sr-next-compact-label svg { display: none; }
@container quick-check-actions (max-width: 22rem) {
  .quick-check-stage-host .sr-next-full-label { display: none; }
  .quick-check-stage-host .sr-next-compact-label { display: inline; }
  .quick-check-stage-host .sr-next-btn,
  .quick-check-stage-host .sr-back-btn { min-width: 0; }
}

/* A completed answer is waiting for an explicit Continue/result click. Three
   fading rings surround the stationary button, then leave a steady halo. */
.quick-check-stage-host .sr-next-btn.sr-next-ready:not(:disabled):not(.is-loading) {
  box-shadow: 0 0 0 4px rgba(23, 109, 87, 0.28), 0 8px 18px rgba(23, 109, 87, 0.2);
}

.quick-check-stage-host .sr-next-btn.sr-next-ready:not(:disabled):not(.is-loading)::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--qc-green);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  animation: quick-check-continue-ring 1000ms ease-out 3;
}

@keyframes quick-check-continue-ring {
  from {
    inset: -4px;
    opacity: 0.55;
  }
  to {
    inset: -14px;
    opacity: 0;
  }
}

.quick-check-stage-host .sr-back-btn {
  padding: 0.65rem 1.15rem;
  border: 1px solid rgba(23, 109, 87, 0.35);
  background: transparent;
  color: var(--qc-green);
  box-shadow: none;
}

.quick-check-stage-host .sr-back-btn:hover {
  border-color: rgba(23, 109, 87, 0.55);
  background: var(--qc-green-soft);
  color: var(--qc-green-dark);
}

.quick-check-stage-host .sr-error-msg,
.quick-check-error {
  margin-top: 0.45rem;
  color: #9f2f2f;
  font-size: 0.84rem;
}

.quick-check-result-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.quick-check-result-body {
  min-width: 0;
  container-name: quick-check-result;
  container-type: inline-size;
}

.quick-check-alternatives {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.quick-check-card .quick-check-alternative:not(:first-child),
.quick-check-alternative-label-multiple {
  display: none;
}

.quick-check-card .quick-check-alternative {
  min-height: 0;
  padding: 0.8rem 2.5rem 0.8rem 0.8rem;
  border-color: #d3cfc9;
}

.quick-check-card .quick-check-alternative:hover {
  border-color: #bdb8b1;
}

.quick-check-card .quick-check-alternative .related-pathway-card-top {
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.quick-check-card .quick-check-alternative .related-pathway-country-pill {
  gap: 0.35rem;
  padding: 0.2rem 0.5rem 0.2rem 0.35rem;
}

.quick-check-card .quick-check-alternative .related-pathway-country-pill span {
  font-size: 0.6875rem;
}

.quick-check-card .quick-check-alternative .quick-check-alternative-title {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quick-check-card .quick-check-alternative .quick-check-alternative-details {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.35rem;
}

.quick-check-card .quick-check-alternative .quick-check-alternative-description {
  display: -webkit-box;
  min-width: 0;
  max-width: none;
  flex: 1;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 0.55rem;
  color: #555;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.quick-check-card .quick-check-alternative .related-pathway-card-arrow {
  right: 0.8rem;
  width: 15px;
  height: 15px;
}

/* Show one alternative in the vertical layout. Use three fixed slots once
   each card can have at least 16rem. Fewer
   recommendations keep the same width instead of filling the empty slots. */
@container quick-check-result (min-width: 50rem) {
  .quick-check-alternatives {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quick-check-card .quick-check-alternative:not(:first-child) {
    display: flex;
  }
  .quick-check-alternative-label-single {
    display: none;
  }
  .quick-check-alternative-label-multiple {
    display: inline;
  }
  .quick-check-card .quick-check-alternative {
    padding-right: 0.8rem;
  }
  .quick-check-card .quick-check-alternative .related-pathway-card-arrow {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    margin-bottom: 0.075rem;
  }
  .quick-check-card .quick-check-alternative .quick-check-alternative-description {
    margin-bottom: 0;
  }
  .quick-check-card .quick-check-alternative .related-pathway-card-top {
    gap: 0.4rem;
  }
}

.quick-check-alternative:focus-visible {
  outline: 2px solid var(--qc-green);
  outline-offset: 4px;
}

.quick-check-card.quick-check-match .quick-check-result-body > p,
.quick-check-card.quick-check-no-match .quick-check-result-body > p {
  width: 100%;
  max-width: none;
}

.quick-check-result-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: var(--qc-green-soft);
  color: var(--qc-green);
  font-size: 1.2rem;
  font-weight: 750;
}

.quick-check-no-match .quick-check-result-mark {
  background: #eaf0f6;
  color: #415a77;
}

.quick-check-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
  container-type: inline-size;
}

.quick-check-no-match .quick-check-result-actions {
  column-gap: 1.25rem;
}

.quick-check-card.quick-check-match .quick-check-result-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.quick-check-card.quick-check-match .quick-check-result-actions .btn.assistance {
  flex: 0 0 auto;
  margin: 0;
}

.quick-check-card.quick-check-match .quick-check-result-actions > .pathway-help-fee {
  flex: none;
  max-width: 100%;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.quick-check-secondary-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  margin-top: 0.6rem;
}

.quick-check-card .quick-check-secondary-links .quick-check-discovery-link {
  min-height: 36px;
  padding: 0.35rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--qc-green);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.quick-check-action-icon {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.quick-check-card .btn.assistance {
  padding: 0.5rem 1.125rem 0.5rem 0.55rem;
}

.quick-check-card .btn.quick-check-secondary {
  border-color: rgba(23, 109, 87, 0.34);
  background: transparent;
  box-shadow: none;
  color: var(--qc-green);
}

.quick-check-card .btn.quick-check-secondary:hover {
  border-color: rgba(23, 109, 87, 0.5);
  background: var(--qc-green-soft);
  color: var(--qc-green-dark);
}

.quick-check-card .quick-check-discovery-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: center;
  max-width: 100%;
  padding-block: 0.5rem;
  color: var(--qc-green);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.quick-check-card .quick-check-discovery-link:hover {
  color: var(--qc-green-dark);
}

.quick-check-card .quick-check-discovery-link:focus-visible {
  outline: 2px solid var(--qc-green);
  outline-offset: 4px;
  border-radius: 2px;
}

/* The card is an isolated stacking context. Elevate the whole card whenever
   the shared renderer marks a control active, so selectors, multi-selectors,
   calendars, and future overlays can cover later page sections. */
.quick-check-card:has(.stage-renderer-field.sr-field-active) {
  z-index: 200;
}

@media (max-width: 760px) {
  .quick-check-card [data-quick-check-continue] {
    white-space: nowrap;
  }

  .quick-check-card.quick-check-active > .quick-check-content,
  .quick-check-card.quick-check-match > .quick-check-content,
  .quick-check-card.quick-check-no-match > .quick-check-content {
    padding: 1.45rem 1.25rem 1.5rem;
  }

  .quick-check-card.quick-check-loading > .quick-check-content {
    padding: 1.45rem 1.25rem 1.5rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .quick-check-skeleton-line {
    animation: none;
  }
}

@media (max-width: 520px) {
  .quick-check-card {
    border-radius: 14px;
  }

  .quick-check-flow-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .quick-check-flow-status {
    width: 100%;
  }

  .quick-check-security {
    margin-left: auto;
  }

  .quick-check-result-layout {
    gap: 0.75rem;
  }

  .quick-check-result-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .quick-check-result-actions .btn {
    width: 100%;
  }

  .quick-check-no-match .quick-check-result-actions {
    flex-direction: column;
  }

}

@media (prefers-reduced-motion: reduce) {
  .quick-check-card .quick-check-alternative:hover {
    transform: none;
  }

  .quick-check-stage-host .sr-next-btn.sr-next-ready:not(:disabled):not(.is-loading)::after {
    content: none;
    animation: none;
  }
  .quick-check-card .btn,
  .quick-check-card .quick-check-alternative,
  .quick-check-progress > span {
    transition: none;
  }
}
