/* Intake/review layouts and documented density exceptions. No chart CSS import. */
:where(.rectification-page) {
  --hero-size: clamp(3.6rem, 9.8vw, 8rem);
  --hero-mobile-size: clamp(3.6rem, 9.8vw, 8rem);
  --hero-copy-margin: 24px auto 0;
  --control-height: var(--control-compact-height);
  --control-padding: 12px 15px;
  --control-font-size: .94rem;
  --field-label-size: .89rem;
  --placeholder: rgba(255,255,255,.57);
  --option-text: #241957;
  --option-background: #efebff;
  --panel-background: rgba(203,184,255,.07);
  --card-filter: none;
}
:where(.rectification-page) .header-link {
  color: var(--white); font-size: .9rem; text-decoration-thickness: 1px; text-underline-offset: 5px;
}

:where(.rectification-page) .hero {
  margin-inline: auto;
}

:where(.rectification-page) .hero .eyebrow {
  margin-bottom: 20px;
}

:where(.rectification-page) .intake-shell {
  overflow: visible;
}

:where(.rectification-page) .step-nav {
  display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line);
}

:where(.rectification-page) .step-tab {
  min-height: 65px; padding: 12px 8px; border: 0; border-right: 1px solid var(--line); color: var(--dim); background: rgba(64,42,167,.16); cursor: pointer; font: inherit; font-size: .9rem;
}

:where(.rectification-page) .step-tab:last-child {
  border-right: 0;
  border-top-right-radius: var(--card-radius);
}

:where(.rectification-page) .step-tab span {
  margin-left: 8px;
}

:where(.rectification-page) .step-tab.active {
  color: var(--white); background: rgba(191,202,255,.18); box-shadow: inset 0 -3px 0 var(--pink);
}

:where(.rectification-page) #intake-form {
  padding: clamp(22px, 4vw, 42px);
}

:where(.rectification-page) .section-intro {
  max-width: 760px; color: var(--muted); line-height: 1.65; margin: 16px 0 28px;
}

:where(.rectification-page) .input-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}

:where(.rectification-page) .field {
  display: flex; flex-direction: column; gap: 8px;
}

:where(.rectification-page) .event-list,
:where(.rectification-page) .question-list {
  display: grid; gap: 18px;
}

:where(.rectification-page) .event-card,
:where(.rectification-page) .question-card,
:where(.rectification-page) .review-summary {
  padding: clamp(18px, 3vw, 28px);
}

:where(.rectification-page) .event-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px;
}

:where(.rectification-page) .event-heading h3,
:where(.rectification-page) .question-card h3 {
  margin: 0; font-size: clamp(1.15rem, 2.8vw, 1.5rem); font-weight: 400;
}

:where(.rectification-page) .event-card .field span {
  font-size: .84rem;
}

:where(.rectification-page) .question-card h3 {
  line-height: 1.3;
}

:where(.rectification-page) .choice-row {
  min-width: 0; margin: 24px 0 0; padding: 0; border: 0;
}

:where(.rectification-page) .choice-row legend {
  margin-bottom: 12px; color: var(--pink); font-size: .82rem;
}

:where(.rectification-page) .choice-options {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px;
}

:where(.rectification-page) .example-grid {
  margin-top: 22px;
}

:where(.rectification-page) .timeline-notes {
  margin-top: 25px;
}

:where(.rectification-page) #add-event {
  margin-top: 20px;
}

:where(.rectification-page) .remove-event {
  min-height: 35px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; color: white; background: transparent; cursor: pointer;
}

:where(.rectification-page) .step-footer {
  margin-top: 34px;
}

:where(.rectification-page) .step-footer #next-step {
  margin-left: auto;
}

:where(.rectification-page) .save-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0;
}

:where(.rectification-page) .privacy-note {
  max-width: 780px; color: var(--muted); font-size: .86rem; line-height: 1.55;
  background: rgba(188, 235, 221, .045);
}

:where(.rectification-page) .consent {
  display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; line-height: 1.5;
}

:where(.rectification-page) .consent input {
  margin-top: 5px; accent-color: var(--lavender);
}

:where(.rectification-page) .review-summary p {
  margin: 8px 0; line-height: 1.5;
}

:where(.rectification-page) .intake-footer {
  width: min(1120px, calc(100% - 36px)); margin: 0 auto 45px; color: var(--dim); font-size: .82rem;
}

:where(.rectification-page) .review-layout {
  display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
}

:where(.rectification-page) .review-sidebar,
:where(.rectification-page) .review-body {
  padding: clamp(20px, 3vw, 32px);
}

:where(.rectification-page) .review-sidebar {
  border-right: 1px solid var(--line); background: rgba(50, 34, 119, .18);
}

:where(.rectification-page) .review-sidebar h2,
:where(.rectification-page) .review-body h2 {
  margin: 0 0 22px; font-size: 1.8rem;
}

:where(.rectification-page) .review-sidebar .outline-button {
  width: 100%; margin: 15px 0;
}

:where(.rectification-page) .submission-list {
  display: grid; gap: 9px;
}

:where(.rectification-page) .submission-item {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: white; background: rgba(255,255,255,.08); cursor: pointer; font: inherit; text-align: left;
}

:where(.rectification-page) .submission-item:hover {
  background: rgba(255,255,255,.17);
}

