/* The workout editor's verdict marks (Components::SyntaxHighlightedTextarea
   with the live preview's Components::EditorVerdict). The colouring itself
   is the legacy syntax_highlight.css. */

/* A movement the preview could not find in the gym's library, marked where
   it is typed: a dotted caution underline under the movement's own colour,
   never a change of weight or spacing, so the text keeps its width. The
   preview's notice names the same movements (Components::UnknownMovementsNotice). */
.hl-unknown {
  text-decoration: underline dotted var(--caution);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* A line the parser warned about (a movement in a timed window with no rep
   count), marked whole where it is typed: a wavy caution underline, the
   warning as the title, so it reads apart from the unknown movement's dotted
   one. The preview's warnings list says the same. */
.hl-warned {
  text-decoration: underline wavy var(--caution);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* The autocomplete's row for a movement the preview could not find
   (description_autocomplete_controller.js): its badge in the same caution
   as the mark above. The row and badge shapes are the legacy
   description_autocomplete.css. */
.autocomplete-badge-unknown {
  color: var(--caution-ink);
  background-color: var(--caution-soft);
}

/* The unknown row wraps: badge and name on one line, the notice and offer
   on the next, where a plain row's hint is cut to one line. */
.autocomplete-item-unknown {
  flex-wrap: wrap;
}

.autocomplete-hint-unknown {
  flex-basis: 100%;
  white-space: normal;
}

/* The workout form's Scoring select and what it says about where its value
   came from (Views::WorkoutDescriptions::PreviewableForm). The select can
   shrink to fit beside Stimulus in the builder's narrow column; the
   "From description" chip wraps under it when there is no room. */
.scoring-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.scoring-select {
  flex: 1 1 6rem;
  min-width: 0;
  transition: background-color 600ms;
}

/* The select just took the scoring the description states
   (workout_live_preview_controller#syncStatedScoring). */
.scoring-select[data-synced] {
  background-color: var(--accent-fill);
}

@media (prefers-reduced-motion: reduce) {
  .scoring-select {
    transition: none;
  }
}

/* The folded Program, Category, Movement prep and Benchmark: its closed
   line reads their values. */
.workout-fields-fold {
  min-width: 0;
}

/* A movement that comes round again (Planning::LineRepeats, by
   Planning::RepeatTone's gap): the editor marks the whole line typed, the
   sentence as its title (workout:repeat-marks, from Components::RepeatMarks).
   The tones differ by more than hue: danger (the same movement back to back)
   is bold on a solid underline; caution (two or three days apart, a pattern
   the day before or after, a movement like one just programmed) a dashed
   one; quiet (the same movement four to six days away) a thin dotted one.
   The syntax colours stay under all three. */
.hl-repeat-danger {
  font-weight: 700;
  text-decoration: underline solid var(--danger);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.hl-repeat-caution {
  text-decoration: underline dashed var(--caution-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.hl-repeat-quiet {
  text-decoration: underline dotted var(--ink-muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* The same repeats on the live preview's lines (repeat_marks_controller.js):
   the movement's name underlined as in the editor, and beside it the mark's
   note, a UI::Popover whose trigger is a chip in the mark's tone with the
   few words that say why; it opens the full sentence on a click, a tap or
   Enter. */
.repeat-mark-danger {
  font-weight: 700;
  color: var(--danger-ink);
  text-decoration: underline solid var(--danger);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.repeat-mark-caution {
  text-decoration: underline dashed var(--caution-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.repeat-mark-quiet {
  text-decoration: underline dotted var(--ink-muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.repeat-mark-note {
  margin-inline-start: var(--space-1);
  white-space: nowrap;
}

.repeat-mark-panel {
  max-width: 22rem;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  white-space: normal;
}
