/* SEG R1617.3-B74 — Student-only typography for editable matrices.
 * Additive stylesheet. Never changes answer structure, admin editor or mathematical data.
 */
.seg-mc-student,
.seg-math142-student:has(.seg-math142-grid[data-seg-b74-matrix]) {
  min-width:0;
}
.seg-mc-student {
  max-width:100%;
  padding:clamp(10px,2vw,18px);
}
.seg-mc-student .seg-mc-equation {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  column-gap:clamp(5px,1.2vw,13px);
  row-gap:10px;
  padding:12px 6px;
  margin:4px 0 8px;
  overflow-x:visible;
  overflow-y:visible;
  white-space:normal;
  border-bottom:1px solid #e8eef4;
}
.seg-mc-student .seg-mc-equation:last-of-type {border-bottom:0}
.seg-mc-student .seg-mc-equation>span:first-child {
  flex:0 0 100%;
  text-align:left;
  font:600 .88rem/1.4 system-ui,-apple-system,sans-serif;
  color:#42627b;
  margin-bottom:2px;
}
.seg-mc-student .seg-mc-equation>span:not(.seg-mc-matrix):not(:first-child) {
  color:inherit;
  font-family:"Cambria Math",Cambria,Georgia,serif;
  font-weight:600;
  font-size:1.23rem;
  line-height:1.1;
}
.seg-mc-student .seg-mc-matrix,
.seg-math142-student .seg-b74-matrix-frame {
  --seg-b74-ink:#223f55;
  display:inline-flex!important;
  flex:none!important;
  align-items:stretch!important;
  width:max-content!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  padding:2px 1px!important;
  box-sizing:border-box!important;
  vertical-align:middle;
  white-space:nowrap;
}
.seg-mc-student .seg-mc-bracket,
.seg-math142-student .seg-b74-bracket {
  display:block!important;
  position:relative;
  box-sizing:border-box;
  align-self:stretch;
  flex:0 0 10px;
  width:10px!important;
  min-width:10px!important;
  padding:0!important;
  margin:0!important;
  font-size:0!important;
  line-height:0!important;
  color:transparent!important;
  overflow:visible;
}
/* Curved, fully stretchable parentheses, independent of row count. */
.seg-mc-student .seg-mc-matrix:not([data-notation="determinant"])>.seg-mc-bracket:first-child,
.seg-math142-student .seg-b74-matrix-frame>.seg-b74-bracket:first-child {
  border-left:2.8px solid var(--seg-b74-ink);
  border-top-left-radius:90% 50%;
  border-bottom-left-radius:90% 50%;
  margin-right:3px!important;
}
.seg-mc-student .seg-mc-matrix:not([data-notation="determinant"])>.seg-mc-bracket:last-child,
.seg-math142-student .seg-b74-matrix-frame>.seg-b74-bracket:last-child {
  border-right:2.8px solid var(--seg-b74-ink);
  border-top-right-radius:90% 50%;
  border-bottom-right-radius:90% 50%;
  margin-left:3px!important;
}
/* Straight, correctly sized determinant bars. */
.seg-mc-student .seg-mc-matrix[data-notation="determinant"]>.seg-mc-bracket:first-child {border-left:2px solid var(--seg-b74-ink);margin-right:4px!important}
.seg-mc-student .seg-mc-matrix[data-notation="determinant"]>.seg-mc-bracket:last-child {border-right:2px solid var(--seg-b74-ink);margin-left:4px!important}
/* Override legacy global table width / border / padding on student equations. */
.seg-mc-student .seg-mc-matrix>table.seg-mc-cells,
.seg-math142-student .seg-b74-matrix-frame>table.seg-math142-grid {
  display:table!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-collapse:separate!important;
  border-spacing:clamp(4px,.7vw,9px) 3px!important;
  table-layout:auto!important;
  background:transparent!important;
  box-shadow:none!important;
  white-space:nowrap!important;
}
.seg-mc-student .seg-mc-cells tr,
.seg-math142-student .seg-b74-matrix-frame .seg-math142-grid tr {
  border:0!important;
  background:transparent!important;
}
.seg-mc-student .seg-mc-cells td,
.seg-math142-student .seg-b74-matrix-frame .seg-math142-grid td {
  display:table-cell!important;
  width:auto!important;
  min-width:0!important;
  height:auto!important;
  padding:1px 2px!important;
  margin:0!important;
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  text-align:center!important;
  vertical-align:middle!important;
  font-family:"Cambria Math",Cambria,Georgia,serif!important;
  font-variant-numeric:tabular-nums;
  font-size:1.12rem!important;
  line-height:1.4!important;
}
.seg-mc-student .seg-mc-cells td>span,
.seg-math142-student .seg-b74-matrix-frame .seg-math142-grid td>span {
  display:inline-block!important;
  min-width:1.2ch!important;
  width:auto!important;
  padding:3px 1px!important;
  color:var(--seg-b74-ink);
  text-align:center;
}
.seg-mc-student .seg-mc-cells input,
.seg-math142-student .seg-b74-matrix-frame .seg-math142-grid input {
  display:inline-block!important;
  width:clamp(38px,4.3vw,52px)!important;
  min-width:0!important;
  max-width:52px!important;
  height:35px!important;
  padding:4px 3px!important;
  margin:0!important;
  box-sizing:border-box!important;
  text-align:center!important;
  font:500 1rem/1.2 "Cambria Math",Cambria,Georgia,serif!important;
  font-variant-numeric:tabular-nums;
  color:#133d5b!important;
  background:#fbfdff!important;
  border:1px solid #9bb6ca!important;
  border-radius:5px!important;
  box-shadow:none!important;
}
.seg-mc-student .seg-mc-cells input:focus-visible,
.seg-math142-student .seg-b74-matrix-frame .seg-math142-grid input:focus-visible {
  outline:2px solid #157ec5!important;
  outline-offset:1px!important;
  border-color:#157ec5!important;
}
.seg-math142-student .seg-math142-scroll:has(>.seg-b74-matrix-frame) {
  max-width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  overflow-x:auto;
  overflow-y:hidden;
  margin:8px 0;
  padding:6px 1px 10px;
  scrollbar-width:thin;
}
.seg-math142-student .seg-b74-matrix-frame {
  margin-inline:auto!important;
}
.seg-math142-student .seg-b74-matrix-frame[data-b74-mode="answer"] .seg-math142-grid input {
  border-style:dashed!important;
}
.seg-mc-student .seg-mc-equation>input[aria-label="Déterminant calculé"] {
  width:clamp(58px,8vw,82px);
  min-height:36px;
  border:1px dashed #8fb1ca;
  border-radius:6px;
  text-align:center;
  font:600 1.1rem "Cambria Math",Cambria,Georgia,serif;
}
@media (max-width:650px) {
  .seg-mc-student .seg-mc-equation {gap:7px 5px;padding:10px 0}
  .seg-mc-student .seg-mc-cells td,
  .seg-math142-student .seg-b74-matrix-frame .seg-math142-grid td {font-size:1rem!important}
  .seg-mc-student .seg-mc-cells input,
  .seg-math142-student .seg-b74-matrix-frame .seg-math142-grid input {
    width:38px!important;
    max-width:38px!important;
    height:32px!important;
  }
}
/* General site rules may require scrolling for 8x8 or 10x10 matrices.
 * Do not squash math glyphs; enable scroll only if a single matrix exceeds viewport.
 */
.seg-math142-student .seg-math142-scroll:has(>.seg-b74-matrix-frame) {scrollbar-color:#b5c4d1 transparent}
