@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");
.sec.wide{grid-column:1/-1}
.dpart{background:#faf8ff;border-radius:16px;padding:10px 14px;margin:10px 0}
.dpart h4{margin:0 0 4px;color:#8b6fd6}
.dpart ul,.wex ol{margin:0;padding-inline-start:20px}
.wex{background:#fdf3f8;border-radius:16px;padding:12px 14px;margin:10px 0}
.wex b{display:block;margin-bottom:4px}
:root {
  --pink: #fbe3ee; --pinkd: #e86fa3; --lav: #ece6fb; --purple: #8b6fd6;
  --blue: #e2effd; --blued: #5a9be0; --mint: #e2f6ef; --mintd: #3fae8a;
  --ink: #3b3350; --muted: #8a82a0; --sh: 0 8px 28px rgba(139, 111, 214, .12);
}
* { box-sizing: border-box; }
.diagram{margin:0;background:#fff;border:1px solid #f1ecfa;border-radius:22px;padding:14px;text-align:center}
.diagram svg{width:100%;max-width:520px;height:auto;font-family:Tajawal,system-ui,sans-serif}
.diagram figcaption{color:var(--muted);font-size:.9rem;margin-top:6px}
body { margin: 0; background: #fff; color: var(--ink); font-family: Tajawal, system-ui, sans-serif; line-height: 1.8; }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid #c9b8f5; outline-offset: 2px; }
h2, h3 { line-height: 1.4; }
.app { min-height: 100vh; background: radial-gradient(circle at 90% 0, #fdf0f6 0, transparent 40%), radial-gradient(circle at 0 30%, #f2eefe 0, transparent 35%); }
.top { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #f1ecfa; }
.logo { border: 0; background: none; font-size: 1.3rem; font-weight: 800; color: var(--purple); }
nav { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.nav { border: 0; background: none; padding: 8px 12px; border-radius: 999px; white-space: nowrap; font-weight: 500; transition: .2s; }
.nav:hover { background: var(--lav); }
.nav.on { background: var(--purple); color: #fff; }
.main { max-width: 1050px; margin: 0 auto; padding: 20px 16px 60px; }
.hero { position: relative; text-align: center; padding: 48px 16px; border-radius: 32px;
  background: linear-gradient(135deg, var(--pink), var(--lav) 55%, var(--blue)); box-shadow: var(--sh); overflow: hidden; margin-bottom: 24px; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.7rem); margin: .2em 0; }
.sub { color: #6a5f86; margin: 0 0 24px; }
.tag { display: inline-block; background: #fff; padding: 4px 14px; border-radius: 999px; color: var(--pinkd); font-weight: 700; margin: 0; }
.deco span { position: absolute; font-size: 2rem; opacity: .5; animation: float 6s ease-in-out infinite; pointer-events: none; }
.a1 { top: 14%; right: 7%; } .a2 { bottom: 12%; left: 7%; animation-delay: 1s !important; }
.a3 { top: 18%; left: 14%; animation-delay: 2s !important; } .a4 { bottom: 16%; right: 14%; animation-delay: 3s !important; }
@keyframes float { 50% { transform: translateY(-10px) rotate(8deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; } .center { justify-content: center; } .gap { gap: 12px; }
.btn { border: 0; background: linear-gradient(135deg, #a58bea, var(--purple)); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; box-shadow: 0 6px 18px rgba(139,111,214,.3); transition: .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(139,111,214,.38); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { padding: 13px 30px; font-size: 1.05rem; }
.btn.ghost { background: #fff; color: var(--purple); }
.btn.done { background: var(--mintd); opacity: 1; }
.card { background: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--sh); border: 1px solid #f3eefc; margin: 18px 0; }
.muted { color: var(--muted); }
.ptitle { font-size: 1.7rem; margin: 8px 0 16px; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.ucard { position: relative; border: 0; text-align: right; padding: 22px; border-radius: 24px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--sh); transition: .25s; animation: pop .5s both; }
.ucard:hover { transform: translateY(-5px) rotate(-.5deg); }
.ucard b { font-size: 1.1rem; } .ucard small { color: var(--muted); }
.uicon { font-size: 2.2rem; }
.unum { font-weight: 800; color: rgba(59,51,80,.35); font-size: 1.4rem; }
.ucard .unum { position: absolute; top: 14px; left: 18px; }
.c-pink { background: var(--pink); } .c-blue { background: var(--blue); } .c-lav { background: var(--lav); } .c-mint { background: var(--mint); }
.sc { color: var(--purple) !important; font-weight: 700; }
.prog h3 { margin: 0; } .pct { color: var(--purple); }
.bar { height: 16px; background: var(--lav); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.fill-bar { position: relative; height: 100%; min-width: 16px; border-radius: 999px; background: linear-gradient(90deg, var(--pinkd), #b69cf0, var(--blued)); transition: width .8s ease; }
.bubble { position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.75); }
.unit { border-radius: 28px; padding: 20px; margin-bottom: 20px; }
.unit h2 { margin: 0 0 12px; font-size: 1.3rem; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lcard { border: 0; background: rgba(255,255,255,.85); border-radius: 18px; padding: 12px 14px; display: flex; gap: 10px; align-items: center;
  text-align: right; transition: .2s; }
.lcard:hover { background: #fff; transform: translateX(-4px); box-shadow: var(--sh); }
.lid { background: var(--lav); color: var(--purple); font-weight: 800; border-radius: 10px; padding: 2px 8px; direction: ltr; }
.ltitle { flex: 1; font-weight: 500; }
.back { border: 0; background: var(--lav); color: var(--purple); border-radius: 999px; padding: 6px 16px; margin-bottom: 14px; font-weight: 700; }
.lhero { background: linear-gradient(135deg, var(--lav), var(--pink)); border-radius: 28px; padding: 26px 20px; margin-bottom: 18px; }
.lhero h2 { margin: 6px 0 0; font-size: clamp(1.3rem, 4vw, 1.9rem); }
.pill { background: #fff; color: var(--purple); border-radius: 999px; padding: 3px 12px; font-weight: 700; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sec { background: #fff; border-radius: 22px; padding: 18px 20px; box-shadow: var(--sh); border: 1px solid #f3eefc; margin-bottom: 16px; animation: pop .4s both; }
.sec h3 { margin: 0 0 8px; color: var(--purple); }
.sec.soft { background: linear-gradient(135deg, #fff7fb, var(--lav)); }
.sec ul { padding-inline-start: 20px; margin: 0; }
dl { margin: 0; } .term { padding: 6px 0; border-bottom: 1px dashed #eee6fb; } .term:last-child { border: 0; }
dt { font-weight: 700; color: var(--pinkd); } dd { margin: 0; }
.law { background: var(--blue); border-radius: 14px; padding: 8px 14px; margin: 6px 0; font-family: ui-monospace, monospace; text-align: center; overflow-x: auto; }
.quiz { display: flex; flex-direction: column; gap: 12px; }
.qtitle { color: var(--purple); margin: 0; }
.qcard { background: #fcfbff; border: 2px solid #efe9fb; border-radius: 20px; padding: 14px 16px; transition: .25s; }
.qcard.ok { border-color: #9fdcc5; background: #f2fbf7; } .qcard.bad { border-color: #f5b5cf; background: #fff5f9; }
.qhead { display: flex; gap: 8px; align-items: center; }
.qnum { width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-weight: 700; }
.qtype { font-size: .8rem; background: var(--lav); color: var(--purple); border-radius: 999px; padding: 1px 10px; }
.qtext { font-weight: 500; margin: 8px 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.opt { border: 2px solid #ece6fb; background: #fff; border-radius: 14px; padding: 9px 12px; text-align: right; transition: .2s; }
.opt:hover:not(:disabled) { border-color: var(--purple); background: var(--lav); }
.opt:disabled { cursor: default; }
.picked-ok { border-color: var(--mintd); background: var(--mint); } .picked-bad { border-color: var(--pinkd); background: var(--pink); }
.fill { display: flex; gap: 8px; flex-wrap: wrap; }
.input { flex: 1; min-width: 0; border: 2px solid #ece6fb; border-radius: 14px; padding: 9px 12px; font-family: inherit; font-size: 1rem; }
.feedback { margin-top: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; animation: pop .3s both; }
.result { text-align: center; font-size: 1.2rem; background: linear-gradient(135deg, var(--pink), var(--lav)); border-radius: 20px; padding: 16px; }
.qpick { display: flex; flex-direction: column; width: 100%; text-align: right; font-size: 1.2rem; font-weight: 800; transition: .2s; }
.qpick small { color: var(--muted); font-weight: 400; font-size: .9rem; }
.final { background: linear-gradient(135deg, var(--pink), var(--lav), var(--blue)); }
.qpick:hover { transform: translateY(-3px); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--sh); text-align: center; display: flex; flex-direction: column; }
.stat span { font-size: 1.6rem; } .stat b { font-size: 1.6rem; color: var(--purple); } .stat small { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.bdg { padding: 10px 18px; border-radius: 999px; background: #f4f2f8; color: #b3adc2; filter: grayscale(1); font-weight: 700; transition: .3s; }
.bdg.on { background: linear-gradient(135deg, var(--pink), var(--lav)); color: var(--ink); filter: none; box-shadow: var(--sh); }
/* review, mind map, assistant */
.rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { border: 0; background: var(--lav); border-radius: 999px; padding: 7px 14px; font-weight: 700; transition: .2s; }
.tab.on { background: var(--purple); color: #fff; }
.mm { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0; }
.mm-root { background: linear-gradient(135deg, #a58bea, var(--purple)); color: #fff; padding: 16px 26px; border-radius: 26px; font-weight: 800;
  font-size: 1.2rem; box-shadow: var(--sh); text-align: center; }
.mm-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; width: 100%; }
.mm-b { position: relative; border-radius: 22px; padding: 16px; box-shadow: var(--sh); animation: pop .5s both; }
.mm-b::before { content: ""; position: absolute; top: -18px; left: 50%; width: 2px; height: 18px; background: #d8ccf6; }
.mm-b h4 { margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: rgba(255,255,255,.85); border-radius: 999px; padding: 2px 10px; font-size: .9rem; }
.chip.eq { direction: ltr; font-family: ui-monospace, monospace; background: #fff; }
.mm-links { margin-top: 10px; font-size: .9rem; color: #6a5f86; }
.chat { display: flex; flex-direction: column; height: min(70vh, 640px); background: #fff; border-radius: 26px; box-shadow: var(--sh); overflow: hidden; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; animation: pop .3s both; }
.msg.me { align-self: flex-start; background: var(--purple); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-end; background: var(--lav); border-bottom-left-radius: 4px; }
.sugs { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid #f3eefc; }
.sug { border: 1px solid #e6defa; background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.sug:hover { background: var(--lav); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #f3eefc; }
@media (max-width: 600px) { .hero { padding: 36px 14px; } .deco span { font-size: 1.4rem; } }
