.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-top: 5px solid transparent;
  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;
  align-items: center;
  gap: 0.65rem;
}

.quick-check-flow-status small {
  color: #708078;
  font-size: 0.74rem;
  line-height: 1.2;
}

.quick-check-flow-status small::before {
  content: "·";
  margin-right: 0.65rem;
}

.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;
}

/* The quick-check input is taller than the shared renderer's default input.
   Center the multi-select close control against that 2.8rem anchor in either
   opening direction. */
.quick-check-stage-host .sr-multi > .sr-select-close {
  bottom: calc((2.8rem - 1.5rem) / 2);
}

.quick-check-stage-host .sr-multi.open.open-up > .sr-select-close {
  top: calc((2.8rem - 1.5rem) / 2);
  bottom: auto;
}

.quick-check-stage-host .sr-actions {
  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 {
  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);
}

.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;
}

.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: #eef2f6;
  color: #415a77;
}

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

.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-match [data-quick-check-continue] {
  min-width: 0;
  padding-inline: clamp(0.8rem, 2.2cqi, 1.2rem);
  font-size: clamp(0.78rem, 2.4cqi, 0.9rem);
  white-space: nowrap;
}

/* 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.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-result-layout {
    gap: 0.75rem;
  }

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

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

}

@media (prefers-reduced-motion: reduce) {
  .quick-check-card .btn,
  .quick-check-progress > span {
    transition: none;
  }
}
