/* ==========================================================
   FOREST-BASED THERAPY — TOOL · v0.5
   Restyled to match the Pocketbook design system.
   Palette: warm cream paper, low-chroma forest greens, ember accent.
   Type: Montserrat (display), Open Sans (body), Playfair (occasional serif).
   ========================================================== */


html { height: 100%; background: transparent; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Open Sans', -apple-system, sans-serif;
  background: transparent;
  color: var(--ink);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  letter-spacing: 0.005em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── LANGUAGE TOGGLE ── */
.lang-bar {
  position: fixed;
  top: 16px;
  right: 24px;
  display: flex;
  gap: 4px;
  z-index: 100;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: all 0.18s;
}

.lang-btn.active {
  background: var(--forest-ink);
  color: var(--paper-pure);
}



/* ── ROLE-AWARE VISIBILITY ── */
body[data-role="participant"] [data-role-only="practitioner"] { display: none !important; }
body[data-role="practitioner"] [data-role-only="participant"] { display: none !important; }

/* The rules above only hide the *wrong* role's content once JS has set
   data-role on <body> — safe for every [data-role-only] that lives inside
   a .screen, since .screen defaults to display:none until .active is
   added by JS regardless. But the persistent nav groups and #entry-screen
   (which is marked .active directly in the markup, not by JS) have no
   such default-hidden ancestor, so both variants render together for as
   long as the page takes to parse and run the scripts that set data-role
   — briefly showing Plan/Run/Reflect/Reference stacked with the
   participant nav links, and both entry-screen pathway lists stacked on
   the main screen. Default these two spots to hidden and opt back in
   per role, so there's never a frame where both show. */
.site-nav-group[data-role-only],
#entry-screen > [data-role-only] { display: none; }
body[data-role="practitioner"] .site-nav-group[data-role-only="practitioner"] { display: flex; }
body[data-role="participant"] .site-nav-group[data-role-only="participant"] { display: flex; }
body[data-role="practitioner"] #entry-screen > [data-role-only="practitioner"],
body[data-role="participant"] #entry-screen > [data-role-only="participant"] { display: block; }

/* ── HEADER ── */
header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--forest-mist);
  margin-bottom: 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 14px;
  gap: 16px;
}

.tree-mark { width: 40px; height: 40px; flex-shrink: 0; }

.header-text h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--forest-ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.header-text p {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── HEADER NAV & SEARCH ── */
/* Skip link (WCAG 2.4.1) — visually hidden until it receives focus,
   which makes it the very first tab stop on the page. */
.skip-link {
  position: absolute;
  top: -60px;
  left: 8px;
  z-index: 3000;
  background: var(--forest-ink);
  color: var(--paper-pure);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* Visually-hidden utility (aria-live regions, etc.) — kept distinct from
   .skip-link, which needs to become visible on focus. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Global keyboard-focus indicator. Nothing in this file provided one
   before this section, so this doesn't override or duplicate anything —
   it's the first one. :focus-visible degrades harmlessly (simply
   unmatched, not an error) on anything old enough not to support it. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--forest-deep);
  outline-offset: 2px;
}

/* Persistent, role-aware nav. Practitioner mode shows Plan/Run/Reflect/
   Reference; participant mode shows the 4 orientation steps. Only the
   group matching data-role-only is visible (existing rule, reused
   as-is: body[data-role="…"] […] { display:none }). */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav-group { display: flex; flex-wrap: wrap; gap: 4px; }

.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.site-nav-link:hover { color: var(--forest-deep); background: var(--paper-card); }
.site-nav-link.active {
  color: var(--forest-deep);
  background: var(--paper-pure);
  border-color: var(--forest-mist);
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.18s;
}
.search-trigger:hover { border-color: var(--forest-soft); color: var(--forest-deep); }
.search-trigger-kbd {
  font-size: 10px;
  color: var(--ink-faint);
  border: 1px solid var(--forest-mist);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Open Sans', sans-serif;
}

/* Mode switch — same pill/segmented-control language as .lang-bar/.lang-btn,
   just sized up to the 44px minimum hit target since (unlike the
   pre-existing language toggle) this is a new control. */
.mode-switch {
  display: flex;
  gap: 4px;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.mode-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.18s;
}
.mode-btn.active { background: var(--forest-ink); color: var(--paper-pure); }

/* Quick links injected into the focused Pocketbook (Plan) screen so the
   Pre-Session Checklist and Session Structure Guide are one click away
   without a trip back through the header nav. */
.plan-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: -8px 0 22px;
}
.plan-quicklinks a {
  font-size: 12px;
  font-weight: 500;
  color: var(--forest-mid);
  text-decoration: none;
  border-bottom: 1px dotted var(--forest-soft);
}
.plan-quicklinks a:hover { color: var(--forest-deep); }

/* Generic "found via search" highlight, reused across screens (reference
   tiers, guide chapters). Distinct from .activity-item.highlight, which
   is specific to the Pocketbook accordion styling. */
.search-highlight {
  box-shadow: 0 0 0 3px rgba(127,163,150,0.35);
  border-radius: var(--r-md);
  transition: box-shadow 0.3s ease;
}

/* Locks the page's own scroll while a full-viewport fixed overlay (Run
   Mode, the search dialog) is open, so scrolling inside the overlay can't
   also move the page behind it — the overlay being position:fixed;inset:0
   makes it LOOK like the only thing on screen, but without this the body
   underneath was still scrollable, producing exactly the kind of
   background/foreground double-scroll this class exists to prevent.
   Toggled by pbStartRunMode()/pbCloseRunMode() in pocketbook.js and
   openSearch()/closeSearch() in search.js. */
body.no-scroll { overflow: hidden; }

/* ─── SEARCH DIALOG (⌘K / Ctrl+K) ─── */
.search-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,48,42,0.45);
  backdrop-filter: blur(6px);
  z-index: 2500;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: pbFadeIn 0.2s ease;
}
.search-dialog-overlay.active { display: flex; }
.search-dialog {
  background: var(--paper-pure);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pbSlideUp 0.22s ease;
}
.search-dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--forest-mist);
}
.search-dialog-head svg { color: var(--ink-faint); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  min-height: 44px;
}
.search-input::placeholder { color: var(--ink-faint); }
.search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--ink-faint);
  line-height: 1;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.search-close:hover { color: var(--ink); background: var(--paper-card); }
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.search-group { margin-bottom: 4px; }
.search-group-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  padding: 10px 10px 4px;
}
.search-result {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  min-height: 44px;
  font-family: 'Open Sans', sans-serif;
}
.search-result:hover, .search-result:focus-visible { background: var(--paper-card); }
.search-result-title { font-size: 13.5px; font-weight: 500; color: var(--forest-ink); }
.search-result-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-empty { padding: 28px 10px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ── SCREENS ── */
#entry-screen { animation: fadeUp 0.5s ease both; }

.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.4s ease backwards; }

/* ── ENTRY ── */
.entry-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-soft);
  margin-bottom: 18px;
}

.entry-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--forest-ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
  max-width: 560px;
}

.entry-sub {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 300;
  margin-bottom: 48px;
  max-width: 480px;
  line-height: 1.65;
}

.pathways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.pathway-card {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 28px 28px 24px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pathway-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--forest-deep);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: top;
}

.pathway-card:hover {
  border-color: var(--forest-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pathway-card:hover::before { transform: scaleY(1); }

.pathway-icon {
  font-size: 22px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  color: var(--forest-deep);
}
.pathway-icon svg { width: 20px; height: 20px; }

.pathway-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}

.pathway-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: 300;
}

.pathway-arrow {
  display: inline-block;
  margin-top: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── SECTION SCREEN ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  margin-bottom: 32px;
  padding: 6px 0;
  border: none;
  background: none;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--forest-deep); }

.section-header { margin-bottom: 40px; }

.section-header .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-deep);
  background: transparent;
  border: 1px solid var(--forest-mist);
  padding: 5px 12px 5px 10px;
  border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.section-header .badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--forest-deep);
  display: inline-block;
}

.section-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: var(--fs-h1);
  font-weight: 500;
  color: var(--forest-ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.section-header p {
  font-size: var(--fs-sub);
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.65;
  max-width: 560px;
}

.section-sub {
  font-size: var(--fs-sub);
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 560px;
}

/* ── MODULES ── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  align-items: start;
}
/* "What is FBT?", "Before your first session", "Learn More", and Implement
   in Practice's tool cards all stack single-column at every viewport width
   instead of the auto-fit default above, which would otherwise sit cards
   side by side on wider screens (only naturally collapsing to one column
   on narrow/mobile widths, where auto-fit runs out of room anyway). */
#pwhat-screen .modules-grid,
#pbefore-screen .modules-grid,
#learn-screen .modules-grid,
#implement-screen .modules-grid {
  grid-template-columns: 1fr;
}
/* Reflect's remaining module-cards (self-reflection, indicators — glossary
   was removed) stack single-column too, and drop the boxed card look
   entirely: no border/background/radius, just open content separated by a
   rule, since this is working reflection material feeding the report, not
   reference cards to browse. */