:where(.rectification-page) .response-content {
  display: grid; gap: 14px; max-height: 600px; overflow: auto;
}

:where(.rectification-page) .response-section {
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.045);
}

:where(.rectification-page) .response-section h3 {
  margin: 0 0 12px; font-size: 1.25rem;
}

:where(.rectification-page) .response-row {
  padding: 8px 0; border-top: 1px solid rgba(255,255,255,.12);
}

:where(.rectification-page) .response-row strong {
  display: block; color: var(--pink); font-size: .8rem; font-weight: 600; text-transform: capitalize;
}

:where(.rectification-page) .response-row p {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; line-height: 1.45;
}

:where(.rectification-page) #review-form {
  margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line);
}

@media (max-width: 680px) {
  :where(.rectification-page) .header-link {
  display: none;
  }

  :where(.rectification-page) .step-tab {
  min-height: 60px; font-size: .8rem;
  }

  :where(.rectification-page) .step-tab span {
  display: block; margin: 3px 0 0; font-size: .72rem;
  }

  :where(.rectification-page) .input-grid,
  :where(.rectification-page) .choice-options {
  grid-template-columns: 1fr;
  }

  :where(.rectification-page) .form-footer {
  flex-wrap: wrap;
  }

  :where(.rectification-page) .step-footer #step-status {
  order: 3; flex-basis: 100%;
  }

  :where(.rectification-page) .save-actions > * {
  width: 100%;
  }

  :where(.rectification-page) .review-layout {
  grid-template-columns: 1fr;
  }

  :where(.rectification-page) .review-sidebar {
  border-right: 0; border-bottom: 1px solid var(--line);
  }
}

:where(.rectification-page) .step-tab:first-child { border-top-left-radius: var(--card-radius); }
:where(.rectification-page) .cross-check-detail { margin-top: 20px; }
/* A panel can be narrow enough that its viewport-sized popover needs to shift. */
:where(.rectification-page) .info-disclosure > div { max-width: calc(100vw - 70px); }
:where(.rectification-page) .intake-step > .section-heading { margin-bottom: 28px; }

/* Patterns: one group per glass panel. Color, selection and focus treatments
 * come from the shared foundation; these are intake layout/density exceptions. */
:where(.rectification-page) .pattern-carousel {
  --panel-background: var(--glass);
  max-width: 860px;
  margin-inline: auto;
  min-width: 0;
}

:where(.rectification-page) .pattern-stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  margin-bottom: 18px;
  scroll-margin-top: 24px;
}

:where(.rectification-page) .pattern-position,
:where(.rectification-page) .pattern-count {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
}

:where(.rectification-page) .pattern-position {
  color: var(--white);
}

:where(.rectification-page) #pattern-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 5px;
  appearance: none;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--line);
  color: var(--lavender);
}

:where(.rectification-page) #pattern-progress::-webkit-progress-bar {
  background: var(--line);
}

:where(.rectification-page) #pattern-progress::-webkit-progress-value {
  background: var(--lavender);
  border-radius: var(--radius-md);
}

:where(.rectification-page) #pattern-progress::-moz-progress-bar {
  background: var(--lavender);
  border-radius: var(--radius-md);
}

:where(.rectification-page) .pattern-map {
  grid-column: 1 / -1;
  min-width: 0;
}

:where(.rectification-page) :is(.pattern-map, .pattern-examples) > summary {
  padding-block: 12px;
  min-height: 44px;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.5;
}

:where(.rectification-page) .pattern-jump-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-block: 12px;
}

:where(.rectification-page) .pattern-map-label {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

:where(.rectification-page) .pattern-jump[aria-current="step"] {
  border-color: var(--mint);
  background: var(--button-background);
}

:where(.rectification-page) .pattern-carousel .question-card {
  min-width: 0;
  border-color: var(--line-bright);
  overflow-wrap: anywhere;
}

:where(.rectification-page) .pattern-carousel .choice {
  min-height: 56px;
  font-size: 1rem;
  line-height: 1.5;
}

:where(.rectification-page) .pattern-carousel .choice:focus-within {
  outline: 2px solid var(--focus-color);
  outline-offset: 3px;
}

:where(.rectification-page) .pattern-carousel .choice-other {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

:where(.rectification-page) .choice-other .choice {
  flex: 1 1 70px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 6px;
  gap: 6px;
  font-size: .84rem;
}

:where(.rectification-page) .choice-other input {
  margin-top: 0;
}

:where(.rectification-page) .pattern-examples {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

:where(.rectification-page) .pattern-examples .example-grid {
  margin-top: 8px;
}

:where(.rectification-page) .step-footer.patterns-active {
  max-width: 860px;
  margin: 24px auto 0;
  flex-direction: row;
}

:where(.rectification-page) .patterns-active #step-status:empty { display: none; }

:where(.rectification-page) .patterns-active #next-step {
  min-width: 0;
}

@media (max-width: 680px) {
  :where(.rectification-page) .pattern-stage-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  :where(.rectification-page) .pattern-carousel .question-card {
    padding: 16px;
  }

  :where(.rectification-page) .patterns-active #back-step,
  :where(.rectification-page) .patterns-active #next-step {
    width: auto;
    flex: 1;
  }
}
