/* MCQ Forge — public pages (landing, shared test, terms/privacy), share modal, PWA bits.
   Uses the tokens from base.css only. Prefixes: pub- (chrome), lp-/lm-/st- (landing), sh- (share page),
   sm- (share modal), lg- (legal). */

/* ---------- public layout: no app chrome ---------- */
body.is-public .sidebar,
body.is-public .topbar,
body.is-public .bottomnav,
body.is-public #banner-slot { display: none !important; }
body.is-public .app { grid-template-columns: minmax(0, 1fr); }
body.is-public .main { padding: 0; }
body.is-public .view { max-width: none; }
@media (max-width: 900px) {
  body.is-public .toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.pub {
  --gutter: clamp(16px, 4vw, 40px);
  --pub-w: 1180px;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.pub-head {
  width: 100%; max-width: calc(var(--pub-w) + 2 * var(--gutter)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 18px;
}
.pub-head .brand { padding: 0; }
.pub-nav { display: flex; align-items: center; gap: 6px; }
.pub-body { width: 100%; max-width: calc(var(--pub-w) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); flex: 1; }
.lbl-short { display: none; }

.pub-foot {
  width: 100%; max-width: calc(var(--pub-w) + 2 * var(--gutter)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: start;
  padding: 36px var(--gutter) max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.pf-brand { display: flex; flex-direction: column; gap: 12px; }
.pf-brand .brand { padding: 0; }
.pf-brand .brand-mark { width: 28px; height: 28px; }
.pf-brand .brand-name { font-size: 1.2rem; }
.pf-note { color: var(--text-3); font-size: var(--fs-sm); max-width: 42ch; }
.pf-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; justify-content: flex-end; }
.pf-links a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.pf-links a:hover { color: var(--text); text-decoration: underline; }
.pf-copy { grid-column: 1 / -1; color: var(--text-3); font-size: var(--fs-xs); }

/* ---------- landing: hero ---------- */
.lp-hero {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding: clamp(24px, 6vh, 72px) 0 clamp(48px, 9vh, 104px);
}
.lp-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.55rem, 6vw, 4.9rem); line-height: 1.02; letter-spacing: -0.022em;
  max-width: 11.5ch; text-wrap: balance;
}
.lp-lead { margin-top: 22px; max-width: 44ch; color: var(--text-2); font-size: clamp(1.04rem, 1.5vw, 1.2rem); line-height: 1.6; }
.lp-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.lp-btn-quiet { background: transparent; }
.lp-btn-quiet:hover { background: var(--surface-2); }
.lp-login { margin-top: 18px; color: var(--text-3); font-size: var(--fs-sm); max-width: 52ch; }
.lp-login a { font-weight: 600; }

/* ---------- landing: the self-running test card ---------- */
.lp-hero-art { min-width: 0; }
.lp-mock { position: relative; width: 100%; max-width: 470px; margin-left: auto; }
.lm-glow {
  position: absolute; left: 4%; right: 4%; bottom: -14%; height: 46%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 150, 50, 0.42), rgba(232, 116, 58, 0.12) 60%, transparent 75%);
  filter: blur(18px);
}
:root[data-theme='light'] .lm-glow { opacity: 0.6; }
.lm-card {
  position: relative; z-index: 1;
  padding: 14px 16px 14px;
  border-radius: 26px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 96%, transparent), color-mix(in srgb, var(--surface-solid) 86%, transparent));
  box-shadow: var(--shadow-2), 0 50px 90px -50px rgba(242, 140, 40, 0.55);
  font-size: 0.92rem;
}
.lm-card::after { /* molten edge where the card meets the glow */
  content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), var(--ember), transparent);
  opacity: 0.8;
}
.lm-top { display: flex; align-items: center; gap: 10px; padding: 2px 2px 10px; }
.lm-x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--text-3); background: var(--surface-2); }
.lm-x svg { width: 15px; height: 15px; }
.lm-title { flex: 1; text-align: center; font-family: var(--font-display); font-size: 1.05rem; }
.lm-timer {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line-strong); font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums;
}
.lm-timer svg { width: 13px; height: 13px; color: var(--text-3); }
.lm-bar { height: 3px; border-radius: 3px; background: var(--surface-hover); overflow: hidden; margin-bottom: 14px; }
.lm-bar > i { display: block; height: 100%; width: 66%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 10px var(--gold); }