#reflect-screen .modules-grid {
  grid-template-columns: 1fr;
  gap: 28px;
}
#reflect-screen .module-card {
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--forest-mist);
}
#reflect-screen .module-card:last-child { border-bottom: none; padding-bottom: 0; }
#reflect-screen .module-card .module-body { padding: 0; }

/* Reference page's own search — distinct from the global ⌘K dialog's
   .search-input, but same visual language (bordered pill, icon inline). */
.reference-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 0 14px;
  min-height: 44px;
  background: var(--paper-pure);
  margin-bottom: 18px;
  color: var(--ink-faint);
}
.reference-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  min-height: 42px;
}
.reference-search-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-faint);
  margin: 4px 0 18px;
}
/* Same-specificity author rule above would otherwise beat the UA
   stylesheet's [hidden] { display: none }, since author origin wins ties
   — this one line is what actually lets refApplyFilter() hide the
   message by toggling the hidden attribute. */
.reference-search-empty[hidden] { display: none; }
.ref-clear-btn {
  padding: 6px 12px;
  min-height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--forest-deep);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.ref-clear-btn:hover { border-color: var(--forest-soft); background: var(--paper); }

/* ── REFERENCE: type filter chips + result count ── */
.ref-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ref-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.ref-filter-chip:hover { border-color: var(--forest-soft); color: var(--ink-soft); }
.ref-filter-chip[aria-pressed="true"] {
  background: var(--forest-ink);
  border-color: var(--forest-ink);
  color: var(--paper-pure);
}
.ref-count { font-size: 12px; color: var(--ink-faint); margin: 0 0 18px; }

/* ── REFERENCE: absolute contraindications — always visible, never
   collapsible, never touched by refApplyFilter(). Kept visually distinct
   (safety-tinted heading + badge) so it reads as categorically different
   from the filterable list below it, not just "first in the list". ── */
.ref-absolute { margin-bottom: 28px; }
.ref-absolute-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ref-absolute-head h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--safety-ink);
  margin: 0;
}
.ref-absolute-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ember);
  background: var(--paper-pure);
  border: 1px solid #E5C7B2;
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.module-card {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.module-card:hover { border-color: var(--forest-soft); box-shadow: var(--shadow-sm); }
.module-card.open { border-color: var(--forest-mid); box-shadow: var(--shadow-md); }

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
}

.module-header-left { display: flex; align-items: center; gap: 12px; }

.module-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.module-title {
  font-family: 'Montserrat', sans-serif;
  font-size: var(--fs-h3);
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
}
.module-tag { font-size: 10.5px; color: var(--ink-faint); font-weight: 400; margin-top: 2px; letter-spacing: 0.04em; }

.module-toggle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--forest-mist);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-faint);
  transition: all 0.2s; flex-shrink: 0;
  background: var(--paper);
}

.module-card.open .module-toggle {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: var(--paper-pure);
  transform: rotate(45deg);
}

/* Door modules: show an arrow rather than a toggle */
.module-card.is-door .module-toggle {
  font-size: 0;
  border-color: transparent;
  background: transparent;
  width: 28px; height: 28px;
  position: relative;
}
.module-card.is-door .module-toggle::before {
  content: '→';
  font-size: 17px;
  color: var(--ink-faint);
  transform: none;
  transition: transform 0.2s, color 0.2s;
  display: inline-block;
}
.module-card.is-door:hover .module-toggle::before {
  color: var(--forest-deep);
  transform: translateX(3px);
}
.module-card.is-door.open .module-toggle {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.module-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--forest-mist); }
.module-card.open .module-body { display: block; }

/* ── MODULE-AS-PAGE (door mode) ── */
.screen.focus-mode .section-header,
.screen.focus-mode > .back-btn { display: none; }
.screen.focus-mode .modules-grid { display: block; grid-template-columns: 1fr; }
.screen.focus-mode .module-card:not(.is-focused) { display: none; }
.screen.focus-mode .module-card.is-focused {
  grid-column: 1 / -1;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-top: 4px;
}
.screen.focus-mode .module-card.is-focused .module-header {
  padding: 0 0 20px 0;
  cursor: default;
  border-bottom: 1px solid var(--forest-mist);
  margin-bottom: 28px;
}
.screen.focus-mode .module-card.is-focused .module-header .module-toggle { display: none; }
.screen.focus-mode .module-card.is-focused .module-header-right { display: none; }
/* Pocketbook in focus mode: hide the redundant "Pocket Guide to Activities
   / 12 activities · select to expand" title strip — the injected back-link
   already provides navigation context. */
.screen.focus-mode #mod-pocket.is-focused .module-header { display: none; }
.screen.focus-mode .module-card.is-focused .module-icon {
  width: 48px; height: 48px; font-size: 22px;
  background: var(--paper-card);
}
.screen.focus-mode .module-card.is-focused .module-title {
  font-size: 28px; font-weight: 500;
  letter-spacing: -0.012em;
}
.screen.focus-mode .module-card.is-focused .module-tag {
  font-size: 11.5px; margin-top: 4px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.screen.focus-mode .module-card.is-focused .module-body {
  display: block; padding: 0; border: none;
}
.module-back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft);
  background: none; border: none;
  cursor: pointer; padding: 0;
  margin-bottom: 22px;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.module-back-link:hover { color: var(--forest-deep); }
.module-back-link::before { content: '←'; font-size: 15px; }

/* ── ACTIVITIES ── */
.activities-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.activity-item {
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-pure);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.activity-item:hover { border-color: var(--forest-soft); }
.activity-item.open { border-color: var(--forest-mid); box-shadow: var(--shadow-sm); }

.activity-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--paper-card);
  user-select: none;
  transition: background 0.18s;
}
.activity-item.open .activity-trigger { background: var(--paper-pure); border-bottom: 1px solid var(--forest-mist); }

.activity-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
}

.activity-duration {
  font-size: 10.5px;
  color: var(--ink-soft);
  background: var(--paper);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--forest-mist);
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.activity-detail { display: none; padding: 18px 18px 20px; background: var(--paper-pure); }
.activity-item.open .activity-detail { display: block; }

/* ── DEEP LINK HIGHLIGHT ── */
.activity-item.highlight {
  border-color: var(--forest-mid);
  box-shadow: 0 0 0 3px rgba(127,163,150,0.18);
}

.detail-section { margin-bottom: 14px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  margin-bottom: 6px;
}

.detail-text { font-size: 13px; color: var(--ink); line-height: 1.65; font-weight: 300; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.detail-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--forest-deep);
  border: 1px solid var(--forest-mist);
  font-weight: 400;
}

.detail-text--example {
  font-style: italic;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--paper);
  border-left: 2px solid var(--forest-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ── COPY LINK ── */
.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-weight: 500;
  margin-top: 12px;
  transition: all 0.15s;
}
.copy-link-btn:hover { border-color: var(--forest-soft); color: var(--forest-deep); }
.copy-link-btn.copied { background: var(--forest-deep); color: var(--paper-pure); border-color: var(--forest-deep); }

/* ── LEARN BLOCKS ── */
/* ── REFLECT CARD ENHANCEMENTS ── */
.module-card .module-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: 300;
  margin-top: 6px;
  max-width: 520px;
}
.module-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.module-count-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  white-space: nowrap;
}

/* Reflect prompt cards (numbered) */
.reflect-prompts { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.reflect-prompt {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.reflect-prompt:hover { border-color: var(--forest-soft); }
.reflect-prompt-num {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--forest-mist);
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  margin-top: 2px;
}
.reflect-prompt-body h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.reflect-prompt-body p { font-size: 13px; color: var(--ink-soft); line-height: 1.65; font-weight: 300; }
.reflect-answer-label {
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
  font-weight: 500; margin: 12px 0 6px;
}
.reflect-answer {
  width: 100%;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  background: var(--paper-pure);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}
.reflect-answer:focus { border-color: var(--forest-deep); outline: none; }

/* Indicators check-list style #2 */
.check-list-v2 { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.check-item-v2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--forest-mist);
  cursor: pointer;
  transition: opacity 0.15s;
}
.check-item-v2:last-child { border-bottom: none; }
.check-item-v2 .check-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--forest-soft);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.check-item-v2.checked .check-dot {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
}
.check-item-v2.checked .check-dot::after {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--paper-pure);
}
.check-item-v2 label {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
  cursor: pointer;
  font-weight: 300;
  transition: all 0.15s;
}
.check-item-v2.checked label {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--forest-soft);
}

