/* The Ciocca Center's certificate screens in the console (docs/certificates/01-plan.md section 5, staff): CertificateStaffChecklistComponent, CertificateApplicationsComponent,
   CertificateEnrollmentsTableComponent, CertificateSessionListComponent and CertificateRosterComponent, and the pages that arrange them (packs/certificates/app/views/certificate_*).

   THE CHECKLIST is an ordered list of requirements, each a card in the entry list's anatomy (43-entry-list.css): a head line (a mark, the requirement's name, its state in
   a badge), a quiet line with the suggested timeline, the description, what satisfied it (a list under a hairline, each line with its Withdraw when a person recorded it),
   and the actions (Record, Waive) behind their disclosures. The mark is drawn here from `data-done`, and is never alone: the badge says the same in words (WCAG 1.4.1).

   The other components are built from the entry list, the data table and the figure strip, and need only their gaps here.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell and the console, in light
   and in dark, and mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and everything that holds words may shrink and wrap, so a language 40% longer
   never widens the page (WCAG 1.4.10). */

/* --- forms_editor (C-editor-ui; docs/certificates/03-forms-plan.md section 5) ---
   The Center's forms pages: CertificateFormEditorComponent (the editor: the whole draft in one form, each question a card in an ordered list, its moves in a row that wraps) and
   CertificateFormPreviewComponent (a version drawn by the form builder, disabled, outside any form). The fields, the sections, the buttons and the actions are the form system's own
   (36-form-fields.css); this adds only the gaps, the cards and the preview's frame. Tokens and logical properties only; everything that holds words wraps (WCAG 1.4.10). */

.certificate-form-editor__bar,
.certificate-form-actions,
.certificate-form-editor__moves,
.certificate-form-editor__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.certificate-form-editor__add {
  align-items: end;
}

.certificate-form-editor__add > .field {
  flex: 1 1 14rem;
  min-inline-size: 0;
}

