/* =====================================================================
   base.css — structural / layout styles (brand-agnostic)
   Reads all visual values from tokens.css custom properties.
   ===================================================================== */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-base); line-height: var(--lh-base);
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; letter-spacing: .005em; }
a { color: var(--brand-accent-dark); }
img { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- top bar (light, carries the brand logo) ---------- */
.appbar {
  background: var(--appbar-bg); color: var(--appbar-fg); position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow); border-bottom: 1px solid var(--border);
}
.appbar .container { display: flex; align-items: center; gap: 16px; height: 64px; position: relative; }
.brandmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
/* reserve the logo box so it never collapses to 0 width while the image
   downloads/decodes (otherwise the logo is invisible for a beat on mobile) */
.brandmark .logo { height: var(--logo-h); width: auto; min-width: 70px; object-fit: contain; object-position: left center; flex-shrink: 0; display: block; }
.brandmark .product { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--brand-accent); line-height: 1; margin-left: 10px; padding-left: 11px; border-left: 1px solid var(--border); }
/* the platform (Thrive) mark beside the operator (Senior6) logo */
.brandmark .product-logo { height: 19px; width: auto; min-width: 44px; object-fit: contain; object-position: left center; flex-shrink: 0; display: block; margin-left: 11px; padding-left: 12px; border-left: 1px solid var(--border); }
.appbar .spacer { flex: 1; }
.appbar a.nav-link { color: var(--text-muted); text-decoration: none; font-size: .9rem; }
.appbar a.nav-link:hover { color: var(--brand-accent-dark); }
.mainnav { display: flex; gap: 18px; align-items: center; }
.appbar a.nav-link.active { color: var(--brand-primary); font-weight: 600; }

/* ---------- hamburger toggle (hidden on desktop) ---------- */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px 6px; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 24px; height: 2px; background: var(--appbar-fg); border-radius: 2px; transition: transform .2s ease, opacity .2s ease, background .2s ease; }
.nav-toggle .bars { position: relative; }
.nav-toggle .bars::before { content: ''; position: absolute; top: -7px; }
.nav-toggle .bars::after  { content: ''; position: absolute; top: 7px; }
.appbar.open .nav-toggle .bars { background: transparent; }
.appbar.open .nav-toggle .bars::before { top: 0; transform: rotate(45deg); }
.appbar.open .nav-toggle .bars::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .appbar .container { height: 58px; gap: 8px; }
  /* hamburger sits to the LEFT of the logo on mobile (first child in the bar) */
  .nav-toggle { display: inline-flex; align-items: center; margin-right: 2px; }
  /* collapse the primary nav into a dropdown panel under the bar
     (header.appbar prefix beats marketing.css's `.appbar .mkt-nav{display:flex}`) */
  header.appbar .mainnav, header.appbar .mkt-nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 6px 0; display: none;
  }
  header.appbar.open .mainnav, header.appbar.open .mkt-nav { display: flex; }
  .appbar .mainnav > a, .appbar .mkt-nav > a, .appbar .mainnav .nav-link {
    padding: 13px 22px; font-size: 1rem; width: 100%; border-radius: 0;
  }
  .appbar .mainnav .btn, .appbar .mainnav button:not(.nav-toggle) { margin: 8px 22px; text-align: center; justify-content: center; width: calc(100% - 44px); }
  .appbar .mainnav .org-switch { padding: 8px 22px; }
  .appbar .mainnav .org-switch select { width: 100%; }
}

/* ---- shared chrome injected by chrome.js (avatar menu, org switcher) ---- */
.appbar .container { gap: 14px; }
.brandmark .org-word { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--brand-primary); }
.org-switch label { font-size: .72rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }
.org-switch select { font: inherit; font-size: .82rem; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .85rem; border: 0; cursor: pointer; }
.avatar-menu { position: relative; }
.avatar-pop { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; display: none; z-index: 60; }
.avatar-pop.show { display: block; }
.avatar-pop a, .avatar-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; font-size: .88rem; color: var(--text); border-radius: 7px; cursor: pointer; text-decoration: none; }
.avatar-pop a:hover, .avatar-pop button:hover { background: var(--surface-2); }
.avatar-pop .who { padding: 9px 12px 4px; }
.avatar-pop .who strong { display: block; }
.avatar-pop .who span { font-size: .78rem; color: var(--text-muted); }
.avatar-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
/* My Certifications — Senior6-branded credential link */
.avatar-pop a.cert-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.avatar-pop .s6-cert-mark { height: 14px; width: auto; flex: none; opacity: .9; }
/* Communities switcher nested inside the avatar menu */
.avatar-pop .org-switch { padding: 8px 12px 4px; }
.avatar-pop .org-switch label { width: 100%; }
.avatar-pop .org-switch select { width: 100%; margin-top: 2px; }

