:root {
  --paper: #f5f8ff;
  --card: #ffffff;
  --ink: #0c2461;
  --muted: #55638a;
  --line: #dfe6f5;
  --blue: #1f5fe8;
  --navy: #0c2461;
  --blue-soft: #e3edff;
  --violet: #7a35e8;
  --violet-soft: #efe7ff;
  --sky: #0079b8;
  --sky-soft: #dcf4ff;
  --grad: linear-gradient(100deg, #0a8be8 0%, #2a50ea 52%, #7a35e8 100%);
  --r: 24px;
  --shadow: 0 2px 4px rgba(12, 36, 97, .04), 0 18px 40px -22px rgba(12, 36, 97, .32);
  --font: "Cairo", "Poppins", sans-serif;
  --display: "Cairo", "Poppins", sans-serif;
}
html[lang="en"] { --font: "Poppins", "Cairo", sans-serif; --display: "Poppins", "Cairo", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 8px; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 30; }
.skip:focus { top: 10px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 248, 255, .84); backdrop-filter: blur(14px); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt small { font-family: var(--body, inherit); font-size: .74rem; font-weight: 600; color: var(--muted); }
.top-nav { display: flex; gap: 26px; margin-inline-start: auto; font-weight: 600; font-size: .95rem; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--blue); }
.lang { border: 0; background: var(--blue-soft); color: var(--navy); border-radius: 999px; padding: 4px 18px; font-weight: 700; font-size: .9rem; min-height: 40px; }
.lang:hover { background: var(--blue); color: #fff; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 0 0 24px;
  background:
    radial-gradient(46% 70% at 12% 8%, rgba(10, 139, 232, .18), transparent 70%),
    radial-gradient(42% 66% at 90% 18%, rgba(122, 53, 232, .15), transparent 70%);
}
.banner { display: block; width: 100%; max-width: 760px; height: auto; margin: 18px auto 0; border-radius: 20px; box-shadow: 0 24px 48px -28px rgba(12, 36, 97, .55); }
.hero-grid { display: block; }
.hero-copy { display: flex; flex-direction: column; align-items: center; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.fan { display: none; }
.hero-art { width: 220px; height: 220px; border-radius: 50%; margin-bottom: 18px; box-shadow: 0 28px 54px -22px rgba(42, 80, 234, .6); }
h1 { font-family: var(--display); font-size: clamp(2.9rem, 7vw, 5rem); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
html[dir="rtl"] h1 { letter-spacing: 0; line-height: 1.25; }
h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin-top: 12px; font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 600; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 28px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1.5px solid transparent; transition: transform .18s, background .18s, color .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 14px 26px -14px rgba(42, 80, 234, .9); }
.btn-primary:hover { filter: brightness(.92); }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--blue); color: var(--navy); }
.promises { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; margin: 22px 0 0; padding: 0; font-weight: 600; font-size: .92rem; color: var(--muted); }
.promises li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--violet); border-radius: 50%; margin-inline-end: 7px; }

