.stepper {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.survey-processing-banner {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 13px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.survey-processing-icon {
  background: #eef2f6;
  border: 4px solid #d0d5dd;
  border-radius: 50%;
  display: block;
  height: 24px;
  position: relative;
  width: 24px;
}

.survey-processing-banner.is-processing .survey-processing-icon {
  animation: survey-pulse 1.3s ease-in-out infinite;
  background: var(--orange-pale);
  border-color: var(--orange);
}

.survey-processing-banner.is-complete .survey-processing-icon {
  background: #12b76a;
  border-color: #abefc6;
}

.survey-processing-banner.is-review .survey-processing-icon,
.survey-processing-banner.is-error .survey-processing-icon {
  background: #fdb022;
  border-color: #fedf89;
}

.survey-processing-copy strong,
.survey-processing-copy p {
  margin: 0;
}

.survey-processing-copy p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.survey-processing-badge {
  background: #eef2f6;
  border-radius: 999px;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.is-processing .survey-processing-badge { background: var(--orange-pale); color: var(--orange-dark); }
.is-complete .survey-processing-badge { background: #ecfdf3; color: var(--success); }
.is-review .survey-processing-badge,
.is-error .survey-processing-badge { background: #fffaeb; color: #b54708; }

.survey-workspace {
  display: grid;
  gap: 16px;
}

.survey-overview {
  align-items: center;
  background: linear-gradient(135deg, #fff8f3, #fff);
  border: 1px solid #fed7c3;
  border-radius: 14px;
  display: grid;
  gap: 15px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
  padding: 18px;
}

.survey-overview h3,
.survey-overview p {
  margin: 0;
}

.survey-overview p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.survey-progress-meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.survey-progress-meta strong {
  font-size: 13px;
  white-space: nowrap;
}

.survey-progress-track {
  background: #eaecf0;
  border-radius: 999px;
  flex: 1;
  height: 9px;
  overflow: hidden;
}

.survey-progress-bar {
  background: linear-gradient(90deg, var(--orange), #f79009);
  border-radius: inherit;
  height: 100%;
  transition: width .25s ease;
  width: 0;
}

.survey-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.survey-group-head {
  align-items: center;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 14px 16px;
}

.survey-group-index {
  align-items: center;
  background: var(--orange-pale);
  border-radius: 9px;
  color: var(--orange-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 38px;
}

.survey-group-head h3,
.survey-group-head p {
  margin: 0;
}

.survey-group-head h3 { font-size: 16px; }
.survey-group-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.survey-group-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.survey-group-A .survey-group-grid { padding: 14px; }

.survey-item {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-left: 4px solid #d0d5dd;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  transition: border-color .2s ease, background .2s ease;
}

.survey-item[data-severity="0"] { background: #f6fef9; border-left-color: #12b76a; }
.survey-item[data-severity="1"] { background: #fffcf5; border-left-color: #f79009; }
.survey-item[data-severity="2"] { background: #fff7f6; border-left-color: #f04438; }

.survey-identity-item { border: 0; margin: 0; }
.survey-identity-item legend { color: #344054; font-size: 13px; font-weight: 700; padding: 0; }
.survey-direct-choices { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.survey-direct-choice { cursor: pointer; display: block; position: relative; }
.survey-direct-choice input {
  accent-color: var(--orange);
  height: 18px;
  left: 12px;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  z-index: 2;
}
.survey-direct-choice span {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-height: 52px;
  padding: 9px 12px 9px 40px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.survey-direct-choice small { color: var(--muted); font-weight: 400; }
.survey-direct-choice[data-option-severity="0"] input,
.survey-state-choice[data-option-severity="0"] input { accent-color: #12b76a; }
.survey-direct-choice[data-option-severity="1"] input,
.survey-state-choice[data-option-severity="1"] input { accent-color: #f79009; }
.survey-direct-choice[data-option-severity="2"] input,
.survey-state-choice[data-option-severity="2"] input { accent-color: #f04438; }
.survey-direct-choice input:checked + span { background: var(--orange-pale); border-color: var(--orange); box-shadow: 0 0 0 2px rgba(241,90,36,.1); color: var(--orange-dark); }
.survey-direct-choice[data-option-severity="0"] input:checked + span { background: #ecfdf3; border-color: #12b76a; box-shadow: 0 0 0 2px rgba(18,183,106,.1); color: #027a48; }
.survey-direct-choice[data-option-severity="2"] input:checked + span { background: #fef3f2; border-color: #f04438; box-shadow: 0 0 0 2px rgba(240,68,56,.1); color: #b42318; }
.survey-direct-choice input:focus-visible + span { outline: 3px solid rgba(241,90,36,.2); outline-offset: 2px; }
.survey-direct-choice input.field-invalid + span { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180,35,24,.12); }

.survey-condition-item {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(210px, .72fr) minmax(0, 1.55fr);
  padding: 16px;
}

.survey-condition-item:first-child { border-top: 0; }

.survey-condition-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 3px;
}

.survey-condition-heading strong { color: #344054; font-size: 13px; }
.survey-condition-heading small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.survey-condition-control { min-width: 0; }

.survey-state-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.survey-state-choice { cursor: pointer; display: block; min-width: 0; position: relative; }
.survey-state-choice input {
  accent-color: var(--orange);
  height: 16px;
  left: 12px;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  z-index: 3;
}
.survey-state-choice span {
  align-items: center;
  background: #fff;
  border: 1px solid #d0d5dd;
  display: flex;
  justify-content: center;
  margin-left: -1px;
  min-height: 48px;
  padding: 8px 10px 8px 34px;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.survey-state-choice:first-child span { border-radius: 9px 0 0 9px; margin-left: 0; }
.survey-state-choice:last-child span { border-radius: 0 9px 9px 0; }
.survey-state-choice strong { font-size: 12px; line-height: 1.3; }
.survey-state-choice input:checked + span { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); color: var(--orange-dark); position: relative; z-index: 1; }
.survey-state-choice[data-option-severity="0"] input:checked + span { background: #ecfdf3; border-color: #12b76a; box-shadow: inset 0 0 0 1px #12b76a; color: #027a48; }
.survey-state-choice[data-option-severity="1"] input:checked + span { background: #fffaeb; border-color: #f79009; box-shadow: inset 0 0 0 1px #f79009; color: #b54708; }
.survey-state-choice[data-option-severity="2"] input:checked + span { background: #fef3f2; border-color: #f04438; box-shadow: inset 0 0 0 1px #f04438; color: #b42318; }
.survey-state-choice input:focus-visible + span { outline: 3px solid rgba(241,90,36,.22); outline-offset: 2px; position: relative; z-index: 2; }
.survey-state-choice input.field-invalid + span { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 3px rgba(180,35,24,.12); position: relative; z-index: 2; }

.survey-condition-control .survey-option-hint { margin-top: 7px; min-height: 0; }
.survey-condition-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #fed7c3;
  border-radius: 12px;
  background: #fffaf7;
}
.survey-condition-detail > small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }
.survey-condition-detail-block { display: grid; align-content: start; gap: 7px; min-width: 0; }
.survey-condition-detail-block > strong { color: #344054; font-size: 12px; }
.survey-detail-choices { display: grid; gap: 6px; }
.survey-detail-choices label { margin: 0; cursor: pointer; }
.survey-detail-choices input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.survey-detail-choices span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.survey-detail-choices input:checked + span {
  border-color: #12b76a;
  background: #ecfdf3;
  color: #027a48;
  box-shadow: inset 0 0 0 1px #12b76a;
}
.survey-detail-choices input:focus-visible + span { outline: 3px solid rgba(241,90,36,.25); outline-offset: 2px; }
.adjustment-survey-detail { grid-column: 2; }
.survey-note-wrap { margin-top: 11px; }
.survey-risk-item { background: #fffcf5; border-left: 4px solid #f79009; }
.survey-risk-item .survey-condition-heading strong { color: #93370d; }

.identity-mismatch-panel { display: grid; gap: 18px; }
.identity-mismatch-heading { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; }
.identity-mismatch-heading h3, .identity-mismatch-heading p { margin: 0; }
.identity-mismatch-heading p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.identity-stop-badge { background: #fef3f2; border-radius: 999px; color: var(--danger); font-size: 11px; font-weight: 800; padding: 6px 10px; white-space: nowrap; }
.identity-mismatch-panel .alert { margin: 0; }
.identity-scope-fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.identity-scope-fieldset legend { color: #344054; font-size: 13px; font-weight: 800; margin-bottom: 9px; padding: 0; }
.identity-scope-options { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.identity-scope-choice { cursor: pointer; display: block; }
.identity-scope-choice input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.identity-scope-choice span { background: #fff; border: 1px solid #d0d5dd; border-radius: 11px; display: flex; flex-direction: column; justify-content: center; min-height: 58px; padding: 10px 13px; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.identity-scope-choice small { color: var(--muted); font-weight: 400; margin-top: 2px; }
.identity-scope-choice input:checked + span { background: var(--orange-pale); border-color: var(--orange); box-shadow: 0 0 0 2px rgba(241,90,36,.1); color: var(--orange-dark); }
.identity-scope-choice input:focus-visible + span { outline: 3px solid rgba(241,90,36,.2); outline-offset: 2px; }
.identity-scope-choice input.field-invalid + span { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180,35,24,.12); }
.identity-identifier-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.identity-identifier-grid.is-single { grid-template-columns: 1fr; }
.identity-identifier-card { background: #fafbfc; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 13px; padding: 15px; }
.identity-identifier-card > small { color: var(--muted); }
.identity-document-fact { border-bottom: 1px solid var(--line); display: grid; gap: 3px; padding-bottom: 11px; }
.identity-document-fact span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.identity-document-fact output { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.identity-terminal-actions { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 18px; justify-content: space-between; padding-top: 16px; }
.identity-terminal-actions p { margin: 3px 0 0; }

.survey-option-hint {
  color: var(--muted);
  display: block;
  line-height: 1.4;
  min-height: 34px;
}

.survey-note-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.survey-note-label textarea {
  background: #fff;
  min-height: 70px;
}

.survey-actions {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px;
}

.survey-actions p { color: var(--muted); font-size: 13px; margin: 0; }
.survey-actions.is-complete { background: #f8fafc; box-shadow: none; }
.survey-actions.is-complete .button.secondary:disabled { background: #eef2f6; color: #475467; cursor: default; opacity: 1; }

.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .12);
}

@keyframes survey-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 90, 36, .15); }
  50% { box-shadow: 0 0 0 8px rgba(241, 90, 36, 0); }
}

@media (max-width: 850px) {
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .survey-processing-banner { grid-template-columns: auto minmax(0, 1fr); }
  .survey-processing-badge { grid-column: 2; justify-self: start; }
  .survey-processing-banner .button { grid-column: 1 / -1; width: 100%; }
  .survey-overview { grid-template-columns: 1fr; }
  .survey-group-A .survey-group-grid { padding: 12px; }
  .survey-condition-item { gap: 12px; grid-template-columns: 1fr; padding: 14px; }
  .survey-condition-detail { grid-template-columns: 1fr; }
  .adjustment-survey-detail { grid-column: 1; }
  .survey-item { padding: 14px; }
  .survey-note-label textarea { font-size: 16px; }
  .survey-actions { align-items: stretch; flex-direction: column; }
  .survey-actions .button { width: 100%; }
  .identity-mismatch-heading, .identity-terminal-actions { align-items: stretch; flex-direction: column; }
  .identity-stop-badge { align-self: flex-start; }
  .identity-terminal-actions .actions { align-items: stretch; flex-direction: column; }
  .identity-terminal-actions .button { width: 100%; }
}

@media (max-width: 480px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .survey-processing-banner { padding: 13px; }
  .survey-group-head { align-items: flex-start; }
  .survey-direct-choices, .identity-scope-options, .identity-identifier-grid { grid-template-columns: 1fr; }
  .survey-state-choices { grid-template-columns: 1fr; gap: 7px; }
  .survey-state-choice span,
  .survey-state-choice:first-child span,
  .survey-state-choice:last-child span { border-radius: 9px; margin-left: 0; }
}
