/* =========================================================================
   PYQ Hub site styles.
   Part 1 (this part): the site frame - header, footer, home, book and
   chapter pages. Light: system fonts, no images, no scripts.
   Part 2 (after the marker below): styles of the solution content itself.
   ========================================================================= */

:root {
  color-scheme: light;
  --ink: #0f2233;
  --ink-2: #29435c;
  --muted: #5b6f82;
  --line: #e1e8ef;
  --line-2: #cfdbe6;
  --paper: #ffffff;
  --canvas: #f5f8fb;
  --navy: #12355b;
  --blue: #1f62a8;
  --blue-soft: #e8f1fb;
  --teal: #11806f;
  --teal-soft: #e6f6f2;
  --saffron: #d9660f;
  --saffron-soft: #fff1e4;
  --violet: #5b3fc4;
  --violet-soft: #f0ecff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 34, 51, 0.06);
  --shadow: 0 10px 30px rgba(15, 34, 51, 0.08);
  --wrap: 1120px;
  --read: 860px;
  --gutter: clamp(16px, 4vw, 32px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.6; }
main { display: block; min-height: 60vh; }
main :where(img, svg, video, canvas) { max-width: 100%; height: auto; }
main :where(pre, .math-display, mjx-container[display="true"]) { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
main :where(table) { width: 100%; max-width: 100%; }
.solution-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid #f2a541; outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.015em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-read { max-width: calc(var(--read) + 2 * var(--gutter)); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 0.6rem 0.9rem; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---- Header -------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); font-size: 1.12rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; font-size: 1rem; font-weight: 800; box-shadow: 0 4px 10px rgba(31, 98, 168, 0.3); }
.brand small { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0; }
.site-nav { display: flex; align-items: center; gap: 0.15rem; }
.site-nav a { padding: 0.5rem 0.8rem; border-radius: 999px; color: var(--ink-2); font-size: 0.95rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: var(--canvas); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }

/* ---- Buttons and chips ---------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 46px; padding: 0.7rem 1.2rem; border: 1px solid transparent; border-radius: 12px; font-weight: 700; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(31, 98, 168, 0.25); }
.btn-primary:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); background: #fff; color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.chips li, .chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 0.85rem; font-weight: 600; }
.chips .tick::before { content: ""; width: 0.5rem; height: 0.28rem; margin-right: 0.1rem; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg) translateY(-1px); }

/* ---- Home hero ---------------------------------------------------------------- */
.hero { padding: clamp(2.2rem, 6vw, 4.2rem) 0 clamp(1.8rem, 4vw, 2.8rem); border-bottom: 1px solid var(--line); background: radial-gradient(1100px 420px at 85% -10%, #dcebfb 0%, rgba(220, 235, 251, 0) 60%), radial-gradient(700px 360px at -10% 110%, #e3f5ef 0%, rgba(227, 245, 239, 0) 60%), #fff; }
.eyebrow { margin: 0 0 0.6rem; color: var(--blue); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.hero h1 { max-width: 15ch; margin: 0 0 0.9rem; font-size: clamp(2rem, 5.2vw, 3.3rem); font-weight: 850; letter-spacing: -0.035em; }
.hero h1 span { color: var(--blue); }
.lead { max-width: 40rem; margin: 0 0 1.4rem; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.18rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.4rem; }

/* ---- Sections ----------------------------------------------------------------- */
.section { padding-block: clamp(1.8rem, 5vw, 3rem); }
.section + .section { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.65rem); }
.section-head p { margin: 0.25rem 0 0; color: var(--muted); }
.class-block + .class-block { margin-top: 2rem; }
.class-title { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.9rem; font-size: 1.2rem; }

/* ---- Book cards ------------------------------------------------------------------ */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.book-card { position: relative; display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem 1.15rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.book-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--ink); transform: translateY(-2px); }
.book-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent, var(--blue)); }
.book-top { display: flex; align-items: center; gap: 0.75rem; }
.class-badge { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft, var(--blue-soft)); color: var(--accent, var(--blue)); font-size: 1.15rem; font-weight: 850; }
.book-subject { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.book-card h3 { margin: 0.1rem 0 0; font-size: 1.12rem; }
.book-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.book-foot .go { color: var(--accent, var(--blue)); font-weight: 800; white-space: nowrap; }
.subj-mathematics { --accent: var(--blue); --accent-soft: var(--blue-soft); }
.subj-science { --accent: var(--teal); --accent-soft: var(--teal-soft); }
.subj-social-science { --accent: var(--saffron); --accent-soft: var(--saffron-soft); }
.subj-other { --accent: var(--violet); --accent-soft: var(--violet-soft); }

.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e8eef4; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent, var(--blue)); }

