/* =========================================================
   NARQA ACADEMY — Design System
   Learn · Recite · Excel
   Palette lifted from the brand collateral: deep navy,
   antique gold, warm cream, Islamic geometric ornament.
   ========================================================= */

:root{
  /* Core brand */
  --navy-950:#061428;
  --navy-900:#0A1C36;
  --navy-800:#0F2547;
  --navy-700:#143154;
  --navy-600:#1C4270;
  --navy-500:#2A5A93;

  --gold-700:#9A7420;
  --gold-600:#B98E29;
  --gold-500:#C9992E;
  --gold-400:#D4A94A;
  --gold-300:#E0BE71;
  --gold-200:#E8CE8A;
  --gold-100:#F2E3BE;

  --cream-50:#FDFBF6;
  --cream-100:#FBF7EE;
  --cream-200:#F7F1E4;
  --cream-300:#EFE6D3;
  --cream-400:#E3D6BC;

  --ink:#0F2547;
  --ink-soft:#3A4C66;
  --ink-mute:#6B7A90;

  --ok:#2E7D52;
  --warn:#B4791C;
  --err:#B3402F;

  /* Surfaces */
  --bg:var(--cream-200);
  --surface:#FFFFFF;
  --surface-2:var(--cream-100);
  --line:var(--cream-400);
  --line-soft:var(--cream-300);

  /* Type */
  --serif:"Cormorant Garamond","Playfair Display",Georgia,"Times New Roman",serif;
  --sans:"Inter","Segoe UI",Roboto,system-ui,-apple-system,sans-serif;
  --arab:"Tajawal","Cairo",var(--sans);

  --radius:14px;
  --radius-lg:22px;
  --radius-sm:9px;

  --shadow-1:0 1px 2px rgba(10,28,54,.06),0 2px 8px rgba(10,28,54,.05);
  --shadow-2:0 4px 14px rgba(10,28,54,.09),0 12px 34px rgba(10,28,54,.07);
  --shadow-3:0 18px 50px rgba(10,28,54,.16);

  --wrap:1180px;
  --gutter:24px;

  /* Gold foil gradient used on rules, borders, headings */
  --foil:linear-gradient(100deg,#9A7420 0%,#D4A94A 22%,#F2E3BE 42%,#C9992E 62%,#E0BE71 82%,#9A7420 100%);
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}

body{
  margin:0;
  font-family:var(--sans);
  font-size:16px;
  line-height:1.62;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

body[dir="rtl"]{font-family:var(--arab)}
body[dir="rtl"] .u-en{font-family:var(--sans)}

img{max-width:100%;display:block}
a{color:var(--navy-600);text-decoration:none}
a:hover{color:var(--gold-600)}

h1,h2,h3,h4{font-family:var(--serif);font-weight:700;line-height:1.14;color:var(--navy-800);margin:0 0 .5em;letter-spacing:.005em}
h1{font-size:clamp(2.1rem,4.6vw,3.5rem)}
h2{font-size:clamp(1.7rem,3.2vw,2.5rem)}
h3{font-size:clamp(1.2rem,2vw,1.55rem)}
h4{font-size:1.06rem;font-family:var(--sans);font-weight:700;letter-spacing:.01em}
p{margin:0 0 1em}

body[dir="rtl"] h1,body[dir="rtl"] h2,body[dir="rtl"] h3{font-family:var(--arab);font-weight:800;line-height:1.35}

.wrap{width:100%;max-width:var(--wrap);margin-inline:auto;padding-inline:var(--gutter)}
.wrap-narrow{max-width:800px}

/* ---------------------------------------------------------
   Islamic geometric pattern (pure CSS/SVG data URI)
   --------------------------------------------------------- */
.pattern{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.9' stroke-opacity='.5'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3Cpath d='M40 14 L66 40 L40 66 L14 40 Z'/%3E%3Cpath d='M0 0 L14 14 M80 0 L66 14 M0 80 L14 66 M80 80 L66 66'/%3E%3Ccircle cx='40' cy='40' r='7'/%3E%3C/g%3E%3C/svg%3E");
  background-size:80px 80px;
}
.pattern-dense{background-size:52px 52px}

/* Default size for every icon() SVG. Context rules below override it;
   this only guarantees a missing rule can never inflate the layout. */
.ico{width:18px;height:18px;flex:0 0 auto}

/* ---------------------------------------------------------
   Ornaments
   --------------------------------------------------------- */
.rule-foil{height:2px;border:0;background:var(--foil);opacity:.85;margin:0}

.ornament{
  display:flex;align-items:center;justify-content:center;gap:14px;
  margin:14px 0 22px;
}
.ornament::before,.ornament::after{
  content:"";height:1px;width:min(120px,18vw);
  background:linear-gradient(90deg,transparent,var(--gold-400));
}
.ornament::after{background:linear-gradient(270deg,transparent,var(--gold-400))}
.ornament i{
  width:10px;height:10px;background:var(--gold-500);
  transform:rotate(45deg);border-radius:2px;display:block;
}
.ornament--start{justify-content:flex-start}
.ornament--start::before{display:none}

.eyebrow{
  font-family:var(--sans);font-size:.735rem;font-weight:700;
  letter-spacing:.24em;text-transform:uppercase;color:var(--gold-600);
  margin:0 0 .7em;
}
body[dir="rtl"] .eyebrow{letter-spacing:.06em;font-family:var(--arab)}

.tagline{
  font-family:var(--sans);font-size:.78rem;font-weight:700;
  letter-spacing:.3em;text-transform:uppercase;color:var(--gold-400);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.6em;
  font-family:var(--sans);font-weight:600;font-size:.94rem;
  padding:.78em 1.55em;border-radius:999px;border:1.5px solid transparent;
  cursor:pointer;transition:.22s cubic-bezier(.2,.7,.3,1);
  white-space:nowrap;line-height:1.2;
}
body[dir="rtl"] .btn{font-family:var(--arab)}

.btn-gold{background:var(--gold-500);color:#231703;border-color:var(--gold-500);box-shadow:0 4px 14px rgba(201,153,46,.32)}
.btn-gold:hover{background:var(--gold-400);border-color:var(--gold-400);color:#231703;transform:translateY(-1px);box-shadow:0 7px 20px rgba(201,153,46,.4)}

.btn-navy{background:var(--navy-800);color:var(--cream-100);border-color:var(--navy-800)}
.btn-navy:hover{background:var(--navy-700);color:#fff;transform:translateY(-1px)}

.btn-ghost{background:transparent;color:var(--navy-800);border-color:var(--gold-400)}
.btn-ghost:hover{background:var(--gold-500);border-color:var(--gold-500);color:#231703}

/* Kept as a separate name because the markup uses it, but on a light ground
   it has to be a dark-on-light outline like .btn-ghost. */
.btn-ghost-light{background:rgba(255,255,255,.6);color:var(--navy-800);border-color:var(--gold-400)}
.btn-ghost-light:hover{background:var(--navy-800);border-color:var(--navy-800);color:var(--cream-100)}

.btn-sm{padding:.5em 1.05em;font-size:.83rem}
.btn-lg{padding:.95em 2.1em;font-size:1.02rem}
.btn-block{display:flex;width:100%}
.btn[disabled],.btn.is-disabled{opacity:.5;pointer-events:none}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.topbar{
  background:var(--navy-900);color:var(--cream-300);
  font-size:.78rem;letter-spacing:.03em;
}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:38px;flex-wrap:wrap}
.topbar a{color:var(--gold-200)}
.topbar a:hover{color:#fff}
.topbar-links{display:flex;gap:18px;align-items:center}

.site-header{
  position:sticky;top:0;z-index:60;
  background:rgba(253,251,246,.93);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line-soft);
  transition:box-shadow .25s;
}
.site-header.is-stuck{box-shadow:var(--shadow-2)}
.site-header .wrap{display:flex;align-items:center;gap:20px;min-height:76px}

.brand{display:flex;align-items:center;gap:12px;flex:0 0 auto}
.brand-mark{width:44px;height:44px;flex:0 0 auto}
.brand-text{display:flex;flex-direction:column;line-height:1}
.brand-name{
  font-family:var(--serif);font-weight:700;font-size:1.5rem;
  letter-spacing:.13em;color:var(--navy-800);
}
.brand-sub{
  font-family:var(--sans);font-size:.56rem;font-weight:600;
  letter-spacing:.42em;color:var(--gold-600);margin-top:3px;padding-inline-start:2px;
}

.nav{display:flex;align-items:center;gap:4px;margin-inline-start:auto}
.nav a{
  font-size:.9rem;font-weight:500;color:var(--ink-soft);
  padding:.55em .85em;border-radius:8px;position:relative;
}
.nav a:hover{color:var(--navy-800);background:var(--cream-200)}
.nav a.active{color:var(--navy-800);font-weight:700}
.nav a.active::after{
  content:"";position:absolute;left:.85em;right:.85em;bottom:.18em;
  height:2px;background:var(--foil);border-radius:2px;
}
.nav-actions{display:flex;align-items:center;gap:10px;margin-inline-start:12px}

.lang-toggle{
  font-family:var(--sans);font-size:.76rem;font-weight:700;letter-spacing:.08em;
  border:1.5px solid var(--line);border-radius:999px;padding:.42em .85em;
  color:var(--ink-soft);background:var(--surface);
}
.lang-toggle:hover{border-color:var(--gold-400);color:var(--gold-700)}

.burger{
  display:none;width:44px;height:44px;border:1px solid var(--line);
  border-radius:10px;background:var(--surface);cursor:pointer;
  align-items:center;justify-content:center;flex-direction:column;gap:4px;
}
.burger span{display:block;width:19px;height:2px;background:var(--navy-800);border-radius:2px;transition:.2s}
.burger.is-open span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.burger.is-open span:nth-child(2){opacity:0}
.burger.is-open span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
/* The academy reads light: cream ground, navy type, gold ornament. Navy is
   kept for small structural bars (footer, table headers, badges), never for
   whole page backgrounds. */
.hero{
  position:relative;overflow:hidden;
  background:
    radial-gradient(120% 90% at 85% 12%,rgba(201,153,46,.16) 0%,transparent 62%),
    linear-gradient(165deg,var(--cream-50) 0%,var(--cream-200) 58%,var(--cream-300) 100%);
  color:var(--ink);
  padding:clamp(64px,9vw,116px) 0 clamp(96px,12vw,150px);
}
.hero::before{
  content:"";position:absolute;inset:0;opacity:.55;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.8'%3E%3Cpath d='M45 2 L88 45 L45 88 L2 45 Z'/%3E%3Cpath d='M45 18 L72 45 L45 72 L18 45 Z'/%3E%3Ccircle cx='45' cy='45' r='9'/%3E%3Cpath d='M2 2 L18 18 M88 2 L72 18 M2 88 L18 72 M88 88 L72 72'/%3E%3C/g%3E%3C/svg%3E");
  mask-image:linear-gradient(215deg,#000 0%,transparent 58%);
  -webkit-mask-image:linear-gradient(215deg,#000 0%,transparent 58%);
}
.hero-curve{
  position:absolute;left:0;right:0;bottom:-1px;z-index:2;
  width:100%;height:clamp(50px,7vw,96px);display:block;
}
.hero .wrap{position:relative;z-index:3}
.hero h1{color:var(--navy-800);margin-bottom:.35em}
.hero h1 .accent{
  /* Darker stops than the navy version needed — gold has to carry on cream. */
  background:linear-gradient(94deg,var(--gold-700),var(--gold-500),var(--gold-700));
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.hero-lede{font-size:clamp(1.02rem,1.6vw,1.2rem);color:var(--ink-soft);max-width:56ch;margin-bottom:2em}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:48px;align-items:center}
.hero-cta{display:flex;gap:14px;flex-wrap:wrap}

.pill-row{display:flex;flex-wrap:wrap;gap:0;margin:0 0 2em;border:1px solid var(--gold-300);border-radius:999px;overflow:hidden;width:fit-content;background:rgba(255,255,255,.72);box-shadow:var(--shadow-1)}
.pill-row .pill{display:flex;align-items:center;gap:.55em;padding:.7em 1.3em;font-size:.83rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--navy-700);border-inline-end:1px solid var(--gold-200)}
.pill-row .pill svg{stroke:var(--gold-600)}
.pill-row .pill:last-child{border-inline-end:0}
.pill-row .pill svg{width:17px;height:17px;flex:0 0 auto}
body[dir="rtl"] .pill-row .pill{text-transform:none;letter-spacing:0;font-size:.9rem}

/* Hero card (the "arch" motif from the brand collateral) */
/* White, not cream — it now sits on a cream hero and has to lift off it. */
.arch-card{
  position:relative;background:var(--surface);color:var(--ink);
  border-radius:200px 200px 22px 22px;padding:44px 32px 32px;
  box-shadow:var(--shadow-3);border:1px solid var(--gold-400);
  text-align:center;
}
.arch-card::after{
  content:"";position:absolute;inset:9px;border:1px solid var(--gold-300);
  border-radius:191px 191px 15px 15px;pointer-events:none;opacity:.65;
}
.arch-card .brand-mark{width:64px;height:64px;margin:0 auto 10px}
.arch-stats{display:grid;grid-template-columns:1fr 1fr;gap:2px;margin-top:22px;background:var(--line-soft);border-radius:12px;overflow:hidden}
.arch-stats div{background:var(--cream-100);padding:16px 8px}
.arch-stats b{display:block;font-family:var(--serif);font-size:1.6rem;color:var(--navy-800);line-height:1}
.arch-stats span{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-mute)}
body[dir="rtl"] .arch-stats span{text-transform:none;letter-spacing:0;font-size:.8rem}

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */
.section{padding:clamp(56px,7vw,92px) 0}
.section-cream{background:var(--cream-100)}
/* Was a navy block; now a light one framed in gold, so a call to action still
   reads as a distinct band without turning the page dark. */
.section-navy{
  background:
    radial-gradient(90% 120% at 50% 0%,rgba(201,153,46,.13) 0%,transparent 60%),
    linear-gradient(180deg,var(--cream-50),var(--cream-200));
  color:var(--ink);
  border-top:2px solid var(--gold-400);
  border-bottom:2px solid var(--gold-400);
}
.section-navy h2,.section-navy h3{color:var(--navy-800)}
.section-navy .eyebrow{color:var(--gold-700)}
.section-navy .section-head p{color:var(--ink-soft)}

.section-head{text-align:center;max-width:660px;margin:0 auto clamp(34px,4vw,52px)}
.section-head p{color:var(--ink-soft);font-size:1.03rem;margin:0}
.section-navy .section-head p{color:rgba(247,241,228,.75)}
.section-head--start{text-align:start;margin-inline:0}

/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */
.grid{display:grid;gap:24px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.grid-auto{grid-template-columns:repeat(auto-fill,minmax(268px,1fr))}

.card{
  background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius);padding:26px;box-shadow:var(--shadow-1);
  transition:.25s cubic-bezier(.2,.7,.3,1);position:relative;
}
.card-hover:hover{transform:translateY(-4px);box-shadow:var(--shadow-2);border-color:var(--gold-300)}
.card-pad-0{padding:0;overflow:hidden}

.icon-badge{
  width:56px;height:56px;border-radius:50%;background:var(--navy-800);
  display:grid;place-items:center;margin-bottom:18px;
  border:2px solid var(--gold-400);flex:0 0 auto;
}
.icon-badge svg{width:26px;height:26px;stroke:var(--gold-300);fill:none;stroke-width:1.6}
.icon-badge-sm{width:40px;height:40px;border-width:1.5px}
.icon-badge-sm svg{width:19px;height:19px}
.icon-badge-gold{background:var(--gold-500);border-color:var(--gold-600)}
.icon-badge-gold svg{stroke:var(--navy-900)}

/* Course card */
.course-card{display:flex;flex-direction:column;height:100%}
.course-cover{
  position:relative;aspect-ratio:16/9;
  background:linear-gradient(150deg,var(--cream-100),var(--cream-300));
  border-bottom:1px solid var(--gold-200);
  display:grid;place-items:center;overflow:hidden;
}
.course-cover::before{
  content:"";position:absolute;inset:0;opacity:.55;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.7'%3E%3Cpath d='M30 2 L58 30 L30 58 L2 30 Z'/%3E%3Ccircle cx='30' cy='30' r='6'/%3E%3C/g%3E%3C/svg%3E");
}
.course-cover .glyph{
  position:relative;font-family:var(--serif);font-size:2.6rem;color:var(--navy-800);
}
/* Bottom, not top. Uploaded course banners carry the academy's own logo
   across the top of the artwork, and a badge pinned up there sat on it. */
.course-level{
  position:absolute;bottom:12px;inset-inline-start:12px;z-index:3;
  background:var(--navy-800);border:1px solid var(--navy-800);
  color:var(--gold-200);font-size:.68rem;font-weight:700;letter-spacing:.12em;
  text-transform:uppercase;padding:.32em .8em;border-radius:999px;
  box-shadow:0 2px 10px rgba(10,28,54,.3);
}
body[dir="rtl"] .course-level{letter-spacing:0;text-transform:none;font-size:.75rem}
.course-body{padding:22px;display:flex;flex-direction:column;flex:1}
.course-body h3{font-size:1.22rem;margin-bottom:.35em}
.course-desc{color:var(--ink-soft);font-size:.92rem;flex:1;margin-bottom:1.1em}
.course-meta{display:flex;gap:16px;flex-wrap:wrap;font-size:.8rem;color:var(--ink-mute);margin-bottom:1.1em;padding-top:14px;border-top:1px solid var(--line-soft)}
.course-meta span{display:inline-flex;align-items:center;gap:.4em}
.course-meta svg{width:14px;height:14px;stroke:var(--gold-600);fill:none;stroke-width:1.8}
.course-foot{display:flex;align-items:center;justify-content:space-between;gap:12px}
.price{font-family:var(--serif);font-size:1.42rem;font-weight:700;color:var(--navy-800)}
.price small{font-family:var(--sans);font-size:.72rem;font-weight:500;color:var(--ink-mute);letter-spacing:.04em}
.price-free{color:var(--ok)}

/* Book card */
.book-card{display:flex;flex-direction:column;height:100%}
.book-cover{
  aspect-ratio:3/4;position:relative;overflow:hidden;
  background:linear-gradient(150deg,var(--cream-100) 0%,var(--cream-300) 100%);
  display:flex;align-items:center;justify-content:center;padding:18px;
  border-bottom:3px solid var(--gold-500);
}
.book-cover::after{
  content:"";position:absolute;inset:10px;border:1px solid var(--gold-300);border-radius:4px;
}
.book-cover span{
  position:relative;font-family:var(--arab);font-size:1.15rem;font-weight:700;
  color:var(--navy-800);text-align:center;line-height:1.5;
}
.book-spine{position:absolute;inset-inline-start:0;top:0;bottom:0;width:7px;background:var(--foil)}
.book-body{padding:16px 18px 18px;flex:1;display:flex;flex-direction:column}
.book-body h4{margin-bottom:.2em;font-size:.97rem}
.book-author{font-size:.8rem;color:var(--ink-mute);margin-bottom:.9em;flex:1}

/* Stat block */
/* Light cells with a navy rule on top — the header-bar-over-light-body
   pattern the brand's own reports use. */
.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line);border-radius:var(--radius);overflow:hidden;border:1px solid var(--line)}
.stat{background:var(--surface);padding:30px 18px;text-align:center;position:relative}
.stat::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--foil)}
.stat b{display:block;font-family:var(--serif);font-size:clamp(1.9rem,3.4vw,2.7rem);color:var(--navy-800);line-height:1;margin-bottom:.25em}
.stat span{font-size:.8rem;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-mute)}
body[dir="rtl"] .stat span{letter-spacing:0;text-transform:none;font-size:.9rem}

