/* Layout and risk-category styling for both risk forms. Common controls live in workbench-shared.css. */
.risk-back {
  color: var(--accent-primary);
}

.risk-app h1 {
  margin: 24px 0;
  color: var(--accent-secondary);
  text-decoration: underline var(--accent-primary);
  text-underline-offset: 6px;
}

.risk-app h2 {
  margin: 0 0 12px;
  color: var(--accent-secondary);
}

.risk-app h3,
.field-label {
  margin: 16px 0 8px;
  color: var(--accent-secondary);
}

/* Panel appearance shared by both risk assessments. */
.risk-card {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
}

.risk-section-heading,
.risk-level-header,
.button-row,
.output-style-row,
.risk-options,
.framework-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.risk-section-heading,
.risk-level-header {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.risk-section-heading h2 {
  margin-bottom: 0;
}
.framework-badges {
  justify-content: flex-end;
  gap: 6px;
}

.framework-badge,
.risk-level-result {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.framework-badge {
  color: var(--accent-primary);
}
.framework-badge.secondary {
  color: var(--accent-secondary);
}

.choice-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.08s ease;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.single-choice .choice-chip span {
  border-radius: 20px;
}

.choice-chip:hover span {
  border-color: var(--accent-secondary);
}

.choice-chip:active span {
  transform: translateY(1px);
}

.choice-chip input:focus-visible + span {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

.choice-chip input:checked + span {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: var(--on-accent);
}

.choice-chip input[type="checkbox"]:checked + span::before {
  content: "✓ ";
}

.button-row {
  align-items: center;
  margin-top: 12px;
}
.output-style-row {
  align-items: center;
  margin-bottom: 10px;
}
.output-style-row .field-label {
  margin: 0 4px 0 0;
}
.risk-app button.output-style-button {
  padding: 8px 12px;
}

.risk-app textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

/* Extra risk-assessment notes start hidden; JavaScript toggles the open class. */
.optional-details {
  display: none;
  margin-top: 10px;
}
.optional-details.open {
  display: block;
}

.risk-level-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
}

.risk-helper,
.risk-note {
  color: var(--muted-text);
  font-size: 14px;
  line-height: 1.4;
}

.risk-helper {
  margin-top: 3px;
  font-size: 13px;
}
.risk-note {
  margin-top: 8px;
}
.risk-level-options {
  margin-top: 8px;
}

.risk-level-explainer {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid currentColor;
  border-radius: 10px;
  background: var(--surface-2);
  line-height: 1.45;
}

/* Colors identify the selected risk category; these styles do not determine risk. */
.risk-low {
  color: #55d187;
}
.risk-low-moderate {
  color: #d7df58;
}
.risk-moderate {
  color: #ffbd4a;
}
.risk-moderate-high {
  color: #ff8a3d;
}
.risk-high {
  color: #ff5a5f;
}

.risk-choice input:checked + span {
  color: #000;
}
.risk-choice.risk-low input:checked + span {
  background: #55d187;
  border-color: #55d187;
}
.risk-choice.risk-low-moderate input:checked + span {
  background: #d7df58;
  border-color: #d7df58;
}
.risk-choice.risk-moderate input:checked + span {
  background: #ffbd4a;
  border-color: #ffbd4a;
}
.risk-choice.risk-moderate-high input:checked + span {
  background: #ff8a3d;
  border-color: #ff8a3d;
}
.risk-choice.risk-high input:checked + span {
  background: #ff5a5f;
  border-color: #ff5a5f;
}

/* Smaller-screen adjustments: reduce columns and spacing to fit the available width. */
@media (max-width: 700px) {
  .risk-section-heading,
  .risk-level-header {
    display: block;
  }
  .framework-badges,
  .risk-level-result {
    margin-top: 8px;
  }
}