/* Library */
.library { padding: 40px 0 76px; }
.lib-head { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 16px; text-align: center; }
h2 { font-family: var(--display); font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 800; line-height: 1.25; }
.search { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); min-width: 0; background: var(--card); border: 1.5px solid transparent; border-radius: 999px; padding: 0 20px; min-height: 56px; color: var(--muted); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); height: 52px; }
.tabs { display: flex; justify-content: safe center; gap: 4px; overflow-x: auto; padding: 6px; margin: 8px auto 0; width: fit-content; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 18px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; font-weight: 700; font-size: .95rem; transition: background .18s, color .18s; }
.tab small { font-size: .78rem; font-weight: 700; opacity: .75; }
.tab:hover { background: var(--blue-soft); color: var(--navy); }
.tab[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* Hero icon links */
.hero-links { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.hl-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--navy); box-shadow: var(--shadow); transition: transform .15s, background .15s, color .15s; }
.hl-ico svg { width: 22px; height: 22px; }
.hl-ico:hover { transform: translateY(-3px); background: var(--grad); color: #fff; border-color: transparent; }

/* Library teaser on home */
.lib-cta { padding: 44px 0 64px; }
.lib-box { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px; padding: 26px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.lib-box:hover { transform: translateY(-4px); box-shadow: 0 28px 48px -24px rgba(12, 36, 97, .4); }
.lib-thumbs { position: relative; height: 250px; }
.lib-thumbs img { position: absolute; width: 54%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 16px 30px -16px rgba(12, 36, 97, .55); }
.lib-thumbs img:nth-child(1) { inset-inline-start: 0; top: 0; transform: rotate(-4deg); }
.lib-thumbs img:nth-child(2) { inset-inline-start: 19%; top: 34px; transform: rotate(2deg); z-index: 1; }
.lib-thumbs img:nth-child(3) { inset-inline-start: 38%; top: 70px; transform: rotate(5deg); z-index: 2; }
.lib-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lib-txt p { color: var(--muted); font-weight: 700; }
.lib-txt .btn { margin-top: 8px; }
.lib-page { padding-top: 32px; min-height: 70vh; }
.top-nav a[aria-current="page"] { color: var(--blue); }

/* Contact page */
.contact-sec { padding: 36px 0 72px; }
.contact-h { text-align: center; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; color: var(--navy); margin-bottom: 26px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.c-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.c-bar { margin: 0; padding: 14px 20px; background: linear-gradient(100deg, #0c2461, #2a50ea 70%, #7a35e8); color: #fff; text-align: center; font-size: 1.25rem; font-weight: 800; }
.c-boxes { display: grid; grid-template-columns: 1fr 1fr; padding: 10px; }
.c-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; text-align: center; text-decoration: none; color: var(--navy); transition: background .18s; }
.c-box:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.c-box:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.c-box:hover { background: var(--blue-soft); }
.c-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--grad); color: #fff; }
.c-ico svg { width: 26px; height: 26px; }
.c-box h3 { font-size: 1.15rem; font-weight: 800; }
.c-val { color: var(--muted); font-weight: 600; font-size: .92rem; word-break: break-all; }
.c-form-panel { background: var(--blue-soft); }
.c-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px; }
.fld { position: relative; display: block; }
.fld-wide, .c-send, .form-msg { grid-column: 1 / -1; }
.fld input, .fld textarea { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); resize: vertical; }
.fld input::placeholder, .fld textarea::placeholder { color: var(--muted); }
.fld input:focus, .fld textarea:focus { outline: 3px solid rgba(42, 80, 234, .25); border-color: var(--blue); }
.fld b { position: absolute; top: 10px; inset-inline-end: 12px; color: #e11d48; font-weight: 800; pointer-events: none; }
html[dir="rtl"] .fld input[dir="ltr"]::placeholder { text-align: right; }
.c-send { justify-self: center; min-width: 180px; border: 0; cursor: pointer; }
.c-form.busy .c-send { opacity: .7; pointer-events: none; }
.form-msg { margin: 0; text-align: center; font-weight: 700; }
.form-msg:empty { display: none; }
.form-msg.ok { color: #059669; }
.form-msg.err { color: #e11d48; }

/* Accounts */
.acct { margin-inline-start: 18px; font-weight: 700; font-size: .92rem; color: var(--navy); text-decoration: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.acct:hover { border-color: var(--blue); color: var(--blue); }
.acct:empty { display: none; }
.acct-box { max-width: 460px; margin: 0 auto; }
.acct-form { grid-template-columns: 1fr; }
.acct-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0; }
.linkish { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.acct-head { text-align: center; }
.acct-head .contact-h { margin-bottom: 4px; }
.acct-acts { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.acct-sub { margin: 40px 0 0; text-align: center; }

/* Admin */
.adm-main { padding: 28px 16px 80px; }
.adm-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.adm-top h1 { font-size: 1.8rem; font-weight: 900; color: var(--navy); }
.adm-tabs { margin: 18px 0 22px; width: auto; justify-content: flex-start; }
.adm-pane > * + * { margin-top: 16px; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.adm-stat, .adm-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.adm-stat b { display: block; font-size: 2rem; font-weight: 900; color: var(--navy); }
.adm-stat span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-box h2 { font-size: 1.1rem; margin-bottom: 10px; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.adm-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.adm-table th, .adm-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table th { background: var(--blue-soft); color: var(--navy); font-weight: 800; white-space: nowrap; }
.adm-ref { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-help { padding: 14px 16px; border-radius: 14px; background: var(--blue-soft); color: var(--navy); font-size: .92rem; }
.adm-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-inline input, .adm-inline select, .adm-course input, .adm-course select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.adm-add input { flex: 1 1 200px; }
.btn.sm { min-height: 38px; padding: 4px 14px; font-size: .88rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); font-weight: 700; font-size: .8rem; }
.chip button { border: 0; background: none; cursor: pointer; color: #e11d48; font-weight: 900; }
.adm-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.adm-course { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.adm-course label { display: grid; gap: 4px; font-weight: 700; font-size: .85rem; color: var(--navy); }
.adm-course .adm-check { display: flex; align-items: center; gap: 8px; }
.adm-course-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sm-note { font-size: .8rem; }
.adm-new { margin-top: 16px; max-width: 420px; border-style: dashed; }
.ok { color: #059669; }
.bad { color: #e11d48; }

/* Courses */
.courses-sec { padding: 40px 0 8px; }
.courses-sec h2 { text-align: center; }
.courses-grid { margin-top: 18px; }
.card.locked .thumb { background: linear-gradient(135deg, #0c2461 0%, #0079b8 60%, #12b5c9 100%); }
.card.locked:hover { transform: none; }
.badge.lock { background: #f59e0b; }
.badge.paid { background: var(--grad); }
.act.off { gap: 8px; cursor: default; background: #e6eaf5; color: var(--muted); box-shadow: none; }
.act.off svg { width: 18px; height: 18px; }
.act.off:hover { filter: none; transform: none; }

/* Course-style cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 22px; }
.card {
  --c: var(--blue); --soft: var(--blue-soft);
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  animation: rise .45s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}
.card[data-type="file"] { --c: var(--violet); --soft: var(--violet-soft); }
.card[data-type="prompt"] { --c: var(--navy); --soft: #e6eaf5; }
.card[data-type="course"] { --c: var(--sky); --soft: var(--sky-soft); }
.card:hover { transform: translateY(-5px); box-shadow: 0 2px 4px rgba(12, 36, 97, .05), 0 28px 48px -22px rgba(12, 36, 97, .42); }
.thumb { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; background: linear-gradient(135deg, #0c2461 0%, #2a50ea 60%, #7a35e8 100%); color: #fff; overflow: hidden; }
.card[data-type="video"] .thumb { background: linear-gradient(135deg, #0a8be8 0%, #2a50ea 55%, #7a35e8 100%); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s; }
.card:hover .thumb img { transform: scale(1.04); }
.thumb-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.thumb-ico svg { width: 30px; height: 30px; }
.thumb img ~ .thumb-ico { display: none; }
.badges { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.badge { padding: 2px 11px; border-radius: 999px; background: rgba(12, 36, 97, .82); color: #fff; font-size: .76rem; font-weight: 800; backdrop-filter: blur(4px); }
.badge.hot { background: var(--grad); }
.badge.free { background: #10b981; }
.fav { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--navy); cursor: pointer; transition: background .18s, color .18s; }
.fav svg, .sq svg, .card-stats svg { width: 18px; height: 18px; }
.fav:hover { background: var(--navy); color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 18px 18px; }
.card-cat { color: var(--c); font-size: .8rem; font-weight: 800; }
.card h3 { font-size: 1.08rem; line-height: 1.45; font-weight: 800; }
.card h3 button { all: unset; cursor: pointer; }
.card h3 button::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.card h3 button:focus-visible::after { outline: 3px solid var(--violet); outline-offset: 2px; }
.card p { color: var(--muted); font-size: .92rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-stats { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.card-stats span { display: inline-flex; align-items: center; gap: 5px; }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.act { position: relative; z-index: 2; flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 18px; border-radius: 12px; border: 0; background: var(--grad); color: #fff; font-weight: 800; font-size: .95rem; text-decoration: none; box-shadow: 0 12px 22px -14px rgba(42, 80, 234, .9); transition: filter .18s, transform .18s; }
.act:hover { filter: brightness(1.08); transform: translateY(-1px); }
.act.done { background: var(--navy) !important; }
.sq { position: relative; z-index: 2; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--blue-soft); color: var(--navy); cursor: pointer; transition: background .18s, color .18s; }
html[dir="rtl"] .sq svg { transform: scaleX(-1); }
.sq:hover { background: var(--navy); color: #fff; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; background: var(--card); border-radius: var(--r); color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.2rem; }
.empty .btn { margin-top: 16px; }

/* Coming next */
.next { padding: 0 0 64px; text-align: center; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); justify-content: center; gap: 22px; margin-top: 18px; }
.next-card { padding: 22px; border-radius: var(--r); background: var(--blue-soft); }
.next-card.course { background: var(--sky-soft); }
.next-card h3 { font-size: 1.2rem; font-weight: 800; }

/* About */
.about, .join { padding: 68px 0; background: linear-gradient(115deg, #0c2461 0%, #1a2f8f 60%, #4a25a8 100%); color: #fff; }
.about-in { display: flex; align-items: center; justify-content: center; gap: 44px; }
.about img { flex: none; width: 176px; height: 176px; border-radius: 50%; }
.about p, .join p { margin: 10px 0 0; color: #d5def7; font-size: 1.06rem; line-height: 1.8; }
.about strong, .join strong { color: #fff; }
.about .about-tag { margin: 4px 0 14px; color: #fff; font-size: 1.25rem; font-weight: 800; }
.socials { display: flex; justify-content: center; gap: 16px; margin-top: 26px; }
.social { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #fff; color: var(--navy); transition: transform .15s, background .15s; }
.social:hover { transform: translateY(-3px); background: var(--blue-soft); }
.social:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn-ico { width: 28px; height: 28px; }
.join .btn-primary { background: #fff; color: var(--navy); box-shadow: none; }
.join .btn-primary:hover { background: var(--blue-soft); }

.about-more { padding: 68px 0; }
.founder { max-width: 820px; margin: 0 auto 56px; padding: 32px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.founder h3 { margin-top: 10px; font-size: 1.3rem; font-weight: 800; }
.founder-role { margin: 2px 0 12px; color: var(--blue); font-weight: 700; }
.founder p:not(.founder-role) { margin: 10px 0 0; color: var(--muted); line-height: 1.8; }
.offer-title { margin-bottom: 22px; text-align: center; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.offer { padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.offer-icon { display: block; font-size: 2rem; line-height: 1.2; }
.offer h3 { margin-top: 8px; font-size: 1.1rem; font-weight: 800; }
.offer p { margin: 8px 0 0; color: var(--muted); line-height: 1.75; }
.mv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 56px; }
.mv { padding: 26px; border-radius: var(--r); background: var(--blue-soft); }
.mv:nth-child(2) { background: var(--violet-soft); }
.mv-wide { grid-column: 1 / -1; background: var(--sky-soft); }
.mv h2 { font-size: 1.35rem; }
.mv p { margin: 8px 0 0; color: var(--ink); line-height: 1.8; }

.join-in { max-width: 760px; text-align: center; }
.join .join-sign { margin-top: 18px; }
.contact-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-top: 36px; padding: 22px 26px; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r); background: rgba(255, 255, 255, .08); text-align: start; }
.contact-box h3 { font-size: 1.2rem; font-weight: 800; }
.contact-box p { margin: 2px 0 0; }

/* Reading page for a library file */
.g-wrap { width: min(820px, 100% - 40px); }
.g-hero { padding: 34px 0 44px; background: linear-gradient(115deg, #0c2461 0%, #1a2f8f 60%, #4a25a8 100%); color: #fff; }
.g-hero small { display: block; margin-top: 22px; color: #d5def7; font-weight: 700; }
.g-hero h1 { margin-top: 6px; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.3; }
.g-hero p { margin: 10px 0 22px; color: #d5def7; font-size: 1.1rem; }
.g-hero .btn-primary { background: #fff; color: var(--navy); box-shadow: none; }
.g-hero .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.g-back { color: #fff; font-weight: 700; }
.g-body { padding: 34px 0 64px; }
.g-lang { margin: 0 0 18px; color: var(--muted); font-size: .95rem; }
.g-p { margin: 0 0 18px; font-size: 1.1rem; line-height: 1.9; }
.g-step { display: flex; align-items: center; gap: 16px; margin: 44px 0 20px; }
.g-num { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--grad); color: #fff; font-size: 1.5rem; font-weight: 800; }
.g-step small { color: var(--blue); font-weight: 700; }
.g-step h2 { font-size: clamp(1.45rem, 4vw, 1.9rem); line-height: 1.35; }
.g-list { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: g; }
.g-list li { counter-increment: g; position: relative; padding: 13px 44px 13px 0; border-bottom: 1px dashed var(--line); font-size: 1.05rem; line-height: 1.8; }
.g-list li::before { content: counter(g); position: absolute; right: 0; top: 13px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .9rem; font-weight: 800; }
.g-list code { padding: 2px 8px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-family: inherit; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.g-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 20px; }
.g-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.g-card small { display: block; color: var(--muted); }
.g-card b { display: block; color: var(--violet); font-size: 1.1rem; }
.g-card span { display: block; color: var(--muted); font-size: .95rem; }
.g-note { display: flex; gap: 12px; margin: 0 0 16px; padding: 16px 18px; border-radius: 16px; background: var(--blue-soft); }
.g-note span { flex: none; font-size: 1.3rem; }
.g-note p { margin: 0; line-height: 1.8; }
.g-copy { margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.g-copy-head { position: sticky; top: 72px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-radius: var(--r) var(--r) 0 0; background: var(--card); border-bottom: 1px solid var(--line); }
.g-copy-head h3 { font-size: 1.08rem; font-weight: 800; }
.g-copy-head small { color: var(--muted); }
.g-copy-head .btn { flex: none; width: auto; min-height: 44px; padding: 4px 24px; }
.g-copy-head .btn.done { background: var(--navy); }
.g-copy .prompt-box { max-height: none; border-radius: 0 0 var(--r) var(--r); background: var(--card); user-select: text; }
.g-h { margin: 36px 0 14px; font-size: clamp(1.3rem, 4vw, 1.6rem); line-height: 1.35; }
.g-img { display: block; width: min(100%, 560px); margin: 0 auto 22px; border-radius: 18px; box-shadow: var(--shadow); }
.g-bullets { margin: 0 0 20px; padding-inline-start: 22px; font-size: 1.05rem; line-height: 1.9; }
.g-body > .g-p:first-child, .g-body > .g-lang + .g-p { margin-top: 0; }
.g-codes ul { margin: 0 0 12px; padding: 0; list-style: none; }
.g-codes li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: 8px; }
.g-codes code { color: var(--navy); font-family: inherit; font-weight: 800; overflow-wrap: anywhere; user-select: all; }
.g-codes span { color: var(--muted); line-height: 1.6; }
.g-code-copy { min-height: 40px; padding: 2px 16px; border: 0; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.g-code-copy:hover { background: var(--blue); color: #fff; }
.g-code-copy.done { background: var(--navy); color: #fff; }
.g-check { margin: 0 0 24px; padding: 0; list-style: none; }
.g-check li { border-bottom: 1px dashed var(--line); }
.g-check label { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; font-size: 1.05rem; line-height: 1.7; cursor: pointer; }
.g-check input { flex: none; width: 22px; height: 22px; margin-top: 4px; accent-color: var(--blue); }
.g-cta { margin-top: 28px; padding: 30px 22px; border-radius: var(--r); background: linear-gradient(115deg, #0c2461 0%, #1a2f8f 60%, #4a25a8 100%); color: #fff; text-align: center; }
.g-cta h2 { font-size: 1.5rem; }
.g-cta p { margin: 10px 0 18px; color: #d5def7; line-height: 1.8; }
.g-cta .btn-primary { background: #fff; color: var(--navy); box-shadow: none; }
.g-cta small { display: block; margin-top: 12px; color: #d5def7; font-weight: 700; }

.foot { padding: 22px 0; font-size: .92rem; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fs-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); transition: transform .15s, background .15s, color .15s; }
.fs-ico svg { width: 20px; height: 20px; }
.fs-ico:hover { transform: translateY(-2px); background: var(--grad); color: #fff; border-color: transparent; }
.foot-in { align-items: center; }
.foot a { font-weight: 700; color: var(--navy); text-decoration: none; }
html[dir="rtl"] .foot a { direction: ltr; unicode-bidi: isolate; }

/* Item modal */
dialog { width: min(760px, 100% - 24px); max-height: calc(100dvh - 32px); border: 0; border-radius: var(--r); padding: 0; background: var(--card); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(10, 26, 72, .6); overflow: auto; }
dialog::backdrop { background: rgba(10, 26, 72, .5); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .24s ease-out; }
.m-box { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.m-head h2 { font-size: 1.65rem; }
.m-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); font-size: 1.35rem; line-height: 1; }
.m-x:hover { background: var(--blue); color: #fff; }
.m-desc { color: var(--muted); }
.m-desc:empty { display: none; }
.prompt-box { position: relative; background: var(--paper); border-radius: 16px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 44dvh; overflow: auto; font-size: .98rem; line-height: 1.75; }
.prompt-box mark, .m-hint mark { background: var(--violet-soft); color: var(--violet); font-weight: 700; padding: 0 4px; border-radius: 5px; }
.m-hint { font-size: .9rem; color: var(--muted); }
.m-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.m-acts .btn { flex: 1 1 170px; }
.m-acts .btn-primary.done { background: var(--navy); }
.m-img { width: min(100%, 460px); margin-inline: auto; border-radius: 16px; box-shadow: var(--shadow); }
.video { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--ink); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.ig-note { text-align: center; font-size: .9rem; font-weight: 700; color: var(--violet); }
.video.ig { position: relative; aspect-ratio: auto; width: min(100%, 400px); height: min(66dvh, 640px); margin-inline: auto; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.video.ig.playing::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 5px; background: var(--grad); transform-origin: left; animation: preview 5s linear both; }
html[dir="rtl"] .video.ig.playing::after { transform-origin: right; }
.ig-gate { height: 100%; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: var(--paper); }
.ig-gate h3 { font-size: 1.3rem; font-weight: 800; line-height: 1.4; }
.ig-gate p { color: var(--muted); }
.ig-gate .btn { width: 100%; }
.lessons { list-style: none; counter-reset: l; margin: 0; padding: 0; display: grid; gap: 8px; }
.lessons a, .lessons span { counter-increment: l; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; background: var(--paper); border-radius: 16px; font-weight: 600; text-decoration: none; }
.lessons a:hover { background: var(--sky-soft); }
.lessons a::before, .lessons span::before { content: counter(l); flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sky-soft); color: var(--sky); font-weight: 800; }

.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translate(50%, 90px); background: var(--ink); color: #fff; padding: 8px 22px; border-radius: 999px; font-weight: 700; z-index: 50; transition: transform .22s; pointer-events: none; }
html[dir="ltr"] .toast { transform: translate(-50%, 90px); }
.toast.show { transform: translate(50%, 0); }
html[dir="ltr"] .toast.show { transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes preview { from { transform: scaleX(0); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .top-nav { display: none; }
  .acct { margin-inline-start: auto; margin-inline-end: 6px; padding: 6px 11px; font-size: .82rem; }
  .brand { font-size: .98rem; gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand-txt > * { white-space: nowrap; }
  .brand-txt small { font-size: .68rem; }
  .lang { padding: 4px 12px; font-size: .82rem; min-height: 34px; }
  .adm-cols { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .c-form { grid-template-columns: 1fr; padding: 16px; }
  .c-box { padding: 22px 6px; }
  .c-val { font-size: .76rem; word-break: normal; }
  .lib-box { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .lib-thumbs { height: 190px; }
  .lib-thumbs img { width: 62%; }
  .lib-txt { align-items: center; text-align: center; }
  .hero { padding: 0 0 20px; }
  .hero-art { width: 168px; height: 168px; }
  .lang { margin-inline-start: 0; }
  .btn { width: 100%; }
  .btn.sm, .acct-acts .btn { width: auto; }
  .tabs { justify-content: flex-start; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tabs { width: auto; }
  .about-in { flex-direction: column; text-align: center; gap: 24px; }
  .about img { width: 132px; height: 132px; }
  .g-codes li { grid-template-columns: minmax(0, 1fr) auto; }
  .g-codes span { grid-column: 1 / -1; grid-row: 2; }
  .founder { padding: 24px 20px; }
  .contact-box { justify-content: center; text-align: center; }
  .contact-box .btn { max-width: 100%; }
  .m-box { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
