/* Language fixes added after the original build (see docs/urdu-site-fixes.md).
   Noto Nastaliq Urdu: SIL Open Font License 1.1, https://fonts.google.com/noto/specimen/Noto+Nastaliq+Urdu */
@font-face {
  font-family: 'CBT Nastaliq';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'CBT Nastaliq';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}

/* Urdu: Nastaliq for Urdu letters only; Latin letters and digits keep the site font. */
html.lang-ur body,
html.lang-ur .btn,
html.lang-ur input,
html.lang-ur textarea,
html.lang-ur select,
html.lang-ur h1, html.lang-ur h2, html.lang-ur h3,
html.lang-ur h4, html.lang-ur h5, html.lang-ur h6 {
  font-family: 'CBT Nastaliq', var(--tblr-font-sans-serif), 'Inter', sans-serif;
}
/* Nastaliq is tall; give lines room so dots and descenders do not collide. */
html.lang-ur p,
html.lang-ur li,
html.lang-ur label,
html.lang-ur .card-body,
html.lang-ur .modal-body,
html.lang-ur .text-muted {
  line-height: 2;
}
html.lang-ur h1, html.lang-ur h2, html.lang-ur h3,
html.lang-ur h4, html.lang-ur h5, html.lang-ur h6,
html.lang-ur .page-title {
  line-height: 1.9;
}
html.lang-ur .navbar-vertical .nav-link,
html.lang-ur .dropdown-item,
html.lang-ur .btn {
  line-height: 1.8;
}

/* Right-to-left pages (Urdu, Shahmukhi Punjabi, Arabic). */
html[dir=rtl] .form-label-description {
  float: left;
  margin-right: 1rem;
}
html[dir=rtl] .form-check {
  padding-left: 0;
  padding-right: 1.5rem;
}
html[dir=rtl] .form-check .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.5rem;
}
html[dir=rtl] .input-group-flat > .form-control:not(:last-child) {
  border-radius: 0 var(--tblr-border-radius) var(--tblr-border-radius) 0;
  border-left: 0;
  border-right: var(--tblr-border-width) solid var(--tblr-border-color);
}
html[dir=rtl] .input-group-flat > .input-group-text:last-child {
  border-radius: var(--tblr-border-radius) 0 0 var(--tblr-border-radius);
  border-right: 0;
  border-left: var(--tblr-border-width) solid var(--tblr-border-color);
}
html[dir=rtl] select.form-select {
  background-position: left .75rem center;
  padding-left: 2.25rem;
  padding-right: .75rem;
}

/* Nastaliq reads small at the site's 14px base size. */
html.lang-ur p,
html.lang-ur li,
html.lang-ur label {
  font-size: 1.08em;
}
html[dir=rtl] .navbar-vertical .nav-link-icon {
  margin-left: .5rem;
  margin-right: 0;
}

/* Lesson video card (added by lang-fix.js). */
.cbt-video .cbt-video-frame {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #0E6F78;
}
.cbt-video .cbt-video-frame iframe,
.cbt-video .cbt-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cbt-video .cbt-video-title {
  text-align: center;
  margin-bottom: .75rem;
}

/* Questionnaire headings (instructions and the 0 to 4 legend) wrap instead of overflowing. */
.table-responsive > .table > thead th {
  white-space: normal;
}
.table-responsive > .table > thead th h3 {
  line-height: 1.8;
}

/* Back / next words under the page arrows, in each site language. */
.pagination .page-prev .page-link,
.pagination .page-next .page-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  margin: 0 .75rem;
}
.pagination .page-prev .page-link::after,
.pagination .page-next .page-link::after {
  font-size: 1.25rem;
  font-weight: 700;
  color: #5190B7;
  line-height: 1.6;
  white-space: nowrap;
  content: "Back";
}
.pagination .page-next .page-link::after { content: "Next"; }
html.lang-ur .pagination .page-prev .page-link::after { content: "پیچھے"; }
html.lang-ur .pagination .page-next .page-link::after { content: "آگے"; }
html.lang-pun .pagination .page-prev .page-link::after { content: "پچھے"; }
html.lang-pun .pagination .page-next .page-link::after { content: "اگے"; }
html.lang-gm .pagination .page-prev .page-link::after { content: "ਪਿੱਛੇ"; }
html.lang-gm .pagination .page-next .page-link::after { content: "ਅੱਗੇ"; }
html.lang-hindi .pagination .page-prev .page-link::after { content: "पीछे"; }
html.lang-hindi .pagination .page-next .page-link::after { content: "आगे"; }
html.lang-ar .pagination .page-prev .page-link::after { content: "السابق"; }
html.lang-ar .pagination .page-next .page-link::after { content: "التالي"; }
html.lang-ch .pagination .page-prev .page-link::after { content: "上一页"; }
html.lang-ch .pagination .page-next .page-link::after { content: "下一页"; }
html.lang-spa .pagination .page-prev .page-link::after { content: "Atrás"; }
html.lang-spa .pagination .page-next .page-link::after { content: "Siguiente"; }

/* Easier forms (added 2026-11-18). */
html.lang-ur .page-body .card-body h1,
html.lang-pun .page-body .card-body h1,
html.lang-ar .page-body .card-body h1 {
  font-size: clamp(1.45rem, 5.5vw, 2.2rem);
  line-height: 1.9;
}
.page-body .form-label {
  font-size: 1.05rem;
  font-weight: 600;
}
html.lang-ur .page-body .form-label,
html.lang-pun .page-body .form-label {
  font-size: 1.15rem;
}
.page-body form .btn-primary,
.page-body .btn-primary[type=submit] {
  font-size: 1.15rem;
  padding: .55rem 2rem;
  min-width: 9rem;
}
.cbt-unsaved {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #f59f00;
  color: #7a4a00;
  font-weight: 600;
  line-height: 1.9;
}
.cbt-pulse {
  box-shadow: 0 0 0 4px rgba(245, 159, 0, .45);
}

/* "Module not open yet" notice (added 2026-11-18) */
.cbt-notopen {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 3000;
  max-width: min(92vw, 40rem); background: #fff4e5; color: #663c00; border: 2px solid #f0a020;
  border-radius: .6rem; padding: .9rem 1.2rem; font-size: 1.1rem; line-height: 1.9;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer;
}
html.lang-ur .cbt-notopen, html.lang-pun .cbt-notopen { font-size: 1.25rem; }