/* Glossary */
.glossary-list { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.glossary-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--forest-mist);
}
.glossary-item:last-child { border-bottom: none; }
.glossary-term {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--forest-deep);
  margin-bottom: 5px;
  letter-spacing: -0.003em;
}
.glossary-def { font-size: 13px; color: var(--ink-soft); line-height: 1.65; font-weight: 300; }

/* ─── REFLECT: SESSION RECAP + HISTORY ─── */
.reflect-session-recap {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-left: 3px solid var(--forest-deep);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.reflect-session-recap[hidden] { display: none; }
.reflect-session-recap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.reflect-session-recap-eyebrow {
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--forest-deep);
  font-weight: 600;
}
.reflect-session-recap-when { font-size: 12px; color: var(--ink-faint); }
.reflect-session-recap-list { display: flex; flex-direction: column; gap: 10px; }
.reflect-recap-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--forest-mist);
}
.reflect-recap-row:last-child { border-bottom: none; }
.reflect-recap-name { font-size: 13.5px; font-weight: 500; color: var(--forest-ink); }
.reflect-recap-time {
  float: right;
  font-size: 11.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.reflect-recap-note {
  clear: both;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  white-space: pre-wrap;
}
.reflect-session-recap-actions { margin-top: 16px; }

/* Export action panel — always rendered (never [hidden]) unlike the recap
   section above it, so the button is disabled-with-a-reason rather than
   missing whenever the gate (pbUpdateReflectExportGate() in pocketbook.js)
   isn't satisfied yet. */
.reflect-export-panel {
  margin-bottom: 28px;
}
.reflect-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#reflect-export-btn { min-height: 44px; padding: 10px 20px; }
#reflect-export-png-btn { min-height: 44px; min-width: 44px; }
.reflect-export-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
}
.reflect-export-hint:empty { display: none; }

/* Extra report metadata — deliberately plain (no card border/shadow),
   distinct from the boxed .module-card treatment used for self-reflection/
   indicators/glossary above, since this is optional context rather than
   reflection content. */
.reflect-meta-block {
  margin-bottom: 24px;
}
.reflect-meta-block h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--forest-ink);
  margin: 0 0 4px;
}
.reflect-meta-sub {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.reflect-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 420px;
}
.reflect-meta-field-full { grid-column: 1 / -1; }
.reflect-meta-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.reflect-meta-field span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.reflect-meta-field input,
.reflect-meta-field textarea {
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-sm, 6px);
  padding: 9px 11px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-pure);
  min-height: 40px;
}
.reflect-meta-field textarea { resize: vertical; min-height: 60px; }
.reflect-meta-field input:focus,
.reflect-meta-field textarea:focus { border-color: var(--forest-deep); outline: none; }

.reflect-history {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--forest-mist);
}
.reflect-history[hidden] { display: none; }
.reflect-history h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--forest-ink);
  margin-bottom: 14px;
}
.reflect-history-list { display: flex; flex-direction: column; gap: 8px; }
.reflect-history-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
}
.reflect-history-when { font-size: 11.5px; color: var(--ink-soft); }
.reflect-history-bar {
  display: flex;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
}
.reflect-history-seg { height: 100%; min-width: 0; }
.reflect-history-meta {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .reflect-history-row { grid-template-columns: 1fr; }
  .reflect-history-when, .reflect-history-meta { white-space: normal; }
}

.learn-blocks { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.learn-block {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.learn-block h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.learn-block p { font-size: 13px; color: var(--ink-soft); line-height: 1.65; font-weight: 300; }

.evidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  padding: 3px 10px;
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  margin-top: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.evidence-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--forest-deep);
}
.evidence-pill--strong { color: var(--forest-ink); }
.evidence-pill--strong::before { background: var(--forest-ink); }
.evidence-pill--moderate { color: var(--forest-mid); }
.evidence-pill--moderate::before { background: var(--forest-mid); }
.evidence-pill--emerging { color: var(--forest-soft); }
.evidence-pill--emerging::before { background: var(--forest-soft); }

/* ── CHECKLISTS ── */
.assessment-intro { font-size: 13px; color: var(--ink-soft); line-height: 1.65; margin-top: 14px; margin-bottom: 16px; font-weight: 300; }
.check-list { display: flex; flex-direction: column; gap: 6px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.check-item:hover { border-color: var(--forest-soft); background: var(--paper-pure); }
.check-item input[type="checkbox"] { margin-top: 2px; accent-color: var(--forest-deep); width: 15px; height: 15px; flex-shrink: 0; }
.check-item label { font-size: 13px; color: var(--ink); line-height: 1.55; cursor: pointer; font-weight: 300; }
.checklist-note { font-size: 11.5px; color: var(--ink-faint); margin-top: 12px; font-style: italic; }

/* ── ANIMATION ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── VISUAL PANEL ── */
.activity-visual {
  margin-bottom: 16px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
}
.activity-visual svg { display: block; width: 100%; }
.activity-visual img { display: block; width: 100%; }
.visual-caption {
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 8px 12px;
  letter-spacing: 0.04em;
  font-style: italic;
  border-top: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  line-height: 1.55;
}

/* ── ROLE SCREEN ── */
.role-screen-inner {
  text-align: center;
  padding: 56px 0 32px;
}
.role-screen-inner .entry-label { text-align: center; margin-bottom: 12px; }
.role-screen-inner .entry-title { margin-left: auto; margin-right: auto; }
.role-screen-inner .entry-sub { margin-left: auto; margin-right: auto; }

.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 36px;
  text-align: left;
}
.role-card {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-lg);
  padding: 36px 32px 28px;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.role-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--forest-deep);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: top;
}
.role-card:hover {
  border-color: var(--forest-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.role-card:hover::before { transform: scaleY(1); }
.role-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  color: var(--forest-ink);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.role-card .role-card-sub {
  font-size: 10.5px;
  color: var(--forest-soft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 16px;
}
.role-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  font-weight: 300;
}
.role-card .role-examples {
  font-size: 12px;
  color: var(--forest-mid);
  margin-top: 14px;
  font-style: italic;
}
.role-card-arrow {
  display: inline-block;
  margin-top: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── SESSION TIMELINE (participant) ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.timeline-item {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.timeline-item:hover { border-color: var(--forest-soft); }
.timeline-item.open { border-color: var(--forest-mid); box-shadow: var(--shadow-sm); }
.timeline-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.timeline-phase {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  color: var(--forest-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px; font-weight: 500;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.timeline-item.open .timeline-phase { background: var(--forest-deep); color: var(--paper-pure); border-color: var(--forest-deep); }
.timeline-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  flex: 1;
  letter-spacing: -0.005em;
}
.timeline-duration {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.timeline-body {
  display: none;
  padding: 0 18px 16px 64px;
  border-top: 1px solid var(--forest-mist);
}
.timeline-item.open .timeline-body { display: block; padding-top: 14px; }
.timeline-body .sub-section { margin-top: 12px; }
.timeline-body .sub-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--forest-soft); margin-bottom: 5px;
}
.timeline-body .sub-text { font-size: 13px; color: var(--ink); line-height: 1.65; font-weight: 300; }

/* ── DOSAGE GRID ── */
.dosage-grid { display: grid; gap: 8px; margin-top: 14px; }
.dosage-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.9fr;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  align-items: start;
  font-size: 12.5px;
}
.dosage-row.dosage-head {
  background: var(--forest-ink);
  border-color: var(--forest-ink);
  color: var(--paper-pure);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.dosage-cell-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  color: var(--forest-ink);
  font-size: 13px;
  letter-spacing: -0.005em;
}
.dosage-row.dosage-head .dosage-cell-label { color: var(--paper-pure); font-weight: 500; font-size: 10px; font-family: 'Open Sans', sans-serif; }
.dosage-cell { color: var(--ink-soft); line-height: 1.5; font-weight: 300; }
.dosage-row.dosage-head .dosage-cell { color: rgba(255,255,255,0.85); }
@media (max-width: 640px) {
  .dosage-row { grid-template-columns: 1fr; gap: 4px; }
  .dosage-row.dosage-head { display: none; }
  .dosage-cell::before {
    content: attr(data-label);
    display: block;
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--forest-soft); margin-bottom: 2px;
  }
}

/* ── INTEGRATION PAIRING (inside a .ref-panel, see REFERENCE ENTRIES below) ── */
.int-pair {
  font-size: 11.5px;
  color: var(--forest-mid);
  font-style: italic;
  letter-spacing: 0.02em;
  margin-top: 6px;
}

/* ── QUESTION LIST ── */
.q-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 0; }
.q-list li {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-left: 3px solid var(--forest-soft);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 300;
  list-style: none;
}

/* ── REFERENCE TIERS ── */
.tier-header {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest-soft);
  margin: 22px 0 10px;
}
.tier-header:first-child { margin-top: 0; }

