/* =========================================================
   RepSheet: muscles worked, key points, and common mistakes
   (exercise-info.js). Used by the builder, printed handout and patient page.
   ========================================================= */
.mm { --mm-body: #d3e0de; --mm-on: #0f8f80; --mm-good: #1f8a5b; --mm-bad: #c8372d;
  display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 16px 0 0; }
.mm h3 { margin: 0 0 8px; font-size: .95rem; color: var(--brand-ink); }
.mm > section { background: var(--brand-tint-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mm-flag { grid-column: 1 / -1; margin: 0; font-size: .8125rem; color: var(--ink-soft); }
.mm-flag .awaiting-check { margin-right: 4px; }
.mm-pic svg { display: block; width: 100%; max-width: 128px; height: auto; margin: 0 auto; }
.mm-body * { fill: var(--mm-body); stroke: var(--mm-body); stroke-linecap: round; }
.mm-body path, .mm-body circle, .mm-body ellipse { stroke: none; }
.mm-on * { fill: var(--mm-on); stroke: var(--mm-on); stroke-linecap: round; }
.mm-svg line { fill: none; }
.mm-svg text { font: 600 10px system-ui, sans-serif; fill: var(--ink-soft); stroke: none; }
.mm-names { margin: 6px 0 0; font-size: .8125rem; line-height: 1.35; color: var(--ink-soft); text-align: center; }
.mm-names span { display: block; }
.mm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.mm-list li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.mm-list svg { flex: none; width: 19px; height: 19px; margin-top: 1px; }
.mm-list svg path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mm-ticks svg circle { fill: var(--mm-good); }
.mm-crosses svg circle { fill: var(--mm-bad); }

/* Builder: folded away on screen, so the physio can read and check it */
.mm-fold { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff); }
.mm-fold > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
.mm-fold > .mm { margin: 0 12px 12px; }
.mm-fold .mm { grid-template-columns: 130px minmax(0, 1fr); }
.mm-fold .mm-muscles { grid-row: span 2; }

/* Patient page and narrow screens */
@media (max-width: 640px) {
  .mm, .mm-fold .mm { grid-template-columns: minmax(0, 1fr); }
  .mm-muscles { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
  .mm-muscles h3 { grid-column: 1 / -1; }
  .mm-fold .mm-muscles { grid-row: auto; }
  .mm-names { text-align: left; font-size: .9rem; }
}

/* Builder: the print copies only show when their option is ticked */
body:not(.show-extras) .print-extras { display: none !important; }

@media screen {
  :root[data-theme="dark"] .mm { --mm-body: #2d3d40; --mm-on: #4fc1b2; --mm-good: #3aa877; --mm-bad: #e0645a; }
}

@media print {
  .mm { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2.5mm; margin: 2.5mm 0 0; font-size: 8.5pt; break-inside: avoid; page-break-inside: avoid; }
  .mm > section { padding: 1.8mm 2.5mm; border-radius: 2mm; border: .3mm solid var(--line-strong); background: none; }
  .mm h3 { font-size: 9pt; margin: 0 0 1.2mm; }
  /* Muscles: small front and back figure beside the names, so the block stays 3 lines high */
  .mm-muscles { display: grid; grid-template-columns: 13mm minmax(0, 1fr); column-gap: 2mm; align-items: center; }
  .mm-muscles h3 { grid-column: 1 / -1; }
  .mm-pic svg { width: 13mm; max-width: none; }
  .mm-svg text { display: none; }
  .mm-names { font-size: 7.5pt; margin: 0; text-align: left; line-height: 1.3; }
  .mm-names span { display: inline; }
  .mm-names span + span::before { content: " · "; }
  .mm-list { gap: 1mm; }
  .mm-list li { gap: 1.5mm; line-height: 1.25; }
  .mm-list svg { width: 3.6mm; height: 3.6mm; margin-top: .2mm; }
  .print-extras { margin-right: -36mm; }
  .large-print .mm { font-size: 11pt; }
  .large-print .print-extras { margin-right: -46mm; }
  /* Paper saver: muscles as one line of text, ticks and crosses side by side with no boxes */
  .paper-saver .print-extras { margin-right: 0; }
  .paper-saver .mm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); font-size: 7.5pt; gap: .5mm 2.5mm; margin-top: 1.5mm; }
  .paper-saver .mm > section { border: none; padding: 0; }
  .paper-saver .mm-muscles { grid-column: 1 / -1; display: block; }
  .paper-saver .mm-muscles h3, .paper-saver .mm-pic { display: none; }
  .paper-saver .mm-names { font-size: 7.5pt; }
  .paper-saver .mm-names::before { content: "Muscles worked: "; font-weight: 700; color: var(--brand-ink); }
  .paper-saver .mm h3 { font-size: 7.5pt; margin-bottom: .6mm; }
  .paper-saver .mm-list { gap: .4mm; }
  .paper-saver .mm-list svg { width: 3mm; height: 3mm; }
  /* Black and white printing */
  .bw-print .mm { --mm-body: #e4e4e4; --mm-on: #222; --mm-good: #222; --mm-bad: #222; }
}