/* ---- Feature strip ---------------------------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.feature { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.feature h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.feature .dot { display: inline-block; width: 10px; height: 10px; margin-right: 0.45rem; border-radius: 50%; background: var(--accent, var(--blue)); vertical-align: 0.05em; }
.note-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding: 1.1rem 1.25rem; border: 1px dashed var(--line-2); border-radius: var(--radius); background: #fff; }
.note-strip p { margin: 0; color: var(--ink-2); }

/* ---- Page header (all pages except home) ----------------------------------------- */
.page-header { padding: clamp(1.2rem, 3vw, 1.8rem) 0 clamp(1.2rem, 3vw, 1.6rem); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, #fbfdff 100%); }
.page-header h1 { margin: 0.2rem 0 0.5rem; font-size: clamp(1.6rem, 4vw, 2.35rem); font-weight: 850; letter-spacing: -0.03em; }
.page-header .lead { margin-bottom: 0.9rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-bottom: 0.6rem; color: var(--muted); font-size: 0.86rem; }
.breadcrumbs a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumbs .sep { color: #9aabbb; }
.header-row { display: flex; align-items: center; gap: 0.9rem 1.1rem; }
.header-row > div { min-width: 0; }
.header-row .class-badge { width: 52px; height: 52px; font-size: 1.35rem; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.meta-row .progress { flex: 1 1 160px; max-width: 240px; }
.meta-text { color: var(--muted); font-size: 0.92rem; font-weight: 600; }

/* ---- Chapter list (book page) ----------------------------------------------------- */
.chapter-list { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.chapter-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 0.9rem; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.chapter-row:hover { border-color: var(--accent, var(--blue)); box-shadow: var(--shadow-sm); color: var(--ink); }
.chapter-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft, var(--blue-soft)); color: var(--accent, var(--blue)); font-weight: 850; }
.chapter-row strong { display: block; font-size: 1.02rem; line-height: 1.35; }
.chapter-row small { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.chapter-row .arrow { color: var(--accent, var(--blue)); font-size: 1.2rem; font-weight: 800; }
.more-soon { margin: 1rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---- Chapter page ------------------------------------------------------------------- */
.solution-review-note { display: flex; gap: 0.7rem; align-items: flex-start; margin: 1.2rem 0; padding: 0.8rem 1rem; border: 1px solid #cdeee5; border-radius: 12px; background: var(--teal-soft); color: var(--ink-2); font-size: 0.93rem; }
.solution-review-note p { margin: 0; }
.solution-review-note > span { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 0.8rem; font-weight: 800; }
.solution-article { padding: clamp(1rem, 3.5vw, 2.6rem); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.solution-article .toc { margin: 0 0 clamp(1.6rem, 4vw, 2.6rem); padding: clamp(0.9rem, 2.5vw, 1.3rem); border: 1px solid #d6e6f2; border-radius: 12px; background: #f6faff; }
.solution-article .toc h2 { margin: 0 0 0.6rem; color: var(--navy); font-size: 1.05rem; }
.solution-article .toc ul { margin: 0; padding-left: 1.2rem; columns: 2 18rem; column-gap: 2rem; }
.solution-article .toc li { break-inside: avoid; }
.solution-article .toc li + li { margin-top: 0.3rem; }
.solution-article .toc a { color: var(--blue); font-weight: 650; text-decoration: none; }
.solution-article .toc a:hover { text-decoration: underline; }
.chapter-neighbours { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.4rem 0 0.6rem; }
.chapter-neighbours a { display: block; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; }
.chapter-neighbours a:hover { border-color: var(--blue); color: var(--blue); }
.chapter-neighbours a span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.chapter-neighbours .next { text-align: right; }
.back-link { display: inline-flex; margin: 0.4rem 0 0; font-weight: 700; }
.back-to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--navy); font-size: 1.2rem; font-weight: 800; text-decoration: none; box-shadow: var(--shadow); }
.back-to-top:hover { background: var(--blue); color: #fff; }

/* ---- Simple pages (About, Contact, Practice, 404) ---------------------------------- */
.card { padding: clamp(1.1rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 1rem; }
.card h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.card p { margin: 0.4rem 0; color: var(--ink-2); }
.card .big-link { font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 800; word-break: break-word; }
.info-list { margin: 0.4rem 0 0; padding: 0; list-style: none; }
.info-list li { padding: 0.45rem 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.info-list li:first-child { border-top: 0; }
.info-list strong { color: var(--ink); }

/* ---- Footer ---------------------------------------------------------------------- */
.site-footer { margin-top: clamp(2.5rem, 6vw, 4rem); background: var(--navy); color: #c8d6e4; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 1.4fr; gap: 1.8rem 2.5rem; padding-block: clamp(2rem, 5vw, 2.8rem); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: #fff; font-size: 1.1rem; font-weight: 800; text-decoration: none; }
.footer-brand:hover { color: #fff; }
.footer-brand .brand-mark { box-shadow: none; background: linear-gradient(135deg, #3d86d4, #1f62a8); }
.site-footer p { margin: 0.6rem 0 0; }
.site-footer h2 { margin: 0 0 0.7rem; color: #fff; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 0.4rem; }
.site-footer a { color: #e6eef6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .credit strong { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; padding-block: 1rem 1.3rem; border-top: 1px solid rgba(255, 255, 255, 0.14); color: #9fb3c6; font-size: 0.84rem; }

/* ---- Responsive -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 108px; }
  .header-inner { flex-wrap: wrap; gap: 0.2rem; min-height: 0; padding-block: 0.55rem 0.35rem; }
  .site-nav { justify-content: space-between; width: calc(100% + 1rem); margin-inline: -0.5rem; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 0.45rem 0.55rem; font-size: 0.9rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .chapter-neighbours { grid-template-columns: 1fr; }
  .chapter-neighbours .next { text-align: left; }
  .chapter-row { grid-template-columns: 38px 1fr auto; gap: 0.7rem; padding: 0.75rem 0.8rem; }
  .chapter-num { width: 38px; height: 38px; }
  .header-row { align-items: flex-start; gap: 0.75rem; }
  .header-row .class-badge { width: 42px; height: 42px; font-size: 1.1rem; }
  .solution-article { border-radius: 14px; }
  .back-to-top { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media print {
  .skip-link, .site-header, .site-footer, .breadcrumbs, .chapter-neighbours, .back-link, .back-to-top, .hero-actions { display: none !important; }
  body { background: #fff; }
  .page-header { padding: 0 0 0.6rem; border: 0; background: none; }
  .solution-article { padding: 0; border: 0; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* ============================== Solution content ============================== */
.ncert-solution-content {
  color: #25394c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.8vw, 1.08rem);
  line-height: 1.78;
}

.ncert-solution-content h2,
.ncert-solution-content h3,
.ncert-solution-content h4 {
  color: #143e5b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.25;
  scroll-margin-top: 1rem;
}

.ncert-solution-content h2 {
  margin: 3.5rem 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid #d9e9eb;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  letter-spacing: -0.03em;
}

.ncert-solution-content h3 {
  margin: 2.6rem 0 0.85rem;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.ncert-solution-content h4 {
  margin: 2rem 0 0.65rem;
  font-size: 1.08rem;
}

.ncert-solution-content > h2:first-child {
  margin-top: 0;
}

.ncert-solution-content p,
.ncert-solution-content ul,
.ncert-solution-content ol {
  margin-block: 0.8rem;
}

.ncert-solution-content li + li {
  margin-top: 0.35rem;
}

.ncert-solution-content hr {
  height: 1px;
  margin: 2.6rem 0;
  border: 0;
  background: #e1e9ee;
}

.ncert-solution-content :where(.question-block, .solution-block, .example-block, .think-block, .activity-block) {
  margin: 1rem 0;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid;
  border-radius: 0.9rem;
}

.ncert-solution-content .question-block {
  border-color: #cadfea;
  background: #f3f8fb;
}

.ncert-solution-content .solution-block {
  border-color: #bfe1d7;
  background: #f1faf7;
}

.ncert-solution-content .example-block {
  border-color: #ead8b2;
  background: #fff9ec;
}

.ncert-solution-content :where(.think-block, .activity-block) {
  border-color: #d8d2ed;
  background: #f8f6fd;
}

.ncert-solution-content :where(.q-label, .s-label, .e-label, .t-label, .a-label, .part-label) {
  margin-bottom: 0.45rem;
  color: #1d6176;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ncert-solution-content .s-label {
  color: #187064;
}

.ncert-solution-content .figure {
  margin: 2rem auto;
  padding: clamp(0.7rem, 2vw, 1rem);
  border: 1px solid #d9e5eb;
  border-radius: 1rem;
  background: #fbfdfe;
}

.ncert-solution-content .figure-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow-x: auto;
}

.ncert-solution-content .figure-inner :where(img, svg) {
  display: block;
  width: auto;
  max-height: 650px;
  margin-inline: auto;
  border-radius: 0.5rem;
}

.ncert-solution-content .figure-inner img {
  max-width: 100% !important;
  height: auto !important;
}

.ncert-solution-content figcaption {
  margin-top: 0.7rem;
  color: #617486;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.82rem;
  text-align: center;
}

.ncert-solution-content .math-display,
.ncert-solution-content mjx-container[display="true"] {
  margin: 1rem 0;
  padding: 0.75rem 0.25rem;
  border-radius: 0.55rem;
  background: #f8fafc;
  scrollbar-color: #9bbbc6 transparent;
}

.ncert-solution-content :where(em, strong):has(mjx-container[display="true"]) {
  display: block;
  max-width: 100%;
}

.ncert-solution-content mjx-container:not([display="true"]) {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}

.ncert-solution-content .table-wrap {
  max-width: 100%;
  margin: 1.2rem 0;
  overflow-x: auto;
  border: 1px solid #d9e5eb;
  border-radius: 0.75rem;
}

.ncert-solution-content table {
  border-collapse: collapse;
  background: #fff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.88rem;
}

.ncert-solution-content :where(th, td) {
  min-width: 5rem;
  padding: 0.65rem;
  border: 1px solid #d9e5eb;
  text-align: left;
  vertical-align: top;
}

.ncert-solution-content th {
  background: #edf5f7;
  color: #173f56;
}

.ncert-science-solutions {
  font-size: calc(clamp(1rem, 1.8vw, 1.08rem) + 2pt);
}

.ncert-science-solutions .answer {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.ncert-science-solutions .science-answer > :first-child {
  margin-top: 0;
}

.ncert-science-solutions .science-answer > :last-child {
  margin-bottom: 0;
}

.ncert-science-solutions table {
  font-size: calc(0.88rem + 2pt);
}

.ncert-science-solutions .question {
  margin-top: 2rem;
  overflow-wrap: anywhere;
}

.ncert-science-solutions .math {
  max-width: 100%;
  overflow-x: auto;
}

.ncert-science-solutions .figure-inner svg.dg {
  width: 100%;
  height: auto;
}

.ncert-science-solutions svg.dg text {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  fill: #221e1a;
}

.ncert-science-solutions svg.dg .sm { font-size: 12.5px; }
.ncert-science-solutions svg.dg .bold { font-weight: 700; }
.ncert-science-solutions svg.dg .nuc { font-size: 10px; font-weight: 700; fill: #fff; }
.ncert-science-solutions svg.dg .r { fill: #c0392b; }
.ncert-science-solutions svg.dg .b { fill: #1f6fb2; }
.ncert-science-solutions svg.dg .g { fill: #0f6b45; }
.ncert-science-solutions svg.dg .m { fill: #617486; }

.solution-article .toc .parts {
  padding-left: 1.3rem;
}

.solution-article .toc .qs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}

.solution-article .toc .qs a {
  display: inline-block;
  min-width: 2.6rem;
  padding: 0.25rem 0.5rem;
  text-align: center;
  border: 1px solid #d9e5eb;
  border-radius: 0.5rem;
}



@media (max-width: 720px) {
  .ncert-solution-content { line-height: 1.7; }
}
@media (max-width: 420px) {
  .ncert-solution-content :where(.question-block, .solution-block, .example-block, .think-block, .activity-block) { padding: 0.85rem; }
}

/* Text that replaces a textbook photo or table (see tools/redraw). */
.figure-note {
  margin: 1rem 0;
  padding: 0.65rem 0.9rem;
  border-left: 3px solid #c8d1da;
  border-radius: 6px;
  background: #f5f7f9;
  color: #3f4b56;
  font-style: italic;
}
.figure-text-card {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  background: #f7fafc;
}
.figure-text-card table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.figure-text-card th, .figure-text-card td { padding: 0.3rem 0.5rem; border: 1px solid #dbe3ea; text-align: center; }
.figure-text-card th { background: #eef3f7; }

/* Wide redrawn diagrams keep readable labels on phones: the figure box scrolls sideways. */
@media (max-width: 640px) {
  .ncert-solution-content .figure-inner > svg.diagram-wide {
    min-width: 500px;
    justify-self: start;
  }
}