/* ---------- home: provided-by + domains ---------- */
.provided-by { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; opacity: .92; margin-bottom: 8px; }
.provided-by strong { color: var(--brand-accent); }
.crumb-line { font-size: .8rem; opacity: .92; margin-bottom: 10px; }
.crumb-line a { color: #fff; }
.section-head .section-note { color: var(--text-muted); font-size: .85rem; }
.section-head { align-items: center; }

.domain-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 8px 0 10px; }
.domain-panel.unlocked { border-color: var(--brand-primary); }
.domain-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.domain-panel > summary::-webkit-details-marker { display: none; }
.domain-ico { font-size: 1.8rem; line-height: 1; }
.domain-name { display: flex; flex-direction: column; flex: 1; }
.domain-name strong { font-size: 1.15rem; }
.domain-sub { color: var(--text-muted); font-size: .85rem; }
.badge.licensed { background: var(--ok-soft); color: var(--ok); }
.badge.locked { background: var(--surface-2); color: var(--text-muted); }
.domain-body { padding: 0 20px 18px; }
.domain-intro { color: var(--text-muted); margin-top: 0; }
.training-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.training-item { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface); }
.training-item.unlocked { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.training-item.locked { opacity: .72; }
.t-main { flex: 1; display: flex; flex-direction: column; }
.t-name { font-weight: 600; }
.t-desc { color: var(--text-muted); font-size: .88rem; }

.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.domain-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); }
.domain-card.locked { opacity: .62; }
.domain-card .dc-text { display: flex; flex-direction: column; flex: 1; }
.domain-card .dc-text strong { font-size: .95rem; }
.domain-card .dc-text span { color: var(--text-muted); font-size: .8rem; }