.lm-stage { display: grid; }
.lm-slide { grid-area: 1 / 1; min-width: 0; padding: 14px 14px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.lm-s2 { opacity: 0; visibility: hidden; }
.lm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.lm-subj { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.78rem; color: var(--text-2); }
.lm-subj i { width: 8px; height: 8px; border-radius: 50%; }
.lm-count { font-size: 0.76rem; font-weight: 700; color: var(--text-3); margin-left: auto; }
.lm-meta .badge { height: 20px; font-size: 0.68rem; }
.lm-q { font-family: var(--font-display); font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.3; margin-bottom: 14px; min-height: 2.6em; }
.lm-opts { display: flex; flex-direction: column; gap: 7px; }
.lm-opt {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px 6px 7px;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.lm-key {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px;
  font-weight: 800; font-size: 0.74rem; color: var(--text-2); border: 1px solid var(--line-strong); background: var(--surface-2);
}
.lm-otext { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-tick { width: 20px; height: 20px; display: grid; place-items: center; color: var(--ok); }
.lm-tick svg { width: 18px; height: 18px; }
/* answered state (the static picture, and where the animation ends up) */
.lm-right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 0 0 1px var(--ok), 0 0 26px -6px color-mix(in srgb, var(--ok) 70%, transparent); }
.lm-right .lm-key { background: var(--ok); color: #04150d; border-color: transparent; }
.lm-other { opacity: 0.45; }
.lm-fb {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 9px 11px; border-radius: 12px;
  background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  font-size: 0.8rem; line-height: 1.45; color: var(--text);
}
.lm-fb-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--ok); color: #04150d; }
.lm-fb-ic svg { width: 14px; height: 14px; }

.lm-foot { display: flex; align-items: center; gap: 10px; padding: 12px 2px 0; }
.lm-ring { position: relative; width: 48px; height: 48px; flex: none; }
.lm-ring-svg { transform: rotate(-90deg); overflow: visible; }
.lm-ring-track, .lm-ring-fill { fill: none; stroke-width: 5; }
.lm-ring-track { stroke: var(--ring-track); }
.lm-ring-fill { stroke: var(--gold); stroke-linecap: round; stroke-dashoffset: 44.77; filter: drop-shadow(0 0 5px rgba(242, 160, 50, 0.5)); }
.lm-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.lm-num b { grid-area: 1 / 1; font-weight: 800; opacity: 0; }
.lm-num .n2 { opacity: 1; }
.lm-mastered { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.lm-mastered strong { font-size: 0.86rem; }
.lm-mastered span { font-size: 0.74rem; color: var(--text-3); }
.lm-next {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 14px; border-radius: 10px;
  font-weight: 700; font-size: 0.82rem; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 45%, var(--ember) 130%);
}
.lm-next svg { width: 15px; height: 15px; }

/* The loop: two questions, 8 s each. Only for people who have not asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .lm-slide { --d: 0s; visibility: visible; animation: lm-slide 16s var(--d) infinite both; }
  .lm-s2 { --d: 8s; }
  .lm-right { animation: lm-right 16s var(--d) infinite both; }
  .lm-right .lm-key { animation: lm-right-key 16s var(--d) infinite both; }
  .lm-right::after {
    content: ''; position: absolute; left: 20px; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
    border: 2px solid var(--gold-hi); opacity: 0; pointer-events: none;
    animation: lm-tap 16s var(--d) infinite both;
  }
  .lm-other { animation: lm-other 16s var(--d) infinite both; }
  .lm-tick { animation: lm-pop 16s var(--d) infinite both; }
  .lm-fb { animation: lm-fb 16s var(--d) infinite both; }
  .lm-ring-fill { animation: lm-ring 16s infinite both; }
  .lm-num .n1 { animation: lm-n1 16s infinite both; }
  .lm-num .n2 { animation: lm-n2 16s infinite both; }
  .lm-num .n3 { animation: lm-n3 16s infinite both; }
  .lm-bar > i { animation: lm-bar 16s infinite both; }
  .lm-next { animation: lm-next 8s infinite both; }
  .lp-mock.is-paused *, .lp-mock.is-paused *::after { animation-play-state: paused !important; }
}
@keyframes lm-slide {
  0% { opacity: 0; transform: translateY(10px); }
  3%, 46% { opacity: 1; transform: none; }
  50%, 100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes lm-right {
  0%, 15% { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-solid) 55%, transparent); box-shadow: none; transform: none; }
  18% { border-color: var(--gold); background: var(--gold-soft); box-shadow: none; transform: scale(0.985); }
  21%, 100% { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 0 0 1px var(--ok), 0 0 26px -6px color-mix(in srgb, var(--ok) 70%, transparent); transform: none; }
}
@keyframes lm-right-key {
  0%, 15% { background: var(--surface-2); color: var(--text-2); border-color: var(--line-strong); }
  18% { background: var(--gold); color: var(--on-gold); border-color: transparent; }
  21%, 100% { background: var(--ok); color: #04150d; border-color: transparent; }
}
@keyframes lm-tap {
  0%, 16% { opacity: 0; transform: scale(0.3); }
  17% { opacity: 0.9; transform: scale(0.4); }
  22%, 100% { opacity: 0; transform: scale(1.5); }
}
@keyframes lm-other {
  0%, 20% { opacity: 1; }
  24%, 100% { opacity: 0.45; }
}
@keyframes lm-pop {
  0%, 20% { opacity: 0; transform: scale(0.4); }
  23% { opacity: 1; transform: scale(1.2); }
  26%, 100% { opacity: 1; transform: none; }
}
@keyframes lm-fb {
  0%, 23% { opacity: 0; transform: translateY(6px); }
  27%, 100% { opacity: 1; transform: none; }
}
@keyframes lm-ring {
  0%, 21% { stroke-dashoffset: 49.74; }
  25%, 71% { stroke-dashoffset: 44.77; }
  75%, 97% { stroke-dashoffset: 39.79; }
  100% { stroke-dashoffset: 49.74; }
}
@keyframes lm-n1 { 0%, 22.9% { opacity: 1; } 23%, 99.9% { opacity: 0; } 100% { opacity: 1; } }
@keyframes lm-n2 { 0%, 22.9% { opacity: 0; } 23%, 72.9% { opacity: 1; } 73%, 100% { opacity: 0; } }
@keyframes lm-n3 { 0%, 72.9% { opacity: 0; } 73%, 99.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lm-bar {
  0%, 21% { width: 58%; }
  25%, 71% { width: 66%; }
  75%, 97% { width: 75%; }
  100% { width: 58%; }
}
@keyframes lm-next {
  0%, 30% { box-shadow: none; }
  36% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 30%, transparent); }
  44%, 100% { box-shadow: none; }
}

/* ---------- landing: sections ---------- */
.lp-section { padding: clamp(52px, 9vh, 104px) 0; border-top: 1px solid var(--line); }
.lp-h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.08; letter-spacing: -0.012em; text-wrap: balance; }
.lp-sec-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: clamp(32px, 5vh, 52px); }
.lp-sec-sub { color: var(--text-2); max-width: 44ch; }

