/* PoC additions on top of the live platform stylesheet (live/live.css).
   Everything the live CSS already styles - header, subject bar, cards, panels, footer -
   is NOT repeated here. These rules cover: the sign-in card, PoC badges, the
   expand-in-place transition (agreed 19 Oct 2026), and the subcategory, scheme and lesson
   pages, which keep the PoC's own layout until they are ported to the live markup. */
/* Layout: fixed purple top bar + subject button strip, centred 1320px content column, card blocks per section (as platform.imoves.com) */
:root {
  --purple: #733088; --mid-purple: #9565a6; --light-purple: #DBCBE1; --xlight-purple: #e4d8e9; --ultra-purple: #ece3ef;
  --pink: #F65275; --blue: #0085CA; --orange: #F68D2E; --green: #198754; --white: #fff; --text: #2b2130; --muted: #7a6a80;
  --font: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --shadow: 0 .5rem 1.5rem rgba(60,20,80,.12); --shadow-sm: 0 .2rem .6rem rgba(60,20,80,.08); --radius: 10px; --radius-sm: 8px; --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } body { scroll-behavior: auto; } }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.light { font-weight: 400; }
.hidden { display: none !important; }

#app.reveal { animation: reveal .28s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* top bar */

/* page blocks */
.badge.purple { background: var(--purple); }

/* subject page */

/* scheme card and lesson rows */
/* expandable lesson (category page) */

/* lesson page */

