:root {
  --urdu-font: "Noto Nastaliq Urdu";
  color-scheme: light;
  --text: #20352c;
  --muted: #506358;
  --background: #f7f9f3;
  --surface: #fff;
  --edge: #dbe4da;
  --primary: #14634a;
  --primary-text: #fff;
  --soft: #e9f3eb;
  --hero: #171c32;
  --hero-text: #f8fbf8;
  --right: #d9f2dd;
  --wrong: #fae0de;
  --round: 15px;
}
[data-theme=dark] {
  color-scheme: dark;
  --text: #def2e6;
  --muted: #afc2b6;
  --background: #101a16;
  --surface: #17241e;
  --edge: #35483e;
  --primary: #a2e4bb;
  --primary-text: #082a1c;
  --soft: #24372d;
  --right: #1d482f;
  --wrong: #542c2c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.5 "Plus Jakarta Sans", var(--urdu-font), ui-sans-serif, system-ui, sans-serif; background: var(--background); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
h1, h2, h3, p { margin: 0 0 .75rem; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.35rem, 2vw, 1.85rem); }
h3 { font-size: 1.12rem; }
img { max-width: 100%; height: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem; border-bottom: 1px solid var(--edge); }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: .5rem; padding: .68rem 1.05rem;
  min-height: var(--action-height); border: 1px solid transparent; border-radius: var(--action-radius); cursor: pointer; font: inherit;
  font-weight: 700; line-height: 1.25; color: var(--button-text); background: var(--hero-highlight); text-decoration: none;
  box-shadow: var(--action-shadow); transition: var(--control-transition); text-align: center;
}
button:not(:disabled):hover, .button:hover { background: var(--button-hover); text-decoration: none; }
button:not(:disabled):active, .button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .65; box-shadow: none; }
.secondary, .plain { color: var(--text); background: var(--surface); border-color: var(--edge); box-shadow: none; }
button.secondary:not(:disabled):hover, .button.secondary:hover, button.plain:not(:disabled):hover, .button.plain:hover, a.plain:hover {
  background: var(--soft); border-color: var(--primary); text-decoration: none;
}
.plain { background: transparent; border-color: transparent; }
.button-small { padding: .45rem .75rem; }
.icon { display: inline-grid; place-items: center; inline-size: var(--action-height); block-size: var(--action-height); padding: 0; text-decoration: none; font-size: 1.4rem; }
input:not([type=radio], [type=checkbox]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--edge);
  border-radius: 9px; padding: .57rem .72rem; width: 100%; min-width: 0;
}
input[type=radio], input[type=checkbox] { accent-color: var(--primary); }
textarea { resize: vertical; }
.skip { position: fixed; left: 1rem; top: -10rem; z-index: 20; padding: .5rem 1rem; background: var(--surface); }
.skip:focus { top: 1rem; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; min-height: 0; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--edge); }
.nav-inner, .nav-actions, .nav-inner nav, .footer-inner, .footer-inner nav { display: flex; align-items: center; gap: .9rem; }
.nav-inner { justify-content: space-between; min-height: 72px; }
.nav-inner nav a, .nav-actions > a:not(.button) { font-size: .88rem; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav-inner nav a:hover { color: var(--primary); text-decoration: underline; }
.nav-actions { gap: .35rem; flex-shrink: 0; }
.nav-actions form { margin: 0; }
.nav-toggle { display: none; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.28rem; font-weight: 780; letter-spacing: -.045em; line-height: 1.05; text-decoration: none; color: inherit; white-space: nowrap; }
.brand small { display: block; margin-top: .25rem; text-transform: uppercase; letter-spacing: .15em; font-size: .57rem; color: var(--muted); }
.brand-mark { display: block; inline-size: 2.375rem; block-size: 2.375rem; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.eyebrow { font-size: .78rem; text-transform: uppercase; font-weight: 750; letter-spacing: .13em; color: inherit; }
.actions, .pager { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.pager-jump input { width: 6rem; }
.page-header p { margin: .55rem 0 0; color: #d6dbe5; }
.stats dt, .tile span, .muted { font-size: .88rem; color: var(--muted); }
.section { padding-block: 1.75rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.recent { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile, .card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--round); padding: 1.15rem; min-width: 0; overflow-wrap: anywhere; }
.tile { display: grid; align-content: start; gap: .15rem; text-decoration: none; color: var(--text); }
a.tile:hover { border-color: var(--primary); }
.tile strong { font-size: 1.02rem; }
.stack { display: grid; align-content: start; gap: .85rem; }
.stack > *, .card > :last-child { margin-bottom: 0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0; }
.filters label { display: grid; gap: .25rem; flex: 1 1 11rem; }
.form p { display: grid; gap: .25rem; }
.form label { font-weight: 600; }
.form .helptext { font-size: .84rem; color: var(--muted); }
.errorlist { color: #b24a42; }
[data-theme=dark] .errorlist { color: #ffaaa1; }
.messages p { margin: .75rem 0; padding: .7rem 1rem; border-radius: 10px; background: var(--soft); }
.intro { display: flex; gap: 1rem; align-items: flex-start; margin-block: 1rem; }
.intro img { width: min(28%, 220px); border-radius: 9px; }
.intro h2 { font-size: 1.25rem; margin-bottom: .65rem; }
.intro p { max-width: 76ch; }
.intro p:last-child { margin-bottom: 0; }
@media (max-width: 480px) {
  .intro { flex-direction: column; }
  .intro img { width: min(100%, 220px); }
}
.crumbs, .metadata { color: var(--muted); font-size: .87rem; }
.metadata { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: .6rem; }
.section-links { columns: 3; padding-left: 1.2rem; }
.section-links li { break-inside: avoid; }
.options { list-style: none; margin: .75rem 0; padding: 0; display: grid; gap: .45rem; }
.choice { display: flex; align-items: center; justify-content: flex-start; gap: .55rem; width: 100%; text-align: left; font-weight: 500; line-height: 1.35; padding: .5rem .65rem; color: var(--text); background: var(--background); border: 1px solid var(--edge); border-radius: 9px; }
.choice b { display: grid; place-items: center; min-width: 1.6rem; min-height: 1.6rem; border-radius: 6px; background: var(--soft); font-size: .85rem; }
.choice.right { background: var(--right); border-color: var(--primary); }
.choice.wrong { background: var(--wrong); border-color: #bc645e; }
.answer summary, summary { cursor: pointer; color: var(--primary); font-weight: 650; }
.answer p { margin: .45rem 0; }
.featured-feedback:empty { display: none; }
.credit, .feedback { margin-top: .65rem; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, .42fr); gap: 1rem; align-items: start; }
.quiz-layout > :only-child { grid-column: 1 / -1; width: min(100%, 820px); margin-inline: auto; }
.exam-status { display: flex; justify-content: space-between; align-items: center; gap: .85rem; }
.timer { background: var(--soft); border-radius: 9px; padding: .45rem .75rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.timer.urgent { background: var(--wrong); }
.exam-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.exam-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.selection { margin-left: auto; font-size: .8rem; white-space: nowrap; }
.assistant-answer { white-space: pre-wrap; padding-top: .7rem; }
.assistant [data-assistant-output] { margin-top: .65rem; }
.trend { padding-left: 1.5rem; }
.trend span { display: inline-block; width: 4rem; }
.trend meter { width: min(65%, 300px); }
@media (max-width: 760px) {
  .quiz-layout { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-links { columns: 2; }
}
@media (max-width: 380px) {
  .nav-actions > a:not(.icon), .nav-actions button { font-size: .76rem; }
  .brand { font-size: 1.05rem; }
  .brand-mark { inline-size: 1.75rem; block-size: 1.75rem; }
  .section-links { columns: 1; }
}

/* Reference layout and surface tokens */
:root {
  --text: oklch(0.25 0.04 165);
  --muted: oklch(0.51 0.025 165);
  --background: oklch(0.985 0.008 135);
  --surface: oklch(0.999 0.003 135);
  --edge: oklch(0.91 0.014 140);
  --primary: oklch(0.51 0.105 164);
  --primary-text: oklch(0.99 0.004 135);
  --soft: oklch(0.94 0.025 145);
  --band: oklch(0.965 0.012 130);
  --accent: oklch(0.59 0.095 155);
  --hero: oklch(0.24 0.055 165);
  --hero-text: oklch(0.98 0.008 135);
  --primary-hover: color-mix(in oklab, var(--primary) 85%, black);
  --hero-highlight: #8ce9b8;
  --button-text: var(--hero-action-text);
  --button-hover: color-mix(in oklab, var(--hero-highlight) 86%, white);
  --shadow-card: 0 1px 2px oklch(0.25 0.04 165 / .04), 0 8px 24px -8px oklch(0.25 0.04 165 / .08);
  --round: 1.125rem;
}
[data-theme=dark] {
  --text: oklch(0.95 0.012 135);
  --muted: oklch(0.72 0.025 150);
  --background: oklch(0.17 0.025 165);
  --surface: oklch(0.21 0.03 165);
  --edge: oklch(0.31 0.035 165);
  --primary: oklch(0.69 0.105 158);
  --primary-text: oklch(0.17 0.025 165);
  --soft: oklch(0.28 0.045 158);
  --band: oklch(0.22 0.03 165);
  --accent: oklch(0.7 0.1 158);
  --hero: oklch(0.11 0.03 168);
  --hero-text: oklch(0.96 0.01 135);
  --primary-hover: color-mix(in oklab, var(--primary) 84%, white);
}
h1, h2, h3, .brand, .tile strong, .stats dd, .exam-number { font-family: "Bricolage Grotesque", var(--urdu-font), ui-sans-serif, system-ui, sans-serif; }
.container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
.container.narrow { max-width: 50rem; }
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--background) 86%, transparent); backdrop-filter: blur(18px); }
.nav-inner { min-height: 4rem; }
.nav-inner nav { gap: .15rem; }
.nav-inner nav a { padding: .45rem .65rem; border-radius: .5rem; color: var(--muted); }
.nav-inner nav a:hover, .nav-inner nav a[aria-current=page] { background: var(--soft); color: var(--text); text-decoration: none; }
.nav-actions { margin-left: auto; }
.hero, .page-header { position: relative; overflow: hidden; isolation: isolate; background: var(--hero); color: var(--hero-text); }
.hero-word { position: absolute; top: 1.5rem; right: max(-2.5rem, calc((100% - 80rem) / 2 - 7.5rem)); z-index: 0; font: 500 14rem/1 "Noto Nastaliq Urdu", serif; color: #ffffff12; pointer-events: none; user-select: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: center; padding-block: 4rem; }
.hero-badge { display: inline-block; margin: 0; padding: .25rem .65rem; border: 1px solid #ffffff26; border-radius: 999px; background: #ffffff1a; font-size: .75rem; font-weight: 650; }
.hero h1 { max-width: none; margin: 1.25rem 0; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.05; font-weight: 800; }
.hero h1 span { color: var(--hero-highlight); }
.hero h1 + p, .page-header p, .home-cta p { max-width: 36rem; color: color-mix(in oklab, var(--hero-text) 75%, transparent); }
.hero-search { display: flex; align-items: center; gap: .75rem; max-width: 36rem; margin-top: 2rem; min-height: 3.5rem; padding: .35rem .4rem .35rem 1rem; color: var(--muted); background: var(--surface); border: 1px solid var(--edge); border-radius: .875rem; }
.hero-search button { min-height: 2.75rem; border-radius: .75rem; }
.hero-search input { background: transparent; border: 0; padding-inline: 0; }
.hero-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-search input:focus { outline: none; }
.hero .actions { margin-top: 1.5rem; }
.hero .button { min-height: 3.25rem; padding-inline: 1.25rem; }
.hero .button-outline { color: var(--hero-text); background: #ffffff0b; border-color: #ffffff55; box-shadow: none; }
.hero .button-outline:hover { background: #ffffff20; border-color: #ffffff9a; }
.hero .actions :focus-visible, .home-cta > .button:focus-visible { outline-color: #b4ecc7; }
.page-header .container { padding-block: 3rem; }
.page-header h1 { font-size: clamp(1.875rem, 4vw, 3rem); line-height: 1; }
.page-header .eyebrow { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .2em; }
.feature { position: relative; width: min(100%, 28rem); margin-inline: auto; }
.feature-card { padding: 1.5rem; color: var(--text); background: var(--surface); }
.feature-card h2 { font: 650 1.125rem/1.4 "Plus Jakarta Sans", var(--urdu-font), system-ui, sans-serif; margin: 1rem 0; letter-spacing: 0; }
.featured-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--muted); font-size: .75rem; font-weight: 600; }
.badge, .featured-meta .badge { padding: .22rem .58rem; border-radius: 999px; background: var(--soft); color: var(--primary); font-size: .75rem; font-weight: 650; }
.options { gap: .6rem; }
.mcq-urdu { display: block; margin-block: .25rem; font: 500 1rem/2.15 var(--urdu-font), serif; text-align: right; overflow-wrap: anywhere; }
.question-text:dir(rtl) { font-family: var(--urdu-font), serif; font-weight: 500; line-height: 2.15; letter-spacing: normal; text-align: start; }
.choice > .question-text:dir(rtl) { flex: 1; }
:is(h2, h3) + .mcq-urdu { width: 100%; margin-block: .65rem 1rem; font-size: clamp(1rem, 1.75vw, 1.2rem); }
.choice { align-items: center; gap: .75rem; min-height: 3.25rem; padding: .65rem .9rem; border-width: 2px; border-radius: .8rem; background: var(--surface); color: var(--text); box-shadow: none; font-size: .925rem; }
.choice b { min-width: 1.75rem; min-height: 1.75rem; }
.choice > span { padding-top: .14rem; }
button.choice:not(:disabled):hover, label.choice:has(input:checked) { border-color: var(--primary); background: var(--soft); }
.choice:disabled { opacity: 1; }
.choice.dimmed:disabled { opacity: .6; }
.featured-feedback { min-height: 2.5rem; margin-top: 1rem; color: var(--muted); font-size: .875rem; }
.home-section { padding-block: clamp(3.25rem, 7vw, 5rem); }
.home-heading { align-items: end; margin-bottom: 2rem; }
.home-heading .eyebrow { margin: 0 0 .5rem; color: var(--accent); letter-spacing: .2em; font-size: .75rem; }
.home-heading h2 { margin: 0; font-size: clamp(1.875rem, 4vw, 2.25rem); }
.home-heading .button { color: var(--text); }
.section-band { background: var(--band); }
.grid { gap: 1rem; }
.card, .tile { box-shadow: var(--shadow-card); }
a.tile { transition: var(--control-transition); }
a.tile:hover { box-shadow: 0 12px 28px -16px var(--primary); }
.popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.popular-grid .tile { gap: 1rem; padding: 1.25rem; }
.popular-grid strong, .group-card strong { font-size: 1.125rem; font-weight: 700; }
.category-icon, .tile .category-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border-radius: .75rem; background: var(--soft); color: var(--primary); font: 700 1.2rem system-ui, sans-serif; }
a.tile:hover .category-icon, a.tile:focus-visible .category-icon { background: var(--primary); color: var(--primary-text); }
.group-grid, .recent, .catalogue-grid { grid-template-columns: 1fr; }
.group-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 11rem; padding: 1.5rem; }
.group-card strong, .group-card > span > span, .catalogue-card strong, .catalogue-card strong + span { display: block; }
.group-card > span > span { margin-top: .25rem; }
.recent-card .card-link { color: var(--accent); font-weight: 700; margin-top: auto; }
.recent-card { display: flex; flex-direction: column; gap: .75rem; min-height: 8.75rem; padding: 1.25rem; }
.recent-card strong { font: 600 1rem/1.4 "Plus Jakarta Sans", system-ui, sans-serif; }
.stats { display: grid; margin: 0; grid-template-columns: 1fr; border: 1px solid var(--edge); border-radius: 1.5rem; background: var(--surface); }
.stats > div { display: block; padding: 2rem; text-align: left; }
.stats > div + div { border-left: 0; border-top: 1px solid var(--edge); }
.stats > div > span { color: var(--accent); font-size: 1.5rem; }
.stats dd { margin-top: .45rem; color: var(--text); font-size: 3rem; line-height: 1.15; font-weight: 800; }
.home-cta { display: grid; gap: 1.5rem; align-items: center; padding: 3.5rem 1.5rem; border-radius: 1.5rem; }
.home-cta h2 { font-size: clamp(1.875rem, 4vw, 2.25rem); }
.home-cta .button { justify-self: start; }
.catalogue-page { padding-block: 2.5rem; }
.syllabus { margin-bottom: 2rem; padding: 1.25rem; color: var(--muted); font-size: .875rem; }
.syllabus nav, .chips { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.chips { gap: .5rem; }
.chips a { padding: .35rem .75rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .8125rem; text-decoration: none; }
.chips a[aria-current=true] { background: var(--primary); color: var(--primary-text); }
.catalogue-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.catalogue-controls nav { flex: 1 1 30rem; }
.subject-search { flex: 1 1 15rem; }
.catalogue-grid { margin-top: 2rem; }
.catalogue-card { display: flex; align-items: center; gap: .85rem; padding: 1rem; }
.catalogue-card > span:nth-child(2) { flex: 1; }
.catalogue-card strong { font-size: 1rem; }
.catalogue-card strong + span { font-size: .75rem; }
.catalogue-card.empty-bank { opacity: .72; }
.site-footer { margin-top: 6rem; padding: 0; border: 0; background: var(--hero); color: var(--hero-text); }
.footer-inner { display: grid; align-items: start; gap: 2.5rem; padding-block: 3.5rem; }
.footer-inner p, .footer-inner a:not(.brand), .footer-inner .brand small { color: color-mix(in oklab, var(--hero-text) 72%, transparent); }
.footer-inner p { margin: 1rem 0 0; max-width: 20rem; }
.footer-inner .footer-urdu { font: 1.125rem/2 "Noto Nastaliq Urdu", serif; }
.footer-inner nav { display: grid; justify-items: start; gap: .6rem; }
.footer-inner nav h2 { font: 650 .875rem/1.5 "Plus Jakarta Sans", sans-serif; letter-spacing: 0; }
.footer-inner nav a { text-decoration: none; }
.footer-inner nav a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid #ffffff1a; font-size: .75rem; color: #ffffffa0; }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-block: 1.25rem; }
@media (min-width: 40rem) {
  .container { padding-inline: 1.5rem; }
  .group-grid, .catalogue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 48rem) {
  .hero-grid { padding-block: 6rem; }
  .hero-word { font-size: 20rem; }
  .page-header .container { padding-block: 4rem; }
  .popular-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats > div + div { border-top: 0; border-left: 1px solid var(--edge); }
  .home-cta { grid-template-columns: 1.5fr 1fr; padding-inline: 3.5rem; }
  .home-cta .button { justify-self: center; }
}
@media (min-width: 64rem) {
  .container { padding-inline: 2rem; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; }
  .group-grid, .catalogue-grid, .recent { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 80rem) { .group-grid, .catalogue-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1090px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-grid; margin-left: 0; }
  .nav-inner nav { display: none; flex-basis: 100%; flex-wrap: wrap; order: 4; padding: .45rem 0; }
  .nav-inner nav.open { display: flex; }
}
@media (max-width: 380px) {
  .nav-actions { gap: .125rem; }
  .nav-actions .button-small { padding-inline: .62rem; }
}
@media (max-width: 480px) {
  .hero .actions > .button { flex: 1 1 11rem; }
  .filters > button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button, a.tile { transition: none; }
  button:not(:disabled):active, .button:active { transform: none; }
}

.line-icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.category-icon .line-icon { width: 1.25rem; height: 1.25rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .35rem; }
.hero-badge .line-icon { width: .875rem; height: .875rem; }
.icon .line-icon { width: 1.15rem; height: 1.15rem; }
.dark-icon, [data-theme=dark] .light-icon { display: none; }
[data-theme=dark] .dark-icon { display: inline; }
.stats dd { margin-inline: 0; }
.subject-header { text-align: center; }
.subject-header h1 { margin-top: 1.25rem; font-weight: 800; }
.subject-header h1 span { color: var(--hero-highlight); }
.subject-header p { margin-inline: auto; }
.subject-bank { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block: 1.5rem; color: var(--muted); font-size: .875rem; }
.subject-bank .button { color: var(--primary); }
.subject-columns { display: grid; gap: 1.5rem; align-items: start; }
.subject-quiz { display: grid; gap: .75rem; }
.subject-quiz h2 { margin: 0; font-size: 1.25rem; }
.subject-quiz p { margin: 0; color: var(--muted); font-size: .875rem; }
.subject-contribute { margin-top: 2rem; text-align: center; font-size: .875rem; }
.header-search-panel { padding-block: 0 .85rem; }
.header-search-form { display: flex; align-items: center; gap: .65rem; margin-inline: auto; max-width: 36rem; padding: .35rem .4rem .35rem .85rem; background: var(--surface); color: var(--muted); border: 1px solid var(--edge); border-radius: .875rem; }
.header-search-form input { background: transparent; border: 0; padding-inline: 0; }
.header-search-form input:focus { outline: none; }
.header-search-form:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 64rem) { .subject-columns { grid-template-columns: minmax(0, 1fr) 18.75rem; } }
.account-layout { min-height: calc(100vh - 4.0625rem); display: grid; }
.account-hero { display: none; }
.account-main { display: grid; align-items: center; justify-items: center; padding: 3rem 1rem; }
.account-content { width: min(100%, 24rem); }
.account-content h1 { font-size: 1.5rem; line-height: 2rem; }
.account-content > p { font-size: .875rem; color: var(--muted); }
.account-content form { margin-top: 1.5rem; }
.account-content form button { width: 100%; min-height: 3rem; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; margin-bottom: 1.5rem; padding: .25rem; border-radius: .7rem; background: var(--band); }
.account-tabs a { text-align: center; padding: .4rem; border-radius: .5rem; color: var(--muted); font-size: .875rem; font-weight: 700; text-decoration: none; }
.account-tabs [aria-current=page] { background: var(--surface); color: var(--text); }
.account-content .account-policy { margin-top: 1.5rem; text-align: center; font-size: .75rem; }
.ask-page { max-width: 75rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.ask-heading, .study-chat-header { display: flex; align-items: center; gap: .85rem; }
.ask-heading { margin-bottom: 1.5rem; }
.ask-heading h1 { margin: 0; font-size: clamp(1.875rem, 4vw, 2.25rem); line-height: 1.111; font-weight: 800; }
.ask-heading p, .study-chat-header p, .study-chat-empty p { margin: .2rem 0 0; color: var(--muted); font-size: .875rem; }
.study-chat { padding: 0; overflow: hidden; }
.study-chat-header, .study-chat-form { padding: 1rem 1.25rem; }
.study-chat-header { border-bottom: 1px solid var(--edge); }
.study-chat-header h2 { margin: 0; font-size: 1.1rem; }
.study-chat-body { min-height: 20rem; max-height: min(62vh, 720px); overflow-y: auto; padding: 1.25rem; }
.study-chat-empty { min-height: 17.5rem; display: grid; align-content: center; justify-items: center; text-align: center; gap: .5rem; }
.study-chat-empty h3 { margin: .4rem 0 0; font-size: 1.25rem; }
.study-chat-form { border-top: 1px solid var(--edge); }
@media (min-width: 64rem) {
  .account-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-hero { display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; }
  .account-hero h2 { font-size: 2.5rem; }
  .account-hero .brand small { color: #ffffffa0; }
  .account-hero ul { list-style: none; padding: 0; display: grid; gap: .75rem; }
  .account-hero li .line-icon { margin-right: .35rem; color: var(--accent); }
  .account-hero > p { font: 1.5rem/2 var(--urdu-font), serif; color: #ffffff66; }
}


/* Homepage palette sampled from the Ilmivora reference. */
.home-page {
  --home-mint: #5daf82;
  --home-ivory: #eff3ed;
}
[data-theme=dark] .home-page {
  --background: #05130d;
  --surface: #091d15;
  --band: #0b1f17;
  --soft: #143123;
  --edge: #1f362c;
  --text: #eff3ed;
  --muted: #a3b4a9;
  --primary: var(--home-mint);
  --accent: var(--home-mint);
  --hero: #000703;
  --hero-text: var(--home-ivory);
}
.home-page :is(.hero-search, .header-search-form) button { box-shadow: none; }
.home-page .hero h1 { margin-block: 1.5rem; }
.home-page .hero-search { min-height: 3.75rem; border-radius: 1.25rem; }
.home-page .hero-search button { min-height: 3rem; border-radius: 1.1rem; padding-inline: 1.45rem; }
.home-page .hero .actions .button { min-height: 3rem; border-radius: 1.1rem; padding-inline: 1.45rem; box-shadow: none; }
.home-page .feature-card { background: var(--surface); }
.home-page .feature-card[data-featured-answer] { box-shadow: 0 18px 42px -18px #0008; }
.feature-motion { display: none; }
@media (min-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .home-page .feature[data-motion] .feature-card[data-featured-answer]:not([hidden]) {
    animation: featured-float 7s ease-in-out infinite;
    animation-play-state: var(--feature-motion-state, running);
  }
  .feature[data-motion]:is(:hover, :focus-within, [data-motion=paused]) { --feature-motion-state: paused; }
  .feature[data-motion] .feature-motion { display: inline-flex; position: absolute; inset-inline-end: 0; top: calc(100% + .75rem); min-height: 2rem; padding: .3rem .65rem; font-size: .75rem; color: var(--hero-text); }
}
@keyframes featured-float {
  from, to { transform: rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(-1deg); }
}
.home-page .feature-card .choice { min-height: 3.7rem; border-radius: 1.1rem; font-size: 1rem; padding-inline: 1rem; }
.home-page .feature-card .choice b { border-radius: 50%; }
.home-page .feature-card .choice:not(.right, .wrong) b { color: var(--muted); background: color-mix(in oklab, var(--edge) 42%, var(--surface)); }
.home-page .feature-card .choice > span { padding-top: 0; }
.home-page .feature-card h2 { font-weight: 700; }
.home-page .popular-grid .tile { min-height: 8rem; }
.home-page .group-card { gap: .75rem; }
.home-page .group-card strong { line-height: 1.25; }
.home-page .category-icon { border-radius: 1.15rem; }
.home-page .stats .line-icon { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.home-page .stats dd { margin-top: .7rem; }
.home-page .foundation { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.home-page .foundation .eyebrow { color: var(--accent); }
.home-page .foundation h2 { font-size: clamp(1.6rem, 3vw, 1.875rem); }
.home-page .foundation p:last-child { max-width: 42rem; margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.home-page .home-cta { border-radius: 1.6rem; }
.home-page .home-cta .actions { margin: 0; }
.home-page .home-cta p { margin-bottom: 0; }
@media (min-width: 64rem) {
  .home-page .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .home-page .home-cta { grid-template-columns: minmax(0, 1fr) auto; }
}

.site-header {
  --header-muted: var(--muted);
  --header-active: var(--soft);
}
[data-theme=dark] .site-header {
  --header-muted: #a3b4a9;
  --header-active: #153225;
  color: #eff3ed;
  background: #05130d;
  border-color: #172b22;
}
.site-header .nav-inner { min-height: 4rem; }
.site-header .brand { gap: .625rem; font-size: 1.25rem; }
.site-header .brand-mark { inline-size: 2.5rem; block-size: 2.5rem; }
.site-header .brand small { margin-top: .25rem; color: var(--header-muted); font: 600 .625rem/1 "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif; }
.site-header .nav-inner nav, .site-header .nav-actions { gap: .25rem; }
.site-header .nav-inner nav a {
  padding: .5rem .75rem;
  border-radius: .875rem;
  color: var(--header-muted);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25rem;
}
.site-header .nav-inner nav a:is(:hover, [aria-current=page]) { background: var(--header-active); color: inherit; }
.site-header .nav-actions .plain { color: inherit; }
.site-header .nav-actions .icon { inline-size: 2.5rem; block-size: 2.5rem; min-height: 2.5rem; line-height: 1; }
.site-header .nav-actions .icon .line-icon { display: block; width: 1rem; height: 1rem; }
.site-header .nav-actions :is(#theme, #header-search-toggle) { border: 1px solid transparent; border-radius: .875rem; }
.site-header .nav-actions :is(#theme, #header-search-toggle):hover { background: var(--header-active); border-color: var(--edge); }
.profile-menu { position: relative; }
.profile-avatar { display: grid; place-items: center; inline-size: var(--action-height); block-size: var(--action-height); border-radius: 50%; background: #edf2eb; color: #092017; font-weight: 750; }
.profile-menu summary { inline-size: 2.5rem; block-size: 2.5rem; font-size: .875rem; list-style: none; cursor: pointer; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover, .profile-menu[open] summary { background: #cbdcd1; }
.profile-panel { position: absolute; z-index: 2; inset-inline-end: 0; top: calc(100% + .35rem); width: min(20rem, calc(100vw - 4rem)); max-height: calc(100dvh - 5rem); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--edge); border-radius: 1rem; box-shadow: var(--action-shadow); }
.profile-identity { display: flex; align-items: center; gap: .75rem; padding: 1.15rem; border-bottom: 1px solid var(--edge); }
.profile-identity .profile-avatar { flex: 0 0 auto; inline-size: 3.25rem; block-size: 3.25rem; }
.profile-identity div { min-width: 0; }
.profile-identity strong, .profile-identity div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity div span { color: var(--muted); font-size: .875rem; }
.profile-links { display: grid; padding: .45rem; }
.profile-links a, .site-header .profile-panel button { color: inherit; text-align: start; justify-content: flex-start; padding: .65rem .7rem; border-radius: .65rem; text-decoration: none; }
.profile-links a:hover, .site-header .profile-panel button:hover { background: var(--header-active); }
.profile-panel form { padding: .45rem; border-top: 1px solid var(--edge); }
.profile-panel button { width: 100%; }
.site-header .nav-actions form { display: flex; }
.site-header .nav-actions .button {
  margin-inline-start: .25rem;
  padding: .4rem .85rem;
  min-width: 4.25rem;
  min-height: 2.5rem;
  border-radius: .875rem;
  font-size: .875rem;
  font-weight: 650;
  box-shadow: none;
}
@media (min-width: 1091px) {
  .site-header .nav-actions { margin-left: 0; }
}
@media (max-width: 380px) {
  .site-header .nav-actions .button { padding-inline: .65rem; }
}
@media (max-width: 520px) {
  .site-header .nav-inner { column-gap: .25rem; }
  .site-header .nav-actions { gap: .1rem; }
}
@media (max-width: 350px) {
  .site-header .nav-inner { padding-inline: .55rem; }
  .site-header .brand { gap: .35rem; font-size: 1.05rem; }
  .site-header .brand-mark { inline-size: 2rem; block-size: 2rem; }
  .site-header .brand small { font-size: .55rem; }
  .site-header .nav-actions .button { min-width: 0; padding-inline: .45rem; }
}
@media (max-width: 380px) {
  .home-page .hero-search { gap: .4rem; padding-inline-start: .65rem; }
  .home-page .hero-search button { padding-inline: .85rem; }
}


/* Reference layouts for the catalogue, quiz, careers and reading pages. */
.reading-page { max-width: 50rem; padding-block: 3rem; }
.reading-page > p, .guide-step p { color: var(--muted); line-height: 1.75; }
.reading-page > h2 { margin-top: 2rem; font-size: 1.3rem; }
.guide-step { scroll-margin-top: 6rem; }
[data-study-items] > article, #subject-questions { scroll-margin-top: 6rem; }
.guide-step h2 { font-size: 1.3rem; }
.guide-step p { margin-bottom: 0; }
.past-header .container { padding-block: clamp(3.5rem, 7vw, 5rem); }
.past-header h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
.paper-filters > label:first-of-type { flex: 2 1 16rem; }
.paper-grid { margin-block-start: .75rem; }
.paper-card { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; }
.paper-card h3 { margin: 0; }
.paper-card h3 a { color: var(--text); }
.paper-card .actions { margin-top: auto; padding-block-start: .5rem; }
.paper-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; width: 100%; margin: 0; }
.paper-metadata dt { color: var(--muted); font-size: .8rem; }
.paper-metadata dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.paper-detail .paper-metadata { max-width: 40rem; }
.paper-detail .paper-metadata + p { margin: .75rem 0 0; }
.quiz-mode-card { display: block; padding: 1rem; border: 1px solid var(--edge); border-radius: .9rem; }
a.quiz-mode-card { background: color-mix(in oklab, var(--soft) 64%, var(--surface)); color: var(--primary); text-decoration: none; }
a.quiz-mode-card:hover { border-color: var(--primary); background: var(--soft); }
.quiz-mode-card h3 { margin: .65rem 0 .35rem; color: var(--text); }
.quiz-mode-card strong { display: block; margin-top: .75rem; font-size: .875rem; }
.exam-categories { display: grid; gap: .35rem; }
.exam-categories a { display: flex; justify-content: space-between; padding: .55rem .65rem; border-radius: .6rem; text-decoration: none; }
.exam-categories [aria-current=page], .exam-categories a:hover { background: var(--soft); }
.paper-practice { background: var(--soft); }
.quiz-setup, .jobs-page { padding-block: 1.5rem; }
.setup-fields, .submission-form { display: grid; gap: 1rem; margin-bottom: 1rem; }
.setup-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.setup-field legend, .setup-field > label { display: block; margin-bottom: .35rem; font-weight: 700; }
.setup-field small { display: block; margin-top: .45rem; color: var(--muted); }
.setup-picker { background: var(--surface); border: 1px solid var(--edge); border-radius: .75rem; }
.setup-picker summary { padding: .65rem .8rem; color: var(--text); }
.setup-picker input[type=search] { width: calc(100% - 1.2rem); margin: 0 .6rem .3rem; }
.setup-options { max-height: 14rem; overflow: auto; padding: .5rem; border-top: 1px solid var(--edge); }
.setup-options label { display: block; padding: .35rem; font-size: .875rem; cursor: pointer; }
.setup-options label[hidden] { display: none; }
.setup-options label:hover { background: var(--soft); }
.submission-field { display: grid; gap: .3rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.job-sectors, .job-grid, .dashboard-stats, .dashboard-charts { display: grid; gap: 1rem; }
.jobs-page { gap: 2rem; }
.job-sector { display: flex; align-items: center; gap: .75rem; }
.job-sector > span:nth-child(2) { flex: 1; }
.job-sector strong, .job-sector > span:nth-child(2) > span { display: block; }
.job-sector[aria-current=page] { background: var(--soft); border-color: var(--primary); }
.job-filter { margin: 0; max-width: 36rem; }
.job-empty { grid-column: 1 / -1; padding: 2rem; text-align: center; }
.job-empty .line-icon { width: 2rem; height: 2rem; margin-bottom: .7rem; color: var(--primary); }
.jobs-notice { display: flex; gap: 1rem; background: var(--soft); }
.jobs-notice h2 { font-size: 1.2rem; }
.jobs-notice p { margin-bottom: 0; }
.dashboard-page { gap: 1.5rem; }
.dashboard-page h1 { font-size: clamp(2rem, 5vw, 2.5rem); }
.dashboard-page .eyebrow, .jobs-page .eyebrow { color: var(--accent); }
.dashboard-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.dashboard-stats article { display: grid; gap: .35rem; }
.dashboard-stats strong { font-size: 1.75rem; }
.dashboard-stats article > span:last-child { color: var(--muted); }
.dashboard-empty { padding: 2rem; text-align: center; }
.dashboard-note { background: var(--soft); }
.results-search { margin-top: 1.25rem; }
.search-columns { display: grid; gap: 1.5rem; align-items: start; }
.search-filters h2 { font: 700 .75rem/1.35 "Plus Jakarta Sans", sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.matching-subjects { margin-bottom: 1.5rem; }
.mcq .metadata { align-items: center; }
.mcq .metadata .badge { text-decoration: none; }
.mcq h3 a { color: inherit; text-decoration: none; }
.mcq h3 a:hover { text-decoration: underline; }
.mcq .choice { border-width: 1px; border-radius: .6rem; }
.mcq:has(.answer[open]) .correct-option { background: var(--right); border-color: var(--primary); }
.mcq .answer:not([open]) .hide-answer, .mcq .answer[open] .show-answer { display: none; }
.mcq .answer[open] p { padding: .65rem .8rem; border-radius: .6rem; background: var(--soft); }
@media (min-width: 40rem) {
  .setup-fields, .submission-form, .job-sectors, .job-grid, .dashboard-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcq .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .search-columns { grid-template-columns: 15rem minmax(0, 1fr); }
  .setup-fields { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr); }
}
