/* Figures (TASK-2026-163 slice S5).
   Almarai has proportional digits and no tabular figures, so static/js/digit_cells.js wraps every digit inside an
   element marked .rp-num in a .rp-d cell that is exactly --digit-w wide (tokens.css: 0.56em, so it follows the text
   size). The last digit of every row then ends on the same pixel. The characters themselves are unchanged. */

/* A figure reads left to right in both languages ("2,020,365.00 EGP" and "2,020,365.00 ج.م"), whatever the page
   direction is, and never reorders with the words around it. */
.rp-num {
  direction: ltr;
  unicode-bidi: isolate;
}

.rp-d {
  display: inline-block;
  width: var(--digit-w, 0.56em);
  text-align: center;
  letter-spacing: 0;
}

/* Mark the cell itself (td or th), not a span inside it. A figure is read left to right in both languages, so its last
   digit is on its right: "end" on a left-to-right cell is the right edge, and that is what makes a column's last digits
   line up in an Arabic page too. A span left to the cell's own (right-to-left) end would sit flush left and ragged. */
:is(td, th).rp-num {
  text-align: end;
}

/* Printing from the page gives the digits their natural width back: paper has no columns to line up here. */
@media print {
  .rp-d {
    display: inline;
    width: auto;
  }
}
