/* Simple CARE's reference parts beside the work (packs/care/app/components/care/simple/possible_steps_component.rb and reaching_component.rb). Usual steps is the student's level, its meetings and count, the
   strip of one mark per usual step, chips for the steps of the work over compact rows (a mark, the words, how it is done, Plan and Log it as done), the steps for a safety concern folded under their own
   line, and the sheet of every level's usual steps (usual_steps_sheet_component.rb): the levels down the side, chips for how a step is done, a search, and the steps in columns. Reaching is how many tries have been made and a `details` of the tries the level planned. The chips are TabsComponent's tabs
   drawn as chips: with no script they are links over every group drawn one under the other, with it one group shows at a time, the chosen chip marked by its fill and its weight as well as by its color.

   Tokens only and logical properties only (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the console in light and in dark and mirrors in a right-to-left language. Nothing sets a
   height or a width, and everything that holds words may shrink and wrap, so a language 40% longer never widens the column (WCAG 1.4.10). A control is at least --target-min tall. */

/* ── Possible steps ─────────────────────────────────────────────────── */

.care-simple-steps__intro,
.care-simple-steps__meaning,
.care-simple-steps__rhythm {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.care-simple-steps__intro,
.care-simple-steps__rhythm {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.care-simple-steps__meaning {
  color: var(--fg1);
}

.care-simple-steps .tabs {
  margin-block-start: var(--space-3);
}

.care-simple-steps .tabs__list {
  gap: var(--space-2);
  border-block-end: 0;
}

.care-simple-steps .tabs__tab {
  justify-content: center;
  padding-inline: var(--space-3);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  margin-block-end: 0;
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 600;
}

.care-simple-steps .tabs__tab:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}



/* ── The progress strip: one mark per usual step ─────────────────────── */

.care-simple-steps__progress {
  display: flex;
  gap: 3px;
  margin-block-end: var(--space-2);
}

.care-simple-steps__segment {
  flex: 1 1 0;
  block-size: 8px;
  border-radius: 4px;
  background: var(--rule);
}

.care-simple-steps__segment--done { background: var(--good); }
.care-simple-steps__segment--planned { background: var(--accent); }

.care-simple-steps__stage {
  display: flex;
  flex-direction: column;
  margin-block-start: var(--space-3);
}

.care-simple-steps__stage-title {
  font-family: var(--font-sans);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block: 0 var(--space-1);
  color: var(--fg2);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.care-simple-steps__tally {
  margin-block: var(--space-2) 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.care-simple-steps__stage-title .care-simple-steps__tally { margin-block: 0; font-size: var(--text-xs, 0.75rem); }

.care-simple-steps__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── A step: its mark, its words and how, its acts ──────────────────── */

/* Mark in column 1, words in column 2, and any acts cleanly below the words in column 2 so they never cover <summary> or clip at 200% zoom and WCAG text spacing. */
.care-simple-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-2);
  row-gap: var(--space-1);
  padding-block: var(--space-2);
  border-block-start: 1px solid var(--rule);
}

.care-simple-step__mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 18px;
  block-size: 18px;
  margin-block-start: 2px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid var(--rule-strong);
}

.care-simple-step__mark--done { border-color: var(--good); background: var(--good); color: var(--accent-fg); }

/* A step the assistant read as done in the last note: the suggestion light of a suggested form option (36-form-fields.css) circles its mark a few times and rests. The tick is the person's. */
.care-simple-step__mark--suggested {
  border: 3px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--suggest-angle), var(--accent) 0 55%, var(--focus) 70%, var(--fg1) 78%, var(--focus) 86%, var(--accent) 100%) border-box;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0.6rem color-mix(in srgb, var(--focus) 70%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .care-simple-step__mark--suggested { animation: suggest-circle 1.8s linear 3, suggest-halo 0.9s ease-in-out 6 alternate; }
}

@media (forced-colors: active) {
  .care-simple-step__mark--suggested { border: 3px solid Highlight; background: Canvas; }
}

.care-simple-step[data-suggested] .care-simple-step__meta { color: var(--accent-text); }
.care-simple-step__mark--planned { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--accent); }