/* Two card flavours, shared by both the always-visible absolute
   contraindications (plain h4+p, no accordion — see .ref-absolute above)
   and the flat reference list's entries (.ref-entry, below). Keeping
   these two classnames — rather than inventing new ones for the list —
   is what keeps search.js's live #mod-indications/#mod-contraindications
   .closest('.indication-block, .warn-block') lookup working unmodified
   for every entry type it already indexed. */
.indication-block, .warn-block {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.warn-block {
  background: var(--safety-bg);
  border: 1px solid #E5C7B2;
  border-left: 3px solid var(--ember);
}
.indication-block h4, .warn-block h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.warn-block h4 { color: var(--safety-ink); }
.indication-block p, .warn-block p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; font-weight: 300; margin-bottom: 6px; }
.warn-block p { color: var(--safety-ink); }
.ind-meta { font-size: 11.5px; color: var(--forest-mid); line-height: 1.55; margin-top: 6px; }
.ind-meta strong { font-weight: 500; color: var(--forest-deep); }

/* ── REFERENCE ENTRIES: the flat, independently-expandable list ──
   .ref-entry layers accordion behaviour onto .indication-block/
   .warn-block: trigger row (kind badge, title, optional evidence
   indicator, chevron) always visible; .ref-panel collapses via the
   native [hidden] attribute, toggled by refToggleEntry() in router.js.
   The trigger itself is a real <button>, absolutely positioned to cover
   the whole row (transparent — nothing to see, just a full-row hit
   target) so its accessible name can come from aria-labelledby pointing
   at the entry's own <h4>, keeping that <h4> exactly as it always was
   (plain data-i18n on the h4, or on its first-child span for the
   evidence-bearing Tier-1 entries) rather than nesting it — invalidly —
   inside the button. */
.ref-entry { padding: 0; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.ref-entry.open { border-color: var(--forest-mid); box-shadow: var(--shadow-sm); }
.ref-entry .ref-panel { padding: 0 18px 16px; }
.ref-entry .ref-panel > *:first-child { margin-top: 0; }
.ref-entry .related-reading { margin-top: 12px; }

.ref-trigger-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 18px;
  cursor: pointer;
}
.ref-trigger-row:hover { background: rgba(20,48,42,0.03); }
.warn-block .ref-trigger-row:hover { background: rgba(143,63,31,0.05); }
.ref-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.ref-trigger:focus-visible { outline: 2px solid var(--forest-deep); outline-offset: -2px; }

.ref-kind-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest-deep);
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-pill);
  padding: 3px 9px;
}
.warn-block .ref-kind-badge { color: var(--safety-ink); border-color: #E5C7B2; }

.ref-trigger-row h4 {
  flex: 1 1 auto;
  min-width: 120px;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
  line-height: 1.4;
}
.warn-block .ref-trigger-row h4 { color: var(--safety-ink); }

/* Evidence: bars + a text label together, never colour alone (WCAG
   1.4.1) — the label already carries the same "Strong/Moderate/
   Emerging" text this app's .evidence-pill has always shown, just
   relocated out of the <h4> and into its own indicator here. Fill
   pattern (strong=3 bars, moderate=2, emerging=1) is a static class per
   entry, transcribed once from that same entry's original
   evidence-pill--strong/moderate/emerging class — nothing computed or
   duplicated at runtime. */
.ref-evidence { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ref-ev-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.ref-ev-bar { width: 3px; border-radius: 1px; background: var(--forest-mist); }
.ref-ev-bar:nth-child(1) { height: 8px; }
.ref-ev-bar:nth-child(2) { height: 12px; }
.ref-ev-bar:nth-child(3) { height: 16px; }
.ref-evidence--strong .ref-ev-bar { background: var(--forest-ink); }
.ref-evidence--moderate .ref-ev-bar:nth-child(1),
.ref-evidence--moderate .ref-ev-bar:nth-child(2) { background: var(--forest-mid); }
.ref-evidence--emerging .ref-ev-bar:nth-child(1) { background: var(--forest-soft); }
.ref-ev-label { font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

.ref-chevron { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-faint); transition: transform 0.2s; }
.ref-entry.open .ref-chevron { transform: rotate(180deg); color: var(--forest-deep); }

@media (max-width: 640px) {
  .ref-trigger-row { flex-wrap: wrap; }
  .ref-evidence { order: 3; margin-left: 32px; }
}

/* ── PARTICIPANT EXPERIENCE CARDS ── */
.exp-card {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.exp-card:hover { border-color: var(--forest-soft); }
.exp-card.open { border-color: var(--forest-mid); box-shadow: var(--shadow-sm); }
.exp-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.exp-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.exp-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  flex: 1;
  letter-spacing: -0.005em;
}
.exp-toggle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--forest-mist);
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-faint);
  transition: all 0.2s;
}
.exp-card.open .exp-toggle {
  background: var(--forest-deep); border-color: var(--forest-deep);
  color: var(--paper-pure); transform: rotate(45deg);
}
.exp-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--forest-mist);
}
.exp-card.open .exp-body { display: block; padding-top: 14px; }
.exp-body .sub-section { margin-top: 12px; }
.exp-body .sub-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--forest-soft); margin-bottom: 5px;
}
.exp-body .sub-text { font-size: 13px; color: var(--ink); line-height: 1.65; font-weight: 300; }

/* ── LEAD PARAGRAPH ── */
.lead-p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
  font-weight: 300;
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--forest-soft);
}

/* ── GUIDE SCREEN ── */
.guide-intro {
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-left: 3px solid var(--forest-deep);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin-bottom: 28px;
}
.guide-intro h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  color: var(--forest-ink);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.guide-intro p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
  font-weight: 300;
  margin-bottom: 10px;
}
.guide-intro p:last-child { margin-bottom: 0; }
.guide-meta { font-size: 11.5px; color: var(--forest-mid); letter-spacing: 0.04em; }
.guide-meta strong { color: var(--forest-deep); font-weight: 500; }
.guide-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--forest-deep);
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  margin-top: 12px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.18s;
}
.guide-pdf-link:hover { background: var(--forest-deep); color: var(--paper-pure); border-color: var(--forest-deep); }
.guide-pdf-link.placeholder { opacity: 0.6; cursor: not-allowed; font-style: italic; font-weight: 400; }
.guide-pdf-link.placeholder:hover {
  background: var(--paper-pure); color: var(--forest-deep); border-color: var(--forest-mist);
}

.guide-part { margin-bottom: 36px; }
.guide-part-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--forest-mist);
}
.guide-part-roman {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  color: var(--forest-soft);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  flex-shrink: 0;
}
.guide-part-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  color: var(--forest-ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.guide-part-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: 300;
  margin: 0 0 16px 42px;
}

.guide-chapter {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.guide-chapter:hover {
  border-color: var(--forest-soft);
  background: var(--paper-card);
  transform: translateX(2px);
}
.guide-chapter-num {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  color: var(--forest-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.guide-chapter:hover .guide-chapter-num {
  background: var(--forest-deep);
  color: var(--paper-pure);
  border-color: var(--forest-deep);
}
.guide-chapter-body { flex: 1; min-width: 0; }
.guide-chapter-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.005em;
}
.guide-chapter-pages {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.guide-chapter-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: 300;
}

/* ── RELATED READING ── */
.related-reading {
  font-size: 11.5px;
  color: var(--forest-mid);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--forest-mist);
  display: flex;
  align-items: center;
  gap: 6px;
}
.related-reading::before { content: '→'; font-size: 11px; opacity: 0.7; }
.related-reading a {
  color: var(--forest-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--forest-soft);
  font-weight: 500;
}
.related-reading a:hover { border-bottom-style: solid; color: var(--forest-ink); }

.guide-chapter-highlight {
  border-color: var(--forest-mid) !important;
  box-shadow: 0 0 0 3px rgba(127,163,150,0.18);
  background: var(--paper-card) !important;
}

/* ── ACTIVITY VISUAL — recolor stale forest-bg fills inside SVGs ── */
.activity-visual svg rect[fill="#F0F4F1"] { fill: var(--paper) !important; }

/* ============================================================
   POCKETBOOK — embedded inside Implement screen
   Scoped under .pb-host. Inherits forest palette tokens.
   ============================================================ */

.pb-host {
  --pb-r-sm: 6px;
  --pb-r-md: 10px;
  --pb-r-lg: 14px;
  --pb-r-pill: 999px;
  --pb-bark: #6B5240;
  --pb-ember: #B8552E;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
  margin-top: 8px;
  position: relative;
}
.pb-main { min-width: 0; }
.pb-builder-backdrop { display: none; }

/* Intro prose (pocketbook-style) */
.pb-prose {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  font-weight: 300;
  margin: 0 0 36px;
  padding: 22px 26px;
  background: var(--paper-card);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-md);
  border-left: 3px solid var(--forest-soft);
}
.pb-prose h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--forest-deep);
  margin-bottom: 10px;
  letter-spacing: -0.005em;
}
.pb-prose p { margin-bottom: 10px; color: var(--ink-soft); font-size: var(--fs-body); }
.pb-prose p:last-child { margin-bottom: 0; }
.pb-prose strong { font-weight: 500; color: var(--forest-ink); }