.disclaimer { font-size: .8rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- standard program intro ---------- */
.program-intro { max-width: var(--reading); margin: 18px 0 6px; }
.prog-desc { font-size: 1.08rem; line-height: 1.65; color: var(--text); margin: 0; }
.prog-stats { margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.prog-stats .badge { font-size: .8rem; }
.prog-for { margin: 14px 0 0; font-size: .95rem; color: var(--text); }
.prog-for-label { display: inline-block; font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-primary-dark); background: var(--brand-primary-soft); padding: 3px 10px; border-radius: 999px; margin-right: 10px; vertical-align: middle; }
.prog-note { margin: 14px 0 0; font-size: .82rem; color: var(--text-muted); font-style: italic; border-left: 3px solid var(--border); padding-left: 12px; }

/* ---------- certifications: requirement detail ---------- */
.req-list { list-style: none; padding: 0; margin: 0 0 10px; }
.req { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.req.is-done { color: var(--text); }
.req-mark { display: inline-block; width: 1.3em; color: var(--text-muted); font-weight: 700; }
.req-mark.ok { color: var(--ok); }
.req-id { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.req-head { font-size: .9rem; color: var(--brand-primary-dark); margin: 12px 0 6px; }

/* ---------- feedback form ---------- */
.form-note { background: var(--brand-accent-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0 16px; font-size: .9rem; }
.feedback-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; max-width: var(--reading); margin-bottom: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .9rem; }
.field .opt { color: var(--text-muted); font-weight: 400; }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.form-result { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); }
.form-result[hidden] { display: none; }
@media (max-width: 720px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; background: var(--surface-2); color: var(--text); text-decoration: none;
  transition: transform .04s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-dark); }
.btn-accent { background: var(--brand-accent); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
}
.badge.tier   { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.badge.dur    { background: var(--surface-2); color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.badge.long   { background: var(--brand-accent-soft); color: var(--warn); }
.badge.done   { background: var(--ok-soft); color: var(--ok); }
.badge.soon   { background: var(--surface-2); color: var(--text-muted); }

/* =====================================================================
   HUB
   ===================================================================== */
.hero { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); color: #fff; padding: 46px 0 38px; position: relative; }
.hero::after { content: ''; position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--brand-accent); }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; margin-bottom: 8px; color: #fff; }
.hero p { margin: 0; opacity: .92; max-width: var(--reading); }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 6px; }
.section-head h2 { font-size: 1.05rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* cert progress panel */
.certgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; margin-top: 14px; }
.certcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.certcard.active { border-color: var(--brand-primary); }
.certcard h3 { font-size: 1.05rem; }
.certcard .summary { color: var(--text-muted); font-size: .9rem; margin: 4px 0 12px; }
.progressbar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progressbar > span { display: block; height: 100%; background: var(--brand-primary); border-radius: 999px; transition: width .4s ease; }
.certcard .pct { font-size: .85rem; color: var(--text-muted); margin-top: 6px; display: flex; justify-content: space-between; }
.certcard.earned { background: var(--ok-soft); border-color: var(--ok); }

/* pathways */
.pathway { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; box-shadow: var(--shadow); overflow: hidden; }
.pathway > summary { list-style: none; cursor: pointer; padding: 18px 20px; display: flex; align-items: center; gap: 12px; }
.pathway > summary::-webkit-details-marker { display: none; }
.pathway > summary::before { content: '▸'; color: var(--brand-primary); transition: transform .15s ease; }
.pathway[open] > summary::before { transform: rotate(90deg); }
.pathway > summary h2 { font-size: 1.2rem; margin: 0; flex: 1; }
.pathnum { font-family: var(--font-head); font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-accent-dark); background: var(--brand-accent-soft); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.pathway-body { padding: 0 20px 16px; }
.section-block { margin: 12px 0 4px; }
.section-block h3 { font-size: .95rem; color: var(--text-muted); margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.secnum { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7em; height: 1.7em; padding: 0 .4em; border-radius: 7px; background: var(--brand-primary-soft); color: var(--brand-primary-dark); font-weight: 700; font-size: .82rem; }
.badge.tn { background: var(--brand-primary); color: #fff; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease; }
.card.module-card { position: relative; }
.card.module-card.playable:hover { border-color: var(--brand-primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.card .ttl { font-weight: 600; }

/* video pin — bottom-right corner of a module card */
.video-pin { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center;
  justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff;
  background: var(--brand-primary); box-shadow: var(--shadow); cursor: pointer;
  transition: transform .1s ease, background .15s ease; }
.video-pin:hover { background: var(--brand-primary-dark); transform: scale(1.08); }
.video-pin:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.video-pin svg { display: block; }
.card .mid { font-size: .78rem; color: var(--text-muted); }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.card.is-soon { opacity: .72; }
.card.is-done { border-color: var(--ok); }
/* brand (B4): Thrive wordmark placeholder + footer About/powered-by */
.thrive-wm { font-weight: 700; font-style: italic; color: var(--brand-primary); letter-spacing: .2px; vertical-align: middle; }
.thrive-logo { height: 15px; width: auto; vertical-align: -3px; display: inline-block; }
.about-thrive { height: 30px; vertical-align: middle; }
.foot-powered { color: var(--text-muted); font-size: .8rem; margin: 0 4px; }
.foot-powered .thrive-wm { font-size: .85rem; }
a.about-link { color: var(--text-muted); text-decoration: none; font-size: .8rem; margin: 0 8px; }
a.about-link:hover { text-decoration: underline; }

/* cert-earned celebration toast */
.cert-celebrate { position: fixed; right: 18px; bottom: 18px; z-index: 1000; transform: translateY(140%); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
.cert-celebrate.show { transform: translateY(0); opacity: 1; }
.cert-celebrate .cc-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--ok); border-left: 5px solid var(--ok); border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; }
.cert-celebrate .cc-emoji { font-size: 1.6rem; }
.cert-celebrate .cc-txt { display: flex; flex-direction: column; line-height: 1.25; }
.cert-celebrate .cc-txt span { color: var(--text-muted); font-size: .85rem; }
.cert-celebrate .cc-link { margin-left: auto; font-weight: 600; color: var(--brand-primary); text-decoration: none; }
.cert-celebrate .cc-x { background: none; border: 0; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; line-height: 1; }

/* entitlement-gated (A3): module/cert cards outside the user's license */
.is-locked { opacity: .6; }
a.is-locked { text-decoration: none; cursor: pointer; }
.certcard.is-locked { filter: grayscale(.35); }
/* A5: cert validity / expiry */
.certcard.expired { border-color: var(--warn); }
.cert-expiry { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }
.certcard.expired .cert-expiry { color: var(--warn); }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 14px; }
.shelf .card { background: var(--brand-accent-soft); }

/* ---------- video modal player ---------- */
body.video-modal-open { overflow: hidden; }
.video-modal[hidden] { display: none; }
.video-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.video-modal-backdrop { position: absolute; inset: 0; background: rgba(10,28,26,.72); }
.video-modal-box { position: relative; width: min(960px, 100%); background: #000; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg); }
.video-modal-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--brand-primary-dark); color: #fff; }
.video-modal-title { font-size: .9rem; font-weight: 600; flex: 1; }
.video-modal-close { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 6px;
  width: 30px; height: 30px; font-size: .95rem; line-height: 1; cursor: pointer; }
.video-modal-close:hover { background: rgba(255,255,255,.28); }
.video-modal-video { display: block; width: 100%; max-height: 80vh; background: #000; }

footer.foot { color: var(--text-muted); font-size: .85rem; padding: 30px 0 50px; text-align: center; }

/* ---------- platform "powered by Keyed + LINQ" footer (Senior6 platform pages) ---------- */
.s6-foot { background: var(--surface); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 48px; }
.s6-foot .container { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 20px; }
.s6-foot .pwr-label { font-size: .74rem; color: var(--text-muted); letter-spacing: .12em; text-transform: uppercase; }
.s6-foot .pwr-logos { display: inline-flex; align-items: center; gap: 24px; }
.s6-foot .pwr-logos img { height: 26px; width: auto; display: block; opacity: .92; }
.s6-foot .pwr-logos img.ks { height: 21px; }
.s6-foot .pwr-logos img.thrive { height: 19px; }
.s6-foot .s6-foot-legal { width: 100%; text-align: center; font-size: .74rem; color: var(--text-muted); opacity: .75; margin-top: 2px; }

/* ---------- subtle "offered by Senior6" footer (operator-branded pages) ---------- */
.s6-foot-org { border-top: 1px solid var(--border); padding: 18px 0 40px; margin-top: 28px; text-align: center; }
.s6-offered { display: flex; align-items: center; justify-content: center; }
.s6-offered-link { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; color: var(--text-muted); text-decoration: none; letter-spacing: .04em; }
.s6-offered-logo { height: 15px; width: auto; opacity: .65; transition: opacity .15s ease; position: relative; top: 1px; }
.s6-offered-link:hover { color: var(--text); }
.s6-offered-link:hover .s6-offered-logo { opacity: 1; }

/* ---------- tier mapper ---------- */
.tier-counts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; color: var(--text-muted); }
.map-table { width: 100%; border-collapse: collapse; }
.map-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; vertical-align: middle; }
.map-id { font-variant-numeric: tabular-nums; color: var(--text-muted); width: 56px; font-weight: 600; }
.map-title { width: auto; }
.map-select { width: 150px; text-align: right; }
.map-select select { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; }
.mapper-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(45,51,64,.07); padding: 12px 0; z-index: 15; }
.mapper-bar-inner { display: flex; align-items: center; gap: 10px; }
.map-status { font-size: .9rem; color: var(--text-muted); }
@media (max-width: 720px) {
  .mapper-bar-inner { flex-wrap: wrap; }
  .map-status { flex-basis: 100%; }
  .map-select { width: 120px; }
}

/* =====================================================================
   PLAYER
   ===================================================================== */
.player-shell { max-width: var(--reading); margin: 0 auto; padding: 0 20px; }
.player-top { position: sticky; top: 60px; background: var(--bg); padding: 14px 0 8px; z-index: 10; }
.player-top .crumbs { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.steps { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.steps > span { display: block; height: 100%; background: var(--brand-primary); transition: width .35s ease; }
.player-top .meta-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .82rem; color: var(--text-muted); }
.player-top .meta-row .spacer { flex: 1; }

.screen { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 32px; box-shadow: var(--shadow); margin: 14px 0; min-height: 320px; }
.screen.type-title { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); color: #fff; position: relative; overflow: hidden; }
.screen.type-title::before { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--brand-accent); opacity: .18; }
.screen.type-title h1 { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: #fff; }
.screen.type-title .sub { opacity: .92; }
.screen h2.screen-title { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; margin-bottom: 14px; color: var(--brand-primary); }
.screen p { margin: 0 0 14px; }
.screen ul, .screen ol { margin: 0 0 14px; padding-left: 22px; }
.screen li { margin: 6px 0; }

.objectives { list-style: none; padding: 0; }
.objectives li { padding-left: 30px; position: relative; margin: 10px 0; }
.objectives li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--brand-primary); font-weight: 700; }

