/* App shell of «آمادگی تیزهوشان»: home, worksheet pages, PDF viewer, guide, purchase. Loaded after style.css and tz.css. */
:root {
  --card: #fffdf7;
  --card-ink: #1d1745;
  --ok: #2fd08a;
  --brand-a: #6c4bff;
  --brand-b: #14b8a6;
}

/* ---------- home ---------- */
.home-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0 4px; }
.hero .logo svg { width: 92px; height: 92px; filter: drop-shadow(0 10px 22px rgba(108, 75, 255, .45)); }
.hero h1 { font-size: 26px; font-weight: 900; margin-top: 6px; }
.hero p { color: var(--muted); font-size: 13.5px; }
.full-chip { margin-top: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 900; color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-a), var(--gold-b)); }
.home-cards { display: flex; flex-direction: column; gap: 10px; width: min(100%, 520px); align-self: center; }
.home-card { min-height: 74px; }
.home-card .emo { font-size: 30px; }
.home-card b { font-size: 16.5px; }
.home-fine { font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------- worksheet list ---------- */
.ws-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.ws-box h3 { margin: 0; font-size: 16px; }
.ws-box p { margin: 0; font-size: 12.5px; color: var(--muted); }
.ws-box .tz-card { background: rgba(255, 255, 255, .05); }

/* ---------- worksheet runner (rich content: figures are SVG) ---------- */
.wsq { -webkit-user-select: text; user-select: text; }
.wsq svg { max-width: 100%; height: auto; }
.wsq .fig { display: flex; justify-content: center; margin: 4px 0; overflow-x: auto; }
.wsq .tz-text ul, .wsq .tz-text blockquote, .wsq .tz-text .cases { font-weight: 400; margin: 6px 0; }
.wsq .tz-text ul { padding-inline-start: 20px; }
.wsq .tz-pass { max-height: none; }
.wsq .tz-pass .pfig { display: flex; justify-content: center; margin-top: 8px; }
.wsq .tz-opt span { flex: 1; min-width: 0; }
.wsq .tz-opt svg { background: #fff; border-radius: 6px; }
.wsq .opts-fig { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wsq .opts-fig .tz-opt { flex-direction: column; justify-content: center; }
.wsq table.code { border-collapse: collapse; font-size: 11px; margin: 0 auto; }
.wsq table.code th, .wsq table.code td { border: 1px solid #555; padding: 2px 5px; text-align: center; }
.wsq table.code td { font-size: 14px; }
.wsq table.grid { border-collapse: collapse; margin: 4px auto; }
.wsq table.grid td, .wsq table.grid th { border: 1.5px solid #444; padding: 4px 10px; text-align: center; font-weight: 800; }
.wsq table.faces { margin: 0 auto; border-collapse: collapse; }
.wsq table.faces td { padding: 2px 4px; font-weight: 900; font-size: 18px; text-align: center; }
.wsq .shrow { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.wsq b.q { font-size: 26px; font-weight: 900; }
.wsq .pair { display: inline-flex; flex-direction: column; gap: 4px; border: 1.5px solid #444; padding: 6px 8px; border-radius: 8px; }
.wsq .sign { border: 1.5px solid #444; border-radius: 6px; padding: 2px 6px; font-size: 12.5px; line-height: 1.6; white-space: nowrap; }
.wsq .sym { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif; letter-spacing: 1px; white-space: nowrap; }
.wsq .ltr { unicode-bidi: isolate; direction: ltr; display: inline-block; letter-spacing: 1.5px; }
.wsq .tz-key .in svg { background: #fff; border-radius: 6px; }
.lock-note { padding: 10px 12px; border-radius: 14px; background: rgba(255, 216, 74, .12); border: 1px solid rgba(255, 216, 74, .4); font-size: 13px; font-weight: 700; }

/* ---------- guide ---------- */
.guide { font-size: 15px; line-height: 1.95; -webkit-user-select: text; user-select: text; }
.guide ul { margin: 6px 0; padding-inline-start: 20px; }
.guide li { margin: 4px 0; }
.guide h4 { margin: 12px 0 2px; font-size: 15px; color: var(--gold-a); }
.guide .tip { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 191, 46, .12); border: 1px solid rgba(255, 191, 46, .4); }
.gtable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.gtable th, .gtable td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.gtable th { background: rgba(124, 92, 255, .25); }
.g-upd { font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- PDF viewer ---------- */
.pdf-ov { display: flex; flex-direction: column; padding: 0; background: #2a2840; place-items: stretch; }
.pdf-bar { display: flex; align-items: center; gap: 8px; padding: calc(var(--sat) + 8px) 10px 8px; background: #141238; border-bottom: 1px solid var(--line); }
.pdf-bar b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-bar .icon-btn { width: 42px; height: 42px; font-size: 20px; font-weight: 900; }
.pdf-pages { flex: 1; overflow: auto; padding: 10px 8px calc(var(--sab) + 16px); display: flex; flex-direction: column; align-items: safe center; gap: 10px; touch-action: pan-x pan-y; }
.pdf-pages canvas { background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); max-width: none; }
.pdf-pages .ph { background: #fff; opacity: .9; }
.pdf-msg { color: var(--muted); padding: 30px; text-align: center; }

/* ---------- purchase & about ---------- */
.buy-sheet { align-items: stretch; text-align: start; }
.buy-ic { font-size: 54px; text-align: center; }
.buy-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.buy-list li { padding: 9px 12px; border-radius: 14px; background: rgba(0, 0, 0, .2); }
.btn.primary { background: linear-gradient(180deg, var(--gold-a), var(--gold-b)); color: var(--gold-ink); border: 0; box-shadow: 0 4px 0 var(--gold-edge); font-weight: 900; }
.about { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 10px 0; }
.about svg, .about .app-logo { width: 84px; height: 84px; }
.app-logo { border-radius: 22%; box-shadow: 0 6px 18px rgba(46, 42, 143, .18); }
.about b { font-size: 18px; }
.about p { font-size: 14px; color: var(--muted); line-height: 1.9; }
.about .maker { color: var(--ink); font-weight: 800; font-size: 15px; }

/* ---------- درس‌نامه: reads like a textbook (js/tz.js lessons / lesson) ---------- */
.lp-toc-top { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.lp-toc-top b { font-size: 14px; }
.lp-toc-top small { font-size: 12px; color: var(--muted); }
.lp-bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.lp-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand-a), var(--brand-b)); }
.lp-chap { flex: none; border-radius: 18px; background: #fdf8ee; color: #2b2540; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.lp-chap-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--cc) 22%, #fdf8ee); border-bottom: 2px solid var(--cc); }
.lp-chap-n { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 900; color: #fff; background: var(--cc); }
.lp-chap-h small { display: block; font-size: 11.5px; font-weight: 700; color: #6d6488; }
.lp-chap-h b { display: block; font-size: 16.5px; font-weight: 900; }
.lp-chap-p { font-size: 13px; font-weight: 800; color: #6d6488; }
.lp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; text-align: start; border-top: 1px dashed #e3dccb; color: inherit; }
.lp-row:first-of-type { border-top: 0; }
.lp-row:active { background: rgba(0, 0, 0, .04); }
.lp-row-n { flex: none; min-width: 34px; font-size: 13px; font-weight: 900; color: var(--cc); filter: brightness(.8); }
.lp-row b { display: block; font-size: 14.5px; }
.lp-row small { display: block; font-size: 12px; color: #7a7290; line-height: 1.6; }
.lp-row-s { flex: none; width: 22px; text-align: center; font-weight: 900; color: #1fa36b; }
.lp-row.locked b, .lp-row.locked .lp-row-n { opacity: .7; }
.lp-row.locked .lp-row-s { font-size: 13px; opacity: .55; }

.lp { flex: none; -webkit-user-select: text; user-select: text; background: #fdf8ee; color: #2b2540; border-radius: 18px; padding: 0 16px 18px; font-size: 15.5px; line-height: 2; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); counter-reset: ex; position: relative; }
.lp-head { margin: 0 -16px 6px; padding: 16px 16px 14px; border-top: 6px solid var(--cc); border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--cc) 14%, #fdf8ee); }
.lp-kicker { display: inline-block; font-size: 12px; font-weight: 900; color: #fff; background: var(--cc); padding: 2px 10px; border-radius: 999px; }
.lp-head h1 { margin: 8px 0 2px; font-size: 23px; font-weight: 900; line-height: 1.5; color: #231c3d; }
.lp-meta { margin: 0; font-size: 12.5px; color: #6d6488; }
.lp-goal { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #ebe3d2; }
.lp-goal b { display: block; font-size: 12.5px; color: #6d6488; }
.lp-goal p { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.8; }
.lp-sec { padding-top: 6px; }
.lp-sec-h { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 18px; font-weight: 900; color: #231c3d; text-align: start; }
.lp-sec-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; color: #fff; background: var(--cc); }
.lp p { margin: 6px 0; }
.lp ul, .lp ol { margin: 6px 0; padding-inline-start: 22px; }
.lp li { margin: 3px 0; }
.lp li::marker { color: var(--cc); }
.lp b { color: #1d1638; }
.lp .ex { counter-increment: ex; margin: 12px 0; padding: 8px 14px 10px; border-radius: 12px; background-color: #fff; border: 1.5px solid #cfe3f7;
  background-image: repeating-linear-gradient(180deg, transparent 0 30px, #eef4fb 30px 31px); }
.lp .ex::before { content: "✏️ مثال حل‌شده"; display: block; font-weight: 900; font-size: 13px; color: #2c7ac9; }
.lp .tip { margin: 12px 0; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: #fff3c4; border-inline-start: 5px solid #f2b705; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.lp .tip::before { content: "📌 نکته‌ی تستی"; display: block; font-weight: 900; font-size: 13px; color: #a46f00; }
.lp .tip.trap { background: #ffe6e9; border-inline-start-color: #e5485f; }
.lp .tip.trap::before { content: "⚠️ دام‌های تستی"; color: #c22f47; }
.lp .fig { margin: 10px auto; padding: 10px 12px; border-radius: 10px; background: #2b2540; color: #fff; font-family: "Courier New", monospace, Vazirmatn; font-size: 17px; line-height: 1.5; white-space: pre; direction: ltr; text-align: left; overflow-x: auto; width: fit-content; max-width: 100%; }
.lp.preview .lp-sec:last-of-type { -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.lp-more { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; padding: 14px; border-radius: 14px; border: 1.5px dashed #d7cdb6; text-align: center; }
.lp-more p { margin: 0; font-size: 13.5px; color: #6d6488; line-height: 1.8; }
.lp-more .btn { color: #4b33c9; border-color: #d7cdb6; }
.lp-foot { display: flex; flex-direction: column; gap: 8px; }
.lp-next { white-space: normal; height: auto; min-height: 44px; padding: 8px 14px; line-height: 1.6; }
.lp ol { list-style: persian; }
.lp-toc-top, .lp-foot { flex: none; }