/* ─── FILTERS (group + suitability/duration chips) ─── */
.pb-filters { margin-bottom: 24px; }
.pb-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pb-filter-row + .pb-filter-row { margin-top: 8px; }
.pb-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  min-height: 44px;
  border-radius: var(--pb-r-pill);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.pb-filter-chip:hover { border-color: var(--forest-soft); }
.pb-filter-chip[aria-pressed="true"] {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: #fff;
}
.pb-filter-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pb-filter-chip-quick { font-weight: 600; }
.pb-filter-toggle-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.pb-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--forest-mid);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pb-filter-toggle:hover { color: var(--forest-deep); }
.pb-filter-clear-btn {
  padding: 6px 10px;
  min-height: 44px;
  border-radius: var(--pb-r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}
.pb-filter-clear-btn:hover:not(:disabled) { border-color: var(--forest-soft); color: var(--forest-deep); }
.pb-filter-clear-btn:disabled { opacity: 0.4; cursor: default; }
.pb-filter-tags[hidden] { display: none; }
.pb-filter-summary {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-faint);
}
.pb-filter-empty {
  padding: 32px 14px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  border: 1px dashed var(--forest-mist);
  border-radius: var(--pb-r-md);
}

/* ─── GROUPS ─── */
.pb-group { margin-bottom: 36px; }
.pb-group:last-of-type { margin-bottom: 16px; }

.pb-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--forest-mist);
}
.pb-group-headline { display: flex; align-items: baseline; gap: 12px; }
.pb-group-num {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  font-weight: 600;
  color: var(--forest-soft);
  line-height: 1;
}
.pb-group-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 21px;
  font-weight: 500;
  color: var(--forest-ink);
  letter-spacing: -0.005em;
}
.pb-group-meta {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

/* ─── ACTIVITY ITEMS (pocketbook variant — overrides existing in .pb-host) ─── */
.pb-host .pb-activity-list { display: flex; flex-direction: column; gap: 8px; }

.pb-host .pb-activity-item {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pb-host .pb-activity-item:hover { border-color: var(--forest-soft); box-shadow: var(--shadow-sm); }
.pb-host .pb-activity-item.open { border-color: var(--forest-mid); box-shadow: var(--shadow-md); }

.pb-host .pb-activity-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  justify-content: flex-start;
}
.pb-host .pb-activity-item.open .pb-activity-trigger { background: var(--paper-card); border-bottom: 1px solid var(--forest-mist); }

.pb-activity-glyph {
  width: 30px; height: 30px;
  flex-shrink: 0;
  color: var(--forest-mid);
  display: flex; align-items: center; justify-content: center;
}
.pb-activity-glyph svg { width: 100%; height: 100%; }

.pb-host .pb-activity-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--forest-ink);
  flex: 1;
  letter-spacing: -0.005em;
}

.pb-activity-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.pb-host .pb-activity-duration {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0.02em;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.pb-timer-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  color: var(--forest-mid);
  cursor: pointer;
  transition: all 0.18s;
}
.pb-timer-icon:hover {
  background: var(--pb-ember);
  border-color: var(--pb-ember);
  color: white;
  transform: scale(1.06);
}
.pb-timer-icon svg { width: 14px; height: 14px; }

.pb-add-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  color: var(--forest-mid);
  cursor: pointer;
  transition: all 0.18s;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.pb-add-icon:hover {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: white;
  transform: scale(1.06);
}
.pb-add-icon.in-session {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: white;
}

.pb-chevron {
  width: 14px; height: 14px;
  color: var(--ink-faint);
  transition: transform 0.25s ease;
}
.pb-host .pb-activity-item.open .pb-chevron { transform: rotate(180deg); color: var(--forest-deep); }

/* ─── ACTIVITY DETAIL ─── */
.pb-host .pb-activity-detail {
  display: none;
  padding: 4px 22px 22px 60px;
  background: var(--paper-pure);
}
.pb-host .pb-activity-item.open .pb-activity-detail {
  display: block;
  animation: pbSlideDown 0.28s ease;
}
@keyframes pbSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pb-host .pb-activity-visual {
  margin: 4px 0 16px;
  border-radius: var(--pb-r-sm);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
}
.pb-host .pb-activity-visual svg { display: block; width: 100%; height: auto; }

/* Run Mode's own visual — same illustrations as the Pocketbook detail
   view, replayed in a loop (see pbSetRunVisual in pocketbook.js) since
   a step can stay on screen far longer than the ~2-6s the SMIL
   animation takes to settle, and a single freeze-frame would read as
   inert for most of that time. */
.pb-run-visual {
  margin: 4px 0 20px;
  border-radius: var(--pb-r-md, 10px);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
}
.pb-run-visual svg { display: block; width: 100%; height: auto; }
.pb-run-visual:empty { display: none; }

.pb-host .pb-visual-caption {
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
  padding: 7px 14px;
  font-style: italic;
  border-top: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  line-height: 1.5;
}

.pb-detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 18px;
  align-items: start;
}
.pb-detail-label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  padding-top: 2px;
}
.pb-detail-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.65;
  font-weight: 300;
}
.pb-detail-text-example {
  font-family: 'Caveat', cursive;
  font-size: 17px;
  line-height: 1.4;
  color: var(--forest-deep);
  font-weight: 500;
  padding: 10px 14px;
  background: var(--paper);
  border-left: 2px solid var(--forest-soft);
  border-radius: 0 var(--pb-r-sm) var(--pb-r-sm) 0;
}
.pb-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-detail-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--pb-r-pill);
  background: var(--paper);
  color: var(--forest-deep);
  border: 1px solid var(--forest-mist);
  font-weight: 400;
}

/* ─── ADAPTATIONS TABLE ─── */
.pb-adaptations {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--forest-mist);
}
.pb-adaptations h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--forest-ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.pb-adaptations-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 22px;
  max-width: 580px;
}
.pb-adaptations-table {
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-md);
  overflow: hidden;
}
.pb-adapt-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--forest-mist);
}
.pb-adapt-row:last-child { border-bottom: none; }
.pb-adapt-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: -0.005em;
}
.pb-adapt-text {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ─── SESSION BUILDER (right rail) ─── */
/* No max-height/overflow-y here on desktop (unlike the mobile popover
   version below, which genuinely needs its own scroll since it's a fixed
   popup capped to a fraction of the viewport) — this rail sits in normal
   page flow, so it grows with its content and scrolls with the page.
   The previous fixed max-height forced a second, independent scrollbar
   inside the sticky sidebar alongside the page's own scrollbar — two
   scroll regions fighting for wheel/trackpad input on the same screen.
   overflow:hidden is kept only so the dark header respects the
   border-radius; it no longer clips any content since there's no height
   cap to exceed. */
.pb-builder {
  position: sticky;
  top: 24px;
  align-self: start;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}
.pb-builder-header {
  padding: 18px 20px 16px;
  background: var(--forest-ink);
  color: white;
}
.pb-builder-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.pb-builder-title {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0;
  line-height: 1;
}
.pb-builder-tagline {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.pb-builder-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--forest-mist);
  border-bottom: 1px solid var(--forest-mist);
}
.pb-stat {
  background: var(--paper-card);
  padding: 12px 16px;
}
.pb-stat-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 4px;
}
.pb-stat-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--forest-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pb-stat-value .unit {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 400;
  margin-left: 2px;
}

.pb-arc-balance {
  padding: 12px 20px 14px;
  background: var(--paper-card);
  border-bottom: 1px solid var(--forest-mist);
}
.pb-arc-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 8px;
}
.pb-arc-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
}
.pb-arc-segment {
  height: 100%;
  transition: flex 0.4s ease;
  min-width: 0;
}
.pb-arc-segment[data-group="1"] { background: var(--forest-soft); }
.pb-arc-segment[data-group="2"] { background: var(--forest-mid); }
.pb-arc-segment[data-group="3"] { background: var(--forest-deep); }
.pb-arc-segment[data-group="4"] { background: var(--pb-bark); }
.pb-arc-segment[data-group="5"] { background: var(--pb-ember); }

.pb-arc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--ink-faint);
}
.pb-arc-legend-item { display: flex; align-items: center; gap: 5px; }
.pb-arc-dot { width: 7px; height: 7px; border-radius: 50%; }

