/* ═══════════════════════════════════════════════════════════
   Risk profile editor · single-form layout.
   Loaded only on risk-profile.html.
   ═══════════════════════════════════════════════════════════ */

.rp-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 36px;
  margin-bottom: 18px;
}
.rp-form-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.rp-form-head-text { flex: 1; min-width: 0; }
.rp-form-head .risk-profile-pill-coreplus { vertical-align: 2px; margin-left: 4px; }

.rp-section {
  padding: 22px 0;
  border-bottom: 1px dashed rgba(17,30,69,0.08);
}
.rp-section:last-of-type { border-bottom: none; }
.rp-section-head {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 24px; align-items: start;
  margin-bottom: 14px;
}
.rp-section-label-wrap { padding-top: 4px; }
.rp-section-label {
  font-family: 'Onest', sans-serif;
  font-weight: 700; font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.rp-section-title {
  font-family: 'Onest', sans-serif;
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.012em;
  color: var(--ink-1);
  margin: 0;
}
.rp-section-helper {
  font-size: 12.5px; color: var(--ink-3);
  line-height: 1.55; margin-top: 6px;
}
.rp-section-body {
  display: flex; flex-direction: column; gap: 12px;
}

/* Pickable tags — click to toggle selection */
.rp-tag-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.rp-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  font-family: 'Onest', sans-serif;
  font-size: 12.5px; font-weight: 500;
  background: white;
  border: 1px solid rgba(17,30,69,0.10);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.rp-tag:hover { border-color: rgba(28,122,254,0.32); color: var(--signal); }

.rp-tag.signal.selected {
  background: rgba(28,122,254,0.10);
  border-color: rgba(28,122,254,0.32);
  color: var(--signal);
  font-weight: 600;
}
.rp-tag.adverse.selected {
  background: rgba(220,62,62,0.06);
  border-color: rgba(220,62,62,0.28);
  color: var(--adverse);
  font-weight: 600;
}
.rp-tag.caution.selected {
  background: rgba(229,163,58,0.10);
  border-color: rgba(229,163,58,0.32);
  color: var(--gold-deep);
  font-weight: 600;
}
.rp-tag-glyph { font-size: 10px; opacity: 0.55; }
.rp-tag.selected .rp-tag-glyph { opacity: 1; }

/* Severity radio group · single-pick */
.rp-severity-group {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rp-severity {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.rp-severity:hover { border-color: rgba(28,122,254,0.32); }
.rp-severity.selected {
  border-color: var(--signal);
  background: rgba(28,122,254,0.04);
  box-shadow: 0 0 0 3px rgba(28,122,254,0.08);
}
.rp-severity-name {
  font-family: 'Onest', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--ink-1);
  margin-bottom: 4px;
}
.rp-severity-desc {
  font-size: 12px; color: var(--ink-3);
  line-height: 1.5;
}

/* Free-text input rows for custom thresholds */
.rp-thresholds {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rp-threshold {
  padding: 14px 16px;
  background: rgba(17,30,69,0.025);
  border-radius: 12px;
}
.rp-threshold-label {
  font-family: 'Onest', sans-serif;
  font-weight: 700; font-size: 9.5px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.rp-threshold-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink);
}
.rp-threshold-row input,
.rp-threshold-row select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  color: var(--ink-1);
  width: 80px;
}
.rp-threshold-row select { width: 120px; }

/* Footer · save / cancel */
.rp-foot {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.rp-foot-meta {
  font-family: 'SUSE Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-3);
}
.rp-foot-meta b { color: var(--ink); font-weight: 600; }
.rp-foot-actions { display: flex; gap: 8px; }

/* Mobile-ish stacking for narrow viewports */
@media (max-width: 900px) {
  .rp-section-head { grid-template-columns: 1fr; gap: 6px; }
  .rp-thresholds { grid-template-columns: 1fr; }
  .rp-severity-group { grid-template-columns: 1fr; }
}
