/* Page-specific rules – global calculator.css untouched */

/* ─── Dimension controls ────────────────────────────────── */
/* Wrapper holds A & B panels side-by-side */
.dims-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
  }
  
  /* Each block stacks header + grid inputs */
  .dims-wrapper .dim-block {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* Header above each block */
  .dim-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  /* Grid alignment of labels/inputs */
  .dims-wrapper .dim-inputs {
    display: grid;
    grid-template-columns: max-content max-content;
    grid-row-gap: 8px;
    grid-column-gap: 12px;
    align-items: center;
  }
  
  /* Labels right-aligned */
  .dims-wrapper .dim-inputs label {
    justify-self: end;
    font-weight: 500;
  }
  
  /* Number inputs */
  .dims-wrapper .dim-inputs input {
    width: 60px;
    padding: 4px;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
  }
  
  /* Button spans two columns, smaller size */
  .dims-wrapper .dim-inputs button {
    grid-column: 1 / span 2;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #777;
    justify-self: center;
  }
  
  /* ─── Matrices layout ─────────────────────────────────── */
  .matrices-area   { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
  .matrix-block    { text-align: center; margin: 0 10px; }
  .matrix-title    { margin-bottom: 8px; font-weight: 600; }
  .operator        { font-size: 2rem!important; margin: 0 20px; display: flex; align-items: center; justify-content: center; }
  
  /* ─── Wrapper + brackets ───────────────────────────────── */
  .matrix-wrapper {
    --cell-size: 40px;
    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); padding: 0; border: 1px solid #999; box-sizing: border-box; }
  .cell-input                  { width: 100%; height: 100%; border: none; padding: 0; margin: 0; text-align: center; font-size: 1rem; background: transparent; 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; }
  
  /* ─── Answer line ─────────────────────────────────────── */
  .answer-box     { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-weight: bold; text-align: left; }
  .answer-box strong { font-weight: 700; }
  
  /* ─── Solve button hover ──────────────────────────────── */
  .solve-button:hover { background-color: #2980b9; }
  
  /* ─── Formula text styling ────────────────────────────── */
  .formula-text {
    width: 100%;
    padding: 4px;
    text-align: center;
    box-sizing: border-box;
  }
  
  /* ─── Step 2 overrides ────────────────────────────────── */
  /* Only the first matrix in Step 2 expands to fit wide formulas */
  .steps-container .step:nth-child(2) .step-answer > .matrix-wrapper:first-of-type {
    display: inline-block;
    width: -moz-fit-content;
    width: fit-content;
  }
  .steps-container .step:nth-child(2) .step-answer > .matrix-wrapper:first-of-type table {
    table-layout: auto;
  }
  .steps-container .step:nth-child(2) .step-answer > .matrix-wrapper:first-of-type .matrix-cell {
    width: auto;
    min-width: var(--cell-size);
  }
  .steps-container .step:nth-child(2) .step-answer > .matrix-wrapper:first-of-type .formula-text {
    white-space: nowrap;
  }
  