.callout { border-left: 4px solid var(--brand-accent); background: var(--brand-accent-soft); padding: 16px 18px; border-radius: var(--radius-sm); margin: 16px 0; }
.callout .label { font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; color: var(--warn); display: block; margin-bottom: 4px; }

.media-ph { background: var(--surface-2); border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 36px; text-align: center; color: var(--text-muted); margin: 16px 0; }
.media-ph .ico { font-size: 2rem; display: block; margin-bottom: 6px; }

/* lesson images (3 per module, peppered through the steps) */
.lesson-figure { margin: 18px 0; }
.lesson-figure img { width: 100%; display: block; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.lesson-figure figcaption { font-size: .82rem; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.img-ph { width: 100%; min-height: 220px; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--surface-2), var(--brand-primary-soft)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); text-align: center; padding: 24px; }
.img-ph .ico { font-size: 2rem; opacity: .5; }
.img-ph .ph-sub { max-width: 36ch; font-size: .9rem; }
.img-ph .ph-tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.compare .col { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.compare .col h4 { margin: 0 0 8px; }
.compare .col.b { background: var(--brand-primary-soft); border-color: var(--brand-primary); }

/* inline formative check */
.check { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin: 16px 0; }
.check .q { font-weight: 600; margin-bottom: 10px; }
.opt { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0; cursor: pointer; font: inherit; transition: border-color .12s ease, background .12s ease; }
.opt:hover { border-color: var(--brand-primary); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--error); background: var(--error-soft); }
.opt.disabled { pointer-events: none; }
.feedback { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; display: none; }
.feedback.show { display: block; }
.feedback.good { background: var(--ok-soft); color: var(--ok); }
.feedback.bad { background: var(--error-soft); color: var(--error); }

