:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ea; --surface: #fffdf7; --fg: #1d2a26; --muted: #5f6f69;
  --accent: #0f6b5c; --accent2: #c9a45c; --border: #e3ddcd; --radius: 14px;
  --font: "Cairo", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1715; --surface: #15211e; --fg: #e9efe9; --muted: #9fb0aa;
  --accent: #3fb59d; --accent2: #d9b871; --border: #24342f;
}
body { background: var(--bg); color: var(--fg); font-family: var(--font); }
.card { background: var(--surface); }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
@media (min-width: 48rem) { .app { max-width: 760px; } }
.shell, .app .shell { max-width: none; padding: 1rem 1rem calc(96px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 1rem; background: var(--accent); color: #fff; font-size: 1.15rem; }
.icon { min-width: 44px; min-height: 44px; background: transparent; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; }
h1, h2, h3 { margin: 0; } h2 { color: var(--accent); }
.hero { border-radius: var(--radius); padding: 1.6rem 1.2rem; color: #fff; text-align: center;
  background: radial-gradient(circle at 20% 0, #1c8b76, #0b4f44 70%); }
.hero h1 { font-family: "Amiri", serif; font-size: 2.4rem; }
.bism { font-family: "Amiri", serif; color: var(--accent2); font-size: 1.2rem; margin: 0; }
.quran { font-family: "Amiri", serif; font-size: 1.35rem; line-height: 2.1; margin: .4rem 0; }
.quran.small { font-size: 1.1rem; }
.hcard { background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--accent2);
  border-radius: var(--radius); padding: 1rem; display: grid; gap: .5rem; }
.between { justify-content: space-between; }
.grade { color: var(--accent); font-weight: 700; font-size: .85rem; }
.meta { margin: 0; display: grid; gap: .25rem; font-size: .9rem; }
.meta div { display: flex; gap: .4rem; } .meta dt { color: var(--muted); } .meta dd { margin: 0; }
.benefit { margin: 0; background: color-mix(in srgb, var(--accent) 8%, transparent); padding: .6rem; border-radius: 10px; }
.btn { min-height: 44px; background: var(--accent); justify-content: center; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn:disabled { opacity: .5; cursor: default; }
.input { font-size: 16px; min-height: 44px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { min-height: 40px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--fg); font: inherit; cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: .7rem; }
.tile { display: grid; gap: .2rem; text-align: start; padding: 1rem; min-height: 64px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.tile b { font-size: 1.05rem; } .tile small, small, .muted { color: var(--muted); }
.resume { border-color: var(--accent2); }
.big { display: block; font-size: 1.6rem; color: var(--accent); }
.progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.read p { font-size: 1.1rem; line-height: 2; }
.back, .link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; min-height: 44px; justify-self: start; }
.steps li, .tips li, .lessons li { margin-bottom: .4rem; line-height: 1.8; }
.opt { min-height: 44px; text-align: start; padding: 0 .8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.opt.ok { background: #d8efe6; border-color: #2e9a77; color: #134a39; }
.opt.bad { background: #f6dcd8; border-color: #c2584a; color: #6b241b; }
.score { font-weight: 700; color: var(--accent); }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; display: flex; justify-content: center; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.tabbar button { flex: 1; max-width: 120px; min-height: 58px; display: grid; place-items: center; gap: 0; background: none;
  border: 0; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; }
.tabbar button span { font-size: 1.25rem; }
.tabbar button.on { color: var(--accent); font-weight: 700; }
