/* fasm.css
 * Extra styling for fasm.html; loaded after screening.css so these rules can override the shared base.
 * CSS controls appearance. JavaScript controls responses and generated notes.
 * Rules later in the file can override earlier rules with equal specificity.
 */

/* List layout for the reported self-harm behaviors. */
.behavior-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.behavior-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-2);
}
.behavior-name {
  font-weight: 700;
  line-height: 1.4;
}
.behavior-name .other-input {
  width: 100%;
  margin-top: 8px;
}
.behavior-check {
  display: flex;
  align-items: baseline;
  gap: var(--space-options);
  font-size: var(--font-option);
  font-weight: 400;
  cursor: pointer;
}
.behavior-check input {
  flex: none;
  width: auto;
  margin: 0;
}
/* Reveal compact follow-ups beside the selected behavior, stacking on narrow screens. */
.behavior-details {
  display: grid;
  grid-template-columns: 120px auto;
  gap: var(--space-row);
  align-items: start;
}
.field-label {
  display: grid;
  gap: 6px;
  color: var(--accent-secondary);
  font-weight: 700;
}
.field-label input,
.other-input,
.age-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.lifetime-question {
  margin-top: 20px;
}
/* Group the contextual questions separately from behavior and function scoring. */
.context-fields {
  display: grid;
  gap: 14px;
}
.context-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-2);
}
.context-item h3 {
  margin: 0 0 12px;
  line-height: 1.4;
}
.context-item .segmented-options {
  gap: 8px;
}
.reason-intro p {
  margin: 0;
}
.response-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 12px;
  color: var(--muted-text);
}
.reason-card {
  display: grid;
  gap: 14px;
}
.reason-card h2 {
  line-height: 1.5;
}
.reason-card .other-input {
  margin-top: 4px;
}
.function-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
/* Display one reinforcement function and its mean score. */
.function-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
}
.function-card h3 {
  margin: 0 0 8px;
}
.function-score {
  font-size: 24px;
  font-weight: 700;
}
.function-description {
  margin-top: 5px;
  color: var(--muted-text);
  line-height: 1.4;
}
/* Background track for a function mean; JavaScript sets the filled width. */
.function-bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.function-bar span {
  display: block;
  height: 100%;
  background: var(--accent-primary);
}
.ranked-reasons {
  margin-top: 20px;
}
.ranked-reasons p {
  margin: 6px 0;
  color: var(--muted-text);
}
.safety-alert a {
  font-weight: 700;
}
/* Smaller-screen adjustments: reduce columns and spacing to fit the available width. */
@media (max-width: 980px) {
  .behavior-row {
    grid-template-columns: 1fr;
  }
}
/* Smaller-screen adjustments: reduce columns and spacing to fit the available width. */
@media (max-width: 760px) {
  .response-grid,
  .function-results {
    grid-template-columns: 1fr 1fr;
  }
}
/* Smaller-screen adjustments: reduce columns and spacing to fit the available width. */
@media (max-width: 520px) {
  .response-grid,
  .function-results {
    grid-template-columns: 1fr;
  }
}
