/* ===== الأساس: إعادة الضبط، الطباعة، أسطح المتصفح ===== */
*, *::before, *::after { box-sizing: border-box; }

html { direction: rtl; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
  accent-color: var(--accent);
}

::selection { background: var(--selection); color: var(--ink); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: var(--line-tight); text-wrap: balance; }
h1 { font-size: var(--fs-20); }
h2 { font-size: var(--fs-15); }
h3 { font-size: var(--fs-14); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; line-height: var(--line-ui); }
button { cursor: pointer; }
svg { display: block; }
b, strong { font-weight: 700; }
[hidden] { display: none !important; }

.tnum, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.meta { font-size: var(--fs-12); color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* شريط التمرير */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.noscript { padding: 40px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .no-print { display: none !important; }
}
