/* Layout: a school timetable — a strip of days across the top, lesson times
   down the right edge, and the teachers of each slot side by side so the
   student picks one. Chalkboard green carries the brand; red means live. */
:root {
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --sunk: #F2F4F3;
  --ink: #1B2428;
  --muted: #5B6668;
  --line: #DCE2DF;
  --board: #0E5A46;
  --board-ink: #FFFFFF;
  --board-soft: #E9F2EE;
  --chalk: #B9770E;
  --chalk-soft: #FBF0D9;
  --live: #C3362B;
  --live-ink: #FFFFFF;
  --live-soft: #FBE4E1;
  --live-text: #B32D23;
  --ok: #2B7A4B;
  --ok-soft: #E2F2E8;
  --warn: #8A5A00;
  --warn-soft: #FFF1D2;
  --shadow: none;
  --font-display: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  --r: 8px;
  --r-sm: 6px;
  --wrap: 1120px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1513; --surface: #16201D; --sunk: #1C2824; --ink: #E5EDE9; --muted: #9DAEA8; --line: #2A3732;
    --board: #5BC39A; --board-ink: #0A1A13; --board-soft: #1A3129; --chalk: #E7B456; --chalk-soft: #33280F;
    --live: #FF6F61; --live-ink: #2A0703; --live-soft: #3B1C19; --live-text: #FF8A7E; --ok: #6BD39C; --ok-soft: #173023;
    --warn: #F0C26A; --warn-soft: #33290F; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1513; --surface: #16201D; --sunk: #1C2824; --ink: #E5EDE9; --muted: #9DAEA8; --line: #2A3732;
  --board: #5BC39A; --board-ink: #0A1A13; --board-soft: #1A3129; --chalk: #E7B456; --chalk-soft: #33280F;
  --live: #FF6F61; --live-ink: #2A0703; --live-soft: #3B1C19; --live-text: #FF8A7E; --ok: #6BD39C; --ok-soft: #173023;
  --warn: #F0C26A; --warn-soft: #33290F; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.7 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--board); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; text-wrap: balance; margin: 0; }
h1 { font: 800 clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem)/1.3 var(--font-display); }
h2 { font: 700 1.25rem/1.4 var(--font-display); }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--board); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--board); color: var(--board-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.loading { padding-block: 48px; color: var(--muted); text-align: center; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: var(--wrap); margin-inline: auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 700 1.2rem/1 var(--font-display); }
.brand-mark { width: 40px; height: auto; flex: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.auth { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) {
  .nav { order: 3; width: 100%; justify-content: space-between; }
  .nav a { flex: 1; text-align: center; padding: 6px 4px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--board); color: var(--board-ink); border-color: var(--board); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--board); }
.btn-live { background: var(--live); color: var(--live-ink); border-color: var(--live); }
.btn-live:hover { filter: brightness(1.06); border-color: var(--live); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--board); }
.btn-ghost:hover { background: var(--board-soft); border-color: transparent; }
.btn-danger { color: var(--live); }
.btn-danger.arm { background: var(--live); color: var(--live-ink); border-color: var(--live); }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: .875rem; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- banners & toasts ---------- */
.banner { padding: 8px var(--gutter); text-align: center; font-size: .92rem; border-bottom: 1px solid var(--line); }
.banner-demo { background: var(--chalk-soft); color: var(--warn); }
.banner-demo button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0 4px; }
.banner-notice { background: var(--board-soft); color: var(--ink); }
.toasts { position: fixed; inset-inline: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; z-index: 60; pointer-events: none; padding-inline: 16px; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 520px; animation: pop .2s ease-out; }
.toast.err { background: var(--live); color: var(--live-ink); }
@keyframes pop { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } * { scroll-behavior: auto !important; } }

/* ---------- home ---------- */
.hero { padding-block: 28px 8px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); align-items: center; }
.hero-text { display: grid; gap: 10px; min-width: 0; justify-items: start; }
.motto { font: 700 1.2rem/1.5 "Amiri", serif; color: var(--board); background: var(--board-soft); padding: 2px 14px; border-radius: 999px; }
.hadith-note { font: 700 1.1rem/1.5 "Amiri", serif; color: var(--board); }
.hero p { color: var(--muted); max-width: 60ch; }
.hadith {
  margin: 0; padding: 22px 22px 18px; border-radius: 16px; background: var(--board-soft);
  border: 1px solid color-mix(in srgb, var(--board) 35%, transparent);
  box-shadow: inset 0 0 0 6px var(--board-soft), inset 0 0 0 7px color-mix(in srgb, var(--board) 25%, transparent);
  display: grid; gap: 12px; justify-items: center; text-align: center;
}
.hadith .orn { color: var(--chalk); font-size: 1.1rem; letter-spacing: .5em; line-height: 1; } /* rtl-ok: centring, LTR value or ornament */
.hadith blockquote { margin: 0; font: 700 1.45rem/2 "Amiri", "Traditional Arabic", serif; color: var(--ink); text-wrap: balance; }
.hadith mark { background: none; color: var(--board); }
.hadith figcaption { font: 400 1rem/1.4 "Amiri", serif; color: var(--muted); }
@media (max-width: 820px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.mine { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--board-soft); }
.mine b { font-family: var(--font-display); font-size: 1.1rem; }
.section { padding-block: 20px; display: grid; gap: 14px; }
.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-head .muted { font-size: .9rem; }
.stages { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; align-content: start; }
.stage h2 { font-size: 1.1rem; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.grade-chip {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  text-decoration: none; font-weight: 600; line-height: 1.35;
}
.grade-chip:hover { border-color: var(--board); background: var(--board-soft); }
.grade-chip.cur { border-color: var(--board); box-shadow: inset 0 0 0 1px var(--board); }
.tag-exam { font-size: .72rem; font-weight: 700; color: var(--warn); }
.cta { display: grid; gap: 10px; padding: 20px; border-radius: var(--r); border: 1px dashed var(--board); background: var(--surface); }
.cta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.steps3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: s; }
.steps3 li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; }
.steps3 { padding: 0; margin: 0; }
.steps3 li b::before { counter-increment: s; content: counter(s) ". "; color: var(--board); }

/* ---------- live strip ---------- */
.live-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.dot-live { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

/* ---------- grade page ---------- */
.page-head { padding-block: 22px 6px; display: grid; gap: 8px; }
.crumbs { font-size: .9rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill-exam { background: var(--chalk-soft); color: var(--warn); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--live-soft); color: var(--live); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--board); }

