:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e3e3dc;
  --accent: #0b6e99;
  --accent-soft: #e4f1f7;
  --brand: #0b4f6c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1d2126;
    --text: #e6e6e3;
    --muted: #9aa1a9;
    --line: #2e343b;
    --accent: #5bb8e0;
    --accent-soft: #1e3340;
    --brand: #0f2f40;
  }
  .content [style*="color"] { filter: brightness(1.6) saturate(.8); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.8 "Noto Naskh Arabic", "Amiri", "Segoe UI", Tahoma, "Arial", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

header.top { background: var(--brand); color: #fff; }
header.top .wrap { display: flex; align-items: center; min-height: 56px; }
.brand { color: #fff; font-size: 1.4rem; font-weight: 700; }
.brand small { font-size: .85rem; font-weight: 400; opacity: .8; margin-inline-start: .5rem; }

main { padding-bottom: 48px; }
h1 { font-size: 1.6rem; line-height: 1.4; margin: 12px 0 20px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }

.crumbs { font-size: .9rem; color: var(--muted); padding-top: 14px; }
.crumbs i { font-style: normal; margin: 0 .4rem; opacity: .6; }
.crumbs span { color: var(--text); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tabs a {
  padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: .95rem;
}
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }

.intro { color: var(--muted); margin-top: 0; }
.grades { columns: 300px; column-gap: 16px; }
.grade, .list {
  break-inside: avoid; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 18px; margin: 0 0 16px;
}
.grade ul, .list ul { list-style: none; margin: 0; padding: 0; }
.grade li, .list li { padding: 5px 0; border-top: 1px solid var(--line); }
.grade li:first-child, .list li:first-child { border-top: 0; }
.list .sub {
  display: inline-block; font-size: .85rem; margin-inline-start: .6rem;
  padding: 0 10px; border-radius: 999px; background: var(--accent-soft);
}

.dead { color: var(--muted); cursor: default; }
.list .sub.dead { background: transparent; border: 1px dashed var(--line); }
p.dead { padding: 12px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; }
.content iframe.pdf + .actions { margin-top: 8px; }
.actions { margin: 0 0 16px; }
.btn {
  display: inline-block; padding: 6px 16px; border-radius: 8px;
  background: var(--accent); color: #fff;
}
.btn:hover { text-decoration: none; opacity: .9; }

.content {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 24px; margin-bottom: 20px; overflow-wrap: anywhere; overflow-x: auto;
}
.content p { margin: .3em 0; }
.content img { max-width: 100%; height: auto; }
.content table { border-collapse: collapse; max-width: 100%; }
.content td, .content th { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.content iframe.pdf { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.content iframe.video { width: 100%; aspect-ratio: 16 / 9; border: 0; }

footer { color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.3rem; }
  .content { padding: 14px; }
}
