/* Home hub v3: compact 3-row layout. Content from data/home-sections.json (tools/build_home.py).
   Tagline (H1) is the single "tagline" string in that JSON. */

/* Slim header on the home page: no quick bar, no extra “होम” chip, tagline lives in the hero */
body.homepage .site-header { padding: .7rem 0; }
body.homepage .logo span.sub { display: none; }
body.homepage .nav-home { display: none; }
body.homepage .topnav.qbar { display: none; }
@media (max-width: 560px) {
  body.homepage .site-header .wrap:first-child { flex-wrap: nowrap; row-gap: 0; align-items: center; }
  body.homepage .htools { order: 0; width: auto; margin-left: auto; justify-content: flex-end; }
  body.homepage .htools .themebtn { margin-left: .35rem; }
}

/* Compact brand line at the TOP */
.home-hero-compact { padding: .85rem 1rem; border-radius: 20px; margin: .85rem 0 .15rem; }
.home-hero-compact .hero-brand { display: flex; align-items: center; gap: .6rem; }
.home-hero-compact .mascots { margin: 0; flex-shrink: 0; }
.home-hero-compact .mascots img { width: 44px; height: 44px; }
.home-hero-compact .hero-copy { min-width: 0; flex: 1 1 auto; }
.home-hero-compact h1 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 .25rem; color: #fff; font-weight: 800; }
.home-hero-compact p { margin: 0; font-size: .875rem; line-height: 1.35; color: #fff; }
.home-hero-compact .seo-hero { color: #fff; opacity: 1; }
@media (min-width: 760px) {
  .home-hero-compact { padding: 1rem 1.25rem; }
  .home-hero-compact h1 { font-size: 1.45rem; }
  .home-hero.home-hero-compact { padding-right: 1.25rem; }
  .home-hero-compact .mascots { position: static; flex-direction: row; }
  .home-hero-compact .mascots img + img { margin-top: 0; margin-left: -14px; }
}

/* site.js used to inject .countlive after the H1; keep it out of the compact hero
   even if an older cached site.js still runs. Footer .fcount stays visible. */
.home-hero .countlive { display: none !important; }

/* Hero row 1: tagline + Mg-ribbon burning animation (keyframes live in style.css, transform/opacity only,
   paused for prefers-reduced-motion). The box is in normal flow with a fixed size, so no layout shift. */
.home-hero-compact .rxn { position: relative; right: auto; top: auto; flex: 0 0 84px; width: 84px; height: 78px; align-self: center; }
.home-hero-compact .rx-eq { right: -2px; bottom: -2px; font-size: .6875rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
/* Hero row 2: mascots + Competition chip */
.home-hero-compact .hero-row2 { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; }
.home-hero-compact .hero-row2 .mascots img { width: 36px; height: 36px; border-width: 2px; }
.home-hero-compact .hero-row2 .mascots img + img { margin-left: -12px; margin-top: 0; }
.hero-comp { flex: 1 1 auto; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem;
  border-radius: 14px; background: #fff; color: #1e1b4b; text-decoration: none; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.hero-comp:hover, .hero-comp:focus-visible { background: #fef3c7; }
.hero-comp:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }
.hero-comp .hc-i { font-size: 1.25rem; line-height: 1; }
.hero-comp .hc-t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hero-comp b { font-size: .9375rem; line-height: 1.25; color: #1e1b4b; }
.hero-comp small { font-size: .75rem; line-height: 1.3; color: #3f3a6b; }
.hero-comp .hc-go { font-weight: 800; color: #4338ca; font-size: 1.1rem; }
html[data-theme="dark"] .hero-comp { background: #1e1b4b; color: #f8fafc; box-shadow: 0 0 0 1px #a5b4fc; }
html[data-theme="dark"] .hero-comp b { color: #f8fafc; }
html[data-theme="dark"] .hero-comp small { color: #e0e7ff; }
html[data-theme="dark"] .hero-comp .hc-go { color: #fde68a; }
html[data-theme="dark"] .hero-comp:hover, html[data-theme="dark"] .hero-comp:focus-visible { background: #312e81; }
@media (min-width: 760px) {
  .home-hero-compact .rxn { flex-basis: 96px; width: 96px; height: 82px; }
  .home-hero-compact .hero-row2 .mascots img { width: 44px; height: 44px; }
  .hero-comp { flex: 0 1 auto; }
}

/* Shared section rhythm — tight, even gaps */
.hsec { margin: .85rem 0 1rem; }
.hsec h2 { font-size: 1.2rem; margin: 0 0 .2rem; display: flex; align-items: center; gap: .4rem; color: var(--ink); }
.hsec-lead { margin: 0 0 .55rem; color: var(--muted); font-size: var(--fs-xs); }
.bigcards { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.bigcard { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 88px; padding: .85rem .9rem; border-radius: 18px;
  background: var(--card); color: var(--ink); text-decoration: none; border: 2px solid var(--border, #e5e7eb); box-shadow: var(--shadow-sm); box-sizing: border-box; height: 100%; }
.bigcard .bc-i { flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 1.8rem; background: #eef2ff; }
.bigcard .bc-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.bigcard b { font-size: 1.15rem; line-height: 1.25; color: var(--ink); }
.bigcard small { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.bigcard .bc-go { font-size: 1.35rem; font-weight: 800; color: var(--brand-1); }
a.bigcard:hover { border-color: var(--brand-1); }
a.bigcard:focus-visible, .follow-btn:focus-visible, .more-extras a:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
a.bigcard:active { transform: scale(.98); }
.bigcard.tone-a { border-left: 8px solid #4338ca; } .bigcard.tone-a .bc-i { background: #e0e7ff; }
.bigcard.tone-b { border-left: 8px solid #0f766e; } .bigcard.tone-b .bc-i { background: #ccfbf1; }
.bigcard.tone-c { border-left: 8px solid #b45309; } .bigcard.tone-c .bc-i { background: #fef3c7; }
.bigcard.tone-d { border-left: 8px solid #be185d; } .bigcard.tone-d .bc-i { background: #fce7f3; }
.bigcard.tone-e { border-left: 8px solid #6d28d9; } .bigcard.tone-e .bc-i { background: #ede9fe; }
.bigcard.off { border-style: dashed; box-shadow: none; }
.bigcard.part { border-left-style: dashed; }
.bigcard.off .bc-i { background: #f1f5f9; }
.bigcard .bc-soon { font-size: var(--fs-xs); font-weight: 700; color: #7c2d12; background: #ffedd5; border-radius: 999px; padding: .1rem .55rem; align-self: flex-start; margin-top: .1rem; }

/* Row 1 — class cards: see «Row 1 v2» block at the end of this file */

/* Row 2 — four same-size study-tool tiles (2×2 on a phone, 4 across on desktop) */
.toolrow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.toolrow.clsgrid { gap: .65rem; }  /* same grid as the class picker */
.toolrow .bigcard { flex-direction: column; align-items: center; text-align: center; justify-content: flex-start;
  min-height: 140px; padding: .75rem .5rem; gap: .3rem; border-left-width: 2px; border-top-width: 6px; }
.toolrow .bigcard.tone-a { border-top-color: #4338ca; }
.toolrow .bigcard.tone-b { border-top-color: #0f766e; }
.toolrow .bigcard.tone-c { border-top-color: #b45309; }
.toolrow .bigcard.tone-d { border-top-color: #be185d; }
.toolrow .bigcard.tone-e { border-top-color: #6d28d9; }
.toolrow .bc-i { width: 52px; height: 52px; font-size: 1.7rem; }
.toolrow .bc-t { align-items: center; width: 100%; }
.toolrow .bigcard b { font-size: 1rem; }
.toolrow .bc-go { display: none; }
@media (min-width: 720px) {
  .toolrow:not(.clsgrid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Row 3 — one coming-soon slot + follow links in one tidy row */
.morerow { grid-template-columns: 1fr; }
.followrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .7rem; }
.follow-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: 64px; padding: .45rem .3rem; border-radius: 14px; color: #fff; font-weight: 800; font-size: .875rem;
  line-height: 1.2; text-align: center; text-decoration: none; }
.follow-btn .fi { font-size: 1.15rem; line-height: 1; font-weight: 800; }
.follow-yt { background: #9f0000; }
.follow-yt:hover { background: #860000; }
.follow-wa { background: #166534; }
.follow-wa:hover { background: #14532d; }
.follow-fb { background: #0a4aad; }
.follow-fb:hover { background: #083d91; }
.more-extras { margin: .7rem 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.more-extras a { color: var(--brand-1); text-decoration: none; }
.more-extras a:hover { text-decoration: underline; }
html[data-theme="dark"] .more-extras a { color: #a5b4fc; }

/* Class / tests hash pickers sit in the slot under their row, hidden until chosen */
.hpick { margin: .4rem 0 1rem; }
.hpick h2 { font-size: 1.1rem; }
.home-flow-slot { margin: 0; }
.home-flow-slot:has(.flow-panel.is-on) { margin: .25rem 0 .9rem; }
.home-flow-slot .flow-panel.is-on { margin-top: .15rem; }

html[data-theme="dark"] .topnav.qbar a { background: rgba(0, 0, 0, .35); }
html[data-theme="dark"] .bigcard { border-color: #2b3152; }
html[data-theme="dark"] .bigcard .bc-go { color: #a5b4fc; }
html[data-theme="dark"] .bigcard .bc-i, html[data-theme="dark"] .bigcard.off .bc-i { background: #23284a; }
html[data-theme="dark"] .bigcard.tone-a { border-left-color: #818cf8; border-top-color: #818cf8; }
html[data-theme="dark"] .bigcard.tone-b { border-left-color: #2dd4bf; border-top-color: #2dd4bf; }
html[data-theme="dark"] .bigcard.tone-c { border-left-color: #fbbf24; border-top-color: #fbbf24; }
html[data-theme="dark"] .bigcard.tone-d { border-left-color: #f472b6; border-top-color: #f472b6; }
html[data-theme="dark"] .bigcard.tone-e { border-left-color: #a78bfa; border-top-color: #a78bfa; }
html[data-theme="dark"] .bigcard .bc-soon { color: #fde68a; background: #3a2e0b; }

.hsec, .flow-panel { scroll-margin-top: 12px; }

@media (max-width: 360px) {
  .toolrow .bigcard b { font-size: .9375rem; }
  .home-hero-compact h1 { font-size: .98rem; }
}

/* Home already has follow links in row 3; hide the JS-injected duplicate banner and the empty breadcrumb */
body.homepage .swm-follow { display: none; }
body.homepage > .breadcrumb, body.homepage .wrap > .breadcrumb { display: none; }

/* ===== Competition block (home row 3) + landing page ===== */
body.comppage .swm-follow { display: none; }
.hsec-competition { margin-top: 1rem; }
.comp-tagline { margin: .15rem 0 .35rem; font-size: 1rem; font-weight: 800; line-height: 1.35; color: var(--ink); }
.comp-lead { margin: 0 0 .65rem; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; }
.comprow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
/* Site wrap is 720px, so 5-col cards were only ~136px and uneven. Stay 2-col (5 even rows). */
.compcard { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-height: 154px; height: 100%;
  padding: .7rem .7rem .65rem; border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none;
  border: 2px solid var(--border, #e5e7eb); box-shadow: var(--shadow-sm); box-sizing: border-box; }
a.compcard:hover { border-color: var(--brand-1); }
a.compcard:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
.comp-code { flex: 0 0 auto; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .35rem;
  border-radius: 12px; font-weight: 800; font-size: .75rem; letter-spacing: .02em; line-height: 1; color: #fff; background: #4338ca; }
.compcard.tone-a .comp-code { background: #4338ca; }
.compcard.tone-b .comp-code { background: #0f766e; }
.compcard.tone-c .comp-code { background: #9a3412; }
.compcard.tone-d .comp-code { background: #9d174d; }
.compcard.tone-e .comp-code { background: #5b21b6; }
.compcard b { font-size: 1rem; line-height: 1.25; color: var(--ink); }
.comp-exams { font-size: var(--fs-xs); font-weight: 700; color: var(--ink); line-height: 1.3; }
.comp-note { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.compcard .bc-soon { margin-top: auto; }
.comp-see { display: inline-flex; align-items: center; gap: .25rem; margin: .7rem 0 0; font-weight: 800; font-size: .95rem;
  color: var(--brand-1); text-decoration: none; }
.comp-see:hover { text-decoration: underline; }
html[data-theme="dark"] .comp-see { color: #a5b4fc; }
html[data-theme="dark"] .compcard { border-color: #2b3152; }
html[data-theme="dark"] .compcard.tone-a .comp-code { background: #3730a3; }
html[data-theme="dark"] .compcard.tone-b .comp-code { background: #115e59; }
html[data-theme="dark"] .compcard.tone-c .comp-code { background: #7c2d12; }
html[data-theme="dark"] .compcard.tone-d .comp-code { background: #831843; }
html[data-theme="dark"] .compcard.tone-e .comp-code { background: #4c1d95; }

/* Landing */
.comp-hero { margin: .9rem 0 1rem; }
.comp-hero h1 { font-size: 1.25rem; line-height: 1.35; margin: 0 0 .4rem; color: var(--ink); }
@media (min-width: 760px) { .comp-hero h1 { font-size: 1.6rem; } }
.comp-group { margin: 1.15rem 0 1.25rem; scroll-margin-top: 88px; }
.comp-group h2 { font-size: 1.2rem; margin: 0 0 .25rem; color: var(--ink); }
.comp-group .hsec-lead { margin-bottom: .6rem; }
.examrow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: .65rem; }
@media (min-width: 640px) { .examrow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.examcard { display: flex; flex-direction: column; gap: .35rem; min-height: 100%; padding: .9rem 1rem; border-radius: 18px;
  background: var(--card); color: var(--ink); border: 2px solid var(--border, #e5e7eb); box-shadow: var(--shadow-sm); box-sizing: border-box; }
.examcard { scroll-margin-top: 88px; }
html[data-theme="dark"] .examcard { border-color: #2b3152; }
.examcard-h { display: flex; align-items: center; gap: .6rem; }
.examcard h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; color: var(--ink); }
.exam-help { margin: 0; font-size: .9375rem; line-height: 1.45; color: var(--ink); }
.exam-start { display: flex; flex-wrap: wrap; gap: .4rem; margin: .15rem 0 0; }
.exam-start a { display: inline-flex; align-items: center; min-height: 36px; padding: .25rem .7rem; border-radius: 999px;
  border: 1.5px solid var(--border, #e5e7eb); background: var(--card); color: var(--brand-1); font-weight: 700; font-size: var(--fs-xs);
  text-decoration: none; }
.exam-start a:hover { border-color: var(--brand-1); }
.exam-start a:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
html[data-theme="dark"] .exam-start a { color: #a5b4fc; border-color: #2b3152; }
.comp-crumb { margin: .7rem 0 .2rem; font-size: var(--fs-xs); }
.comp-crumb a { color: var(--brand-1); font-weight: 700; text-decoration: none; }
html[data-theme="dark"] .comp-crumb a { color: #a5b4fc; }

/* Soon pill on competition cards (base rule is scoped to .bigcard only) */
.compcard .bc-soon,
.examcard .bc-soon {
  font-size: var(--fs-xs); font-weight: 700; color: #7c2d12; background: #ffedd5;
  border-radius: 999px; padding: .1rem .55rem; align-self: flex-start; margin-top: auto;
}
html[data-theme="dark"] .compcard .bc-soon,
html[data-theme="dark"] .examcard .bc-soon { color: #fde68a; background: #3a2e0b; }

/* Keep competition-page header on one row, like the organised home */
body.comppage .site-header { padding: .7rem 0; }
body.comppage .nav-home { display: none; }
@media (max-width: 560px) {
  body.comppage .site-header .wrap:first-child { flex-wrap: nowrap; row-gap: 0; align-items: center; }
  body.comppage .htools { order: 0; width: auto; margin-left: auto; justify-content: flex-end; }
  body.comppage .htools .themebtn { margin-left: .35rem; }
}

/* Official syllabus subject chips */
.subchips { list-style: none; margin: .15rem 0 .1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.subchip { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .3rem; max-width: 100%;
  border-radius: 999px; padding: .12rem .5rem; font-size: .75rem; line-height: 1.3; font-weight: 700; }
.subchip-n { font-weight: 800; }
.subchip-st { font-weight: 700; }
.subchip-avail { color: #14532d; background: #dcfce7; }
.subchip-soon { color: #7c2d12; background: #ffedd5; }
html[data-theme="dark"] .subchip-avail { color: #bbf7d0; background: #14532d; }
html[data-theme="dark"] .subchip-soon { color: #fde68a; background: #3a2e0b; }
.subchips-compact .subchip { padding: .08rem .45rem; font-size: .7rem; line-height: 1.25; }
.chip-legend { margin: 0 0 .55rem; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; }
.exam-src { margin: .1rem 0 0; font-size: var(--fs-xs); line-height: 1.35; }
.exam-src a { color: var(--brand-1); font-weight: 700; text-decoration: none; }
.exam-src a:hover { text-decoration: underline; }
.exam-src a:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
html[data-theme="dark"] .exam-src a { color: #a5b4fc; }
.exam-track { margin: .25rem 0 .15rem; padding: .35rem 0 0; border-top: 1px dashed var(--border, #e5e7eb); }
.exam-track:first-of-type { border-top: 0; padding-top: 0; }
.exam-track h4 { margin: 0 0 .3rem; font-size: .88rem; line-height: 1.3; color: var(--ink); }
html[data-theme="dark"] .exam-track { border-color: #2b3152; }
@media (min-width: 640px) {
  .examrow:has(> :only-child) { grid-template-columns: 1fr; }
}

@media (min-width: 720px) {
  .compcard { min-height: 154px; }
}
@media (min-width: 640px) {
  .examrow > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Subject-wise competition cards: 2-col at every width (5 even rows inside the 720px wrap) */
.subjrow .subjcard { min-height: 220px; height: 100%; padding: .6rem .6rem .55rem; gap: .25rem; }
.subjrow .subjcard .comp-exams { min-height: 3.9em; }
.subj-status { min-height: 3.6em; align-items: flex-end; }
.subjcard-main { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; width: 100%;
  color: inherit; text-decoration: none; flex: 1 1 auto; }
.subjcard-main:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
.subjcard b { font-size: .95rem; line-height: 1.25; color: var(--ink); }
.subj-status { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.subj-status a.subchip, .subj-status span.subchip { text-decoration: none; }
.subj-status a.subchip:hover { filter: brightness(0.97); }
.subj-status a.subchip:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
.examnav { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0 .15rem; }
.examnav-chip { display: inline-flex; align-items: center; min-height: 36px; padding: .2rem .7rem;
  border-radius: 999px; border: 1.5px solid var(--border, #e5e7eb); background: var(--card);
  color: var(--brand-1); font-weight: 800; font-size: var(--fs-xs); text-decoration: none; }
.examnav-chip:hover { border-color: var(--brand-1); }
.examnav-chip:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }
html[data-theme="dark"] .examnav-chip { color: #a5b4fc; border-color: #2b3152; }

/* Landing subject sections */
.subj-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; margin: 0 0 1.4rem; }
@media (min-width: 800px) {
  .subj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.subj-sec { scroll-margin-top: 88px; }
.subj-sec h2 { margin: 0; font-size: 1.1rem; line-height: 1.3; color: var(--ink); }
.subj-sec .examcard-h { flex-wrap: wrap; }
.subj-sec .in-exams { font-weight: 800; }
.topic-h { margin: .35rem 0 .2rem; font-size: .95rem; color: var(--ink); }
.topic-list { margin: 0 0 .35rem; padding: 0 0 0 1.1rem; color: var(--ink); font-size: .9375rem; line-height: 1.45; }
.topic-list li { margin: 0 0 .15rem; }
.exam-view { margin: 1.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border, #e5e7eb); }
.exam-view > h2 { font-size: 1.25rem; margin: 0 0 .35rem; color: var(--ink); }
html[data-theme="dark"] .exam-view { border-color: #2b3152; }
.examcard .subchip a { color: inherit; text-decoration: none; }
.examcard .subchip a:hover { text-decoration: underline; }
.examcard .subchip a:focus-visible { outline: 3px solid var(--brand-1); outline-offset: 2px; }

/* old 3-col min-heights no longer apply to the 10-card subject grid */
@media (min-width: 720px) {
  .compcard { min-height: 154px; }
}

/* ===== Row 1 v2 — class cards (data/home-sections.json → tools/build_home.py class_card) =====
   Classes with content = big even cards (number badge, subjects + chapter counts, CTA).
   Classes without notes yet = compact secondary cards (free books now, notes soon).
   Every card is one tap target; #hash cards open the subject picker in #home-flow-slot. */
.clsgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.clsgrid > li { min-width: 0; display: flex; }
.clscard { --tone: #4338ca; --tone-2: #6d28d9; --tone-ink: #3730a3; --tone-soft: #eef2ff;
  position: relative; display: flex; flex-direction: column; gap: .6rem; width: 100%; box-sizing: border-box;
  padding: .85rem .8rem .8rem; border-radius: 20px; background: var(--card); color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--border, #e5e7eb); box-shadow: 0 1px 2px rgba(26,26,46,.05), 0 6px 18px rgba(26,26,46,.06);
  transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease; -webkit-tap-highlight-color: transparent; }
.clscard.tone-b { --tone: #0f766e; --tone-2: #115e59; --tone-ink: #115e59; --tone-soft: #e6f7f4; }
.clscard.tone-c { --tone: #9a3412; --tone-2: #7c2d12; --tone-ink: #7c2d12; --tone-soft: #fff4ea; }
.clscard.tone-d { --tone: #be185d; --tone-2: #9d174d; --tone-ink: #9d174d; --tone-soft: #fdf0f6; }
.clscard.tone-e { --tone: #6d28d9; --tone-2: #5b21b6; --tone-ink: #5b21b6; --tone-soft: #f3e8ff; }
.clsgrid { grid-auto-rows: 1fr; }   /* every class card the same height, whatever its number of subject rows */
.cc-num.cc-num-long { font-size: .98rem; letter-spacing: -.04em; }
a.clscard:hover { border-color: var(--tone); }
a.clscard:active { transform: scale(.985); }
a.clscard:focus-visible { outline: 3px solid var(--tone); outline-offset: 2px; }
.cc-head { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.cc-num { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; line-height: 1; letter-spacing: -.02em; color: #fff;
  background: linear-gradient(135deg, var(--tone), var(--tone-2)); box-shadow: 0 4px 10px rgba(26,26,46,.14); }
.cc-hd { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.cc-title { font-size: 1.08rem; line-height: 1.2; font-weight: 800; color: var(--ink); }
.cc-board { font-size: .72rem; font-weight: 800; letter-spacing: .03em; color: var(--muted); }
.cc-subs { display: flex; flex-direction: column; gap: .28rem; }
.cc-sub { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 28px;
  padding: .2rem .5rem; border-radius: 10px; background: var(--tone-soft); font-size: .8125rem; line-height: 1.25; }
.cc-sn { font-weight: 700; color: var(--ink); min-width: 0; white-space: nowrap; }
.cc-ct { flex: 0 0 auto; font-weight: 800; color: var(--tone-ink); white-space: nowrap; }
.cc-sub.is-soon { background: transparent; box-shadow: inset 0 0 0 1px var(--border, #e5e7eb); }
.cc-sub.is-soon .cc-sn { color: var(--muted); }
.cc-ct-soon { font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; color: #7c2d12; background: #ffedd5; }
.cc-cta { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: .15rem; min-height: 42px;
  border-radius: 12px; font-weight: 800; font-size: .9rem; color: #fff; background: var(--tone); }
/* selected class (site.js sets .on + aria-current) */
.clscard.on, .clscard[aria-current="true"] { border-color: var(--tone); box-shadow: 0 0 0 1.5px var(--tone), 0 8px 22px rgba(26,26,46,.10); }
/* secondary (no notes yet) */
.clsgrid > li.cc-li-soon .clscard { gap: .5rem; padding: .7rem .75rem; border-radius: 16px; box-shadow: none; }
.clscard-soon .cc-num { width: 40px; height: 40px; border-radius: 12px; font-size: .82rem; letter-spacing: -.03em;
  color: var(--tone-ink); background: var(--tone-soft); box-shadow: none; }
.clscard-soon .cc-title { font-size: .95rem; }
.cc-desc { font-size: .78rem; line-height: 1.25; color: var(--muted); }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; }
.cc-soon { font-size: .72rem; font-weight: 800; line-height: 1.25; padding: .12rem .5rem; border-radius: 999px; color: #7c2d12; background: #ffedd5; }
.cc-go { font-weight: 800; font-size: 1.05rem; color: var(--tone-ink); }
@media (min-width: 720px) {
  .cc-num.cc-num-long { font-size: 1.1rem; }
  .clsgrid { gap: .8rem; }
  .clscard { padding: 1rem 1rem .95rem; }
  .cc-num { width: 52px; height: 52px; font-size: 1.45rem; }
  .cc-title { font-size: 1.2rem; }
  .cc-sub { font-size: .875rem; min-height: 34px; padding: .3rem .65rem; }
  .clsgrid > li.cc-li-soon .clscard { flex-direction: row; align-items: center; justify-content: space-between; }
  .clscard-soon .cc-foot { margin-top: 0; gap: .6rem; }
}
@media (max-width: 360px) {
  .clsgrid { gap: .5rem; }
  .clscard { padding: .75rem .6rem; }
  .cc-sub { padding: .25rem .4rem; font-size: .78rem; }
}
html[data-theme="dark"] .clscard { --tone: #4f46e5; --tone-2: #4338ca; --tone-ink: #c7d2fe; --tone-soft: #1f2547;
  border-color: #2b3152; box-shadow: 0 1px 0 rgba(0,0,0,.35); }
html[data-theme="dark"] .clscard.tone-b { --tone: #0f766e; --tone-2: #115e59; --tone-ink: #99f6e4; --tone-soft: #12302f; }
html[data-theme="dark"] .clscard.tone-d { --tone: #be185d; --tone-2: #9d174d; --tone-ink: #fbcfe8; --tone-soft: #33172a; }
html[data-theme="dark"] .clscard.tone-c { --tone: #b45309; --tone-2: #92400e; --tone-ink: #fde68a; --tone-soft: #2e2512; }
html[data-theme="dark"] .clscard.tone-e { --tone: #6d28d9; --tone-2: #5b21b6; --tone-ink: #ddd6fe; --tone-soft: #2a2150; }
html[data-theme="dark"] .clscard .cc-cta { background: var(--tone-2); }
html[data-theme="dark"] .clscard.on, html[data-theme="dark"] .clscard[aria-current="true"] { box-shadow: 0 0 0 1.5px var(--tone-ink); border-color: var(--tone-ink); }
html[data-theme="dark"] .cc-ct-soon, html[data-theme="dark"] .cc-soon { color: #fde68a; background: #3a2e0b; }
html[data-theme="dark"] .cc-num { box-shadow: none; }
html[data-theme="dark"] .clscard-soon .cc-num { color: var(--tone-ink); background: var(--tone-soft); }

/* Subject picker in the home slot: honest «जल्द» subject uses the same card as live subjects
   (solid border, full contrast), just with a soon pill and no link. */
.home-flow-slot .pick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.home-flow-slot .pick > li { min-width: 0; }
.home-flow-slot .pick .off.subsoon { opacity: 1; filter: none; border-style: solid; cursor: default; box-shadow: none; background: var(--card); }
.home-flow-slot .pick .off.subsoon, .home-flow-slot .pick .off.subsoon * { filter: none; }
.home-flow-slot .pick .off.subsoon b { color: var(--ink); }
.home-flow-slot .pick .subsoon .soon { display: inline-block; margin-top: .1rem; color: #7c2d12; background: #ffedd5; font-weight: 800; }
html[data-theme="dark"] .home-flow-slot .pick .subsoon .soon { color: #fde68a; background: #3a2e0b; }
/* odd last card (e.g. Social Science as 3rd) spans the row on a phone so the grid stays even */
@media (max-width: 599px) {
  .home-flow-slot .pick > li.pk-soon:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .home-flow-slot .pick > li.pk-soon:last-child:nth-child(odd) .off { flex-direction: row; align-items: center; gap: .6rem; min-height: 64px; flex-wrap: wrap; }
  .home-flow-slot .pick > li.pk-soon:last-child:nth-child(odd) .off small { margin-left: auto; }
}
@media (min-width: 600px) { .home-flow-slot .pick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* long class ranges (6–8, 11–12): keep the name on one line on a 390px phone */
.cc-title { white-space: nowrap; }
.clscard:has(.cc-num-long) .cc-head { gap: .5rem; }
.clscard:has(.cc-num-long) .cc-title { font-size: 1rem; letter-spacing: -.01em; }
@media (min-width: 720px) { .clscard:has(.cc-num-long) .cc-title { font-size: 1.2rem; } }

/* ===== Home 2-tap picker sheet (js/home-picker.js): class → subject tabs + chapter list, then chapter.
   Tokens are the design-system v1 set (scoped vars only; nothing else is restyled). ===== */
:root {
  /* type: 12 / 14 / 16 / 18 / 21 / 26 */
  --ds-fs-1: .75rem; --ds-fs-2: .875rem; --ds-fs-3: 1rem; --ds-fs-4: 1.125rem; --ds-fs-5: 1.3125rem; --ds-fs-6: 1.625rem;
  /* spacing: 4 / 8 / 12 / 16 / 24 / 32 */
  --ds-s1: 4px; --ds-s2: 8px; --ds-s3: 12px; --ds-s4: 16px; --ds-s5: 24px; --ds-s6: 32px;
  --ds-r-sm: 10px; --ds-r: 14px; --ds-r-lg: 20px; --ds-r-pill: 999px;
  --ds-tap: 44px;
  --ds-bg: #f6f7fb; --ds-surface: #ffffff; --ds-surface-2: #f1f3f9; --ds-line: #e3e6ef; --ds-line-strong: #c9cedd;
  --ds-ink: #141a2e; --ds-ink-2: #3d4560; --ds-muted: #535b75;
  --ds-brand: #4338ca; --ds-brand-ink: #ffffff; --ds-brand-soft: #eef0ff; --ds-brand-text: #3730a3;
  --ds-accent: #0f766e; --ds-accent-soft: #e6f6f4;
  --ds-soon-bg: #f1f2f6; --ds-soon-ink: #4b5268;
  --ds-shadow: 0 1px 2px rgba(20,26,46,.05), 0 2px 8px rgba(20,26,46,.05);
  --ds-focus: 0 0 0 3px rgba(67,56,202,.35);
}
html[data-theme="dark"] {
  --ds-bg: #0e1120; --ds-surface: #161a2c; --ds-surface-2: #1d2238; --ds-line: #2a3050; --ds-line-strong: #3a4268;
  --ds-ink: #f2f4fa; --ds-ink-2: #d3d8e8; --ds-muted: #b9bfd3;
  --ds-brand: #5b54e8; --ds-brand-ink: #ffffff; --ds-brand-soft: #23264a; --ds-brand-text: #c7cdff;
  --ds-accent: #2dd4bf; --ds-accent-soft: #12302d;
  --ds-soon-bg: #20243a; --ds-soon-ink: #c3c8da;
  --ds-shadow: 0 1px 2px rgba(0,0,0,.35);
  --ds-focus: 0 0 0 3px rgba(165,180,252,.45);
}
.hp-sheet .chnav-row { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r); box-shadow: var(--ds-shadow); color: var(--ds-ink); }
.chnav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-s2); }
.chnav-row { display: flex; align-items: center; gap: var(--ds-s3); min-height: 52px; padding: var(--ds-s2) var(--ds-s3); text-decoration: none; }
.chnav-n { flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--ds-r-pill); background: var(--ds-surface-2); color: var(--ds-ink); font-weight: 700; font-size: var(--ds-fs-2); }
.chnav-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; color: var(--ds-ink); font-weight: 600; line-height: 1.35; }
.chnav-t small { font-weight: 500; color: var(--ds-muted); font-size: var(--ds-fs-1); }
.chnav-go { color: var(--ds-brand-text); font-weight: 700; }
.hp-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,12,24,.45); }
.hp-sheet[hidden] { display: none; }
.hp-panel { width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; background: var(--ds-bg); border-radius: var(--ds-r-lg) var(--ds-r-lg) 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
.hp-top { display: flex; align-items: center; gap: var(--ds-s3); padding: var(--ds-s3) var(--ds-s4) var(--ds-s2); }
.hp-top h2 { margin: 0; font-size: var(--ds-fs-5); color: var(--ds-ink); flex: 1; }
.hp-top small { display: block; font-size: var(--ds-fs-2); color: var(--ds-muted); font-weight: 500; }
.hp-close { width: var(--ds-tap); height: var(--ds-tap); border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-ink); font-size: 1.1rem; }
.hp-tabs { display: flex; flex-wrap: wrap; gap: var(--ds-s2); padding: 0 var(--ds-s4) var(--ds-s3); border-bottom: 1px solid var(--ds-line); }
.hp-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: var(--ds-tap); padding: 0 14px; border-radius: var(--ds-r-pill);
  border: 1px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-ink); font-weight: 700; font-size: var(--ds-fs-2); }
.hp-tab small { font-weight: 600; color: var(--ds-muted); font-size: var(--ds-fs-1); }
.hp-tab[aria-selected="true"] { background: var(--ds-brand); border-color: var(--ds-brand); color: var(--ds-brand-ink); }
.hp-tab[aria-selected="true"] small { color: var(--ds-brand-ink); }
.hp-tab[aria-disabled="true"] { background: var(--ds-soon-bg); color: var(--ds-soon-ink); border-style: dashed; }
.hp-body { overflow-y: auto; padding: var(--ds-s3) var(--ds-s4) var(--ds-s5); overscroll-behavior: contain; }
.hp-body .chnav-list { gap: var(--ds-s2); }
.hp-empty { padding: var(--ds-s4); border-radius: var(--ds-r); background: var(--ds-soon-bg); color: var(--ds-soon-ink); }
.hp-empty .ds-btn { margin-top: var(--ds-s3); }
html.hp-open { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .hp-sheet:not([hidden]) .hp-panel { animation: hpUp .22s ease-out; }
  @keyframes hpUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.hp-tab { padding: 0 12px; }
.hp-empty .ds-btn { display: inline-flex; align-items: center; gap: var(--ds-s2); min-height: var(--ds-tap); padding: 0 var(--ds-s4); border-radius: var(--ds-r-sm);
  background: var(--ds-brand); color: var(--ds-brand-ink); font-weight: 700; text-decoration: none; }
html.hp-ready .home-flow-slot { display: none; }
.clscard .cc-sub { cursor: pointer; }

/* ===== Equal card sizes (Appu 2026-11-18: every card in a grid the same width and height) ===== */
/* picker sheet: subject tabs = equal-width, equal-height grid cells; labels clamp to 2 lines */
.hp-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); grid-auto-rows: 1fr; }
.hp-tab { flex: none; width: 100%; min-width: 0; box-sizing: border-box; justify-content: center; text-align: center; flex-wrap: wrap; column-gap: 6px; row-gap: 0;
  padding: 4px 8px; line-height: 1.2; border-radius: var(--ds-r-sm); white-space: normal; overflow: hidden; }
.hp-tab small { flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* picker sheet: chapter rows all one height; title max 2 lines, source note 1 line */
.hp-body .chnav-row { box-sizing: border-box; height: 76px; min-height: 0; overflow: hidden; }
.hp-body .chnav-tt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-weight: inherit; }
.hp-body .chnav-t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* home competition + class grids: equal rows */
.comprow, .clsgrid { grid-auto-rows: 1fr; }
.comprow > li, .clsgrid > li { display: flex; min-width: 0; }
.comprow > li > *, .clsgrid > li > * { flex: 1 1 auto; min-width: 0; }
/* competition page grids: equal rows whenever they show 2+ columns (one column = a plain list, sized by its content) */
@media (min-width: 640px) { .examrow, .subj-grid { grid-auto-rows: 1fr; } .examrow > li { display: flex; } .examrow > li > * { flex: 1 1 auto; } }
.hp-tab[aria-disabled="true"][aria-selected="true"] { background: var(--ds-soon-bg); color: var(--ds-soon-ink); border: 2px solid var(--ds-soon-ink); }
.hp-tab[aria-disabled="true"][aria-selected="true"] small { color: var(--ds-soon-ink); }

/* Competitive exams entry card: same .clscard, one full-width cell */
.clsgrid.comppick { grid-template-columns: 1fr; margin: 0 0 .9rem; }
.comppick .clscard { max-width: none; }
.hp-tabs[hidden] { display: none !important; }
.chnav-row.is-soon { cursor: default; border-style: dashed; box-shadow: none; opacity: 1; }
.chnav-row.is-soon .chnav-tt { color: var(--ds-ink, var(--ink)); }
.chnav-soon { margin-left: auto; flex: 0 0 auto; font-size: .72rem; font-weight: 800; white-space: nowrap;
  padding: .05rem .45rem; border-radius: 999px; color: #7c2d12; background: #ffedd5; }
html[data-theme="dark"] .chnav-soon { color: #fde68a; background: #3a2e0b; }

/* Tools / competition clscards: titles may wrap (class cards keep nowrap). */
.toolrow .cc-title, .comppick .cc-title { min-width: 0; display: block; white-space: normal; overflow-wrap: anywhere; }
.toolrow .cc-hd, .comppick .cc-hd { min-width: 0; }
.toolrow .cc-sub { min-width: 0; }
.toolrow .cc-sub:not(:has(.cc-ct)) .cc-sn { white-space: normal; overflow: visible; }
.toolrow .cc-ct, .comppick .cc-ct { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
