/* Reset, typography and the browser surfaces that normally ship unstyled. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--action);
  accent-color: var(--action);
}
:lang(ur) { font-family: var(--font-urdu); line-height: 2.1; }
:lang(ur) h1, :lang(ur) h2, :lang(ur) h3, :lang(ur) .read { line-height: 2.2; letter-spacing: 0; }
/* Nastaliq's tall strokes need room: controls with a tight line box get more, so nothing is clipped. */
:lang(ur) :is(button, .btn, .tab, .chip, .stamp, .tag, .menu-item, .dx-link, .seg button, input, select, textarea, th) { line-height: 1.9; }
:lang(ur) :is(.data-table td, .data-table th, .table td, .table th, .stamp, .tag, .measure-key, .scale-caption, .measure-scale, .spine-head, .spine-label small,
  .dx-status, .cell-sub, .list-sub, .hint, .section-sub, small, kbd, .palette-item small) { font-family: var(--font-urdu-compact); line-height: 1.75; }
:lang(ur) .num, :lang(ur) input[type="number"], :lang(ur) .money, :lang(ur) .figure { font-family: var(--font-sans); }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: var(--text-xl); line-height: 1.2; }
h2 { font-size: var(--text-lg); line-height: 1.25; }
h3 { font-size: var(--text-md); line-height: 1.3; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

.num, td.num, th.num, .figure, .money {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
/* A figure is one unbreakable, left-to-right unit: "Rs" never wraps away from its digits, and Urdu text never reorders them. */
.money, .figure { white-space: nowrap; unicode-bidi: isolate; direction: ltr; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: var(--action-soft); color: var(--action-ink); }
::placeholder { color: var(--ink-3); opacity: 1; }

* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; border: 3px solid transparent; }

/* The Munshi mark and wordmark. */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 650; letter-spacing: -0.015em; }
.brand-mark { width: 26px; height: 26px; flex: none; }

.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* Reduced motion is gentler, not none: each component drops its movement and keeps a short fade. Only scrolling is global. */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