.care-simple-step__what {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.care-simple-step__what > summary,
div.care-simple-step__what {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.care-simple-step__what > summary {
  list-style: none;
  cursor: pointer;
}

.care-simple-step__what > summary::-webkit-details-marker { display: none; }

.care-simple-step__what > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.care-simple-step__label {
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.care-simple-step__meta {
  color: var(--fg2);
  font-size: var(--text-xs, 0.75rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.care-simple-step__how {
  color: var(--accent-text);
  font-weight: 700;
}

.care-simple-step__about {
  margin-block: var(--space-1) 0;
  color: var(--fg1);
  font-size: var(--text-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.care-simple-step__acts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  min-inline-size: 0;
}

.care-simple-step__acts .btn { color: var(--accent-text); }

/* ── What the assistant read as done in the last note ───────────────── */

.care-simple-steps__suggested {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-block-start: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: 10px;
  background: var(--accent-soft);
}

.care-simple-steps__suggested-lead {
  margin: 0;
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 700;
}

.care-simple-steps__suggested-reason {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.care-simple-steps__suggested-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The stage strip: the tabs drawn as one row the width of the card, "All steps" across the top with every step's mark, and a tile for each step of the work under it with its own
   count and marks. They wrap, never scroll; the tabs' one column is held to the card's width so nothing under them widens. */
.care-simple-steps .tabs {
  grid-template-columns: minmax(0, 1fr);
}

.care-simple-steps .tabs__nav,
.care-simple-steps .tabs__panel {
  min-inline-size: 0;
}

.care-simple-steps .tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Two tiles to a row in a side column; one to a row when the card is too narrow for two to hold their names. */
.care-simple-steps .tabs__item {
  flex: 1 1 max(calc(50% - var(--space-2)), 7rem);
  min-inline-size: 0;
}

.care-simple-steps .tabs__item:first-child {
  flex-basis: 100%;
}

.care-simple-steps .tabs .tabs__tab {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 3px;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: var(--target-min);
  padding: var(--space-2);
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg1);
  text-align: start;
  white-space: normal;
  overflow-wrap: normal;
}

/* The tally sits after the name and drops under it when the tile is too narrow for both on one line. */
.care-simple-steps .tabs .tabs__tab {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
}

.care-simple-steps .tabs .care-simple-steps__tile-name {
  flex: 1 1 auto;
  min-inline-size: 0;
  overflow-wrap: break-word;
}

.care-simple-steps .care-simple-steps__tile-bar {
  flex: 1 1 100%;
  grid-column: 1 / -1;
}

.care-simple-steps .tabs__item:first-child .tabs__tab {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: var(--space-2);
}

.care-simple-steps .tabs__item:first-child .care-simple-steps__tile-bar {
  grid-column: 1 / -1;
}

.care-simple-steps .tabs--scripted .tabs__tab[aria-selected="true"] {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--fg1);
}

.care-simple-steps__tile-name {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 800;
  line-height: 1.2;
}

.care-simple-steps__tile-tally {
  color: var(--fg2);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.care-simple-steps__tile-bar {
  display: flex;
  gap: 2px;
}

.care-simple-steps__tile-bar .care-simple-steps__segment {
  block-size: 5px;
}

/* ── Only if there is a safety concern ──────────────────────────────── */

.care-simple-steps__safety {
  margin-block-start: var(--space-3);
  padding-inline: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bad) 6%, transparent);
}

.care-simple-steps__safety > summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  min-block-size: var(--density-chip);
  align-items: center;
  color: var(--bad);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

@media (pointer: coarse) {
  .care-simple-steps__safety > summary { min-block-size: var(--target-min); }
}

.care-simple-steps__safety > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.care-simple-steps__safety .care-simple-steps__tally { margin-block: 0; color: var(--bad); }

.care-simple-steps__safety .care-simple-steps__list { padding-block-end: var(--space-2); }

.care-simple-steps__more {
  margin-block: var(--space-3) 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

/* ── Every level's usual steps (the sheet) ──────────────────────────── */

.care-usual-sheet {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5, 1.5rem);
  align-items: flex-start;
}

.care-usual-sheet__levels {
  flex: 1 1 220px;
  max-inline-size: 280px;
}

.care-usual-sheet__levels > ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.care-usual-sheet__level {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px var(--space-2);
  min-block-size: var(--target-min);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  color: var(--fg1);
  text-decoration: none;
}

.care-usual-sheet__level:hover { background: var(--accent-soft); }

.care-usual-sheet__level[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-fg);
}

.care-usual-sheet__level-name { font-weight: 800; }
.care-usual-sheet__level-count { font-size: var(--text-xs, 0.75rem); font-weight: 600; }

.care-usual-sheet__theirs {
  flex-basis: 100%;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.care-usual-sheet__main {
  flex: 999 1 560px;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

.care-usual-sheet__title { margin: 0; font-size: var(--text-lg, 1.25rem); }

.care-usual-sheet__meaning,
.care-usual-sheet__rhythm {
  margin-block: var(--space-1) 0;
  max-inline-size: 70ch;
  overflow-wrap: anywhere;
}

.care-usual-sheet__rhythm { color: var(--fg2); font-size: var(--text-sm); }

.care-usual-sheet__tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.care-usual-sheet__hows {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.care-usual-sheet__how {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-block-size: var(--density-chip);
  padding-inline: var(--space-3);
  border: 1px solid var(--control-line);
  border-radius: 999px;
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

@media (pointer: coarse) {
  .care-usual-sheet__how { min-block-size: var(--target-min); }
}

.care-usual-sheet__how:hover { background: var(--accent-soft); border-color: var(--accent-line); }

.care-usual-sheet__how[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

.care-usual-sheet__how-count { opacity: 0.75; }

.care-usual-sheet__find {
  display: flex;
  flex: 1 1 18rem;
  flex-wrap: wrap;
  min-inline-size: 0;
  gap: var(--space-2);
  align-items: center;
}

.care-usual-sheet__find > label { font-size: var(--text-sm); font-weight: 700; }

.care-usual-sheet__find > input {
  flex: 1 1 10rem;
  inline-size: 16rem;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: var(--density-chip);
  padding-inline: var(--space-2);
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg1);
  font: inherit;
}

.care-usual-sheet__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-4, 1rem);
  align-items: start;
}

.care-usual-sheet__stage,
.care-usual-sheet__safety {
  min-inline-size: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface-raised);
}

.care-usual-sheet__safety {
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  background: color-mix(in srgb, var(--bad) 6%, var(--surface-raised));
}

.care-usual-sheet__stage-title {
  font-family: var(--font-sans);
  display: flex;
  justify-content: space-between;
  margin: 0 0 var(--space-1);
  color: var(--fg2);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.care-usual-sheet__safety .care-usual-sheet__stage-title { color: var(--bad); }

.care-usual-sheet__empty,
.care-usual-sheet__none {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
}

/* ── Reaching ───────────────────────────────────────────────────────── */

.care-simple-reaching__count,
.care-simple-reaching__words {
  margin-block: 0;
  overflow-wrap: anywhere;
}

.care-simple-reaching__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-3);
  min-inline-size: 0;
}

.care-simple-reaching__planned {
  margin-block-start: var(--space-3);
}

.care-simple-reaching__planned > summary {
  display: list-item;
  min-block-size: var(--density-chip);
  padding-block: var(--space-1);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

@media (pointer: coarse) {
  .care-simple-reaching__planned > summary {
    min-block-size: var(--target-min);
  }
}

.care-simple-reaching__planned > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.care-simple-reaching__list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.care-simple-reaching__try {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
  padding-block: var(--space-3);
  border-block-start: 1px solid var(--rule);
}

.care-simple-reaching__try:first-child {
  border-block-start: 0;
}

.care-simple-reaching__try .care-simple-reaching__actions {
  margin-block-start: var(--space-1);
}

/* On a narrow screen the levels are chips that wrap, so the steps are on the first screen and not under five full-width rows. */
@media (max-width: 40rem) {
  .care-usual-sheet__levels {
    flex-basis: 100%;
    min-inline-size: 0;
    max-inline-size: none;
  }

  .care-usual-sheet__levels > ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .care-usual-sheet__levels li { flex: 0 1 auto; min-inline-size: 0; }

  .care-usual-sheet__level {
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--control-line);
    border-radius: 1rem;
  }

  .care-usual-sheet__level[aria-current="page"] { border-color: var(--accent); }

  .care-usual-sheet__theirs { flex-basis: auto; }
}
