:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5b5f66;
  --border: #dcddd8;
  --accent: #1f5f8b;
  --check-bg: #fff2c4;
  --check-text: #5a4300;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1d1f22;
    --text: #e8e9ea;
    --muted: #a3a8af;
    --border: #33363b;
    --accent: #7bb6e0;
    --check-bg: #4a3b05;
    --check-text: #ffe08a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, "Noto Sans Arabic", "Segoe UI Arabic", Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

a { color: var(--accent); }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

nav.lang a { margin-inline-start: 12px; }
nav.lang a:first-child { margin-inline-start: 0; }

main { padding: 24px 0 40px; }

section.lang-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 20px 20px;
  margin-bottom: 24px;
}

section[dir="rtl"] { line-height: 1.8; }

h1 { font-size: 1.6rem; line-height: 1.3; margin: 16px 0 8px; }
h2 { font-size: 1.2rem; line-height: 1.35; margin: 28px 0 8px; }
h3 { font-size: 1.02rem; margin: 20px 0 6px; }

p, li { overflow-wrap: anywhere; }

ul, ol { padding-inline-start: 1.4rem; }

.meta { color: var(--muted); font-size: 0.92rem; }

.check {
  background: var(--check-bg);
  color: var(--check-text);
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
}

.table-scroll { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: start;
  vertical-align: top;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer.site a { margin-inline-end: 14px; }
