/* ==========================================================================
   PMS - Base reset & typography (RTL aware via logical properties)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-family: var(--font-arabic);
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* The one deliberate exception to "Zain everywhere": real code elements stay
   monospaced, because proportional letters break code alignment. */
code, pre, tt {
  font-family: Consolas, "Courier New", monospace;
}

::placeholder { color: var(--text-faint); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Utility helpers */
.u-hidden { display: none !important; }
/* for text a screen reader still needs but nobody should see (e.g. the app
   name next to a logo that already spells it out) */
.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.u-muted { color: var(--text-muted); }
.u-faint { color: var(--text-faint); }
.u-bold { font-weight: 600; }
.u-flex { display: flex; align-items: center; gap: var(--space-2); }
.u-grow { flex: 1; }
.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-clickable { cursor: pointer; }