/* HalalBook Academy (/learn) and user manual (/manual). Loaded only on those pages.
   No images or web fonts: emoji and CSS only, so pages stay small on cheap phones and slow connections. */

:root {
    --lx-radius: 1rem;
    --lx-shadow: 0 6px 20px rgba(15, 23, 42, .07);
    --lx-ink: #1f2937;
}

/* ---------- Hero ---------- */
.hb-lx-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; align-items: center;
    background: linear-gradient(135deg, #ecfdf5 0%, #fef9c3 50%, #ede9fe 100%); border-radius: 1.5rem; padding: 2.5rem 2rem; margin-bottom: 1.5rem; }
.hb-lx-hero-manual { grid-template-columns: 1fr; text-align: center; background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 55%, #fce7f3 100%); }
.hb-lx-hero-manual .hb-lx-search { max-width: 560px; margin: 1rem auto 0; }
.hb-lx-kicker { display: inline-block; background: #fff; color: var(--hb-green); font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px; box-shadow: var(--lx-shadow); margin-bottom: .8rem; }
.hb-lx-hero h1 { font-size: 1.75rem; font-weight: 650; line-height: 1.15; color: #064e3b; margin-bottom: .8rem; }
.hb-lx-hero-manual h1 { color: #1e3a8a; }
.hb-lx-hero p { font-size: 1.1rem; color: #374151; line-height: 1.65; }
.hb-lx-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.hb-lx-stats { display: flex; flex-wrap: wrap; gap: .75rem; }
.hb-lx-stats > div { background: #fff; border-radius: .9rem; padding: .5rem .9rem; box-shadow: var(--lx-shadow); display: flex; flex-direction: column; min-width: 90px; }
.hb-lx-stats b { font-size: 1.5rem; color: var(--hb-green); line-height: 1.1; }
.hb-lx-stats span { font-size: .8rem; color: var(--hb-muted); }
.hb-lx-hero-art { position: relative; height: 260px; }
.hb-lx-hero-art .coin { position: absolute; font-size: 3.4rem; width: 92px; height: 92px; border-radius: 50%; background: #fff; box-shadow: var(--lx-shadow);
    display: flex; align-items: center; justify-content: center; animation: lx-float 6s ease-in-out infinite; }
.hb-lx-hero-art .c1 { top: 0; left: 10%; }
.hb-lx-hero-art .c2 { top: 20%; right: 5%; animation-delay: -1s; background: #dcfce7; }
.hb-lx-hero-art .c3 { top: 45%; left: 30%; animation-delay: -2s; background: #fef3c7; width: 110px; height: 110px; }
.hb-lx-hero-art .c4 { bottom: 0; right: 18%; animation-delay: -3s; background: #ede9fe; }
.hb-lx-hero-art .c5 { bottom: 5%; left: 0; animation-delay: -4s; background: #fce7f3; }
@keyframes lx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hb-lx-hero-art .coin { animation: none; } }

/* ---------- Progress ---------- */
.hb-lx-progress-card { background: #fff; border: 1px solid var(--hb-border); border-radius: var(--lx-radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.hb-lx-bar { height: .7rem; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: .5rem 0 .25rem; }
.hb-lx-bar > div { height: 100%; background: linear-gradient(90deg, #10b981, #f59e0b); border-radius: 999px; transition: width .4s; }

/* ---------- Quick cards ---------- */
.hb-lx-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.hb-lx-quick-card, .hb-lx-manual-card { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--lx-ink); background: #fff;
    border: 1px solid var(--hb-border); border-top: 5px solid var(--c); border-radius: var(--lx-radius); padding: 1rem 1.1rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); transition: transform .15s, box-shadow .15s; }
.hb-lx-quick-card:hover, .hb-lx-manual-card:hover { transform: translateY(-3px); box-shadow: var(--lx-shadow); color: var(--lx-ink); }
.hb-lx-quick-card .e, .hb-lx-manual-card .e { font-size: 2rem; line-height: 1; }
.hb-lx-quick-card b, .hb-lx-manual-card b { font-size: 1.05rem; }
.hb-lx-quick-card span:last-child, .hb-lx-manual-card span:last-child { color: var(--hb-muted); font-size: .9rem; line-height: 1.45; }

/* ---------- Learning path ---------- */
.hb-lx-section-title { font-weight: 800; font-size: 1.7rem; margin: .5rem 0 .25rem; }
.hb-lx-section-sub { color: var(--hb-muted); margin-bottom: 1.25rem; }
.hb-lx-path { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.hb-lx-track { background: #fff; border-radius: 1.25rem; border: 1px solid var(--hb-border); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.03); scroll-margin-top: 4.5rem; }
.hb-lx-track header { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem; background: color-mix(in srgb, var(--c) 14%, #fff); border-bottom: 3px solid var(--c); }
.hb-lx-track-num { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.hb-lx-track-emoji { font-size: 2.2rem; line-height: 1; }
.hb-lx-track-head { flex: 1; min-width: 0; }
.hb-lx-track h3 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.hb-lx-level { font-size: .78rem; font-weight: 700; color: color-mix(in srgb, var(--c, #10b981) 75%, #000); text-transform: uppercase; letter-spacing: .04em; }
.hb-lx-who { font-size: .82rem; color: var(--hb-muted); }
.hb-lx-track-done { background: var(--c); color: #fff; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; }
.hb-lx-track > p { padding: .8rem 1.1rem 0; margin: 0; color: #4b5563; font-size: .93rem; line-height: 1.55; }
.hb-lx-lessons { list-style: none; padding: .5rem .6rem .8rem; margin: 0; }
.hb-lx-lessons a { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: .6rem; text-decoration: none; color: var(--lx-ink); }
.hb-lx-lessons a:hover { background: color-mix(in srgb, var(--c) 10%, #fff); }
.hb-lx-lessons .e { font-size: 1.2rem; width: 1.6rem; text-align: center; }
.hb-lx-lessons .t { flex: 1; }
.hb-lx-lessons .m { font-size: .78rem; color: var(--hb-muted); white-space: nowrap; }
.hb-lx-lessons li.done .t { color: var(--hb-muted); }
.hb-lx-lessons li.done .m { color: #16a34a; font-weight: 800; font-size: 1rem; }

/* ---------- Call to action ---------- */
.hb-lx-cta { text-align: center; background: linear-gradient(135deg, #036f54, #0d9488); color: #fff; border-radius: 1.5rem; padding: 2.25rem 1.5rem; margin: 2rem 0 1rem; }
.hb-lx-cta h2 { font-weight: 800; }
.hb-lx-cta p { max-width: 640px; margin: 0 auto 1rem; opacity: .95; }

/* ---------- Lesson and manual page ---------- */
.hb-lx-crumbs { font-size: .88rem; color: var(--hb-muted); margin-bottom: .8rem; }
.hb-lx-crumbs a { text-decoration: none; }
.hb-lx-crumbs span { margin: 0 .2rem; }
.hb-lx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
.hb-lx-lesson { background: #fff; border-radius: 1.25rem; border: 1px solid var(--hb-border); overflow: hidden; }
.hb-lx-lesson-head { display: flex; gap: 1.1rem; align-items: center; padding: 1.6rem 1.6rem 1.3rem; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 20%, #fff), #fff); border-bottom: 4px solid var(--c); }
.hb-lx-lesson-emoji { font-size: 3rem; width: 84px; height: 84px; flex: none; border-radius: 1.2rem; background: #fff; box-shadow: var(--lx-shadow); display: flex; align-items: center; justify-content: center; }
.hb-lx-lesson-head h1 { font-size: 1.5rem; font-weight: 650; margin: .15rem 0 .35rem; }
.hb-lx-lesson-head .lead { margin: 0 0 .5rem; font-size: 1.08rem; color: #4b5563; }
.hb-lx-body { padding: 1.4rem 1.6rem .4rem; font-size: 1.05rem; line-height: 1.75; }
.hb-lx-body p { margin-bottom: 1rem; }
.hb-lx-h { font-size: 1.3rem; font-weight: 800; margin: 1.5rem 0 .6rem; padding-inline-start: .7rem; border-inline-start: 5px solid var(--c); }
.hb-lx-list, .hb-lx-steps { padding-inline-start: 1.4rem; margin-bottom: 1rem; }
.hb-lx-list li, .hb-lx-steps li { margin-bottom: .35rem; }
.hb-lx-list li::marker { color: var(--c); font-size: 1.2em; }
.hb-lx-steps { list-style: none; counter-reset: step; padding-inline-start: 0; }
.hb-lx-steps li { counter-increment: step; position: relative; padding-inline-start: 2.6rem; min-height: 2rem; }
.hb-lx-steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: .1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--c); color: #fff;
    font-weight: 800; font-size: .95rem; display: flex; align-items: center; justify-content: center; }
.hb-lx-box { display: flex; gap: .7rem; border-radius: .9rem; padding: .8rem 1rem; margin: 0 0 1rem; line-height: 1.6; }
.hb-lx-ico { font-size: 1.3rem; line-height: 1.4; }
.hb-lx-tip { background: #fef9c3; border: 1px dashed #eab308; }
.hb-lx-careful { background: #fee2e2; border: 1px solid #fca5a5; }
.hb-lx-story { background: #e0f2fe; border: 1px solid #7dd3fc; }
.hb-lx-formula { text-align: center; font-weight: 800; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 65%, #000));
    border-radius: .9rem; padding: .9rem 1rem; margin: 0 0 1rem; letter-spacing: .01em; }
.hb-lx-entry { margin: 0 0 1rem; border: 2px solid color-mix(in srgb, var(--c) 40%, #fff); border-radius: .9rem; overflow: hidden; }
.hb-lx-entry figcaption { background: color-mix(in srgb, var(--c) 14%, #fff); padding: .45rem .8rem; font-weight: 700; font-size: .95rem; }
.hb-lx-entry table, .hb-lx-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hb-lx-entry th, .hb-lx-entry td, .hb-lx-table th, .hb-lx-table td { padding: .4rem .8rem; border-top: 1px solid var(--hb-border); vertical-align: top; }
.hb-lx-entry th, .hb-lx-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--hb-muted); background: #f9fafb; }
.hb-lx-entry tr.cr td:first-child { padding-inline-start: 2.2rem; }
.hb-lx-entry tfoot td { font-weight: 800; background: #f9fafb; }
.hb-lx-entry .num, .hb-lx-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-lx-table-wrap { overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--hb-border); border-radius: .9rem; }
.hb-lx-table-wrap .hb-lx-table tr:first-child td { border-top: 1px solid var(--hb-border); }
.hb-lx-table tbody tr:nth-child(even) td { background: #fafafa; }
.hb-lx-table tr.total td { font-weight: 800; background: color-mix(in srgb, var(--c, #10b981) 10%, #fff); }
.hb-lx-try { display: inline-block; font-weight: 700; text-decoration: none; background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 70%, #000);
    border: 1px solid color-mix(in srgb, var(--c) 40%, #fff); border-radius: 999px; padding: .4rem 1rem; }
.hb-lx-keys { margin: .5rem 1.6rem 1.2rem; background: #f0fdf4; border: 2px solid #86efac; border-radius: 1rem; padding: 1rem 1.2rem .4rem; }
.hb-lx-keys h2 { font-size: 1.15rem; font-weight: 800; }
.hb-lx-keys li { margin-bottom: .4rem; }

/* ---------- Quiz ---------- */
.hb-quiz { margin: 0 1.6rem 1.2rem; background: #faf5ff; border: 2px solid #d8b4fe; border-radius: 1rem; padding: 1rem 1.2rem; }
.hb-quiz h2 { font-size: 1.15rem; font-weight: 800; }
.hb-quiz-q { margin-bottom: 1rem; }
.hb-quiz-ask { font-weight: 700; margin-bottom: .45rem; }
.hb-quiz-ask .n { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #8b5cf6; color: #fff; align-items: center; justify-content: center; font-size: .85rem; margin-inline-end: .3rem; }
.hb-quiz-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .45rem; }
.hb-quiz-opt { text-align: start; background: #fff; border: 2px solid #e9d5ff; border-radius: .7rem; padding: .55rem .8rem; font-size: .97rem; color: var(--lx-ink); min-height: 44px; }
.hb-quiz-opt:hover:not(:disabled) { border-color: #8b5cf6; background: #f5f3ff; }
.hb-quiz-opt:disabled { cursor: default; opacity: 1; }
.hb-quiz-opt.right { background: #dcfce7; border-color: #22c55e; font-weight: 700; }
.hb-quiz-opt.wrong { background: #fee2e2; border-color: #ef4444; }
.hb-quiz-opt.dim { opacity: .55; }
.hb-quiz-why { margin-top: .45rem; font-size: .93rem; border-radius: .6rem; padding: .45rem .7rem; }
.hb-quiz-why.right { background: #f0fdf4; }
.hb-quiz-why.wrong { background: #fff7ed; }
.hb-quiz-score { text-align: center; background: #fff; border-radius: .9rem; padding: .9rem; }
.hb-quiz-score .big { font-size: 2rem; font-weight: 800; color: #7c3aed; }

.hb-lx-done-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 0 1.6rem 1.2rem; }
.hb-lx-done-badge { background: #dcfce7; color: #166534; font-weight: 800; border-radius: 999px; padding: .4rem 1rem; }
.hb-lx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1rem 1.6rem 1.6rem; border-top: 1px solid var(--hb-border); }
.hb-lx-pager a { display: flex; flex-direction: column; text-decoration: none; color: var(--lx-ink); border: 1px solid var(--hb-border); border-radius: .9rem; padding: .7rem .9rem; }
.hb-lx-pager a:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, #fff); }
.hb-lx-pager .next { text-align: end; }
.hb-lx-pager small { color: var(--hb-muted); }
.hb-lx-pager span { font-weight: 700; }

/* ---------- Side bar ---------- */
.hb-lx-side { position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: .6rem; }
.hb-lx-side-card { background: #fff; border: 1px solid var(--hb-border); border-radius: 1rem; padding: .8rem .9rem; }
.hb-lx-side-title { font-weight: 800; margin-bottom: .3rem; cursor: pointer; }
.hb-lx-side-card ol { padding-inline-start: 1.3rem; margin: 0; font-size: .9rem; }
.hb-lx-side-card li { margin: .2rem 0; }
.hb-lx-side-card li a { text-decoration: none; color: var(--lx-ink); }
.hb-lx-side-card li.current a { font-weight: 800; color: color-mix(in srgb, var(--c) 75%, #000); }
.hb-lx-side-card li.done::marker { content: "✓ "; color: #16a34a; }
.hb-lx-side-link { display: block; background: #fff; border: 1px solid var(--hb-border); border-radius: .8rem; padding: .55rem .9rem; text-decoration: none; color: var(--lx-ink); font-weight: 600; }
.hb-lx-side-link:hover { border-color: var(--hb-green); }

/* ---------- Glossary, tools, manual ---------- */
.hb-lx-page-head { display: flex; gap: 1rem; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, #fff), #fff); border: 1px solid var(--hb-border);
    border-inline-start: 6px solid var(--c); border-radius: 1.25rem; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.hb-lx-page-head .e { font-size: 3rem; }
.hb-lx-page-head h1 { font-weight: 800; margin-bottom: .25rem; }
.hb-lx-page-head p { margin: 0; color: #4b5563; }
.hb-lx-search { border-radius: 999px; margin-bottom: 1rem; }
.hb-lx-letters { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1rem; }
.hb-lx-letters a { width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; border-radius: .6rem; background: #ede9fe; color: #5b21b6; font-weight: 800; text-decoration: none; }
.hb-lx-letter { font-weight: 800; color: #7c3aed; margin-top: 1.25rem; scroll-margin-top: 4.5rem; }
.hb-lx-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.hb-lx-term { background: #fff; border: 1px solid var(--hb-border); border-radius: .9rem; padding: .8rem 1rem; }
.hb-lx-term dt { font-size: 1.05rem; color: #4c1d95; }
.hb-lx-term dd { margin: .2rem 0 0; color: #374151; line-height: 1.55; }
.hb-lx-term dd a { display: block; font-size: .85rem; margin-top: .3rem; text-decoration: none; }

.hb-lx-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.hb-lx-tool { background: #fff; border: 1px solid var(--hb-border); border-top: 6px solid var(--c); border-radius: 1.25rem; padding: 1.2rem 1.3rem; }
.hb-lx-tool h2 { font-size: 1.3rem; font-weight: 800; }
.hb-lx-result { margin-top: 1rem; background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 1rem; padding: .9rem 1rem; text-align: center; }
.hb-lx-result .big { font-size: 2rem; font-weight: 800; color: color-mix(in srgb, var(--c) 70%, #000); }
.hb-lx-split { display: flex; height: 2.2rem; border-radius: .7rem; overflow: hidden; margin-top: .8rem; color: #fff; font-weight: 800; font-size: .85rem; }
.hb-lx-split > div { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.hb-lx-split .needs { background: #3b82f6; }
.hb-lx-split .wants { background: #f59e0b; }
.hb-lx-split .save { background: #10b981; }

.hb-lx-group-title { font-weight: 800; font-size: 1.4rem; margin: 1.5rem 0 .75rem; padding-inline-start: .7rem; border-inline-start: 6px solid var(--c); }
.hb-lx-manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.hb-lx-faq { margin: 0 1.6rem 1.2rem; }
.hb-lx-faq h2 { font-size: 1.15rem; font-weight: 800; }
.hb-lx-faq details { background: #f9fafb; border: 1px solid var(--hb-border); border-radius: .8rem; padding: .6rem .9rem; margin-bottom: .5rem; }
.hb-lx-faq summary { font-weight: 700; cursor: pointer; }
.hb-lx-faq p { margin: .5rem 0 0; }

/* ---------- Phones ---------- */
@media (max-width: 900px) {
    .hb-lx-hero { grid-template-columns: 1fr; padding: 1.75rem 1.25rem; }
    .hb-lx-hero-art { display: none; }
    .hb-lx-layout { grid-template-columns: 1fr; }
    .hb-lx-side { position: static; }
}
@media (max-width: 600px) {
    .hb-lx-hero h1 { font-size: 1.8rem; }
    .hb-lx-path { grid-template-columns: 1fr; }
    .hb-lx-lesson-head { flex-direction: column; text-align: center; padding: 1.2rem 1rem 1rem; }
    .hb-lx-lesson-head h1 { font-size: 1.55rem; }
    .hb-lx-body { padding: 1.1rem 1rem .2rem; font-size: 1rem; }
    .hb-lx-keys, .hb-quiz, .hb-lx-faq { margin-inline: 1rem; }
    .hb-lx-done-row { padding-inline: 1rem; }
    .hb-lx-pager { grid-template-columns: 1fr; padding: 1rem; }
    .hb-lx-pager .next { text-align: start; }
    .hb-lx-page-head { flex-direction: column; text-align: center; }
    .hb-lx-terms, .hb-lx-tools { grid-template-columns: 1fr; }
}

@media print {
    .hb-lx-side, .hb-lx-pager, .hb-lx-done-row, .hb-lx-hero-actions, .hb-lx-cta { display: none !important; }
    .hb-lx-layout { display: block; }
    .hb-lx-lesson { border: 0; }
}