.pb-arc-advice {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-sm);
  font-size: 11px;
  line-height: 1.5;
  color: var(--forest-deep);
}
.pb-arc-advice:empty { display: none; }

.pb-suggest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--pb-r-sm);
  border: 1px dashed var(--forest-soft);
  background: transparent;
  color: var(--forest-deep);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pb-suggest-btn:hover { background: var(--forest-mist); border-style: solid; }

.pb-builder-list {
  flex: 1;
  padding: 10px 12px 12px;
  min-height: 100px;
}
.pb-builder-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}
.pb-builder-empty-icon {
  width: 34px; height: 34px;
  margin: 0 auto 10px;
  color: var(--forest-soft);
  opacity: 0.6;
}

.pb-builder-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  margin-bottom: 6px;
  background: var(--paper);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-sm);
  transition: all 0.18s;
  animation: pbSlideIn 0.25s ease;
}
.pb-builder-row:hover { border-color: var(--forest-soft); }
@keyframes pbSlideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
.pb-builder-row-handle {
  color: var(--ink-faint);
  cursor: grab;
  flex-shrink: 0;
  line-height: 1;
  font-size: 14px;
  letter-spacing: -2px;
}
.pb-builder-row-handle:active { cursor: grabbing; }
.pb-builder-row-group {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pb-builder-row-name {
  flex: 1;
  font-size: 12px;
  color: var(--forest-ink);
  font-weight: 400;
  line-height: 1.3;
  min-width: 0;
}
.pb-builder-row-dur {
  font-size: 10px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.pb-builder-row-dur-label { white-space: nowrap; }
/* Per-item minute stepper. Small hit targets here are a deliberate match
   to this row's pre-existing ▲▼ reorder buttons and × remove button
   (16×13px / 18×18px respectively) — this dense list already trades hit
   target size for density, so the stepper follows the same convention
   rather than introducing a visually inconsistent oversized control next
   to buttons half its size. Still real <button> elements either way. */
.pb-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.pb-stepper-btn {
  width: 16px; height: 16px;
  padding: 0;
  border: 1px solid var(--forest-mist);
  border-radius: 3px;
  background: var(--paper-pure);
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-family: inherit;
}
.pb-stepper-btn:hover { background: var(--forest-mist); color: var(--forest-deep); }
.pb-stepper-val {
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pb-builder-row-move {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.pb-move-btn {
  width: 16px; height: 13px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  line-height: 1;
  border-radius: 3px;
}
.pb-move-btn:hover:not(:disabled) { background: var(--forest-mist); color: var(--forest-deep); }
.pb-move-btn:disabled { opacity: 0.25; cursor: default; }

.pb-builder-row-remove {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
}
.pb-builder-row-remove:hover { background: var(--pb-ember); color: white; }

/* Optional session-details section (start time / group-site /
   practitioner) feeding the plan export — collapsed by default via native
   <details>, styled to match the rest of the builder panel. */
.pb-session-meta {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--forest-mist);
  background: var(--paper-card);
}
.pb-session-meta-summary {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--forest-deep);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pb-session-meta-summary::-webkit-details-marker { display: none; }
.pb-session-meta-summary::before {
  content: '▸';
  font-size: 9px;
  transition: transform 0.15s ease;
}
.pb-session-meta[open] .pb-session-meta-summary::before { transform: rotate(90deg); }
.pb-session-meta-sub {
  font-size: 11px;
  color: var(--ink-faint);
  margin: 6px 0 10px;
}
.pb-session-meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.pb-session-meta-field:last-child { margin-bottom: 0; }
.pb-session-meta-field label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.pb-session-meta-field input {
  padding: 7px 10px;
  border-radius: var(--pb-r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
}
.pb-session-meta-field input:focus {
  outline: none;
  border-color: var(--forest-mid);
}

.pb-builder-actions {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--forest-mist);
  display: flex;
  gap: 8px;
  background: var(--paper-card);
}
.pb-builder-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--pb-r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  color: var(--forest-deep);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: all 0.18s;
}
.pb-builder-btn:hover:not(:disabled) { border-color: var(--forest-mid); color: var(--forest-ink); }
.pb-builder-btn.primary {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: white;
}
.pb-builder-btn.primary:hover:not(:disabled) { background: var(--forest-ink); border-color: var(--forest-ink); }
.pb-builder-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pb-builder-btn-icon {
  flex: 0 0 auto;
  width: 44px;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Explanatory reason for the disabled PDF/PNG/Run-mode buttons above —
   kept always in the DOM (empty string when the plan isn't empty) rather
   than toggled with [hidden], matching pb-arc-advice's :empty pattern, so
   a screen reader tracking this aria-live region isn't announced into and
   back out of existence on every render. */
.pb-builder-hint {
  font-size: 11px;
  color: var(--ink-faint);
  font-style: italic;
  padding: 0 16px 12px;
  margin: -4px 0 0;
}
.pb-builder-hint:empty { display: none; }

/* ─── RUN MODE (full-screen overlay) ─── */
.pb-run-mode {
  display: none;
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--paper);
  flex-direction: column;
  animation: pbFadeIn 0.25s ease;
}
.pb-run-mode.active { display: flex; }
@keyframes pbFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Breadcrumb strip — same visual weight as a plain header row; see the
   HTML comment above .pb-run-topbar for why this isn't the actual shared
   site header (yet). */
.pb-run-topbar {
  padding: 14px 32px;
  border-bottom: 1px solid var(--forest-mist);
  background: var(--paper-pure);
  flex-shrink: 0;
}
.pb-run-crumb {
  font-size: 13px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pb-run-crumb span:last-child { color: var(--ink); font-weight: 600; }

.pb-run-body {
  flex: 1; overflow-y: auto;
  padding: 26px 32px 40px;
}
.pb-run-headrow {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  max-width: 760px; margin: 0 auto 12px;
}
.pb-run-step {
  font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
  font-weight: 600;
}
.pb-run-dots {
  list-style: none; margin: 0 auto 22px; padding: 0;
  max-width: 760px;
  display: flex; gap: 5px;
}
.pb-run-dots li {
  flex: 1; height: 7px;
  border-radius: 999px;
  background: var(--forest-mist);
}
.pb-run-dots li.done { background: var(--forest-deep); }
.pb-run-dots li.current { background: var(--pb-ember); }

.pb-run-card {
  max-width: 760px; margin: 0 auto;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-lg, 14px);
  box-shadow: var(--shadow-md);
  padding: 30px 34px 26px;
}
.pb-run-group-tag {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--forest-deep);
  margin-bottom: 14px; font-weight: 600;
}
.pb-run-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500; font-size: 34px;
  color: var(--forest-ink);
  margin-bottom: 6px; line-height: 1.15;
  letter-spacing: -0.01em;
}
.pb-run-duration {
  font-size: 13px; color: var(--ink-faint);
  margin-bottom: 26px;
}
.pb-run-section { margin-bottom: 22px; }
.pb-run-section-full { grid-column: 1 / -1; }
.pb-run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 26px;
}
.pb-run-label {
  font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--forest-deep);
  margin-bottom: 6px; font-weight: 600;
}
.pb-run-text { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.pb-run-intro {
  font-family: 'Caveat', cursive;
  font-size: 19px; line-height: 1.4;
  color: var(--forest-deep);
  font-weight: 500;
  padding: 14px 18px;
  border-left: 3px solid var(--forest-deep);
  background: var(--paper-card);
  border-radius: 0 var(--pb-r-sm) var(--pb-r-sm) 0;
}
.pb-run-notes-block { margin-top: 24px; }
.pb-run-notes-label {
  font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--pb-ember, var(--ember));
  margin-bottom: 6px; font-weight: 600;
  display: block;
}
.pb-run-notes-hint {
  font-size: 13px; color: var(--ink-faint);
  margin: 0 0 8px;
}
.pb-run-notes {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-sm);
  background: var(--paper-pure);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}
.pb-run-notes:focus { border-color: var(--forest-deep); outline: none; }

.pb-run-footer {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--forest-mist);
}
.pb-run-btn {
  padding: 10px 18px;
  border: 1px solid var(--forest-mist);
  background: var(--paper-pure); color: var(--ink);
  border-radius: var(--pb-r-sm);
  font-family: inherit; font-weight: 500;
  cursor: pointer; font-size: 13px;
  transition: all 0.18s;
}
.pb-run-btn:hover:not(:disabled) { border-color: var(--forest-deep); }
.pb-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pb-run-btn.primary { background: var(--forest-ink); color: var(--paper); border-color: var(--forest-ink); flex: 1; min-width: 160px; }
.pb-run-btn.primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
.pb-run-btn.timer { background: var(--pb-ember); color: white; border-color: var(--pb-ember); }
.pb-run-kbd-hint { font-size: 12.5px; color: var(--ink-faint); }
#pb-runFinishReflect { font-weight: 600; }

