
/* v752 — Build Process rendered inside the existing Form Studio AI modal.
   The feature remains isolated under /process-builder; this stylesheet only
   adapts its setup/review surfaces to the shared AI modal visual language. */

#processSourcePanel[hidden],
#processReviewPanel[hidden] {
  display: none !important;
}

.process-file-picker {
  position: relative;
}

.process-file-list {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.process-file-list:empty {
  display: none;
}

.process-file-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  background: #fafbfc;
  color: #536176;
  font-size: 9.5px;
  line-height: 1.2;
}

.process-file-chip span {
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-file-chip button {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7a8597;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.process-file-chip button:hover {
  background: #f0f2f5;
  color: #344054;
}

.process-review-panel {
  padding: 10px 12px 0;
  border: 0;
  background: transparent;
}

.process-review-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin: 2px 0 8px;
  padding: 0 2px;
}

.process-review-heading h2 {
  margin: 0;
  color: #25324a;
  font-size: 13px;
  font-weight: 650;
}

.process-review-heading p {
  max-width: 900px;
  margin: 3px 0 0;
  color: #718096;
  font-size: 9.5px;
  line-height: 1.4;
}

.process-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 9px;
  padding: 8px;
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(244, 242, 255, 0.95),
      rgba(250, 251, 255, 0.95)
    );
}

.process-metric {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid rgba(224, 221, 252, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
}

.process-metric strong {
  color: #25324a;
  font-size: 13px;
  font-weight: 650;
}

.process-metric span {
  color: #7a8597;
  font-size: 9.5px;
}

.process-review-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 5px;
  color: #344054;
  font-size: 10px;
  font-weight: 650;
}

.process-review-section-heading span {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #667085;
  font-size: 9px;
}

.process-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid #f0dfb4;
  border-radius: 7px;
  background: #fffcf5;
}

.process-question.is-blocking {
  border-color: #efc0c0;
  background: #fff8f8;
}

.process-question strong {
  display: block;
  color: #344054;
  font-size: 10px;
  font-weight: 650;
}

.process-question p {
  margin: 2px 0 0;
  color: #7a6851;
  font-size: 9px;
  line-height: 1.35;
}

.process-clarification {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: #25324a;
  font: inherit;
  font-size: 9.5px;
}

.process-clarification:focus {
  border-color: #aaa2f6;
  box-shadow: 0 0 0 2px rgba(91, 80, 246, 0.10);
}

.process-refine-row {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 9px;
}

.process-form-card {
  margin-bottom: 7px;
  overflow: hidden;
  border: 1px solid #e5e8ee;
  border-radius: 8px;
  background: #fff;
}

.process-form-heading {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: 0;
  background: #fafbfc;
  color: #25324a;
  text-align: left;
  cursor: pointer;
}

.process-form-heading:hover {
  background: #f7f8fb;
}

.process-form-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.process-form-title strong {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-form-title small,
.process-form-meta {
  color: #7a8597;
  font-size: 9px;
  font-weight: 500;
}

.process-form-meta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.process-form-body {
  padding: 8px 10px 10px;
}

.process-form-body[hidden] {
  display: none !important;
}

.process-form-purpose {
  margin: 0 0 7px;
  color: #667085;
  font-size: 9.5px;
  line-height: 1.4;
}

.process-section-block + .process-section-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eef0f3;
}

.process-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.process-section-title strong {
  color: #344054;
  font-size: 10px;
  font-weight: 650;
}

.process-section-title span {
  color: #8a94a5;
  font-size: 8.5px;
}

.process-field-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.process-field-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.process-field-table th,
.process-field-table td {
  padding: 6px 7px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  vertical-align: top;
}

.process-field-table th {
  color: #7a8597;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.process-field-table td {
  color: #536176;
  font-size: 9.5px;
  line-height: 1.35;
}

.process-field-table th:nth-child(1),
.process-field-table td:nth-child(1) {
  width: 22%;
}

.process-field-table th:nth-child(2),
.process-field-table td:nth-child(2) {
  width: 38%;
}

.process-field-table th:nth-child(3),
.process-field-table td:nth-child(3) {
  width: 30%;
}

.process-field-table th:nth-child(4),
.process-field-table td:nth-child(4) {
  width: 10%;
}

.process-field-table tr.is-excluded {
  opacity: 0.55;
}

.process-field-title {
  display: block;
  color: #344054;
  font-weight: 650;
}

.process-needs-review {
  display: block;
  margin-top: 2px;
  color: #a15c00;
  font-size: 8.5px;
  font-weight: 650;
}

.process-evidence span,
.process-evidence small {
  display: block;
}

.process-evidence small {
  margin-top: 2px;
  color: #8a94a5;
  font-size: 8.5px;
}

.process-mapping-select {
  height: 30px;
  min-height: 30px;
  padding-left: 8px;
  font-size: 9px;
}

.process-include {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #667085;
  font-size: 9px;
  white-space: nowrap;
}

.process-include input {
  margin: 0;
}


.process-optional-clarifications {
  margin-top: 10px;
  border: 1px solid var(--process-border, #d6dde8);
  border-radius: 8px;
  background: var(--process-surface, #fff);
  overflow: hidden;
}

.process-optional-clarifications > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  user-select: none;
}

.process-optional-clarifications > summary::-webkit-details-marker {
  display: none;
}

.process-optional-clarifications > summary::after {
  content: "›";
  font-size: 16px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
  margin-left: auto;
}

.process-optional-clarifications[open] > summary::after {
  transform: rotate(90deg);
}

.process-optional-count {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
}

.process-optional-body {
  padding: 0 12px 12px;
}

.process-required-heading {
  margin-top: 8px;
}

@media (max-width: 820px) {
  .process-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-question {
    grid-template-columns: 1fr;
  }

  .process-field-table {
    min-width: 760px;
  }
}


/* v754 — Process review participates in the shared modal review layout.
   This keeps Accept/Build visible and makes the review body scroll above,
   rather than underneath, the shared footer. */
body.process-review-mode {
  overflow: hidden;
}

body.process-review-mode .process-review-panel {
  display: flex;
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 18px;
  scroll-padding-bottom: 18px;
}

body.process-review-mode .ai-footer {
  position: static;
  bottom: auto;
  flex: 0 0 auto;
  margin-top: 8px;
}

body.process-review-mode .ai-footer .actions {
  flex-wrap: wrap;
}