.certificate-form-editor__questions {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.certificate-form-editor__heading,
.certificate-form-editor__lede,
.certificate-form-editor__kind,
.certificate-form-editor__fixed {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.certificate-form-editor__lede,
.certificate-form-editor__kind,
.certificate-form-editor__fixed {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.certificate-form-editor__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.certificate-form-editor__question {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.certificate-form-editor__legend {
  padding-inline: var(--space-1);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.certificate-form-preview {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
  padding: var(--space-4);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-md);
}

.certificate-form-preview__note {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
}

.certificate-form-preview__title,
.certificate-form-preview__intro {
  margin-block: 0;
  overflow-wrap: anywhere;
}

/* A preview's fieldset is disabled, and holds no form of its own: no border of a fieldset around what is the form's section. */
.certificate-form-preview__fields {
  min-inline-size: 0;
}

/* --- end forms_editor --- */

.certificate-staff-checklist,
.certificate-applications,
.certificate-roster {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.certificate-staff-checklist__title,
.certificate-applications__title,
.certificate-roster__title {
  margin-block: 0;
}

.certificate-staff-checklist__lede {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.certificate-staff-checklist__steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.certificate-staff-checklist__step {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
  padding-block: var(--space-3);
  padding-inline: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.certificate-staff-checklist__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  min-inline-size: 0;
}

.certificate-staff-checklist__mark::before {
  content: "○";
  color: var(--fg2);
}

.certificate-staff-checklist__step[data-done="true"] .certificate-staff-checklist__mark::before {
  content: "✓";
  color: var(--tone-good-fg);
}

.certificate-staff-checklist__label {
  min-inline-size: 0;
  margin-block: 0;
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.35;
}

.certificate-staff-checklist__meta,
.certificate-staff-checklist__description {
  min-inline-size: 0;
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
}

.certificate-staff-checklist__evidence {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
  margin: 0;
  padding-block-start: var(--space-2);
  padding-inline: 0;
  border-block-start: 1px solid var(--rule);
  list-style: none;
}

.certificate-staff-checklist__evidence-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  min-inline-size: 0;
  font-size: var(--text-sm);
}

.certificate-staff-checklist__evidence-text {
  min-inline-size: 0;
}

.certificate-staff-checklist__course {
  color: var(--fg2);
}

.certificate-staff-checklist__actions,
.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  min-inline-size: 0;
}

/* A requirement's Record or Waive, once open, takes the whole row: its form is a `.tform`, an inline-size container that takes no width from what it holds, so beside the other
   button it was only as wide as its own summary and its choices wrapped a letter to a line (seen on an enrollment's page, 26 Oct 2026). The other button wraps under it. */
.certificate-staff-checklist__actions > .form-disclosure[open],
.certificate-actions > .form-disclosure[open] {
  flex: 1 0 100%;
}

/* A decision, a withdrawal or a state change is one button in a form of its own: the forms sit side by side and wrap.
   Not a size container: `.tform` is one (`container: tform / inline-size`), and an inline-size container takes no width from what it holds, so in a flex row
   that gives it none it shrank to nothing and its button's words wrapped a letter to a line (seen on an enrollment's page, 10 Oct 2026).
   Two classes, because this sheet (26) now loads before 36-form-fields.css, whose `.tform` would otherwise win (seen again 26 Oct 2026). */
.tform.certificate-inline-form {
  container-type: normal;
  display: inline-flex;
  flex: none;
  max-inline-size: 100%;
  margin: 0;
}
/* On a phone, a button's words longer than the row wrap inside it rather than run past the screen. */
.tform.certificate-inline-form .btn {
  max-inline-size: 100%;
  white-space: normal;
}

.certificate-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

.certificate-count {
  color: var(--fg2);
  font-size: var(--text-sm);
}

/* The enrollments table folds its two day columns under 40rem of its own frame, and its name cell then says them in words (CertificateEnrollmentsTableComponent),
   so a phone reads a student and not a table that scrolls sideways. */
.certificate-enrollments-frame {
  container-type: inline-size;
  min-inline-size: 0;
}

.certificate-folded {
  display: none;
}

@container (max-width: 40rem) {
  .certificate-enrollments-table :is(th, td)[data-fold] {
    display: none;
  }

  .certificate-folded {
    display: block;
    margin-block-start: var(--space-1);
    color: var(--fg2);
    font-size: var(--text-sm);
    font-weight: 400;
  }
}

/* --- forms_staff (C-staff-ui; docs/certificates/03-forms-plan.md section 2, "The coordinator" and "The Associate Director") ---
   The submissions queue (CertificateSubmissionsTableComponent: the data table, drawn as cards where it has little room), one submission's page (CertificateSubmissionReviewComponent,
   CertificateConfirmationsComponent, CertificateSubmissionHistoryComponent, Approve and Send back behind their disclosures), and the line a checklist step gives its newest submission.
   Tokens and logical properties only, both modes, nothing pinned, everything that holds words may wrap. */

.certificate-submission-review,
.certificate-confirmations,
.certificate-submission-history {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.certificate-submission-review__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.certificate-submission-review__title,
.certificate-confirmations__title,
.certificate-submission-history__title {
  margin-block: 0;
}

.certificate-submission-review__summary,
.certificate-confirmations__lede,
.certificate-confirmations__gone {
  margin-block: 0;
  color: var(--fg2);
}

.certificate-submission-review__note {
  margin: 0;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border-inline-start: 3px solid var(--rule-strong);
  background: var(--surface-sunken);
  overflow-wrap: anywhere;
}

.certificate-submission-review__note figcaption {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.certificate-submission-review__note blockquote {
  margin: 0;
  white-space: pre-line;
}

.certificate-submission-review__note blockquote p {
  margin-block: var(--space-1) 0;
}

/* Each confirmation reads like the answers on a request's page (60-intake.css, `.report-card`): who recorded it and when as the card's head over a hairline, then each question
   and its answer a row under a hairline, the question in the quiet color. */
.certificate-confirmations .entry__title {
  font-weight: 650;
}
.certificate-confirmations .entry__line {
  padding-block-end: var(--space-2);
  border-block-end: 1px solid var(--rule);
}
.certificate-confirmations .form-answers {
  gap: var(--space-3);
}
.certificate-confirmations .form-answer + .form-answer {
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--rule);
}
.certificate-confirmations .form-answer dt {
  color: var(--fg2);
  font-weight: 600;
}
.certificate-confirmations .form-answer dd {
  max-inline-size: 66ch;
  margin-block-start: var(--space-1);
}

.certificate-confirmations__action {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.certificate-review {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.certificate-submissions-table__year {
  display: block;
  color: var(--fg2);
  font-size: var(--text-sm);
  font-weight: 400;
}

.certificate-staff-checklist__submission {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
/* --- end forms_staff --- */
/* A link that stands alone in a table cell, not in a sentence, still meets the 24px target (WCAG 2.5.8). */
.certificate-cell-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
}

/* The overview's progress: one step per requirement of the student's set, filled when met. An empty step is outlined in muted ink, so it reads at 3:1. */
.certificate-steps {
  display: inline-flex;
  gap: 0.125rem;
  inline-size: 7.5rem;
  vertical-align: middle;
}

.certificate-steps__step {
  flex: 1 1 0;
  block-size: 0.625rem;
  border-radius: 0.125rem;
  background: var(--surface-sunken);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.certificate-steps__step[data-done] {
  background: var(--tone-good-fg);
  box-shadow: none;
}

@media (forced-colors: active) {
  .certificate-steps__step { background: Canvas; box-shadow: inset 0 0 0 1px CanvasText; }
  .certificate-steps__step[data-done] { background: CanvasText; }
}
