/* THC Core — the top bar.
   1. The header: sticky, tucked away while reading, three layouts (one row / logo + two rows / phone rows),
      and (1.11.0) the feature row: featured tabs beside the logo on phones.
   2. The items (icon over a short label), the cart included.
   3. The panels each item opens.
   4. [thc_resource_links] — the Resources page's jump buttons.
   5. THC 2026-10-05 (1.12.0): phones (under 768px) with the bottom tab bar on: the slim header, the bottom tab bar
      and its More sheet, the compact footer; and the [thc_sitemap] list at every width.
   6. THC 2026-11-17 (1.13.0): Favorites (its panel, the Manage rows, the strip on My THC), and a menu that has to
      scroll: a scrollbar that is always showing and a soft fade while there is more below.
   7. THC 2026-11-17 (1.14.0): Customize the menu (the tick boxes; sections someone has hidden on the phone bars).
   Colours come from the theme's tokens, so High contrast and Dark follow automatically. */

:root {
  --thc-b-raised: var(--thc-surface-raised, #fcf8ef);
  --thc-b-muted: var(--thc-surface-muted, #ece4d9);
  --thc-b-border: var(--thc-border, #d9d0bc);
  --thc-b-text: var(--thc-text, #332d25);
  --thc-b-deep: var(--thc-leaf-deep, #3f5c3b);
  --thc-b-canvas: var(--thc-canvas, #f7f1e4);
}

/* ---------- 1. the header ---------- */

.thc-bar-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform .22s ease;
}
body.admin-bar .thc-bar-header { top: var(--wp-admin--admin-bar--height, 32px); }
.thc-bar-header.is-tucked { transform: translateY(-100%); }
body.admin-bar .thc-bar-header.is-tucked { transform: translateY(calc(-100% - var(--wp-admin--admin-bar--height, 32px))); }
@media (max-width: 600px) {
  /* WordPress's own admin bar scrolls away on phones. */
  body.admin-bar .thc-bar-header { top: 0; }
  body.admin-bar .thc-bar-header.is-tucked { transform: translateY(-100%); }
}
.thc-bar-header.has-open { z-index: 10000001; } /* an open panel sits above the cookie banner too */
html[data-thc-bar="static"] .thc-bar-header { position: relative; transform: none; }
html[data-thc-bar="pinned"] { scroll-padding-top: calc(var(--thc-bar-h, 0px) + 8px); }
@media (prefers-reduced-motion: reduce) { .thc-bar-header { transition: none; } }
html[data-thc-motion="reduce"] .thc-bar-header { transition: none; }

/* A page the server marks as floating (the thc_core_bar_floats filter; none since 1.12.49, when Tutor's lesson bar and
   its frog button went) starts tucked away. "Always showing" and "Top of page only" keep it in the page. */
html:not([data-thc-bar="pinned"]):not([data-thc-bar="static"]) .thc-bar-header--learning { position: fixed; left: 0; right: 0; width: 100%; }
html[data-thc-bar="pinned"] .thc-bar-header.is-tucked,
html[data-thc-bar="static"] .thc-bar-header.is-tucked { transform: none; }

/* "Back to your lesson": a slim strip under the bar on other pages, part of the header (it tucks with it). */
.thc-return { background: var(--thc-b-muted); border-top: 1px solid var(--thc-b-border); border-bottom: 1px solid var(--thc-b-border); }
.thc-return__inner { display: flex; align-items: center; gap: .25rem; max-width: var(--thc-wide, 1340px); margin: 0 auto; padding: 0 .5rem; }
.thc-return__link {
  display: flex; align-items: center; gap: .35rem; flex: 1 1 auto; min-width: 0; min-height: 40px;
  color: var(--thc-b-deep); font-size: .9rem; font-weight: 600; line-height: 1.2; text-decoration: none;
}
.thc-return__link svg { flex: none; }
.thc-return__text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thc-return__link:hover .thc-return__text { text-decoration: underline; text-underline-offset: 2px; }
.thc-return__link:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
.thc-return__close {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
  margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--thc-b-text); cursor: pointer; line-height: 0;
}
.thc-return__close:hover, .thc-return__close:focus-visible { background: var(--thc-b-raised); }
.thc-return__close:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }

/* The header is the measuring stick for the three layouts (rem-based, so larger text sizes switch sooner). */
.thc-bar-header .thc-site-header { container: thc-header / inline-size; }

/* Phones first: the logo on its own row, then the bar across the full width (the page's side margins are
   narrowed in the header so five labels have room). */
@media (max-width: 600px) {
  .thc-bar-header .thc-site-header { padding-left: 0; padding-right: 0; }
  .thc-bar-header .thc-site-header__inner { padding-inline: .5rem; }
}
.thc-bar-header .thc-site-header__inner {
  flex-wrap: wrap;
  row-gap: .15rem;
  min-height: 0;
  padding-block: .4rem .35rem;
}
.thc-bar-header .thc-site-brand { flex: 1 1 100%; }
.thc-bar-header .thc-site-brand .custom-logo { width: 120px; max-height: 44px; }
.thc-bar-header .thc-site-header__actions {
  flex: 1 1 100%;
  justify-content: stretch;
  gap: 0;
  min-width: 0;
}
.thc-bar { width: 100%; margin: 0; }
.thc-bar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* THC 2026-10-01 (1.11.0): column counts come from the bar itself (style attribute), so rows stay even for any
     number of items: --thc-bar-ca on phones, --thc-bar-c2 on medium screens, --thc-bar-n on one row. */
  grid-template-columns: repeat(var(--thc-bar-ca, 5), minmax(0, 1fr));
  gap: .1rem .15rem;
}
/* Featured tabs in their own list (feature row on): without subgrid support they simply sit in a row above the rest. */
.thc-bar--feat .thc-bar__list--featured { grid-template-columns: repeat(var(--thc-bar-k, 3), minmax(0, 1fr)); column-gap: .35rem; margin-bottom: .25rem; }
.thc-bar--feat .thc-bar__list--rest { grid-template-columns: repeat(var(--thc-bar-cp, 5), minmax(0, 1fr)); }

/* THC 2026-10-01 (1.11.0): phones lay the rows on half columns, so a last row one or two short is centred under the
   full ones (eleven items: six, then five in the middle) instead of leaving a gap at the right. Same sizes as before. */
@container thc-header (max-width: 37.49rem) {
  .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-ca2, 10), minmax(0, 1fr)); }
  .thc-bar:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot { grid-column: span 2; }
  .thc-bar[data-thc-bar-ca="3"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
  .thc-bar[data-thc-bar-ca="4"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
  .thc-bar[data-thc-bar-ca="4"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
  .thc-bar[data-thc-bar-ca="5"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(5n+1):nth-last-child(2) { grid-column: 4 / span 2; }
  .thc-bar[data-thc-bar-ca="5"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(5n+1):nth-last-child(3) { grid-column: 3 / span 2; }
  .thc-bar[data-thc-bar-ca="5"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(5n+1):nth-last-child(4) { grid-column: 2 / span 2; }
  .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(6n+1):nth-last-child(2) { grid-column: 5 / span 2; }
  .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(6n+1):nth-last-child(3) { grid-column: 4 / span 2; }
  .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(6n+1):nth-last-child(4) { grid-column: 3 / span 2; }
  .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) > .thc-bar__list > .thc-bar__slot:nth-child(6n+1):nth-last-child(5) { grid-column: 2 / span 2; }
}

/* Medium: the logo beside two even rows (five each for ten items, six each for twelve). */
@container thc-header (min-width: 37.5rem) {
  .thc-bar-header .thc-site-header__inner { flex-wrap: nowrap; padding-block: .45rem; }
  .thc-bar-header .thc-site-brand { flex: 0 1 auto; }
  .thc-bar-header .thc-site-brand .custom-logo { width: clamp(132px, 14vw, 176px); max-height: 64px; }
  .thc-bar-header .thc-site-header__actions { flex: 0 0 auto; }
  .thc-bar { width: auto; }
  .thc-bar__list,
  .thc-bar--feat .thc-bar__list--rest { grid-template-columns: repeat(var(--thc-bar-c2, 5), minmax(4.25rem, auto)); }
  .thc-bar--feat .thc-bar__list--featured { grid-template-columns: repeat(var(--thc-bar-k, 3), minmax(4.25rem, auto)); column-gap: .15rem; margin: 0; }
}

/* Wide: one row of all of them, from the width where they fit (62rem for ten, as before; more for eleven or twelve).
   THC 2026-11-12 (1.12.53): eight or fewer fit from 52rem and nine from 57rem. */
/* THC 2026-11-17 (1.14.0): someone who hides tabs can have as few as three. Five or fewer are one row from 37.5rem (so
   they are never split over two rows) and six or seven from 45rem. */
@container thc-header (min-width: 37.5rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="37"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 5), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 45rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="45"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 7), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 52rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="52"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 8), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 57rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="57"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 9), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 62rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="62"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 64rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="64"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 66rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="66"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 70rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="70"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
}
@container thc-header (min-width: 74rem) {
  .thc-bar:not(.thc-bar--feat)[data-thc-bar-wide="74"] .thc-bar__list { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
}

/* THC 2026-10-01: the feature row (1.11.0). The bar has two lists, featured tabs first, so the keyboard and screen
   readers meet them in the same order as the eye. With subgrid, the two lists share the bar's columns:
   - phones: the header line becomes a grid; the logo and the featured tabs share its first row, and the other items
     fill the full width below in even rows (the bar spans both rows; it lets taps through to the logo underneath);
   - wider screens: featured tabs take the first columns of the first row and the rest continue after them, so the
     rows stay even and nothing is printed twice. */
@supports (grid-template-columns: subgrid) {
  /* Phones. Beside the logo when there is room: from 19.5rem (a 360px phone up to 120% text), or 25rem with
     OpenDyslexic, which is much wider (a 414px phone at normal size). Otherwise, at the largest text sizes, all items
     merge into even rows below the logo, featured first (the same rows and height as with the feature row off). */
  @container thc-header (min-width: 19.5rem) and (max-width: 37.49rem) {
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-site-header__inner {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      grid-template-rows: auto auto;
      align-items: center;
      column-gap: .5rem;
    }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-site-brand { grid-column: 1; grid-row: 1; }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-site-header__actions { display: contents; }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-bar--feat {
      grid-column: 1 / -1; grid-row: 1 / span 2;
      display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid;
      align-items: center; pointer-events: none; /* spans the logo's row too: taps there go through to the logo */
    }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list { pointer-events: auto; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list--featured { grid-column: 2; grid-row: 1; margin: 0; column-gap: .35rem; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list--rest { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(var(--thc-bar-cp2, 10), minmax(0, 1fr)); }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat > .thc-bar__list--rest > .thc-bar__slot { grid-column: span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="3"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="4"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="4"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(2) { grid-column: 4 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(3) { grid-column: 3 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(4) { grid-column: 2 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(2) { grid-column: 5 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(3) { grid-column: 4 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(4) { grid-column: 3 / span 2; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(5) { grid-column: 2 / span 2; }
    /* the featured tiles: the same icon over a label, on a raised tile so they read as the main ways in; 44px tall,
       so the logo's line is no taller than before; labels shrink with larger text to fit beside the 120px logo */
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item {
      min-height: 44px; padding: .15rem 0; gap: .1rem;
      /* THC 2026-10-01: featured tabs look like every other tab, no tile outline (1.11.2) */
    }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item:hover { background: var(--thc-b-muted); }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item[aria-expanded="true"] { background: var(--thc-b-muted); box-shadow: inset 0 -3px 0 var(--thc-b-deep); }
    html:not([data-thc-font="dyslexic"]) .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__label { font-size: min(.72rem, calc((100cqw - 140px) / var(--thc-bar-k, 3) / 5.6)); letter-spacing: 0; }
  }
  @container thc-header (min-width: 25rem) and (max-width: 37.49rem) {
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-site-header__inner {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      grid-template-rows: auto auto;
      align-items: center;
      column-gap: .5rem;
    }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-site-brand { grid-column: 1; grid-row: 1; }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-site-header__actions { display: contents; }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-bar--feat {
      grid-column: 1 / -1; grid-row: 1 / span 2;
      display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid;
      align-items: center; pointer-events: none; /* spans the logo's row too: taps there go through to the logo */
    }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list { pointer-events: auto; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list--featured { grid-column: 2; grid-row: 1; margin: 0; column-gap: .35rem; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list--rest { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(var(--thc-bar-cp2, 10), minmax(0, 1fr)); }
    html[data-thc-font="dyslexic"] .thc-bar--feat > .thc-bar__list--rest > .thc-bar__slot { grid-column: span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="3"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="4"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="4"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(2) { grid-column: 4 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(3) { grid-column: 3 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="5"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(5n+1):nth-last-child(4) { grid-column: 2 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(2) { grid-column: 5 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(3) { grid-column: 4 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(4) { grid-column: 3 / span 2; }
    html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="6"] > .thc-bar__list--rest > .thc-bar__slot:nth-child(6n+1):nth-last-child(5) { grid-column: 2 / span 2; }
    /* the featured tiles: the same icon over a label, on a raised tile so they read as the main ways in; 44px tall,
       so the logo's line is no taller than before; labels shrink with larger text to fit beside the 120px logo */
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item {
      min-height: 44px; padding: .15rem 0; gap: .1rem;
      /* THC 2026-10-01: featured tabs look like every other tab, no tile outline (1.11.2) */
    }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item:hover { background: var(--thc-b-muted); }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__item[aria-expanded="true"] { background: var(--thc-b-muted); box-shadow: inset 0 -3px 0 var(--thc-b-deep); }
    html[data-thc-font="dyslexic"] .thc-bar-header--feat .thc-bar .thc-bar__slot--featured .thc-bar__label { font-size: min(.72rem, calc((100cqw - 140px) / var(--thc-bar-k, 3) / 8)); letter-spacing: 0; }
  }
  @container thc-header (max-width: 19.49rem) {
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat { display: grid; grid-template-columns: repeat(var(--thc-bar-ca, 5), minmax(0, 1fr)); gap: .1rem 0; pointer-events: none; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list { display: grid; grid-template-columns: subgrid; margin: 0; pointer-events: none; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__slot { pointer-events: auto; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list--featured { grid-row: 1; grid-column: 1 / span var(--thc-bar-k, 3); }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list--rest { grid-row: 1 / span var(--thc-bar-ra, 2); grid-column: 1 / -1; grid-template-rows: subgrid; }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat .thc-bar__list--rest > .thc-bar__slot:first-child { grid-column-start: var(--thc-bar-k1, 1); }
    html:not([data-thc-font="dyslexic"]) .thc-bar--feat[data-thc-bar-ca="6"] .thc-bar__label { font-size: min(.68rem, calc((100cqw - 1rem) / 32)); }
    html[data-thc-font="legible"] .thc-bar--feat[data-thc-bar-ca="6"] .thc-bar__label { font-size: min(.68rem, calc((100cqw - 1rem) / 36)); }
  }
  @container thc-header (max-width: 24.99rem) {
    html[data-thc-font="dyslexic"] .thc-bar--feat { display: grid; grid-template-columns: repeat(var(--thc-bar-cd, 4), minmax(0, 1fr)); gap: .1rem 0; pointer-events: none; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list { display: grid; grid-template-columns: subgrid; margin: 0; pointer-events: none; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__slot { pointer-events: auto; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list--featured { grid-row: 1; grid-column: 1 / span var(--thc-bar-k, 3); }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list--rest { grid-row: 1 / span var(--thc-bar-rd, 3); grid-column: 1 / -1; grid-template-rows: subgrid; }
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__list--rest > .thc-bar__slot:first-child { grid-column-start: var(--thc-bar-k1, 1); }
    /* OpenDyslexic here: at most four a row, so the labels stay readable (one row more than other typefaces) */
    html[data-thc-font="dyslexic"] .thc-bar--feat .thc-bar__label { font-size: min(.72rem, calc((100cqw - 1rem) / var(--thc-bar-cd, 4) / 8.8)); letter-spacing: 0; }
  }

  @container thc-header (min-width: 37.5rem) {
    .thc-bar--feat {
      display: grid;
      grid-template-columns: repeat(var(--thc-bar-c2, 5), minmax(4.25rem, auto));
      gap: .1rem .15rem;
      pointer-events: none; /* the lists overlap in row one; each slot takes its own taps */
    }
    .thc-bar--feat .thc-bar__list { display: grid; grid-template-columns: subgrid; pointer-events: none; }
    .thc-bar--feat .thc-bar__slot { pointer-events: auto; }
    .thc-bar--feat .thc-bar__list--featured { grid-row: 1; grid-column: 1 / span var(--thc-bar-k, 3); }
    .thc-bar--feat .thc-bar__list--rest { grid-row: 1 / span 2; grid-column: 1 / -1; grid-template-rows: subgrid; }
    .thc-bar--feat .thc-bar__list--rest > .thc-bar__slot:first-child { grid-column-start: var(--thc-bar-k1, 1); }
  }
  /* 1.14.0: the same two tiers for fewer tabs, with the feature row. */
  @container thc-header (min-width: 37.5rem) {
    .thc-bar--feat[data-thc-bar-wide="37"] { grid-template-columns: repeat(var(--thc-bar-n, 5), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="37"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 45rem) {
    .thc-bar--feat[data-thc-bar-wide="45"] { grid-template-columns: repeat(var(--thc-bar-n, 7), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="45"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 52rem) {
    .thc-bar--feat[data-thc-bar-wide="52"] { grid-template-columns: repeat(var(--thc-bar-n, 8), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="52"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 57rem) {
    .thc-bar--feat[data-thc-bar-wide="57"] { grid-template-columns: repeat(var(--thc-bar-n, 9), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="57"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 62rem) {
    .thc-bar--feat[data-thc-bar-wide="62"] { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="62"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 64rem) {
    .thc-bar--feat[data-thc-bar-wide="64"] { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="64"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 66rem) {
    .thc-bar--feat[data-thc-bar-wide="66"] { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="66"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 70rem) {
    .thc-bar--feat[data-thc-bar-wide="70"] { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="70"] .thc-bar__list--rest { grid-row: 1; }
  }
  @container thc-header (min-width: 74rem) {
    .thc-bar--feat[data-thc-bar-wide="74"] { grid-template-columns: repeat(var(--thc-bar-n, 10), minmax(4.25rem, auto)); }
    .thc-bar--feat[data-thc-bar-wide="74"] .thc-bar__list--rest { grid-row: 1; }
  }

  /* Tablets set to "Same as phones" (up to 1023px wide, below the one-row width): the logo and the featured tabs on
     one line, the rest in a row below (two even rows if there are more than ten). */
  @media (max-width: 1023px) {
    @container thc-header (min-width: 37.5rem) {
      .thc-bar-header--tabphone .thc-site-header__inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 1rem;
        row-gap: .15rem;
      }
      .thc-bar-header--tabphone .thc-site-brand { grid-column: 1; grid-row: 1; }
      .thc-bar-header--tabphone .thc-site-header__actions { display: contents; }
      .thc-bar-header--feat .thc-bar--tabphone {
        grid-column: 1 / -1; grid-row: 1 / span 2;
        grid-template-columns: subgrid; grid-template-rows: subgrid; align-items: center; gap: inherit;
      }
      .thc-bar--tabphone .thc-bar__list { pointer-events: auto; }
      .thc-bar--tabphone .thc-bar__list--featured { grid-column: 2; grid-row: 1; grid-template-columns: repeat(var(--thc-bar-k, 3), minmax(5rem, 7rem)); justify-content: end; }
      .thc-bar--tabphone .thc-bar__list--rest { grid-column: 1 / -1; grid-row: 2; grid-template-rows: none; grid-template-columns: repeat(var(--thc-bar-ct, 8), minmax(0, 1fr)); }
      .thc-bar--tabphone .thc-bar__list--rest > .thc-bar__slot:first-child { grid-column-start: auto; }
    }
  }
}

/* Tablets set to "Same as phones": the featured tabs on raised tiles too. */
@supports (grid-template-columns: subgrid) {
  @media (max-width: 1023px) {
    @container thc-header (min-width: 37.5rem) {
      .thc-bar-header--tabphone .thc-bar .thc-bar__slot--featured .thc-bar__item {
        /* THC 2026-10-01: featured tabs look like every other tab, no tile outline (1.11.2) */
      }
      .thc-bar-header--tabphone .thc-bar .thc-bar__slot--featured .thc-bar__item:hover { background: var(--thc-b-muted); }
      .thc-bar-header--tabphone .thc-bar .thc-bar__slot--featured .thc-bar__item[aria-expanded="true"] { background: var(--thc-b-muted); box-shadow: inset 0 -3px 0 var(--thc-b-deep); }
    }
  }
}

/* Browsers without subgrid (before Safari 16 / Chrome 117): on wider screens the two lists sit side by side and wrap. */
@supports not (grid-template-columns: subgrid) {
  @container thc-header (min-width: 37.5rem) {
    .thc-bar--feat { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  }
}

/* ---------- 2. the items ---------- */

.thc-bar__slot { display: flex; min-width: 0; margin: 0; padding: 0; }
.thc-bar__slot::marker { content: none; }

.thc-bar .thc-bar__item,
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  margin: 0;
  padding: .3rem .25rem .25rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--thc-b-text);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.thc-bar .thc-bar__item:hover,
.thc-bar .thc-bar__item[aria-expanded="true"],
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__button:hover { background: var(--thc-b-muted); color: var(--thc-b-text); }
.thc-bar .thc-bar__item:focus-visible,
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__button:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 1px; }
.thc-bar .thc-bar__item[aria-expanded="true"] { box-shadow: inset 0 -3px 0 var(--thc-b-deep); }

.thc-bar__icon { display: inline-flex; line-height: 0; }
.thc-bar .thc-bar__svg,
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__icon { width: 1.375rem; height: 1.375rem; flex: none; }
.thc-bar .thc-bar__label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.15;
  white-space: nowrap;
  color: inherit;
}
.thc-bar .thc-bar__item.is-current .thc-bar__label {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Display: a small dot when someone has changed a setting (same as the old round button). */
.thc-bar .thc-bar__item.is-custom .thc-bar__icon { position: relative; }
.thc-bar .thc-bar__item.is-custom .thc-bar__icon::after {
  content: ""; position: absolute; right: -3px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--thc-leaf, #5e7d53); box-shadow: 0 0 0 2px var(--thc-b-raised);
}

/* THC 2026-11-12 (1.12.53): items printed without a tab (Display & reading, The app, Contact). Their list and slots take
   no place in any of the layouts above, the link is never shown, and only the panel appears (opened from the Profile
   panel, Support's help row or the phone More sheet). The bar itself lets taps through where two lists overlap, so the
   panel takes its own. */
.thc-bar .thc-bar__list.thc-bar__list--tucked { display: contents; }
.thc-bar .thc-bar__tslot { display: contents; margin: 0; padding: 0; list-style: none; }
.thc-bar .thc-bar__tslot > .thc-bar__item { display: none; }
.thc-bar .thc-bar__tslot > .thc-bar__panel { pointer-events: auto; }

/* 1.12.53: the cart's count on the Shop tab (and on the phone More tab): a small number at the icon's corner, shown only
   when the cart holds something. */
.thc-bar .thc-bar__icon { position: relative; }
.thc-bar__count {
  position: absolute; top: -7px; right: -12px; box-sizing: border-box; min-width: 1.15rem; height: 1.15rem; padding: 0 .28rem;
  border-radius: 999px; background: var(--thc-b-deep); color: #fff; box-shadow: 0 0 0 2px var(--thc-b-raised);
  font-size: .68rem; font-weight: 700; line-height: 1.15rem; text-align: center; letter-spacing: 0;
}
.thc-bar__count[hidden] { display: none; }

/* The WooCommerce cart, restyled to match. Its drawer and item count are WooCommerce's own. (Not printed since 1.12.53:
   the cart is part of the Shop tab. Kept for a header that still carries the mini-cart.) */
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart { display: flex; width: 100%; margin: 0; }
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__quantity-badge { position: relative; display: inline-flex; line-height: 0; }
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__badge {
  position: absolute; top: -6px; right: -10px; margin: 0; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem;
  font-size: .68rem; line-height: 1.1rem; border-radius: 999px; transform: none;
}
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__amount,
.thc-bar .thc-bar__slot--cart .wc-block-mini-cart__tax-label { display: none; }

/* Narrow phones: the columns are tight, so the labels give up their side padding and letter spacing. */
@container thc-header (max-width: 26rem) {
  .thc-bar__list { gap: .1rem 0; }
  .thc-bar .thc-bar__item,
  .thc-bar .thc-bar__slot--cart .wc-block-mini-cart__button { padding-inline: 0; }
  /* Normally .72rem; with the largest text sizes on a small phone, capped so five labels still fit a row. */
  .thc-bar .thc-bar__label { font-size: min(.72rem, calc((100cqw - 1rem) / 27)); letter-spacing: 0; }
  /* 1.11.0: six to a row (eleven or twelve items with the feature row off): a little smaller still. */
  .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) .thc-bar__label,
  .thc-bar--feat[data-thc-bar-cp="6"] .thc-bar__list--rest .thc-bar__label { font-size: min(.68rem, calc((100cqw - 1rem) / 32)); }
  html[data-thc-font="legible"] .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) .thc-bar__label,
  html[data-thc-font="legible"] .thc-bar--feat[data-thc-bar-cp="6"] .thc-bar__list--rest .thc-bar__label { font-size: min(.68rem, calc((100cqw - 1rem) / 36)); }
  html[data-thc-font="dyslexic"] .thc-bar[data-thc-bar-ca="6"]:not(.thc-bar--feat) .thc-bar__label,
  html[data-thc-font="dyslexic"] .thc-bar--feat[data-thc-bar-cp="6"] .thc-bar__list--rest .thc-bar__label { font-size: min(.68rem, calc((100cqw - 1rem) / 42)); }
}

/* ---------- 3. the panels ---------- */

.thc-bar__panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 1px);
  left: .5rem;
  right: .5rem;
  max-height: var(--thc-bar-panel-max, 70vh);
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: .55rem .6rem .7rem;
  border: 1px solid var(--thc-b-border);
  border-radius: 12px;
  background: var(--thc-b-raised);
  color: var(--thc-b-text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  font-size: .95rem;
  line-height: 1.4;
  text-align: start;
}
.thc-bar__panel[hidden] { display: none; }
/* 1.12.55: the script measures a panel straight after changing its columns. The theme's reduced-motion rule gives
   every element a 0.01 ms transition, which would make that measurement read the width from before the change, so
   the panel and its body take no part in transitions at all (they never had one of their own). */
.thc-bar__panel, .thc-bar__panel > .thc-bar__body { transition-property: none !important; }
.thc-bar__panel *, .thc-bar__panel *::before, .thc-bar__panel *::after { box-sizing: border-box; }
@container thc-header (min-width: 37.5rem) {
  .thc-bar__panel { --thc-bar-panel-w: 23.5rem; left: auto; right: var(--thc-bar-panel-right, 1rem); width: min(var(--thc-bar-panel-w), calc(100% - 1rem)); }
  .thc-bar__panel--resources,
  .thc-bar__panel--display { --thc-bar-panel-w: 30rem; }
  .thc-bar__links--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .35rem; }
  /* THC 2026-11-13 (1.12.55; Micha: "Some of the nav menus are scrolling past the bottom of the screen on my rather
     large tablet. So can we have those widen into more columns"): a panel taller than the room under the header
     spreads into two or three columns. The script sets data-thc-cols only when the one-column panel would scroll
     and the header has room for the wider one, so a panel that fits keeps its usual shape. Groups, rows and the cart
     box stay whole; the buttons at the foot and the lines at the top run the full width. Reading and Tab order are
     unchanged: down the first column, then the next. */
  .thc-bar__panel[data-thc-cols] { width: min(calc(var(--thc-bar-panel-w) * var(--thc-bar-cols, 2)), calc(100% - 1rem)); }
  .thc-bar__panel[data-thc-cols] .thc-bar__body { column-count: var(--thc-bar-cols, 2); column-gap: 1.1rem; column-rule: 1px solid var(--thc-b-border); }
  .thc-bar__panel[data-thc-cols] .thc-bar__group,
  .thc-bar__panel[data-thc-cols] .thc-bar__links > li,
  .thc-bar__panel[data-thc-cols] .thc-bar__cartbox,
  .thc-bar__panel[data-thc-cols] .thc-bar__resume { break-inside: avoid; }
  .thc-bar__panel[data-thc-cols] .thc-bar__group-title { break-after: avoid; }
  /* Every column starts at the same height: the space above a group is padding (kept at the top of a column), not margin (dropped there). */
  .thc-bar__panel[data-thc-cols] .thc-bar__group + .thc-bar__group { margin-top: 0; }
  .thc-bar__panel[data-thc-cols] .thc-bar__group { padding-top: .3rem; }
  .thc-bar__panel[data-thc-cols] .thc-bar__group-title { margin-top: 0; }
  .thc-bar__panel--resources[data-thc-cols] .thc-bar__group { padding-top: .5rem; }
  .thc-bar__panel[data-thc-cols] .thc-bar__body > .thc-bar__actions,
  .thc-bar__panel[data-thc-cols] .thc-bar__body > .thc-bar__lede,
  .thc-bar__panel[data-thc-cols] .thc-bar__body > .thc-bar__resume,
  .thc-bar__panel[data-thc-cols] .thc-bar__body > .thc-bar__cartbox,
  .thc-bar__panel[data-thc-cols] .thc-bar__body > .thc-bar__more { column-span: all; }
  /* THC 2026-11-17 (1.13.0): no room for a second full-width column (a window about 1080 px wide, say): the menu takes
     the header's whole width and its columns are narrower, so its link grid drops to as many links a row as fit. */
  .thc-bar__panel[data-thc-fit][data-thc-cols] { width: calc(100% - 1rem); }
  .thc-bar__panel[data-thc-fit] .thc-bar__links--grid { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
}

.thc-bar__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .2rem .6rem; }
.thc-bar__title { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.thc-bar__close {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; margin: -4px -2px -4px 0; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: inherit; cursor: pointer; line-height: 0;
}
.thc-bar__close .thc-bar__svg { width: 18px; height: 18px; }
.thc-bar__close:hover, .thc-bar__close:focus-visible { background: var(--thc-b-muted); }
.thc-bar__close:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }

.thc-bar__body > :first-child { margin-top: 0; }
.thc-bar__resume { margin: .1rem 0 .45rem; }
.thc-bar__resume a {
  display: flex; flex-wrap: wrap; gap: 0 .3rem; align-items: center; min-height: 44px; padding: .45rem .6rem; border-radius: 8px;
  background: var(--thc-b-muted); color: var(--thc-b-deep); font-weight: 600; text-decoration: none;
}
.thc-bar__resume a:hover { text-decoration: underline; text-underline-offset: 2px; }
.thc-bar__resume a:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 0; }
.thc-bar__lede { margin: .1rem .6rem .45rem; }
.thc-bar__muted { margin: .1rem .6rem .35rem; opacity: .85; font-size: .9rem; }
.thc-bar__more { margin: .55rem .6rem 0; font-size: .9rem; }
.thc-bar__more a { color: var(--thc-b-deep); font-weight: 600; }

.thc-bar__links { list-style: none; margin: 0; padding: 0; }
.thc-bar__links > li { margin: 0; padding: 0; }
.thc-bar__links > li[hidden] { display: none; }
.thc-bar__link {
  display: flex; flex-direction: column; justify-content: center; gap: .05rem;
  min-height: 44px; padding: .45rem .6rem; border-radius: 8px;
  color: var(--thc-b-text); text-decoration: none;
}
.thc-bar__link:hover { background: var(--thc-b-muted); color: var(--thc-b-text); }
.thc-bar__link:hover .thc-bar__link-text { text-decoration: underline; text-underline-offset: 2px; }
.thc-bar__link:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 0; }
.thc-bar__link-text { font-weight: 600; color: var(--thc-b-deep); }
.thc-bar__link-text .thc-bar__svg--external { width: .8rem; height: .8rem; margin-left: .3rem; vertical-align: -1px; }
.thc-bar__note { font-size: .84rem; opacity: .85; }
.thc-bar__tag {
  display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px;
  background: var(--thc-b-deep); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 1px;
}

.thc-bar__group + .thc-bar__group { margin-top: .45rem; }
.thc-bar__group-title { margin: .25rem .6rem .05rem; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
/* THC 2026-10-08 (1.12.6): in the Tools panel the group headings are full-width bands with centred words, so each group reads as its own block (Micha: the plain headings did not give enough of a visual break). */
.thc-bar__panel--resources .thc-bar__group + .thc-bar__group { margin-top: .7rem; }
.thc-bar__panel--resources .thc-bar__group-title { margin: 0 0 .3rem; padding: .38rem .6rem; border-radius: .45rem; background: var(--thc-b-muted); color: var(--thc-b-deep); text-align: center; font-size: .78rem; letter-spacing: .08em; opacity: 1; }

.thc-bar__actions {
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin-top: .55rem; padding: .6rem .35rem 0; border-top: 1px solid var(--thc-b-border);
}
.thc-bar__body > .thc-bar__actions:first-child { margin-top: .2rem; padding-top: 0; border-top: 0; }
.thc-bar__actions[hidden] { display: none; }
/* 1.12.55: the section's main-page button, first in its panel, with a rule under it (the foot rows have theirs above). */
.thc-bar__body > .thc-bar__actions--top,
.thc-bar__body > .thc-bar__actions--top:first-child { margin: .2rem 0 .5rem; padding: 0 .35rem .6rem; border-top: 0; border-bottom: 1px solid var(--thc-b-border); }
.thc-bar .thc-bar__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 1 1 auto;
  min-height: 44px; margin: 0; padding: .5rem .95rem; border: 1px solid var(--thc-b-deep); border-radius: 999px;
  background: var(--thc-b-deep); color: #fff; font: inherit; font-weight: 700; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer;
}
.thc-bar .thc-bar__btn:hover { filter: brightness(1.12); color: #fff; }
.thc-bar .thc-bar__btn--quiet { background: transparent; color: var(--thc-b-deep); }
.thc-bar .thc-bar__btn--quiet:hover { background: var(--thc-b-muted); color: var(--thc-b-deep); filter: none; }
.thc-bar .thc-bar__btn:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }

/* 1.12.53: the cart at the top of the Shop panel (shown by the script when the cart holds something). */
.thc-bar__cartbox { margin: .1rem 0 .55rem; padding: .55rem .35rem .6rem; border-radius: 10px; background: var(--thc-b-muted); }
.thc-bar__cartbox[hidden] { display: none; }
.thc-bar__cartline { margin: 0 .3rem; font-weight: 600; }
/* 1.12.55: what is in the cart, by name (filled by the script). */
.thc-bar__cartitems { list-style: none; margin: .3rem .3rem 0; padding: 0; font-size: .92rem; }
.thc-bar__cartitems[hidden] { display: none; }
.thc-bar__cartitems > li { margin: 0; padding: .12rem 0 .12rem .85rem; position: relative; overflow-wrap: anywhere; }
.thc-bar__cartitems > li::before { content: ""; position: absolute; left: .15rem; top: .7em; width: .3rem; height: .3rem; border-radius: 50%; background: currentColor; opacity: .7; }
.thc-bar__cartitems > .thc-bar__cartmore { opacity: .85; }
.thc-bar__cartitems > .thc-bar__cartmore::before { content: none; }
.thc-bar__cartbox .thc-bar__actions { margin-top: .45rem; padding-top: 0; border-top: 0; }
.thc-bar .thc-bar__cartbox .thc-bar__btn--quiet { background: var(--thc-b-raised); }
.thc-bar .thc-bar__cartbox .thc-bar__btn--quiet:hover { background: var(--thc-b-canvas); }
/* 1.12.53: "Need help? Contact us" at the foot of the Support panel, set apart from the giving groups. */
.thc-bar__links--help { margin-top: .5rem; padding-top: .35rem; border-top: 1px solid var(--thc-b-border); }

.thc-bar__tiers { list-style: none; margin: .15rem 0 .2rem; padding: 0 .35rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.thc-bar__tiers > li { margin: 0; flex: 1 1 auto; }
.thc-bar__tiers form, .thc-bar__group form { margin: 0; }
.thc-bar__group > form { padding: 0 .35rem; }
.thc-bar__group > form .thc-bar__btn { width: 100%; }

/* Search: THC Search's own form, full width. */
.thc-bar__panel .thc-search-form { width: 100%; margin: .15rem 0 0; }
.thc-bar__panel .thc-search-form input[type="search"] { min-height: 44px; font-size: 1rem; }

/* Display: THC Core's settings form, as in the old panel. */
.thc-bar__panel--display .thc-display__form { padding: 0 .35rem; }
.thc-bar__panel--display .thc-display__more { margin: .45rem .35rem 0; }

.thc-bar .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}

/* High contrast and dark */
html[data-thc-contrast="high"] .thc-bar__panel { border: 2px solid #000; }
html[data-thc-contrast="high"] .thc-bar .thc-bar__item[aria-expanded="true"] { box-shadow: inset 0 -3px 0 #000; }
html[data-thc-theme="dark"] .thc-bar .thc-bar__btn:not(.thc-bar__btn--quiet),
html[data-thc-theme="dark"] .thc-bar .thc-bar__btn:not(.thc-bar__btn--quiet):hover,
html[data-thc-theme="dark"] .thc-bar__tag,
html[data-thc-theme="dark"] .thc-bar__count,
html[data-thc-theme="dark"] .thc-more__count,
html[data-thc-theme="dark"] .thc-jump__link:hover { color: #15130f; }
html[data-thc-theme="dark"] .thc-bar__panel { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }

/* ---------- 4. [thc_resource_links] ---------- */

.thc-jump { margin: 0; }
.thc-jump__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.thc-jump__list > li { margin: 0; }
.thc-jump__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem;
  border: 1px solid var(--thc-b-deep); border-radius: 999px; background: var(--thc-b-raised);
  color: var(--thc-b-deep); font-weight: 700; line-height: 1.2; text-decoration: none;
}
.thc-jump__link:hover { background: var(--thc-b-deep); color: #fff; }
.thc-jump__link:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }

/* ---------- 5. THC 2026-10-05 (1.12.0): phone bottom tab bar, slim header, compact footer, site map ----------
   Everything phone-only sits inside one media query (under 768px), so tablets and desktops are unchanged. The
   selectors start "html body" so they outrank the phone layouts above (feature row, subgrid) without !important.
   Text size, spacing, typeface and contrast come from Display & reading through the same rem sizes and tokens. */

:root { --thc-tabbar-h: 56px; }

/* Wider screens: the phone-only parts are never shown. */
.thc-tabbar,
.thc-mini-footer { display: none; }
@media (min-width: 768px) {
  .thc-bar .thc-bar__list.thc-bar__list--phone { display: none !important; }
}

@media (max-width: 767.98px) {
  /* -- the slim header: logo · Support · Search · Favs · My THC (1.13.0, the tab reading Favorites until 1.13.1; logo · Support · Search · Profile in
     1.12.53; logo · Search · Support · bell before that). The bell (Updates) is not shown here: its dot is on My THC. -- */
  html body .thc-bar-header.thc-bar-header--slim .thc-site-header__inner {
    display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
    column-gap: .5rem; row-gap: 0; padding-block: .3rem;
  }
  html body .thc-bar-header.thc-bar-header--slim .thc-site-brand { flex: 1 1 auto; min-width: 0; grid-column: auto; grid-row: auto; }
  html body .thc-bar-header.thc-bar-header--slim .thc-site-brand .custom-logo { width: 112px; max-height: 44px; }
  html body .thc-bar-header.thc-bar-header--slim .thc-site-header__actions { display: flex; flex: 0 0 auto; width: auto; min-width: 0; }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] {
    display: flex; align-items: center; gap: .1rem; width: auto; margin: 0;
    grid-column: auto; grid-row: auto; pointer-events: auto;
  }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] > .thc-bar__list { display: contents; pointer-events: auto; }
  /* Every other item stays in the page (its panel can still open from More) with its icon hidden. */
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot:not(.thc-bar__slot--search):not(.thc-bar__slot--favorites):not(.thc-bar__slot--account) { display: contents; }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot:not(.thc-bar__slot--search):not(.thc-bar__slot--favorites):not(.thc-bar__slot--account) > .thc-bar__item { display: none; }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot.thc-bar__slot--cart { display: none; }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--search,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--favorites,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--account,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__pslot { display: flex; margin: 0; padding: 0; pointer-events: auto; list-style: none; }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--search > .thc-bar__item,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--favorites > .thc-bar__item,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--account > .thc-bar__item,
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__pslot > .thc-bar__item {
    min-width: 3.4rem; min-height: 48px; padding: .25rem .2rem; gap: .15rem;
  }
  /* THC 2026-11-17 (1.13.0): four items beside the logo (Support, Search, Favorites, My THC). On the narrowest phones
     the items and the logo each give up a little so nothing overlaps; every item is still 48px tall and at least 44px
     wide. */
  @media (max-width: 389.98px) {
    html body .thc-bar-header.thc-bar-header--slim .thc-site-header__inner { column-gap: .25rem; }
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] { gap: 0; }
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--search > .thc-bar__item,
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--favorites > .thc-bar__item,
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__slot--account > .thc-bar__item,
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__pslot > .thc-bar__item { min-width: 2.75rem; padding-inline: .1rem; }
    html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__label { font-size: .66rem; }
    html body .thc-bar-header.thc-bar-header--slim .thc-site-brand .custom-logo { width: min(112px, 27vw); height: auto; }
  }
  html body .thc-bar-header--slim .thc-bar[data-thc-bar-slim] .thc-bar__label { font-size: .72rem; letter-spacing: 0; }
  /* The search and Profile panels (and Display & reading, opened from More) drop below the header, full width. */
  html body .thc-bar-header--slim .thc-bar__panel { left: .5rem; right: .5rem; width: auto; }

  /* -- the bottom tab bar -- */
  .thc-tabbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; /* above the page, under the open
    header panels, the cookie notice (99990) and WooCommerce's cart drawer */
    width: 100%; margin: 0; box-sizing: border-box;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--thc-b-raised); color: var(--thc-b-text);
    border-top: 1px solid var(--thc-b-border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  }
  .thc-tabbar.has-open { z-index: 10000001; } /* the open More sheet sits above the cookie notice, like the header's panels */
  .thc-tabbar__list {
    list-style: none; margin: 0; padding: 0;
    /* 1.14.0: one equal column per tab that is showing (a section someone has hidden takes none), instead of a fixed
       count from the server. */
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  }
  .thc-tabbar__slot { display: flex; min-width: 0; margin: 0; padding: 0; }
  .thc-tabbar__slot::marker { content: none; }
  .thc-tabbar .thc-tabbar__tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    box-sizing: border-box; width: 100%; min-width: 0; height: calc(var(--thc-tabbar-h) - 1px); min-height: 48px; margin: 0; padding: .2rem 0 .25rem;
    border: 0; border-radius: 0; background: transparent; color: var(--thc-b-text);
    font: inherit; line-height: 1; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  .thc-tabbar__icon { display: inline-flex; line-height: 0; position: relative; }
  .thc-tabbar .thc-tabbar__icon .thc-bar__svg { width: 1.375rem; height: 1.375rem; } /* 22px at the default text size */
  .thc-tabbar__label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .66rem; font-weight: 600; line-height: 1.15; white-space: nowrap; } /* about 10.5px */
  .thc-tabbar .thc-tabbar__tab:hover { background: var(--thc-b-muted); }
  .thc-tabbar .thc-tabbar__tab:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: -3px; }
  /* The current section, and More while its sheet is open: the deep colour and a bar along the top edge. */
  .thc-tabbar .thc-tabbar__tab.is-current,
  .thc-tabbar .thc-tabbar__tab[aria-expanded="true"] { color: var(--thc-b-deep); box-shadow: inset 0 3px 0 var(--thc-b-deep); }
  .thc-tabbar .thc-tabbar__tab.is-current .thc-tabbar__label,
  .thc-tabbar .thc-tabbar__tab[aria-expanded="true"] .thc-tabbar__label { font-weight: 700; }
  .thc-tabbar .thc-tabbar__tab[aria-expanded="true"] { background: var(--thc-b-muted); }
  html[data-thc-contrast="high"] .thc-tabbar { border-top: 2px solid #000; }
  html[data-thc-contrast="high"] .thc-tabbar .thc-tabbar__tab.is-current,
  html[data-thc-contrast="high"] .thc-tabbar .thc-tabbar__tab[aria-expanded="true"] { box-shadow: inset 0 4px 0 #000; text-decoration: underline; text-underline-offset: 2px; }
  html[data-thc-theme="dark"] .thc-tabbar { box-shadow: 0 -4px 16px rgba(0, 0, 0, .4); }
  /* Very large text: labels shrink to fit five across rather than wrapping. */
  html[data-thc-font="dyslexic"] .thc-tabbar__label { font-size: min(.66rem, calc((100vw - 1rem) / var(--thc-tabbar-n, 5) / 6.4)); }

  /* -- the More sheet: slides up from just above the bar -- */
  .thc-tabbar .thc-bar__panel.thc-tabbar__sheet {
    position: fixed; top: auto; left: .5rem; right: .5rem; width: auto;
    bottom: calc(var(--thc-tabbar-h) + env(safe-area-inset-bottom, 0px) + .35rem);
    max-height: var(--thc-bar-panel-max, 70vh);
    border-radius: 14px; box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
    animation: thc-sheet-up .2s ease-out;
  }
  @keyframes thc-sheet-up { from { transform: translateY(1.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
  .thc-more { list-style: none; margin: 0; padding: 0; }
  .thc-more__row { margin: 0; padding: 0; border-top: 1px solid var(--thc-b-border); }
  .thc-more__row:first-child { border-top: 0; }
  .thc-more__link,
  .thc-more__sum {
    display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .45rem .6rem; border-radius: 8px;
    color: var(--thc-b-deep); font-weight: 600; text-decoration: none; cursor: pointer; list-style: none;
  }
  .thc-more__sum::-webkit-details-marker { display: none; }
  .thc-more__sum::marker { content: none; }
  .thc-more__text { flex: 1 1 auto; min-width: 0; }
  .thc-more__icon { display: inline-flex; line-height: 0; color: var(--thc-b-text); }
  .thc-more__icon .thc-bar__svg { width: 1.25rem; height: 1.25rem; }
  .thc-more__chev { flex: none; width: .55rem; height: .55rem; margin-inline-end: .2rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
  .thc-more__det[open] > .thc-more__sum .thc-more__chev { transform: rotate(225deg); }
  .thc-more__link:hover, .thc-more__sum:hover { background: var(--thc-b-muted); }
  .thc-more__link:hover .thc-more__text, .thc-more__sum:hover .thc-more__text { text-decoration: underline; text-underline-offset: 2px; }
  .thc-more__link:focus-visible, .thc-more__sum:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 0; }
  .thc-more__body { padding: 0 0 .5rem 1.4rem; }
  /* 1.12.53: the cart's count beside the Shop row's name. */
  .thc-more__count {
    flex: none; box-sizing: border-box; min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px;
    background: var(--thc-b-deep); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.4rem; text-align: center;
  }
  .thc-more__count[hidden] { display: none; }
  /* 1.12.53: More has its own rows for Display & reading, Contact and The app, so the Profile row's copy of them is left out. */
  .thc-tabbar .thc-bar__group--util { display: none; }
  /* In the Play app, the App panel's install wording and button (THC PWA hides them in the header's copy by id). */
  html.thc-play-app .thc-tabbar [data-thc-bar-app-status],
  html.thc-play-app .thc-tabbar [data-thc-bar-install-row] { display: none !important; }

  /* -- room for the bar: the page never ends behind it -- */
  body.thc-has-tabbar { padding-bottom: calc(var(--thc-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  body:has(> .thc-tabbar) { padding-bottom: calc(var(--thc-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  /* Keyboard focus and jumps to a spot on the page stay clear of the bar. */
  html:has(body.thc-has-tabbar) { scroll-padding-bottom: calc(var(--thc-tabbar-h) + 8px); }

  /* -- the compact footer in place of the theme footer (whose markup stays for wider screens) -- */
  body.thc-has-tabbar .thc-site-footer { display: none; }
  body:has(> .thc-tabbar) .thc-site-footer { display: none; }
  body.thc-has-tabbar footer.wp-block-template-part:has(> .thc-site-footer) { display: none; }
  body.thc-has-tabbar .thc-mini-footer,
  body:has(> .thc-tabbar) .thc-mini-footer {
    display: block; margin: 2rem 0 0; padding: 1rem 1rem 1.1rem;
    border-top: 1px solid var(--thc-b-border); background: var(--thc-b-muted); color: var(--thc-b-text);
    font-size: .9rem; line-height: 1.4; text-align: center;
  }
  .thc-mini-footer__links { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem 1.1rem; }
  .thc-mini-footer__links > li { margin: 0; }
  .thc-mini-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--thc-b-deep); font-weight: 600; }
  .thc-mini-footer__links a:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
  .thc-mini-footer__line { margin: 0; font-size: .82rem; opacity: .9; }
  html[data-thc-theme="dark"] body .thc-mini-footer { background: #15130f; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .thc-tabbar .thc-bar__panel.thc-tabbar__sheet { animation: none; }
  .thc-more__chev { transition: none; }
}
@media (max-width: 767.98px) {
  html[data-thc-motion="reduce"] .thc-tabbar .thc-bar__panel.thc-tabbar__sheet { animation: none; }
  html[data-thc-motion="reduce"] .thc-more__chev { transition: none; }
}

/* [thc_sitemap]: plain grouped lists on /sitemap/. */
.thc-sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem 2rem; }
.thc-sitemap__group { margin: 0; }
.thc-sitemap__title { margin: 0 0 .4rem; font-size: 1.15rem; }
.thc-sitemap__list { margin: 0; padding-inline-start: 1.1rem; }
.thc-sitemap__list > li { margin: .2rem 0; }
/* 1.12.11: off-site links on the site map say they open a new tab, for screen readers only. */
.thc-sitemap .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}

/* THC 2026-10-09 (1.12.7): the My courses ↔ catalog line ("Browse all courses →" / "Go to my courses →"), every screen
   size: a plain text link row, 14px at the default text size (.875rem, so Display & reading's text size still applies). */
.thc-courses-switch { margin: 0 0 .75rem; font-size: .875rem; line-height: 1.4; color: var(--thc-b-text); }
.thc-courses-switch a { display: inline-flex; align-items: center; min-height: 44px; color: var(--thc-b-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.thc-courses-switch a:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }


/* ---------- 6. THC 2026-11-17 (1.13.0, thc-workboard WB-136): a menu that scrolls says so; Favorites ---------- */

/* A menu that has to scroll (Micha: "We apparently need a scrollbar as a fallback"). Some systems hide scrollbars
   until the pointer is on them, so this one is drawn by the page and is always there while the menu can scroll; and
   while there is more below, the foot of the menu fades (is-more, set by thc-bar.js). */
.thc-bar__panel::-webkit-scrollbar { width: 12px; }
.thc-bar__panel::-webkit-scrollbar-track { background: var(--thc-b-muted); border-radius: 0 12px 12px 0; }
.thc-bar__panel::-webkit-scrollbar-thumb { background: var(--thc-b-deep); border-radius: 999px; border: 3px solid var(--thc-b-muted); min-height: 44px; }
@supports not selector(::-webkit-scrollbar) {
  .thc-bar__panel { scrollbar-width: thin; scrollbar-color: var(--thc-b-deep) var(--thc-b-muted); }
}
.thc-bar__panel.is-more::after {
  content: ""; display: block; position: sticky; bottom: -.7rem; height: 2.4rem; margin: -2.4rem -.6rem 0;
  background: linear-gradient(to bottom, transparent, var(--thc-b-raised) 85%); pointer-events: none;
}

/* Favorites: the panel. */
.thc-favs > .thc-bar__actions--top { margin: .2rem 0 .5rem; padding: 0 .35rem .6rem; border-top: 0; border-bottom: 1px solid var(--thc-b-border); }
.thc-favs [hidden] { display: none !important; }
.thc-favs__status { margin: 0 .6rem; font-size: .9rem; font-weight: 600; color: var(--thc-b-deep); }
.thc-favs__status:empty { display: none; }
.thc-favs__status:not(:empty) { margin-bottom: .35rem; }
.thc-favs__empty, .thc-favs__note, .thc-favs__hint { margin: .3rem .6rem; font-size: .9rem; }
.thc-favs__note { opacity: .9; }
.thc-favs__note a { color: var(--thc-b-deep); font-weight: 600; }
/* Manage favorites / Done stays in reach at the foot of the panel however long the list above it is (and takes the
   place of the fade there). */
.thc-favs__foot { position: sticky; bottom: -.7rem; z-index: 1; margin-top: .5rem; padding-bottom: .7rem; background: var(--thc-b-raised); }
.thc-bar__panel--favorites.is-more::after { content: none; }
/* Manage: each favorite is a row with its name and three buttons (move up, move down, remove), each 44px. */
.thc-favs__row { display: flex; align-items: center; gap: .15rem; min-height: 48px; padding: .1rem .1rem .1rem .6rem; border-radius: 8px; }
.thc-favs__row + .thc-favs__row { border-top: 1px solid var(--thc-b-border); border-radius: 0; }
.thc-favs__name { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--thc-b-deep); overflow-wrap: anywhere; }
.thc-favs__tools { display: flex; flex: none; gap: .1rem; }
.thc-favs__tool {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--thc-b-deep); cursor: pointer; line-height: 0;
}
.thc-favs__tool .thc-bar__svg { width: 20px; height: 20px; }
.thc-favs__tool:hover { background: var(--thc-b-muted); }
.thc-favs__tool:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 1px; }
.thc-favs__tool[aria-disabled="true"] { opacity: .35; cursor: default; }
.thc-favs__tool[aria-disabled="true"]:hover { background: transparent; }
.thc-favs__manage { margin-top: .5rem; padding: .55rem .35rem .2rem; border-top: 1px solid var(--thc-b-border); }
.thc-favs__manage .thc-favs__hint { margin: 0 .25rem .5rem; }
.thc-favs__label { display: block; margin: 0 .25rem .2rem; font-weight: 700; font-size: .9rem; }
.thc-favs__pick-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.thc-favs__pick-row select {
  flex: 1 1 12rem; min-width: 0; min-height: 44px; padding: .35rem .5rem; border: 1px solid var(--thc-b-deep); border-radius: 8px;
  background: var(--thc-b-raised); color: var(--thc-b-text); font: inherit;
}
.thc-favs__pick-row select:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
.thc-bar .thc-favs__pick-row .thc-bar__btn { flex: 0 0 auto; }
.thc-favs__reset { margin: .5rem .25rem 0; }
.thc-favs__text-btn {
  min-height: 44px; margin: 0; padding: .3rem 0; border: 0; background: transparent; color: var(--thc-b-deep);
  font: inherit; font-size: .9rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.thc-favs__text-btn:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
.thc-favs__carry { margin: .2rem 0 .5rem; padding: .55rem .6rem; border-radius: 10px; background: var(--thc-b-muted); }
.thc-favs__carry p { margin: 0 0 .45rem; }
.thc-favs__carry-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 !important; }
.thc-bar .thc-bar__btn[disabled] { opacity: .55; cursor: default; filter: none; }

/* Favorites on a page (first thing on My THC): a heading with a Manage button, then the links as a row of buttons. */
.thc-favs-strip {
  box-sizing: border-box; margin: 0 0 1.25rem; padding: .8rem .9rem .9rem; border: 1px solid var(--thc-b-border); border-radius: 12px;
  background: var(--thc-b-raised); color: var(--thc-b-text);
}
.thc-favs-strip[hidden] { display: none; }
.thc-favs-strip__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .5rem; }
.thc-favs-strip__title { margin: 0; font-size: 1.1rem; line-height: 1.25; }
.thc-favs-strip__manage {
  min-height: 44px; margin: 0; padding: .3rem .9rem; border: 1px solid var(--thc-b-deep); border-radius: 999px; background: transparent;
  color: var(--thc-b-deep); font: inherit; font-weight: 700; cursor: pointer;
}
.thc-favs-strip__manage[hidden] { display: none; }
.thc-favs-strip__manage:hover { background: var(--thc-b-muted); }
.thc-favs-strip__manage:focus-visible, .thc-favs-strip__link:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
.thc-favs-strip__list { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.thc-favs-strip__list > li { margin: 0; padding: 0; }
.thc-favs-strip__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .9rem; border-radius: 999px;
  background: var(--thc-b-muted); color: var(--thc-b-deep); font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.thc-favs-strip__link:hover { text-decoration: underline; text-underline-offset: 2px; }
.thc-favs-strip__empty { margin: 0; }
.thc-favs-strip__empty[hidden] { display: none; }


/* ---------- 7. THC 2026-11-17 (1.14.0, thc-workboard WB-136): Customize the menu ---------- */

/* A section someone has hidden (html[data-thc-hide], set by the script printed with the bar): its tab in the top bar
   is moved out of the row by that script; here it leaves the phone bottom bar, and Shop leaves the More sheet. */
html[data-thc-hide~="courses"] .thc-tabbar__slot--courses,
html[data-thc-hide~="resources"] .thc-tabbar__slot--tools,
html[data-thc-hide~="fun"] .thc-tabbar__slot--fun,
html[data-thc-hide~="care"] .thc-tabbar__slot--care,
html[data-thc-hide~="shop"] .thc-more__row--shop { display: none !important; }

/* The panel: one tick box per section, each row a 44px target. */
.thc-tabs [hidden] { display: none !important; }
.thc-tabs__set { margin: 0; padding: 0; border: 0; min-width: 0; }
.thc-tabs__legend { margin: 0 .6rem .15rem; padding: 0; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.thc-tabs__list { list-style: none; margin: 0; padding: 0; }
.thc-tabs__row { margin: 0; padding: 0; }
.thc-tabs__row + .thc-tabs__row { border-top: 1px solid var(--thc-b-border); }
.thc-tabs__label { display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: .2rem .6rem; border-radius: 8px; cursor: pointer; }
.thc-tabs__label:hover { background: var(--thc-b-muted); }
.thc-tabs__box { flex: none; width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--thc-b-deep); }
.thc-tabs__box:focus-visible { outline: 2px solid var(--thc-b-deep); outline-offset: 2px; }
.thc-tabs__icon { display: inline-flex; flex: none; line-height: 0; color: var(--thc-b-deep); }
.thc-tabs__icon .thc-bar__svg { width: 22px; height: 22px; }
.thc-tabs__name { font-weight: 600; color: var(--thc-b-deep); }
.thc-tabs__box:not(:checked) ~ .thc-tabs__icon, .thc-tabs__box:not(:checked) ~ .thc-tabs__name { opacity: .6; }
.thc-tabs__status { margin: .35rem .6rem 0; font-size: .9rem; font-weight: 600; color: var(--thc-b-deep); }
.thc-tabs__status:empty { display: none; }
/* In the My THC panel: the sections this person has hidden, and the way back. */
.thc-bar__group--hidden[hidden], .thc-bar__group--hidden [hidden] { display: none !important; }
.thc-bar__group--hidden { margin-bottom: .45rem; padding-bottom: .2rem; border-bottom: 1px solid var(--thc-b-border); }
.thc-tabs__back { margin: 0 .6rem; }
