/* ProceduresPanel organism - the hotel's procedures on a department Settings page: the
   list of SOP slots on the left, the selected procedure on the right (TLP-1133).
   The Journey's own classes (help-stage, help-chips) draw the stages here too, so the
   procedure reads the same in Docs and in Settings. SPACING CONTRACT: the panel body owns
   the gap; nothing carries an external margin. Every value from design-tokens.css. */

.help-proc {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.help-proc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.help-proc-list .item-row.help-proc-row {
  cursor: pointer;
  border: var(--border-width-1) solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
}

.help-proc-list .item-row.help-proc-row.is-selected {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.help-proc-foot {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-top: var(--space-2);
}

.help-proc-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--bg-surface);
  border: var(--border-width-1) solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  min-width: 0;
}

.help-proc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.help-proc-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.help-proc-title h3 {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.help-proc-actions {
  display: flex;
  gap: var(--space-2);
}

.help-proc-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.help-proc-section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.help-proc-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.help-proc-ref {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: var(--border-width-1) solid var(--border-subtle);
}

.help-proc-ref:last-child {
  border-bottom: 0;
}

.help-proc-ref-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.help-proc-q {
  display: flex;
  flex-direction: column;
  gap: var(--space-px);
  padding: var(--space-2) 0;
  border-bottom: var(--border-width-1) solid var(--border-subtle);
}

.help-proc-q:last-child {
  border-bottom: 0;
}

.help-proc-q-text {
  font-weight: var(--font-weight-medium);
}

.help-proc-q-answer {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.help-proc-version {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--border-width-1) solid var(--border-subtle);
  font-size: var(--text-sm);
}

.help-proc-version:last-child {
  border-bottom: 0;
}

.help-proc-version-no {
  font-family: var(--font-family-mono);
  color: var(--text-secondary);
}

.help-proc-version-meta {
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- the editor (TLP-1134) ---------- */
.help-proc-detail .help-stage.is-open {
  border: var(--border-width-1) solid var(--color-primary);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  background: var(--bg-panel);
}

.help-proc-stage-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.help-proc-stage-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.help-stage-who .icon-clickable {
  margin-left: var(--space-2);
  vertical-align: middle;
}

.help-proc-q-form {
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.help-proc-q-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
}

.help-proc-q-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
}

.help-proc-compare {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.help-proc-compare-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-width-1) solid var(--border-subtle);
}

.help-proc-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
}

.help-proc-compare-row.is-changed {
  background: var(--color-warning-light);
}

.help-proc-compare-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

@media (max-width: 860px) {
  .help-proc {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-proc-compare-head,
  .help-proc-compare-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