.nav-bar { display: flex; gap: 10px; align-items: center; margin: 18px 0 50px; }
.nav-bar .spacer { flex: 1; }

/* =====================================================================
   ASSESSMENT
   ===================================================================== */
.assessment .item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin: 14px 0; box-shadow: var(--shadow); }
.assessment .item .qnum { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.assessment .item.scenario { border-left: 4px solid var(--brand-accent); }
.assessment .item .stem { font-weight: 600; margin: 6px 0 12px; }
.assessment .item .scenario-text { background: var(--brand-accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; font-style: italic; }
.result { text-align: center; padding: 34px; border-radius: var(--radius); margin: 16px 0; }
.result.pass { background: var(--ok-soft); border: 1px solid var(--ok); }
.result.fail { background: var(--error-soft); border: 1px solid var(--error); }
.result .score { font-size: 3rem; font-weight: 800; }
.result.pass .score { color: var(--ok); }
.result.fail .score { color: var(--error); }

/* =====================================================================
   FACILITATOR MODE
   ===================================================================== */
.fac-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.fac-toggle button { border: 0; background: var(--surface); padding: 7px 14px; cursor: pointer; font: inherit; font-size: .82rem; color: var(--text-muted); }
.fac-toggle button.on { background: var(--brand-primary); color: #fff; }

.fac-guide { display: none; }
body.mode-facilitator .fac-guide { display: block; }
body.mode-facilitator .screen { font-size: 1.12rem; }            /* larger type for group display */
body.mode-facilitator .player-shell { max-width: 980px; }

.fac-note { border: 1px dashed var(--brand-accent); background: var(--brand-accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; }
.fac-note .label { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); display: block; margin-bottom: 6px; }
.fac-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 14px 0; box-shadow: var(--shadow); }
.fac-block h3 { color: var(--brand-primary-dark); }
.fac-timing { width: 100%; border-collapse: collapse; }
.fac-timing td, .fac-timing th { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.fac-timing th { font-size: .78rem; text-transform: uppercase; color: var(--text-muted); }

/* comprehensive facilitator guide */
.fac-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; margin: 16px 0 6px; }
.fac-toolbar h2 { margin: 0; color: var(--brand-primary-dark); font-size: 1.2rem; }
.fac-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fac-iconbtn { display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600;
  background: var(--brand-primary-dark); color: #fff; padding: 8px 14px; border-radius: 8px; transition: background .15s ease; }
.fac-iconbtn:hover { background: var(--brand-primary); filter: brightness(1.35); }
.fac-iconbtn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.fac-snapshot { background: var(--brand-primary-soft); border-color: var(--brand-primary); }
.fac-k { display: inline-block; font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-primary-dark); margin-right: 4px; }
.fac-sub { font-weight: 700; font-size: .8rem; margin: 10px 0 4px; }
.fac-ans { color: var(--text-muted); font-size: .92em; margin-top: 3px; }
.fac-qa { margin: 0; }
.fac-qa dt { font-weight: 700; margin-top: 10px; }
.fac-qa dd { margin: 2px 0 0; }
.fac-questions { margin: 0; padding-left: 20px; }
.fac-questions > li { margin-bottom: 14px; }
.q-scenario { font-style: italic; color: var(--text-muted); margin-bottom: 3px; }
.q-stem { font-weight: 600; margin-bottom: 5px; }
.q-opt { margin: 2px 0 2px 4px; }
.fac-slides { margin: 0; padding-left: 20px; }
.fac-slides > li { margin-bottom: 14px; }
.fs-slide { font-weight: 700; color: var(--brand-primary-dark); margin-bottom: 4px; }
.fac-script { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.fs-say, .fs-ask, .fs-point { margin: 6px 0; }
.fs-say strong, .fs-ask strong, .fs-point strong, .fac-script .label { color: var(--brand-primary-dark); }
.fs-phrases { margin: 8px 0; }
.fs-phrase { border-left: 3px solid var(--border); padding-left: 12px; margin: 8px 0; }
.fs-do, .fs-dont { margin: 4px 0; }
.fs-tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 7px; border-radius: 4px; margin-right: 7px; }
.fs-tag.ok { background: #e3f3e3; color: #1f6b2e; }
.fs-tag.no { background: #fbe3e3; color: #a32525; }

/* printable handouts — hidden on screen, shown only in print */
.leader-script, .slides-print { display: none; }

/* =====================================================================
   RESPONSIVE / MOBILE  (microlearning)
   ===================================================================== */
@media (max-width: 720px) {
  :root { --fs-base: 16px; }
  .hero h1 { font-size: 1.55rem; }
  .compare { grid-template-columns: 1fr; }
  .screen { padding: 22px 18px; }
  .screen.type-title h1 { font-size: 1.7rem; }
  .screen.type-title::before { width: 110px; height: 110px; }
  .result .score { font-size: 2.4rem; }
  .player-shell { padding: 0 16px; }
  .player-top { top: 56px; }
  .appbar .container { height: 56px; }
  .appbar .logo { max-height: 30px; }                              /* leave room for the mode toggle */
  .fac-toggle button { padding: 7px 11px; font-size: .78rem; }
  .module-grid, .certgrid, .shelf { grid-template-columns: 1fr; }
  /* sticky thumb-reach controls: Next is the big primary target */
  .nav-bar { position: sticky; bottom: 0; background: var(--bg); gap: 8px;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); margin-bottom: 0;
    border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
  .nav-bar .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
  .nav-bar .btn-primary { flex: 1 1 auto; }
  /* facilitator timing table scrolls instead of forcing page width */
  .fac-timing { display: block; overflow-x: auto; }
}

/* =====================================================================
   PRINT  (facilitator guide handout)
   ===================================================================== */
@media print {
  @page { size: letter; margin: 0.95in 0.6in; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .appbar, .player-top, .nav-bar, .fac-toggle, .fac-guide, #stage,
  .lesson-region, .assessment-region, nav, footer { display: none !important; }
  /* default print target = leader script; "Download slides" switches via body.print-slides */
  .leader-script { display: block !important; }
  .slides-print { display: none !important; }
  body.print-slides .leader-script { display: none !important; }
  body.print-slides .slides-print { display: block !important; }
  body { background: #fff; color: var(--text); font-size: 11.5pt; line-height: 1.45; }
  .player-shell { max-width: none !important; margin: 0; padding: 0; }
  /* reliable left/right inset even if the print dialog overrides @page margins */
  .leader-script { padding: 0 0.3in; }

  /* running text header/footer on flowing content pages: <thead>/<tfoot> repeat per page */
  .print-frame { width: 100%; border-collapse: collapse; }
  .print-frame > tbody > tr > td, .print-frame > thead > tr > td, .print-frame > tfoot > tr > td { padding: 0; border: 0; }
  .run-head, .run-foot { display: flex; justify-content: space-between; gap: 16px; font-size: 8pt; color: var(--text-muted); }
  .run-head { border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 12px; }
  .run-foot { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 12px; }

  /* ---- leader script (portrait, themed) ---- */
  .ls-head { border-bottom: 3px solid var(--brand-primary); padding-bottom: 10px; margin-bottom: 18px; }
  .ls-kicker { font-size: 8pt; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-primary); font-weight: 700; }
  .ls-head h1 { font-size: 19pt; margin: 4px 0 2px; color: var(--brand-primary-dark); }
  .ls-meta { font-size: 10pt; color: var(--text-muted); }
  .ls-sec { margin: 14px 0; page-break-inside: avoid; }
  .ls-sec h2 { font-size: 12pt; color: var(--brand-primary-dark); border-bottom: 1.5px solid var(--brand-primary-soft); padding-bottom: 3px; margin: 0 0 7px; }
  .ls-glance { background: var(--brand-primary-soft); border: 1px solid var(--brand-primary); border-radius: 8px; padding: 12px 16px; }
  .ls-glance h2 { border: 0; margin-bottom: 4px; }
  .ls-say { margin: 5px 0; }
  .ls-cue { display: inline-block; font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
            background: var(--brand-primary); color: #fff; padding: 2px 7px; border-radius: 4px; margin-right: 7px; vertical-align: middle; }
  .ls-do .ls-cue { background: var(--brand-accent-dark); }
  .ls-pt .ls-cue { background: var(--text-muted); }
  .ls-slides { padding-left: 18px; }
  .ls-slides > li { margin-bottom: 10px; page-break-inside: avoid; }
  .ls-slide-h { font-weight: 700; color: var(--brand-primary-dark); }
  .fs-phrase { border-left: 3px solid var(--brand-primary-soft); padding-left: 12px; margin: 6px 0; page-break-inside: avoid; }
  .fs-do, .fs-dont { margin: 3px 0; }
  .fs-tag { display: inline-block; font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
  .fs-tag.ok { background: #dff0df; color: #1f6b2e; }
  .fs-tag.no { background: #f7dede; color: #a32525; }
  .ls-sec ul, .ls-sec ol { margin: 4px 0; padding-left: 20px; }
  .fac-qa dt { font-weight: 700; margin-top: 7px; color: var(--brand-primary-dark); }
  .fac-qa dd { margin: 1px 0 0; }
  .fac-ans { color: var(--text-muted); }
  .ls-foot { margin-top: 18px; border-top: 2px solid var(--brand-primary-soft); padding-top: 6px; font-size: 8pt; color: var(--text-muted); }

  /* ---- slide deck (landscape, slide-quality, themed) ---- */
  .slide-page { page-break-after: always; box-sizing: border-box; padding: 0.5in 0.7in 0.4in;
                min-height: 7.7in; display: flex; flex-direction: column; }
  .slide-page:last-child { page-break-after: auto; }
  .slide-card { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; }
  .slide-page.type-title .slide-card, .slide-page.type-callout .slide-card { justify-content: center; }
  .slide-card h1 { font-size: 32pt; color: var(--brand-primary-dark); margin: 0 0 .25em; line-height: 1.08; }
  .slide-card .slide-sub { font-size: 16pt; color: var(--text-muted); margin: 0; }
  .slide-card h2, .slide-card .screen-title { font-size: 22pt; color: var(--brand-primary-dark); margin: 0 0 .5em; }
  .slide-card { font-size: 15pt; color: var(--text); }
  .slide-card p { margin: 0 0 .5em; }
  .slide-card ul, .slide-card ol { margin: .4em 0; padding-left: 1.2em; }
  .slide-card li { margin: .35em 0; }
  .slide-card .objectives { list-style: none; padding-left: 0; }
  .slide-card .objectives li { padding-left: 1.5em; position: relative; }
  .slide-card .objectives li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-accent-dark); font-weight: 700; }
  .slide-card .opt { border: 1.5px solid var(--brand-primary); background: var(--brand-primary-soft); border-radius: 10px; padding: 10px 16px; margin: 9px 0; }
  .slide-card .callout { background: var(--brand-accent-soft); border-left: 6px solid var(--brand-accent); padding: 16px 20px; border-radius: 10px; }
  .slide-card .callout .label { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11pt; color: var(--brand-accent-dark); margin-bottom: 8px; }
  .slide-card .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: .4em; }
  .slide-card .compare .col { border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
  .slide-card .compare .col h4 { margin: 0 0 .4em; font-size: 13pt; }
  .slide-card .compare .a { background: #fdecec; }
  .slide-card .compare .b { background: var(--brand-primary-soft); }
  .slide-foot { display: flex; justify-content: space-between; align-items: center; font-size: 9pt; color: var(--text-muted);
                border-top: 3px solid var(--brand-primary); padding-top: 8px; margin-top: 12px; }

  /* ---- PDF front matter: cover + summary pages (both handouts) ---- */
  .lp-page { page-break-after: always; box-sizing: border-box; min-height: 9in; display: flex; flex-direction: column; }
  .lp-page.cover, .slide-page.cover { text-align: center; }
  .cover-top { min-height: 1.6in; display: flex; align-items: center; justify-content: center; }
  .cover-logo { max-height: 1.5in; max-width: 70%; object-fit: contain; }
  .cover-org { font-size: 22pt; font-weight: 800; color: var(--brand-primary-dark); }
  .lp-page.cover .cover-mid, .slide-page.cover .cover-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .cover-kicker { font-size: 11pt; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-primary); font-weight: 700; }
  .cover-title { font-size: 32pt; color: var(--brand-primary-dark); margin: .15em 0; line-height: 1.1; }
  .slide-page.cover .cover-title { font-size: 38pt; }
  .cover-sub { font-size: 13pt; color: var(--text-muted); }
  .cover-doctype { display: inline-block; margin-top: 12px; font-size: 10pt; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .08em; color: #fff; background: var(--brand-primary); padding: 4px 14px; border-radius: 999px; }
  .slide-page.cover .cover-doctype { font-size: 12pt; }
  .cover-legal { border-top: 2px solid var(--brand-primary); padding-top: 10px; font-size: 9pt; color: var(--text-muted); }
  .cover-contact { font-weight: 700; color: var(--text); margin-top: 2px; }
  .lp-page.summary { display: block; }
  .slide-page.summary { justify-content: flex-start; font-size: 14pt; }
  .summary-h { font-size: 15pt; color: var(--brand-primary-dark); border-bottom: 2px solid var(--brand-primary-soft); padding-bottom: 4px; margin: 0 0 8px; }
  .slide-page.summary .summary-h { font-size: 22pt; }
  .summary-note { margin-top: 16px; font-size: 8.5pt; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 6px; }

  /* assessment questions (with options, no answers marked) */
  .fac-questions { padding-left: 18px; margin: 0; }
  .fac-questions > li { margin-bottom: 10px; page-break-inside: avoid; }
  .q-scenario { font-style: italic; color: var(--text-muted); margin: 0 0 2px; }
  .q-stem { font-weight: 700; margin: 0 0 3px; }
  .q-opt { margin: 1px 0 1px 4px; }

  /* attendance sign-in sheet (last page of the facilitator handout) */
  .lp-page.attendance { display: block; page-break-before: always; page-break-after: auto; }
  .att-head { border-bottom: 3px solid var(--brand-primary); padding-bottom: 8px; margin-bottom: 16px; }
  .att-title { font-size: 17pt; color: var(--brand-primary-dark); margin: 4px 0 2px; }
  .att-meta { font-size: 10pt; color: var(--text-muted); }
  .att-fields { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 16px; }
  .att-field { display: flex; align-items: flex-end; gap: 8px; }
  .att-label { font-weight: 700; font-size: 10pt; }
  .att-blank { display: inline-block; min-width: 2.2in; border-bottom: 1px solid #333; height: 1.05em; }
  .att-table { width: 100%; border-collapse: collapse; }
  .att-table th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: .04em;
                  color: var(--text-muted); border-bottom: 2px solid var(--brand-primary); padding: 4px 8px; }
  .att-table td { border: 1px solid #999; height: 0.34in; padding: 0 8px; }
  .att-table .att-n { width: 0.4in; text-align: center; color: var(--text-muted); }
  .att-note { margin-top: 12px; font-size: 8pt; color: var(--text-muted); }

  a[href]::after { content: ""; }
}

/* =====================================================================
   LANDING DASHBOARD (illustrative)
   ===================================================================== */
.learner-hello { font-size: 1.02rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand-accent); border-radius: var(--radius); padding: 16px 18px; margin: 22px 0 6px; box-shadow: var(--shadow); }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 26px 0 14px; flex-wrap: wrap; }
.dash-title { font-family: var(--font-display); font-size: 1.55rem; color: var(--brand-primary); margin: 0; }
.dash-note { margin: 3px 0 0; font-size: .78rem; color: var(--text-muted); font-style: italic; }
.facility-select { font-size: .7rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facility-select select { font: inherit; font-weight: 500; text-transform: none; letter-spacing: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-width: 230px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.kpi-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--brand-primary); line-height: 1; }
.kpi-label { font-size: .82rem; color: var(--text-muted); margin-top: 6px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.dash-card h3 { font-size: .95rem; margin: 0 0 14px; color: var(--brand-primary-dark); }
.bar-row { margin: 12px 0; }
.bar-row .bar-label { font-size: .8rem; color: var(--text); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand-accent); transition: width .5s ease; }
.bar-fill.navy { background: var(--brand-primary); }
.vbar-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.vbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbar { width: 100%; max-width: 36px; background: linear-gradient(var(--brand-primary), var(--brand-primary-dark)); border-radius: 6px 6px 0 0; transition: height .5s ease; }
.vbar-month { font-size: .72rem; color: var(--text-muted); }
@media (max-width: 820px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } .dash-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   LOCKED CARDS + SUBSCRIPTION MODAL
   ===================================================================== */
[data-locked] { cursor: pointer; }
.modal-overlay { position: fixed; inset: 0; background: rgba(29, 36, 34, .55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 460px; width: 100%; padding: 30px 28px 26px; text-align: center; position: relative; }
.modal-box .modal-ico { font-size: 2.4rem; }
.modal-box h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--brand-primary); margin: 6px 0 10px; }
.modal-box p { color: var(--text-muted); margin: 0 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-close { position: absolute; top: 8px; right: 14px; border: 0; background: none; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--text); }

/* in-context help — "?" tip + popover (assets/js/help-tip.js, help-data.js) */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; padding: 0; vertical-align: middle;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--brand-primary, #2d3340); color: #fff;
  font: 700 11px/1 var(--font-body, sans-serif); opacity: .65;
}
.help-tip:hover, .help-tip:focus { opacity: 1; }
.help-pop {
  position: fixed; z-index: 1000; max-width: 280px;
  background: var(--surface, #fff); color: var(--text, #222);
  border: 1px solid var(--border, #ddd); border-radius: 10px;
  box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.18));
  padding: 12px 14px; font-size: .9rem;
}
.help-pop strong { display: block; color: var(--brand-primary, #2d3340); margin-bottom: 4px; font-family: var(--font-display, sans-serif); }
.help-pop p { margin: 0 0 8px; line-height: 1.5; color: var(--text, #333); }
.help-pop a { color: var(--brand-accent, #f36744); text-decoration: none; font-weight: 600; }
.help-pop a:hover { text-decoration: underline; }

/* D3 — small-screen: keep tall modals usable on short viewports */
@media (max-width: 560px) {
  .modal-box { padding: 24px 18px 22px; max-height: calc(100vh - 40px); overflow-y: auto; }
}
