/* Shared by privacy-policy.html and terms.html. Mirrors the main page's tokens,
   nav and footer so the legal pages feel like part of the same site.
   Fonts are the same self-hosted files (../fonts/); no third-party requests. */

@font-face { font-family: 'Amiri'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/Amiri-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Amiri'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/Amiri-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 500; font-style: normal; font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 600 700; font-style: normal; font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('../fonts/inter-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-2: #262626;
  --border: #2d2d2d;
  --border-strong: #3a3a3a;
  --text: #ffffff;
  --text-body: #d2d2d2;
  --text-2: #a0a0a0;
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --gutter: 16px;
  --font-en: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
}
@media (min-width: 640px) { :root { --gutter: 28px; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg); color: var(--text-body);
  font-family: var(--font-en); font-size: 1rem; line-height: 1.7;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); font-size: 1.22rem; line-height: 1.9; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }

/* ===== Nav (same as the main page) ===== */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.brand-name { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="ar"] .brand-name { font-size: 1.2rem; }
.nav-end { display: flex; align-items: center; gap: 22px; }
.nav-links a { text-decoration: none; color: var(--text-2); font-size: 0.92rem; font-weight: 500; transition: color 0.2s; }
html[lang="ar"] .nav-links a { font-size: 1.05rem; }
.nav-links a:hover { color: var(--text); }
.lang-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 6px 14px; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color 0.2s;
}
.lang-btn:hover { border-color: var(--accent); }
.lang-btn svg { width: 15px; height: 15px; opacity: 0.8; }
.lang-btn[lang="ar"] { font-family: var(--font-ar); font-size: 1rem; padding-block: 3px; }
.lang-btn[lang="en"] { font-family: var(--font-en); }

/* ===== Document ===== */
html[lang="ar"] #docEn, html[lang="en"] #docAr { display: none; }
.legal { max-width: 760px; margin: 0 auto; padding: 108px var(--gutter) 72px; }
.doc h1 {
  color: var(--text); font-size: clamp(2rem, 6vw, 3rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.02em;
}
html[lang="ar"] .doc h1 { font-family: var(--font-ar); font-weight: 700; line-height: 1.5; letter-spacing: 0; }
.doc .updated { margin-top: 6px; color: var(--text-2); font-size: 0.9rem; }
html[lang="ar"] .doc .updated { font-size: 1.05rem; }

.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 6px; }
.toc-label {
  width: 100%; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
html[lang="ar"] .toc-label { font-size: 1rem; letter-spacing: 0; }
.toc a {
  text-decoration: none; color: var(--text-2); font-size: 0.84rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
  transition: border-color 0.2s, color 0.2s;
}
html[lang="ar"] .toc a { font-size: 1rem; padding-block: 1px; }
.toc a:hover { color: var(--text); border-color: var(--accent); }

.doc h2 {
  color: var(--accent); font-size: 1.3rem; font-weight: 700; line-height: 1.35;
  margin-top: 2.4rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}
html[lang="ar"] .doc h2 { font-family: var(--font-ar); font-size: 1.65rem; line-height: 1.5; }
.doc h3 { color: var(--text); font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.3rem; }
html[lang="ar"] .doc h3 { font-family: var(--font-ar); font-size: 1.35rem; font-weight: 700; }
/* long Android permission names (REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) must wrap on phones */
.doc { overflow-wrap: anywhere; }
.doc p { margin: 0.6rem 0; }
.doc ul { margin: 0.6rem 0; padding-inline-start: 1.4rem; }
.doc li { margin: 0.4rem 0; padding-inline-start: 0.2rem; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); font-weight: 600; }
html[lang="ar"] .doc strong { font-weight: 700; }
.doc p a, .doc li a { color: var(--accent); text-underline-offset: 3px; }
.doc hr { border: none; border-top: 1px solid var(--border); margin: 2.6rem 0 1.6rem; }
.doc .closing {
  background: var(--accent-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 16px; padding: 1.1rem 1.3rem; text-align: center; font-weight: 600;
}

/* ===== Footer (same as the main page) ===== */
footer { border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--text-2); font-size: 0.9rem; }
html[lang="ar"] footer { font-size: 1.02rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer nav a { text-decoration: none; transition: color 0.2s; }
footer nav a:hover, footer nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 639px) { footer .wrap { flex-direction: column; text-align: center; } }

/* ===== Print: plain black on white ===== */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .nav, .toc, footer { display: none; }
  .legal { padding: 0; max-width: none; }
  .doc h1, .doc h3, .doc strong { color: #000; }
  .doc h2 { color: #000; border-top-color: #bbb; }
  .doc .closing { background: none; color: #000; border-color: #999; }
}
