/* /mistakes «أخطائي» (Task mistakes, part b), «احفظ للمراجعة» wherever a question shows answered, and «أخطائي»'s card on
   /learn. Right to left first: logical properties only. Colours and sizes come from tokens.css only. The question in a
   review is practice's (learn.css's learn-item, learn-option…); what's here is the notebook, the lists, the review's own
   parts and the save button. Nothing moves. */

/* its notice (when there's one) over the page's body, a gap between them */
.mistakes-page,
.mk-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mk-body > h1 {
  margin: 0;
}

/* a link drawn as a button: its words in its middle, as the tests page's */
.mistakes-page a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mistakes-page.is-busy .mk-stage {
  opacity: 0.7;
}

.mk-lead {
  margin: 0;
}

.mk-help {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

/* ── The notebook ── */

.mk-today {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.mk-due {
  margin: 0;
  font-size: var(--font-size-title);
}

.mk-held {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-inline-start: 4px solid var(--color-draft);
  border-radius: var(--radius);
  background: var(--color-draft-soft);
}

.mk-next {
  margin: 0;
  font-weight: 700;
}

.mk-book h2,
.mk-done h1 {
  margin: 0 0 var(--space-3);
}

/* a card's heading, as the other cards' */
.mk-book h2 {
  font-size: var(--font-size-card-title);
}

.mk-fields,
.mk-skills,
.mk-entries,
.mk-hint-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mk-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-weight: 700;
}

.mk-field-name .icon {
  color: var(--color-on-text);
}

.mk-counts {
  color: var(--color-muted);
  font-size: var(--font-size-small);
  font-weight: 400;
}

.mk-skills {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mk-skill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--color-bg);
}

/* a skill with some due today: its counts in the text's colour */
.mk-skill.is-due .mk-counts {
  color: var(--color-text);
  font-weight: 700;
}

.mk-lists {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.mk-list-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.mk-list-link:hover {
  background: var(--color-bg);
}

.mk-list-count {
  padding: 0 var(--space-2);
  border-radius: var(--radius);
  background: var(--color-info-soft);
  font-size: var(--font-size-small);
}

.mk-lists > .mk-help {
  flex-basis: 100%;
}

/* ── A review ── */

.mk-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.mk-back {
  font-size: var(--font-size-small);
  font-weight: 700;
}

.mk-crumb-due {
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

/* (the keyboard is put there for a screen reader to start from, as practice's stage: no frame) */
.mk-stage:focus {
  outline: none;
}

.mk-hints {
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--color-info-soft);
}

.mk-hint-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mk-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.mk-hint-n {
  font-size: var(--font-size-small);
  font-weight: 700;
}

.mk-hint-body {
  flex: 1 1 12rem;
  min-inline-size: 0;
}

/* what the answer did: its icon, and its colours by what it was (the words in the text's colour, which reads on the
   soft backgrounds in both themes; the dark theme's danger and correct colours are for borders and marks) */
.mk-after {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  border-inline-start: 4px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-weight: 700;
}

.mk-after .icon {
  flex: none;
}

.mk-after.is-next,
.mk-after.is-learned {
  border-inline-start-color: var(--color-correct);
  background: var(--color-correct-soft);
}

.mk-after.is-next .icon,
.mk-after.is-learned .icon {
  color: var(--color-correct);
}

.mk-after.is-in {
  border-inline-start-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.mk-after.is-in .icon {
  color: var(--color-danger);
}

.mk-after.is-again {
  border-inline-start-color: var(--color-draft);
  background: var(--color-draft-soft);
}

.mk-solution {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.mk-solution-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.mk-solution-toggle[aria-expanded="true"] .mk-chevron {
  transform: rotate(180deg);
}

.mk-solution-body {
  align-self: stretch;
}

.mk-done {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mk-done > p {
  margin: 0;
}

.mk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── «المحفوظة» and «تعلّمتها» ── */

.mk-entries {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mk-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mk-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.mk-entry-node {
  font-weight: 700;
}

.mk-entry-stem {
  overflow-x: auto;
}

.mk-more {
  display: flex;
  justify-content: center;
}

/* ── «احفظ للمراجعة» (components/save-question.js): the same words on and off, pressed and its icon filled when saved ── */

.save-question {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: var(--space-1);
}

/* (small, as «بلاغ عن مشكلة» and «عرض الشرح» beside it) */
.save-question-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-small);
}

.save-question-button[aria-pressed="true"] {
  color: var(--color-on-text);
  font-weight: 700;
}

.save-question-button[aria-pressed="true"] .icon {
  fill: currentColor;
}

/* what it did, said beside it: always there, so a screen reader hears it change (empty, it takes no room) */
.save-question-why {
  color: var(--color-muted);
  font-size: var(--font-size-small);
}

.save-question-why:not(:empty) {
  margin-inline-start: var(--space-2);
}

/* in a post's answered question, under its solution */
.cm-q-save {
  align-self: flex-start;
}

/* (practice's answered question, «احفظ للمراجعة» and «بلاغ عن مشكلة» in one row, and «أخطائي» on /learn, under the subject
   list, a card that links: learn.css since Task indoor, part d) */
