/* MURSHEDE visual system — Arabic-first RTL. Colors derived from the logo, Rashed and the reference design. */
:root {
  --blue: #1b63b5;          /* logo blue */
  --blue-deep: #12406f;
  --navy: #17324d;          /* headings */
  --teal: #0a7570;          /* primary action — darkened for WCAG AA (white text 5.6:1) */
  --teal-2: #1fb3a3;
  --mint: #e3f6f1;
  --gold: #f6b800;          /* Rashed / star */
  --gold-soft: #fff4d6;
  --brown: #8a5a2b;         /* warm brown from Rashed's shoes */
  --sky: #eaf5fb;
  --lav: #f3ecfa;
  --pink: #fdeef3;
  --ink: #1f2d3a;
  --muted: #5b6b78;
  --line: #dbe6ee;
  --bg: #f7fbfd;
  --card: #ffffff;
  --ok: #1d7a4a;
  --warn: #9a5b00;
  --err: #b42318;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 28px rgba(23, 50, 77, .08);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #1b63b5;
  --font: "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, "Geeza Pro", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.75; font-size: 17px; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1000; }
.skip-link:focus { top: 10px; }
[hidden] { display: none !important; } /* the hidden attribute must win over component display rules (.btn …) */
.dev-banner { background: #fff2cc; color: #6b4b00; text-align: center; font-size: .85rem; padding: 4px 12px; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.page { padding-block: 28px 64px; }
.page-loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #0a7570, #08605c); color: #fff; box-shadow: 0 6px 16px rgba(10, 117, 112, .28); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-gold { background: var(--gold); color: #3d2c00; }
.btn-danger { background: #fff; color: var(--err); border-color: #f2c4bf; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-account { background: var(--navy); color: #fff; min-height: 42px; padding: 6px 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; }
label { font-weight: 600; color: var(--navy); display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); border: 2px solid var(--line); font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; }
.field { margin-bottom: 16px; }
.field-error { color: var(--err); font-size: .9rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); padding: 10px 12px; border-radius: 12px; background: var(--sky); margin-bottom: 10px; }
.check input { width: 22px; height: 22px; margin-top: 4px; flex: none; accent-color: var(--teal); }
.notice { border-radius: var(--radius-sm); padding: 12px 16px; background: var(--sky); border-inline-start: 5px solid var(--blue); }
.notice.warn { background: #fff7e6; border-color: #e0a100; }
.notice.ok { background: #e8f7ee; border-color: var(--ok); }
.notice.err { background: #fdecea; border-color: var(--err); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--sky); color: var(--blue-deep); }
.badge.demo { background: #fff2cc; color: #6b4b00; }
.badge.ai { background: var(--mint); color: #075e59; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: .92rem; cursor: pointer; color: var(--navy); }
.chip[aria-pressed=true] { background: var(--teal); border-color: var(--teal); color: #fff; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: linear-gradient(to bottom, rgba(247, 251, 253, .96), rgba(247, 251, 253, .85)); backdrop-filter: blur(6px); }
.nav { max-width: 1240px; margin-inline: auto; display: flex; align-items: center; gap: 18px; background: #fff; border-radius: 999px; box-shadow: var(--shadow); padding: 8px 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.45rem; color: var(--blue-deep); text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: .96rem; }
.nav-links a:hover { background: var(--sky); }
.nav-links a[aria-current=page] { color: var(--teal); box-shadow: inset 0 -3px 0 var(--teal); border-radius: 0; }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.country-chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: .92rem; color: var(--navy); }
.nav-toggle { display: none; background: none; border: 0; color: var(--navy); padding: 8px; cursor: pointer; border-radius: 12px; }
@media (max-width: 1080px) {
  .nav { border-radius: 24px; flex-wrap: wrap; }
  .nav-toggle { display: block; margin-inline-start: auto; }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; order: 5; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a[aria-current=page] { box-shadow: none; background: var(--mint); border-radius: 12px; }
  .nav-tools { order: 2; }
  .country-chip { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #dbe8f3; margin-top: 40px; }
.footer-inner { width: min(1180px, 100% - 32px); margin-inline: auto; padding: 32px 0; display: grid; gap: 18px; grid-template-columns: 2fr 1fr; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand img { background: #fff; border-radius: 12px; padding: 4px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #fff; }
.footer-note { grid-column: 1 / -1; font-size: .85rem; opacity: .8; margin: 0; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; margin-top: -78px; padding-top: 96px; background: url('/media/background.jpg') center bottom / cover no-repeat; min-height: 520px; }
.hero::after { content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 70px; background: var(--bg); clip-path: ellipse(70% 100% at 50% 100%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; align-items: end; gap: 12px; width: min(1180px, 100% - 32px); margin-inline: auto; }
.hero-copy { padding-block: 40px 90px; }
.hero-copy h1 { color: var(--navy); }
.hero-copy h1 em { font-style: normal; color: var(--teal); }
.hero-copy p { font-size: 1.12rem; color: #2d4356; max-width: 34em; }
.hero-art { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding-bottom: 44px; }
.hero-art .boy { width: min(260px, 44%); }
.hero-art .star { width: min(250px, 44%); margin-inline-end: -10px; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { padding-block: 20px 0; text-align: center; }
  .hero-copy .row { justify-content: center; }
  .hero-art { padding-bottom: 50px; }
}
.section { padding-block: 36px; }
.section-title { text-align: center; margin-bottom: 26px; }
.help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .help-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .help-grid { grid-template-columns: 1fr; } }
.help-card { position: relative; display: flex; align-items: center; gap: 10px; min-height: 150px; border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s; border: 0; font: inherit; text-align: start; cursor: pointer; width: 100%; }
.help-card:hover { transform: translateY(-3px); }
.help-card h3 { margin-bottom: 4px; font-size: 1.25rem; }
.help-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.help-card img { width: 96px; flex: none; }
.help-card .arrow { position: absolute; bottom: 14px; inset-inline-start: 20px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); }
.bg-mint { background: var(--mint); } .bg-gold { background: var(--gold-soft); } .bg-sky { background: var(--sky); } .bg-lav { background: var(--lav); } .bg-pink { background: var(--pink); }
.search-band { background: linear-gradient(135deg, #0d7a74, #0b5d63); border-radius: 28px; padding: 18px 22px; color: #fff; }
.search-band h2 { color: #fff; font-size: 1.2rem; margin-bottom: 12px; }
.search-band form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 10px; }
.search-band select { border-radius: 999px; border: 0; }
@media (max-width: 900px) { .search-band form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .search-band form { grid-template-columns: 1fr; } }
.learn-band { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: center; }
@media (max-width: 860px) { .learn-band { grid-template-columns: 1fr; } }
.area-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .area-tiles { grid-template-columns: 1fr; } }
.area-tile { border-radius: 28px; padding: 18px; text-align: center; text-decoration: none; color: var(--navy); font-weight: 800; font-size: 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .15s; }
.area-tile:hover { transform: translateY(-3px); }
.area-tile img { width: 150px; }
.quote-band { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: #fff; border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.quote-band img { width: 160px; border-radius: 22px; }
.quote-band blockquote { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--navy); }
@media (max-width: 640px) { .quote-band { grid-template-columns: 1fr; text-align: center; } .quote-band img { margin-inline: auto; } }

/* ---------- Story ---------- */
.story { max-width: 760px; margin-inline: auto; }
.story h1 { text-align: center; margin-block: 10px 24px; }
.story h2 { margin-top: 2em; color: var(--teal); }
.story p { font-size: 1.12rem; line-height: 2.05; }
.story .emphasis { font-weight: 800; color: var(--navy); font-size: 1.22rem; background: var(--gold-soft); border-radius: 14px; padding: 12px 18px; }
.story-figure { margin: 28px 0; }
.story-figure img { border-radius: 24px; width: 100%; box-shadow: var(--shadow); }
.story-figure figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 8px; }
.story .signature { white-space: pre-line; font-weight: 700; color: var(--navy); }

/* ---------- Directory ---------- */
.filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .filters { grid-template-columns: 1fr; } }
.cat-tabs, .sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.service-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .service-list { grid-template-columns: 1fr; } }
.service { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.service h3 { margin-bottom: 4px; }
.service dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: .95rem; }
.service dt { color: var(--muted); font-weight: 600; }
.service dd { margin: 0; overflow-wrap: anywhere; }
.service .meta { font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty img { width: 120px; opacity: .9; }

/* ---------- Learning hub ---------- */
.areas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .areas-grid { grid-template-columns: 1fr; } }
.area-card { border-radius: 28px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.area-card img { width: 140px; align-self: center; }
.area-card h2 { font-size: 1.35rem; text-align: center; }
.area-card .progress-note { font-size: .92rem; color: var(--muted); text-align: center; }
.area-card .btn { margin-top: auto; }

/* ---------- Child player ---------- */
.player-page { min-height: calc(100vh - 140px); background: linear-gradient(180deg, #eaf6fd 0%, #f7fbf2 100%); }
.player { width: min(1100px, 100% - 24px); margin-inline: auto; padding-block: 14px 30px; display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .player { grid-template-columns: 1fr; } .player-side { flex-direction: row !important; justify-content: space-between; } }
.player-side { display: flex; flex-direction: column; align-items: center; gap: 10px; position: sticky; top: 90px; }
.player-stage { background: #fff; border-radius: 32px; box-shadow: var(--shadow); padding: 20px; min-height: 420px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.player-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; flex-wrap: wrap; }
.save-status { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-status.saving { color: var(--warn); } .save-status.error { color: var(--err); font-weight: 700; } .save-status.saved { color: var(--ok); }
.steps-dots { display: flex; gap: 6px; }
.steps-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.steps-dots span.done { background: var(--teal-2); } .steps-dots span.now { background: var(--gold); transform: scale(1.25); }
.big-image { width: min(360px, 80vw); aspect-ratio: 1; border-radius: 28px; background: var(--sky); padding: 10px; }
.big-image img { width: 100%; height: 100%; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: 720px; }
.choice { border: 4px solid transparent; background: var(--sky); border-radius: 28px; padding: 8px; cursor: pointer; aspect-ratio: 1; transition: transform .15s, border-color .15s; min-height: 120px; }
.choice img { width: 100%; height: 100%; pointer-events: none; }
.choice:hover:not([disabled]) { transform: scale(1.03); border-color: var(--teal-2); }
.choice[disabled] { cursor: default; opacity: .7; }
.choice.correct-model { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(246, 184, 0, .35); opacity: 1; }
.choice.picked-correct { border-color: #3cb371; opacity: 1; }
.choice.picked { border-color: #b9c6d2; }
.aac-label { font-size: .85rem; color: var(--muted); text-align: center; }
.round-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); background: #fff; color: var(--navy); }
.round-btn.go { width: 92px; height: 92px; background: linear-gradient(135deg, #0d8c85, #0a6964); color: #fff; }
.round-btn.go.pulse { animation: pulse 1.6s ease-in-out infinite; }
.round-btn svg { width: 38px; height: 38px; }
.player-controls { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.listening { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: #ffe9ec; color: #8f1d2c; font-weight: 700; }
.listening .dot { width: 14px; height: 14px; border-radius: 50%; background: #e0344b; animation: blink 1.2s infinite; }
.parent-panel { width: 100%; border-top: 2px dashed var(--line); padding-top: 12px; font-size: .92rem; }
.parent-panel summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.task-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; max-width: 720px; }
.task-levels .btn { border-radius: 16px; min-height: 56px; }
.task-levels .btn.lvl-independent { background: var(--teal); color: #fff; }
.break-screen { text-align: center; padding: 30px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 179, 163, .45); } 50% { box-shadow: 0 0 0 16px rgba(31, 179, 163, 0); } }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Rashed character ---------- */
rashed-character { display: inline-block; position: relative; width: var(--rashed-size, 190px); }
rashed-character .rashed-figure { position: relative; transform-origin: 50% 90%; }
rashed-character img.rashed-img { width: 100%; display: block; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .12)); user-select: none; -webkit-user-drag: none; }
rashed-character .rashed-fx { position: absolute; inset: 0; pointer-events: none; }
rashed-character .fx { position: absolute; opacity: 0; transition: opacity .3s; }
rashed-character .fx-think { top: -6%; inset-inline-end: -4%; width: 34%; }
rashed-character .fx-mic { bottom: 6%; inset-inline-start: -6%; width: 30%; }
rashed-character .fx-sparkles { inset: -10%; width: 120%; }
rashed-character .fx-zz { top: -4%; inset-inline-end: 0; width: 30%; }
rashed-character .fx-point { top: 40%; inset-inline-start: -22%; width: 28%; }
rashed-character[state=thinking] .fx-think, rashed-character[state=uncertain] .fx-think { opacity: 1; }
rashed-character[state=listen] .fx-mic { opacity: 1; }
rashed-character[state=success] .fx-sparkles, rashed-character[state=celebrate] .fx-sparkles, rashed-character[state=supported_success] .fx-sparkles { opacity: 1; }
rashed-character[state=break] .fx-zz { opacity: 1; }
rashed-character[state=prompt] .fx-point, rashed-character[state=teach] .fx-point { opacity: 1; }
.rashed-caption { font-size: .82rem; color: var(--muted); text-align: center; min-height: 1.4em; }
/* State motions — whole-character only (original asset is preserved, not redrawn) */
rashed-character[state=welcome] .rashed-figure { animation: r-wave 2.4s ease-in-out 2; }
rashed-character[state=teach] .rashed-figure { animation: r-talk 1.1s ease-in-out infinite; }
rashed-character[state=prompt] .rashed-figure { animation: r-lean 1.6s ease-in-out infinite; }
rashed-character[state=listen] .rashed-figure { transform: rotate(-4deg) scale(1.02); transition: transform .4s; }
rashed-character[state=waiting] .rashed-figure, rashed-character[state=idle] .rashed-figure { animation: r-breathe 3.2s ease-in-out infinite; }
rashed-character[state=success] .rashed-figure { animation: r-jump .7s ease-out 2; }
rashed-character[state=supported_success] .rashed-figure { animation: r-nod .9s ease-in-out 2; }
rashed-character[state=thinking] .rashed-figure { animation: r-think 1.6s ease-in-out 1 forwards; }
rashed-character[state=uncertain] .rashed-figure { transform: rotate(5deg); transition: transform .4s; }
rashed-character[state=celebrate] .rashed-figure { animation: r-celebrate 1s ease-in-out 3; }
rashed-character[state=break] .rashed-figure { animation: r-breathe 5s ease-in-out infinite; filter: saturate(.85); }
@keyframes r-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes r-talk { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.015); } }
@keyframes r-lean { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-7deg) translateX(-4px); } }
@keyframes r-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes r-jump { 0% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(1.04); } 70% { transform: translateY(0) scale(.98, 1.02); } 100% { transform: translateY(0); } }
@keyframes r-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes r-think { 0% { transform: rotate(0); } 40% { transform: rotate(6deg); } 100% { transform: rotate(0); } }
@keyframes r-celebrate { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-16px) rotate(-6deg); } 75% { transform: translateY(-16px) rotate(6deg); } }
.reduced-motion rashed-character .rashed-figure, .reduced-motion .round-btn.go.pulse, .reduced-motion .bubble, .reduced-motion .burst span { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  rashed-character .rashed-figure, .round-btn.go.pulse, .bubble, .burst span, .listening .dot { animation: none !important; transition: none !important; }
}

/* Reward bubble */
.bubble-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bubble { --size: 56px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #d6f3ff 30%, #8fd3f4 70%, #5ab7e6 100%); box-shadow: inset -6px -8px 14px rgba(0, 70, 120, .18), 0 6px 18px rgba(90, 183, 230, .35);
  transition: width .6s cubic-bezier(.3, 1.6, .5, 1), height .6s cubic-bezier(.3, 1.6, .5, 1); color: #062b44; font-weight: 800; }
.bubble.grow { animation: bubble-pop .6s ease-out; }
@keyframes bubble-pop { 50% { transform: scale(1.12); } }
.bubble-stars { font-size: .85rem; color: var(--brown); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst span { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; animation: burst 1.2s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }

/* ---------- Ask Rashed ---------- */
.ask-fab { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: 78px; height: 78px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #fff7d6, #ffe082); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); display: grid; place-items: center; }
.ask-fab img { width: 66px; }
.ask-fab-label { position: absolute; bottom: -6px; right: 50%; transform: translateX(50%); background: var(--navy); color: #fff; font-size: .72rem; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.ask-panel { position: fixed; right: 16px; bottom: 104px; z-index: 81; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 140px)); background: #fff; border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22); display: flex; flex-direction: column; overflow: hidden; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #0a6964, #16559c); color: #fff; }
.ask-head img { width: 44px; }
.ask-head h2 { color: #fff; font-size: 1.1rem; margin: 0; flex: 1; }
.ask-head button { background: rgba(0, 0, 0, .22); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; }
.ask-body { padding: 12px 14px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.ask-msg { padding: 10px 14px; border-radius: 18px; max-width: 92%; font-size: .95rem; }
.ask-msg.me { align-self: flex-start; background: var(--sky); }
.ask-msg.bot { align-self: flex-end; background: var(--gold-soft); }
.ask-msg ul { margin: 6px 0 0; padding-inline-start: 18px; }
.ask-head .ask-new { width: auto; height: 32px; border-radius: 999px; padding: 0 12px; font-size: .85rem; font-weight: 700; }
.ask-msg.safety { background: #fde8e8; border: 2px solid #b42318; color: #5c1010; font-weight: 600; }
.ask-specialist { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: #fff; border-inline-start: 4px solid var(--teal); font-size: .9rem; }
.ask-followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-followups .chip { font-size: .85rem; padding: 4px 10px; text-align: start; }
/* كلماتي اليومية (recorded word path) */
.words-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.words-instruction { font-size: 1.6rem; margin: 8px 0 12px; }
.words-model { display: flex; justify-content: center; margin: 8px 0 16px; }
.words-model img { max-width: min(320px, 70vw); max-height: 260px; object-fit: contain; border-radius: 24px; border: 4px dashed var(--teal); background: #fff; padding: 6px; }
.words-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.words-option { border: 4px solid transparent; background: var(--sky); border-radius: 24px; padding: 8px; cursor: pointer; min-height: 150px; display: flex; align-items: center; justify-content: center; }
.words-option img { width: 100%; max-height: 240px; object-fit: contain; pointer-events: none; }
.words-option:focus-visible { outline: 4px solid var(--navy); }
.words-option.correct-model { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(246, 184, 0, .35); }
.words-option.chosen-wrong { opacity: .55; }
.words-option[disabled] { cursor: default; }
.words-feedback { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: var(--gold-soft); font-weight: 700; }
.words-feedback.ok { background: var(--mint); }
.words-caregiver { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; border-top: 2px dashed var(--line); }
.words-name-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.words-entry { margin: 12px 0 20px; }
/* staff pages */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: start; font-weight: 600; padding: 6px 8px 6px 0; color: var(--navy); width: 60%; }
table.kv td { padding: 6px 0; font-weight: 700; }
table.kv tr + tr { border-top: 1px solid var(--line); }
.specialist .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.review-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.review-item p { margin: 6px 0; }
.review-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.review-controls textarea { flex: 1 1 280px; min-height: 44px; font: inherit; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); }
.coming-soon { max-width: 640px; }
.coming-soon p { line-height: 1.9; }
.auth-gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.auth-gate-actions .btn { min-width: 150px; }
.ask-auth { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sky); }
.ask-auth .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ask-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.ask-form input { min-height: 44px; }
@media (max-width: 520px) { .ask-panel { right: 8px; left: 8px; width: auto; bottom: 96px; } }

/* ---------- Dashboard ---------- */
.dash-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: linear-gradient(135deg, #e7f7f4, #eaf3fd); border-radius: 30px; padding: 20px 24px; }
@media (max-width: 760px) { .dash-hero { grid-template-columns: 1fr; text-align: center; } .dash-hero rashed-character { margin-inline: auto; } }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 18px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .wide { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .85rem; }
.table-wrap { overflow-x: auto; }
.status { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef2f5; color: #445; white-space: nowrap; }
.status.s-practicing { background: #eef6ff; color: #1b4f8a; } .status.s-emerging { background: #fff4d6; color: #7a5600; }
.status.s-developing { background: #e3f6f1; color: #0b625c; } .status.s-mastered_provisional { background: #dff3e6; color: #17603a; }
.resume-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.resume-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 14px; flex-wrap: wrap; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting label { margin: 0; font-weight: 600; }
.setting .hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.switch { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: #c9d5df; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: right .2s; }
.switch:checked { background: var(--teal); }
.switch:checked::after { right: 25px; }
input[type=range] { width: 160px; accent-color: var(--teal); }

/* ---------- Assessment ---------- */
.assess { max-width: 820px; margin-inline: auto; }
.q-options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.q-option { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; font: inherit; text-align: start; cursor: pointer; min-height: 56px; }
.q-option[aria-pressed=true] { border-color: var(--teal); background: var(--mint); font-weight: 700; }
.progress-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-2), var(--teal)); border-radius: 999px; }
.result-list li { margin-bottom: 6px; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 560px; margin-inline: auto; }
.tabs { display: flex; gap: 6px; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 999px; min-height: 44px; font: inherit; font-weight: 700; cursor: pointer; color: var(--navy); }
.tabs button[aria-selected=true] { background: var(--teal); color: #fff; }
.phone-row { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }
.phone-row input { direction: ltr; text-align: left; }
input[type=email] { direction: ltr; text-align: left; }

/* ---------- Knowledge ---------- */
.article-list { display: grid; gap: 14px; }
.article { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.outbox-item { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; overflow-wrap: anywhere; }

/* Sizes */
rashed-character.rashed-sm { --rashed-size: 110px; }
.dash-hero rashed-character { --rashed-size: 130px; }
.child-mode .site-footer { display: none; }
code { background: var(--sky); padding: 1px 6px; border-radius: 6px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.help-card .arrow svg { width: 16px; height: 16px; }
.btn-ghost svg { width: 26px; height: 26px; }
@media (max-width: 1200px) { .help-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .help-grid { grid-template-columns: 1fr; } }
.help-card { padding-bottom: 52px; }
#content { display: flex; flex-direction: column; align-items: center; width: 100%; }
#content > * + * { margin-top: 16px; }
#respond-zone { width: 100%; display: flex; flex-direction: column; align-items: center; }
#respond-zone .choices { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); max-width: 480px; }
#respond-zone .choice { min-height: 100px; }
@media (max-width: 560px) {
  .choices { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .choice { min-height: 0; border-radius: 18px; padding: 4px; }
  .big-image { width: min(280px, 78vw); }
  .player-stage { padding: 14px; }
}
.gender-field { border: 0; padding: 0; margin: 0 0 16px; }
.gender-field legend { font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.chip-radio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; margin: 0; }
.chip-radio:has(input:checked) { border-color: var(--teal); background: var(--mint); font-weight: 700; }
.chip-radio input { accent-color: var(--teal); }

/* ---------- قصتنا: editorial story ---------- */
.editorial { padding: 40px 16px 72px; }
.ed-body { max-width: 700px; margin-inline: auto; font-size: 1.14rem; line-height: 2.05; color: #1f2d3a; }
.ed-body::after { content: ""; display: block; clear: both; }
.ed-head { text-align: center; margin-bottom: 34px; }
.ed-head .g-star { width: 34px; height: 34px; margin-bottom: 6px; }
.ed-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.5; color: var(--navy); max-width: 16em; margin-inline: auto; }
.g-star { fill: #e8a800; width: 18px; height: 18px; flex: none; }
.ed-body p { margin: 0 0 1.1em; text-align: start; }
.ed-body .ed-lead { font-size: 1.24rem; color: var(--navy); font-weight: 500; }
.ed-body h2 { clear: both; display: flex; align-items: center; gap: 10px; font-size: clamp(1.3rem, 2.6vw, 1.6rem); color: var(--navy); margin: 2.2em 0 .8em; }
.ed-body .ed-pull { clear: both; text-align: center; font-size: 1.32rem; font-weight: 700; color: var(--navy); line-height: 1.9; margin: 1.6em auto; max-width: 30em; }
.ed-body .ed-pull::before { content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 8px;
  background: #e8a800; clip-path: path('M11 0C11.6 5 15 8.4 22 11 15 11.6 11.6 15 11 22 10.4 15 7 11.6 0 11 7 10.4 10.4 7 11 0Z'); }
.ed-body .ed-signature { font-weight: 700; color: var(--navy); margin-top: .4em; }
.ed-body figure { margin: 6px 0 14px; position: relative; }
.ed-body .fig-end { float: left; margin-right: 26px; }   /* RTL: text on the right/start side */
.ed-body .fig-start { float: right; margin-left: 26px; }
.ed-body figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.5; }
.fig-portrait { width: 190px; }
.fig-portrait img { width: 190px; height: 190px; object-fit: cover; border-radius: 50%; display: block; }
.fig-cutout { width: 170px; margin-bottom: 18px !important; }
.fig-cutout img { width: 170px; display: block; }
.fig-cutout .g-star { position: absolute; top: -4px; inset-inline-start: 6px; width: 30px; height: 30px; }
.fig-star { width: 130px; }
.fig-star img { width: 130px; display: block; }
@media (max-width: 640px) {
  .ed-body { font-size: 1.06rem; line-height: 1.95; }
  .fig-portrait, .fig-portrait img { width: 118px; height: auto; }
  .fig-portrait img { height: 118px; }
  .fig-cutout, .fig-cutout img { width: 112px; }
  .fig-star, .fig-star img { width: 90px; }
  .ed-body .fig-end { margin-right: 14px; } .ed-body .fig-start { margin-left: 14px; }
}

/* ---------- Hero readability (round 3) ---------- */
.hero-copy { position: relative; isolation: isolate; }
.hero-copy::before {
  /* Soft, borderless light that fades into the illustration — not a box. Alpha >= .82 across the text area. */
  content: ""; position: absolute; z-index: -1; inset: -120px -200px -110px -200px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(248, 252, 255, .94) 0%, rgba(248, 252, 255, .87) 70%, rgba(248, 252, 255, .55) 86%, rgba(248, 252, 255, 0) 100%);
  filter: blur(2px);
}
.hero-copy h1 { color: #0f2a44; }
.hero-copy h1 em { color: #0a6964; }
.hero-copy p { color: #142c42; font-size: 1.22rem; font-weight: 500; line-height: 1.95; }
@media (max-width: 860px) { .hero-copy::before { inset: -90px -90px -60px; } .hero-copy p { font-size: 1.1rem; } }

/* ---------- Directory (round 3) ---------- */
.dir-intro { font-size: 1.15rem; line-height: 1.9; color: #24384b; max-width: 46em; margin-bottom: 22px; }
.dir-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 860px) { .dir-tiles { grid-template-columns: repeat(2, 1fr); } }
.dir-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; border-radius: 20px; border: 2px solid transparent; cursor: pointer; font: inherit; text-align: start; color: #17324d; transition: transform .15s, border-color .15s; min-height: 112px; }
.dir-tile:hover { transform: translateY(-2px); }
.dir-tile[aria-pressed=true] { border-color: #0a6964; box-shadow: 0 0 0 3px rgba(10, 105, 100, .18); }
.dir-tile-icon svg { width: 34px; height: 34px; }
.dir-tile-label { font-weight: 800; font-size: 1.06rem; }
.dir-tile-count { font-size: .9rem; color: #3d5163; }
.t-health { background: #fdecef; } .t-health .dir-tile-icon { color: #b4233f; }
.t-rehab { background: #e3f6f1; } .t-rehab .dir-tile-icon { color: #0a6964; }
.t-education { background: #e8f1fd; } .t-education .dir-tile-icon { color: #1b56a0; }
.t-recreation { background: #fff4d6; } .t-recreation .dir-tile-icon { color: #8a5a00; }
.dir-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; background: #fff; border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.dir-filters .f-wide { grid-column: 1 / -1; }
.dir-filters label { font-size: .92rem; }
.dir-filters select:disabled { background: #f1f4f7; color: #4f6172; }
@media (max-width: 760px) { .dir-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dir-filters { grid-template-columns: 1fr; } }
.f-more summary { cursor: pointer; font-weight: 700; color: #1b56a0; padding: 4px 0; }
.f-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; margin-top: 10px; }
@media (max-width: 760px) { .f-more-grid { grid-template-columns: 1fr; } }
.f-actions { display: flex; justify-content: flex-end; }
.dir-count { margin: 16px 2px 10px; font-weight: 700; color: #17324d; }
.svc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .svc-list { grid-template-columns: 1fr; } }
.svc { background: #fff; border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.svc-name { font-size: 1.12rem; margin: 0; line-height: 1.6; color: #17324d; }
.svc-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.svc-cats li { font-size: .82rem; font-weight: 700; background: #e3f6f1; color: #0a5d58; border-radius: 999px; padding: 2px 10px; }
.svc-services { margin: 0; color: #24384b; line-height: 1.8; }
.svc-line { margin: 0; display: flex; align-items: center; gap: 8px; color: #3d5163; font-size: .95rem; }
.svc-line svg { width: 18px; height: 18px; color: #1b56a0; flex: none; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.act { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: #eef4fb; color: #12406f; font-weight: 700; font-size: .9rem; text-decoration: none; border: 1px solid #d3e2f2; }
.act:hover { background: #dfeaf8; }
.act svg { width: 18px; height: 18px; flex: none; }
.svc-more { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.svc-more summary { cursor: pointer; font-weight: 700; color: #1b56a0; min-height: 36px; display: flex; align-items: center; }
.svc-more dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; font-size: .92rem; }
.svc-more dt { color: #3d5163; font-weight: 700; }
.svc-more dd { margin: 0; overflow-wrap: anywhere; color: #24384b; }