/* how it works — a real sequence, so the steps are numbered and joined by one rail */
.lp-steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.lp-steps::before {
  content: ''; position: absolute; left: 20px; right: 0; top: 19px; height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--ember) 45%, color-mix(in srgb, var(--steel) 45%, transparent) 100%);
  opacity: 0.7;
}
.lp-step { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ls-head { display: flex; flex-direction: column; gap: 18px; }
.ls-n {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-display); font-size: 1.2rem; color: var(--gold-text);
  background: var(--bg); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: 0 0 0 6px var(--bg), 0 0 22px -4px rgba(242, 181, 68, 0.55);
}
.lp-step h3 { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.15; }
.lp-step > p { color: var(--text-2); max-width: 36ch; }

.st-art {
  margin-top: 10px; padding: 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-1); font-size: 0.8rem;
}
.st-file { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.sf-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: var(--gold-text); }
.sf-ic svg { width: 21px; height: 21px; }
.sf-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sf-name strong { font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-name span { color: var(--text-3); }
.sf-lines { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.sf-lines i { display: block; height: 6px; border-radius: 6px; background: var(--surface-hover); }
.sf-lines i:nth-child(1) { width: 92%; }
.sf-lines i:nth-child(2) { width: 74%; }
.sf-lines i:nth-child(3) { width: 84%; }

.st-qs { display: flex; flex-direction: column; gap: 7px; }
.sq { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.sq:nth-child(2) { margin-left: 8px; opacity: 0.85; }
.sq:nth-child(3) { margin-left: 16px; opacity: 0.65; }
.sq-n { font-weight: 800; font-size: 0.7rem; color: var(--gold-text); }
.sq-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.sq-keys { display: flex; gap: 3px; }
.sq-keys i { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 5px; font-style: normal; font-size: 0.58rem; font-weight: 800; color: var(--text-3); border: 1px solid var(--line-strong); }

.st-res { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sr-grid { display: grid; grid-template-columns: repeat(6, 20px); gap: 4px; }
.sr-grid i { height: 20px; display: grid; place-items: center; border-radius: 6px; font-style: normal; font-size: 0.6rem; font-weight: 800; }
.sr-grid i.ok { background: var(--ok-soft); color: var(--ok); }
.sr-grid i.bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.sr-sum { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sr-sum strong { font-size: 0.9rem; }
.sr-sum span { color: var(--text-3); }

/* features: the AI block is the one heavy surface; the rest is a quiet list */
.lp-features { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.lp-ai {
  position: relative; overflow: hidden;
  padding: clamp(22px, 3vw, 36px); border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  background: radial-gradient(120% 70% at 0% 0%, var(--gold-soft), transparent 62%), var(--surface);
  box-shadow: var(--shadow-1);
}
.lp-ai-text { margin-top: 12px; color: var(--text-2); max-width: 48ch; }
.lp-providers { margin-top: 22px; border-top: 1px solid var(--line); }
.lp-providers li {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: baseline; gap: 4px 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.lpp-name { font-family: var(--font-display); font-size: 1.28rem; line-height: 1.2; }
.lpp-by { color: var(--text-3); font-size: var(--fs-sm); min-width: 0; }
.lp-providers .badge { align-self: center; }
.lp-keynote { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: var(--fs-sm); color: var(--text-2); }
.lp-keynote strong { color: var(--text); }
.kn-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--gold-soft); color: var(--gold-text); }
.kn-ic svg { width: 18px; height: 18px; }

.lp-feats { display: flex; flex-direction: column; }
.lp-feat { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.lp-feat:first-child { padding-top: 6px; }
.lp-feat:last-child { border-bottom: 0; }
.lf-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); color: var(--gold-text); border: 1px solid var(--line); }
.lf-ic svg { width: 21px; height: 21px; }
.lf-urdu span { font-family: var(--font-urdu); font-size: 0.9rem; line-height: 1; padding-top: 6px; }
.lp-feat h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.lp-feat p { color: var(--text-2); margin-top: 4px; font-size: 0.95rem; max-width: 48ch; }

/* faq */
.lp-faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.lp-faq-side .lp-sec-sub { margin-top: 12px; }
.lp-faq-list { border-top: 1px solid var(--line); }
.lp-qa { border-bottom: 1px solid var(--line); }
.lp-qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.04rem;
}
.lp-qa summary::-webkit-details-marker { display: none; }
.lp-qa summary:hover { color: var(--gold-text); }
.qa-chev { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-2); transition: transform 0.25s var(--ease), background 0.2s; }
.qa-chev svg { width: 15px; height: 15px; }
.lp-qa[open] .qa-chev { transform: rotate(45deg); background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }
.lp-qa p { padding: 0 44px 20px 2px; color: var(--text-2); max-width: 64ch; }

/* closing call to action */
.lp-close {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 40px;
  margin-bottom: clamp(40px, 7vh, 80px); padding: clamp(28px, 4vw, 48px);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: 30px;
  background:
    radial-gradient(90% 140% at 100% 120%, rgba(232, 116, 58, 0.22), transparent 60%),
    radial-gradient(70% 120% at 0% -20%, var(--gold-soft), transparent 60%),
    var(--surface);
}
.lc-copy { max-width: 46ch; }
.lc-copy p { margin-top: 10px; color: var(--text-2); }
.lp-close .lp-ctas { margin-top: 0; }

/* ---------- landing: responsive ---------- */
@media (max-width: 960px) {
  .lp-hero { grid-template-columns: minmax(0, 1fr); }
  .lp-title { max-width: 14ch; }
  .lp-mock { margin: 0; max-width: 520px; }
  .lp-features, .lp-faq { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .lp-steps { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-left: 56px; }
  .lp-steps::before { left: 19px; right: auto; top: 20px; bottom: 20px; width: 1px; height: auto; background: linear-gradient(180deg, var(--gold), var(--ember) 50%, color-mix(in srgb, var(--steel) 45%, transparent)); }
  .ls-head { flex-direction: row; align-items: center; gap: 14px; }
  .ls-n { position: absolute; left: -56px; top: -4px; }
  .lp-step > p { max-width: none; }
}
@media (max-width: 560px) {
  .pub-head { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .pub-head .brand-mark { width: 30px; height: 30px; }
  .pub-head .brand-name { font-size: 1.2rem; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .lp-ctas .btn { flex: 1 1 100%; }
  .lm-card { padding: 12px 12px 12px; border-radius: 22px; }
  .lm-slide { padding: 12px 11px 10px; }
  .lp-providers li { grid-template-columns: minmax(0, 1fr) auto; }
  .lpp-by { grid-column: 1; grid-row: 2; }
  .lp-providers .badge { grid-column: 2; grid-row: 1 / span 2; }
  .lp-qa p { padding-right: 2px; }
  .pub-foot { grid-template-columns: minmax(0, 1fr); }
  .pf-links { justify-content: flex-start; }
}

/* ---------- share modal ---------- */
.sm-body { display: flex; flex-direction: column; gap: 16px; }
.sm-count { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-2); }
.sm-count strong { color: var(--text); }
.sm-count .spin { margin-top: 2px; }
.sm-count > svg { width: 18px; height: 18px; flex: none; color: var(--gold-text); margin-top: 2px; }
.sm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 4px 0 14px; }
.sm-link { display: flex; gap: 8px; }
.sm-link .input { font-variant-numeric: tabular-nums; color: var(--gold-text); font-weight: 600; }
.sm-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sm-ways .btn { width: 100%; }
.btn-wa { color: #0b2e1c; border-color: transparent; background: #25d366; }
.btn-wa:hover { background: #3be07a; }
.sm-done { display: flex; align-items: center; gap: 12px; }
.sm-done .sd-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--ok-soft); color: var(--ok); }
.sm-done .sd-ic svg { width: 20px; height: 20px; }
.sm-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sm-gate .sg-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--gold-soft); color: var(--gold-text); }
.sm-gate .sg-ic svg { width: 24px; height: 24px; }
.sm-gate p { color: var(--text-2); }
.sm-mine { border-top: 1px solid var(--line); padding-top: 4px; }
.sm-mine summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.sm-mine summary:hover { color: var(--text); }
.sm-mine ul { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.sm-mine li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.sm-mine .mi-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sm-mine .mi-t strong { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-mine .mi-t span { font-size: var(--fs-xs); color: var(--text-3); }
.sm-mine .icon-btn { width: 34px; height: 34px; }

/* ---------- shared test page ---------- */
.sh-wrap { max-width: 860px; margin: 0 auto; padding: clamp(8px, 3vh, 32px) 0 clamp(40px, 8vh, 80px); }
.sh-card { padding: clamp(22px, 4vw, 40px); overflow: hidden; }
.sh-card::before {
  content: ''; position: absolute; right: -80px; top: -120px; width: 340px; height: 300px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 181, 68, 0.2), transparent);
}
.sh-from { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--text-2); font-size: var(--fs-sm); }
.sh-avatar {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--ember)); color: var(--on-gold); font-weight: 800; font-size: 0.85rem;
}
.sh-from strong { color: var(--text); }
.sh-title { position: relative; margin-top: 16px; font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.sh-desc { position: relative; margin-top: 12px; color: var(--text-2); max-width: 62ch; white-space: pre-line; overflow-wrap: anywhere; }
.sh-facts { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); align-items: start; }
.sh-count { display: flex; flex-direction: column; line-height: 1; }
.sh-count b { font-family: var(--font-display); font-weight: 400; font-size: 3.2rem; color: var(--gold-text); }
.sh-count span { margin-top: 6px; color: var(--text-3); font-size: var(--fs-sm); }
.sh-mix { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sh-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); margin-bottom: 7px; }
.sh-diffbar { display: flex; height: 10px; border-radius: 10px; overflow: hidden; background: var(--surface-hover); gap: 2px; }
.sh-diffbar i { display: block; height: 100%; min-width: 4px; }
.sh-diffbar .d-easy { background: var(--ok); }
.sh-diffbar .d-medium { background: var(--steel); }
.sh-diffbar .d-hard { background: var(--bad); }
.sh-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-xs); color: var(--text-2); }
.sh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sh-legend i { width: 8px; height: 8px; border-radius: 50%; }
.sh-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-topics .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* scoped: .sh-actions is also the subject page header (pages.css) */
.sh-card .sh-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.sh-note { position: relative; margin-top: 12px; color: var(--text-3); font-size: var(--fs-sm); }
.sh-preview { margin-top: clamp(28px, 5vh, 44px); }
.sh-preview h2 { font-family: var(--font-display); font-size: var(--fs-xl); margin-bottom: 14px; }
.sh-q { padding: 18px 20px; }
.sh-q + .sh-q { margin-top: 12px; }
.shq-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.shq-n { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); }
.shq-text { font-family: var(--font-display); font-size: 1.18rem; line-height: 1.32; overflow-wrap: anywhere; }
.shq-text.urdu { font-family: var(--font-urdu); line-height: 2.1; }
.shq-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.shq-opt { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: 0.92rem; min-width: 0; }
.shq-opt .k { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 0.7rem; font-weight: 800; color: var(--text-3); border: 1px solid var(--line-strong); }
.shq-opt span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sh-more { margin-top: 14px; color: var(--text-3); font-size: var(--fs-sm); }
.sh-saved { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; font-size: var(--fs-sm); }
.sh-saved svg { width: 18px; height: 18px; }
.sh-empty { max-width: 640px; margin: clamp(16px, 6vh, 64px) auto; }
.save-choice { display: flex; flex-direction: column; gap: 14px; }
.save-choice .seg { align-self: flex-start; }
@media (max-width: 600px) {
  .sh-facts { grid-template-columns: minmax(0, 1fr); }
  .sh-count { flex-direction: row; align-items: baseline; gap: 10px; }
  .sh-count b { font-size: 2.6rem; }
  .shq-opts { grid-template-columns: minmax(0, 1fr); }
  .sh-card .sh-actions .btn { flex: 1 1 100%; }
}