/* Feature list with gold check */
.check-list{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.check-list li{display:flex;gap:12px;align-items:flex-start;font-size:.95rem}
.check-list li::before{
  content:"";flex:0 0 auto;width:20px;height:20px;border-radius:50%;margin-top:2px;
  background:var(--gold-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1C36' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
.table-wrap{overflow-x:auto;border:1px solid var(--line-soft);border-radius:var(--radius);background:var(--surface)}
table.tbl{width:100%;border-collapse:collapse;font-size:.9rem;min-width:560px}
table.tbl th{
  text-align:start;font-weight:700;font-size:.72rem;letter-spacing:.13em;text-transform:uppercase;
  color:var(--cream-200);background:var(--navy-800);padding:13px 16px;white-space:nowrap;
}
body[dir="rtl"] table.tbl th{letter-spacing:0;text-transform:none;font-size:.82rem}
table.tbl td{padding:13px 16px;border-top:1px solid var(--line-soft);vertical-align:middle}
table.tbl tbody tr:hover{background:var(--cream-100)}
table.tbl .num{font-variant-numeric:tabular-nums}

.badge{
  display:inline-flex;align-items:center;gap:.35em;font-size:.72rem;font-weight:700;
  letter-spacing:.06em;text-transform:uppercase;padding:.3em .7em;border-radius:999px;
  border:1px solid transparent;white-space:nowrap;
}
body[dir="rtl"] .badge{letter-spacing:0;text-transform:none;font-size:.78rem}
.badge-gold{background:var(--gold-100);color:var(--gold-700);border-color:var(--gold-300)}
.badge-navy{background:#E5EBF3;color:var(--navy-700);border-color:#C6D3E3}
.badge-ok{background:#E1F1E8;color:var(--ok);border-color:#B9DFC9}
.badge-warn{background:#FBF0DA;color:var(--warn);border-color:#F0DCAE}
.badge-err{background:#F8E4E0;color:var(--err);border-color:#EEC4BC}
.badge-mute{background:var(--cream-200);color:var(--ink-mute);border-color:var(--line)}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.field{margin-bottom:16px}
.field label{display:block;font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft);margin-bottom:6px}
body[dir="rtl"] .field label{letter-spacing:0;text-transform:none;font-size:.88rem}
.input,select.input,textarea.input{
  width:100%;font-family:inherit;font-size:.95rem;color:var(--ink);
  background:var(--surface);border:1.5px solid var(--line);border-radius:var(--radius-sm);
  padding:.7em .9em;transition:.18s;
}
textarea.input{min-height:120px;resize:vertical;line-height:1.6}
.input:focus{outline:none;border-color:var(--gold-400);box-shadow:0 0 0 3px rgba(201,153,46,.16)}
.input::placeholder{color:#9AA7B8}
select.input{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7A90' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .8em center;background-size:16px;padding-inline-end:2.4em}
body[dir="rtl"] select.input{background-position:left .8em center}
.field-hint{font-size:.78rem;color:var(--ink-mute);margin-top:5px}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}

.alert{padding:13px 16px;border-radius:var(--radius-sm);font-size:.9rem;margin-bottom:18px;border:1px solid}
.alert-err{background:#F8E4E0;border-color:#EEC4BC;color:#8E2E20}
.alert-ok{background:#E1F1E8;border-color:#B9DFC9;color:#1D5E3B}
.alert-info{background:#E9EFF7;border-color:#C6D3E3;color:var(--navy-700)}

/* Auth panel */
.auth-shell{min-height:calc(100vh - 76px);display:grid;grid-template-columns:1fr 1fr;background:var(--cream-100)}
.auth-aside{
  background:linear-gradient(160deg,var(--cream-50),var(--cream-300));
  color:var(--ink);border-inline-end:1px solid var(--gold-300);
  padding:clamp(36px,5vw,64px);display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden;
}
.auth-aside::before{content:"";position:absolute;inset:0;opacity:.45;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.8'%3E%3Cpath d='M45 2 L88 45 L45 88 L2 45 Z'/%3E%3Cpath d='M45 18 L72 45 L45 72 L18 45 Z'/%3E%3C/g%3E%3C/svg%3E")}
.auth-aside h2{color:var(--navy-800)}
.auth-aside .check-list li{color:var(--ink-soft)}
.auth-aside .tagline{color:var(--gold-700)}
.auth-aside>*{position:relative}
.auth-main{padding:clamp(36px,5vw,64px);display:flex;flex-direction:column;justify-content:center}
.auth-card{width:100%;max-width:420px;margin-inline:auto}

/* ---------------------------------------------------------
   Dashboard shell
   --------------------------------------------------------- */
.dash{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:calc(100vh - 76px)}
/* A grid column grows to fit its widest content unless told otherwise, so a
   wide table or the row of menu links would stretch the whole page past the
   screen (and a phone then shrinks the page to fit). Both halves may shrink;
   the wide things scroll inside their own boxes instead. */
.dash>*{min-width:0}
.side{
  background:var(--cream-50);color:var(--ink);padding:24px 0;
  border-inline-end:1px solid var(--line);
}
.side-user{padding:0 22px 20px;margin-bottom:14px;border-bottom:1px solid var(--line-soft)}
.avatar{
  width:46px;height:46px;border-radius:50%;background:var(--gold-500);color:var(--navy-900);
  display:grid;place-items:center;font-family:var(--serif);font-weight:700;font-size:1.15rem;margin-bottom:10px;
}
.side-user b{display:block;font-size:.95rem;color:var(--navy-800)}
.side-user span{font-size:.75rem;color:var(--gold-700);letter-spacing:.1em;text-transform:uppercase;font-weight:700}
body[dir="rtl"] .side-user span{letter-spacing:0;text-transform:none;font-size:.82rem}
.side nav{display:flex;flex-direction:column;gap:2px;padding:0 12px}
.side nav a{
  display:flex;align-items:center;gap:11px;padding:.68em .8em;border-radius:9px;
  color:var(--ink-soft);font-size:.9rem;font-weight:500;
}
.side nav a svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;flex:0 0 auto}
.side nav a:hover{background:var(--cream-200);color:var(--navy-800)}
.side nav a.active{background:var(--navy-800);color:var(--cream-100);font-weight:700}
.side nav a.active svg{stroke:var(--gold-300)}
.side-sep{margin:16px 22px;height:1px;background:var(--line-soft)}
.side-label{padding:0 22px;font-size:.66rem;letter-spacing:.18em;text-transform:uppercase;color:var(--gold-700);margin-bottom:8px;font-weight:700}
body[dir="rtl"] .side-label{letter-spacing:0;text-transform:none;font-size:.76rem}

.dash-main{padding:clamp(22px,3vw,36px);background:var(--cream-100);min-width:0}
.dash-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:26px}
.dash-head h1{font-size:clamp(1.6rem,3vw,2.1rem);margin:0}
.dash-head p{margin:.3em 0 0;color:var(--ink-mute);font-size:.93rem}

.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px;margin-bottom:28px}
.kpi{background:var(--surface);border:1px solid var(--line-soft);border-radius:var(--radius);padding:20px;position:relative;overflow:hidden}
.kpi::after{content:"";position:absolute;inset-inline-start:0;top:0;bottom:0;width:4px;background:var(--foil)}
.kpi span{font-size:.74rem;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-mute);display:block;margin-bottom:8px}
body[dir="rtl"] .kpi span{letter-spacing:0;text-transform:none;font-size:.84rem}
.kpi b{font-family:var(--serif);font-size:2.1rem;color:var(--navy-800);line-height:1;display:block}
.kpi small{font-size:.78rem;color:var(--ink-mute);display:block;margin-top:6px}

.panel{background:var(--surface);border:1px solid var(--line-soft);border-radius:var(--radius);overflow:hidden;margin-bottom:24px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;border-bottom:1px solid var(--line-soft);background:var(--cream-50);flex-wrap:wrap}
.panel-head h3{margin:0;font-size:1.05rem;font-family:var(--sans);font-weight:700}
.panel-body{padding:20px}
.panel-body>:last-child{margin-bottom:0}
.panel .table-wrap{border:0;border-radius:0}

/* progress */
.bar{height:8px;background:var(--cream-300);border-radius:999px;overflow:hidden;min-width:90px}
.bar i{display:block;height:100%;background:var(--foil);border-radius:999px}
.bar-lg{height:12px}

/* ---------------------------------------------------------
   Blog
   --------------------------------------------------------- */
.post-card{display:flex;flex-direction:column;height:100%}
.post-card .post-tag{font-size:.7rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--gold-600);margin-bottom:.55em}
body[dir="rtl"] .post-card .post-tag{letter-spacing:0;text-transform:none;font-size:.8rem}
.post-card h3{font-size:1.16rem;margin-bottom:.4em}
.post-card p{color:var(--ink-soft);font-size:.9rem;flex:1}
.post-meta{font-size:.78rem;color:var(--ink-mute);display:flex;gap:14px;margin-top:1em;padding-top:12px;border-top:1px solid var(--line-soft)}

.prose{font-size:1.05rem;line-height:1.8;color:#22334D;max-width:70ch}
.prose h2{margin-top:1.7em;font-size:1.7rem}
.prose h3{margin-top:1.5em}
.prose blockquote{
  margin:1.6em 0;padding:.2em 0 .2em 1.4em;border-inline-start:3px solid var(--gold-400);
  font-family:var(--serif);font-size:1.2rem;font-style:italic;color:var(--navy-700);
}
body[dir="rtl"] .prose blockquote{padding:.2em 1.4em .2em 0;font-family:var(--arab);font-style:normal}
.prose .ayah{
  display:block;background:var(--cream-200);border:1px solid var(--gold-300);border-radius:var(--radius);
  padding:22px;margin:1.7em 0;font-family:var(--arab);font-size:1.35rem;line-height:2.1;
  text-align:center;color:var(--navy-800);direction:rtl;
}
.prose ul,.prose ol{padding-inline-start:1.3em}
.prose li{margin-bottom:.5em}

/* ---------------------------------------------------------
   Games / apps
   --------------------------------------------------------- */
.game-shell{max-width:560px;margin-inline:auto;text-align:center}
.game-status{
  font-family:var(--serif);font-size:1.32rem;font-weight:700;color:var(--navy-800);
  min-height:2.1em;display:flex;align-items:center;justify-content:center;gap:.5em;
}
.xo-board{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;aspect-ratio:1;max-width:360px;margin:0 auto 22px}
.xo-cell{
  background:var(--surface);border:2px solid var(--line);border-radius:var(--radius);
  font-family:var(--serif);font-size:3rem;font-weight:700;color:var(--navy-800);
  display:grid;place-items:center;cursor:pointer;transition:.16s;user-select:none;
}
.xo-cell:hover:not(.taken){border-color:var(--gold-400);background:var(--cream-100)}
.xo-cell.o{color:var(--gold-600)}
.xo-cell.win{background:var(--gold-100);border-color:var(--gold-500)}
.xo-cell.taken{cursor:default}

.c4-board{
  display:grid;grid-template-columns:repeat(7,1fr);gap:8px;padding:12px;
  background:var(--navy-800);border-radius:var(--radius);max-width:440px;margin:0 auto 22px;
  border:2px solid var(--gold-500);
}
.c4-cell{aspect-ratio:1;border-radius:50%;background:var(--navy-900);box-shadow:inset 0 2px 6px rgba(0,0,0,.5);cursor:pointer;transition:.15s}
.c4-cell.r{background:radial-gradient(circle at 32% 30%,#E06A5A,#B3402F)}
.c4-cell.y{background:radial-gradient(circle at 32% 30%,var(--gold-300),var(--gold-600))}
.c4-cell.win{box-shadow:0 0 0 3px #fff,inset 0 2px 6px rgba(0,0,0,.4)}
.c4-board:hover .c4-cell:not(.r):not(.y){background:#0d2340}

.app-tile{display:flex;gap:18px;align-items:flex-start}
.app-tile .icon-badge{margin-bottom:0}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer{background:var(--navy-900);color:rgba(247,241,228,.72);padding:clamp(48px,6vw,72px) 0 0;position:relative;overflow:hidden}
.site-footer::before{content:"";position:absolute;inset:0;opacity:.12;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23E0BE71' stroke-width='.8'%3E%3Cpath d='M40 2 L78 40 L40 78 L2 40 Z'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E")}
.site-footer .wrap{position:relative}
.foot-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:36px;padding-bottom:44px}
.site-footer h4{color:var(--gold-300);font-size:.78rem;letter-spacing:.18em;text-transform:uppercase;margin-bottom:1.2em}
body[dir="rtl"] .site-footer h4{letter-spacing:0;text-transform:none;font-size:.95rem}
.site-footer .brand-name{color:#fff}
.site-footer ul{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.site-footer a{color:rgba(247,241,228,.72);font-size:.9rem}
.site-footer a:hover{color:var(--gold-300)}
.foot-bottom{border-top:1px solid rgba(224,190,113,.22);padding:20px 0;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:.82rem}
.social{display:flex;gap:10px}
.social a{width:36px;height:36px;border:1px solid rgba(224,190,113,.35);border-radius:50%;display:grid;place-items:center}
.social a:hover{background:var(--gold-500);border-color:var(--gold-500)}
.social svg{width:16px;height:16px;stroke:var(--gold-200);fill:none;stroke-width:1.7}
.social a:hover svg{stroke:var(--navy-900)}

/* ---------------------------------------------------------
   Utilities
   --------------------------------------------------------- */
.mb-0{margin-bottom:0}.mt-0{margin-top:0}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:36px}
.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.text-center{text-align:center}
.text-mute{color:var(--ink-mute)}
.text-sm{font-size:.86rem}
.text-xs{font-size:.78rem}
.flex{display:flex}
.flex-between{display:flex;align-items:center;justify-content:space-between;gap:14px}
.flex-gap{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.flex-1{flex:1}
.hide{display:none}
.nowrap{white-space:nowrap}
.empty{text-align:center;padding:46px 20px;color:var(--ink-mute)}
.empty svg{width:44px;height:44px;stroke:var(--line);fill:none;stroke-width:1.4;margin:0 auto 14px}

.filters{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:28px;align-items:center}
.filters .input{width:auto;min-width:150px}
.chip{
  padding:.45em 1em;border-radius:999px;border:1.5px solid var(--line);
  background:var(--surface);font-size:.85rem;font-weight:600;color:var(--ink-soft);cursor:pointer;
}
.chip:hover{border-color:var(--gold-400);color:var(--gold-700)}
.chip.active{background:var(--navy-800);border-color:var(--navy-800);color:var(--cream-100)}

.breadcrumb{font-size:.82rem;color:var(--ink-mute);margin-bottom:1.2em;display:flex;gap:.5em;flex-wrap:wrap}
.breadcrumb a{color:var(--ink-mute)}
.breadcrumb a:hover{color:var(--gold-600)}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width:1000px){
  .hero-grid{grid-template-columns:1fr;gap:36px}
  .arch-card{max-width:430px;margin-inline:auto}
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .foot-grid{grid-template-columns:1fr 1fr}
  .stat-row{grid-template-columns:repeat(2,1fr)}
  .auth-shell{grid-template-columns:1fr}
  .auth-aside{display:none}
}
@media (max-width:860px){
  .site-header .wrap{min-height:66px}
  .burger{display:flex}
  .nav{
    position:fixed;inset:66px 0 auto;background:var(--cream-50);
    flex-direction:column;align-items:stretch;gap:0;padding:12px var(--gutter) 22px;
    border-bottom:1px solid var(--line);box-shadow:var(--shadow-2);
    transform:translateY(-130%);transition:.3s cubic-bezier(.2,.7,.3,1);margin:0;
    max-height:calc(100vh - 66px);overflow-y:auto;
  }
  .nav.is-open{transform:translateY(0)}
  .nav a{padding:.85em .6em;border-bottom:1px solid var(--line-soft);border-radius:0}
  .nav a.active::after{display:none}
  .nav-actions{margin:16px 0 0;flex-direction:column;align-items:stretch}
  .nav-actions .btn{width:100%}
  .dash{grid-template-columns:minmax(0,1fr)}
  .side{padding:16px 0;min-width:0;max-width:100vw}
  .side nav{flex-direction:row;overflow-x:auto;padding:0 12px 6px}
  .side nav a{white-space:nowrap}
  .side-sep,.side-label{display:none}
  .side-user{display:flex;align-items:center;gap:12px;padding-bottom:14px}
  .avatar{margin-bottom:0}
}
@media (max-width:620px){
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .foot-grid{grid-template-columns:1fr}
  .field-row{grid-template-columns:1fr}
  .stat-row{grid-template-columns:1fr}
  .topbar-links span.hide-sm{display:none}
  .pill-row{width:100%;border-radius:var(--radius)}
  .pill-row .pill{flex:1;justify-content:center;padding:.65em .6em}
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* Reveal on scroll */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .7s ease,transform .7s cubic-bezier(.2,.7,.3,1)}
.reveal.is-in{opacity:1;transform:none}

@media print{
  .site-header,.site-footer,.topbar,.side,.btn{display:none!important}
  body{background:#fff}
}

/* ---------------------------------------------------------
   Inline icon sizing — icon() emits a bare <svg>, so give it
   a size wherever it lands.
   --------------------------------------------------------- */
.btn svg{width:16px;height:16px;flex:0 0 auto;stroke-width:2}
.btn-lg svg{width:18px;height:18px}
.btn-sm svg{width:14px;height:14px}
.badge svg{width:12px;height:12px;flex:0 0 auto}
.topbar svg{width:13px;height:13px;display:inline-block;vertical-align:-2px}
.text-xs svg,.text-sm svg{width:13px;height:13px;display:inline-block;vertical-align:-2px;stroke:var(--gold-600)}
.panel-head svg{width:16px;height:16px}
.brand-mark{display:block}

/* Auth screens run without the site header, so they own the viewport. */
.auth-shell{min-height:100vh}
.auth-brand{display:none}
@media (max-width:1000px){
  .auth-brand{display:flex;margin-bottom:24px}
}

/* ---------------------------------------------------------
   Image upload control
   --------------------------------------------------------- */
.upload-row{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.upload-preview{
  width:180px;flex:0 0 auto;border-radius:var(--radius-sm);overflow:hidden;
  border:1.5px solid var(--line);background:var(--cream-200);
  display:grid;place-items:center;
}
.upload-preview img{width:100%;height:100%;object-fit:cover;display:block}
.upload-empty svg{width:30px;height:30px;stroke:var(--line);fill:none;stroke-width:1.4}
.upload-controls{flex:1;min-width:230px;display:grid;gap:8px;align-content:start}
.upload-controls input[type=file]{padding:.5em;font-size:.86rem;cursor:pointer}
.upload-controls input[type=file]::file-selector-button{
  font:inherit;font-weight:600;font-size:.82rem;margin-inline-end:.8em;cursor:pointer;
  padding:.42em 1em;border-radius:999px;border:1.5px solid var(--gold-400);
  background:transparent;color:var(--navy-800);
}
.upload-controls input[type=file]::file-selector-button:hover{background:var(--gold-500);border-color:var(--gold-500)}
.upload-remove{display:flex;align-items:center;gap:.5em;font-size:.85rem;color:var(--err);cursor:pointer}
.upload-remove input{accent-color:var(--err);width:15px;height:15px;cursor:pointer}

/* Photos replacing the generated placeholders */
.course-cover img,.book-cover img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;
}
.course-cover.has-img::before,.book-cover.has-img::after{display:none}
.course-cover.has-img .glyph{display:none}
.book-cover.has-img span{display:none}
/* Only the bottom is darkened, and only enough to keep the badge legible.
   The top is left completely clean so an uploaded banner's own artwork and
   logo are never dimmed. */
.course-cover.has-img::after{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(0deg,rgba(10,28,54,.5) 0%,rgba(10,28,54,.16) 24%,transparent 46%);
}
.avatar-img{object-fit:cover;display:block}
.avatar.has-img{background:none;border:2px solid var(--gold-400);overflow:hidden;padding:0}
.avatar.has-img img{width:100%;height:100%;object-fit:cover;border-radius:50%}

/* ---------------------------------------------------------
   Featured app banner (Quran Tracker)
   --------------------------------------------------------- */
.feature-app{
  position:relative;overflow:hidden;margin-bottom:28px;
  background:
    radial-gradient(80% 120% at 85% 0%,rgba(201,153,46,.14) 0%,transparent 60%),
    linear-gradient(150deg,var(--cream-50) 0%,var(--cream-200) 100%);
  color:var(--ink);border:1.5px solid var(--gold-400);border-radius:var(--radius-lg);
  padding:clamp(26px,4vw,42px);box-shadow:var(--shadow-2);
}
.feature-app::before{
  content:"";position:absolute;inset:0;opacity:.5;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.8'%3E%3Cpath d='M45 2 L88 45 L45 88 L2 45 Z'/%3E%3Cpath d='M45 18 L72 45 L45 72 L18 45 Z'/%3E%3Ccircle cx='45' cy='45' r='9'/%3E%3C/g%3E%3C/svg%3E");
  mask-image:linear-gradient(240deg,#000,transparent 65%);
  -webkit-mask-image:linear-gradient(240deg,#000,transparent 65%);
}
.feature-app>*{position:relative;z-index:1}
.feature-app h2{color:var(--navy-800);font-size:clamp(1.6rem,3vw,2.2rem);margin-bottom:.15em}
.feature-app .eyebrow{color:var(--gold-700)}
.feature-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:34px;align-items:center}
.feature-lede{color:var(--ink-soft);font-size:1.04rem;max-width:52ch}

.feature-list{list-style:none;padding:0;margin:0;display:grid;gap:13px}
.feature-list li{display:flex;gap:13px;align-items:flex-start;font-size:.96rem;color:var(--ink-soft)}
.feature-list .ic{
  flex:0 0 auto;width:34px;height:34px;border-radius:9px;display:grid;place-items:center;
  background:var(--navy-800);border:1px solid var(--gold-400);
}
.feature-list .ic svg{width:16px;height:16px;stroke:var(--gold-300);fill:none;stroke-width:1.8}

.feature-note{
  display:flex;gap:13px;align-items:flex-start;margin-top:22px;padding:15px 17px;
  background:var(--surface);border:1px solid var(--gold-300);
  border-radius:var(--radius);font-size:.9rem;color:var(--ink-soft);
}
.feature-note svg{width:19px;height:19px;stroke:var(--gold-600);fill:none;stroke-width:1.8;flex:0 0 auto;margin-top:2px}
.feature-note b{color:var(--navy-800)}

@media (max-width:860px){
  .feature-grid{grid-template-columns:1fr;gap:26px}
}

/* External-destination markers on app tiles */
.ext-mark{display:inline-block;vertical-align:middle;margin-inline-start:.35em;opacity:.55}
.ext-mark svg{width:14px;height:14px;stroke:var(--ink-mute);fill:none;stroke-width:1.9}
.card-hover:hover .ext-mark{opacity:1}
.card-hover:hover .ext-mark svg{stroke:var(--gold-600)}
.ext-host{
  display:inline-block;margin-inline-start:.7em;font-size:.76rem;color:var(--ink-mute);
  vertical-align:middle;
}

/* Attached-file indicator on the book form */
.file-state{
  width:180px;flex:0 0 auto;aspect-ratio:3/4;border-radius:var(--radius-sm);
  border:1.5px dashed var(--line);background:var(--cream-200);
  display:grid;place-content:center;justify-items:center;gap:10px;
  text-align:center;padding:14px;font-size:.84rem;color:var(--ink-mute);
}
.file-state svg{width:28px;height:28px;stroke:var(--line);fill:none;stroke-width:1.5}
.file-state.is-set{border-style:solid;border-color:var(--ok);background:#E9F4EE;color:var(--ok)}
.file-state.is-set svg{stroke:var(--ok)}

/* =========================================================================
   MOTION
   =========================================================================
   Everything below animates transform and opacity only — the two properties
   a browser can hand to the GPU — so nothing here triggers layout or paint
   while scrolling. The whole block switches off under prefers-reduced-motion
   at the end.

   Reveal states are gated behind .js on <html>, set by an inline script in
   the head. With JavaScript off, nothing is ever left hidden.
   ========================================================================= */

@keyframes nq-fade-up   { from{opacity:0;transform:translate3d(0,26px,0)}   to{opacity:1;transform:none} }
@keyframes nq-fade-in   { from{opacity:0}                                   to{opacity:1} }
@keyframes nq-fade-start{ from{opacity:0;transform:translate3d(-28px,0,0)}  to{opacity:1;transform:none} }
@keyframes nq-fade-end  { from{opacity:0;transform:translate3d(28px,0,0)}   to{opacity:1;transform:none} }
@keyframes nq-scale-in  { from{opacity:0;transform:scale(.93)}              to{opacity:1;transform:none} }
@keyframes nq-arch-in   { from{opacity:0;transform:translate3d(0,34px,0) scale(.97)} to{opacity:1;transform:none} }
@keyframes nq-shimmer   { from{background-position:200% 0}                  to{background-position:-200% 0} }
@keyframes nq-float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-9px)} }
@keyframes nq-drift     { from{background-position:0 0}                     to{background-position:90px 90px} }
@keyframes nq-orn       { from{opacity:0;transform:rotate(45deg) scale(0)}  to{opacity:1;transform:rotate(45deg) scale(1)} }
@keyframes nq-rule      { from{transform:scaleX(0)}                         to{transform:scaleX(1)} }
@keyframes nq-pulse     { 0%,100%{box-shadow:0 0 0 0 rgba(201,153,46,.42)} 70%{box-shadow:0 0 0 14px rgba(201,153,46,0)} }

/* ---------- scroll reveal ---------- */
.js .reveal{opacity:0}
.js .reveal.is-in{
  animation:nq-fade-up .72s cubic-bezier(.16,.84,.36,1) both;
  animation-delay:var(--d,0ms);
}
.js .reveal-in.is-in   { animation-name:nq-fade-in }
.js .reveal-start.is-in{ animation-name:nq-fade-start }
.js .reveal-end.is-in  { animation-name:nq-fade-end }
.js .reveal-scale.is-in{ animation-name:nq-scale-in }

/* ---------- hero entrance ---------- */
.js .hero-anim > *{animation:nq-fade-up .8s cubic-bezier(.16,.84,.36,1) both}
.js .hero-anim > *:nth-child(1){animation-delay:.05s}
.js .hero-anim > *:nth-child(2){animation-delay:.15s}
.js .hero-anim > *:nth-child(3){animation-delay:.25s}
.js .hero-anim > *:nth-child(4){animation-delay:.35s}
.js .hero-anim > *:nth-child(5){animation-delay:.45s}
.js .arch-card{animation:nq-arch-in .9s cubic-bezier(.16,.84,.36,1) .3s both}

/* The geometric ground drifts, very slowly. */
.hero::before{animation:nq-drift 70s linear infinite}
.feature-app::before{animation:nq-drift 90s linear infinite}

/* ---------- gold rules draw themselves in ---------- */
.rule-foil{transform-origin:left center}
.js .rule-foil{animation:nq-rule .8s cubic-bezier(.16,.84,.36,1) both}
body[dir="rtl"] .rule-foil{transform-origin:right center}

.js .ornament i{animation:nq-orn .5s cubic-bezier(.2,1.4,.4,1) .25s both}
.js .ornament::before,.js .ornament::after{animation:nq-fade-in .7s ease .1s both}

/* Foil surfaces catch the light as it passes. */
.kpi::after,.stat::before{
  background:linear-gradient(100deg,#9A7420,#D4A94A,#F2E3BE,#C9992E,#E0BE71,#9A7420);
  background-size:200% 100%;
  animation:nq-shimmer 6s linear infinite;
}

/* ---------- cards ---------- */
.card-hover{transition:transform .35s cubic-bezier(.16,.84,.36,1),box-shadow .35s,border-color .35s}
.card-hover:hover{transform:translateY(-6px)}
.card-hover:active{transform:translateY(-2px)}

.card-hover .icon-badge{transition:transform .4s cubic-bezier(.2,1.3,.4,1),background .3s,border-color .3s}
.card-hover:hover .icon-badge{transform:scale(1.09) rotate(-6deg);background:var(--gold-500);border-color:var(--gold-600)}
.card-hover:hover .icon-badge svg{stroke:var(--navy-900)}
.icon-badge svg{transition:stroke .3s}

.course-cover img,.book-cover img{transition:transform .6s cubic-bezier(.16,.84,.36,1)}
.card-hover:hover .course-cover img,
.card-hover:hover .book-cover img{transform:scale(1.06)}
.course-cover .glyph{transition:transform .5s cubic-bezier(.2,1.2,.4,1)}
.card-hover:hover .course-cover .glyph{transform:scale(1.12) rotate(4deg)}

.card-hover h3,.card-hover h3 a{transition:color .25s}
.card-hover:hover h3,.card-hover:hover h3 a{color:var(--gold-700)}

/* ---------- buttons: a light sweeps across on hover ---------- */
.btn{position:relative;overflow:hidden;isolation:isolate}
.btn::after{
  content:"";position:absolute;inset:0;z-index:-1;
  background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.42) 50%,transparent 80%);
  transform:translateX(-120%);transition:transform .6s cubic-bezier(.16,.84,.36,1);
}
.btn:hover::after{transform:translateX(120%)}
.btn-gold.btn-lg:hover{animation:nq-pulse 1.4s ease-out}

/* ---------- nav ---------- */
.nav a::after{
  content:"";position:absolute;left:.85em;right:.85em;bottom:.18em;height:2px;
  background:var(--foil);border-radius:2px;
  transform:scaleX(0);transform-origin:center;transition:transform .3s cubic-bezier(.16,.84,.36,1);
}
.nav a:hover::after{transform:scaleX(1)}
.nav a.active::after{transform:scaleX(1)}

.brand{transition:transform .35s cubic-bezier(.2,1.2,.4,1)}
.brand:hover{transform:scale(1.03)}
.brand-mark{transition:transform .6s cubic-bezier(.2,1.2,.4,1)}
.brand:hover .brand-mark{transform:rotate(-8deg) scale(1.06)}

/* ---------- progress bars fill when they scroll in ---------- */
.bar i{width:0;transition:width 1.1s cubic-bezier(.16,.84,.36,1) .15s}
.bar i.is-filled{width:var(--w)}

/* ---------- table rows ---------- */
table.tbl tbody tr{transition:background .2s,transform .2s}
table.tbl tbody tr:hover{transform:translateX(2px)}
body[dir="rtl"] table.tbl tbody tr:hover{transform:translateX(-2px)}

/* ---------- games ---------- */
@keyframes nq-drop{from{transform:translateY(-320%)} to{transform:translateY(0)}}
@keyframes nq-pop {0%{transform:scale(0) rotate(-25deg)} 60%{transform:scale(1.18) rotate(4deg)} 100%{transform:scale(1) rotate(0)}}
.xo-cell{transition:background .2s,border-color .2s,transform .2s}
.xo-cell:hover:not(.taken){transform:scale(1.04)}
.xo-cell.taken{animation:nq-pop .34s cubic-bezier(.2,1.3,.4,1) both}
.xo-cell.win{animation:nq-pulse 1s ease-out 2}
.c4-cell.r,.c4-cell.y{animation:nq-drop .38s cubic-bezier(.34,.06,.5,1) both}
.c4-cell.win{animation:nq-pulse 1s ease-out 2}

/* ---------- misc ---------- */
.badge,.chip{transition:transform .2s,background .2s,border-color .2s,color .2s}
.chip:hover{transform:translateY(-2px)}
.social a{transition:transform .3s cubic-bezier(.2,1.3,.4,1),background .25s,border-color .25s}
.social a:hover{transform:translateY(-3px) scale(1.08)}
.avatar{transition:transform .35s cubic-bezier(.2,1.3,.4,1)}
.card-hover:hover .avatar{transform:scale(1.06)}
.upload-preview img{transition:transform .4s}
.upload-preview:hover img{transform:scale(1.04)}
.feature-list li{transition:transform .25s}
.feature-list li:hover{transform:translateX(4px)}
body[dir="rtl"] .feature-list li:hover{transform:translateX(-4px)}
.alert{animation:nq-fade-up .45s cubic-bezier(.16,.84,.36,1) both}
.panel,.kpi{transition:box-shadow .3s,transform .3s}
.kpi:hover{transform:translateY(-3px);box-shadow:var(--shadow-2)}

/* The mark on the closing call to action breathes. */
.section-navy .brand-logo{animation:nq-float 5s ease-in-out infinite}

.reveal,.card-hover{backface-visibility:hidden}

/* ---------- the switch ---------- */
@media (prefers-reduced-motion:reduce){
  .js .reveal,.js .reveal.is-in,.js .hero-anim > *,.js .arch-card,
  .js .rule-foil,.js .ornament i,.js .ornament::before,.js .ornament::after{
    animation:none !important;opacity:1 !important;transform:none !important;
  }
  .hero::before,.feature-app::before,.kpi::after,.stat::before,
  .section-navy .brand-logo,.xo-cell.taken,.c4-cell.r,.c4-cell.y,.alert{animation:none !important}
  .bar i{transition:none;width:var(--w)}
  .btn::after{display:none}
}

/* Parallax offset written by the scroll handler. */
.hero::before{transform:translate3d(0,var(--py,0),0)}

/* ---------------------------------------------------------
   Brand artwork
   The mark ships at 320px and the lockup at 720px; both are
   sized down in CSS so they stay sharp on any display.
   --------------------------------------------------------- */
.brand-mark{width:44px;height:auto;flex:0 0 auto;object-fit:contain}
.brand-logo{width:100%;max-width:300px;height:auto;margin-inline:auto}
.arch-card .brand-logo{max-width:230px;margin-bottom:6px}
.auth-aside .brand-logo{max-width:250px;margin-inline:0}
.section-navy .brand-logo{max-width:230px;margin-inline:auto}
.error-mark{width:96px;margin:0 auto}

/* =========================================================================
   Hub pages — the internal teacher and student profiles
   ========================================================================= */
.hub-head{
  position:relative;overflow:hidden;
  background:
    radial-gradient(90% 130% at 88% 0%,rgba(201,153,46,.15) 0%,transparent 62%),
    linear-gradient(165deg,var(--cream-50) 0%,var(--cream-200) 100%);
  border-bottom:2px solid var(--gold-400);
  padding:clamp(20px,3vw,30px) 0 clamp(26px,4vw,40px);
}
.hub-head::before{
  content:"";position:absolute;inset:0;opacity:.4;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23C9992E' stroke-width='.7'%3E%3Cpath d='M40 2 L78 40 L40 78 L2 40 Z'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
  mask-image:linear-gradient(250deg,#000,transparent 60%);
  -webkit-mask-image:linear-gradient(250deg,#000,transparent 60%);
}
.hub-head .wrap{position:relative;z-index:1}

.hub-id{display:flex;gap:clamp(18px,3vw,34px);align-items:flex-start;flex-wrap:wrap}
.hub-photo{
  width:clamp(96px,13vw,150px);aspect-ratio:1;flex:0 0 auto;border-radius:50%;
  overflow:hidden;border:3px solid var(--gold-400);background:var(--surface);
  box-shadow:var(--shadow-2);
}
.hub-photo img{width:100%;height:100%;object-fit:cover}
.hub-photo-empty{
  display:grid;place-items:center;background:var(--navy-800);
  font-family:var(--serif);font-size:clamp(2rem,4vw,3rem);color:var(--gold-300);
}
.hub-id-text{flex:1;min-width:260px}
.hub-id-text h1{font-size:clamp(1.7rem,3.6vw,2.6rem);margin:0}
.hub-role{
  font-family:var(--sans);font-size:.94rem;font-weight:600;
  color:var(--gold-700);margin:.3em 0 0;
}
body[dir="rtl"] .hub-role{font-family:var(--arab)}
.hub-bio{color:var(--ink-soft);max-width:62ch;margin-bottom:.9em}
.hub-progress{margin-top:16px;max-width:320px}

/* ---------- the link tiles ---------- */
.link-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}
.link-card{
  display:flex;align-items:center;gap:14px;padding:16px 18px;
  background:var(--surface);border:1.5px solid var(--line-soft);
  border-radius:var(--radius);box-shadow:var(--shadow-1);
  transition:transform .3s cubic-bezier(.16,.84,.36,1),box-shadow .3s,border-color .3s;
}
.link-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-2);border-color:var(--gold-400)}
.link-card .icon-badge{margin-bottom:0}
.link-card-text{display:flex;flex-direction:column;min-width:0;flex:1}
.link-card-text b{color:var(--navy-800);font-size:.98rem;line-height:1.3}
.link-card-text small{color:var(--ink-mute);font-size:.79rem}
.link-card-go{width:15px;height:15px;stroke:var(--ink-mute);flex:0 0 auto;transition:stroke .25s,transform .25s}
.link-card:hover .link-card-go{stroke:var(--gold-600);transform:translateX(3px)}
body[dir="rtl"] .link-card:hover .link-card-go{transform:translateX(-3px)}

/* ---------- roster rows ---------- */
.roster-name{display:flex;align-items:center;gap:11px;color:inherit}
.roster-name b{display:block;color:var(--navy-800);font-size:.94rem;line-height:1.25}
.roster-name small{display:block;color:var(--ink-mute);font-size:.76rem}
.roster-name:hover b{color:var(--gold-700)}

/* ---------- the embedded calendar ---------- */
.cal-frame{
  display:block;width:100%;height:420px;border:0;
  border-top:1px solid var(--line-soft);background:var(--cream-50);
}

@media (max-width:900px){
  .cal-frame{height:340px}
}
@media (max-width:820px){
  .hub-id{gap:18px}
  .hub-id-text{min-width:0}
}

/* =========================================================================
   MOBILE & APP
   ========================================================================= */

/* ---------- safe areas ----------
   In standalone mode the page owns the whole screen, including the strip
   under a notch and the home indicator. Pad the fixed edges back. */
.topbar .wrap,
.site-header .wrap{
  padding-inline-start:max(var(--gutter),env(safe-area-inset-left));
  padding-inline-end:max(var(--gutter),env(safe-area-inset-right));
}
.site-footer{padding-bottom:env(safe-area-inset-bottom)}
.nav{padding-bottom:max(22px,env(safe-area-inset-bottom))}

/* ---------- two-column layouts that actually collapse ----------
   These were inline `grid-template-columns` on the elements themselves,
   which no media query can reach — so every one of them stayed two columns
   on a phone and squeezed the content. They are classes now. */
.grid-aside{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
.grid-main {grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}
.grid-wide {grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)}
.grid-even {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.grid-cover{grid-template-columns:250px minmax(0,1fr)}

@media (max-width:940px){
  .grid-aside,.grid-main,.grid-wide,.grid-even{grid-template-columns:1fr}
  .grid-cover{grid-template-columns:190px minmax(0,1fr)}
}
@media (max-width:620px){
  .grid-cover{grid-template-columns:1fr;justify-items:center}
  .grid-cover > :first-child{max-width:240px;width:100%}
}

/* ---------- touch ---------- */
@media (hover:none){
  /* Hover lifts are meaningless on a touch screen and leave cards stuck in
     the hovered state after a tap. */
  .card-hover:hover,.kpi:hover,.link-card:hover,.chip:hover,.social a:hover{transform:none}
  .card-hover:active,.link-card:active{transform:scale(.985)}
  .btn:hover::after{transform:translateX(-120%)}
  table.tbl tbody tr:hover{transform:none}
}
a,button,.btn,.chip,summary,label{-webkit-tap-highlight-color:rgba(201,153,46,.18)}
.btn,.chip,.nav a,.side nav a,.lang-toggle{touch-action:manipulation}

/* Every tap target reaches the 44px minimum on a phone. */
@media (max-width:620px){
  .btn-sm{padding:.62em 1.1em;min-height:38px}
  .btn{min-height:44px}
  .nav a{min-height:46px;display:flex;align-items:center}
  .social a{width:42px;height:42px}
}

/* ---------- iOS zooms a text field whose font is under 16px ----------
   The fix is the font size, not user-scalable=no: pinch zoom stays available. */
@media (max-width:820px){
  .input,select.input,textarea.input,
  input[type=text],input[type=email],input[type=password],
  input[type=url],input[type=search],input[type=number],input[type=tel]{
    font-size:16px;
  }
}

/* ---------- tables ----------
   They scroll sideways rather than reflow, so say so: a soft edge appears
   while there is more to the right, and disappears at the end. */
.table-wrap{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  background:
    linear-gradient(90deg,var(--surface) 30%,rgba(255,255,255,0)) left / 36px 100% no-repeat,
    linear-gradient(270deg,var(--surface) 30%,rgba(255,255,255,0)) right / 36px 100% no-repeat,
    radial-gradient(farthest-side at 0 50%,rgba(10,28,54,.16),transparent) left / 12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%,rgba(10,28,54,.16),transparent) right / 12px 100% no-repeat;
  background-attachment:local,local,scroll,scroll;
}
@media (max-width:620px){
  table.tbl{min-width:520px;font-size:.86rem}
  table.tbl th,table.tbl td{padding:11px 12px}
}

/* ---------- phone layout ---------- */
@media (max-width:620px){
  :root{--gutter:16px}

  .hero{padding:clamp(34px,8vw,56px) 0 clamp(56px,12vw,80px)}
  .hero-cta{flex-direction:column;align-items:stretch}
  .hero-cta .btn{width:100%}
  .arch-card{border-radius:130px 130px 18px 18px;padding:30px 20px 24px}
  .arch-card::after{border-radius:124px 124px 12px 12px}

  .hub-id{flex-direction:column;align-items:center;text-align:center}
  .hub-id-text{text-align:center}
  .hub-id-text .ornament--start{justify-content:center}
  .hub-id-text .ornament--start::before{display:block}
  .hub-id-text .flex-gap{justify-content:center}
  .hub-progress{margin-inline:auto}
  .breadcrumb{justify-content:center}

  .link-grid{grid-template-columns:1fr}
  .feature-app{padding:22px 18px}
  .feature-grid{gap:22px}

  .dash-main{padding:16px}
  .dash-head{gap:12px}
  .dash-head .flex-gap,.dash-head > .flex-gap{width:100%}
  .kpi-grid{grid-template-columns:1fr 1fr;gap:12px}
  .kpi{padding:14px}
  .kpi b{font-size:1.6rem}

  .filters{gap:8px}
  .filters .input{min-width:0;flex:1}

  .panel-head{padding:14px 16px}
  .panel-body{padding:16px}
  .section{padding:clamp(38px,9vw,56px) 0}

  .cal-frame{height:300px}
  .upload-row{flex-direction:column}
  .upload-preview{width:100%;max-width:220px}

  .foot-bottom{flex-direction:column;text-align:center;gap:10px}
}

@media (max-width:420px){
  .kpi-grid{grid-template-columns:1fr}
  .xo-board{max-width:100%}
  .c4-board{padding:8px;gap:5px}
  .hub-photo{width:96px}
}

/* ---------- standalone: it is an app now, not a page ---------- */
@media (display-mode:standalone){
  /* The browser's own chrome is gone, so the marketing strip goes too. */
  .topbar{display:none}
  .site-header{padding-top:env(safe-area-inset-top)}
  body{overscroll-behavior-y:none}
}

/* The search box in a filter bar: wide on a desktop, full width on a phone.
   Set here rather than inline, so the phone breakpoint can actually win. */
.filters-search{flex:1;min-width:200px}
@media (max-width:620px){
  .filters-search{min-width:0;flex:1 1 100%}
  .filters .input{min-width:0}
  .filters .btn{flex:1}
}

/* =========================================================================
   Hero illustration — students before an open mushaf
   ========================================================================= */
.hero-scene{
  display:block;width:100%;height:auto;
  margin:6px 0 2px;
  overflow:visible;
}

/* The three figures breathe, each on its own offset so they never move as
   one block. */
@keyframes hs-breathe{
  0%,100%{transform:translateY(0)}
  50%    {transform:translateY(-3.5px)}
}
.hs-fig{
  animation:hs-breathe 4.6s ease-in-out infinite;
  animation-delay:var(--d,0s);
  transform-box:fill-box;
  transform-origin:center bottom;
}

/* The pool of light under the mushaf swells and settles. */
@keyframes hs-glow{
  0%,100%{opacity:.75;transform:scale(1)}
  50%    {opacity:1;transform:scale(1.07)}
}
.hs-glow{
  animation:hs-glow 5.5s ease-in-out infinite;
  transform-box:fill-box;
  transform-origin:center;
}

/* Light through the arch drifts, very slightly. */
@keyframes hs-rays{
  0%,100%{opacity:.34;transform:translateX(-5px)}
  50%    {opacity:.6;transform:translateX(5px)}
}
.hs-rays{animation:hs-rays 9s ease-in-out infinite}

/* The lantern swings from its cord, not its middle. */
@keyframes hs-swing{
  0%,100%{transform:rotate(-3.2deg)}
  50%    {transform:rotate(3.2deg)}
}
.hs-lantern{
  animation:hs-swing 6s ease-in-out infinite;
  transform-origin:330px 18px;
}
@keyframes hs-flame{
  0%,100%{opacity:.55}
  50%    {opacity:1}
}
.hs-flame{animation:hs-flame 2.6s ease-in-out infinite}

/* A highlight crosses the open pages. */
@keyframes hs-shine{
  0%      {transform:translateX(0);opacity:0}
  12%     {opacity:1}
  55%     {opacity:1}
  70%,100%{transform:translateX(200px);opacity:0}
}
.hs-shine{
  animation:hs-shine 6.5s cubic-bezier(.4,0,.5,1) infinite;
  transform-box:view-box;
}

/* Gold ornaments rise out of the light and fade. */
@keyframes hs-mote{
  0%      {transform:translateY(10px) scale(.5);opacity:0}
  18%     {opacity:.9}
  75%     {opacity:.5}
  100%    {transform:translateY(-46px) scale(1.05);opacity:0}
}
.hs-mote{
  animation:hs-mote 7s ease-out infinite;
  animation-delay:var(--d,0s);
  transform-box:fill-box;
  transform-origin:center;
  opacity:0;
}

/* The book settles into place once, on load. */
@keyframes hs-book-in{
  from{transform:translateY(14px) scale(.96);opacity:0}
  to  {transform:none;opacity:1}
}
.js .hs-book{
  animation:hs-book-in .9s cubic-bezier(.16,.84,.36,1) .45s both;
  transform-box:fill-box;
  transform-origin:center bottom;
}

@media (prefers-reduced-motion:reduce){
  .hs-fig,.hs-glow,.hs-rays,.hs-lantern,.hs-flame,.hs-shine,.js .hs-book{
    animation:none !important;transform:none !important;opacity:1 !important;
  }
  .hs-mote{animation:none !important;opacity:.7 !important}
}

/* The card now carries an illustration, so it needs less padding at the top
   and the logo can be smaller. */
.arch-card .brand-logo{max-width:180px;margin-bottom:2px}
.arch-card .arch-stats{margin-top:14px}
@media (max-width:620px){
  .arch-card .brand-logo{max-width:150px}
}

/* =========================================================================
   Floating WhatsApp button
   =========================================================================
   Bottom-left on every page. WhatsApp green rather than the brand gold on
   purpose — this one is a recognised badge, and a visitor should know what
   it is before reading anything.
   ========================================================================= */
.wa-float{
  position:fixed;z-index:70;
  left:max(18px,env(safe-area-inset-left));
  bottom:max(18px,env(safe-area-inset-bottom));
  display:flex;align-items:center;gap:0;
  height:56px;padding:0;border-radius:999px;
  background:#25D366;color:#fff;
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 6px 20px rgba(18,140,63,.38),0 2px 6px rgba(10,28,54,.18);
  overflow:hidden;
  transition:box-shadow .3s,transform .3s cubic-bezier(.16,.84,.36,1);
}
.wa-float:hover,.wa-float:focus-visible{
  color:#fff;transform:translateY(-3px);
  box-shadow:0 10px 28px rgba(18,140,63,.45),0 3px 8px rgba(10,28,54,.2);
}

.wa-float-ico{
  width:52px;height:52px;flex:0 0 auto;
  display:grid;place-items:center;
}
.wa-float-ico svg{width:27px;height:27px;stroke:#fff;stroke-width:1.7;fill:none}

/* The label is folded away and opens on hover, so the button stays a small
   badge until someone reaches for it. */
.wa-float-text{
  max-width:0;opacity:0;white-space:nowrap;
  font-family:var(--sans);font-weight:700;font-size:.92rem;
  transition:max-width .38s cubic-bezier(.16,.84,.36,1),opacity .25s,padding .38s;
  padding-inline-end:0;
}
body[dir="rtl"] .wa-float-text{font-family:var(--arab)}
.wa-float:hover .wa-float-text,
.wa-float:focus-visible .wa-float-text{
  max-width:190px;opacity:1;padding-inline-end:20px;
}

/* A slow ring, so it is noticed once without nagging. */
@keyframes wa-ring{
  0%     {box-shadow:0 0 0 0 rgba(37,211,102,.5),0 6px 20px rgba(18,140,63,.38)}
  70%    {box-shadow:0 0 0 16px rgba(37,211,102,0),0 6px 20px rgba(18,140,63,.38)}
  100%   {box-shadow:0 0 0 0 rgba(37,211,102,0),0 6px 20px rgba(18,140,63,.38)}
}
.wa-float{animation:wa-ring 3.4s ease-out 1.5s infinite}
.wa-float:hover{animation:none}

/* On a phone it is a plain round badge — there is no hover to open a label,
   and the screen edge is precious. */
@media (max-width:620px){
  .wa-float{
    height:54px;
    left:max(14px,env(safe-area-inset-left));
    bottom:max(14px,env(safe-area-inset-bottom));
  }
  .wa-float-ico{width:50px;height:50px}
  .wa-float-text{display:none}
}

/* Touch devices never get the hover, so never fold the label open. */
@media (hover:none){
  .wa-float:hover{transform:none}
  .wa-float-text{display:none}
}

@media (prefers-reduced-motion:reduce){
  .wa-float{animation:none}
  .wa-float:hover{transform:none}
  .wa-float-text{transition:none}
}

@media print{ .wa-float{display:none} }

/* The calendar subscription row */
.feed-row{display:flex;gap:8px;align-items:center;margin-bottom:10px}
.feed-url{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem;flex:1;min-width:0}
.feed-row .btn{flex:0 0 auto}
@media (max-width:620px){
  .feed-row{flex-wrap:wrap}
  .feed-row .btn{width:100%}
}

/* =========================================================================
   Testimonials
   ========================================================================= */

/* ---------- the headline rating ---------- */
.rating-bar{
  display:flex;align-items:center;gap:clamp(16px,3vw,30px);flex-wrap:wrap;
  padding:20px clamp(18px,3vw,28px);margin-bottom:26px;
  background:var(--surface);border:1.5px solid var(--gold-300);
  border-radius:var(--radius);box-shadow:var(--shadow-1);
}
.rating-score{display:flex;align-items:center;gap:12px}
.rating-score b{
  font-family:var(--serif);font-size:clamp(2.2rem,4.5vw,3rem);
  color:var(--navy-800);line-height:1;
}
.rating-text{flex:1;min-width:150px;line-height:1.4}
.rating-text b{display:block;font-size:1.02rem;color:var(--navy-800)}
.rating-text small{color:var(--ink-mute);font-size:.86rem}

/* ---------- stars ---------- */
.stars{display:inline-flex;gap:2px;vertical-align:middle}
.star{width:17px;height:17px;fill:var(--cream-400);flex:0 0 auto}
.star.is-on{fill:var(--gold-500)}
.rating-score .star{width:22px;height:22px}

/* ---------- the wall ----------
   Columns rather than grid rows: quotes vary a lot in length, and a grid
   would leave every card in a row as tall as the longest one. */
.testi-grid{columns:3;column-gap:22px}
@media (max-width:1000px){ .testi-grid{columns:2} }
@media (max-width:660px) { .testi-grid{columns:1} }

.testi{
  position:relative;break-inside:avoid;margin:0 0 22px;
  background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius);padding:24px 22px 20px;
  box-shadow:var(--shadow-1);
  transition:transform .35s cubic-bezier(.16,.84,.36,1),box-shadow .35s,border-color .35s;
}
.testi:hover{transform:translateY(-4px);box-shadow:var(--shadow-2);border-color:var(--gold-300)}
.testi.is-featured{border-color:var(--gold-400);background:linear-gradient(170deg,var(--cream-50),var(--surface) 55%)}

/* The quote mark is decoration, so it sits behind the text and is not read. */
.testi-mark{
  position:absolute;top:-6px;inset-inline-end:16px;
  font-family:var(--serif);font-size:5.5rem;line-height:1;
  color:var(--gold-200);opacity:.55;pointer-events:none;user-select:none;
}

.testi-quote{
  margin:12px 0 18px;padding:0;border:0;
  font-size:.98rem;line-height:1.72;color:var(--ink-soft);
  position:relative;
}
body[dir="rtl"] .testi-quote{font-size:1.02rem;line-height:1.9}

.testi-who{display:flex;align-items:center;gap:12px;padding-top:16px;border-top:1px solid var(--line-soft)}
.testi-id{min-width:0}
.testi-id b{display:block;color:var(--navy-800);font-size:.96rem;line-height:1.3}
.testi-id small{display:block;color:var(--ink-mute);font-size:.79rem}

.testi-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}
.testi-src{font-size:.75rem;color:var(--ink-mute)}

@media (max-width:620px){
  .testi{padding:20px 18px 16px}
  .testi-mark{font-size:4.5rem}
  .rating-bar{gap:14px}
  .rating-bar .btn{width:100%}
}

/* ---------- the three on the home page ---------- */
.testi-home .testi{margin-bottom:0}

/* ---------------------------------------------------------
   The weekly pattern picker
   A student takes two or three lessons a week on different
   days, so each day carries its own time rather than sharing
   one.
   --------------------------------------------------------- */
.day-grid{display:grid;gap:8px}
.day-row{
  display:grid;grid-template-columns:22px 1fr 120px;align-items:center;gap:12px;
  padding:9px 12px;border:1.5px solid var(--line-soft);border-radius:var(--radius-sm);
  background:var(--surface);cursor:pointer;transition:border-color .2s,background .2s;
}
.day-row:hover{border-color:var(--gold-300)}
.day-row.is-on{border-color:var(--gold-500);background:var(--cream-50)}
.day-row input[type=checkbox]{width:18px;height:18px;accent-color:var(--gold-600);cursor:pointer}
.day-name{font-weight:600;color:var(--navy-800);font-size:.93rem}
.day-row .day-time{padding:.35em .5em;font-size:.86rem}
.day-row:not(.is-on) .day-time{opacity:.45}

.mode-chip{cursor:pointer;user-select:none}

@media (max-width:620px){
  .day-row{grid-template-columns:22px 1fr 110px;gap:8px;padding:8px 10px}
  .day-name{font-size:.88rem}
}

/* =========================================================================
   Reports — the reporting sheet as pages
   ========================================================================= */
.d-block{display:block}
.month-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.month-nav b{min-width:120px;text-align:center;font-size:.95rem;color:var(--navy-800)}

/* P / L / A / E marks */
.att{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;border-radius:6px;font-size:.72rem;font-weight:700;background:var(--cream-200);color:var(--ink-mute);white-space:nowrap}
.att-P{background:#E1F1E8;color:var(--ok)}
.att-L{background:#FBF0DA;color:var(--warn)}
.att-A{background:#F8E4E0;color:var(--err)}
.att-E{background:#E5EBF3;color:var(--navy-700)}
a.att:hover{filter:brightness(.95)}

.att-grid{min-width:0!important}
.att-grid th,.att-grid td{padding:6px 3px!important;text-align:center;white-space:nowrap;font-size:.8rem}
/* Every day is a drawn column, so a mark can be traced up to its date. */
.att-grid th,.att-grid td{border-inline-end:1px solid var(--line-soft)}
.att-grid thead th{border-bottom:2px solid var(--line)}
.att-grid .att-name{text-align:start;padding-inline:12px!important;position:sticky;inset-inline-start:0;background:var(--surface);z-index:1;min-width:150px;border-inline-end:2px solid var(--line)}
.att-grid thead .att-name{background:inherit}
.att-grid td.is-weekend{background:var(--cream-50)}
/* The header stays navy; a weekend day is a lighter shade of it, not cream,
   so its number stays readable. */
.att-grid thead th.is-weekend{background:var(--navy-600)}
.att-grid td .att+.att{margin-inline-start:2px}
/* The column under the pointer lights up, header included. */
.att-grid td.is-hot,.att-grid th.is-hot{background:rgba(212,169,74,.16)}
.att-grid tbody tr:hover{transform:none}
.att-grid tbody td:empty::after{content:"·";color:var(--line);font-size:.75rem}

/* horizontal bar breakdowns */
.breakdown h4{font-family:var(--sans);font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);margin:0 0 10px}
.hbar{display:grid;grid-template-columns:minmax(80px,120px) minmax(0,1fr) 64px;gap:10px;align-items:center;margin-bottom:8px;font-size:.84rem}
.hbar .bar{min-width:0}
.hbar-P .bar i{background:var(--ok)}
.hbar-L .bar i{background:var(--warn)}
.hbar-A .bar i{background:var(--err)}
.hbar-E .bar i{background:var(--navy-600)}
/* The same scale for a percentage on its own: good, fair, weak, bad. */
.tone-good{color:var(--ok)!important}
.tone-fair{color:var(--navy-600)!important}
.tone-weak{color:var(--warn)!important}
.tone-bad{color:var(--err)!important}

/* forms */
.field-row-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.check-label{display:flex!important;align-items:center;gap:10px;text-transform:none!important;letter-spacing:0!important;font-size:.9rem!important;font-weight:600!important;color:var(--ink)!important}
.check-label input,.skill-tbl input[type=checkbox]{width:18px;height:18px;accent-color:var(--gold-600)}
.skill-tbl td{padding:8px 12px}
.rep-tbl td{vertical-align:top}

/* read-only lesson report */
.rep-dl{display:grid;grid-template-columns:minmax(120px,200px) 1fr;gap:10px 18px;margin:0}
.rep-dl dt{font-size:.78rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-mute)}
.rep-dl dd{margin:0;font-size:.92rem}

/* quarterly report and invoice sheets */
.qr-sheet{background:var(--surface);border:1px solid var(--line-soft);border-radius:var(--radius);padding:clamp(18px,3vw,34px)}
.qr-title{text-align:center;margin-bottom:22px}
.qr-title .brand-logo{max-width:110px;height:auto;margin:0 auto 8px;display:block}
.qr-meta>div{background:var(--cream-50);border:1px solid var(--line-soft);border-radius:var(--radius-sm);padding:10px 14px}
.qr-sec{margin-top:24px}
.qr-sec h3{font-family:var(--sans);font-size:.78rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--gold-700);border-bottom:1px solid var(--line);padding-bottom:6px;margin:0 0 12px}
.ladder{list-style:none;margin:0;padding:0}
.ladder li{padding:8px 12px;border:1px solid var(--line-soft);border-radius:var(--radius-sm);margin-bottom:6px;display:flex;justify-content:space-between;gap:10px;font-size:.88rem}
.ladder li small{color:var(--ink-mute);white-space:nowrap}
.ladder li.is-current{border-color:var(--navy-800);background:#E5EBF3;font-weight:700}
.ladder li.is-target{border-color:var(--gold-400);background:var(--gold-100)}
.sign-row{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin-top:40px}
.sign-row>div{border-top:1px solid var(--ink-mute);padding-top:8px;font-size:.82rem;color:var(--ink-mute);line-height:2}
.inv-total td{background:var(--navy-800)!important;color:var(--cream-100)!important;font-weight:700}

@media (max-width:620px){
  .field-row-3{grid-template-columns:1fr}
  .hbar{grid-template-columns:minmax(0,1fr) 64px}
  .hbar>span:first-child{grid-column:1/-1}
  .rep-dl{grid-template-columns:1fr;gap:2px}
  .rep-dl dd{margin-bottom:10px}
  .sign-row{grid-template-columns:1fr}
}

@media print{
  .dash{display:block}
  .dash-main{padding:0;background:#fff}
  .no-print,.alert,.wa-float{display:none!important}
  .qr-sheet{border:0;padding:0}
  .qr-sec,.panel{break-inside:avoid}
  .bar i{width:var(--w,auto)}
}

/* ---------------------------------------------------------
   Home page: popular courses, larger and edge to edge
   --------------------------------------------------------- */
.wrap-wide{max-width:1560px}
.course-grid-lg{gap:clamp(22px,2.4vw,36px)}
.course-grid-lg .course-cover .glyph{font-size:3.6rem}
.course-grid-lg .course-level{font-size:.78rem;padding:.4em 1em;bottom:16px;inset-inline-start:16px}
.course-grid-lg .course-body{padding:clamp(22px,2.2vw,32px)}
.course-grid-lg .course-body h3{font-size:clamp(1.35rem,1.6vw,1.7rem)}
.course-grid-lg .course-desc{font-size:1.02rem}
.course-grid-lg .course-meta{font-size:.9rem;gap:20px}
.course-grid-lg .course-meta svg{width:16px;height:16px}
.course-grid-lg .price{font-size:1.8rem}
.course-grid-lg .btn-sm{padding:.6em 1.4em;font-size:.92rem}
@media (max-width:1100px) and (min-width:621px){
  .course-grid-lg{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------------------------------------------------------
   Multi-pick dropdown (lesson report: Quran, activity, disposition)
   --------------------------------------------------------- */
.multi{position:relative}
.multi-summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;user-select:none}
.multi-summary::-webkit-details-marker{display:none}
.multi-summary::after{content:"";flex:0 0 auto;width:7px;height:7px;margin-top:-4px;border-right:2px solid var(--ink-mute);border-bottom:2px solid var(--ink-mute);transform:rotate(45deg)}
.multi[open] .multi-summary{border-color:var(--gold-400);box-shadow:0 0 0 3px rgba(201,153,46,.16)}
/* Wrap the chosen items onto as many lines as needed, so a Quran field with
   many surahs shows them all and never overflows into the next column. */
.multi-text{min-width:0;color:#9AA7B8;line-height:1.55;overflow-wrap:anywhere}
.multi-summary{align-items:flex-start}
/* Grid cells must be allowed to shrink, or a long field pushes its neighbour
   (e.g. Details) off the row. */
.field-row>*,.field-row-3>*{min-width:0}
.multi.has-value .multi-text{color:var(--ink)}
.multi-pop{position:absolute;z-index:40;inset-inline:0;top:calc(100% + 6px);min-width:min(300px,86vw);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-2);padding:8px}
.multi-search{margin-bottom:6px}
.multi-list{max-height:290px;overflow:auto;overscroll-behavior:contain}
.field .multi-opt{display:flex;align-items:center;gap:10px;margin:0;padding:8px;border-radius:6px;cursor:pointer;text-transform:none;letter-spacing:0;font-size:.92rem;font-weight:500;color:var(--ink)}
.field .multi-opt:hover{background:var(--cream-100)}
.multi-opt input{flex:0 0 auto;width:17px;height:17px;accent-color:var(--gold-600)}
.multi-opt input:checked+span{font-weight:700;color:var(--navy-800)}
.multi-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:6px;padding-top:8px;border-top:1px solid var(--line-soft)}
@media (max-width:620px){.multi-pop{position:static;margin-top:6px}}

/* ---------------------------------------------------------
   Admin-only panels (student fees)
   --------------------------------------------------------- */
.panel-admin{border-color:var(--gold-300)}
.panel-admin .panel-head{background:var(--gold-100)}
.fee-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.fee-sum>div{background:var(--cream-50);border:1px solid var(--line-soft);border-radius:var(--radius-sm);padding:12px 14px}
.fee-sum span{display:block;font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-mute);margin-bottom:4px}
.fee-sum b{font-family:var(--serif);font-size:1.6rem;color:var(--navy-800);line-height:1.1}
.fee-sum .fee-due{background:var(--navy-800);border-color:var(--navy-800)}
.fee-sum .fee-due span{color:var(--gold-200)}
.fee-sum .fee-due b{color:var(--cream-100)}
@media (max-width:620px){.fee-sum{grid-template-columns:1fr 1fr}.fee-sum .fee-due{grid-column:1/-1}}

/* The multi-pick list opens in the page flow, pushing the fields below it
   down. Floated over the page it was cut off by .panel's overflow:hidden,
   leaving only the search box visible. */
.multi-pop{position:static;min-width:0;margin-top:6px;box-shadow:var(--shadow-1)}

/* A row hidden by the search must actually hide: the display rule above
   would otherwise win over the hidden attribute. */
.multi-opt[hidden]{display:none!important}

/* Quran memorisation tracker */
.quran-tbl td{vertical-align:middle}
.quran-row.is-done{background:rgba(46,125,82,.06)}
.quran-tbl .qmem{text-align:center}

.panel-link{transition:box-shadow .2s,transform .2s}
.panel-link:hover{box-shadow:var(--shadow-2);transform:translateY(-2px)}

/* Quiz play */
.quiz-opt{display:flex;align-items:center;gap:10px;padding:11px 14px;border:1px solid var(--line-soft);border-radius:var(--radius-sm);margin-bottom:8px;cursor:pointer}
.quiz-opt:hover{border-color:var(--gold-400)}
.quiz-opt input{flex:0 0 auto;width:18px;height:18px;accent-color:var(--gold-600)}
.quiz-opt span{flex:1}
.quiz-correct{background:#E1F1E8;border-color:#B9DFC9}
.quiz-wrong{background:#F8E4E0;border-color:#EEC4BC}
.quiz-tag{font-weight:700}

/* ---------- wide tables: slide arrows and drag (narqa.js) ----------
   Floats at the bottom of the window while a table wider than the screen
   is in view, since the table's own scrollbar is at its far end. */
.tbl-pan{
  position:fixed;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:60;
  display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:999px;
  background:var(--navy-800);color:var(--cream-100);box-shadow:0 8px 24px rgba(10,28,54,.28);
  font-size:.8rem;direction:ltr
}
.tbl-pan[hidden]{display:none}
.tbl-pan span{padding:0 4px;white-space:nowrap;opacity:.85}
.tbl-pan button{
  width:38px;height:34px;border-radius:999px;border:0;cursor:pointer;
  background:var(--gold-400);color:var(--navy-900);font-size:.9rem;line-height:1
}
.tbl-pan button:disabled{opacity:.3;cursor:default}
.tbl-pan button:not(:disabled):hover{background:var(--gold-300)}
.table-wrap.is-pannable{cursor:grab}
.table-wrap.is-dragging{cursor:grabbing;user-select:none}
.table-wrap.is-pannable a{cursor:pointer}
.table-wrap::-webkit-scrollbar{height:10px}
.table-wrap::-webkit-scrollbar-thumb{background:var(--gold-300);border-radius:999px}
.table-wrap::-webkit-scrollbar-track{background:var(--cream-200,#f3ecdc)}
@media print{.tbl-pan{display:none}}
