/* Matrix applets (mathcourse/static/mathcourse/applets/matrices.js): matrices
 * to type into, arrows with heads, the parallelogram, the eigenvector lines. */

/* A 2 × 2 matrix between brackets: boxes to type into, or numbers. */
.mcm-line { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; font-size: 1.1rem; color: var(--ink); }
.mcm-name { font-weight: 800; color: var(--ink); }
.mcm-name.is-c { color: var(--teal-deep); }
.mcm-mx { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 6px; padding: 6px 10px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); border-radius: 8px; vertical-align: middle; }
.mcm-mx input, .mcm-mx output { width: 4.4em; min-height: 44px; padding: 4px 6px; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 1.05rem; font-weight: 700; text-align: center; color: var(--ink); }
.mcm-mx input:focus-visible { outline: 3px solid var(--tangerine); outline-offset: 1px; }
.mcm-mx input.is-b { border-color: color-mix(in srgb, var(--tangerine) 60%, var(--paper)); }
.mcm-mx input.is-c { border-color: color-mix(in srgb, var(--teal) 60%, var(--paper)); }
.mcm-mx input.is-row { border-color: var(--tangerine); background: color-mix(in srgb, var(--tangerine) 16%, var(--paper)); }
.mcm-mx input.is-col { border-color: var(--teal-deep); background: color-mix(in srgb, var(--teal) 18%, var(--paper)); }
.mcm-out output { display: grid; place-items: center; border-style: dashed; color: var(--muted); }
.mcm-out output.is-done { border-style: solid; color: var(--ink); }
.mcm-out output.is-now { border-style: solid; border-color: var(--tangerine); background: color-mix(in srgb, var(--gold) 16%, var(--paper)); color: var(--ink); }
.mcm-bars { display: inline-grid; gap: 4px; padding: 4px 12px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); border-radius: 6px; }
.mcm-bars > span { display: grid; grid-template-columns: repeat(2, minmax(2.6em, auto)); gap: 14px; text-align: center; }
.mcm-bars b { font-weight: 800; color: var(--ink); }
.mcm-bars b.is-c { color: var(--teal-deep); }
.mcm-name sup { font-size: 0.7em; }

/* Multiplying: A, B and the answer in one row that wraps on a phone. */
.mcm-mul { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; margin-bottom: 14px; font-size: 1.2rem; color: var(--ink); }
.mcm-eq { font-weight: 800; }
.mcm-pair { display: inline-flex; gap: 10px; align-items: center; }
.mc-applet[data-mc-applet="multiply"] .mca-btns { margin-top: 14px; }
.mc-applet[data-mc-applet="multiply"] .mca-btns button:disabled { opacity: 0.45; cursor: default; }

/* The board. */
.mcm-arm { stroke-width: 3.4; }
.mcm-head { stroke: none; fill: var(--ink); }
.mcm-head.is-b { fill: var(--tangerine); }
.mcm-head.is-c { fill: var(--teal-deep); }
.mcm-arm.is-same { stroke-width: 6; }
.mcm-square { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; }
.mcm-para { fill: color-mix(in srgb, var(--teal) 24%, transparent); stroke: var(--teal-deep); stroke-width: 2; stroke-linejoin: round; }
.mcm-para.is-neg { fill: color-mix(in srgb, var(--tangerine) 26%, transparent); stroke: var(--tangerine); }
.mcm-para.is-zero { stroke: var(--ink); stroke-width: 3; }
.mcm-tri { fill: color-mix(in srgb, var(--gold) 45%, transparent); stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 3 3; }
.mcm-trail { fill: color-mix(in srgb, var(--gold) 14%, transparent); stroke: var(--gold); stroke-width: 1.2; }
.mcm-gl { stroke: color-mix(in srgb, var(--teal) 45%, var(--paper)); stroke-width: 1; }
.mcm-eig { stroke: var(--gold); stroke-width: 2.6; stroke-dasharray: 9 6; }
.mcm-guide { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2 5; }
.mcm-value { font-size: 20px; font-weight: 800; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.mcm-lab { font-size: 14px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.mcm-lab.is-b { fill: var(--tangerine); }
.mcm-lab.is-c { fill: var(--teal-deep); }

/* Answers for the teacher under the questions. */
.mcm-notes { margin-top: 18px; padding: 12px 16px; border: 1px dashed var(--gold); border-radius: 12px; }
.mcm-notes summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.mcm-notes summary small { margin-left: 6px; font-weight: 400; color: var(--muted); }
.mcm-notes ol { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 22px; line-height: 1.55; }
.mc-applet.is-full .mcm-notes { display: none; }

@media (max-width: 520px) {
    .mcm-mx input, .mcm-mx output { width: 3.8em; font-size: 1rem; }
    .mcm-mul { font-size: 1.05rem; }
}