/* age strip: one pill per year 4-11, lit for the ages covered */
.sh .ages b { background: rgba(255,255,255,.18); color: rgba(255,255,255,.55); }
.sh .ages b.on { background: #fff; color: var(--purple); }

/* age switch on merged resource cards */
.agerow { display: flex; justify-content: flex-start; align-items: center; padding: 0 1rem .5rem; flex-wrap: wrap; }
.agerow + .lessons { padding-top: .25rem; }
.agerow + .lmini { padding-top: .25rem; }
.sh .agesw { background: rgba(255,255,255,.18); border: 0; box-shadow: none; }
#classage { appearance: none; -webkit-appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px; }
#classage option { color: var(--text); }

/* search & browse */
.searchbar { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.searchbar input { flex: 1; font: inherit; font-size: 1.15rem; padding: .65rem 1.1rem; border: 2px solid var(--light-purple); border-radius: 999px; background: #fff; min-height: 48px; }
.searchbar input:focus { border-color: var(--purple); outline: none; }
.browse { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.browse .block { margin-bottom: 0; }
.browse ul { list-style: none; margin: 0 0 .75rem; padding: 0; }
.browse li { padding: .15rem 0; }
.browse li.sg { font-weight: 600; color: var(--purple); margin-top: .5rem; }
.browse li a { font-weight: 400; }

.notice { background: #fff; border-left: 5px solid var(--orange); padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 400; box-shadow: var(--shadow-sm); }
.loading { text-align: center; padding: 4rem 1rem; color: var(--mid-purple); font-weight: 500; }
.loading::before { content: ''; display: block; width: 44px; height: 44px; margin: 0 auto 1rem; border-radius: 50%; border: 4px solid var(--light-purple); border-top-color: var(--purple); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.collapse-btn { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; font-size: 1.2rem; }
.poc { font-size: .75rem; background: var(--pink); color: #fff; border-radius: 4px; padding: .05rem .4rem; margin-left: .4rem; vertical-align: middle; }

/* sign-in (Phase 1) */
body.signed-out nav a.nbtn, body.signed-out #classage { display: none; }
.userchip { display: inline-flex; align-items: center; gap: .45rem; color: #fff; font-weight: 600; padding: .4rem .6rem; min-height: 40px; }
.userchip i { font-size: 1.2rem; }
#usernav { display: inline-flex; gap: .4rem; align-items: center; }
.login-wrap { display: flex; justify-content: center; padding: 7vh 0 3rem; }
.login-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--light-purple); padding: 2rem 2.2rem 1.4rem; width: 100%; max-width: 430px; display: flex; flex-direction: column; animation: reveal .28s var(--ease); }
.login-card .login-logo { height: 46px; align-self: center; margin-bottom: 1rem; background: linear-gradient(180deg, #8a46a0, var(--purple)); border-radius: var(--radius-sm); padding: .6rem 1.1rem; box-sizing: content-box; }
.login-card h1 { color: var(--purple); font-size: 1.6rem; text-align: center; margin-bottom: .25rem; }
.login-card > p { text-align: center; }
.login-card label { font-weight: 600; color: var(--purple); margin: .6rem 0 .25rem; }
.login-card input { font: inherit; font-size: 1.05rem; padding: .6rem .9rem; border: 2px solid var(--light-purple); border-radius: var(--radius-sm); background: #fff; min-height: 48px; }
.login-card input:focus { border-color: var(--purple); outline: none; }
.login-card .btn { justify-content: center; margin-top: 1.1rem; }
.login-card .btn:disabled { opacity: .6; }
.login-card .notice { margin: .4rem 0 .2rem; }
.login-card .small { font-size: .85rem; margin: 1rem 0 0; text-align: center; }
/* v0.77: the version switch - a small, quiet control under the password (it replaced the large v0.73 switch) */
.login-card .forgot { margin-top: .3rem; }
.version-switch { display: flex; align-items: center; justify-content: flex-start; gap: .4rem; margin: .7rem 0 0; font-size: .8rem; color: #8a7d90; }
.version-switch .vs-label { cursor: pointer; user-select: none; }
.version-switch #vs-new { color: var(--purple); font-weight: 600; }
.login-card.legacy .version-switch #vs-new { color: #8a7d90; font-weight: 400; }
.login-card.legacy .version-switch #vs-old { color: #2b2130; font-weight: 600; }
#versionswitch { position: relative; width: 34px; height: 20px; padding: 0; border: 0; border-radius: 999px; background: var(--light-purple); cursor: pointer; flex: none; transition: background .18s var(--ease); }
#versionswitch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
#versionswitch[aria-checked="true"] { background: #8a7d90; }
#versionswitch[aria-checked="true"] span { transform: translateX(14px); }
#versionswitch:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.login-card input:disabled { background: #f4f1f5; color: #8a7d90; }
.login-card #legacynote { margin: .5rem 0 0; }
.version-info { position: relative; display: inline-flex; }
.version-info button { font: inherit; font-size: .95rem; line-height: 1; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: #8a7d90; cursor: pointer; transition: background .18s var(--ease); }
.version-info button:hover, .version-info button[aria-expanded="true"] { background: var(--ultra-purple); color: var(--purple); }
.version-info button:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.version-info [role="tooltip"] { position: absolute; left: -110px; top: calc(100% + 8px); width: min(260px, 72vw); background: #2b2130; color: #fff; font-size: .85rem; font-weight: 400; line-height: 1.35; text-align: left; padding: .6rem .75rem; border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 30; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s; pointer-events: none; }
.version-info [role="tooltip"]::before { content: ''; position: absolute; left: 115px; bottom: 100%; border: 7px solid transparent; border-bottom-color: #2b2130; }
.version-info button:hover + [role="tooltip"], .version-info button:focus-visible + [role="tooltip"], .version-info button[aria-expanded="true"] + [role="tooltip"] { opacity: 1; visibility: visible; transform: none; }

/* per-user context strip, locked lessons, sticky banner (Phase 1 increment 2) */
.userctx { display: inline-flex; flex-direction: column; line-height: 1.25; margin-right: .5rem; max-width: 30%; }
.ctx-school { font-weight: 700; color: #fff; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-class { color: var(--light-purple); font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.signed-out .userctx { display: none; }
#stickybanner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: .7rem max(16px, env(safe-area-inset-left)); text-align: center; font-weight: 600; background: var(--purple); color: #fff; border-top: 3px solid var(--orange); box-shadow: 0 -2px 12px rgba(60,20,80,.25); }
body:has(#stickybanner:not(.hidden)) footer { padding-bottom: 4.5rem; }


/* ---------- v0.25: live shell additions ---------- */
body.with-bg-img { background-repeat: no-repeat; background-position: center 50px; background-size: cover; background-attachment: fixed; }
body.with-bg-img .main-content, body.with-bg-img .footer-brush-container, body.with-bg-img .brush-container, body.with-bg-img .non-niched-header, body.with-bg-img .navbar-subjects { background: transparent !important; }
#app .main-content { background: var(--light-purple); }
.poc-badge { position: absolute; left: 50%; transform: translateX(-50%); top: 2px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap; z-index: 20; }
/* v0.74: the badge is now the "Switch to previous version" link */
a.poc-badge { font-size: 11px; padding: 4px 10px; text-decoration: none; transition: background .18s var(--ease), box-shadow .18s var(--ease); }
a.poc-badge:hover, a.poc-badge:focus-visible { color: #fff; text-decoration: underline; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
body.signed-out a.poc-badge { display: none; }   /* the sign-in card has its own switch */
/* v0.77: on a wide screen the link sits level with the middle of the header, not against its top edge */
.main-nav { position: relative; }
@media (min-width: 1200px) { a.poc-badge { top: 50%; transform: translate(-50%, -50%); font-size: 12px; padding: 5px 12px; } }
.poc-foot { font-size: 11px; opacity: .8; margin-top: .25rem; }
.badge.passcode { background: var(--orange); color: #2b2130; font-size: 11px; vertical-align: middle; margin-left: .4rem; }
#scrollable-navbar .subject-button.active { outline: 2px solid #fff; outline-offset: -2px; }
#scrollable-navbar .subject-button .button-text { text-decoration: none; }
#scrollable-navbar .subject-button.active .button-text { text-decoration: underline; }
main { padding-bottom: 2rem; }
/* v0.32: no page reveal animation - the live site has none (the sign-in card keeps its own) */
.collapse-smooth { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .32s var(--ease), opacity .25s; opacity: 1; }
.collapse-smooth > div { min-height: 0; overflow: hidden; }
.collapse-smooth.closed { grid-template-rows: 0fr; opacity: 0; }
.card-img-top { aspect-ratio: 16/9; object-fit: cover; background: var(--ultra-purple); }
.btn-outline-secondary { --bs-btn-hover-color: var(--purple); }
.dropdown-menu.show { display: block; }
.wistia-ratio { position: relative; padding: 56.25% 0 0 0; }
.wistia-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
body.signed-out #subjectnav, body.signed-out #headerfilter, body.signed-out #search-toolbar, body.signed-out #userctx { display: none !important; }
.loading { padding: 3rem; text-align: center; color: var(--mid-purple); }

/* ---------- v0.25.1 home page fixes ---------- */
.navbar-logo img { box-shadow: none; outline: none; border: 0; background: none; }
.navbar .navbar-logo.uncollapsed { width: 140px; }
/* Live: single row, scrolls sideways below lg with round arrow buttons (nav-scroll.js). */
#scrollable-navbar { overflow-x: auto; scrollbar-width: none; }
#scrollable-navbar::-webkit-scrollbar { display: none; }
.navbar-subjects .scroll-button i { font-size: 30px; opacity: .5; }
#headerfilter .form-select option { color: var(--mid-purple); }
#headerfilter .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 16px 12px; padding-right: 2.25rem; appearance: none; }
.navbar .btn-outline-secondary { border-radius: var(--bs-border-radius); }
#scrollable-navbar .subject-button .button-text { white-space: nowrap; }
.user-dropdown .dropdown-menu.show { position: absolute; right: 0; left: auto; }
.navbar-actions { position: relative; }

/* ---------- v0.26: category, scheme and lesson pages ---------- */
.lesson-drawer > div > .lesson-inline { margin-top: -.25rem; }
.lesson-x .lesson-row[aria-expanded="true"] { background-color: var(--ultra-purple); }
.age-switch .btn { font-size: .8rem; }
.lesson-part-item .part-head { cursor: pointer; }
.lesson-part-item[data-part] { display: block; }
.scheme-card .variant[hidden] { display: none; }
.videobox .wistia-ratio, .wistia-ratio { position: relative; padding: 56.25% 0 0 0; }
.wistia-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* v0.31 drag-to-reorder (SortableJS ghost look) */
.dnd-ghost { opacity: 0.4; }
#cur-tabs .nav-item.handle { cursor: grab; }

/* v0.39 slide player (replaces the Google Slides iframe for captured decks) */
.slide-player { position: relative; background: #111; border-radius: 4px; outline: none; user-select: none; }
.slide-player:focus-visible { box-shadow: 0 0 0 3px rgba(115, 48, 136, .5); }
.slide-stage { position: relative; width: 100%; background: #000; overflow: hidden; cursor: pointer; }
.slide-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.slide-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide-player.pen-on .slide-stage { cursor: crosshair; }
.slide-player.laser-on .slide-stage { cursor: none; }
.slide-laser { display: none; position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: rgba(255, 0, 0, .85); box-shadow: 0 0 12px 4px rgba(255, 0, 0, .55); pointer-events: none; }
.slide-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #212529; color: #fff; flex-wrap: wrap; }
.slide-bar .sp-gap { flex: 1; }
.slide-bar .sp-counter { min-width: 64px; text-align: center; font-size: .9rem; }
.sp-btn { background: transparent; border: 0; color: #fff; width: 34px; height: 34px; border-radius: 4px; font-size: 1.05rem; line-height: 1; }
.sp-btn:hover { background: rgba(255, 255, 255, .12); }
.sp-btn.active { background: #733088; }
.sp-colours { display: inline-flex; gap: 4px; margin: 0 4px; }
.sp-colour { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.sp-colour.active { border-color: #fff; }
.slide-player.is-full { display: flex; flex-direction: column; width: 100vw; height: 100vh; border-radius: 0; }
.slide-player.is-full .slide-stage { flex: 1; padding-top: 0 !important; }
.slide-player.is-full .slide-bar { flex: none; }

/* lesson blocks (v0.44.3): the lesson plan, Printables and parts blocks share one frame -
   2px purple border, the card radius, one shadow, purple row dividers - and document rows
   reuse the parts rows' markup so heights, icons and titles line up. */
.lesson-docs { display: flex; flex-direction: column; gap: .75rem; }
.lesson-docs:not(:empty) { margin-bottom: .75rem; }
.lesson-block { background: var(--white); border: 2px solid var(--purple); border-radius: var(--bs-card-border-radius, 5px); box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1); overflow: hidden; }
.lesson-block > .list-group-item { border-left: 0; border-right: 0; border-top: 1px solid var(--xlight-purple); border-bottom: 0; }
.lesson-block > .list-group-item:first-child, .doc-printables-head + .list-group-item { border-top: 0; }
.doc-printables-head { background: var(--ultra-purple); color: var(--purple); font-weight: 600; font-size: .95rem; padding: .5rem 1rem; display: flex; align-items: center; }
.doc-row { position: relative; }
.doc-row .part-head { cursor: pointer; }
.doc-row:hover { background-color: var(--ultra-purple); }
.doc-row:hover .part-head > .col > div:first-child i { transform: translateX(2px); }
@media (min-width: 768px) { .doc-row .part-head { min-height: 4.3rem; } }   /* = a parts row with its duration and Part x of y lines (md up; below md those lines are hidden) */
.doc-row .btn { white-space: nowrap; }

/* ---------- v0.45 polish pass (2-3 Nov 2026) ----------
   No wording or structure changes. One consistent set of touches for everything clickable,
   matched to the lift the live site already gives its resource cards (.lift: -3px, .25s):
   buttons lift 1px and press down; rows tint and their icon nudges; subject and nav buttons
   lift; links and icons ease their colour; chevrons turn. All off under reduce-motion
   (global rule at the top). Line thickness and dividers unified on the purple tint. */
:root { --fx: .18s var(--ease); --lift-shadow: 0 .5rem 1rem rgba(0,0,0,.15); }

/* buttons: every .btn except close crosses, slide-player controls and disabled ones */
.btn:not(.btn-close):not(.sp-btn):not(.sp-colour) { transition: transform var(--fx), box-shadow var(--fx), background-color .15s ease-in-out, border-color .15s ease-in-out, color .15s ease-in-out; }
.btn:not(.btn-close):not(.sp-btn):not(.sp-colour):not(:disabled):not(.disabled):hover { transform: translateY(-1px); box-shadow: var(--lift-shadow) !important; }
.btn:not(.btn-close):not(.sp-btn):not(.sp-colour):not(:disabled):not(.disabled):active { transform: translateY(0) scale(.98); box-shadow: 0 .125rem .25rem rgba(0,0,0,.1) !important; transition-duration: .06s; }

/* subject bar and header nav buttons */
#scrollable-navbar .subject-button { transition: transform var(--fx), box-shadow var(--fx), filter var(--fx); }
#scrollable-navbar .subject-button:hover { transform: translateY(-1px); box-shadow: 0 .35rem .8rem rgba(0,0,0,.2); filter: brightness(1.06); }
#scrollable-navbar .subject-button:active { transform: translateY(0); filter: brightness(.97); transition-duration: .06s; }
.navbar-subjects .scroll-button { transition: opacity var(--fx); }
.navbar-subjects .scroll-button:hover i { opacity: .9; }

/* rows that expand or open (lesson rows on category pages, parts, documents): tint eases in,
   the leading icon nudges right, the whole row never jumps */
.list-group-item-action, .lesson-part-item, .lesson-row { transition: background-color .15s ease-in-out, border-color .15s ease-in-out; }
.lesson-row > .row > .col > div:first-child i, .part-head > .col > div:first-child i { transition: transform var(--fx), color .15s ease-in-out; display: inline-block; }
.lesson-row:hover > .row > .col > div:first-child i, .lesson-part-item .part-head:hover > .col > div:first-child i { transform: translateX(2px); }

/* lesson row action icons (done, favourite, curriculum): grow slightly under the pointer */
.lesson-icon.cursor-pointer i, [data-fav-for] i, [data-done-for] i, .curriculum-btn i { transition: transform var(--fx), color .15s ease-in-out; display: inline-block; }
.lesson-icon.cursor-pointer:hover i, .btn[data-fav-for]:hover i, .curriculum-btn:hover i { transform: scale(1.18); }
.lesson-icon.cursor-pointer:active i { transform: scale(1); transition-duration: .06s; }

/* panel chevrons (Main Homepage, subject groups, curriculum groups) turn instead of swapping glyphs */
.subgroup-collapse { transition: transform var(--fx); }
.subgroup-collapse::after, .subgroup-collapse.collapsed::after { content: "\25BC"; display: inline-block; transition: transform .25s var(--ease); }
.subgroup-collapse.collapsed::after { transform: rotate(90deg); }   /* points left, as the live glyph does */

/* links: colour and underline ease rather than snap; breadcrumb and footer included */
a { transition: color .15s ease-in-out, text-decoration-color .15s ease-in-out; }
.breadcrumb-item a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* cards the live site lifts (.lift) keep that; cards without it that are links get the same */
a > .card.subcategory-card:not(.lift) { transition: box-shadow .25s ease, transform .25s ease; }
a > .card.subcategory-card:not(.lift):hover { transform: translate3d(0, -3px, 0); }
.card.subcategory-card .card-img-top { transition: transform .35s var(--ease); }
.card.subcategory-card { overflow: hidden; }
.lift:hover .card-img-top, a > .card.subcategory-card:hover .card-img-top { transform: scale(1.03); }

/* dividers and borders on one tint: 1px xlight-purple between rows, purple frames around blocks */
.scheme-card .list-group-item, .card .list-group-flush > .list-group-item { border-color: var(--xlight-purple); }

/* images: lazy thumbnails fade in once loaded instead of popping (class set by app.js) */
img.fx-wait { opacity: 0; }
img.fx-in { opacity: 1; transition: opacity .3s ease-out; }

/* phone: the Thumb-o-meter row keeps its link on one line, centred under the button */
@media (max-width: 991.98px) {
  #past-readings { white-space: nowrap; }
  .d-lg-none.px-2.mb-3.row > .col:has(#past-readings) { justify-content: center; }
}

/* form controls: a soft purple focus ring everywhere, matching the sign-in fields */
.form-control:focus, .form-select:focus { border-color: var(--mid-purple); box-shadow: 0 0 0 .2rem rgba(115, 48, 136, .15); }

/* v0.45.2-3 phone alignment: the age filter's label lines up with the Browse button and the
   cards (the nested live row adds a gutter); menu items ease their tint. Mobile resource cards
   with nothing under the title drop their empty body in app.js (subcatCard). */
@media (max-width: 575.98px) { #agefilter > label.col { margin-left: 0; padding-left: 0; text-align: left; } #agefilter { margin-left: 0; } }
.dropdown-item { transition: background-color .15s ease-in-out, color .15s ease-in-out; }

/* ---------- v0.45.4 expanded lesson on the category page: one block, one owner ----------
   David (2 Nov, evening): with a lesson open it was not obvious that the text, documents
   and parts below belonged to it. Now the open row becomes the block's header (purple,
   white text) and the drawer continues it inside the same 2px purple frame, on the
   ultra-light tint, with the inner blocks stepped down to a 1px mid-purple line. */
.lesson-x.open { border: 2px solid var(--purple); border-bottom: 0; border-radius: var(--bs-card-border-radius, 5px) var(--bs-card-border-radius, 5px) 0 0; margin-bottom: 0 !important; overflow: hidden; }
.lesson-x.open > .list-group-item { border-left: 0; border-right: 0; border-top: 0; }
.lesson-x.open .lesson-row, .lesson-x.open .lesson-row:hover { background-color: var(--purple) !important; color: #fff; }
.lesson-x.open .lesson-row .text-primary, .lesson-x.open .lesson-row .text-purple, .lesson-x.open .lesson-row .text-mid-purple, .lesson-x.open .lesson-row h5 { color: #fff !important; }
.lesson-x.open .lesson-row .fw-light { color: var(--light-purple) !important; }
.lesson-x.open + .lesson-drawer > div > .lesson-inline { margin-top: 0; border: 2px solid var(--purple) !important; border-top: 0 !important; border-radius: 0 0 var(--bs-card-border-radius, 5px) var(--bs-card-border-radius, 5px); background: var(--ultra-purple); }
.lesson-inline .lesson-block { border-width: 1px; border-color: var(--mid-purple); box-shadow: 0 .25rem .75rem rgba(0,0,0,.08); }
.lesson-inline .lesson-block .list-group-item.active-part, .lesson-inline .lesson-collapse.active { border-color: var(--xlight-purple) !important; }

/* v0.45.6 phone: the open lesson's header bar runs the full width of the frame (the icon
   column has nothing to show below md, so it is hidden there) */
@media (max-width: 767.98px) { .lesson-x.open > .list-group-item + .list-group-item { display: none; } }

/* ---------- v0.46 / v0.47.3 age switch (David, 3 Nov 2026) ----------
   Desktop: the switch sits at the right of the scheme header with a clear gap from the name.
   Phone: "Ages:" once, then the ranges as equal buttons on their own row under the name. */
.age-switch-wrap { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; margin-left: 1rem; }
.age-switch-lbl { color: #fff; font-weight: 500; font-size: var(--fs-s); white-space: nowrap; }
@media (max-width: 767.98px) {
  .scheme-card .card-header > .col.has-age-switch { flex-wrap: wrap; }
  .age-switch-wrap { flex: 1 1 100%; margin-left: 0; margin-top: .5rem; }
  .age-switch-wrap .age-switch { flex: 1 1 auto; display: flex; }
  .age-switch-wrap .age-switch .btn { flex: 1 1 0; padding-left: .3rem; padding-right: .3rem; white-space: nowrap; min-width: 0; }
  .age-pre { display: none; }
}
/* Phone category cards (v0.46.4, v0.47): one plain white card per category - title, subtext,
   meta - no thumbnail (it only repeated the title), no internal divider, a chevron centred on
   the card to show it opens. TEMPORARY WORKAROUND alongside WORD_TILE_IMAGES in app.js. */
@media (max-width: 767.98px) {
  .subcategory-card.d-md-none { position: relative; padding: .15rem 2.2rem .7rem 0; border: 1px solid var(--mid-purple); }
  .subcategory-card.d-md-none::after { content: "\F285"; font-family: "bootstrap-icons"; position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--mid-purple); font-size: .9rem; line-height: 1; }
  .subcategory-card.d-md-none > .border-bottom { border-bottom: 0 !important; }
  .subcategory-card.d-md-none > .border-bottom > .row > .col-5 { display: none; }
  .subcategory-card.d-md-none > .border-bottom > .row > .col-7 { flex: 0 0 100%; max-width: 100%; margin-left: 0 !important; padding: 0 0 0 calc(1rem + 11px); }
  .subcategory-card.d-md-none > .border-bottom > .row > .col-7 .card-title { margin: .55rem 0 0 !important; }
  .subcategory-card.d-md-none > .card-body > div > .pt-3 { padding-top: 0 !important; }
  .subcategory-card.d-md-none .subcategory-card--subheading { margin: .15rem 1rem 0 !important; }
  .subcategory-card.d-md-none .subcategory-card--subheading:empty { display: none; }
  .subcategory-card.d-md-none .card-body ul { margin: .25rem .5rem 0; justify-content: flex-start !important; }
  .subcategory-card.d-md-none .card-body ul:empty { display: none; }
  .subcategory-card.d-md-none .card-body li { padding: 0 .5rem; flex: 0 0 auto !important; }
  .subcategory-card.d-md-none:active { background: var(--ultra-purple); }
  .card-body > .row > [class*="col-"]:has(> a > .subcategory-card.d-md-none) { margin-bottom: .6rem !important; }
  .card-body.pb-1:has(.subcategory-card.d-md-none) { padding-bottom: .4rem !important; }
}
.subcategory-card.tile-only { padding-bottom: 0; }   /* word tile with nothing under it: no empty body, no ledge */

/* ---------- v0.47 type scale (David, 3 Nov 2026) ----------
   One typeface (BalooPrimary: 300 light, 500 semi-bold, 700 bold) at five sizes, applied
   everywhere so panel headers, titles, body, secondary and meta text look the same on every
   page. Form controls inherit the typeface (the age select was in the system font). */
:root { --fs-h: 1.25rem; --fs-t: 1.125rem; --fs-b: 1rem; --fs-s: .875rem; --fs-m: .75rem; }
@media (max-width: 575.98px) { :root { --fs-h: 1.125rem; --fs-t: 1.0625rem; } }
select, input, textarea, button, .form-select, .form-control { font-family: "BalooPrimary", sans-serif !important; }   /* v0.48.1: the live sheet sets Arial on form controls */
.form-select { font-size: var(--fs-b); font-weight: 300; }
/* panel and scheme headers */
.card-header, h5.card-header, .card-header > div, .card-header h5, .card-header .h5 { font-size: var(--fs-h); font-weight: 500; line-height: 1.25; }
.card-header small, .card-header .i-small, .card-header .text-white-50, .card-header span.fw-light { font-size: var(--fs-s); font-weight: 300; }
/* row and card titles */
.lesson-row h5, .part-head h5, .doc-row h5, .subcategory-card .card-title, .subcategory-card .h5, .lesson-inline h5, #lessonPage h5:not(.card-header) { font-size: var(--fs-t); font-weight: 500; line-height: 1.25; }
.lesson-row h5 .badge, .part-head h5 .badge { font-size: var(--fs-m); }
/* body text */
p.card-text, .card-text, .card-body p, .lesson-inline .media-body, .media-body p, .card-text.lead, .lead { font-size: var(--fs-b); font-weight: 300; line-height: 1.5; }
.card-body p.h6 { font-size: var(--fs-b); }
/* secondary: subtext under titles, descriptions on rows, labels, breadcrumbs, printables head */
.subcategory-card--subheading, .lesson-row .fw-light, label.fw-light, #agefilter label, .breadcrumb, .breadcrumb-item, .doc-printables-head, .notice { font-size: var(--fs-s); }
.subcategory-card--subheading, .lesson-row .fw-light, label.fw-light, #agefilter label, .breadcrumb-item { font-weight: 300; }
.doc-printables-head { font-weight: 500; }
/* meta: counts, durations, Part x of y, badges, footer */
.subcategory-card li, .subcategory-card .small, .lesson-icon, .part-head small, .part-head .lesson-icon, small.text-mid-purple, .badge, .scheme-badge .badge, footer, footer .text-1, footer .text-md, .poc-foot { font-size: var(--fs-m); }
.subcategory-card li, .lesson-icon, .part-head small, footer, footer .text-1 { font-weight: 300; }
/* buttons */
.btn { font-size: var(--fs-b); font-weight: 500; }
.btn-sm, .btn-group-sm > .btn { font-size: var(--fs-s); }
.subject-button .button-text { font-weight: 500; }

/* ---------- v0.48 phone menu drawer (David, 3 Nov 2026) ----------
 Below md: Search, Menu, Browse and the age filter fold into one drawer from a hamburger at
 the top right. The header keeps the logo and the hamburger; an age chip under the header
 shows (and clears) an active filter. md and up are unchanged. */
.m-burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: transparent; border: 1.5px solid rgba(255,255,255,.85); border-radius: var(--bs-border-radius, 5px); cursor: pointer; }
.m-burger span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform var(--fx), opacity var(--fx); }
.m-burger:active { transform: scale(.96); }
.m-drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(43,33,48,.45); z-index: 1060; opacity: 0; transition: opacity .25s ease; }
.m-drawer-backdrop.show { opacity: 1; }
.m-drawer-backdrop[hidden] { display: none; }
.m-drawer { display: flex; flex-direction: column; gap: .75rem; position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); z-index: 1061; background: var(--ultra-purple); box-shadow: -.5rem 0 1.5rem rgba(0,0,0,.2); padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)); overflow-y: auto; transform: translateX(100%); transition: transform .28s var(--ease); visibility: hidden; }
.m-drawer.open { transform: none; visibility: visible; }
body.m-drawer-open { overflow: hidden; }
.m-drawer-head { display: flex; align-items: center; gap: .5rem; margin: 0 -1rem; padding: calc(.75rem + env(safe-area-inset-top)) 1rem .75rem; background: var(--purple); color: #fff; }
.m-drawer-ctx { flex: 1 1 auto; min-width: 0; font-size: var(--fs-s); font-weight: 500; line-height: 1.3; }
.m-drawer-ctx .text-light-purple, .m-drawer-ctx a { color: var(--light-purple) !important; font-weight: 300; display: block; }
.m-drawer-close { flex: 0 0 auto; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; font-size: 1.1rem; border-radius: var(--bs-border-radius, 5px); }
.m-drawer-search { position: relative; margin-top: .25rem; }
.m-drawer-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--mid-purple); }
.m-drawer-search input { width: 100%; font: inherit; font-size: var(--fs-b); font-weight: 300; padding: .6rem .9rem .6rem 2.4rem; min-height: 46px; border: 1px solid var(--mid-purple); border-radius: var(--bs-border-radius, 5px); background: #fff; color: var(--text); }
.m-drawer-search input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 .2rem rgba(115, 48, 136, .15); }
.m-drawer-label { font-size: var(--fs-s); font-weight: 500; color: var(--purple); margin: .25rem 0 -.4rem; }
.m-drawer-select { min-height: 46px; color: var(--purple); border-color: var(--mid-purple); }
.m-drawer-browse { min-height: 46px; }
.m-drawer-nav { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--mid-purple); border-radius: var(--bs-border-radius, 5px); overflow: hidden; margin-top: .25rem; }
.m-drawer-nav hr { margin: 0; border: 0; border-top: 1px solid var(--xlight-purple); opacity: 1; }
.m-drawer-item { display: block; width: 100%; text-align: left; padding: .7rem 1rem; font-size: var(--fs-b); font-weight: 500; color: var(--purple); background: #fff; border: 0; text-decoration: none; transition: background-color .15s ease-in-out; }
.m-drawer-item:active, .m-drawer-item:hover { background: var(--ultra-purple); color: var(--purple); text-decoration: none; }
.m-drawer-item + .m-drawer-item { border-top: 1px solid var(--xlight-purple); }
.m-agechip-wrap { display: block; padding-top: .75rem; }
.m-agechip-wrap.hidden { display: none; }
.m-agechip { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; font: inherit; font-size: var(--fs-s); font-weight: 500; color: #fff; background: var(--purple); border: 0; border-radius: 999px; box-shadow: var(--shadow-sm); }
.m-agechip i { font-size: .7rem; opacity: .85; }


/* ---------- v0.50 desktop header layout (David, 3 Nov 2026) ----------
   md and up, two rows on one grid:
     row 1: logo (the height of the school and class name line) | school and class name
     row 2: slogan (on the button row, the buttons' height)     | age filter + nav buttons
   The age filter has no text label (the select's options say what it does; it keeps its
   aria-label). Breakpoints are this theme's own: md 768px, lg 1280px. */
@media (min-width: 768px) {
  .main-nav > .container > .row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "logo ctx" "slogan tools"; column-gap: 1.5rem; row-gap: .35rem; align-items: center; margin: 0; }
  .main-nav .navbar-brand, .main-nav .navbar-actions { display: contents !important; }   /* the brand carries Bootstrap d-flex, which is !important */
  .main-nav .navbar-logo { grid-area: logo; width: auto !important; margin: 0; padding: 0; line-height: 0; }
  .main-nav .navbar-logo img { height: 30px; width: auto !important; max-width: none !important; display: block; }
  .main-nav .nav-slogan { grid-area: slogan; display: flex !important; align-items: center; height: 38px; margin: 0 !important; }
  .main-nav .nav-slogan a { font-size: 1.25rem; line-height: 1; white-space: nowrap; }
  .main-nav .navbar-actions > .collapse { grid-area: ctx; justify-self: end; align-self: center; }
  .main-nav .navbar-actions > .collapse .school-class-details { margin: 0 !important; }
  .main-nav .navbar-actions > .collapse .school-class-details > div { margin: 0 !important; }
  .main-nav .navbar-actions > div:last-child { grid-area: tools; justify-self: end; }
  .main-nav #search-toolbar { margin: 0 !important; flex-wrap: nowrap; }
}

/* ---------- v0.51 header controls (David, 3 Nov 2026) ----------
   Every width: the old Menu dropdown and the Home / Favourites / Curriculum / Upgrade header
   buttons are gone (their items live in the drawer), as is the Browse + age filter row (the
   filter lives in the drawer). From md the header's button row is: search icon, Browse, menu.
   Phones: the hamburger only; search and Browse are in the drawer. */
#headerfilter, #search-toolbar .btn-group:has(.user-dropdown), #search-toolbar > .btn-group.d-lg-block, #upgradebtn { display: none !important; }
#search-toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; }
#search-toolbar > * { margin: 0 !important; }
#searchopen { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
#hdr-browse #browsebtn { height: 44px; white-space: nowrap; background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.85); }
#hdr-browse #browsebtn:hover { background: rgba(255,255,255,.12); }
#hdr-browse #browsebtn.hidden { display: none; }
.m-burger { width: 44px; height: 44px; }
.m-drawer-search { display: none !important; }   /* v0.52: the header search icon shows at every width */

/* ---------- v0.52 lesson page actions on one row (David, 3 Nov 2026) ----------
   Below lg (1280px), where the sidebar stacks above the lesson, History, Favourite, Mark Done,
   Thumb-o-meter, Past measurements and Add to Curriculum sit on a single row of equal buttons.
   On phones the labels drop to a smaller size and may wrap to two lines. lg and up keep the
   sidebar's stacked buttons. */
@media (max-width: 1279.98px) {
  .lesson-actions { display: flex; align-items: stretch; gap: .5rem; margin: 1.25rem 0; padding: 0 .5rem; }
  .lesson-actions > div:not(.d-none), .lesson-actions > div > .col, .lesson-actions > .row { display: contents !important; }   /* the live wrappers carry Bootstrap d-flex !important */
  .lesson-actions .btn { flex: 1 1 auto; min-width: 0; margin: 0 !important; width: auto !important; font-size: var(--fs-s); line-height: 1.2; padding: .55rem .6rem; white-space: normal; text-align: center; display: flex; align-items: center; justify-content: center; gap: .3rem; }
  .lesson-actions #past-readings { flex: 0 1 auto; align-self: center; font-size: var(--fs-s); line-height: 1.2; text-align: center; padding: 0 .25rem; }
}
@media (max-width: 575.98px) {
  .lesson-actions { gap: .35rem; padding: 0; }
  .lesson-actions .btn { font-size: .72rem; line-height: 1.15; padding: .45rem .2rem; white-space: normal; text-align: center; }
  .lesson-actions .btn i { display: none !important; }
  .lesson-actions #past-readings { flex: 1 1 0; white-space: normal; text-align: center; font-size: .72rem; line-height: 1.15; }
}
@media (max-width: 1279.98px) { .lesson-actions .btn i { display: none !important; } .lesson-actions .btn { padding: .5rem .55rem; } }
@media (min-width: 820px) and (max-width: 1279.98px) { .lesson-actions .btn, .lesson-actions #past-readings { white-space: nowrap; } }   /* v0.52.2: one line per label wherever the row has room */
/* v0.52.3 phones: six equal columns, small labels that may wrap (hyphenated if a word is too long) */
@media (max-width: 575.98px) {
  .lesson-actions { gap: .3rem; padding: 0; }
  .lesson-actions .btn, .lesson-actions #past-readings { flex: 1 1 0 !important; min-width: 0; padding: .45rem .15rem !important; font-size: .68rem !important; line-height: 1.15; white-space: normal !important; overflow-wrap: anywhere; hyphens: auto; text-align: center; }
}
@media (max-width: 575.98px) { .lesson-actions { gap: .25rem; } .lesson-actions .btn, .lesson-actions #past-readings { overflow-wrap: normal; font-size: .64rem !important; padding: .45rem .1rem !important; } }   /* v0.52.4: whole words fit */

/* v0.53 Home icon between Browse and the menu from 768px (where the header has room); the
   drawer's Home item and its divider step aside there so Home is never in two places */

/* ---------- v0.54 header to David's mock-up (3 Nov 2026) ----------
   From 768px:   [logo] Active・Educational・Fun                      (search) (home) (Browse) (menu)
                 School name  class name                              (buttons centred on both rows)
   The school and class name show from 768px (were 1280px), left-aligned under the logo. */
@media (min-width: 768px) {
  .main-nav > .container > .row { grid-template-columns: auto 1fr auto; grid-template-areas: "logo slogan tools" "ctx ctx tools"; column-gap: .75rem; row-gap: .2rem; align-items: end; }
  .main-nav .navbar-logo { align-self: end; }
  .main-nav .nav-slogan { grid-area: slogan; height: auto; align-self: end; padding-bottom: 2px; }
  .main-nav .nav-slogan a { font-size: 1.05rem; }
  .main-nav .navbar-actions > .collapse { grid-area: ctx; justify-self: start; align-self: start; }
  .main-nav .navbar-actions > .collapse .school-class-details { flex-direction: row !important; justify-content: flex-start !important; }
  .main-nav .navbar-actions > .collapse .school-class-details > .flex-column { display: block !important; }
  .main-nav .navbar-actions > .collapse .details { justify-content: flex-start !important; text-align: left; }
  .main-nav .navbar-actions > div:last-child { grid-area: tools; justify-self: end; align-self: center; }
}

/* ---------- v0.55 (David, 3 Nov 2026) ----------
   Header: the class name (and passcode badge) drop out first as the window narrows, then the
   school name (classes set by fitHeaderCtx in app.js); when neither shows, the logo row and the
   buttons centre on each other. Phones: smaller buttons, centred on the logo. */
.main-nav .navbar-actions > .collapse .details { white-space: nowrap; }
#header.ctx-no-class .ctx-classname, #header.ctx-no-class #passcodebadge { display: none !important; }
#header.ctx-no-school .navbar-actions > .collapse { display: none !important; }
@media (min-width: 768px) { #header.ctx-no-school .main-nav > .container > .row { grid-template-areas: "logo slogan tools"; align-items: center; } #header.ctx-no-school .nav-slogan { align-self: center; padding-bottom: 0; } }
@media (max-width: 767.98px) {
  .main-nav .navbar-actions .collapse { display: none !important; }
  .main-nav > .container > .row { align-items: center; }
  .main-nav .navbar-brand, .main-nav .navbar-actions { align-self: center; margin: 0 !important; }
  #search-toolbar { align-items: center; }
  #searchopen, .m-burger { width: 38px; height: 38px; }
  .m-burger { gap: 4px; padding: 0 9px; }
  #searchopen { font-size: 1rem; }
}
/* Document rows: the Open button covers its row (stretched link), so it must not move on hover -
   a lift there shrank the link's cover to the button and back again (the flicker on 3 Nov). */
.doc-row .btn.doc-open:hover, .doc-row .btn.doc-open:active { transform: none !important; box-shadow: none !important; }
.doc-row:hover .btn.doc-open { background-color: var(--bs-btn-hover-bg, #622974); }

/* ---------- v0.56 (David, 3 Nov 2026) ----------
   One size and weight for the header and subject-bar text: slogan, school name, class name,
   the Browse button and the subject buttons all at 1rem / 500. */
.main-nav .nav-slogan a, #userctx, #userctx .ctx-school, #userctx .ctx-classname, #userctx .ctx-classname a,
.main-nav .navbar-actions > .collapse .details, #hdr-browse #browsebtn,
#scrollable-navbar .subject-button .button-text { font-size: 1rem !important; font-weight: 500 !important; line-height: 1.25 !important; }
.main-nav .navbar-actions > .collapse .heading-3 { font-size: 1rem !important; }
/* v0.56.1: a dash between the school and the class name; it goes with the class name when that drops out */
#userctx .ctx-classname::before, #m-drawer-ctx .ctx-classname::before { content: "- "; color: #fff; }

/* ---------- v0.57 header buttons by available room (David, 3 Nov 2026) ----------
   Home and Browse stay in the header for as long as they fit beside the logo (and slogan);
   as the window narrows Home goes first, then Browse (fitHeaderButtons in app.js sets the
   body classes). Whichever has left the header appears in the drawer instead, so each is
   only ever in one place. */
.hdr-home { display: inline-flex; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; font-size: 1.15rem; }
body.hdr-no-home #hdr-home, body.hdr-no-browse #hdr-browse { display: none !important; }
body:not(.hdr-no-home) .m-drawer-home, body:not(.hdr-no-home) .m-drawer-home + hr { display: none !important; }
body:not(.hdr-no-browse) .m-drawer-browse { display: none !important; }
@media (max-width: 767.98px) { .hdr-home { width: 38px; height: 38px; font-size: 1rem; } #hdr-browse #browsebtn { height: 38px; padding: 0 .7rem; display: inline-flex; align-items: center; } }

/* ---------- v0.58 (David, 3 Nov 2026): school / class line balanced against the logo ----------
   The logo's top sits ~5px above the buttons' top, so the school / class line now sits ~5px below
   the buttons' bottom to mirror it: slightly larger gap between logo and names. */
@media (min-width: 768px) {
  .main-nav > .container > .row { row-gap: .5rem; }
}

/* ---------- v0.59 (David, 3 Nov 2026): age filter chip in the header ----------
   From 768px an active age filter sits left of the search icon while there is room (placeAgeChip,
   app.js); it leaves first as the header narrows and returns to its place under the header.
   Phones unchanged. In the header it reads as a light outline pill on the purple bar. */
body.chip-in-hdr #m-agechip-wrap { display: none !important; }
#search-toolbar .m-agechip { height: 44px; margin-right: .5rem; padding: 0 1rem; gap: .6rem; font-size: 1rem; font-weight: 500; white-space: nowrap; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.55); box-shadow: none; transition: background var(--fx, .2s), border-color var(--fx, .2s); }
#search-toolbar .m-agechip:hover, #search-toolbar .m-agechip:focus-visible { background: rgba(255,255,255,.22); border-color: #fff; }
#search-toolbar .m-agechip i { font-size: .75rem; opacity: .9; }

/* ---------- v0.60 Browse tree (David, 3 Nov 2026) ----------
   #/browse: Finder-style columns Subjects | Groups | Categories | Schemes | Lessons | Parts, a find box,
   breadcrumb and an age-filter notice. Phones show one column at a time (the breadcrumb and Back go up). */
.bt { padding: 1.25rem 0 2rem; }
.bt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: .9rem; }
.bt-title small { display: block; font-size: var(--fs-s); }
.bt-find { position: relative; flex: 1 1 320px; max-width: 520px; }
.bt-find > .bi-search { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--mid-purple); pointer-events: none; }
.bt-find input { padding-left: 2.4rem; padding-right: 2.4rem; height: 44px; border: 1px solid var(--light-purple); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); }
.bt-find input:focus { border-color: var(--purple); box-shadow: 0 0 0 .2rem rgba(115,48,136,.15); }
.bt-find-clear { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--mid-purple); }
.bt-find-clear:hover { background: var(--ultra-purple); color: var(--purple); }
.bt-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem; min-height: 32px; margin-bottom: .75rem; font-size: var(--fs-s); color: var(--mid-purple); }
.bt-crumb { border: 0; background: transparent; padding: .15rem .4rem; border-radius: 6px; color: var(--mid-purple); font: inherit; font-weight: 300; }
.bt-crumb:hover { background: var(--ultra-purple); color: var(--purple); }
.bt-crumb.current { color: var(--purple); font-weight: 500; }
.bt-back { display: none; margin-left: auto; border: 1px solid var(--light-purple); background: #fff; color: var(--purple); border-radius: 999px; padding: .2rem .8rem; font: inherit; font-size: var(--fs-s); font-weight: 500; }
.bt-cols { display: flex; align-items: stretch; gap: .75rem; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: .75rem; scroll-snap-type: x proximity; }
.bt-col { flex: 0 0 272px; width: 272px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--light-purple); border-radius: var(--radius); box-shadow: var(--shadow-sm); scroll-snap-align: start; max-height: calc(100vh - 290px); min-height: 420px; }
.bt-col[data-col="l"], .bt-col[data-col="p"] { flex-basis: 320px; width: 320px; }
.bt-col-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .9rem; background: var(--purple); color: #fff; border-radius: var(--radius) var(--radius) 0 0; font-size: var(--fs-s); font-weight: 500; }
.bt-col-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-col-head small { color: rgba(255,255,255,.75); font-weight: 300; }
.bt-col-link { display: block; padding: .5rem .9rem; font-size: var(--fs-s); font-weight: 500; color: var(--purple); background: var(--ultra-purple); border-bottom: 1px solid var(--light-purple); text-decoration: none; }
.bt-col-link:hover { background: var(--xlight-purple); color: var(--purple); }
.bt-col-body { flex: 1 1 auto; overflow-y: auto; padding: .35rem; }
.bt-empty { padding: 1rem .6rem; color: var(--mid-purple); font-size: var(--fs-s); font-weight: 300; }
.bt-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .5rem .6rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--purple); font: inherit; line-height: 1.25; text-decoration: none; transition: background var(--fx, .18s), transform var(--fx, .18s); }
.bt-item:hover { background: var(--ultra-purple); color: var(--purple); transform: translateX(2px); }
.bt-item.selected, .bt-item.selected:hover { background: var(--purple); color: #fff; transform: none; }
.bt-item.selected .bt-sub, .bt-item.selected .bt-chev, .bt-item.selected .bt-ico { color: rgba(255,255,255,.8); }
.bt-ico { flex: 0 0 auto; font-size: 1.1rem; color: var(--mid-purple); }
.bt-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bt-name { font-size: var(--fs-b); font-weight: 500; }
.bt-sub { font-size: var(--fs-m); font-weight: 300; color: var(--mid-purple); }
.bt-sub em { font-style: normal; font-weight: 500; }
.bt-chev { flex: 0 0 auto; font-size: .75rem; color: var(--mid-purple); }
.bt-free { flex: 0 0 auto; font-size: .65rem; font-weight: 500; padding: .1rem .45rem; border-radius: 999px; background: var(--green); color: #fff; }
.bt-done { flex: 0 0 auto; color: var(--green); font-size: .95rem; }
.bt-item.selected .bt-done, .bt-item.selected .bt-free { color: #fff; }
.bt-item.restricted .bt-name { color: var(--muted); }
.bt-item.age-out { opacity: .55; }
.bt-item.age-out .bt-name { font-weight: 300; }
.bt-item.age-out:hover, .bt-item.age-out.selected { opacity: 1; }
.bt-item.leaf .bt-chev { display: none; }
.bt-item.leaf::after { content: "\f1c5"; font-family: "bootstrap-icons"; font-size: .8rem; color: var(--mid-purple); }
.bt-item.selected.leaf::after { color: rgba(255,255,255,.8); }
.bt-age-note { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: #fff6e8; border-bottom: 2px solid var(--orange); color: var(--text); font-size: var(--fs-s); font-weight: 300; }
.bt-age-note > i { color: var(--orange); font-size: 1rem; flex: 0 0 auto; }
.bt-age-note span { flex: 1 1 auto; }
.bt-age-note .btn { flex: 0 0 auto; font-size: var(--fs-m); padding: .15rem .55rem; white-space: nowrap; }
.bt-results { background: #fff; border: 1px solid var(--light-purple); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .35rem; max-height: calc(100vh - 250px); overflow-y: auto; }
.bt-results-head { padding: .5rem .7rem; color: var(--mid-purple); font-size: var(--fs-s); font-weight: 300; }
.bt-hit { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; padding: .5rem .7rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--purple); font: inherit; transition: background var(--fx, .18s); }
.bt-hit:hover { background: var(--ultra-purple); }
.bt-hit-level { flex: 0 0 76px; font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--mid-purple); }
.bt-hit-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bt-hit-text .bt-sub i { font-size: .6rem; }
@media (max-width: 767.98px) {
  .bt { padding-top: .75rem; }
  .bt-title small { display: none; }
  .bt-cols { gap: 0; overflow-x: hidden; }
  .bt-col { flex: 0 0 100%; width: 100%; max-height: none; min-height: 0; }
  .bt-cols.has-sel .bt-col:not(:last-child) { display: none; }
  .bt-back { display: inline-flex; align-items: center; margin-left: 0; margin-right: .5rem; order: -1; }   /* v0.64: left, before the current level */
  .bt-crumbs .bt-crumb:not(.current) { display: none; }
  .bt-crumbs > i { display: none; }
  .bt-col[data-col="l"], .bt-col[data-col="p"] { flex-basis: 100%; width: 100%; }
}

/* ---------- v0.61 Browse pop-over and views (David, 3 Nov 2026) ----------
   The tree is no longer a page. Desktop: a panel that drops under the header over the page;
   phones: a panel sliding in from the left. (v0.61.4: the Tree and Two-pane views are removed.) */
.bt-backdrop { position: fixed; inset: 0; background: rgba(43,33,48,.45); z-index: 1040; opacity: 0; transition: opacity .25s; }
.bt-backdrop.show { opacity: 1; }
.bt-pop { position: fixed; left: 0; right: 0; top: var(--bt-top, 90px); z-index: 1045; background: var(--ultra-purple); border-bottom: 1px solid var(--light-purple); box-shadow: 0 1rem 2rem rgba(60,20,80,.25); max-height: calc(100vh - var(--bt-top, 90px)); overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .22s var(--ease), transform .22s var(--ease); }
.bt-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.bt-pop .bt { padding: 1rem 1.5rem 1.25rem; display: flex; flex-direction: column; min-height: 0; max-width: 1400px; width: 100%; margin: 0 auto; }
.bt-pop .bt-top { margin-bottom: .6rem; flex-wrap: nowrap; }
.bt-pop .bt-title { flex: 0 0 auto; min-width: 0; }
.bt-pop .bt-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.bt-pop .bt-find { flex: 1 1 260px; max-width: 460px; }
.bt-close { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--light-purple); border-radius: 50%; background: #fff; color: var(--purple); display: inline-flex; align-items: center; justify-content: center; }
.bt-close:hover { background: var(--purple); color: #fff; }
.bt-body { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.bt-pop .bt-cols { padding-bottom: .5rem; }
.bt-pop .bt-col { max-height: calc(100vh - var(--bt-top, 90px) - 190px); min-height: 300px; }
.bt-pop .bt-results { max-height: calc(100vh - var(--bt-top, 90px) - 150px); }
body.bt-open { overflow: hidden; }
@media (max-width: 767.98px) {
  .bt-pop { top: 0; bottom: 0; max-height: none; width: 100%; transform: translateX(-100%); opacity: 1; border-bottom: 0; }
  .bt-pop.open { transform: none; }
  .bt-pop .bt { padding: .75rem 1rem 1rem; }
  .bt-pop .bt-top { flex-wrap: wrap; }
  .bt-pop .bt-title { order: 1; flex: 1 1 auto; } .bt-close { order: 2; } .bt-pop .bt-find { order: 3; flex: 1 1 100%; max-width: none; }
  .bt-pop .bt-col { max-height: none; min-height: 0; }
  .bt-pop .bt-results { max-height: none; }
  .bt-body { overflow-y: auto; }
}

/* ---------- v0.63 (David, 3 Nov 2026): Browse in the subject bar ----------
   Same style as the subject buttons, chevron after the word; it flips while the panel is open.
   While Browse is in the bar the header and drawer Browse are hidden. */
#scrollable-navbar .subject-browse { background-color: var(--purple); }
#scrollable-navbar .subject-browse .button-text i { font-size: .8em; margin-left: .35rem; display: inline-block; transition: transform .2s var(--ease); vertical-align: -1px; }
body.bt-open #scrollable-navbar .subject-browse .button-text i { transform: rotate(180deg); }
body.bt-open #scrollable-navbar .subject-browse { outline: 2px solid #fff; outline-offset: -2px; }
body.browse-in-bar #hdr-browse, body.browse-in-bar .m-drawer-browse { display: none !important; }
body.bt-open #subjectnav { position: relative; z-index: 1041; }   /* above the dimmed page, so the bar's Browse button can close the panel */

/* ---------- v0.64 full-screen lesson (David, 3 Nov 2026) ---------- */
.lesson-focus { position: fixed; inset: 0; z-index: 1060; background: var(--ultra-purple); display: flex; flex-direction: column; opacity: 0; transition: opacity .2s var(--ease); }
.lesson-focus.show { opacity: 1; }
.lesson-focus-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.25rem; background: var(--purple); color: #fff; box-shadow: 0 .25rem .75rem rgba(60,20,80,.25); }
.lesson-focus-title { min-width: 0; }
.lesson-focus-title h5 { margin: 0; color: #fff; font-size: var(--fs-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-focus-title small { display: block; color: var(--light-purple); font-size: var(--fs-s); font-weight: 300; }
.lesson-focus-close { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .9rem .45rem .8rem; border: 2px solid #fff; border-radius: 999px; background: #fff; color: var(--purple); font: inherit; font-size: var(--fs-b); font-weight: 500; transition: background var(--fx), color var(--fx), transform var(--fx); }
.lesson-focus-close:hover { background: var(--orange); border-color: var(--orange); color: #fff; transform: translateY(-1px); }
.lesson-focus-close i { font-size: 1rem; }
.lesson-focus-close kbd { font: inherit; font-size: .75rem; font-weight: 500; padding: .05rem .4rem; border-radius: 5px; background: var(--ultra-purple); color: var(--purple); border: 1px solid var(--light-purple); }
.lesson-focus-close:hover kbd { background: rgba(255,255,255,.25); color: #fff; border-color: rgba(255,255,255,.5); }
.lesson-focus-body { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem; }
.lesson-focus-inner { max-width: 1140px; margin: 0 auto; }
.lesson-focus .lesson-inline { border: 0 !important; border-radius: var(--radius) !important; margin-top: 0; }
.lesson-focus .lesson-fullscreen { display: none; }
body.lesson-focus-open { overflow: hidden; }

/* v0.65 CMS preview */
.preview-banner { background: #ffc20e; color: #2a1a3a; font-size: 14px; padding: 6px 16px; text-align: center; }
.preview-banner b { margin-right: 6px; }
.preview-banner a { margin-left: 12px; color: #2a1a3a; font-weight: 600; }
.cms-body p { margin: 0 0 .25rem; padding-right: .25rem; }
.cms-body h5 { color: var(--bs-purple, #733088); margin: .75rem 0 .25rem; }
.cms-body ul { padding-left: 1.25rem; margin-bottom: .25rem; }
