/* The CARE practice on a case's page (CareCaseFileComponent, CareObligationsComponent, CareInterventionsComponent, CaseGoalsComponent, CareNotesComponent, CaseReviewsComponent, and the grouped
   choice of the level of care, Forms::GroupedChoiceComponent; the sheets in app/views/care_*; docs/phase0_core/03-new-specs.md G7, "As built (F2)"). Built from the case page's own lists and
   facts (53-case-pages.css), C2's step log (62-case-work.css: `.case-work-list`, `.case-work-entry`, `.case-work-meta`, the Read frames), the form fields, the badge, the callout and the button,
   so what is here is only how they sit together.

   The pages around the panels are here too, because the sheets of CARE and of conduct share them: a sheet's flow and the facts above its form, a form that waits behind a button (no card inside the
   panel), and a Read as a page of its own (care_reads, case_assessments/reason, conduct_findings/reason and conduct_sanctions/text).

   A LEVEL IS A WORD AMONG WORDS: there is no rule here for a level, a group, a state or a kind of obligation, and no color that could rank one (design-direction.md section 6.3). Overdue is a badge
   with a word, never a color alone.

   Numbered 64, the number the simulation build reserved for this card. Tokens only and logical properties only, so all of it reads on the console in light and in dark and mirrors in a
   right-to-left language. It declares no token and decides no mode. Nothing is pinned to an edge and nothing sets a height. Everything that holds words may shrink and breaks a long word, so a
   language 40% longer never widens the page (WCAG 1.4.10). */

.care-practice {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--density-gap);
  max-inline-size: 64rem;
  min-inline-size: 0;
}
.care-notes-due,
.care-notes-pre-meeting {
  display: grid;
  gap: 0.5rem;
  min-inline-size: 0;
}
.care-prompt {
  max-inline-size: 48rem;
}

/* ── A small form inside an entry: a goal's new state, an invitation ───── */

.care-inline-form,
.care-inline-action {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  min-inline-size: 0;
}
/* The choice takes the room its chips need, and its Save sits right after it, not at the far edge. */
.care-inline-form > .field {
  flex: 0 1 auto;
  min-inline-size: 0;
  margin: 0;
}
.care-inline-action > .case-source {
  flex: 1 1 100%;
  margin: 0;
}

/* ── The level of care: a fieldset per group, a radio per level, each with its guidance ── */

.field-grouped-choice {
  display: grid;
  gap: 0.75rem;
  min-inline-size: 0;
}
/* The level's guidance spans the card, as the card's own lines above it do; the boxes below set its width anyway. */
.field-grouped-choice > .field-help {
  max-inline-size: none;
}
.field-choice-group {
  display: grid;
  gap: 0.25rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0.5rem 0 0;
  border: 0;
  border-block-start: 1px solid var(--rule);
}
.field-choice-group-label {
  padding: 0;
  font-weight: 650;
  color: var(--fg1);
  overflow-wrap: anywhere;
}
/* Each option is one box: the row that chooses (its label and description) and, under them, its examples. The box takes
   the row's look (36-form-fields.css), and the label inside it draws no second edge. A group of one takes the whole row
   (auto-fit), and the boxes of a row are one height. */
.field-grouped-choice .field-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.field-choice {
  display: grid;
  align-content: start;
  min-inline-size: 0;
  background: var(--surface-raised);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
}
.field-choice:hover {
  border-color: var(--fg3);
}
.field-choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.field-choice > .field-option,
.field-choice > .field-option:has(input:checked) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.field-option input[type="radio"] {
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin: 0.05rem 0 0;
  cursor: pointer;
}
.field-choice-hint {
  overflow-wrap: anywhere;
}
.field-choice-examples {
  min-inline-size: 0;
  padding-block: 0 0.5rem;
  padding-inline: 2.45rem 0.75rem;
  color: var(--fg2);
  font-size: 0.8125rem;
}
.field-choice-examples summary {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
  color: var(--fg1);
  text-decoration: underline;
  cursor: pointer;
}
.field-choice-examples ul {
  margin: 0.25rem 0 0;
  padding-inline-start: 1.25rem;
}
.field-choice-examples li {
  overflow-wrap: anywhere;
}
@media (pointer: coarse) {
  .field-choice-examples summary {
    min-block-size: var(--target-min);
  }
}

/* ── The sheets ──────────────────────────────────────────────────────────── */

/* The facts under a section's heading: the heading's hairline is the strip's top, so the two are not drawn one under the other; and each fact is its label over its words, so a row of four is four alike
   (a figure draws label and value on one line while they fit, which put two of these on a line and two on two). */
.care-review-facts .figure-strip {
  border-block-start: 0;
}
.care-review-facts .figure {
  display: grid;
  align-content: start;
  gap: 0;
}

/* A form whose first section has nothing above it (a form whose every field is optional has no "required" sentence) drew the section's hairline at the very top of its card: the request forgery token is
   the form's first child, so the frame's "the first section needs no hairline" (45-sheet.css, `:first-child`) did not find it. This is the section that is first once the hidden fields are not counted.
   (Foundation request: say it so in 45-sheet.css.) */
.tform:has(> .form-section) > .form-section:nth-child(1 of :not(input[type="hidden"])) {
  padding-block-start: 0;
  border-block-start: 0;
}

