/* 3×3–specific matrix layout & cell styling */

.matrices-area {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.matrix-block { text-align: center; margin: 0 10px; }
.matrix-title { margin-bottom: 8px; font-weight: 600; }

.matrix-wrapper {
  --cell-size: 60px;
  display: inline-block;
  position: relative;
  padding: 8px;
  vertical-align: middle;
}
.matrix-wrapper table {
  border-collapse: separate;
  border-spacing: 1px;
}
.matrix-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: 1px solid #999;
  box-sizing: border-box;
}
.cell-input {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  text-align: center;
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
}
.matrix-wrapper::before,
.matrix-wrapper::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 4px;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
}
.matrix-wrapper::before {
  left: 0;
  border-left: 2px solid #333;
  border-radius: 4px 0 0 4px;
}
.matrix-wrapper::after {
  right: 0;
  border-right: 2px solid #333;
  border-radius: 0 4px 4px 0;
}

/* Fraction styling — identical to 2×2 */
.frac-table {
  border-collapse: collapse;
  margin-right: 12px;
}
.frac-table td {
  border: none;
  padding: 4px 8px;
  text-align: center;
}
.frac-table tr:first-child td {
  border-bottom: 1px solid #333;
}

/* Operator alignment */
.operator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
  font-size: 1rem;
}
/* widen only the symbolic‐adjugate matrix cells */
.matrix-wrapper.wide-cells .matrix-cell {
  min-width: calc(var(--cell-size) * 1.5);
}
/* widen only the symbolic‐adjugate matrix cells */
.matrix-wrapper.wide-cells .matrix-cell {
  min-width: calc(var(--cell-size) * 1.5);
}
/* make the substituted adjugate cells even wider */
.matrix-wrapper.wide-cells .matrix-cell {
  min-width: calc(var(--cell-size) * 2);
}