.days { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 8px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.day {
  flex: none; width: 64px; display: grid; justify-items: center; gap: 0; padding: 8px 4px 6px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; scroll-snap-align: start; line-height: 1.3;
}
.day .wd { font-size: .78rem; color: var(--muted); }
.day .dn { font: 700 1.3rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.day .ct { font-size: .72rem; color: var(--muted); min-height: 1.2em; }
.day.has .ct { color: var(--board); font-weight: 700; }
.day[aria-pressed="true"] { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.day[aria-pressed="true"] .wd, .day[aria-pressed="true"] .ct { color: var(--board-ink); }
.day.today:not([aria-pressed="true"]) { border-color: var(--board); }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-block: 4px 10px; }
.chip { flex: none; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.day-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-block: 6px 2px; }
.day-title h2 { font-size: 1.15rem; }

.slots { display: grid; gap: 0; padding-bottom: 24px; }
.slot { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding-block: 14px; border-top: 1px solid var(--line); }
.slot:first-child { border-top: 0; }
.slot-time { display: grid; align-content: start; justify-items: start; gap: 0; position: sticky; top: 76px; align-self: start; }
.slot-time b { font: 700 1.35rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.slot-time span { font-size: .85rem; color: var(--muted); }
.slot-time small { margin-top: 6px; font-size: .75rem; color: var(--board); font-weight: 700; background: var(--board-soft); padding: 1px 8px; border-radius: 999px; }
.slot-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
@media (max-width: 520px) {
  .slot { grid-template-columns: 1fr; gap: 8px; }
  .slot-time { position: static; display: flex; align-items: baseline; gap: 8px; }
  .slot-time small { margin-top: 0; }
}

/* ---------- session card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); min-width: 0;
}
.card.s-live { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); }
.card.s-cancelled { opacity: .62; }
.card.s-cancelled h3 { text-decoration: line-through; }
.card-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.subj { font-size: .82rem; font-weight: 700; color: var(--board); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card h3 { overflow-wrap: anywhere; }
.who { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover span { text-decoration: underline; }
.meta { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.card .act .btn { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.badge.b-live { background: var(--live); color: var(--live-ink); }
.badge.b-live .dot-live { background: var(--live-ink); }
.badge.b-soon { background: var(--live-soft); color: var(--live-text); }
.badge.b-upcoming { background: var(--board-soft); color: var(--board); }
.badge.b-replay, .badge.b-recorded { background: var(--ok-soft); color: var(--ok); }
.badge.b-cancelled { background: var(--sunk); color: var(--muted); }
.av { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; background: var(--board-soft); color: var(--board); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; overflow: hidden; }
.av-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.av-md { width: 40px; height: 40px; font-size: 1rem; }

.empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* ---------- recordings ---------- */
.vids { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); padding-block: 8px 24px; }
.vid { display: grid; gap: 6px; text-decoration: none; color: var(--ink); min-width: 0; }
.thumb { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--board); color: var(--board-ink); display: grid; place-items: center; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { font: 700 1.05rem/1.4 var(--font-display); padding: 12px; text-align: center; }
.thumb .play { position: absolute; inset-inline-start: 8px; bottom: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 6px; }
.vid h3 { font-size: .98rem; overflow-wrap: anywhere; }
.vid:hover h3 { text-decoration: underline; }

/* ---------- session page ---------- */
.sess { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; padding-block: 18px 32px; align-items: start; }
@media (max-width: 900px) { .sess { grid-template-columns: minmax(0, 1fr); } }
.player { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; background: #0B1210; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player .ph { color: #E5EDE9; text-align: center; padding: 20px; display: grid; gap: 10px; justify-items: center; }
.player .ph b { font: 700 1.25rem/1.4 var(--font-display); }
.player .ph .big { font: 700 2rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.player .ph .btn { color: var(--ink); }
.desc { white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.side { display: grid; gap: 14px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; min-width: 0; }
.box h2 { font-size: 1.05rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.alts { display: grid; gap: 8px; }
.alt { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); padding: 8px; border-radius: 10px; border: 1px solid var(--line); min-width: 0; }
.alt:hover { border-color: var(--board); }
.alt div { min-width: 0; }
.alt b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt span { font-size: .8rem; color: var(--muted); }
details.report summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
details.report[open] summary { margin-bottom: 10px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; max-width: 720px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .lbl { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .84rem; color: var(--muted); }
.field .err-msg { font-size: .84rem; color: var(--live); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.input:focus { outline: 2px solid var(--board); outline-offset: 0; border-color: var(--board); }
.input[aria-invalid="true"] { border-color: var(--live); }
input[type="url"].input, input[type="email"].input { direction: ltr; text-align: right; } /* rtl-ok: centring, LTR value or ornament */
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; flex: 1 1 200px; }
.seg input { accent-color: var(--board); width: 18px; height: 18px; }
.seg label:has(input:checked) { border-color: var(--board); background: var(--board-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { accent-color: var(--board); width: 20px; height: 20px; margin-top: 4px; flex: none; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--board-soft); font-size: .92rem; display: grid; gap: 4px; }
.note.warn { background: var(--warn-soft); color: var(--ink); }
.note.bad { background: var(--live-soft); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-block: 22px 8px; }
.dash-head .who-big { display: grid; gap: 2px; min-width: 0; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
}
.item .when { display: grid; line-height: 1.3; font-variant-numeric: tabular-nums; }
.item .when b { font: 700 1rem/1.3 var(--font-display); }
.item .when span { font-size: .8rem; color: var(--muted); }
.item .what { display: grid; gap: 2px; min-width: 0; }
.item .what b { overflow-wrap: anywhere; }
.item .what .row { font-size: .82rem; color: var(--muted); gap: 6px; }
.item .tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.item.cancelled { opacity: .65; }
@media (max-width: 680px) {
  .item { grid-template-columns: 76px minmax(0, 1fr); }
  .item .tools { grid-column: 1 / -1; justify-content: flex-start; }
}
.linkflag { font-weight: 700; }
.linkflag.ok { color: var(--ok); }
.linkflag.no { color: var(--warn); }

/* ---------- teacher / directory ---------- */
.prof { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding-block: 22px 6px; }
.prof .info { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.tgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); padding-block: 12px 24px; }
.tcard { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.tcard:hover { border-color: var(--board); }
.tcard div { min-width: 0; display: grid; }
.tcard b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard span { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- admin ---------- */
.atable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.atable { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.atable th, .atable td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.atable th { font-size: .8rem; color: var(--muted); font-weight: 700; background: var(--sunk); }
.atable tr:last-child td { border-bottom: 0; }
.atable .email { direction: ltr; unicode-bidi: plaintext; font-size: .85rem; }

/* ---------- guide / prose ---------- */
.prose { max-width: 72ch; display: grid; gap: 14px; padding-block: 8px 32px; }
.prose h2 { margin-top: 12px; }
.prose ol, .prose ul { margin: 0; padding-inline-start: 1.4em; display: grid; gap: 6px; }
.prose code, .kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; background: var(--sunk); padding: 1px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.path { display: inline; direction: ltr; unicode-bidi: isolate; font-weight: 700; }
.sign-in { max-width: 520px; margin: 32px auto; text-align: center; justify-items: center; }
.g-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); min-height: 48px; padding-inline: 20px; font-weight: 700; }
.g-btn svg { width: 20px; height: 20px; }

.foot { padding-block: 24px 36px; border-top: 1px solid var(--line); margin-top: 24px; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; }
.foot a { color: var(--muted); }
.email { direction: ltr; unicode-bidi: plaintext; }
h1[tabindex="-1"]:focus, #view:focus { outline: none; }
/* الشعار فوق الخلفية الداكنة: لوحة فاتحة صغيرة خلفه حتى يبقى الأخضر الداكن واضحاً */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { background: #F4F6F1; border-radius: 8px; padding: 3px; } }
:root[data-theme="dark"] .brand-mark { background: #F4F6F1; border-radius: 8px; padding: 3px; }

/* ---------- استوديو التسجيل ---------- */
.studio { display: grid; gap: 14px; max-width: 760px; padding-block: 8px 32px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps > li h2 { font-size: 1.1rem; }
ol.plain, ul.plain { margin: 0; padding-inline-start: 1.3em; display: grid; gap: 4px; }
.meter { height: 10px; border-radius: 999px; background: var(--sunk); overflow: hidden; max-width: 420px; }
.meter span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .08s linear; }
.btn-lg { min-height: 52px; padding-inline: 24px; font-size: 1.06rem; border-radius: 12px; }
.rec-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--live); flex: none; animation: recpulse 1.2s ease-in-out infinite; }
.btn .rec-dot { width: 12px; height: 12px; background: currentColor; animation: none; }
.rec-panel.paused .rec-dot { animation: none; background: var(--muted); }
.rec-time { margin-inline-start: auto; font: 800 2.2rem/1 var(--font-display); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
@keyframes recpulse { 50% { opacity: .3; } }
.st-video { width: 100%; aspect-ratio: 16 / 9; background: #0B1210; border-radius: var(--r); display: block; }
.recbar {
  position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: block;
  max-width: 560px; margin-inline: auto; padding: 10px 16px; border-radius: 12px; background: var(--live); color: var(--live-ink);
  font-weight: 700; text-align: center; text-decoration: none; box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
details.more { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px; display: grid; gap: 10px; }
details.more summary { cursor: pointer; font-weight: 700; }
details.more[open] summary { margin-bottom: 8px; }

/* ---------- مكتبة الدروس: المواد، البحث، الوحدات ---------- */
a.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
a.chip:hover, button.chip:hover { border-color: var(--muted); }
.chip[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] .muted, .chip[aria-current="page"] .muted { color: inherit; opacity: .7; }
.search { position: relative; padding-block: 4px 6px; }
.search .input { padding-inline-start: 40px; min-height: 46px; border-radius: 999px; }
.search::before {
  content: ""; position: absolute; inset-inline-start: 15px; top: 50%; width: 15px; height: 15px; margin-top: -9px;
  border: 2px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.search::after {
  content: ""; position: absolute; inset-inline-start: 27px; top: 50%; width: 2px; height: 7px; margin-top: 3px;
  background: var(--muted); transform: rotate(-45deg); pointer-events: none;
}
#sres:not(:empty) { padding-block: 6px 20px; display: grid; gap: 10px; }
.dipl { margin-block: 6px 4px; border-color: color-mix(in srgb, var(--chalk) 45%, var(--line)); background: var(--chalk-soft); }
.dipl h2 { font-size: 1.02rem; color: var(--warn); }
.dipl .filters { padding-block: 0; flex-wrap: wrap; }
.req { margin-block: 8px 24px; }
.req summary { cursor: pointer; list-style-position: inside; }
.req[open] summary { margin-bottom: 12px; }
.cont {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--r); background: var(--board); color: var(--board-ink);
  text-decoration: none; margin-block: 6px 10px; position: relative; padding-inline-end: 44px;
}
.cont::after { content: "›"; position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-52%); font: 700 1.6rem/1 var(--font-display); }
.cont b { overflow-wrap: anywhere; }
.cont span { font-size: .86rem; opacity: .85; }
.cont:hover { filter: brightness(1.06); }
details.unit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
details.unit > summary {
  cursor: pointer; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; list-style: none;
}
details.unit > summary::-webkit-details-marker { display: none; }
details.unit > summary::before { content: "◂"; color: var(--board); font-size: .85rem; transition: transform .15s; }
details.unit[open] > summary::before { transform: rotate(-90deg); }
details.unit > summary b { font-family: var(--font-display); }
details.unit[open] > summary { border-bottom: 1px solid var(--line); }
details.unit .lrows { border: 0; border-radius: 0; }
.lrows { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
details.unit .lrows { margin-bottom: 0; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); min-width: 0; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--board-soft); }
.lr-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--board-soft); position: relative; }
.lr-ic::after {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -7px 0 0 -4px; /* rtl-ok: centring, LTR value or ornament */
  border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--board);
}
.lrow.seen .lr-ic { background: var(--ok-soft); }
.lrow.seen .lr-ic::after { border: solid var(--ok); border-width: 0 3px 3px 0; width: 8px; height: 14px; margin: -9px 0 0 -4px; transform: rotate(45deg); }
.lr-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.lr-main b { overflow-wrap: anywhere; font-weight: 700; }
.lr-main > span:not(.prog) { font-size: .84rem; color: var(--muted); }
.lr-main .prog { margin-top: 4px; max-width: 220px; }

/* شريط التقدّم في المشاهدة */
.prog { display: block; height: 4px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.prog::after { content: ""; display: block; height: 100%; width: var(--p, 0%); background: var(--live); border-radius: inherit; }
.thumb .prog { position: absolute; inset-inline: 0; bottom: 0; border-radius: 0; background: rgba(0, 0, 0, .35); }
.thumb .prog::after { border-radius: 0; }
.vid.seen .thumb img { opacity: .78; }
.vid.seen .play { background: var(--ok); color: var(--board-ink); }
.thumb .play:has(+ .prog) { bottom: 10px; }

/* ---------- صفحة الدرس: المشغّل بالضغط، الشكر، السابق والتالي ---------- */
.facade { all: unset; position: relative; display: block; width: 100%; height: 100%; cursor: pointer; background: #0B1210; }
.facade img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.facade:hover img { opacity: 1; }
.facade:focus-visible { outline: 3px solid var(--chalk); outline-offset: -3px; }
.play-disc {
  position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; /* rtl-ok: centring, LTR value or ornament */
  background: rgba(195, 54, 43, .92); box-shadow: 0 4px 18px rgba(0, 0, 0, .35); transition: transform .15s;
}
.play-disc::after {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -14px 0 0 -9px; /* rtl-ok: centring, LTR value or ornament */
  border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent #fff;
}
.facade:hover .play-disc { transform: scale(1.06); }
.play-hint {
  position: absolute; inset-inline: 0; bottom: 12px; margin-inline: auto; width: max-content; max-width: 90%;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: .85rem; font-weight: 600; padding: 3px 12px; border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) { .play-disc, details.unit > summary::before { transition: none; } }
#watchrow:empty, #thanks:empty, #seq:empty { display: none; }
[data-seen][aria-pressed="true"] { color: var(--ok); background: var(--ok-soft); }
.thanks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.thanks .btn[aria-pressed="true"] { opacity: 1; color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.seq { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seq .btn { flex-direction: column; align-items: flex-start; gap: 0; white-space: normal; text-align: start; height: auto; padding: 10px 14px; min-width: 0; }
.seq .btn:last-child { align-items: flex-end; text-align: end; }
.seq .btn b { overflow-wrap: anywhere; font-size: .95rem; }
#seq .small { margin-top: 8px; }
@media (max-width: 480px) { .seq { grid-template-columns: 1fr; } .seq .btn:last-child { align-items: flex-start; text-align: start; } .seq > span:empty { display: none; } }
/* على الهاتف: صورة صغيرة بجانب العنوان حتى تقصر القوائم الطويلة */
@media (max-width: 560px) {
  .vids { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .vid { grid-template-columns: 132px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-content: start; }
  .vid > .thumb { grid-row: 1 / span 4; align-self: start; border-radius: 8px; }
  .vid > :not(.thumb) { grid-column: 2; }
  .vid h3 { font-size: .94rem; }
  .vid .meta { font-size: .8rem; }
  .thumb .ph { font-size: .82rem; padding: 6px; }
  .thumb .play { inset-inline-start: 4px; bottom: 4px; font-size: .7rem; padding: 1px 6px; }
  .thumb .play:has(+ .prog) { bottom: 8px; }
}

/* ---------- المعلم: مكان الدرس، الأثر، الطلبات ---------- */
fieldset.place { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; background: var(--paper); }
fieldset.place legend { font-weight: 700; padding-inline: 6px; }
fieldset.place .hint { margin-top: -6px; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 0; }
.tile b { font: 800 1.6rem/1.2 var(--font-display); color: var(--board); }
.tile span { font-size: .86rem; color: var(--muted); }
.cert-box { border-color: color-mix(in srgb, var(--chalk) 45%, var(--line)); }
.cert-box h2 { color: var(--warn); }
.cert-meter { max-width: none; }
.cert-meter span { background: var(--chalk); }
.rs:empty { display: none; }
.req-item .when b { font-size: 1.3rem; color: var(--board); }
.seg-sm label { flex: 0 0 auto; padding: 6px 12px; }

/* ---------- شهادة الشكر ---------- */
.cert-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 18px 12px; }
.cert {
  --gold: #A8730B; --deep: #1D5C4A;
  background: #FFFDF7; color: #17252A; border-radius: 6px; padding: 14px; aspect-ratio: 297 / 210; width: 100%;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .12); container-type: inline-size; overflow: hidden; position: relative;
}
.cert-stamp {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); z-index: 2; pointer-events: none; /* rtl-ok: centring, LTR value or ornament */
  font: 800 12cqw/1 var(--font-display); color: rgba(195, 54, 43, .55); border: .8cqw solid rgba(195, 54, 43, .55); border-radius: 2cqw; padding: 1cqw 4cqw;
}
.cert-in {
  height: calc(100% - 20px); border: 2px solid var(--gold); outline: 6px double var(--deep); outline-offset: 4px; border-radius: 4px;
  display: grid; align-content: space-evenly; justify-items: center; text-align: center;
  padding: 3.2cqw 5cqw 2.4cqw; gap: .8cqw; margin: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(29, 92, 74, .05), transparent 60%);
}
.cert-head { display: flex; align-items: center; gap: 1.2cqw; }
.cert-head img { width: 5.5cqw; height: auto; }
.cert-head div { display: grid; text-align: start; line-height: 1.3; }
.cert-head b { font: 800 2.1cqw/1.3 var(--font-display); color: var(--deep); }
.cert-head span { font-size: 1.25cqw; color: #56676A; }
.cert h1 { font: 700 4.6cqw/1.3 "Amiri", serif; color: var(--deep); margin-top: .6cqw; }
.cert-lead { font-size: 1.8cqw; color: #3B4A4E; }
.cert-name { font: 700 4cqw/1.3 "Amiri", serif; color: var(--gold); border-bottom: 1px solid rgba(168, 115, 11, .4); padding-inline: 3cqw; }
.cert-body { font-size: 1.75cqw; line-height: 1.9; max-width: 62cqw; color: #2A3A3E; }
.cert-motto { font: 700 2.1cqw/1.4 "Amiri", serif; color: var(--deep); }
.cert-foot { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 2cqw; font-size: 1.25cqw; }
.cert-foot > div { display: grid; gap: .1cqw; min-width: 0; }
.cert-foot > div:first-child { text-align: start; }
.cert-foot > div:last-child { justify-items: end; }
.cert-foot span { color: #56676A; }
.cert-foot b { font-weight: 700; }
.cert-level { width: 9cqw; height: 9cqw; border-radius: 50%; border: 2px solid var(--gold); background: #FBF0D9; display: grid !important; place-content: center; text-align: center; }
.cert-level b { font: 800 3cqw/1 var(--font-display); color: var(--gold); }
.cert-level span { font-size: 1.2cqw; color: var(--gold) !important; }
.cert-code { direction: ltr; unicode-bidi: isolate; letter-spacing: .08em; font-family: ui-monospace, Menlo, Consolas, monospace; } /* rtl-ok: centring, LTR value or ornament */
.cert-url { direction: ltr; unicode-bidi: isolate; font-size: 1cqw; }
.cert.void .cert-in { filter: grayscale(1); opacity: .55; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; }
  .topbar, .banner, .foot, .no-print, .toasts, .recbar, .skip { display: none !important; }
  .wrap, main, #view { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .cert { box-shadow: none; border-radius: 0; width: 297mm; height: 210mm; aspect-ratio: auto; padding: 8mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
a.tile { text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--board); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* الشهادة على الهاتف: نص مقروء بدل نسخة مصغّرة من صفحة A4 (الطباعة لا تتأثر) */
@media screen and (max-width: 700px) {
  .cert { aspect-ratio: auto; padding: 8px; }
  .cert-in { height: auto; padding: 22px 16px 18px; gap: 10px; margin: 8px; outline-width: 4px; }
  .cert-head img { width: 44px; }
  .cert-head b { font-size: 1.05rem; }
  .cert-head span { font-size: .78rem; }
  .cert h1 { font-size: 1.7rem; }
  .cert-lead, .cert-body { font-size: .98rem; max-width: none; }
  .cert-name { font-size: 1.6rem; }
  .cert-motto { font-size: 1.05rem; }
  .cert-foot { font-size: .82rem; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 12px; }
  .cert-foot > div:first-child, .cert-foot > div:last-child { text-align: center; justify-items: center; }
  .cert-level { width: 72px; height: 72px; }
  .cert-level b { font-size: 1.5rem; }
  .cert-level span { font-size: .75rem; }
  .cert-url { font-size: .72rem; overflow-wrap: anywhere; }
  .cert-stamp { font-size: 3.2rem; border-width: 4px; padding: 4px 18px; }
}

/* ---------- المهارات ---------- */
.skill-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.skill-chip { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.skill-chip:hover, .skill-card:hover, .pcard:hover { border-color: var(--board); background: var(--board-soft); }
.sk-ic { font-size: 1.35rem; line-height: 1; flex: none; }
.skill-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); padding-block: 12px 8px; }
.skill-card { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; min-width: 0; }
.skill-card .sk-ic { font-size: 1.8rem; }
.skill-card .pill { justify-self: start; }
.note.safety { margin-block: 10px 4px; border-inline-start: 4px solid var(--board); }

/* ---------- المسارات ودرس الأسبوع ---------- */
.pcards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.pcard { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; min-width: 0; }
.pcard .pill { justify-self: start; background: var(--board-soft); color: var(--board); }
.pcard b { overflow-wrap: anywhere; }
.pcard .prog { margin-top: 4px; }
.path-progress .meter { max-width: none; }
.feat { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border-radius: var(--r);
  background: var(--chalk-soft); border: 1px solid color-mix(in srgb, var(--chalk) 45%, var(--line)); color: var(--ink); text-decoration: none; }
.feat:hover h2 { text-decoration: underline; }
.feat-text { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.feat-text h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
@media (max-width: 560px) { .feat { grid-template-columns: minmax(0, 1fr); } }

/* ---------- الثقة: شارة موثّق، الدعوة، الترشيح ---------- */
.verified { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); vertical-align: middle; white-space: nowrap; }
h1 .verified { font-size: .8rem; }
.vouch { font-size: .86rem; color: var(--board); font-weight: 600; }
.prof-tiles { padding-bottom: 8px; }
.tile-wide { grid-column: span 2; }
.tile-wide .areas { font: 600 .95rem/1.6 var(--font-body); color: var(--ink); }
@media (max-width: 480px) { .tile-wide { grid-column: auto; } }
.badge-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--live);
  color: var(--live-ink); font-size: .72rem; font-weight: 800; line-height: 1; }
.month-note { padding: 10px 14px; border-radius: 10px; background: var(--ok-soft); color: var(--ink); }
.reject-note { color: var(--live-text); }
.nominate .row .input { min-width: 0; }
.join { max-width: 600px; }
.join .pill { justify-self: center; }

/* ---------- اختبر نفسك والملفات ---------- */
.quiz { gap: 12px; }
.qz { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 8px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.qz legend { font-weight: 700; padding-inline: 4px; overflow-wrap: anywhere; }
.qz .qz-o { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.qz .qz-o span { min-width: 0; overflow-wrap: anywhere; }
.qz .qz-o .qz-dot { width: 16px; height: 16px; flex: none; border: 2px solid var(--board); border-radius: 50%; }
.qz .qz-o[aria-pressed="true"] .qz-dot { background: var(--board); box-shadow: inset 0 0 0 3px var(--surface); }
.qz .qz-o[aria-disabled="true"] { cursor: default; }
.qz .qz-o:focus-visible { outline: 3px solid var(--board); outline-offset: 1px; }
.qz-r:focus { outline: none; }
.qz .qz-o.right { border-color: var(--ok); background: var(--ok-soft); }
.qz .qz-o.wrong { border-color: var(--live); background: var(--live-soft); }
.qz-r { font-size: .88rem; font-weight: 700; min-height: 1.2em; }
.qz-score { font-weight: 700; color: var(--board); }
.files { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.files a { font-weight: 600; overflow-wrap: anywhere; }
.qz-ed { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; display: grid; gap: 8px; min-width: 0; }
.qz-ed legend { font-weight: 700; padding-inline: 4px; }
.qz-opts { display: grid; gap: 6px; }
.qz-opt { display: flex; align-items: center; gap: 8px; }
.qz-opt input[type=radio] { accent-color: var(--ok); width: 20px; height: 20px; flex: none; }
.fl-row { margin-bottom: 8px; }
.fl-row .fl-u { direction: ltr; text-align: right; } /* rtl-ok: centring, LTR value or ornament */

/* ---------- قوائم مرقّمة ومحرر المسار ---------- */
.lr-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--board-soft); color: var(--board); display: grid; place-items: center;
  font: 800 .95rem/1 var(--font-display); }
.lrow.seen .lr-num { background: var(--ok-soft); color: var(--ok); }
.pick-row { cursor: default; }
.pick-row:hover { background: transparent; }
.pick-row .row { flex-wrap: nowrap; }
@media (max-width: 400px) { .pick-row { flex-wrap: wrap; } .pick-row .lr-main { flex-basis: calc(100% - 52px); } .pick-row .row { margin-inline-start: auto; } }
.pick-list { display: grid; gap: 6px; margin-top: 8px; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.pick > span { display: grid; min-width: 0; }
.pick b { overflow-wrap: anywhere; }
@media (max-width: 560px) { .nav a { font-size: .88rem; padding-inline: 2px; } }

/* ===== تطوّع بالشرح ===== */
.teach-head h1 { max-width: 860px; }
.teach-steps { margin: 4px 0 18px; }
.wa-btn { background: #1F8F55; border-color: #1F8F55; }
.wa-btn:hover { background: #18774A; border-color: #18774A; }
.prose-list { padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.8; }

/* ===== أدوات للمعلم والطالب ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tool-card { display: grid; gap: 8px; align-content: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.tool-card:hover { border-color: var(--board); background: var(--board-soft); }
.tool-card:focus-visible { outline: 3px solid var(--board); outline-offset: 2px; }
.tool-card b { font-size: 1.08rem; overflow-wrap: anywhere; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-open { font-weight: 700; color: var(--board); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.subj-tools h2 { font-size: 1.15rem; }

/* ===== مساعد المنصة ===== */
.bot-btn { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--board); color: var(--board-ink); font: 700 .95rem var(--font-body); box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; }
.bot-btn:focus-visible { outline: 3px solid var(--chalk); outline-offset: 2px; }
.bot { position: fixed; inset-inline-end: 16px; bottom: 72px; z-index: 61; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.25); overflow: hidden; }
.bot[hidden] { display: none; }
.bot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 14px; background: var(--board); color: var(--board-ink); }
.bot-head .btn { color: inherit; }
.bot-log { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.bot-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; line-height: 1.7; font-size: .95rem; overflow-wrap: anywhere; }
.bot-msg.from-bot { justify-self: start; background: var(--sunk); border-start-start-radius: 4px; }
.bot-msg.from-me { justify-self: end; background: var(--board-soft); border-start-end-radius: 4px; }
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot-chips .chip { font-size: .85rem; text-align: start; white-space: normal; }
.bot-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-weight: 700; }
.bot-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.bot-form .input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .bot-btn { bottom: 12px; inset-inline-end: 12px; } }
@media print { .bot-btn, .bot { display: none !important; } }
.on-studio .bot-btn, .on-studio .bot { display: none !important; }

/* ===== مواعيد الدروس: القادم و«يُعرض الآن» ===== */
.badge.b-premiere { background: var(--chalk); color: #fff; }
.badge.b-premiere .dot-live { background: #fff; }
.card.s-premiere { border-color: color-mix(in srgb, var(--chalk) 60%, var(--line)); }
.card.s-upcoming .when-at, .card.s-premiere .when-at { color: var(--board); font-weight: 700; }
.note.live-note { background: var(--chalk-soft); }
.player .ph-up .up-when { font-weight: 700; }
.player .ph-up .up-btns { justify-content: center; }
.player .ph-up .small { opacity: .8; }
.up-strip { margin: 14px 0 6px; display: grid; gap: 8px; }
.up-strip h2 { font-size: 1.05rem; }

/* ===== الإرسال للمنصة وموعد العرض ===== */
.src-pick, .when { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 14px; margin: 0; display: grid; gap: 8px; min-width: 0; background: var(--surface); }
.src-pick legend, .when legend { font-weight: 700; padding-inline: 6px; }
.src-opt, .when-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-width: 0; }
.src-opt:has(input:checked), .when-opt:has(input:checked) { border-color: var(--board); background: var(--board-soft); }
.src-opt input, .when-opt input { accent-color: var(--board); width: 20px; height: 20px; flex: none; margin-top: 3px; }
.src-opt span, .when-opt span { display: grid; gap: 2px; min-width: 0; }
.src-opt small, .when-opt small { color: var(--muted); font-size: .86rem; line-height: 1.6; }
.when-at { margin-top: 2px; }
.when-hint b { color: var(--board); }
.warn-t { color: var(--warn); font-weight: 700; }
.consent { margin-top: 4px; }
.up-prog { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--board-soft); }
.up-prog .bar { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.up-prog .bar span { display: block; height: 100%; width: 0; background: var(--board); transition: width .3s; }
.send-box { display: grid; gap: 10px; border-color: var(--board); }
.send-box h2 { font-size: 1.15rem; }
.own-ch > summary { font-weight: 700; }
.own-ch .steps { margin-top: 10px; }
.note.ok-note { background: var(--ok-soft); }

/* ===== الإدارة: الرفع على القناة ===== */
.up-item { display: grid; gap: 8px; margin-bottom: 12px; }
.up-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.up-when { font-size: .92rem; }
.up-when.soon b { color: var(--warn); }
.up-when.late { color: var(--live-text); font-weight: 700; }
.up-steps { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.up-steps li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.up-pub .input { flex: 1 1 220px; min-width: 0; }

/* v5.3: الدخول إلى حصة Meet أو Zoom أو Teams */
.player .ph-join .btn-live { color: var(--live-ink); }
.player .ph-join .small { opacity: .85; max-width: 46ch; }
.live-rec { border-color: var(--live); }


/* =====================================================================
   v5.3: مظهر رسمي بسيط — صفحات بيضاء، شريط علوي بلون المنصة، زوايا أقل
   استدارة، عناوين أقسام بخط جانبي، وأزرار واضحة
   ===================================================================== */
h1 { font-weight: 700; }
.topbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 4px solid var(--board); }
.brand { color: var(--board); }
.nav a { border-radius: 6px; }
.nav a[aria-current="page"] { color: var(--board); background: var(--board-soft); }
.btn { border-radius: 6px; min-height: 44px; font-weight: 600; }
.btn-sm { border-radius: 6px; }
.pill, .badge { border-radius: 4px; }
.chip { border-radius: 6px; }
.card, .stage, .box, .tile, .pcard, .skill-card, .empty, .item, .src-pick, .when { box-shadow: none; }
.section-head h2, .section > h2 { padding-inline-start: 10px; border-inline-start: 4px solid var(--board); line-height: 1.3; }
.section { padding-block: 18px; }

/* الصفحة الرئيسية */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: 26px 6px; }
.hero h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); }
.hero p { color: var(--muted); }
.stage { background: var(--sunk); border-color: transparent; }
.stage h3 { font-size: 1rem; color: var(--muted); font-weight: 600; }
.grade-chip { background: var(--surface); border-radius: 6px; min-height: 48px; font-size: 1.02rem; }
.band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block: 18px 6px;
  padding: 16px 18px; border-radius: var(--r); background: var(--board); color: var(--board-ink); }
.band > div:not(.row):not(.vol-faces) { display: grid; gap: 2px; }
.band b { font-size: 1.1rem; }
.band .btn-primary { background: var(--board-ink); color: var(--board); border-color: var(--board-ink); }
.feat { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); padding: 10px; background: var(--surface); border: 1px solid var(--line); }

/* صور الدروس بلا صورة من يوتيوب: خلفية هادئة باسم المادة */
.thumb { background: var(--board-soft); color: var(--board); border: 1px solid var(--line); border-radius: 6px; }
.thumb .ph { font-weight: 600; font-size: 1rem; }

/* لوحة المعلم */
.dash-head { padding-block: 22px 4px; }
.dash-actions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); padding-block: 8px 4px; }
.act-tile { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); text-decoration: none; }
.act-tile b { font-size: 1.05rem; }
.act-tile span { font-size: .85rem; color: var(--muted); }
.act-tile:hover { border-color: var(--board); }
.act-tile.act-main { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.act-tile.act-main span { color: color-mix(in srgb, var(--board-ink) 80%, transparent); }
.dash-links { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-block: 6px 2px; font-size: .92rem; }
.dash-links a { color: var(--muted); }
.cert-box h3 { color: var(--warn); }

/* صفحة «تطوّع بالشرح» */
.teach-page .hadith, .hadith { padding: 16px 18px; border-radius: var(--r); box-shadow: none; gap: 6px; }
.hadith blockquote { font-size: 1.25rem; line-height: 1.9; }

/* زر المساعد: دائرة صغيرة */
.bot-btn { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.35rem; }

.foot { text-align: start; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.foot-links b { color: var(--ink); }

/* v5.4: شريط المعلم في الرئيسية */
.teacher-bar { background: var(--surface); border: 1px solid var(--board); margin-top: 14px; }
.player .ph-join .btn-sm { color: var(--ink); }
@media (max-width: 560px) {
  .dash-actions { grid-template-columns: 1fr 1fr; }
  .act-tile { padding: 12px; }
}

/* v5.5: زر لكل وقت، والباقي تحت «المزيد» */
.row-more { display: inline-block; }
.row-more[open] { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-more > summary { list-style: none; }
.row-more > summary::-webkit-details-marker { display: none; }
.row-more[open] > summary { background: var(--sunk); }
.row-more .menu { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* تقويم الحصص القادمة (7 أيام) */
.section > * { min-width: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; max-width: 100%; }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cal-day.today { border-color: var(--board); box-shadow: inset 0 3px 0 var(--board); }
.cal-day.empty { background: var(--sunk); }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cal-head span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.cal-head b { font-size: 1.35rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-day.today .cal-head span, .cal-day.today .cal-head b { color: var(--board); }
.cal-item { display: grid; gap: 1px; padding: 6px 8px; border-radius: 6px; background: var(--board-soft); color: var(--ink); text-decoration: none; border-inline-start: 3px solid var(--board); min-width: 0; }
.cal-item.is-live { background: var(--live-soft); border-inline-start-color: var(--live); }
.cal-item:hover { filter: brightness(.97); }
.cal-time { font-size: .78rem; font-weight: 700; color: var(--board); font-variant-numeric: tabular-nums; }
.cal-item.is-live .cal-time { color: var(--live-text); }
.cal-item b { font-size: .86rem; }
.cal-t { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-g { font-size: .72rem; color: var(--muted); }
.cal-more { font-size: .8rem; color: var(--board); font-weight: 700; text-align: center; }
.cal-none { color: var(--line); text-align: center; padding-block: 8px; }
@media (max-width: 900px) {
  .cal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cal-day { flex: 0 0 150px; scroll-snap-align: start; }
}

/* معلمونا المتطوعون */
.band-teachers { flex-direction: column; align-items: stretch; gap: 14px; }
.vol-head { display: grid; gap: 2px; }
.band .vol-faces { display: flex; flex-wrap: wrap; gap: 14px 10px; }
.band-teachers .row { justify-content: flex-start; }
.vol { display: grid; justify-items: center; gap: 4px; width: 76px; color: var(--board-ink); text-decoration: none; text-align: center; }
.vol span:last-child { font-size: .78rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.av.av-vol { width: 56px; height: 56px; font-size: 1.3rem; background: var(--board-ink); color: var(--board); border: 3px solid color-mix(in srgb, var(--board-ink) 40%, transparent); }
.vol:hover .av-vol { transform: translateY(-2px); }
.band-teachers .vol-all { color: var(--board-ink); }

/* رابط الحصة لصاحبها */
.note.mylink { margin-top: 10px; }
.note.mylink a { overflow-wrap: anywhere; font-weight: 600; }

/* أيقونة المعلم: رجل بالكُمّة أو امرأة بالحجاب */
.av.av-ic { background: #E6F0EC; padding: 0; }
.av.av-ic svg { width: 100%; height: 100%; display: block; }
.av.av-vol.av-ic { background: #E6F0EC; }
fieldset.pick-g { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.pick-g legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.g-opts { display: flex; gap: 12px; flex-wrap: wrap; }
.g-opt { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 18px 10px; border: 2px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--surface); min-width: 112px; font-weight: 600; }
.g-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.g-opt:has(input:checked) { border-color: var(--board); background: var(--board-soft); color: var(--board); }
.g-opt:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--board) 45%, transparent); outline-offset: 2px; }

/* رابط الحصة يظهر في النموذج مباشرة */
.linkbox { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--board-soft); min-width: 0; }
.lb-label { font-weight: 700; display: block; margin-bottom: 6px; }
.lb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.lb-url { flex: 1 1 220px; min-width: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 600; overflow-wrap: anywhere; text-align: left; } /* rtl-ok: centring, LTR value or ornament */
.linkbox .field { margin: 0; }
.lb-swap { justify-self: start; }
.lb-tip { margin: 0; font-size: .9rem; color: var(--ink); }

/* «حصتك الآن» أعلى لوحة المعلم */
.pill-live { background: var(--live); color: var(--live-ink); }
.now-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; padding: 14px 16px; border: 2px solid var(--live); border-radius: var(--r); background: var(--live-soft); }
.now-card > div { display: grid; gap: 4px; min-width: 0; }
.now-card > div .pill { justify-self: start; }
@media (max-width: 600px) { .now-card .btn { width: 100%; } }
.note.mylink .btn-live { justify-self: start; }
.note.mylink .lb-url { justify-self: stretch; }
/* الجوال: مربع الحصة القادمة يتسع لأزراره بدل أن تُقصّ */
@media (max-width: 600px) { .player:has(> .ph) { aspect-ratio: auto; min-height: 200px; } }

/* ===================================================================
   v6 — هوية «مِدْرار»: القوس العُماني والمطر، ولون وأيقونة لكل مادة.
   العنوان الكبير وأرقام الصفوف بخط كوفي، وباقي النصوص بخط واضح.
   =================================================================== */
:root {
  --font-kufi: "Reem Kufi", var(--font-display);
  --sky: #DDEFF8; --sky-ink: #1D5D86; --leaf: #DFF1E8; --leaf-ink: #16674A;
  --sand: #F3E7D3; --sand-ink: #6B4C14; --gold: #E7B456;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sky: #13293A; --sky-ink: #9CCBEA; --leaf: #15302A; --leaf-ink: #8FD7B6; --sand: #2E261A; --sand-ink: #E9CF9F; }
  :root:not([data-theme="light"]) [style*="--sc"] { --sct: color-mix(in srgb, var(--sc) 55%, #fff); --scs: color-mix(in srgb, var(--sc) 24%, var(--surface)); }
}
:root[data-theme="dark"] { --sky: #13293A; --sky-ink: #9CCBEA; --leaf: #15302A; --leaf-ink: #8FD7B6; --sand: #2E261A; --sand-ink: #E9CF9F; }
[style*="--sc"] { --sct: var(--sc); --scs: color-mix(in srgb, var(--sc) 11%, var(--surface)); }
:root[data-theme="dark"] [style*="--sc"] { --sct: color-mix(in srgb, var(--sc) 55%, #fff); --scs: color-mix(in srgb, var(--sc) 24%, var(--surface)); }
.sico { width: 1.2em; height: 1.2em; flex: none; }

/* الواجهة: قوس فيه معلم وطالبان، ويقطر منه المطر */
.hero.hero-arch { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: end; gap: 28px; padding-block: 30px 0; }
.hero-arch .hero-text { gap: 14px; align-self: center; }
.hero .hero-h { font: 700 clamp(2.5rem, 1.4rem + 4.2vw, 4.6rem)/1.2 var(--font-kufi); color: var(--board); }
.hero-arch p { font-size: 1.15rem; max-width: 34ch; }
.hero-doors { display: flex; gap: 12px; flex-wrap: wrap; margin-block: 8px 34px; }
.door-btn { display: grid; gap: 2px; justify-items: start; text-align: start; min-width: 210px; padding: 14px 24px; border: 0; border-radius: 18px;
  font: inherit; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.door-btn b { font-size: 1.3rem; line-height: 1.4; }
.door-btn span { font-size: .92rem; opacity: .88; }
.door-btn.st { background: var(--board); color: var(--board-ink); }
.door-btn.te { background: var(--sand); color: var(--sand-ink); }
.door-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--board) 22%, transparent); }
.door-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.hero-art { width: 100%; max-width: 480px; justify-self: center; display: block; }
.hero-art .kufi { font-family: var(--font-kufi); }
.drops path { fill: #fff; opacity: 0; animation: midrar-rain 2.6s linear infinite; animation-delay: var(--d); }
@keyframes midrar-rain { 0% { transform: translateY(-30px); opacity: 0; } 15% { opacity: .9; } 85% { opacity: .9; } 100% { transform: translateY(130px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drops path { animation: none; opacity: .85; } .door-btn, .grade-chip { transition: none; } }
@media (max-width: 820px) {
  .hero.hero-arch { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 16px; }
  .hero-art { order: -1; max-width: 270px; }
  .hero-doors { margin-bottom: 20px; }
  .door-btn { flex: 1 1 100%; min-width: 0; }
}

/* اختر صفّك: ثلاثة أبواب مقوّسة، لكل حلقة لونها */
.stages { align-items: end; }
@media (min-width: 900px) { .stages { grid-template-columns: 1fr 1.35fr .8fr; } }
.stage { border: 0; border-radius: 220px 220px 18px 18px / 130px 130px 18px 18px; padding: 56px 18px 20px; justify-items: center; text-align: center; }
.stage h3 { font-size: 1.15rem; }
.stage.st-1 { background: var(--sky); color: var(--sky-ink); }
.stage.st-2 { background: var(--leaf); color: var(--leaf-ink); }
.stage.st-3 { background: var(--sand); color: var(--sand-ink); }
.stage .grade-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.stage .grade-chip { width: 96px; min-height: 0; padding: 8px 4px 6px; gap: 0; align-items: center; text-align: center; border: 0; border-radius: 16px;
  background: var(--surface); color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.stage .grade-chip .gno { font: 700 2.2rem/1.1 var(--font-kufi); }
.stage .grade-chip span { font-size: .8rem; color: var(--muted); }
.stage .grade-chip .tag-exam { color: var(--warn); }
.stage .grade-chip:hover { background: var(--surface); transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, .1); }
.stage .grade-chip.cur { box-shadow: inset 0 0 0 2px currentColor; }
@media (max-width: 600px) { .stage { border-radius: 180px 180px 18px 18px / 90px 90px 18px 18px; padding-top: 44px; } .stage .grade-chip { width: 78px; } .stage .grade-chip .gno { font-size: 1.8rem; } }

/* لون المادة في البطاقات والتقويم والصور المصغّرة */
.card[style*="--sc"] { border-top: 4px solid var(--sc); }
.card[style*="--sc"] .subj { color: var(--sct); }
.card.s-live[style*="--sc"] { border-top-color: var(--live); }
.cal-item[style*="--sc"] { background: var(--scs); border-inline-start-color: var(--sc); }
.cal-item[style*="--sc"] b { color: var(--sct); }
.vid[style*="--sc"] .thumb, .feat[style*="--sc"] .thumb { background: var(--sc); color: #fff; }
.thumb .ph { display: grid; justify-items: center; gap: 6px; }
.thumb .ph .sico { width: 38px; height: 38px; opacity: .9; }
.chip-sc .sico { width: 18px; height: 18px; color: var(--sct); }
.chip-sc[aria-current="page"] { background: var(--sc); border-color: var(--sc); color: #fff; }
.chip-sc[aria-current="page"] .sico { color: #fff; }

/* شريط المتطوعين بزخرفة نجمية، و«أنت؟» في آخره */
.band-teachers { background-color: var(--board);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 6l6 14 14-6-6 14 14 6-14 6 6 14-14-6-6 14-6-14-14 6 6-14-14-6 14-6-6-14 14 6z' fill='none' stroke='rgba(255,255,255,.09)' stroke-width='1.5'/%3E%3C/svg%3E"); }
.vol-head b { font-size: 1.5rem; }
.vol-you .av { background: var(--gold); color: #0E3B2F; font-weight: 800; font-size: .95rem; border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

/* أولياء الأمور */
.parents-strip { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-block: 16px 6px; padding: 18px 22px;
  border-radius: 18px; background: var(--sand); color: var(--sand-ink); text-decoration: none; }
.parents-strip b { display: block; font-size: 1.15rem; }
.parents-strip .btn { border-color: currentColor; color: inherit; background: transparent; }

/* صفحة الصف: المواد بطاقات ملوّنة بأيقوناتها */
.filters.subj-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 128px), 1fr)); gap: 10px; overflow: visible; }
.subj-tiles .chip { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 104px; padding: 14px 8px; border: 0; border-radius: 18px;
  background: var(--scs); color: var(--ink); font-weight: 700; white-space: normal; text-align: center; line-height: 1.4; transition: transform .15s ease, box-shadow .15s ease; }
.subj-tiles .chip .sico { width: 38px; height: 38px; }
.subj-tiles .chip:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, .08); }
.crumb-sc { display: inline-flex; align-items: center; gap: 4px; color: var(--sct); font-weight: 700; }
.crumb-sc .sico { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .subj-tiles .chip { transition: none; } }
.plan-tools { display: flex; justify-content: flex-end; padding-top: 14px; }
.share-week { gap: 6px; }
/* الحديث على سبورة القوس */
.hero-art .hd { font: 700 27px/1 "Amiri", "Traditional Arabic", serif; fill: #F4F6F1; }
.hero-art .hd-say { font-size: 22px; fill: #E7B456; }
.hero-art .hd-key { fill: #8FD7B6; }
.hero-art .hd-src { font-size: 19px; font-weight: 400; fill: #CFE6DD; }

/* «تدرّب»: أسئلة تفاعلية بثلاثة مستويات */
.px-cta { display: flex; align-items: center; gap: 14px; margin-block: 6px 14px; padding: 14px 18px; border-radius: 18px; background: var(--scs); color: var(--ink); text-decoration: none; }
.px-cta > .sico { width: 40px; height: 40px; color: var(--sct); }
.px-cta > span:first-of-type { display: grid; flex: 1; min-width: 0; }
.px-cta b { font-size: 1.1rem; }
.px-cta small { color: var(--muted); }
.px-unit { display: grid; gap: 10px; padding-block: 12px; }
.px-unit h2 { font-size: 1.1rem; color: var(--sct); }
.px-lessons { display: grid; gap: 8px; }
.px-lesson { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-inline-start: 5px solid var(--sc); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.px-lesson > span:first-child { display: grid; flex: 1; min-width: 0; }
.px-lesson small { color: var(--muted); }
.px-stars { color: var(--gold); font-size: 1.3rem; letter-spacing: 0; white-space: nowrap; }
.px-stars i { font-style: normal; color: var(--line); }
.px-pick, .px-run, .px-end, .px-key { display: grid; gap: 14px; padding-block: 8px 20px; }
.px-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.px-lv { display: grid; gap: 2px; justify-items: center; padding: 18px 10px; border: 0; border-radius: 18px; font: inherit; cursor: pointer; color: var(--ink); transition: transform .15s ease; }
.px-lv b { font-size: 1.2rem; }
.px-lv small { color: var(--muted); }
.px-lv:hover { transform: translateY(-2px); }
.px-lv.lv-1 { background: var(--leaf); } .px-lv.lv-2 { background: var(--sky); } .px-lv.lv-3 { background: var(--sand); } .px-lv.lv-0 { background: var(--sunk); }
.px-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.px-bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.px-bar span { display: block; height: 100%; background: var(--sc); border-radius: 99px; transition: width .3s ease; }
.px-q { font-size: 1.35rem; line-height: 1.7; }
.m { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; white-space: nowrap; font-weight: 600; }
.px-opts { display: grid; gap: 8px; }
.px-tf { grid-template-columns: 1fr 1fr; }
.px-o { padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.05rem; text-align: start; cursor: pointer; }
.px-tf .px-o { text-align: center; font-weight: 700; }
.px-o[aria-pressed="true"] { border-color: var(--sc); background: var(--scs); }
.px-o.right, .px-in.right, .px-match select.right { border-color: var(--ok); background: var(--ok-soft); }
.px-o.wrong, .px-in.wrong, .px-match select.wrong { border-color: var(--live); background: var(--live-soft); }
.px-o:disabled { cursor: default; color: var(--ink); }
.px-in { font-size: 1.2rem; max-width: 320px; }
.px-match { display: grid; gap: 10px; }
.px-mrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; }
.px-order { display: grid; gap: 8px; padding: 0; margin: 0; list-style-position: inside; }
.px-order li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.px-order li > span:first-child { flex: 1; min-width: 0; }
.px-mv { display: flex; gap: 4px; }
.px-hint summary { cursor: pointer; color: var(--board); font-weight: 600; }
.px-fb { display: grid; gap: 4px; border-radius: 12px; }
.px-fb:empty { display: none; }
.px-fb.ok { padding: 12px 16px; background: var(--ok-soft); color: var(--ink); border-inline-start: 5px solid var(--ok); }
.px-fb.no { padding: 12px 16px; background: var(--live-soft); color: var(--ink); border-inline-start: 5px solid var(--live); }
.px-end { justify-items: center; text-align: center; }
.px-end .px-stars { font-size: 3rem; }
.px-end h2 { font: 700 2.2rem/1.2 var(--font-kufi); }
.px-key ol { display: grid; gap: 14px; padding-inline-start: 22px; }
.px-key li { display: grid; gap: 4px; justify-items: start; }
.px-ans { color: var(--ok); }
@media (max-width: 600px) { .px-mrow { grid-template-columns: minmax(0, 1fr); gap: 4px; } .px-q { font-size: 1.2rem; } }
@media (prefers-reduced-motion: reduce) { .px-lv, .px-bar span { transition: none; } }
.px-qrow { display: flex; align-items: flex-start; gap: 10px; }
.px-qrow .px-q { flex: 1; min-width: 0; }
.px-say { flex: none; }
/* للصغار: خط أكبر وأزرار أوسع */
.px-young .px-q { font-size: 1.6rem; line-height: 1.9; }
.px-young .px-o { font-size: 1.35rem; padding: 16px 18px; line-height: 1.9; }
.px-young .px-order li, .px-young .px-mrow { font-size: 1.2rem; line-height: 1.9; }
.px-young .px-match select { font-size: 1.1rem; }

/* ===================================================================
   v7 — الصفحة الرئيسية السينمائية: كل قسم صورة عُمانية كاملة،
   والكلام على زجاج مصنفر فوقها، والمطر يبقى يتساقط مع التمرير.
   الصفحة الرئيسية داكنة دائماً، وكل الأصناف هنا تبدأ بـ h7- حتى لا تتعارض.
   =================================================================== */
body.home7 {
  --paper: #0B1311; --surface: #16201D; --sunk: #1C2824; --ink: #F5EFE4; --muted: #A9B5AF; --line: #2A3732;
  --board: #5BC39A; --board-ink: #0A1A13; --board-soft: #1A3129; --chalk: #E7B456; --chalk-soft: #33280F;
  --live: #FF6F61; --live-ink: #2A0703; --live-soft: #3B1C19; --live-text: #FF8A7E; --ok: #6BD39C; --ok-soft: #173023;
  --warn: #F0C26A; --warn-soft: #33290F; --sky: #13293A; --sky-ink: #9CCBEA; --leaf: #15302A; --leaf-ink: #8FD7B6; --sand: #2E261A; --sand-ink: #E9CF9F;
  --h7-night: #0B1311; --h7-night-2: #101B18; --h7-mist: rgba(245, 239, 228, .76); --h7-faint: rgba(245, 239, 228, .52);
  --h7-gold: #E7B456; --h7-gold-ink: #2A1C05; --h7-glass: rgba(255, 255, 255, .085); --h7-glass-hi: rgba(255, 255, 255, .15); --h7-line: rgba(255, 255, 255, .2);
  --h7-naskh: "Amiri", "Traditional Arabic", "Noto Naskh Arabic", serif;
  color-scheme: dark; background: var(--h7-night); color: var(--ink);
}
body.home7 [style*="--sc"] { --sct: color-mix(in srgb, var(--sc) 55%, #fff); --scs: color-mix(in srgb, var(--sc) 24%, var(--surface)); }
body.home7 .brand-mark { background: #F4F6F1; border-radius: 8px; padding: 3px; }
body.home7 .topbar { position: fixed; top: 0; inset-inline: 0; padding-top: env(safe-area-inset-top, 0px); background: transparent; border-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none; transition: background-color .3s ease, border-color .3s ease; }
body.home7 .topbar .nav a { color: var(--h7-mist); }
body.home7 .topbar .nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .1); }
body.home7.h7-solid .topbar { background: rgba(11, 19, 17, .72); border-bottom-color: rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
body.home7 #banners:not(:empty) { padding-top: var(--h7-bar, 68px); }
body.home7 #view { max-width: none; padding-inline: 0; }
body.home7 .foot { border-top-color: rgba(255, 255, 255, .08); }

.h7 { font-size: 17px; line-height: 1.85; }
.h7 section { position: relative; }
.h7 figure, .h7 blockquote, .h7 ul, .h7 ol { margin: 0; }
.h7 img { display: block; }
.h7-gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.h7-wrap { max-width: 1240px; margin-inline: auto; }
.h7-eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 .86rem/1 var(--font-body); letter-spacing: .02em; color: var(--h7-gold); }
.h7-eyebrow::before { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.h7-h2 { font: 700 clamp(2.1rem, 1.3rem + 3.2vw, 4rem)/1.2 var(--font-kufi); }
.h7-lead { font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--h7-mist); max-width: 48ch; }
.h7-glass { background: var(--h7-glass); border: 1px solid var(--h7-line); border-radius: 18px;
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .h7-glass { background: rgba(16, 27, 24, .88); } }
.h7-btn { display: inline-grid; gap: 1px; justify-items: start; text-align: start; text-decoration: none; padding: 13px 26px; border-radius: 999px; font: 600 1.05rem/1.4 var(--font-body);
  border: 1px solid transparent; cursor: pointer; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.h7-btn small { font-size: .8rem; font-weight: 400; opacity: .82; }
.h7-btn-gold { background: var(--h7-gold); color: var(--h7-gold-ink); box-shadow: 0 10px 30px rgba(231, 180, 86, .28); }
.h7-btn-gold:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(231, 180, 86, .4); }
.h7-btn-glass { color: var(--ink); background: var(--h7-glass-hi); border-color: var(--h7-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.h7-btn-glass:hover { background: rgba(255, 255, 255, .24); transform: translateY(-2px); }
.h7-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* 1. الواجهة: الصورة تقترب من الكتاب مع التمرير */
.h7-hero { height: 230vh; height: 230svh; }
.h7-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--h7-night); }
.h7-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 72%; transform-origin: 50% 80%; transform: scale(1.04); will-change: transform; }
.h7-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.h7-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(7, 11, 10, .66) 0%, rgba(7, 11, 10, .22) 34%, rgba(7, 11, 10, 0) 52%, rgba(7, 11, 10, .1) 74%, var(--h7-night) 100%); }
.h7-dim { position: absolute; inset: 0; background: rgba(7, 11, 10, .55); opacity: 0; }
.h7-copy { position: absolute; inset-inline: 0; top: calc(var(--h7-bar, 68px) + clamp(24px, 7vh, 90px)); display: grid; justify-items: center; text-align: center; gap: 18px; will-change: transform, opacity; }
.h7-copy .h7-eyebrow::after { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.h7-hero h1 { font: 700 clamp(3.1rem, 1.4rem + 6.6vw, 7.6rem)/1.12 var(--font-kufi); color: var(--ink); text-shadow: 0 4px 40px rgba(0, 0, 0, .45); }
.h7-hero h1 span { color: var(--h7-gold); }
.h7-sub { font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem); max-width: 44ch; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.h7-copy .h7-btns { justify-content: center; margin-top: 6px; }
.h7-copy .h7-btn { min-width: 190px; }
.h7-copy .h7-btn-glass { background: rgba(10, 16, 14, .42); }
.h7-late { position: absolute; inset-inline: 0; bottom: clamp(56px, 12vh, 120px); display: grid; justify-items: center; text-align: center; opacity: 0; }
.h7-late p { font: 600 clamp(1.4rem, 1rem + 1.9vw, 2.6rem)/1.5 var(--font-kufi); max-width: 24ch; text-shadow: 0 3px 30px rgba(0, 0, 0, .7); }
.h7-cue { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); inset-inline: 0; display: grid; justify-items: center; gap: 8px; font-size: .8rem; color: var(--h7-mist); }
.h7-cue i { width: 1.5px; height: 42px; background: linear-gradient(to bottom, transparent, var(--ink)); animation: h7-drip 1.8s ease-in infinite; }
@keyframes h7-drip { 0% { transform: scaleY(0); transform-origin: top; } 60% { transform: scaleY(1); transform-origin: top; } 61% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ما يخص الزائر الآن: مباشر، القادم، تابع، الأحدث */
.h7-now { max-width: 1240px; margin-inline: auto; display: grid; gap: 4px; padding-block: 8px; }
.h7-now:not(:has(> :not([hidden]))) { display: none; }

/* صورة داخل نافذة تتحرك أبطأ من الصفحة */
.h7-frame { position: relative; overflow: hidden; border-radius: 26px; background: var(--h7-night-2); max-width: 100%; }
.h7-pl { position: absolute; inset: 0; transform: translate3d(0, var(--py, 0%), 0) scale(var(--ps, 1.16)); will-change: transform; }
.h7-pl > img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.h7-sec { padding-block: clamp(80px, 11vw, 160px); }

/* 2. المعلمون */
.h7-head2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 20px 60px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.h7-head2 > div { display: grid; gap: 16px; }
.h7-duo { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: clamp(22px, 3.4vw, 48px); align-items: start; }
.h7-duo figure { position: relative; min-width: 0; }
.h7-duo figure:last-child { margin-top: clamp(60px, 12vw, 180px); }
.h7-duo .h7-frame { aspect-ratio: 1672 / 941; }
.h7-cap { position: absolute; inset-inline-start: clamp(14px, 2vw, 24px); bottom: clamp(-34px, -2.4vw, -18px); max-width: min(340px, calc(100% - 28px)); padding: 16px 20px; display: grid; gap: 4px; }
.h7-cap b { font: 700 1.25rem/1.4 var(--font-kufi); }
.h7-cap span { font-size: .95rem; color: var(--h7-mist); line-height: 1.7; }
.h7-faces { margin-top: clamp(64px, 8vw, 110px); display: grid; gap: 16px; }
.h7-faces .vol-faces { display: flex; flex-wrap: wrap; gap: 14px 10px; }
.h7-faces .vol { color: var(--ink); }
.h7-faces .row { display: flex; gap: 12px; flex-wrap: wrap; }
/* شاشة السبورة في صورة الصف تعرض حصة حية */
.h7-board { position: absolute; left: 0; top: 0; width: 400px; height: 480px; transform-origin: 0 0; overflow: hidden; direction: rtl; visibility: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #16303A 0%, #0B171C 55%, #070D10 100%); color: #EAF4F1; display: grid; grid-template-rows: auto 1fr auto; padding: 26px 28px; font-family: var(--font-body); line-height: 1.5; }
.h7-board.ready { visibility: visible; }
.h7-pl > img.h7-hand { position: absolute; left: 64.175%; top: 29.224%; width: 16.268%; height: 18.066%; object-fit: fill; pointer-events: none; }
.h7-board-top { display: flex; justify-content: space-between; align-items: center; font-size: 19px; color: rgba(234, 244, 241, .78); }
.h7-board-top .live { display: inline-flex; align-items: center; gap: 8px; color: #FFB4AA; font-weight: 600; }
.h7-board-top .live::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #FF6F61; box-shadow: 0 0 0 4px rgba(255, 111, 97, .25); animation: h7-pulse 1.6s ease-in-out infinite; }
@keyframes h7-pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 111, 97, 0); } }
.h7-eq { align-self: start; margin-top: 34px; direction: ltr; text-align: center; white-space: nowrap; font: 700 62px/1 var(--font-body); letter-spacing: .01em; min-height: 66px; }
.h7-eq .caret { display: inline-block; width: 4px; height: 54px; background: var(--h7-gold); vertical-align: -6px; margin-left: 4px; animation: h7-blink 1s steps(1) infinite; }
@keyframes h7-blink { 50% { opacity: 0; } }
.h7-dots { direction: ltr; display: grid; grid-template-columns: repeat(4, 28px); gap: 12px; justify-content: end; margin-bottom: 4px; }
.h7-dots i { width: 28px; height: 28px; border-radius: 50%; background: var(--h7-gold); opacity: 0; transform: scale(.4); transition: opacity .3s ease, transform .3s ease; }
.h7-dots i.on { opacity: 1; transform: none; }

/* 3. الطلاب */
.h7-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); align-items: center; }
.h7-split .h7-card { position: relative; z-index: 2; margin-inline-end: clamp(-170px, -10vw, -60px); padding: clamp(26px, 3.2vw, 44px); display: grid; gap: 18px; }
.h7-split .h7-frame { aspect-ratio: 5 / 4; }
.h7-drops { list-style: none; padding: 0; display: grid; gap: 14px; }
.h7-drops li { position: relative; padding-inline-start: 30px; color: var(--h7-mist); line-height: 1.75; }
.h7-drops li b { color: var(--ink); font-weight: 600; }
.h7-drops li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .62em; width: 11px; height: 11px; background: var(--h7-gold); border-radius: 50% 0 50% 50%; transform: rotate(-45deg); }

/* أقسام بصورة كاملة */
.h7-scene { overflow: hidden; isolation: isolate; }
.h7-scene > .h7-pl { z-index: -2; }
.h7-veil { position: absolute; inset: 0; z-index: -1; }

/* 4. اختر صفك */
.h7-grades .h7-veil { background: linear-gradient(to bottom, var(--h7-night) 0%, rgba(11, 19, 17, .35) 18%, rgba(11, 19, 17, .15) 50%, rgba(11, 19, 17, .55) 85%, var(--h7-night) 100%),
  linear-gradient(to left, rgba(7, 11, 10, .55), rgba(7, 11, 10, 0) 60%); }
.h7-mistfx { position: absolute; z-index: -1; inset: 30% -20% auto; height: 40%; pointer-events: none; opacity: .5; filter: blur(20px); animation: h7-drift 38s ease-in-out infinite alternate;
  background: radial-gradient(40% 50% at 30% 50%, rgba(255, 255, 255, .22), transparent 70%), radial-gradient(35% 45% at 75% 40%, rgba(255, 255, 255, .16), transparent 70%); }
@keyframes h7-drift { to { transform: translateX(12%); } }
.h7-grades .h7-head { display: grid; gap: 16px; max-width: 620px; margin-bottom: clamp(36px, 5vw, 60px); scroll-margin-top: calc(var(--h7-bar, 68px) + 20px); }
/* شريط الصفوف: بطاقة لكل صف، والتي في الوسط أكبر، والجانبية مائلة بعمق */
.h7-railwrap { margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
.h7-rail { --cw: clamp(214px, 22vw, 270px); --gap: 18px; display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-block: 36px 34px; scrollbar-width: none; cursor: grab; outline: none; }
/* فراغ قبل أول بطاقة وبعد آخرها، كعنصرين في الصف لا كحشوة: بعض متصفحات الجوال تتجاهل الحشوة في نهاية التمرير، فلا تصل آخر الصفوف إلى الوسط وتبقى أصغر */
.h7-rail::before, .h7-rail::after { content: ""; flex: 0 0 max(0px, calc(50% - var(--cw) / 2 - var(--gap))); }
.h7-rail::-webkit-scrollbar { display: none; }
.h7-rail.drag { scroll-snap-type: none; cursor: grabbing; }
.h7-rail.drag .h7-gslot { pointer-events: none; }
.h7-gslot { position: relative; flex: 0 0 var(--cw); scroll-snap-align: center; text-decoration: none; color: var(--ink); border-radius: 22px; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.h7-gslot:focus-visible { outline: none; }
.h7-gslot:focus-visible .h7-gcard { outline: 3px solid var(--h7-gold); outline-offset: 4px; }
.h7-gcard { --tint: #9CCBEA; position: relative; aspect-ratio: 3 / 4; border-radius: 22px; padding: 22px 22px 18px; display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 10px;
  overflow: hidden; transform-origin: 50% 50%; will-change: transform, opacity; transition: border-color .35s ease, box-shadow .35s ease, background-color .35s ease; }
.h7-gcard.s2 { --tint: #8FD7B6; }
.h7-gcard.s3 { --tint: #E7B456; }
.h7-gcard::before { content: ""; position: absolute; inset: -40% -30% auto; height: 70%; background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--tint) 34%, transparent), transparent 70%); opacity: .55; pointer-events: none; transition: opacity .35s ease; }
.h7-gcard.is-center { background: rgba(255, 255, 255, .13); border-color: color-mix(in srgb, var(--tint) 65%, transparent);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 50px -12px color-mix(in srgb, var(--tint) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18); }
.h7-gcard.is-center::before { opacity: 1; }
.h7-gstage { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; color: var(--h7-mist); }
.h7-gstage em { font: 600 .7rem/1 var(--font-body); font-style: normal; background: var(--h7-gold); color: var(--h7-gold-ink); padding: 4px 8px; border-radius: 999px; }
.h7-gstage em.you { background: rgba(255, 255, 255, .9); color: #0B1311; }
.h7-gno { position: relative; align-self: center; justify-self: center; font: 700 clamp(5rem, 3.6rem + 4vw, 7rem)/1 var(--font-kufi); color: var(--tint); font-variant-numeric: tabular-nums;
  text-shadow: 0 10px 40px color-mix(in srgb, var(--tint) 35%, transparent); }
/* صف الطالب: الرقم بحجمه، لكن بلون أبيض ذهبي مضيء وإطار ذهبي، لا يشبه ألوان الحلقات */
.h7-gcard.h7-mine { --mine: #E5323B; --mine-hi: #FFB3B0; --mine-ink: #FFFFFF; /* أحمر العلم العُماني */
  border-color: color-mix(in srgb, var(--mine) 80%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mine) 40%, transparent), 0 24px 60px rgba(0, 0, 0, .4), 0 0 46px -10px color-mix(in srgb, var(--mine) 75%, transparent); }
.h7-gcard.h7-mine .h7-gno { color: var(--mine-hi); background: linear-gradient(180deg, #FFFFFF 0%, var(--mine-hi) 45%, var(--mine) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: none; filter: drop-shadow(0 6px 22px color-mix(in srgb, var(--mine) 60%, transparent)); }
.h7-gcard.h7-mine .h7-gfoot i, .h7-gcard.h7-mine.is-center .h7-gfoot i { background: var(--mine); color: var(--mine-ink); }
.h7-gcard.h7-mine .h7-gstage em.you { background: var(--mine); color: var(--mine-ink); }
.h7-gname { position: relative; font: 700 1.3rem/1.35 var(--font-kufi); text-align: center; }
.h7-gsubs { position: relative; display: flex; justify-content: center; gap: 8px; color: var(--h7-mist); min-height: 26px; align-items: center; }
.h7-gsubs .sico { width: 24px; height: 24px; }
.h7-gsubs .more { font-size: .8rem; }
.h7-gfoot { position: relative; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9rem; color: var(--h7-mist); }
.h7-gfoot i { font-style: normal; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--ink); transition: background-color .25s ease, color .25s ease; }
.h7-gcard.is-center .h7-gfoot i { background: var(--tint); color: #0B1311; }
.h7-railnav { display: flex; justify-content: center; align-items: center; gap: 18px; padding-inline: 16px; }
.h7-rbtn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--h7-line); background: var(--h7-glass-hi); color: var(--ink); font: 600 1.2rem/1 var(--font-body); cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background-color .2s ease, transform .2s ease; }
.h7-rbtn:hover { background: rgba(255, 255, 255, .26); transform: scale(1.06); }
.h7-rdots { display: flex; gap: 6px; align-items: center; }
.h7-rdots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .3); transition: width .3s ease, background-color .3s ease; }
.h7-rdots i.on { width: 22px; background: var(--h7-gold); }

/* العدّادات */
.h7-stats { padding-block: clamp(30px, 5vw, 60px) 10px; }
.h7-statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(12px, 2vw, 22px); }
.h7-stat { position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 18px 22px; }
.h7-stat::after { content: ""; position: absolute; inset: auto 15% 0; height: 2px; background: linear-gradient(to left, transparent, var(--h7-gold), transparent); transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.h7-stat.counting::after, .h7-stat.done::after { transform: scaleX(1); }
.h7-sico { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: var(--h7-gold); background: rgba(231, 180, 86, .14); box-shadow: 0 0 0 1px rgba(231, 180, 86, .3); }
.h7-sico svg { width: 26px; height: 26px; }
.h7-stat.done .h7-sico { animation: h7-pop .6s ease; }
@keyframes h7-pop { 40% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(231, 180, 86, 0), 0 0 30px rgba(231, 180, 86, .5); } }
.h7-stat b { font: 700 clamp(2.4rem, 1.8rem + 2.2vw, 3.6rem)/1.1 var(--font-kufi); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.h7-stat > span:last-child { color: var(--h7-mist); font-size: .95rem; }

/* 5. الحديث */
.h7-hadith { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; }
.h7-hadith .h7-veil { background: radial-gradient(70% 70% at 55% 50%, rgba(7, 11, 10, .72) 0%, rgba(7, 11, 10, .58) 55%, rgba(7, 11, 10, .35) 100%),
  linear-gradient(to bottom, var(--h7-night) 0%, transparent 16%, transparent 84%, var(--h7-night) 100%); }
.h7-beams { position: absolute; z-index: -1; inset: -10% 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: repeating-linear-gradient(118deg, transparent 0 46px, rgba(255, 210, 140, .14) 46px 82px, transparent 82px 150px);
  -webkit-mask-image: radial-gradient(60% 75% at 8% 28%, #000 0%, transparent 70%); mask-image: radial-gradient(60% 75% at 8% 28%, #000 0%, transparent 70%);
  animation: h7-beams 14s ease-in-out infinite alternate; }
@keyframes h7-beams { to { opacity: .85; background-position: 60px 0; } }
.h7-hadith-in { display: grid; justify-items: center; text-align: center; gap: 22px; padding-block: 120px; }
.h7-hadith blockquote { font: 700 clamp(1.75rem, 1rem + 2.9vw, 3.3rem)/1.95 var(--h7-naskh); max-width: 26ch; text-shadow: 0 2px 26px rgba(0, 0, 0, .55); }
.h7-hadith mark { background: none; color: var(--h7-gold); }
.h7-hadith figcaption, .h7-hadith p { color: var(--h7-mist); }
.h7-hadith p { max-width: 40ch; }

/* 6. تطوّع */
.h7-vol { min-height: 92vh; min-height: 92svh; display: grid; align-items: center; }
.h7-vol .h7-veil { background: radial-gradient(60% 70% at 50% 55%, rgba(7, 11, 10, .25), rgba(7, 11, 10, .6)),
  linear-gradient(to bottom, var(--h7-night) 0%, transparent 18%, transparent 82%, var(--h7-night) 100%); }
.h7-parents { max-width: 1240px; margin: 0 auto clamp(40px, 6vw, 80px); }

@media (max-width: 860px) {
  .h7-head2 { grid-template-columns: minmax(0, 1fr); }
  .h7-duo { grid-template-columns: minmax(0, 1fr); gap: 72px; }
  .h7-duo figure:last-child { margin-top: 0; }
  .h7-split { grid-template-columns: minmax(0, 1fr); }
  .h7-split .h7-frame { order: -1; aspect-ratio: 4 / 3; }
  .h7-split .h7-card { margin-top: -64px; margin-inline: 10px; }
}
@media (max-width: 520px) {
  .h7-rail { --cw: min(72vw, 260px); --gap: 12px; }
  .h7-statrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h7-stat { padding: 20px 12px 18px; }
  .h7-cap { position: relative; inset: auto; margin: -36px 12px 0; max-width: none; }
  .h7-copy .h7-btn { min-width: 0; flex: 1 1 140px; }
  .h7-hadith blockquote { line-height: 1.85; }
}
@media (prefers-reduced-motion: reduce) {
  .h7-hero { height: auto; }
  .h7-pin { position: relative; }
  .h7-late { opacity: 1; position: relative; bottom: auto; margin-top: -170px; padding-bottom: 60px; }
  .h7-cue, .h7-fx { display: none; }
  .h7-mistfx, .h7-beams, .h7-cue i, .h7-board-top .live::before, .h7-eq .caret { animation: none; }
  .h7-btn, .h7-gcard, .h7-rbtn, .h7-stat::after { transition: none; }
  .h7-stat.done .h7-sico { animation: none; }
}

/* تنبيه الحصص المباشرة في الواجهة وعلى بطاقات الصفوف */
.h7-gnow.is-live i { background: #FFFFFF; animation: h7-livedot 1.4s ease-in-out infinite; }
@keyframes h7-livedot { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 60% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); } }
.h7-gnow { position: absolute; top: 52px; inset-inline-start: 50%; transform: translateX(50%); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 .74rem/1.4 var(--font-body);
  background: rgba(10, 16, 14, .6); color: var(--ink); border: 1px solid rgba(255, 255, 255, .2); z-index: 1; }
.h7-gnow.is-live { background: #E5323B; border-color: transparent; color: #FFFFFF; box-shadow: 0 6px 20px rgba(229, 50, 59, .5); }
.h7-gnow i { width: 7px; height: 7px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .h7-gnow.is-live i { animation: none; } }

/* جدول الحصص: بطاقات طولية تمرّ أفقياً على جانبي بطاقة «تطوّع» وخلفها */
.h7-volstage { position: relative; display: grid; grid-template-areas: "bar" "main"; gap: 18px; padding-block: 40px;
  margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
.h7-sbar { grid-area: bar; display: flex; justify-content: center; align-items: center; gap: 16px; padding-inline: 16px; text-align: center; }
.h7-sbar > span { display: grid; gap: 0; line-height: 1.5; }
.h7-sbar b { font: 700 1.2rem/1.4 var(--font-kufi); }
.h7-sbar #h7-sched-n { font-size: .86rem; color: var(--h7-mist); }
.h7-srail { grid-area: main; align-self: center; display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); cursor: grab; }
.h7-srail::-webkit-scrollbar { display: none; }
.h7-srail.drag { cursor: grabbing; }
.h7-srail.drag .h7-scard { pointer-events: none; }
.h7-sspacer { flex: 0 0 242px; }
.h7-sfill { flex: 0 0 210px; }
/* هامش تلقائي في الطرفين: يتوسط الصف حين لا يملأ الشاشة، ولا يؤثر حين يفيض */
.h7-srail > :first-child { margin-inline-start: auto; }
.h7-srail > :last-child { margin-inline-end: auto; }
/* بطاقة «تطوّع» بقياس بطاقات الحصص نفسه، ثابتة في الوسط بإطار ذهبي، والحصص تمرّ خلفها */
.h7-volcard { grid-area: main; justify-self: center; align-self: center; position: relative; z-index: 2; width: 210px; height: 440px;
  display: grid; grid-template-rows: auto auto auto auto 1fr auto auto; justify-items: center; text-align: center; gap: 8px; padding: 18px 16px 14px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(231, 180, 86, .3) 0%, rgba(40, 30, 18, .55) 50%, rgba(20, 16, 12, .7) 100%);
  border: 1px solid rgba(231, 180, 86, .7); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 50px -12px rgba(231, 180, 86, .7), inset 0 1px 0 rgba(255, 255, 255, .15); }
.h7-vtag { font: 700 .78rem/1 var(--font-body); padding: 5px 12px; border-radius: 999px; background: var(--h7-gold); color: var(--h7-gold-ink); }
.h7-vico { --sc: #E7B456; --sct2: #FFE3A3; }
.h7-volcard h2 { font: 700 1.25rem/1.35 var(--font-kufi); }
.h7-volcard p { font-size: .82rem; line-height: 1.6; color: var(--h7-mist); }
.h7-vsteps { list-style: none; margin: 0; padding: 8px 0 0; align-self: start; display: grid; gap: 5px; width: 100%; border-top: 1px solid rgba(255, 255, 255, .14); counter-reset: v; font-size: .82rem; text-align: start; }
.h7-vsteps li { counter-increment: v; display: flex; gap: 8px; align-items: baseline; }
.h7-vsteps li::before { content: counter(v); font: 700 .95rem/1 var(--font-kufi); color: var(--h7-gold); min-width: 12px; }
.h7-volcard .h7-btn { justify-self: stretch; justify-items: center; padding: 10px 14px; font-size: .95rem; }
.h7-vguide { font-size: .82rem; color: var(--h7-mist); }
.h7-vguide:hover { color: var(--ink); }
.h7-scard { --sct2: color-mix(in srgb, var(--sc) 55%, #fff); flex: 0 0 210px; height: 440px; display: grid; grid-template-rows: auto auto auto auto 1fr auto auto; justify-items: center; text-align: center; gap: 8px;
  padding: 18px 16px 16px; border-radius: 22px; text-decoration: none; color: var(--ink); user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sc) 30%, rgba(255, 255, 255, .06)) 0%, rgba(255, 255, 255, .06) 45%, rgba(10, 16, 14, .35) 100%);
  border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  transition: transform .25s ease, border-color .25s ease; }
.h7-scard:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--sc) 70%, #fff); }
.h7-scard:focus-visible { outline: 3px solid var(--h7-gold); outline-offset: 3px; }
.h7-scard [data-badge] { justify-self: center; }
.h7-scard .badge { background: rgba(255, 255, 255, .14); color: var(--ink); }
.h7-scard .badge.b-live { background: #E5323B; color: #FFFFFF; box-shadow: 0 6px 18px rgba(229, 50, 59, .5); }
.h7-scard .badge.b-live .dot-live { background: #FFFFFF; }
.h7-sico2 { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; margin-top: 6px; color: var(--sct2);
  background: color-mix(in srgb, var(--sc) 26%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sc) 55%, transparent); }
.h7-sico2 .sico { width: 32px; height: 32px; }
.h7-ssubj { font: 700 1.15rem/1.35 var(--font-kufi); color: var(--sct2); }
.h7-sgrade { font-size: .85rem; color: var(--h7-mist); }
.h7-stitle { align-self: start; font-weight: 600; font-size: .98rem; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.h7-swhen { font-size: .82rem; color: var(--h7-mist); line-height: 1.6; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); width: 100%; }
.h7-steacher { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .85rem; min-width: 0; max-width: 100%; }
.h7-steacher > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h7-steacher .av { width: 28px; height: 28px; font-size: .75rem; flex: none; }
.h7-sempty { margin: auto; padding: 18px 24px; border-radius: 16px; background: rgba(10, 16, 14, .5); color: var(--h7-mist); text-align: center; }
.h7-sempty a { color: var(--h7-gold); }
/* الجوال والشاشات المتوسطة: البطاقة أولاً ثم صف الحصص تحتها */
@media (max-width: 999px) {
  .h7-volstage { grid-template-areas: "card" "bar" "rail"; padding-block: 24px; }
  .h7-volcard { grid-area: card; }
  .h7-srail { grid-area: rail; }
  .h7-sspacer, .h7-sfill { display: none; }

}
@media (prefers-reduced-motion: reduce) { .h7-scard { transition: none; } }

/* كيف تعمل المنصة: خط عمودي تنزل عليه قطرة مطر مع التمرير، وكل خطوة تصلها تضيء ويظهر مثالها */
.h7-how { background: radial-gradient(60% 50% at 70% 40%, rgba(231, 180, 86, .07), transparent 70%); }
.h7-how-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px 70px; align-items: start; }
.h7-how-head { position: sticky; top: calc(var(--h7-bar, 68px) + 40px); display: grid; gap: 16px; }
.h7-tl { --x: 9px; position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(46px, 7vw, 90px); }
.h7-tl::before { content: ""; position: absolute; inset-inline-start: calc(var(--x) - 1px); top: 18px; bottom: 30px; width: 2px; background: rgba(255, 255, 255, .12); border-radius: 2px; }
.h7-tlfill { position: absolute; inset-inline-start: calc(var(--x) - 1px); top: 0; width: 2px; height: 0; background: linear-gradient(to bottom, rgba(231, 180, 86, .3), var(--h7-gold)); border-radius: 2px; }
.h7-drop { position: absolute; top: 0; inset-inline-start: calc(var(--x) - 9px); width: 18px; height: 18px; margin-top: -14px; z-index: 2; will-change: transform; pointer-events: none; }
.h7-drop::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 35% 35%, #FFF3D6, var(--h7-gold) 55%, #B9770E); border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
  box-shadow: 0 0 18px rgba(231, 180, 86, .8), 0 0 46px rgba(231, 180, 86, .35); }
.h7-step { position: relative; padding-inline-start: 46px; display: grid; gap: 6px; opacity: .38; transition: opacity .5s ease; }
.h7-step.on { opacity: 1; }
.h7-node { position: absolute; inset-inline-start: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--h7-night); border: 2px solid rgba(255, 255, 255, .3); transition: background-color .3s ease, border-color .3s ease; }
.h7-node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--h7-gold); opacity: 0; }
.h7-step.on .h7-node { background: var(--h7-gold); border-color: var(--h7-gold); }
.h7-step.on .h7-node::after { animation: h7-ripple 1s ease-out 1; }
@keyframes h7-ripple { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
.h7-sn { font: 600 .78rem/1 var(--font-body); letter-spacing: .04em; color: var(--h7-gold); }
.h7-step h3 { font: 700 clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem)/1.3 var(--font-kufi); }
.h7-step h3 em { font-style: normal; color: var(--h7-gold); }
.h7-step p { color: var(--h7-mist); max-width: 40ch; }
.h7-demo { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.h7-demo i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: var(--h7-mist); font-size: .9rem;
  transition: background-color .4s ease .35s, border-color .4s ease .35s, color .4s ease .35s, transform .4s ease .35s; }
.h7-dg i { font: 700 1.3rem/1 var(--font-kufi); min-width: 52px; justify-content: center; padding: 12px 8px; }
.h7-ds .sico { width: 20px; height: 20px; }
.h7-step.on .h7-dg i.pick, .h7-step.on .h7-dp i.pick { background: var(--h7-gold); border-color: var(--h7-gold); color: var(--h7-gold-ink); transform: translateY(-3px); }
.h7-step.on .h7-ds i.pick { background: color-mix(in srgb, var(--sc) 35%, transparent); border-color: color-mix(in srgb, var(--sc) 70%, #fff); color: var(--ink); transform: translateY(-3px); }
.h7-dw { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; max-width: 380px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .12); }
.h7-dw .play { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .12); position: relative; }
.h7-dw .play::after { content: ""; position: absolute; inset: 11px 10px 11px 13px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.h7-dw .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; direction: ltr; }
.h7-dw .bar b { display: block; height: 100%; width: 0; background: var(--h7-gold); border-radius: 6px; transition: width 1.6s cubic-bezier(.3, .6, .3, 1) .3s; }
.h7-step.on .h7-dw .bar b { width: 100%; }
.h7-demo .ok { grid-column: 1 / -1; font-size: .85rem; color: #8FD7B6; opacity: 0; transform: translateY(4px); transition: opacity .4s ease 1.9s, transform .4s ease 1.9s; }
.h7-dp .ok { flex-basis: 100%; transition-delay: .9s; }
.h7-demo .ok::before { content: "✓ "; }
.h7-step.on .h7-demo .ok { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .h7-how-in { grid-template-columns: minmax(0, 1fr); }
  .h7-how-head { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .h7-step, .h7-node, .h7-demo i, .h7-dw .bar b, .h7-demo .ok { transition: none; }
  .h7-step.on .h7-node::after { animation: none; }
}