/* ─── INLINE RUN-MODE TIMER ─── */
.pb-run-timer {
  margin-top: 36px;
  padding: 22px 24px 20px;
  background: var(--paper-pure);
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-md, 10px);
  box-shadow: var(--shadow-sm);
}
.pb-run-timer-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.pb-run-timer-eyebrow {
  font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--forest-deep);
  font-weight: 600;
}
.pb-run-timer-display {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500; font-size: 38px;
  color: var(--forest-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}
.pb-run-timer-track {
  height: 6px; width: 100%;
  background: var(--forest-mist);
  border-radius: 999px;
  overflow: hidden;
}
.pb-run-timer-fill {
  height: 100%;
  background: var(--forest-deep);
  width: 100%;
  transition: width 0.5s linear;
  border-radius: 999px;
}
/* .over replaces the old stop-at-zero .done state: the run-mode timer now
   keeps counting past zero instead of stopping, so this just re-colors
   the display/fill once it's past target rather than marking "finished". */
.pb-run-timer.over .pb-run-timer-fill { background: var(--pb-ember); }
.pb-run-timer.over .pb-run-timer-display { color: var(--pb-ember); }
.pb-run-timer.paused .pb-run-timer-fill { opacity: 0.55; }
.pb-run-timer-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px;
  font-size: 12px; color: var(--ink-faint);
}
.pb-run-timer-actions { display: flex; gap: 8px; }
.pb-run-timer-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--forest-mist);
  border-radius: var(--pb-r-sm, 6px);
  color: var(--ink-soft);
  font-family: inherit; font-size: 12px;
  cursor: pointer; transition: all 0.18s;
}
.pb-run-timer-btn:hover { border-color: var(--forest-deep); color: var(--forest-deep); }
.pb-run-timer.untimed { display: none; }

/* ─── TIMER MODAL ─── */
.pb-timer-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,48,42,0.45);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: pbFadeIn 0.25s ease;
}
.pb-timer-modal.active { display: flex; }
.pb-timer-modal-content {
  background: var(--paper-pure);
  border-radius: var(--pb-r-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  width: calc(100% - 32px);
  text-align: center;
  animation: pbSlideUp 0.3s ease;
}
@keyframes pbSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pb-timer-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.pb-timer-activity-name {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--forest-ink);
  margin-bottom: 12px;
  font-weight: 600;
}
.pb-timer-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 12px auto 16px;
}
.pb-timer-ring { transform: rotate(-90deg); }
.pb-timer-ring circle { fill: none; stroke-width: 4; }
.pb-timer-ring .track { stroke: var(--forest-mist); }
.pb-timer-ring .progress {
  stroke: var(--forest-deep);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear;
}
.pb-timer-display {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 42px;
  color: var(--forest-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.pb-timer-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.pb-timer-btn {
  padding: 10px 20px;
  border-radius: var(--pb-r-sm);
  border: 1px solid var(--forest-mist);
  background: var(--paper);
  color: var(--forest-deep);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.pb-timer-btn:hover { background: var(--forest-deep); color: white; border-color: var(--forest-deep); }
.pb-timer-btn.primary { background: var(--forest-deep); color: white; border-color: var(--forest-deep); }
.pb-timer-btn.primary:hover { background: var(--forest-ink); border-color: var(--forest-ink); }

/* ─── TOAST ─── */
.pb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--forest-ink);
  color: white;
  padding: 12px 20px;
  border-radius: var(--pb-r-pill);
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.pb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── MOBILE FAB (visible only on ≤1100px via media query below) ─── */
.pb-fab { display: none; }
@keyframes pbFabBump      { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pbFabCountBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ─── PRINT TEMPLATES: off-screen on screen, revealed (left:0) only while
   body.is-exporting-png is set, so html2canvas can rasterize them — never
   actually printed via the browser's print dialog. Two templates share
   this base — #print-session (the session plan, from
   exportRenderPrintSession()) and #print-report (the post-session report,
   from exportRenderPrintReport()) — both built with the shared .pexport
   visual language below. ─── */
#print-session, #print-report {
  position: absolute; left: -9999px; top: 0;
  width: 794px;   /* A4 @ 96dpi */
  background: #fff; color: #111;
  font: 14px/1.5 'Open Sans', sans-serif;
  padding: 32px; box-sizing: border-box;
}
body.is-exporting-png #print-session, body.is-exporting-png #print-report { left: 0; }
#print-qr-slot canvas, #print-qr-slot img { display: block; }

/* ─── SESSION-PLAN EXPORT (redesigned template) ───
   Shared by both #print-session and #print-report — see the comment above
   exportRenderPrintReport() in pocketbook.js for which classes below are
   common vs. report-only. */
