/* Base: the page, plain text, and the small helpers every screen uses. */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 400 var(--fs-2)/1.6 var(--font-ui); direction: rtl; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-family: var(--font-field); }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: var(--accent-a38) transparent; }

/* digits read left to right inside Arabic; plaintext keeps «ملف 0152» or «5:30 م» in the right order */
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; white-space: nowrap; }
.nobr { white-space: nowrap; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
#view .money:not(.free) { font-weight: 600; } /* an amount on a page stands out (the prototype's); a printed paper keeps its weight */
.money.free { color: var(--muted); font-weight: 400; }
.money.back { color: var(--rx-ink); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-1); }
.shake { animation: shake .3s ease; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* who a thing belongs to (a card's stripe, a task row, a chip, a toast) */
.o-pat, .sheet[data-own="pat"], .chip.pat { --own: var(--own-pat); --own-soft: var(--own-pat-soft); --own-ink: var(--own-pat-ink); }
.o-desk, .sheet[data-own="desk"], .chip.desk, .toast[data-own="desk"] { --own: var(--own-desk); --own-soft: var(--own-desk-soft); --own-ink: var(--own-desk-ink); }
.o-doc, .sheet[data-own="doc"], .chip.doc, .toast[data-own="doc"] { --own: var(--own-doc); --own-soft: var(--own-doc-soft); --own-ink: var(--own-doc-ink); }
.o-auto, .chip.auto { --own: var(--own-auto); --own-soft: var(--own-auto-soft); --own-ink: var(--own-auto-ink); }
.o-money { --own: var(--money); --own-soft: var(--money-soft); --own-ink: var(--money-ink); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@keyframes s-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