/* ---------- terms & privacy ---------- */
.lg-wrap { max-width: 760px; margin: 0 auto; padding: clamp(8px, 3vh, 32px) 0 clamp(40px, 8vh, 80px); }
.lg-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 26px; }
.lg-tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.lg-tabs a[aria-current='page'] { background: var(--surface-solid); color: var(--text); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4); }
.lg-title { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1.05; }
.lg-updated { margin-top: 10px; color: var(--text-3); font-size: var(--fs-sm); }
.lg-intro { margin-top: 18px; font-size: 1.08rem; color: var(--text-2); }
.lg-body { margin-top: 30px; }
.lg-body section + section { margin-top: 28px; }
.lg-body h2 { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.2; margin-bottom: 8px; }
.lg-body p, .lg-body li { color: var(--text-2); }
.lg-body p + p { margin-top: 10px; }
.lg-body ul { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.lg-body li { position: relative; padding-left: 20px; }
.lg-body li::before { content: ''; position: absolute; left: 4px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.lg-body strong { color: var(--text); }

/* ---------- PWA: install button, iOS hint, update toast ---------- */
.ios-steps { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.ios-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.ios-steps strong { color: var(--text); }
.ios-n { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--gold-text); font-weight: 800; font-size: 0.85rem; }
.update-toast { gap: 10px; }
.update-toast .ut-text { flex: 1; }
.update-toast .icon-btn { width: 32px; height: 32px; }