/* A note's goals are one section of the sheet (Forms::SectionComponent); the second and third goal start under a hairline, so each goal's three fields read as one. */
.care-note-goals .care-note-goal-start {
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--rule);
}
.care-answer .form-answers {
  margin: 0;
}
/* A choice is answered in a one-item list that draws no marker, and its 1.25rem of indent put it a step in from the answers that are text. (Foundation request: 60-intake.css, `.form-answer-list`.) */
.care-answer .form-answer-list {
  padding-inline-start: 0;
}

/* ── A Read, when it is the page ─────────────────────────────────────────
   A Read draws its words in the entry's own Turbo frame on the case's page, set in from the entry (62-case-work.css, 56-case-assessments.css). Without Turbo the same markup is a page of its own, the frame
   its one part under the header: the words are held to the measure of prose and sit on the card the console's other parts are (an entry's padding, hairline and radius), so the page is not a rule and a
   sentence floating under the title. */
.page-flow > turbo-frame > :is(.case-work-text, .assessment-reason) {
  max-inline-size: calc(66ch + 2 * var(--space-5));
  margin: 0;
  padding-block: var(--space-4);
  padding-inline: var(--space-5);
  gap: var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

/* A button or a link at the end of an entry (Mark as done, Write the note, Enter the form) is as wide as its words, at the start of the line: an entry is a grid, which would stretch it. */
.care-practice .case-work-entry > .btn,
.care-notes-pre-meeting > .btn {
  justify-self: start;
  max-inline-size: 100%;
}


/* The review opens on how far each part of the plan has got (badges) and on the loose ends it can settle: each one's name, its badge and its acts in one wrapping row. */
.care-review-progress {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.care-review-loose {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.care-review-loose-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-block-size: var(--target-min);
  padding-block: var(--space-2);
  border-block-start: 1px solid var(--rule);
}
.care-review-loose-label {
  flex: 1 1 16rem;
  min-inline-size: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The plan tab's panels are their buttons under the help band: the band's rule is the only one above them. */
.case-show .care-plan-changes > .case-source + :is(.case-work-form, .care-inline-action),
.case-show .care-interventions > .case-source + .care-intervention-forms {
  border-block-start: 0;
}

/* What each of the level's interventions asks, behind its button: the name, then its paragraphs, a reading width. */
.care-intervention-asks-list {
  display: grid;
  gap: var(--space-1);
  max-inline-size: 48rem;
  margin: 0;
  padding-block-start: var(--space-2);
}
.care-intervention-asks-list dt {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.care-intervention-asks-list dt:not(:first-child) {
  padding-block-start: var(--space-2);
}
.care-intervention-asks-list dd {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  color: var(--fg2);
  overflow-wrap: anywhere;
}
.care-intervention-asks-list p {
  margin: 0;
}

/* --- my-plan: a student's own CARE plan (CareMyPlanComponent, care/my_plan/show). What waits for the student first, on an accented surface; then the meeting and the goals, each a
   plain section with a display heading, as the student Home's sections are. Tokens and logical properties only; every row wraps (WCAG 1.4.10). --- */
.care-my-plan-page .page-header h1 {
  font-family: var(--font-display);
}
.care-my-plan {
  display: grid;
  gap: var(--space-6);
  max-inline-size: 48rem;
}
.care-my-plan-page__plan {
  display: grid;
  gap: var(--space-4);
}
.care-my-plan__heading {
  margin: 0;
  color: var(--fg1);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.care-my-plan__action,
.care-my-plan__part {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
}
.care-my-plan__action {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--rule);
  border-block-start: 3px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.care-my-plan__action p,
.care-my-plan__part p {
  margin: 0;
  overflow-wrap: anywhere;
}
.care-my-plan__note {
  margin: 0;
  color: var(--fg2);
}
.care-my-plan__quiet {
  color: var(--fg2);
}
.care-my-plan__when {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
}
.care-my-plan__facts,
.care-my-plan__goals {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.care-my-plan__facts li,
.care-my-plan__goal-due {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}
.care-my-plan__goals {
  gap: var(--space-3);
  inline-size: 100%;
}
.care-my-plan__goal {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.care-my-plan__goal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.care-my-plan__goal-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.care-my-plan__goal-words {
  margin: 0;
  overflow-wrap: anywhere;
}
.care-my-plan__goal-due {
  margin: 0;
  color: var(--fg2);
}
.care-my-plan-page__help {
  max-inline-size: 48rem;
}
/* --- end my-plan --- */
/* --- referrer (care decisions, decision 1): a referrer's referrals on Home and after sending one --- */
/* The reference is read out or typed back to the CARE Team: figures of one width, a little apart. A long name wraps rather than widening the entry. */
.care-my-referrals__reference {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.care-my-referrals .entry__title {
  overflow-wrap: anywhere;
}
/* --- end referrer --- */
/* --- care:report (the semester report, Care::ReportsController) --- */
/* The term chooser: the select and its button on one line where there is room, the button under it on a phone. */
.care-semester-report-page__terms {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
}
.care-semester-report-page__terms > :first-child {
  flex: 1 1 16rem;
  max-inline-size: 28rem;
}
.care-semester-report-page__download {
  margin: 0;
}
.care-semester-report {
  display: grid;
  gap: var(--space-5);
}
/* --- end care:report --- */
/* ── safety-records track: decision 7's safety records on the Assessment tab (CareSafetyRecordsComponent) ── */
/* Each record's facts and its words, once read, take the whole width under its name; the case page lays an entry's parts in a wrapping row. */
.care-safety-records .case-work-entry > :is(.case-facts, .case-work-text-frame) {
  flex: 1 1 100%;
  min-inline-size: 0;
}
/* ── end safety-records track ── */
