/* BIO10 unit stylesheet — generated deterministically by bio10/gen.py from the accepted template CSS. */
:root {
        --ink: #17233b; --muted: #5b6b84; --brand: #0e7a5f; --brand-dark: #0a5c48;
        --accent: #f4b942; --bg: #f2f5f9; --card: #ffffff; --line: #dde5ee;
        --good: #12805c; --good-bg: #e5f6ef; --bad: #c0392b; --bad-bg: #fdecea;
      }
      * { box-sizing: border-box; margin: 0; padding: 0; }
      body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Nastaliq Urdu", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; }
      .wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
      header.site { background: var(--ink); color: #fff; padding: 14px 0; margin-bottom: 22px; }
      header.site .wrap { padding-bottom: 0; display: flex; align-items: baseline; gap: 12px; }
      .logo { font-size: 24px; font-weight: 800; letter-spacing: .3px; }
      .logo span { color: var(--accent); }
      .tagline { color: #b9c6da; font-size: 13px; }
      .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
      .crumbs b { color: var(--brand-dark); }
      h1 { font-size: 26px; line-height: 1.3; margin-bottom: 8px; }
      .sub { color: var(--muted); margin-bottom: 16px; }
      .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(23,35,59,.05); }
      .meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 20px; }
      .chip { background: #eef4f1; color: var(--brand-dark); border: 1px solid #cfe5db; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
      .btn { display: inline-block; border: 0; cursor: pointer; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; padding: 13px 28px; border-radius: 10px; transition: background .15s ease; }
      .btn:hover { background: var(--brand-dark); }
      .hidden { display: none !important; }

      /* UNIT TABS */
      .units { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
      .unitbtn { flex: 1 1 30%; border: 2px solid var(--line); background: #fff; color: var(--muted); border-radius: 12px; padding: 10px 8px; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.35; }
      .unitbtn .uico { font-size: 20px; display: block; margin-bottom: 2px; }
      .unitbtn.active { background: #fff8e6; border-color: var(--accent); color: var(--ink); }
      .unitbtn.soon { opacity: .55; }
      .unitbtn .soon-tag { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }

      /* TABS */
      .tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
      .tabbtn { flex: 1 1 auto; cursor: pointer; border: 2px solid var(--line); background: #fff; color: var(--muted); font-size: 15px; font-weight: 700; padding: 12px 10px; border-radius: 12px; transition: all .15s ease; white-space: nowrap; }
      .tabbtn:hover { border-color: var(--brand); color: var(--brand-dark); }
      .tabbtn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
      .panel h2 { font-size: 20px; margin-bottom: 12px; }
      .panel h3 { font-size: 16px; margin: 18px 0 8px; color: var(--brand-dark); }
      .panel p { margin-bottom: 10px; }
      .panel ul, .panel ol { margin: 0 0 12px 20px; display: grid; gap: 6px; }
      .note { border-left: 4px solid var(--accent); background: #fffaf0; padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 14px; margin-bottom: 16px; }

      /* Tables */
      table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14.5px; }
      th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
      th { background: #eef4f1; color: var(--brand-dark); }
      td.ur, td.sd { direction: rtl; text-align: right; font-size: 16px; line-height: 1.9; }
      .tblwrap { overflow-x: auto; }

      /* Exercise sections */
      .exsec { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fbfcfe; margin-bottom: 14px; }
      .exsec h3 { margin: 0 0 10px; font-size: 16.5px; color: var(--ink); }
      .exsec h3 .tag { float: right; font-size: 11.5px; background: #eef4f1; color: var(--brand-dark); border-radius: 999px; padding: 3px 10px; font-weight: 700; }
      .exsec p:last-child, .exsec ul:last-child, .exsec table:last-child { margin-bottom: 0; }
      .grouphead { font-size: 17px; font-weight: 800; margin: 22px 0 12px; color: var(--brand-dark); }
      .grouphead:first-child { margin-top: 0; }
      .model { border-left: 4px solid var(--brand); background: #f0f8f4; padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 14.5px; margin-bottom: 10px; }
      .urline { direction: rtl; text-align: right; background: #f7f2e7; border: 1px solid #eadfc6; border-radius: 8px; padding: 8px 12px; font-size: 15.5px; line-height: 2; color: #4a4232; margin-top: 10px; }
      /* Language switcher: default English — support lines appear only in the selected language */
      /* Support lines are HIDDEN by default (English only). They appear ONLY in the selected language. */
      .urline { display: none; }
      body[data-lang="ur"] .urline[lang="ur"] { display: block; }
      body[data-lang="sd"] .urline[lang="sd-Arab-PK"] { display: block; }
      .langswitch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
      .langswitch .ls-label { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-right: 2px; }
      .langbtn { cursor: pointer; border: 2px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 14.5px; font-weight: 700; padding: 8px 18px; border-radius: 999px; transition: all .15s ease; }
      .langbtn:hover { border-color: var(--brand); color: var(--brand-dark); }
      .langbtn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
      .langswitch .ls-note { font-size: 12.5px; color: var(--muted); }
      /* Original lesson + word meanings */
      .story p { line-height: 1.8; margin: 8px 0; }
      .story .parthead { font-size: 15px; font-weight: 800; color: var(--brand-dark); margin: 20px 0 4px; }
      .story .parthead:first-of-type { margin-top: 6px; }
      .wordbox { background: #f4f8ff; border: 1px solid #dbe7fb; border-radius: 10px; padding: 10px 14px; margin: 10px 0 6px; }
      .wordbox h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--brand-dark); }
      .wm { font-size: 14.5px; margin: 4px 0; line-height: 1.7; }
      .wm b { color: var(--ink); }
      .wm .star { color: #b45309; font-size: 12.5px; font-weight: 700; }
      .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
      .sup { background: #fdf6e0; border-radius: 6px; padding: 0 7px; color: #6b5a2a; white-space: nowrap; }
      .sup { display: none; }
      body[data-lang="ur"] .sup[lang="ur"] { display: inline; }
      body[data-lang="sd"] .sup[lang="sd-Arab-PK"] { display: inline; }
      .trline { direction: rtl; text-align: right; background: #faf6ec; border-right: 3px solid #e8c96a; border-radius: 6px; padding: 5px 10px; font-size: 15px; line-height: 2; color: #5c5340; margin: -4px 0 12px; }
      .trline { display: none; }
      body[data-lang="ur"] .trline[lang="ur"] { display: block; }
      body[data-lang="sd"] .trline[lang="sd-Arab-PK"] { display: block; }
      .rulesbox { background: #fff8e6; border: 2px solid #e8c96a; border-radius: 12px; padding: 14px 18px; margin: 12px 0; }
      .rulesbox h4 { margin: 0 0 8px; text-align: center; letter-spacing: 1px; color: #8a6d1a; }
      .rulesbox ol { margin: 0; padding-left: 20px; line-height: 1.8; }
      .rulesbox .rfoot { text-align: center; font-weight: 700; margin-top: 8px; color: #8a6d1a; }
      .vocab-note { font-size: 14px; color: var(--muted); margin: 4px 0 10px; }
      .urline b { color: #7a5b00; }
      .clean3 { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 8px; }
      @media (min-width: 640px) { .clean3 { grid-template-columns: 1fr 1fr 1fr; } }
      .cleancard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfe; }
      .cleancard h4 { font-size: 15.5px; margin-bottom: 8px; color: var(--brand-dark); }
      .cleancard ul { margin: 0 0 0 18px; display: grid; gap: 5px; font-size: 14.5px; }

      /* Diagram */
      .diagram { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; margin-bottom: 16px; }
      .diagram svg { width: 100%; height: auto; display: block; }
      .diagram .cap { font-size: 13px; color: var(--muted); text-align: center; padding-top: 8px; }

      /* Poem (Unit 4) */
      .poem { background: #fdfaf2; border: 1px solid #eadfc6; border-radius: 12px; padding: 18px 22px; margin: 12px 0; }
      .poem .ptitle { text-align: center; font-weight: 800; letter-spacing: 2px; font-size: 17px; margin-bottom: 12px; }
      .poem .verse { margin-bottom: 16px; }
      .poem .verse:last-of-type { margin-bottom: 6px; }
      .poem .verse p { margin: 2px 0; line-height: 1.75; font-size: 15.5px; }
      .poem .pauthor { text-align: right; font-weight: 700; letter-spacing: 1px; }

      /* Quiz */
      .qbar { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
      .timer { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
      .progress { height: 8px; background: #e6edf3; border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
      .progress > div { height: 100%; background: var(--brand); width: 0%; transition: width .3s ease; }
      .qtext { font-size: 19px; font-weight: 700; margin-bottom: 16px; }
      .opts { display: grid; gap: 10px; }
      .opt { text-align: left; width: 100%; cursor: pointer; background: #fbfcfe; border: 2px solid var(--line); border-radius: 10px; padding: 13px 16px; font-size: 16px; color: var(--ink); display: flex; gap: 12px; align-items: center; }
      .opt:hover { border-color: var(--brand); }
      .opt .letter { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: #eef2f7; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
      .opt.correct { border-color: var(--good); background: var(--good-bg); }
      .opt.correct .letter { background: var(--good); color: #fff; }
      .opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
      .opt.wrong .letter { background: var(--bad); color: #fff; }
      .opt.locked { cursor: default; }
      .explain { margin-top: 16px; border-left: 4px solid var(--accent); background: #fffaf0; padding: 14px 16px; border-radius: 0 10px 10px 0; }
      .explain .verdict { font-weight: 800; margin-bottom: 4px; }
      .explain .verdict.ok { color: var(--good); }
      .explain .verdict.no { color: var(--bad); }
      .explain p { font-size: 15px; }
      .explain .ur { direction: rtl; text-align: right; color: #3d4c63; margin-top: 6px; font-size: 16px; line-height: 2; }
      .qfoot { margin-top: 18px; display: flex; justify-content: flex-end; }
      .score-big { font-size: 44px; font-weight: 800; text-align: center; }
      .score-msg { text-align: center; color: var(--muted); margin-bottom: 6px; }
      .score-stats { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 20px; }
      .review { margin-top: 22px; display: grid; gap: 12px; }
      .review .item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fbfcfe; }
      .review .item .rq { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
      .review .item .ra { font-size: 14px; color: var(--good); font-weight: 600; }
      .review .item .ry { font-size: 14px; color: var(--bad); }
      .center { text-align: center; }
      .procard { border: 2px dashed var(--accent); background: #fffaf0; border-radius: 12px; padding: 16px 18px; margin-top: 18px; }
      .procard h3 { margin: 0 0 8px; color: #7a5b00; font-size: 16.5px; }
      .procard ul { margin-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }

      section.text { margin-top: 26px; }
      section.text h2 { font-size: 20px; margin-bottom: 12px; }
      section.text ol { margin-left: 20px; display: grid; gap: 14px; }
      section.text .a { color: var(--brand-dark); font-weight: 600; }
      footer.site { margin-top: 34px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
      @media (max-width: 520px) {
        h1 { font-size: 22px; }
        .card { padding: 16px; }
        .qtext { font-size: 17px; }
        .tabbtn { font-size: 13px; padding: 10px 6px; }
        .unitbtn { flex: 1 1 45%; }
        table { font-size: 13.5px; }
        .poem { padding: 14px 14px; }
        .poem .verse p { font-size: 14.5px; }
      }
.panel .tblwrap { max-width: 100%; min-width: 0; overflow-x: auto; }
      #panel-guide p, #panel-exercise .qcard p { min-width: 0; overflow-wrap: anywhere; }
      .figbox { background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0 14px; overflow-x: auto; }
      .figbox svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
      .qcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 14px; background: #fff; }
      .qq { font-weight: 600; margin-bottom: 8px; }
      .qopts { margin: 0 0 8px 20px; display: grid; gap: 4px; }
      .qopt-correct { color: var(--brand-dark); font-weight: 700; }
      .qans { margin: 6px 0; }
      .words { background: #f7faf8; border: 1px solid #dfe9e2; border-radius: 10px; padding: 10px 14px; margin: 10px 0 16px; }
      .words-h { font-weight: 700; color: var(--brand-dark); margin-bottom: 6px; }
      .voctable { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 14.5px; }
      .voctable th, .voctable td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
      .voctable th { background: #eef4f1; color: var(--brand-dark); }
      .setbtns { display: flex; flex-wrap: wrap; gap: 10px; }
      /* BIO10 (from CHEM9-F08): long Urdu/Sindhi vocabulary support must wrap on narrow screens.
         The base .sup style (shared template) uses white-space: nowrap, which forced
         page-level horizontal overflow at 390px. Scoped to Biology pages only. */
      .sup[lang] { white-space: normal; overflow-wrap: anywhere; }
      /* BIO10-FIX1 F03: Teacher's Guide bullet lists are CSS grids (base .panel ul);
         at 320px the single implicit column could not shrink below the longest
         unbreakable support string (~298px in a ~234px column), forcing page-level
         overflow on Chapter 8's Guide in all three languages at XL reading size.
         Scoped to Biology X pages via this stylesheet; verified pattern from the
         independent Chromium trial. */
      #panel-guide ul { grid-template-columns: minmax(0, 1fr); }
      #panel-guide li, #panel-guide li p { min-width: 0; overflow-wrap: anywhere; }