/* ===== Calm theme (added 2026-11-18): smaller headings, warmer colours, softer cards ===== */
:root, [data-bs-theme=light] {
  --tblr-primary: #0e7c7b;
  --tblr-primary-rgb: 14, 124, 123;
  --tblr-body-bg: #f5f2ec;
  --tblr-body-bg-rgb: 245, 242, 236;
  --tblr-border-radius: 12px;
  --cbt-ink: #23384a;
  --cbt-teal: #0e7c7b;
  --cbt-teal-dark: #0b5e5d;
  --cbt-soft: #e7f3f1;
  --cbt-warm: #f7b267;
}
body, .page { background: #f5f2ec; }
.page-wrapper { color: var(--cbt-ink); }

/* Keep the reading area a comfortable width on big screens */
.page-wrapper .container-xl { max-width: 1080px; }

/* Side menu: deep teal instead of near-black, with a clear "you are here" pill */
aside.navbar-vertical.navbar-dark {
  background: linear-gradient(180deg, #0b4f5c 0%, #0e6b6a 100%) !important;
  box-shadow: 0 0 24px rgba(11, 79, 92, .18);
}
aside.navbar-vertical .nav-link { border-radius: 10px; margin: 2px 8px; transition: background .2s; }
aside.navbar-vertical .nav-link:hover { background: rgba(255, 255, 255, .10); }
aside.navbar-vertical .nav-item.active > .nav-link,
aside.navbar-vertical .nav-link.active { background: rgba(255, 255, 255, .18); color: #fff; }

/* Top bar */
.page > header.navbar, .page-wrapper ~ header.navbar, header.navbar { background: #ffffffcc; backdrop-filter: blur(6px); }

/* Page title ("Stress / Module") */
.page-header .page-title { color: var(--cbt-teal-dark); font-size: 1.25rem; }
.page-header .page-pretitle { color: #8a8f98; }

/* Cards: rounder, softer, no hard border */
.page-body .card {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(35, 56, 74, .04), 0 8px 24px rgba(35, 56, 74, .07);
  overflow: hidden;
}

/* Headings inside lessons: much smaller than before (they were 35-40px), in brand colour */
.page-body .card-body h1 {
  font-size: 1.6rem !important;
  line-height: 1.6;
  color: var(--cbt-teal-dark);
  margin-bottom: .9rem !important;
}
html.lang-ur .page-body .card-body h1,
html.lang-pun .page-body .card-body h1,
html.lang-ar .page-body .card-body h1 {
  font-size: clamp(1.3rem, 4vw, 1.6rem) !important;
  line-height: 2;
}
.page-body .card-body h2 { font-size: 1.35rem; color: var(--cbt-teal-dark); }
.page-body .card-body h3, .page-body .card-body h4 { font-size: 1.15rem; color: var(--cbt-teal-dark); }

/* Body text: a touch larger and more open so it is easy to read */
.page-body .card-body p, .page-body .card-body li { font-size: 1rem; line-height: 1.75; }
html.lang-ur .page-body .card-body p, html.lang-ur .page-body .card-body li,
html.lang-pun .page-body .card-body p, html.lang-pun .page-body .card-body li {
  font-size: 1.12rem; line-height: 2.2;
}

/* Illustrations: not taller than needed */
.page-body .card-body img { max-height: 340px; width: auto; max-width: 100%; }

/* Buttons: friendly pill shape in teal */
.btn-primary {
  background: linear-gradient(135deg, #12908e, #0b6b6a);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(14, 124, 123, .25);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover, .btn-primary:focus { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14, 124, 123, .32); }
.page-body form .btn-primary,
.page-body .btn-primary[type=submit] { font-size: 1.05rem; padding: .5rem 1.8rem; }

/* Form boxes: soft and rounded, clear focus */
.page-body .form-control, .page-body textarea {
  border-radius: 12px;
  border: 1.5px solid #d9dee3;
  background: #fbfaf7;
}
.page-body .form-control:focus, .page-body textarea:focus {
  border-color: var(--cbt-teal);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, .15);
  background: #fff;
}
.page-body .form-control::placeholder { color: #a3aab2; }
.page-body .form-label { font-size: 1rem; color: var(--cbt-teal-dark); }
html.lang-ur .page-body .form-label, html.lang-pun .page-body .form-label { font-size: 1.08rem; }

/* Questionnaire sliders */
.page-body input[type=range] { accent-color: var(--cbt-teal); }
.page-body table tr:nth-child(even) > td { background: #faf8f4; }

/* Progress bars on the home page */
.progress { background: #e6ebe9; border-radius: 999px; height: .5rem; }
.progress-bar { background: linear-gradient(90deg, #12908e, #4cc3a6); border-radius: 999px; }

/* Home page module cards: shorter pictures, lift on hover */
.page-body a.card-link { transition: transform .2s, box-shadow .2s; }
.page-body a.card-link:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(35, 56, 74, .14); }
.page-body a.card-link svg[height="13rem"] { height: 9.5rem; }
.page-body a.card-link .card-title { font-size: 1.1rem; font-weight: 700; color: var(--cbt-ink); }

/* Back / next arrows: brand colour, smaller words */
.pagination .page-prev .page-link::after,
.pagination .page-next .page-link::after { font-size: 1.05rem; color: var(--cbt-teal); }
.pagination .page-link i { color: var(--cbt-teal) !important; }
.cbt-scale-nav circle { fill: var(--cbt-teal); }

/* Audio player */
.page-body audio { border-radius: 999px; }

/* Lesson video cards */
.cbt-video { max-width: 820px; margin-left: auto; margin-right: auto; }

/* Phones: tighter spacing */
@media (max-width: 576px) {
  .page-body .card-body { padding: 1rem; }
  .page-body .card-body h1 { font-size: 1.3rem !important; }
  html.lang-ur .page-body .card-body h1 { font-size: 1.3rem !important; }
  .page-body a.card-link svg[height="13rem"] { height: 7rem; }
}
/* Home: "My healthy thoughts" banner in brand colours instead of dark grey */
.page-body .card-body.rounded[style*="#333242"] {
  background: linear-gradient(135deg, #0b5e5d 0%, #12908e 60%, #4cc3a6 100%) !important;
}
/* Read-aloud player: teal ring instead of light blue */
.page-body audio { border-color: rgba(14, 124, 123, .45) !important; }
/* A little air above sub-headings in lessons */
.page-body .card-body h2 { margin-top: 1.1rem; }
.page-body .card-body .bg-light, .page-body .card-body .border.rounded { border-radius: 12px !important; }
/* Typing boxes were 1.8rem, which cut off the hint text on phones */
.page-body .form-control, .page-body textarea { font-size: 1rem !important; padding: .6rem .9rem; height: auto; }
html.lang-ur .page-body .form-control, html.lang-ur .page-body textarea,
html.lang-pun .page-body .form-control, html.lang-pun .page-body textarea { font-size: 1.1rem !important; line-height: 2; }
.page-body .card-body h1 + br, .page-body .card-body h1 + br + br { display: none; }
@media (max-width: 576px) {
  html.lang-ur .page-body .card-body h1, html.lang-pun .page-body .card-body h1 { font-size: 1.2rem !important; }
}

/* Compact questionnaire (added 2026-11-18): all 10 questions and the submit button fit on one screen. */
.page-body .table-vcenter > tbody > tr > td { padding-top: .2rem; padding-bottom: .2rem; line-height: 1.7; }
.page-body .table-vcenter > tbody > tr > td .form-range { margin: 0 !important; height: 1.2rem; }
.page-body .table-vcenter output.avatar { width: 1.9rem; height: 1.9rem; font-size: .95rem !important; }
.page-body .table-vcenter > thead th { padding-top: .35rem; padding-bottom: .35rem; }
.table-responsive > .table > thead th h3 { font-size: .95rem; line-height: 1.7; margin: 0; }
.page-wrapper > .page-header:empty, .page-wrapper > .page-header { margin-top: .5rem; min-height: 0; }
.page-body { margin-top: .75rem; }

/* Smaller everywhere (Farooq, 2026-11-18: still too large). Overrides the sizes above. */
.page-body .card-body p, .page-body .card-body li, .page-body .card-body td { font-size: .95rem; line-height: 1.65; }
html.lang-ur .page-body .card-body p, html.lang-ur .page-body .card-body li, html.lang-ur .page-body .card-body td,
html.lang-pun .page-body .card-body p, html.lang-pun .page-body .card-body li, html.lang-pun .page-body .card-body td,
html.lang-ur .page-body .card-body .card-text, html.lang-pun .page-body .card-body .card-text { font-size: .98rem; line-height: 1.95; }
html.lang-ur p, html.lang-ur li, html.lang-ur label { font-size: 1em; }
.page-body .card-body h1 { font-size: 1.3rem !important; margin-bottom: .6rem !important; }
html.lang-ur .page-body .card-body h1, html.lang-pun .page-body .card-body h1, html.lang-ar .page-body .card-body h1 { font-size: 1.3rem !important; line-height: 1.9; }
.page-body .card-body h2 { font-size: 1.15rem; }
.page-body .card-body h3, .page-body .card-body h4 { font-size: 1.02rem; }
.page-body .card-body { padding: 1rem 1.25rem; }
.page-body .card-body .card .card-body, .page-body .card-body .bg-light { padding: .75rem 1rem; }
.page-body .card-body img { max-height: 240px; }
.page-header .page-title { font-size: 1.1rem; }
.cbt-video { max-width: 640px; }
.cbt-video .cbt-video-title { font-size: 1.05rem; margin-bottom: .4rem; }
.page-body .form-label { font-size: .95rem; }
html.lang-ur .page-body .form-label, html.lang-pun .page-body .form-label { font-size: 1rem; }
html.lang-ur .page-body .form-control, html.lang-ur .page-body textarea,
html.lang-pun .page-body .form-control, html.lang-pun .page-body textarea { font-size: 1rem !important; line-height: 1.8; }
.page-body form .btn-primary, .page-body .btn-primary[type=submit] { font-size: .98rem; padding: .4rem 1.5rem; min-width: 7rem; }
/* Side menu a little tighter */
aside.navbar-vertical .nav-link { padding-top: .3rem; padding-bottom: .3rem; font-size: .95rem; }
/* Page arrows: smaller circles and words */
.cbt-scale-nav svg { width: 52px; height: 52px; }
.pagination .page-prev .page-link::after, .pagination .page-next .page-link::after { font-size: .95rem; line-height: 1.4; }
/* Home module cards */
.page-body a.card-link svg[height="13rem"] { height: 8rem; }
.page-body a.card-link .card-title { font-size: 1rem; }

/* Number each question in the check-in tables: 1, 2, 3 ... */
.page-body table:has(input[type=range]) tbody { counter-reset: cbtq; }
.page-body table:has(input[type=range]) tbody tr { counter-increment: cbtq; }
.page-body table:has(input[type=range]) tbody tr > td:first-child::before {
  content: counter(cbtq) ". ";
  font-family: system-ui, sans-serif; font-weight: 700; color: var(--cbt-teal);
  display: inline-block; min-width: 1.6rem;
}

/* Fill the laptop screen (Farooq, 2026-11-18: page too small now). Overrides the sizes above. */
.page-wrapper .container-xl { max-width: 1400px; }
.page-body .card-body p, .page-body .card-body li, .page-body .card-body td { font-size: 1.02rem; line-height: 1.75; }
html.lang-ur .page-body .card-body p, html.lang-ur .page-body .card-body li, html.lang-ur .page-body .card-body td,
html.lang-pun .page-body .card-body p, html.lang-pun .page-body .card-body li, html.lang-pun .page-body .card-body td,
html.lang-ur .page-body .card-body .card-text, html.lang-pun .page-body .card-body .card-text { font-size: 1.08rem; line-height: 2.05; }
.page-body .card-body h1 { font-size: 1.45rem !important; }
html.lang-ur .page-body .card-body h1, html.lang-pun .page-body .card-body h1, html.lang-ar .page-body .card-body h1 { font-size: 1.45rem !important; }
.page-body .card-body img { max-height: 300px; }
.cbt-video { max-width: 760px; }
/* Check-in tables: bigger text again, still all on one screen */
.page-body .table-vcenter > tbody > tr > td { padding-top: .3rem; padding-bottom: .3rem; }
html.lang-ur .page-body .table-vcenter > tbody > tr > td:first-child, html.lang-pun .page-body .table-vcenter > tbody > tr > td:first-child { font-size: 1.12rem; }
.page-body .table-vcenter > tbody > tr > td:first-child { font-size: 1.05rem; }
.table-responsive > .table > thead th h3 { font-size: 1.08rem; }
.page-body .table-vcenter output.avatar { width: 2.1rem; height: 2.1rem; font-size: 1.05rem !important; }
/* Arrows take the place of the submit button (Next submits the answers) */
.cbt-hidden-submit { display: none !important; }
.cbt-scale-nav { margin: 0 auto !important; justify-content: center !important; width: 100%; }
.cbt-scale-nav svg { width: 60px; height: 60px; }
.cbt-scale-nav .page-link { background: none; border: 0; }

/* Stress symptoms page (2026-11-18): icons close around Khushi, colourful badges with labels */
.cbt-sym { max-width: 900px; margin: 0 auto !important; }
.cbt-sym > .col-4 { margin-top: 0 !important; }
.cbt-sym > .col-4:not(:has(img)) { display: flex; flex-direction: column; gap: .35rem; align-items: center; text-align: center !important; }
.cbt-sym > .col-4 > div { display: flex; flex-direction: column; align-items: center; max-width: 15rem; }
.cbt-sym img[alt=Symptoms] { width: 100%; max-height: 420px; }
.cbt-sym-badge { display: inline-flex !important; align-items: center; justify-content: center; width: 3.3rem; height: 3.3rem; border-radius: 50%;
  padding: 0 !important; box-shadow: 0 6px 16px rgba(35,56,74,.15); animation: cbtPop .6s ease-out both, cbtBob 4s ease-in-out 1s infinite;
  transition: transform .2s; cursor: default; }
.cbt-sym-badge:hover { transform: scale(1.12); }
.cbt-sym-badge i { font-size: 1.8rem !important; color: #fff !important; }
.cbt-sym-c0 { background: linear-gradient(135deg,#ef8354,#f7b267); }
.cbt-sym-c1 { background: linear-gradient(135deg,#0e7c7b,#4cc3a6); }
.cbt-sym-c2 { background: linear-gradient(135deg,#7b61c9,#b49cf0); }
.cbt-sym-c3 { background: linear-gradient(135deg,#e05780,#f59ab5); }
.cbt-sym-c4 { background: linear-gradient(135deg,#2f80c9,#7cc0f2); }
.cbt-sym-label { display: block; margin-top: .15rem; font-size: .88rem; line-height: 1.5; color: var(--cbt-ink); font-weight: 600; }
html.lang-ur .cbt-sym-label, html.lang-pun .cbt-sym-label { font-size: .95rem; line-height: 1.7; }
@keyframes cbtPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cbtBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .cbt-sym-badge { animation: none; } }

/* ---- Emotions match game (examine4) ---- */
.cbt-emo-wrap{position:relative;display:block;width:100%;max-width:620px;margin:0 auto}
.page-body .card-body .cbt-emo-wrap img{display:block;width:100%;max-width:100%;max-height:none;height:auto}
.cbt-emo-spot{position:absolute;width:25%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;
  border:4px solid transparent;background:transparent;cursor:pointer;transition:all .25s;padding:0}
.cbt-emo-spot:hover{border-color:#9fd6d0;box-shadow:0 0 0 6px rgba(20,130,120,.12)}
.cbt-emo-spot.sel{border-color:#f0a500;box-shadow:0 0 0 8px rgba(240,165,0,.25);animation:cbtEmoPulse 1.2s infinite}
.cbt-emo-spot.done{border-color:#2e9e6a;cursor:default}
.cbt-emo-tag{position:absolute;left:50%;bottom:-14px;transform:translateX(-50%);white-space:nowrap;background:#2e9e6a;color:#fff;
  border-radius:999px;padding:2px 12px;font-size:1rem;box-shadow:0 3px 8px rgba(0,0,0,.15);animation:cbtEmoIn .4s ease-out}
.cbt-emo-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:6px 0 14px;padding:10px 16px;
  border-radius:14px;background:#eef7f6;color:#14524c;font-size:1.05rem;transition:background .3s}
.cbt-emo-bar.good{background:#e3f6ea;color:#1e7a4f}.cbt-emo-bar.bad{background:#fdf0e6;color:#9a4a12}
.cbt-emo-bar.win{background:linear-gradient(90deg,#ffe9a8,#c9f2dc);color:#14524c;font-weight:600}
.cbt-emo-score{background:#fff;border-radius:999px;padding:2px 12px;font-size:.95rem;white-space:nowrap}
.list-group-item.cbt-emo-chip{cursor:pointer;font-size:1.1rem;border-width:2px;transition:transform .2s,box-shadow .2s;display:flex;align-items:center;justify-content:center;gap:8px}
.cbt-emo-icon{font-size:1.5rem;line-height:1}
.cbt-emo-k0{background:#fdecec!important}.cbt-emo-k1{background:#eef6e4!important}.cbt-emo-k2{background:#efeafb!important}
.cbt-emo-k3{background:#fff6d6!important}.cbt-emo-k4{background:#e6f0fb!important}.cbt-emo-k5{background:#fdeefa!important}
.cbt-emo-k6{background:#fdf1e3!important}.cbt-emo-k7{background:#eaf6f5!important}
.list-group-item.cbt-emo-chip:hover{color:inherit!important;border-color:#1a8a80!important;transform:translateY(-3px)}
.cbt-emo-ready .cbt-emo-chip{border-color:#f0a500!important}
.cbt-emo-pop{animation:cbtEmoPop .45s ease-out}.cbt-emo-shake{animation:cbtEmoShake .4s}
@keyframes cbtEmoPulse{50%{box-shadow:0 0 0 14px rgba(240,165,0,.08)}}
@keyframes cbtEmoIn{from{opacity:0;transform:translate(-50%,8px)}}
@keyframes cbtEmoPop{40%{transform:scale(1.12)}}
@keyframes cbtEmoShake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
/* the floating label and the placeholder overlapped in the "other emotions" box */
.form-floating>textarea#other-emotions::placeholder{color:transparent}

/* ---- Khatoon's diary as a book ---- */
.cbt-book-src{display:none!important}
.cbt-book-empty{display:none!important}
.cbt-book{max-width:760px;margin:10px auto 24px}
.cbt-book-stage{perspective:1600px}
.cbt-page{position:relative;min-height:360px;padding:26px 34px 46px 60px;border-radius:6px 16px 16px 6px;
  background:#fffdf6 repeating-linear-gradient(to bottom,transparent 0,transparent 37px,#e9e2cf 37px,#e9e2cf 38px);
  background-position:0 64px;box-shadow:0 14px 30px rgba(60,40,10,.14),inset 14px 0 18px -12px rgba(0,0,0,.18);
  border:1px solid #eadfc4;transform-origin:left center;font-size:1.15rem;line-height:38px}
html[dir=rtl] .cbt-page{padding:26px 60px 46px 34px;border-radius:16px 6px 6px 16px;transform-origin:right center;
  box-shadow:0 14px 30px rgba(60,40,10,.14),inset -14px 0 18px -12px rgba(0,0,0,.18)}
.cbt-page:before{content:"";position:absolute;top:0;bottom:0;left:40px;border-left:2px solid #f2b8b0}
html[dir=rtl] .cbt-page:before{left:auto;right:40px}
.cbt-pg-head{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.cbt-pg-head h3{margin:0;font-size:1.7rem;color:#14524c}
.cbt-pg-icon{font-size:1.8rem;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#e9f6f4;line-height:1}
.cbt-pg-k1 .cbt-pg-icon{background:#eef3fd}.cbt-pg-k2 .cbt-pg-icon{background:#fdf0f0}.cbt-pg-k3 .cbt-pg-icon{background:#eef8ef}
.cbt-pg-k4 .cbt-pg-icon,.cbt-pg-k5 .cbt-pg-icon,.cbt-pg-k6 .cbt-pg-icon{background:#fff6d6}
.cbt-pg-body p,.cbt-pg-body ul{margin:0}
.cbt-pg-body ul{padding-inline-start:1.4em}
.cbt-pg-body li{line-height:38px}
.cbt-pg-num{position:absolute;bottom:10px;left:0;right:0;text-align:center;font-size:.9rem;color:#9b8b66;line-height:1.4}
.turn-out-f{animation:cbtTurnOutF .33s ease-in forwards}.turn-in-f{animation:cbtTurnInF .38s ease-out}
.turn-out-b{animation:cbtTurnOutB .33s ease-in forwards}.turn-in-b{animation:cbtTurnInB .38s ease-out}
@keyframes cbtTurnOutF{to{transform:rotateY(-80deg);opacity:.3}}
@keyframes cbtTurnInF{from{transform:rotateY(80deg);opacity:.3}}
@keyframes cbtTurnOutB{to{transform:rotateY(80deg);opacity:.3}}
@keyframes cbtTurnInB{from{transform:rotateY(-80deg);opacity:.3}}
html[dir=rtl] .turn-out-f{animation-name:cbtTurnOutB}html[dir=rtl] .turn-in-f{animation-name:cbtTurnInB}
html[dir=rtl] .turn-out-b{animation-name:cbtTurnOutF}html[dir=rtl] .turn-in-b{animation-name:cbtTurnInF}
.cbt-cycle{display:flex;flex-direction:column;align-items:center;gap:2px;margin:6px 0 10px;line-height:1.5}
.cbt-cy{padding:8px 18px;border-radius:14px;font-size:1.1rem;box-shadow:0 3px 8px rgba(0,0,0,.08);background:#fff;white-space:nowrap}
.cbt-cy-s{background:#e9f6f4}.cbt-cy-t{background:#eef3fd}.cbt-cy-e{background:#fdf0f0}.cbt-cy-b{background:#eef8ef}
.cbt-cy-row{display:flex;align-items:center;gap:26px;justify-content:center}
.cbt-cy-arrow{color:#16857b;font-size:1.6rem;line-height:1.2}
.cbt-cy-arrow.diag.l{transform:rotate(30deg)}.cbt-cy-arrow.diag.r{transform:rotate(-30deg)}
html[dir=rtl] .cbt-cy-arrow.diag.l{transform:rotate(-30deg)}html[dir=rtl] .cbt-cy-arrow.diag.r{transform:rotate(30deg)}
.cbt-cy-note{font-size:1.05rem;line-height:1.9;color:#3d4b49;margin-top:8px!important}
@media (max-width:600px){.cbt-page{padding:20px 22px 44px 30px}html[dir=rtl] .cbt-page{padding:20px 30px 44px 22px}}
.cbt-pg-body li,.cbt-pg-body p{opacity:1!important;animation:cbtLiIn .45s ease-out both!important}
.cbt-pg-body li:nth-child(2){animation-delay:.15s!important}.cbt-pg-body li:nth-child(3){animation-delay:.3s!important}
.cbt-pg-body li:nth-child(4){animation-delay:.45s!important}.cbt-pg-body li:nth-child(5){animation-delay:.6s!important}
@keyframes cbtLiIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.cbt-book-side{margin-top:4px}

/* Text the video already covers: hidden behind a "read it all" button (2026-11-20). */
.cbt-fold-on .cbt-fold-item,.cbt-fold-on:not(.cbt-fold-part) .card.fade-in app-text-to-speech{display:none!important}
.cbt-fold-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem;
  background:#f1f6fd;border:1px solid #d5e3f7;border-radius:8px;padding:.6rem 1rem;margin:0 auto 1rem;max-width:760px;font-size:1rem}
.cbt-fold-bar .btn{white-space:nowrap}

/* ===== 2026-11-24: compact 0-4 answer buttons and side arrows (Farooq: slider too long; arrows on the sides) ===== */
/* Questionnaires: small round buttons replace the long slider and the number bubble. */
.cbt-range-done { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; }
.cbt-pick-out, .cbt-pick-table thead th.w-1 { display: none !important; }
.cbt-pick-table td:has(.cbt-pick) { width: 1%; white-space: nowrap; }
.cbt-pick { display: inline-flex; gap: .4rem; padding: .15rem 0; } /* follows the page: 0 on the right in Urdu, like the old slider */
.cbt-pick-b {
  width: 2.35rem; height: 2.35rem; border-radius: 50%; border: 1.5px solid #cfdcda; background: #fff;
  color: #4a5a63; font: 700 1rem/1 system-ui, sans-serif; cursor: pointer; padding: 0;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.cbt-pick-b:hover { border-color: var(--cbt-teal); color: var(--cbt-teal); transform: translateY(-1px); }
.cbt-pick-b:focus-visible { outline: 3px solid rgba(14,124,123,.35); outline-offset: 2px; }
.cbt-pick-b.on { color: #fff; border-color: transparent; transform: scale(1.1); box-shadow: 0 4px 10px rgba(35,56,74,.22); }
.cbt-pick-b.cbt-lv0.on { background: #2a9d8f; }
.cbt-pick-b.cbt-lv1.on { background: #7cb66a; }
.cbt-pick-b.cbt-lv2.on { background: #e9b949; }
.cbt-pick-b.cbt-lv3.on { background: #ee8a4b; }
.cbt-pick-b.cbt-lv4.on { background: #d9534f; }
.cbt-pick-table > tbody > tr > td { padding-top: .25rem !important; padding-bottom: .25rem !important; }

/* Back / next: round teal buttons at the sides, half way down the screen. */
.page-body .pagination.cbt-side { margin: 0 !important; padding: 0; height: 0; min-height: 0; }
.page-body .pagination.cbt-side > li {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 1030; margin: 0;
}
.page-body .pagination.cbt-side .page-link {
  margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
}
.page-body .pagination.cbt-side .page-link > i, .page-body .pagination.cbt-side .page-link > svg { display: none !important; }
.cbt-arrow {
  display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(145deg, #19aaa6 0%, #0e7c7b 55%, #0b5e5d 100%); color: #fff;
  box-shadow: 0 8px 20px rgba(11,94,93,.32), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .2s, box-shadow .2s;
}
.page-body .pagination.cbt-side .page-link:hover .cbt-arrow { transform: scale(1.08); box-shadow: 0 12px 26px rgba(11,94,93,.42), inset 0 1px 0 rgba(255,255,255,.3); }
.page-body .pagination.cbt-side .page-link:active .cbt-arrow { transform: scale(.94); }
.page-body .pagination.cbt-side .page-next .cbt-arrow { animation: cbtArrowGlow 2.6s ease-in-out infinite; }
@keyframes cbtArrowGlow {
  0%, 100% { box-shadow: 0 8px 20px rgba(11,94,93,.32), 0 0 0 0 rgba(25,170,166,.45), inset 0 1px 0 rgba(255,255,255,.3); }
  50% { box-shadow: 0 8px 20px rgba(11,94,93,.32), 0 0 0 10px rgba(25,170,166,0), inset 0 1px 0 rgba(255,255,255,.3); }
}
.page-body .pagination.cbt-side .page-prev .page-link::after,
.page-body .pagination.cbt-side .page-next .page-link::after {
  font-size: .85rem !important; font-weight: 700; line-height: 1.7 !important; color: var(--cbt-teal-dark, #0b5e5d);
  background: rgba(255,255,255,.92); padding: 0 .6rem; border-radius: 999px; box-shadow: 0 2px 6px rgba(35,56,74,.12);
}
/* Which side: back on the start side, next on the end side; keep clear of the side menu (15rem) on laptops. */
html[dir=ltr] .pagination.cbt-side > li.page-prev, html:not([dir=rtl]) .pagination.cbt-side > li.page-prev { left: 12px; }
html:not([dir=rtl]) .pagination.cbt-side > li.page-next { right: 12px; }
html[dir=rtl] .pagination.cbt-side > li.page-prev { right: 12px; }
html[dir=rtl] .pagination.cbt-side > li.page-next { left: 12px; }
@media (min-width: 992px) {
  html:not([dir=rtl]) .pagination.cbt-side > li.page-prev { left: max(calc(15rem + 14px), calc((100vw + 15rem - 1400px) / 2 - 70px)); }
  html:not([dir=rtl]) .pagination.cbt-side > li.page-next { right: max(14px, calc((100vw - 15rem - 1400px) / 2 - 70px)); }
  html[dir=rtl] .pagination.cbt-side > li.page-prev { right: max(calc(15rem + 14px), calc((100vw + 15rem - 1400px) / 2 - 70px)); }
  html[dir=rtl] .pagination.cbt-side > li.page-next { left: max(14px, calc((100vw - 15rem - 1400px) / 2 - 70px)); }
}
/* Room for the arrows so they never cover the words. */
.page-body.cbt-has-side > .container-xl { padding-left: 84px; padding-right: 84px; }

/* Phones (and the future app): arrows become slim tabs on the screen edge; questions stack above their buttons. */
@media (max-width: 640px) {
  .page-body.cbt-has-side > .container-xl { padding-left: 34px; padding-right: 34px; }
  .cbt-arrow { width: 30px; height: 60px; border-radius: 14px; }
  html:not([dir=rtl]) .pagination.cbt-side > li.page-prev .cbt-arrow, html[dir=rtl] .pagination.cbt-side > li.page-next .cbt-arrow { border-radius: 0 14px 14px 0; }
  html:not([dir=rtl]) .pagination.cbt-side > li.page-next .cbt-arrow, html[dir=rtl] .pagination.cbt-side > li.page-prev .cbt-arrow { border-radius: 14px 0 0 14px; }
  .cbt-arrow svg { width: 22px; height: 22px; }
  html:not([dir=rtl]) .pagination.cbt-side > li.page-prev, html[dir=rtl] .pagination.cbt-side > li.page-next { left: 0; }
  html:not([dir=rtl]) .pagination.cbt-side > li.page-next, html[dir=rtl] .pagination.cbt-side > li.page-prev { right: 0; }
  .page-body .pagination.cbt-side .page-prev .page-link::after, .page-body .pagination.cbt-side .page-next .page-link::after { display: none; }
  .cbt-pick-table, .cbt-pick-table tbody, .cbt-pick-table thead, .cbt-pick-table tr { display: block; width: 100%; }
  .cbt-pick-table tr > td, .cbt-pick-table tr > th { display: block; width: 100% !important; border: 0; }
  .cbt-pick-table tbody tr { border-bottom: 1px solid #ece8e1; padding: .35rem .5rem; }
  .cbt-pick-table td:has(.cbt-pick) { padding-top: 0 !important; }
  .cbt-pick { gap: .5rem; }
  .cbt-pick-b { width: 2.5rem; height: 2.5rem; }
}
/* Keep the 0-4 meanings readable above the buttons on laptops */
@media (min-width: 641px) { .cbt-pick-table thead th:nth-child(2) { min-width: 24rem; } .cbt-pick-table thead th:nth-child(2) h3 { font-size: 1rem !important; } }

/* Questionnaires: every question must be answered (2026-11-25) */
.cbt-scale-nav.cbt-locked .page-next .cbt-arrow { filter: grayscale(.85); opacity: .55; animation: none; box-shadow: none; }
.cbt-pick-table tr.cbt-missing > * { background: #fdecea !important; box-shadow: inset 0 0 0 9999px #fdecea !important; }
.cbt-pick-table tr.cbt-missing .cbt-pick { animation: cbtShake .45s ease; }
.cbt-pick-table tr.cbt-missing .cbt-pick-b { border-color: #d9534f; }
@keyframes cbtShake { 0%,100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cbt-answer-all { background: #b23b37 !important; color: #fff !important; border-color: #8f2a27 !important; }
@media (max-width: 640px) { .cbt-answer-all { left: 12px !important; right: 12px !important; width: auto !important; max-width: none !important; transform: none !important; } }

/* Score pages: simple up/down view instead of the area chart (2026-11-25) */
.cbt-trend-card.cbt-has-trend #chart,
.cbt-trend-card.cbt-has-trend .align-items-baseline,
.cbt-trend-card.cbt-has-trend .dropdown { display: none !important; }
.cbt-trend { padding: .25rem 0 .5rem; }
.cbt-trend-wait { color: #6b7785; }
.cbt-trend-top { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cbt-trend-num { display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 7.5rem; height: 7.5rem; border-radius: 50%; color: #fff; box-shadow: 0 6px 16px rgba(35,56,74,.18); }
.cbt-trend-num b { font-size: 2.8rem; line-height: 1; font-weight: 700; font-family: system-ui, sans-serif; }
.cbt-trend-num small { font-size: .9rem; opacity: .95; margin-top: .25rem; }
.cbt-trend-num.cbt-low, .cbt-bar-fill.cbt-low { background: #2a9d8f; }
.cbt-trend-num.cbt-mid, .cbt-bar-fill.cbt-mid { background: #e9a23b; }
.cbt-trend-num.cbt-high, .cbt-bar-fill.cbt-high { background: #d9534f; }
.cbt-trend-lv { display: flex; flex-direction: column; gap: .4rem; }
.cbt-chip { display: inline-block; padding: .3rem .9rem; border-radius: 999px; font-weight: 700; font-size: 1.15rem; }
.cbt-chip.cbt-low { background: #e3f4f1; color: #1d7368; }
.cbt-chip.cbt-mid { background: #fdf1dc; color: #9a6210; }
.cbt-chip.cbt-high { background: #fbe4e3; color: #a3322e; }
.cbt-trend-hint { color: #6b7785; font-size: .95rem; }
.cbt-trend-msg { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 12px; font-size: 1.1rem; line-height: 1.7; }
.cbt-trend-msg svg { flex: none; }
.cbt-dir-down { background: #e3f4f1; color: #1d6e64; }
.cbt-dir-up { background: #fdeee2; color: #9b4a14; }
.cbt-dir-same, .cbt-dir-first { background: #eef3f8; color: #2f4a63; }
.cbt-trend-h { margin: 1.4rem 0 .6rem; font-size: 1.05rem; color: #23384a; }
.cbt-bars { display: flex; align-items: flex-end; gap: .6rem; overflow-x: auto; padding-bottom: .25rem; }
.cbt-bar { flex: 1 1 0; min-width: 4.2rem; max-width: 7rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.cbt-bar-v { font-weight: 700; font-family: system-ui, sans-serif; color: #23384a; }
.cbt-bar-col { display: flex; align-items: flex-end; width: 70%; height: 140px; background: #f1f4f7; border-radius: 8px; overflow: hidden; }
.cbt-bar-fill { display: block; width: 100%; border-radius: 8px 8px 0 0; }
.cbt-bar-n { font-size: .8rem; text-align: center; line-height: 1.5; color: #4a5a6a; }
.cbt-bar-now .cbt-bar-col { outline: 3px solid #0e7c7b; outline-offset: 2px; }
.cbt-bar-now .cbt-bar-n { font-weight: 700; color: #0e7c7b; }
html.lang-ur .cbt-trend-msg, html.lang-pun .cbt-trend-msg { font-size: 1.2rem; }
@media (max-width: 640px) {
  .cbt-trend-num { width: 6rem; height: 6rem; }
  .cbt-trend-num b { font-size: 2.2rem; }
  .cbt-trend-msg { font-size: 1rem; }
  .cbt-bar-col { height: 110px; }
}
@media print { .cbt-trend-num, .cbt-bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ===== 2026-12-01: diary tabs + edge arrows (Farooq: diary pages must be easy to see; side arrows only change lesson pages) ===== */
.cbt-bk-tabs{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:0 0 10px}
.cbt-bk-tab{display:inline-flex;align-items:center;gap:6px;border:1.5px solid #cfe3e0;background:#fff;color:#2f5f5a;border-radius:999px;
  padding:3px 12px 3px 6px;font-size:.95rem;line-height:1.7;cursor:pointer;transition:background .2s,border-color .2s,transform .15s;white-space:nowrap}
html[dir=rtl] .cbt-bk-tab{padding:3px 6px 3px 12px}
.cbt-bk-tab:hover{border-color:#16857b;transform:translateY(-1px)}
.cbt-bk-tab.seen{background:#eef7f6}
.cbt-bk-tab.on{background:#16857b;border-color:#16857b;color:#fff;box-shadow:0 4px 10px rgba(22,133,123,.25)}
.cbt-tab-ic{font-size:1.05rem;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(0,0,0,.04)}
.cbt-bk-tab.on .cbt-tab-ic{background:rgba(255,255,255,.22)}
.cbt-book-stage{position:relative;padding:0 18px}
.cbt-bk-edge{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:38px;height:38px;border-radius:50%;padding:0;
  display:flex;align-items:center;justify-content:center;background:#fffdf6;color:#16857b;border:2px solid #b9dfda;
  box-shadow:0 3px 8px rgba(60,40,10,.15);cursor:pointer;transition:transform .15s,background .2s}
.cbt-bk-edge:hover:not(:disabled){background:#16857b;color:#fff;border-color:#16857b}
.cbt-bk-edge:disabled{opacity:0;pointer-events:none}
html:not([dir=rtl]) .cbt-bk-prev,html[dir=rtl] .cbt-bk-next{left:0}
html:not([dir=rtl]) .cbt-bk-next,html[dir=rtl] .cbt-bk-prev{right:0}
.cbt-page{min-height:300px}
@media (max-width:640px){
  .cbt-bk-tab .cbt-tab-tx{display:none}
  .cbt-bk-tab.on .cbt-tab-tx{display:inline}
  .cbt-book-stage{padding:0 12px}
  .cbt-bk-edge{width:32px;height:32px}
}

/* ===== 2026-12-01: lesson pages fit one screen (Farooq: no scrolling on laptop or phone) ===== */
html.cbt-lesson footer.footer { display: none !important; }
html.cbt-lesson .page-wrapper > .page-header { margin-top: .2rem !important; padding-top: 0; padding-bottom: 0; }
html.cbt-lesson .page-wrapper > .page-header .page-pretitle { display: none; }
html.cbt-lesson .page-wrapper > .page-header .page-title { font-size: 1rem; line-height: 1.6; }
html.cbt-lesson .page-body { margin-top: .35rem; margin-bottom: 0; }
html.cbt-lesson .page-body .card { margin-bottom: .5rem; }
html.cbt-lesson .page-body .card-body { padding-top: .6rem; padding-bottom: .6rem; }
html.cbt-lesson .page-body .card-body h1 { margin-bottom: .3rem !important; }
html.cbt-lesson .page-body .card-body img { max-height: min(300px, 46vh); }
html.cbt-lesson .cbt-video .cbt-video-frame { max-width: min(880px, calc((100vh - 250px) * 16 / 9)); }
html.cbt-lesson .cbt-video { margin-bottom: .5rem !important; }
html.cbt-lesson .cbt-video .card-body { padding: .4rem .75rem .6rem; }
html.cbt-lesson .cbt-fold-bar { margin-bottom: .5rem; padding: .35rem .9rem; }
@media (max-width: 640px) {
  html.cbt-lesson .page-body .card-body img { max-height: 26vh; }
  html.cbt-lesson .page-body .card-body { padding: .6rem .75rem; }
}
/* Picture beside the words: the picture takes a third, the words get the rest (fewer lines). */
@media (min-width: 768px) {
  html.cbt-lesson .page-body .card-body .row:has(> [class*=col-] > img-d) > [class*=col-]:has(> img-d):not(:has(p, h1, h2, h3, ul, table, .cbt-book)) { flex: 0 0 34%; max-width: 34%; }
  html.cbt-lesson .page-body .card-body .row:has(> [class*=col-] > img-d) > [class*=col-]:not(:has(> img-d)):has(p, h1, h2, h3, ul, table) { flex: 1 1 0; max-width: none; }
}
html.cbt-lesson .page-body app-text-to-speech + br, html.cbt-lesson .page-body app-text-to-speech + br + br { display: none; }
html.cbt-lesson .page-body app-text-to-speech audio { height: 40px; margin-bottom: .3rem; }
/* Forms: less space between the boxes; the red star sits beside its label */
html.cbt-lesson .page-body form { padding-top: .25rem !important; }
html.cbt-lesson .page-body form .mb-3 { margin-bottom: .45rem !important; position: relative; }
html.cbt-lesson .page-body form .mb-3 > div[style*="color: red"] { position: absolute; top: .1rem; inset-inline-end: 0; line-height: 1; }
html.cbt-lesson .page-body form .form-label { margin-bottom: .15rem; }
.cbt-form-nav svg, .cbt-scale-nav .cbt-arrow svg { width: 28px !important; height: 28px !important; }
@media (max-width: 640px) { .cbt-form-nav svg, .cbt-scale-nav .cbt-arrow svg { width: 22px !important; height: 22px !important; } }
/* "Your thought cycle" circle: fits the screen height */
html.cbt-lesson .page-body .circle { height: min(71vw, calc(100vh - 175px)) !important; width: min(75vw, calc((100vh - 175px) * 1.06)) !important; margin: 0 auto; }
html.cbt-lesson .page-body .circle .flow-text { width: min(20vw, 14rem) !important; max-width: min(20vw, 14rem) !important; font-size: min(1.5vw, 1.05rem) !important; margin-bottom: 6px; padding: 5px; }
html.cbt-lesson .page-body .circle i.ti { font-size: min(7vw, 2.6rem) !important; top: 6px !important; }
html.cbt-lesson .page-body h1 + br, html.cbt-lesson .page-body h1 + br + br { display: none; }
/* Long reading pages shown in parts; the side arrows move through the parts */
.cbt-scr-hide { display: none !important; }
.cbt-screens { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .35rem 0 .6rem; color: #0b5e5d; font-size: .95rem; }
.cbt-scr-dots { display: inline-flex; gap: 7px; }
.cbt-scr-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d6e6e3; cursor: pointer; }
.cbt-scr-dots i.on { background: #16857b; transform: scale(1.3); }
/* Lesson video beside the words on laptops; the video takes the picture's place */
.page-body > .container-xl.cbt-vid-side { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.page-body > .container-xl.cbt-vid-side > br { display: none; }
.page-body > .container-xl.cbt-vid-side > .cbt-video { max-width: none; margin: 0 !important; }
.page-body > .container-xl.cbt-vid-side > * { min-width: 0; }
.cbt-vid-side .card-body .row > [class*=col-]:has(> img-d):not(:has(p, h1, h2, h3, ul, table)) { display: none !important; }
.cbt-vid-side .card-body .row > [class*=col-]:not(:has(> img-d)) { flex: 1 1 100%; max-width: 100%; }
/* Story steps (problem solving): smaller words; the side arrows replace the down-arrow */
html.cbt-lesson .page-body .card1 .card-text, html.cbt-lesson .page-body .card1 .card-title { font-size: 1.3rem !important; line-height: 2.1; }
html.cbt-lesson .page-body .card1 .list-group, html.cbt-lesson .page-body .card1 table { font-size: 1.1rem !important; }
html.cbt-lesson .page-body .card1 .card-text1 { padding: .5rem 1rem !important; }
html.cbt-lesson .page-body .card1 { padding: 1rem 1.5rem !important; }
.page-body:has(.cbt-step-nav) .card1 .arrow { display: none; }
/* Pages with several pictures: smaller pictures */
html.cbt-lesson .page-body .card-body.cbt-many-img img { max-height: 24vh; }
/* Two pictures either side of the words: each picture a fifth */
@media (min-width: 768px) {
  html.cbt-lesson .page-body .card-body .row:has(> [class*=col-]:has(> img-d) ~ [class*=col-]:has(> img-d)) > [class*=col-]:has(> img-d):not(:has(p, h1, h2, h3, ul, table)) { flex: 0 0 20%; max-width: 20%; }
}
html.cbt-lesson .page-body .card-body .row > h1, html.cbt-lesson .page-body .card-body .row > h2 { flex: 0 0 100%; width: 100%; max-width: 100%; }
html.cbt-lesson .page-body .card-body .row > br { display: none; }
html.cbt-lesson .page-body .card-body h1[style*="2.5rem"] { font-size: 1.45rem !important; }
.page-body > .container-xl.cbt-vid-side > .cbt-video { grid-column: 1; grid-row: 1; }
.page-body > .container-xl.cbt-vid-side > .cbt-fold-bar { grid-column: 1; grid-row: 2; max-width: none; }
.page-body > .container-xl.cbt-vid-side > :not(.cbt-video):not(.cbt-fold-bar):not(br) { grid-column: 2; grid-row: 1 / span 3; }
html.cbt-lesson .page-body .card-body .row > [class*=col-]:not(:has(*)) { display: none; }
.cbt-scr-src { display: none !important; }
@media (max-width: 767px) {
  .page-body .card-body .row > .col:has(p, ul, h2, h3, table) { flex: 1 0 100%; }
}
@media (max-width: 640px) {
  html.cbt-lesson .page-body .card-body.cbt-many-img .row > [class*=col-]:has(> img-d):not(:has(p, h2, h3, ul)) { flex: 0 0 50%; max-width: 50%; }
  html.cbt-lesson .page-body .card-body.cbt-many-img img { max-height: 17vh; }
  html.cbt-lesson .page-body .card-body img { max-height: 22vh; }
}
.cbt-scr-empty { display: none !important; }
/* Phones: on a page with a lesson video, the video takes the picture's place */
@media (max-width: 991px) {
  html.cbt-lesson .page-body > .container-xl:has(> .cbt-video) .card-body [class*=col-]:has(> img-d):not(:has(p, h1, h2, h3, ul, table)) { display: none !important; }
}
html.cbt-lesson .cbt-sym img[alt=Symptoms] { max-height: calc(100vh - 210px); }
html.cbt-lesson .cbt-sym-badge { width: 2.7rem; height: 2.7rem; }
html.cbt-lesson .cbt-sym-badge i { font-size: 1.45rem !important; }
html.cbt-lesson .cbt-sym > .col-4:not(:has(img)) { gap: .15rem; }
html.cbt-lesson .cbt-sym > .col-4:not(:has(img)):has(> div:nth-child(5)) { display: grid !important; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; align-items: start; }
@media (max-width: 640px) {
  html.cbt-lesson .page-body .card-body:has(.cbt-book) [class*=col-]:has(> img-d):not(:has(.cbt-book, p)) { display: none !important; }
  .cbt-page { min-height: 220px; }
}

/* Problem solving: lesson / "your turn" tabs and write-in boxes (2026-12-02) */
.cbt-ps{margin-bottom:12px}
.cbt-ps-tabs{display:flex;gap:8px;justify-content:center;margin:0 0 14px}
.cbt-ps-tabs button{display:inline-flex;align-items:center;gap:6px;border:1.5px solid #cfe3e0;background:#fff;color:#2f5f5a;border-radius:999px;padding:6px 18px;font-size:1rem;font-weight:600;cursor:pointer;transition:all .15s}
.cbt-ps-tabs button:hover{border-color:#16857b}
.cbt-ps-tabs button.on{background:#16857b;border-color:#16857b;color:#fff;box-shadow:0 4px 10px rgba(22,133,123,.25)}
.cbt-ps-on > .cbt-ps-lesson{display:none!important}
.cbt-ps-work{max-width:860px;margin:0 auto}
.cbt-ps-steps{display:flex;gap:4px;justify-content:center;flex-wrap:wrap;margin-bottom:12px}
.cbt-ps-steps a{display:inline-flex;align-items:center;gap:5px;font-size:.82rem;color:#7a8b8a;padding:3px 10px 3px 4px;border-radius:999px;background:#f3f6f6;text-decoration:none}
html[dir=rtl] .cbt-ps-steps a{padding:3px 4px 3px 10px}
.cbt-ps-steps a b{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#dfe9e8;color:#4d6b68;font-size:.78rem}
.cbt-ps-steps a.past b{background:#4cc3a6;color:#fff}
.cbt-ps-steps a.on{background:#e3f3f1;color:#0b5e5d;font-weight:700}
.cbt-ps-steps a.on b{background:#16857b;color:#fff}
.cbt-ps-h{font-size:1.45rem;color:#0b5e5d;text-align:center;margin:4px 0 4px}
.cbt-ps-p{text-align:center;color:#4d6260;margin:0 0 12px}
.cbt-ps-p.small{font-size:.9rem;margin-top:6px}
.cbt-ps-sub{font-size:1.15rem;color:#0b5e5d;text-align:center;margin:16px 0 8px}
.cbt-ps-banner{background:#fff7e6;border:1.5px solid #f2d49b;border-radius:12px;padding:8px 14px;margin:0 0 12px;font-weight:600;color:#5a4a20}
.cbt-ps-banner span{color:#9a7a30;font-weight:500}
.cbt-ps-none{background:#f3f6f6;border-radius:12px;padding:14px;text-align:center;color:#4d6260}
.cbt-ps-box{width:100%;border:2px solid #23384a;border-radius:6px;background:#fff;padding:8px 10px;font:inherit;font-size:1rem;line-height:1.7;resize:none;overflow:hidden;min-height:44px;color:#1d273b}
.cbt-ps-box:focus{outline:none;border-color:#16857b;box-shadow:0 0 0 3px rgba(22,133,123,.18)}
.cbt-ps-box::placeholder{color:#9aa8a7}
.cbt-ps-boxes{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
.cbt-ps-boxes li{display:flex;align-items:flex-start;gap:8px}
.cbt-ps-boxes .num{flex:none;width:28px;height:28px;margin-top:8px;border-radius:50%;background:#e3f3f1;color:#0b5e5d;display:grid;place-items:center;font-weight:700;font-size:.9rem}
.cbt-ps-boxes li.on .cbt-ps-box{border-color:#e0a526;background:#fffaf0}
.cbt-ps-pick{flex:none;margin-top:4px;border:1.5px solid #e6d6ae;background:#fff;color:#9a7a30;border-radius:999px;padding:5px 12px;font-size:.9rem;cursor:pointer;white-space:nowrap}
.cbt-ps-boxes li.on .cbt-ps-pick{background:#e0a526;border-color:#e0a526;color:#fff;font-weight:600}
.cbt-ps-check{display:flex;flex-direction:column;gap:2px;margin-top:12px;background:#eef7f6;border-radius:12px;padding:10px 14px;font-size:.92rem;color:#2f5f5a}
.cbt-ps-weigh{display:flex;flex-direction:column;gap:14px}
.cbt-ps-sol-h{font-weight:700;font-size:1.05rem;color:#23384a;border-bottom:2px solid #23384a;padding-bottom:4px;margin-bottom:8px}
.cbt-ps-sol.on .cbt-ps-sol-h{color:#0b5e5d;border-color:#16857b}
.cbt-ps-sides{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.cbt-ps-side{display:flex;flex-direction:column;gap:4px;margin:0}
.cbt-ps-side > span{text-align:center;font-size:.9rem;color:#4d6260}
.cbt-ps-side .cbt-ps-box{min-height:64px}
.cbt-ps-side ul{margin:0;padding-inline-start:20px;font-size:.92rem}
.cbt-ps-choices{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.cbt-ps-choose{border:2px solid #cfe3e0;background:#fff;color:#2f5f5a;border-radius:12px;padding:8px 16px;font-size:1rem;cursor:pointer}
.cbt-ps-choose:hover{border-color:#16857b}
.cbt-ps-choose.on{background:#16857b;border-color:#16857b;color:#fff;font-weight:700}
.cbt-ps-plan{background:#eef7f6;border-radius:12px;padding:10px 14px;display:flex;flex-direction:column;gap:4px}
.cbt-ps-plan span{color:#4d6b68}
.cbt-ps-plan-h{font-weight:700;color:#0b5e5d}
.cbt-ps-when input{border:1.5px solid #cfe3e0;border-radius:8px;padding:2px 8px}
.cbt-ps-bar{position:relative;height:22px;background:#e8eeee;border-radius:999px;margin:12px 0 8px;overflow:hidden}
.cbt-ps-bar i{position:absolute;inset-block:0;inset-inline-start:0;background:linear-gradient(90deg,#4cc3a6,#16857b);border-radius:999px;transition:width .3s}
.cbt-ps-bar b{position:relative;direction:ltr;display:block;text-align:center;font-size:.8rem;line-height:22px;color:#14524c}
.cbt-ps-ticks{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.cbt-ps-ticks label{display:flex;align-items:center;gap:10px;border:2px solid #23384a;border-radius:6px;padding:8px 12px;cursor:pointer;margin:0;background:#fff}
.cbt-ps-ticks input{width:20px;height:20px;accent-color:#16857b;flex:none}
.cbt-ps-ticks li.done label{border-color:#4cc3a6;background:#f1fbf8}
.cbt-ps-ticks li.done .tx{text-decoration:line-through;color:#6d8a86}
.cbt-ps-yay{text-align:center;font-weight:700;color:#0b5e5d;margin-top:10px}
.cbt-ps-review{display:flex;flex-direction:column;gap:8px}
.cbt-ps-review label{margin:0;display:flex;flex-direction:column;gap:3px}
.cbt-ps-review span{font-size:.92rem;color:#4d6260}
.cbt-ps-ex{margin-top:14px;text-align:center}
.cbt-ps-ex-btn{border:1.5px dashed #9cc9c3;background:#f7fbfa;color:#2f5f5a;border-radius:999px;padding:5px 14px;font-size:.92rem;cursor:pointer}
.cbt-ps-ex-body{display:none;text-align:start;margin-top:8px;background:#fbfaf6;border:1px solid #ece6d4;border-radius:12px;padding:10px 14px}
.cbt-ps-ex.open .cbt-ps-ex-body{display:block}
.cbt-ps-exlist{margin:0;padding-inline-start:20px}
.cbt-ps-saved{text-align:center;font-size:.8rem;color:#8a9a98;margin:12px 0 0}
@media (max-width:640px){
  .cbt-ps-sides{grid-template-columns:1fr;gap:8px}
  .cbt-ps-h{font-size:1.2rem}
  .cbt-ps-steps a{font-size:.72rem}
  .cbt-ps-pick{padding:5px 8px}
}
/* problem solving intro / Munir: folded text card keeps only its arrows (2026-12-02) */
.cbt-fold-on .cbt-fold-shell{background:none!important;box-shadow:none!important;border:0!important;min-height:0}
.cbt-fold-on .cbt-fold-shell > .card-body{padding:0}
/* problem solving: pick-one step and "solve the next problem" (2026-12-02) */
.cbt-ps-choices.col{flex-direction:column;align-items:stretch;max-width:640px;margin:0 auto}
.cbt-ps-choices.col .cbt-ps-choose{display:flex;align-items:center;gap:10px;text-align:start;padding:12px 14px}
.cbt-ps-choices.col .cbt-ps-choose .num{flex:none;width:28px;height:28px;border-radius:50%;background:#e6f2f0;color:#16857b;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem}
.cbt-ps-choices.col .cbt-ps-choose .tx{flex:1}
.cbt-ps-choices.col .cbt-ps-choose em{flex:none;font-style:normal;font-size:.9rem;background:#e0a526;color:#fff;border-radius:999px;padding:3px 10px}
.cbt-ps-choices.col .cbt-ps-choose em.ok{background:#e6f2f0;color:#16857b}
.cbt-ps-choices.col .cbt-ps-choose.on{background:#fffaf0;border-color:#e0a526;color:#2f5f5a}
.cbt-ps-choices.col .cbt-ps-choose.on .num{background:#e0a526;color:#fff}
.cbt-ps-next .cbt-ps-choose em{background:#16857b}
.cbt-ps-next{margin-top:18px;padding-top:6px;border-top:1px dashed #cfe3e0}
.cbt-ps-tag{flex:none;margin-top:6px;font-size:.85rem;color:#16857b;background:#e6f2f0;border-radius:999px;padding:4px 10px;white-space:nowrap}
.cbt-ps-boxes li.solved .cbt-ps-box{color:#6b8f8a}

/* problem solving: one solution at a time, result page, tiny stairs (2026-12-02) */
/* step 4: slim advantage / disadvantage lists */
.cbt-ps-sol{border:1.5px solid #dfe9e8;border-radius:14px;padding:10px 12px;background:#fcfdfd}
.cbt-ps-sol-h{display:flex;justify-content:space-between;align-items:center;gap:8px;border:0;padding:0;margin-bottom:8px}
.cbt-ps-tally{flex:none;display:flex;gap:6px;font-size:.85rem}
.cbt-ps-tally i{font-style:normal;border-radius:999px;padding:1px 9px}
.cbt-ps-tally .a{background:#e3f6ef;color:#16765f}.cbt-ps-tally .d{background:#fdeceb;color:#a5443c}
.cbt-ps-side > span{font-weight:700}
.cbt-ps-side.pros > span{color:#16765f}.cbt-ps-side.cons > span{color:#a5443c}
.cbt-ps-mini{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.cbt-ps-mini li{display:flex;gap:6px;align-items:center}
.cbt-ps-mini .dot{flex:none;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-size:.75rem;font-weight:700}
.pros .cbt-ps-mini .dot{background:#e3f6ef;color:#16765f}.cons .cbt-ps-mini .dot{background:#fdeceb;color:#a5443c}
.cbt-ps-mini .cbt-ps-box{min-height:38px;padding:4px 10px;border-width:1.5px;border-radius:8px}
.pros .cbt-ps-box:focus{border-color:#16765f}.cons .cbt-ps-box:focus{border-color:#a5443c;box-shadow:0 0 0 3px rgba(165,68,60,.15)}
/* result page */
.cbt-ps-win{position:relative;text-align:center;padding:28px 10px 18px;overflow:hidden}
.cbt-ps-win .lab{color:#4d6260;margin:0}
.cbt-ps-win .big{font-family:"Noto Nastaliq Urdu",serif;font-size:clamp(1.8rem,6vw,2.8rem);line-height:2.1;color:#0b5e5d;margin:6px 0;display:inline-block;padding:4px 22px;border-radius:18px;background:linear-gradient(135deg,#fff7e0,#e6f6f2);box-shadow:0 0 0 3px #f1cf73,0 10px 30px rgba(224,165,38,.35);animation:cbtWinPop .9s cubic-bezier(.2,1.6,.4,1) both, cbtGlow 2.4s ease-in-out .9s infinite}
.cbt-ps-win .score{display:flex;gap:10px;justify-content:center;margin:10px 0}
.cbt-ps-win .score i{font-style:normal;border-radius:999px;padding:3px 14px;font-weight:700}
.cbt-ps-win .score .a{background:#e3f6ef;color:#16765f}.cbt-ps-win .score .d{background:#fdeceb;color:#a5443c}
.cbt-ps-win .go{font-family:"Noto Nastaliq Urdu",serif;font-size:1.3rem;color:#16857b;margin:14px 0 0;animation:cbtRise .6s ease 1s both}
.cbt-ps-win .star{position:absolute;left:50%;top:45%;font-size:1.3rem;opacity:0;animation:cbtBurst 1.6s ease-out var(--dl) both}
@keyframes cbtWinPop{0%{transform:scale(.3);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes cbtGlow{50%{box-shadow:0 0 0 3px #f1cf73,0 10px 40px rgba(224,165,38,.6)}}
@keyframes cbtRise{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}
@keyframes cbtBurst{0%{transform:translate(-50%,-50%) scale(.2);opacity:1}80%{opacity:1}100%{transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(1) rotate(var(--r));opacity:0}}
.cbt-ps-retry{text-align:center;padding:16px 8px}
.cbt-ps-retry .big{font-size:2.4rem}
.cbt-ps-btn{border:0;background:#16857b;color:#fff;border-radius:999px;padding:8px 20px;font:inherit;font-weight:700;cursor:pointer;margin-top:8px}
/* step 5: stairs */
.cbt-ps-stairs{display:block;width:120px;max-width:100%;height:auto;margin:0 auto}
.cbt-ps-stairs .walker{animation:cbtClimb 6s steps(1) infinite}
.cbt-ps-stairs .legs{transform-origin:0 -6px;animation:cbtStride .5s ease-in-out infinite alternate}
.cbt-ps-stairs .flag{transform-origin:310px 30px;animation:cbtWave 1.2s ease-in-out infinite alternate}
@keyframes cbtStride{from{transform:skewX(-14deg)}to{transform:skewX(14deg)}}
@keyframes cbtWave{from{transform:skewY(-6deg)}to{transform:skewY(6deg)}}
@media (prefers-reduced-motion:reduce){.cbt-ps-win .big,.cbt-ps-win .go,.cbt-ps-win .star,.cbt-ps-stairs *{animation:none!important;opacity:1}}
.cbt-ps-retry .cbt-ps-tally{margin-inline-start:auto}