.pexport { font-family: 'Open Sans', sans-serif; color: #1B2A24; }

.pexport-topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding-bottom: 8px; border-bottom: 1px solid #C8D8D0;
  margin-bottom: 8px;
}
.pexport-topbar-fields { display: flex; flex-direction: column; gap: 10px; }
.pexport-meta-row { display: flex; gap: 26px; flex-wrap: wrap; }
.pexport-meta-block { min-width: 70px; max-width: 150px; }
.pexport-label {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #7C8E85; margin-bottom: 3px;
}
.pexport-value {
  font-size: 13px; font-weight: 600; color: #14302A;
  overflow-wrap: break-word; word-break: break-word;
}
.pexport-logos { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.pexport-logo-img { height: 115px; width: auto; display: block; } /* 125px - 8% */

.pexport-title-block { margin-bottom: 8px; }
.pexport-title {
  font-family: 'Playfair Display', Georgia, serif; font-size: 30px; font-weight: 600;
  color: #14302A; margin: 0 0 4px; letter-spacing: -0.01em;
}
.pexport-subtitle { font-size: 12.5px; color: #4D6359; }

.pexport-body { display: flex; gap: 24px; align-items: flex-start; }
.pexport-timeline { flex: 1; min-width: 0; }
.pexport-sidebar { width: 240px; flex-shrink: 0; }

.pexport-col-headers {
  display: flex; gap: 12px; padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid #C8D8D0;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: #7C8E85;
}
.pexport-col-headers span:first-child { width: 56px; flex-shrink: 0; }

.pexport-row {
  display: flex; gap: 10px; padding: 3px 0;
  border-bottom: 1px solid #eee; page-break-inside: avoid;
}
.pexport-row-clock { width: 56px; flex-shrink: 0; }
.pexport-row-clock-time { font-size: 13px; font-weight: 700; color: #14302A; }
.pexport-row-clock-dur { font-size: 10px; color: #7C8E85; margin-top: 1px; }
.pexport-row-bar { width: 3px; border-radius: 2px; align-self: stretch; flex-shrink: 0; }
.pexport-row-main { flex: 1; min-width: 0; }
.pexport-row-heading { font-size: 13px; font-weight: 600; color: #14302A; }
.pexport-row-num { color: #7C8E85; font-weight: 600; margin-right: 2px; }
.pexport-row-group { font-size: 10.5px; font-style: italic; color: #4D6359; margin: 2px 0 3px; }
.pexport-row-purpose { font-size: 11px; color: #333; line-height: 1.4; margin-bottom: 3px; }
.pexport-row-quote {
  font-family: 'Caveat', cursive; font-size: 16px; font-weight: 600;
  color: #3A4F47; line-height: 1.25;
  border-left: 2px solid #ddd; padding-left: 8px;
}
.pexport-row-note {
  font-size: 11px; font-style: italic; color: #555; line-height: 1.4;
  border-left: 2px solid #ddd; padding-left: 8px;
}

.pexport-stats-eyebrow {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #7C8E85; margin-bottom: 10px;
}
.pexport-arc-block, .pexport-shape-block, .pexport-materials-block { margin-bottom: 16px; }
.pexport-arc-row { display: flex; align-items: center; gap: 10px; }
.pexport-arc-donut { flex-shrink: 0; width: 72px; height: 72px; }
.pexport-arc-donut svg { width: 100%; height: 100%; display: block; }
.pexport-arc-legend { flex: 1; min-width: 0; }
.pexport-legend-row { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #4D6359; margin-bottom: 3px; }
.pexport-legend-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pexport-legend-label { flex: 1; min-width: 0; }
.pexport-legend-pct { font-weight: 600; color: #14302A; }
.pexport-section-label {
  font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #7C8E85; margin-top: 8px; margin-bottom: 6px;
}
.pexport-shape-block svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.pexport-materials-list { margin: 6px 0 0; font-size: 10.5px; color: #333; line-height: 1.4; }
.pexport-materials-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.pexport-materials-row .pexport-checkbox { margin-top: 2px; }

.pexport-qr-block { display: flex; gap: 10px; align-items: center; }
.pexport-qr-block #print-qr-slot { flex-shrink: 0; }
.pexport-qr-caption { font-size: 9px; color: #7C8E85; line-height: 1.4; }

.pexport-banner {
  margin: 6px 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid #C8D8D0; border-bottom: 1px solid #C8D8D0;
  font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #234A3E; font-weight: 600;
}
.pexport-banner-total { font-size: 11px; text-transform: none; letter-spacing: normal; }

.pexport-footer-title {
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #7C8E85; margin-bottom: 6px;
}
.pexport-checklist {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; margin-bottom: 10px;
}
.pexport-check-item {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 10px; color: #333; line-height: 1.35;
}
.pexport-checkbox {
  width: 9px; height: 9px; border: 1px solid #999; border-radius: 2px;
  flex-shrink: 0; margin-top: 2px;
}
.pexport-footer-bottom {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 40px; border-top: 1px solid #234A3E; /* ~2 lines of clear space above the rule */
  font-size: 9.5px; color: #7C8E85;
}

/* Paginated PDF pages only (see pbBuildSessionPaginatedCanvases()/
   pbBuildReportPaginatedCanvases() in pocketbook.js) — the continuous
   on-screen/PNG render doesn't use this, since it isn't broken into fixed-
   height pages. Each page gets a fixed height (one full A4 content area)
   and the footer is pinned to the true bottom via the auto margin, instead
   of trailing right after wherever that page's content happens to end. */
.pexport--paged { display: flex; flex-direction: column; }
.pexport--paged > * { flex-shrink: 0; } /* flex items default to shrinkable — without this, content silently compresses/clips to fit the fixed page height instead of the packer's page break ever kicking in */
.pexport--paged > .pexport-footer-bottom { margin-top: auto; }
/* Session-plan pages only: when the trailing banner+checklist lands on a
   page, it travels together with the footer-bottom line as one connected
   unit pushed to the bottom — not the footer-bottom line alone, which
   would leave a large disconnected gap between the checklist and the
   thin footer rule below it. */
.pexport--paged > .pexport-tail-anchor { margin-top: auto; }

/* ─── POST-SESSION REPORT (same .pexport visual language, single-column —
   no chart sidebar, since the point here is giving notes/free-text room
   rather than at-a-glance stats). Reuses .pexport-row/-section-label/
   -footer-bottom etc. above as-is; these are the report-only additions. */
.pexport-notes-card {
  margin: 4px 0 18px; padding: 12px 14px;
  background: #F4F8F6; border: 1px solid #C8D8D0; border-left: 3px solid #7FA396;
  border-radius: 4px;
}
.pexport-notes-text {
  margin-top: 4px; font-size: 12px; color: #333; line-height: 1.55;
  white-space: pre-wrap;
}
.pexport-qa-card { padding: 9px 0; border-bottom: 1px solid #eee; page-break-inside: avoid; }
.pexport-qa-q { font-size: 12.5px; font-weight: 600; color: #14302A; }
.pexport-qa-a { margin-top: 3px; font-size: 12px; color: #333; line-height: 1.5; white-space: pre-wrap; }
.pexport-indicator-item { padding: 3px 0; font-size: 11px; color: #666; }
.pexport-indicator-item.is-checked { color: #14302A; font-weight: 600; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .pb-host { grid-template-columns: 1fr; padding-bottom: 88px; }

  /* Builder on mobile: popup that grows OUT of the FAB. Ironclad hide
     when not .expanded — visibility:hidden + opacity:0 + scale near 0 +
     pointer-events:none. The visibility transition is delayed so the
     element only becomes hittable AFTER it has finished animating in. */
  .pb-builder {
    position: fixed !important;
    bottom: 96px !important;          /* clears the 64px circular FAB */
    left: 16px !important;
    right: 16px !important;
    top: auto !important;
    max-height: calc(var(--vh, 1vh) * 70);
    overflow-y: auto;
    border-radius: var(--pb-r-lg);
    transform-origin: bottom right;
    transform: scale(0.05);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0s linear 0.22s;
    z-index: 50;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
  }
  .pb-builder.expanded {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0s linear 0s;
    pointer-events: auto;
  }
  .pb-builder-header { cursor: pointer; }

  /* Dims and separates the page content behind the popup so it reads as
     a modal rather than a box floating on top of the activity list. */
  .pb-builder-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(20,48,42,0.45);
    z-index: 45;               /* below .pb-builder (50), above page content */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  }
  .pb-builder-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
  }

  /* Circular FAB. Just a number on a forest-ink disc. No icon.
     env(safe-area-inset-*) keeps it clear of a phone's gesture-nav bar
     / rounded corners (the inset is 0 on devices without one, so this
     is never less than the plain 16px). */
  .pb-fab {
    position: fixed;
    right: max(16px, calc(16px + env(safe-area-inset-right)));
    bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
    z-index: 60;                /* above .pb-builder (50), below run-mode (200) */
    width: 64px;
    height: 64px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--forest-ink);
    color: white;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .pb-fab.bump { animation: pbFabBump 0.32s ease; }
  .pb-fab.open { transform: scale(0.92); opacity: 0.9; }
  .pb-fab-count {
    font-family: 'Open Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    transform-origin: center;
    display: inline-block;
  }
  .pb-fab-count.bump { animation: pbFabCountBump 0.34s ease; }

  /* Visibility gates — FAB only renders while the pocketbook module is
     the focused module. Run-mode hides both FAB and builder.
     Class/attribute selectors (not :has()) for compatibility with the
     older WebView used by the Odoo embed test path. */
  body[data-focused="mod-pocket"] .pb-fab { display: inline-flex; }
  body.pb-run-active .pb-fab,
  body.pb-run-active .pb-builder,
  body.pb-run-active .pb-builder-backdrop { display: none !important; }
  /* Hard guard: builder cannot be expanded outside the pocketbook. */
  body:not([data-focused="mod-pocket"]) .pb-builder {
    transform: scale(0.05) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body:not([data-focused="mod-pocket"]) .pb-builder-backdrop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
@media (max-width: 768px) {
  #site-header {
    transition: transform 0.25s ease, opacity 0.25s ease;
    will-change: transform;
  }
  #site-header.header-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
  }
  /* Lang-bar scrolls with the page on mobile (now lives inside the header flex row) */
  .lang-bar {
    position: static;
    margin-left: auto;
    top: auto; right: auto;
  }
  /* Nav and controls each take the full row on narrow screens, stacked
     under the title, rather than fighting it for horizontal space. */
  .site-nav, .header-controls { flex-basis: 100%; }
  .header-controls { margin-left: 0; }
  .search-trigger-label { display: none; }
  .search-trigger-kbd { display: none; }

  /* Belt-and-suspenders against horizontal scroll. body already had
     overflow-x: hidden, which is enough in a standalone tab, but this
     app is normally viewed inside a host page's <iframe> — an iframe is
     its own scroll container, and doesn't reliably inherit/propagate a
     same-origin-looking-but-actually-separate document's root-scroller
     behavior the exact same way every mobile engine does. Repeating the
     clamp on html and on .container directly means there's no path left
     for a stray wide element to force a scrollbar the host page has to
     render around. */
  html, body { overflow-x: hidden; max-width: 100%; }
  .container { overflow-x: hidden; max-width: 100%; }

  /* Run Mode's illustration as the visual centerpiece of the step. Bleeds
     out to the card's full outer edge (cancelling .pb-run-card's own
     side padding) rather than sitting narrower inside it, so it renders
     at its biggest — a fixed min-height would just leave empty space
     above/below instead, since the illustration's own aspect ratio is
     wide and short. */
  .pb-run-card { padding-left: 0; padding-right: 0; }
  .pb-run-card > *:not(.pb-run-visual) { padding-left: 34px; padding-right: 34px; }
  .pb-run-visual { border-radius: 0; border-left: none; border-right: none; margin: 4px 0 24px; }

  /* Phone-only density pass. `zoom` (not `transform`) is used deliberately:
     it triggers a real re-layout at the reduced scale rather than a
     post-layout visual transform, so it shrinks type, spacing, and total
     scroll height together in one step — instead of hunting down every
     hardcoded font-size in this file individually, which is most of them.
     Support: Chromium/Android WebView, Safari 16.4+, Firefox 126+ — i.e.
     effectively every mobile browser this size range targets. Scoped to
     this existing ≤768px breakpoint only, so nothing above it changes. */
  body { zoom: 0.75; }
}
@media (max-width: 640px) {
  .pb-host .pb-activity-detail { padding: 4px 14px 18px; }
  .pb-detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .pb-detail-label { padding-top: 12px; }
  .pb-detail-grid > div:first-child { padding-top: 0; }
  .pb-adapt-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 18px; }
  .pb-group-title { font-size: 18px; }
  .pb-group-num { font-size: 22px; }
}

