/* ============================================================
   BRODEUR'S BISTRO — Staff Training Library
   Direction A · Bistro Standard
   ============================================================ */

@font-face {
  font-family: "Bronzetti";
  src: url("fonts/Bronzetti-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ============ TOKENS ============ */
:root {
  /* brand */
  --bb-red:        #C8102E;
  --bb-red-dark:   #9E0B23;
  --bb-red-deep:   #4A0D14;
  --bb-black:      #111111;
  --bb-ink:        #1F1F1F;

  /* paper */
  --bb-shell:      #FAF7F1;
  --bb-cream:      #F5EFE6;
  --bb-paper:      #FFFFFF;
  --bb-line:       #E5DFD3;

  /* greys */
  --bb-muted:      #5C5750;
  --bb-mute-dark:  #cfcfcf;

  /* semantic */
  --bb-good:       #1F7A3F;
  --bb-good-soft:  #dff5e2;
  --bb-bad:        #B0271A;
  --bb-bad-soft:   #fbe1de;
  --bb-warn-bg:    #fff8e6;
  --bb-warn-line:  #f0d27a;
  --bb-warn-ink:   #8a6a10;

  /* medal */
  --bb-gold:       #d4a868;
  --bb-silver:     #a8a8a8;
  --bb-bronze:     #b07448;

  /* elevation */
  --bb-shadow-sm:  0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --bb-shadow-md:  0 4px 14px rgba(0,0,0,.07);
  --bb-shadow-lg:  0 6px 22px rgba(0,0,0,.28);

  /* radii */
  --bb-r:          6px;
  --bb-r-sm:       4px;
  --bb-r-pill:     99px;

  /* type */
  --bb-font-logo:    "Bronzetti", "Oswald", "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  --bb-font-display: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bb-font-body:    "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --bb-fs-body:    15px;
  --bb-fs-sm:      13px;
  --bb-fs-xs:      12px;
  --bb-fs-eyebrow: 12px;

  --bb-track-eyebrow:    0.18em;
  --bb-track-caps:       0.08em;
  --bb-track-caps-tight: 0.04em;

  /* spacing (density-aware) */
  --bb-sp-1: 4px;
  --bb-sp-2: 8px;
  --bb-sp-3: 12px;
  --bb-sp-4: 16px;
  --bb-sp-5: 22px;
  --bb-sp-6: 28px;
  --bb-sp-7: 36px;
  --bb-sp-8: 48px;

  /* layout */
  --header-h: 60px;
  --tabbar-h: 64px;
  --rail-w:   220px;

  --sa-top: env(safe-area-inset-top);
  --sa-bot: env(safe-area-inset-bottom);
}

html[data-density="compact"] {
  --bb-sp-3: 10px;
  --bb-sp-4: 12px;
  --bb-sp-5: 16px;
  --bb-sp-6: 20px;
  --bb-sp-7: 28px;
}

/* ============ BASE ============ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bb-shell);
  color: var(--bb-ink);
  font-family: var(--bb-font-body);
  font-size: var(--bb-fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: calc(var(--header-h) + var(--sa-top));
  padding-bottom: calc(var(--tabbar-h) + var(--sa-bot));
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--bb-red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input { font: inherit; }

.hidden { display: none !important; }
.fleur { color: var(--bb-red); font-style: normal; line-height: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ============ TOP HEADER ============ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: var(--bb-black);
  color: #fff;
  border-bottom: 3px solid var(--bb-red);
  padding-top: var(--sa-top);
}
.app-header-inner {
  height: var(--header-h);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff;
}
.brand-mark {
  font-size: 24px;
  color: var(--bb-red);
}
.brand-text {
  display: flex; flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-family: var(--bb-font-logo);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bb-mute-dark);
  margin-top: 4px;
  font-weight: 500;
}

.topnav { display: flex; gap: 22px; justify-content: center; }
.topnav-link {
  color: #ddd;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .12s, border-color .12s;
}
.topnav-link:hover { color: #fff; }
.topnav-link.on { color: #fff; border-bottom-color: var(--bb-red); font-weight: 700; }

/* White magnifying-glass search, sits beside Dashboard in the top nav. */
.topnav-search {
  background: none; border: 0; cursor: pointer;
  color: #fff; font-size: 20px; line-height: 1;
  padding: 4px 6px; margin-right: 4px;
  opacity: 0.9;
}
.topnav-search:hover { opacity: 1; }

.topbar-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--bb-r-sm);
  background: rgba(255,255,255,0.06);
  color: #fff;
  display: grid; place-items: center;
  font-size: 16px;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn.light {
  background: #fff;
  color: var(--bb-ink);
  border: 1px solid var(--bb-line);
}
.icon-btn.light:hover { background: var(--bb-cream); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  color: #fff;
}
.user-chip:hover { background: rgba(255,255,255,0.12); }
.user-init {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bb-red); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.user-name {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
}

/* "Desktop ↗" link in the SPA topbar — points at the canonical Flask
   LMS at /. Matches the visual weight of the icon buttons but reads as
   a pill so it's recognisably a cross-site jump. */
.desktop-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.desktop-link:hover {
  background: var(--bb-red);
  border-color: var(--bb-red);
  color: #fff;
  text-decoration: none;
}

/* ============ BOTTOM TABS (mobile) ============ */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--sa-bot));
  padding-bottom: var(--sa-bot);
  background: var(--bb-paper);
  border-top: 1px solid var(--bb-line);
  display: grid;
  /* 6 tabs at narrow widths — auto-fit so 7 future games tab still works */
  grid-template-columns: repeat(6, 1fr);
  z-index: 25;
}
.tab {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  color: var(--bb-muted);
  font-size: 9px;          /* shrunk one step to fit "MENU ITEMS" in 6-col layout */
  font-weight: 700;
  letter-spacing: 0.04em;  /* slightly tighter tracking too */
  text-transform: uppercase;
  padding: 6px 2px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;            /* allow shrinking */
}
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-ico { font-size: 19px; line-height: 1; }
.tab.on { color: var(--bb-red); }

/* ============ MAIN ============ */
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 16px 28px;
}

/* Site-wide credit line under every tab — same voice as footer.fp on
   the Flask pages. Sits in normal flow after <main>, above the fixed
   tab bar (body padding-bottom already clears it). */
.app-footer {
  text-align: center;
  font-size: 11px;
  font-style: italic;
  color: var(--bb-muted);
  padding: 6px 16px 26px;
  border-top: 1px solid var(--bb-line);
  max-width: 1180px;
  margin: 0 auto;
}
.app-footer-fleur { color: var(--bb-red); font-style: normal; }

/* AllerGenius tab — the tool has its own full header/nav, so give it
   the whole tab body instead of boxing it into a card. */
.allergenius-frame {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--r, 6px);
  height: calc(100vh - var(--header-h) - var(--sa-top) - var(--tabbar-h) - var(--sa-bot) - 50px);
  min-height: 480px;
}

/* ============ TYPOGRAPHY ============ */
.eyebrow {
  font-size: var(--bb-fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--bb-track-eyebrow);
  font-weight: 700;
  color: var(--bb-red);
  margin-bottom: 8px;
}
.h1 {
  font-family: var(--bb-font-logo);   /* Bronzetti — display face */
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--bb-black);
}
.greeting-h1 { font-size: clamp(32px, 5vw, 52px); }
.h2 {
  font-family: var(--bb-font-logo);   /* Bronzetti — match h1 */
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  color: var(--bb-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 36px 0 14px;
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap;
}
.h2-sub {
  color: var(--bb-muted);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
/* BOH role sub-headers within a category */
.boh-subgroup { margin-top: 6px; }
.subcat-head {
  font-family: var(--bb-font-logo);
  font-size: 14px;
  font-weight: 800;
  color: var(--bb-red);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 18px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--bb-line);
}
.subcat-empty { font-style: italic; color: var(--bb-muted); margin: 4px 0 8px; }
.course-coming-soon { opacity: 0.6; cursor: default; box-shadow: none; }
.course-coming-soon:hover { border-color: var(--bb-line); box-shadow: none; transform: none; }

/* Card-deck mini-modules (La Ligne) */
.cm-head { margin: 6px 0 12px; }
.cm-head-eyebrow { font-family: var(--bb-font-logo); font-size: 15px; font-weight: 800; color: var(--bb-red); text-transform: uppercase; letter-spacing: .04em; }
.cm-progress { display: flex; gap: 6px; margin-top: 8px; }
.cm-dot { width: 26px; height: 5px; border-radius: 99px; background: var(--bb-line); }
.cm-dot.on { background: var(--bb-red); }
.cm-dot.past { background: var(--bb-red); opacity: .45; }
.cm-card { background: var(--bb-paper); border: 1px solid var(--bb-line); border-radius: var(--bb-r); box-shadow: var(--bb-shadow-sm); padding: 20px 20px 22px; min-height: 240px; }
.cm-eyebrow { color: var(--bb-red); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.cm-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 12px; color: var(--bb-black); }
.cm-intro { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.cm-bullets { list-style: none; margin: 0; padding: 0; }
.cm-bullets li { position: relative; padding: 6px 0 6px 20px; font-size: 14.5px; line-height: 1.5; border-top: 1px solid var(--bb-line); }
.cm-bullets li:first-child { border-top: 0; }
.cm-bullets li::before { content: "▪"; position: absolute; left: 2px; top: 6px; color: var(--bb-red); }
.cm-callout { margin-top: 14px; background: var(--bb-cream); border-left: 4px solid var(--bb-red); border-radius: 0 var(--bb-r) var(--bb-r) 0; padding: 10px 14px; font-size: 14px; }
.cm-callout-lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--bb-red); margin-bottom: 2px; }
.cm-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 4px; }
.cm-count { font-size: 12px; color: var(--bb-muted); letter-spacing: .04em; }
.cm-done { margin-top: 12px; color: var(--bb-good); font-weight: 700; font-size: 14px; }
.greeting-sub {
  font-size: 15px;
  color: var(--bb-muted);
  max-width: 64ch;
  margin: 8px 0 0;
}
.subhead {
  margin: 18px 0 8px;
  font-size: 11px; color: var(--bb-muted);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700;
}

/* ============ BUTTONS ============ */
.btn {
  background: var(--bb-paper);
  color: var(--bb-ink);
  border: 1px solid var(--bb-line);
  padding: 10px 16px;
  border-radius: var(--bb-r);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--bb-cream); border-color: var(--bb-line); }
.btn.primary {
  background: var(--bb-red);
  color: #fff;
  border-color: var(--bb-red);
}
.btn.primary:hover { background: var(--bb-red-dark); border-color: var(--bb-red-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--bb-red); }
.btn.ghost:hover { background: var(--bb-cream); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; height: 44px; justify-content: center; }

.back-link {
  font-size: 12px; color: var(--bb-muted);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  margin-bottom: 14px; display: inline-block; cursor: pointer;
}
.back-link:hover { color: var(--bb-red); }

/* ============ HERO ============ */
.hero {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 18px 0 10px;
  margin-bottom: 2px;
}
.hero .eyebrow { display: block; }

/* ============ STAT STRIP ============ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.stat {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 16px 18px;
  box-shadow: var(--bb-shadow-sm);
}
.stat-n {
  font-size: 32px; font-weight: 800;
  color: var(--bb-red);
  line-height: 1;
  letter-spacing: -0.01em;
}
.stat-lbl {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bb-muted);
  margin-top: 8px;
  font-weight: 700;
}
.stat-sub {
  font-size: 12px;
  color: var(--bb-muted);
  margin-top: 4px;
  font-style: italic;
}

/* ============ PROGRESS BAR ============ */
.progress {
  height: 8px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--bb-red);
  transition: width 200ms ease-out;
}
.progress.thin { height: 6px; }

/* ============ RECIPE TASK CARD ============ */
.rx-task {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-left: 6px solid var(--bb-red);
  border-radius: var(--bb-r);
  padding: 16px 18px;
  margin: 16px 0;
  box-shadow: var(--bb-shadow-md);
}
.rx-task-head {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 10px;
}
.rx-task-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.rx-task-title { flex: 1; font-weight: 700; font-size: 15px; }
.rx-task-pct {
  font-size: 22px; font-weight: 800; color: var(--bb-red);
  letter-spacing: -0.01em;
}
.rx-task-meta { font-size: 13px; margin-top: 8px; }
.rx-task-meta a { color: var(--bb-red); font-weight: 700; cursor: pointer; }
.rx-task-foot {
  font-size: 12px; color: var(--bb-muted);
  margin-top: 4px; font-style: italic;
}

/* ============ NOTIFY CARD ============ */
.notify {
  display: flex; gap: 16px;
  background: var(--bb-warn-bg);
  border: 1px solid var(--bb-warn-line);
  border-left: 6px solid var(--bb-red);
  border-radius: var(--bb-r);
  padding: 16px 18px;
  margin: 16px 0;
}
.notify-ico { font-size: 24px; line-height: 1; flex-shrink: 0; }
.notify-title {
  font-size: 15px; font-weight: 800;
  color: var(--bb-red);
  margin-bottom: 4px;
}
.notify-list { font-size: 14px; line-height: 1.5; }
.notify-list a {
  color: var(--bb-ink); font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(200,16,46,0.4);
  text-underline-offset: 2px;
  cursor: pointer;
}
.notify-list a:hover { color: var(--bb-red); }
.notify-foot {
  font-size: 12px; color: var(--bb-muted);
  margin-top: 8px; font-style: italic;
}

/* ============ STREAK RIBBON ============ */
.streak-ribbon {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bb-black); color: #fff;
  padding: 8px 16px 8px 12px;
  border-left: 4px solid var(--bb-red);
  font-size: 13px;
  margin: 4px 0 12px;
}
.streak-flame { font-size: 18px; }
.streak-n {
  font-family: var(--bb-font-logo);
  font-size: 22px; font-weight: 800;
  color: var(--bb-red);
  letter-spacing: 0.02em;
}
.streak-lbl { font-weight: 500; letter-spacing: 0.04em; }

/* ============ MODULE TILE ============ */
.mt-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
.course {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 18px 20px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .12s, box-shadow .12s, transform .06s;
  position: relative;
  box-shadow: var(--bb-shadow-sm);
  width: 100%;
}
.course:hover {
  border-color: var(--bb-red);
  box-shadow: var(--bb-shadow-md);
  transform: translateY(-1px);
}
.course-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.course-eyebrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bb-muted); font-weight: 700;
}
.course-title {
  font-size: 17px; font-weight: 700;
  text-wrap: pretty;
  line-height: 1.25;
}
.course-meta {
  font-size: 12px; color: var(--bb-muted);
}
.course.done {
  background: linear-gradient(180deg, #f4faf3 0%, #fff 100%);
  border-color: rgba(31,122,63,0.3);
}
.course.done:hover { border-color: var(--bb-good); }
.course.inprog { border-left: 3px solid var(--bb-red); }
.course-new-badge {
  position: absolute; top: -8px; right: 14px;
  background: var(--bb-red); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 0.16em;
  padding: 3px 8px; border-radius: var(--bb-r-sm);
  box-shadow: var(--bb-shadow-md);
}
.pill {
  font-size: 9px; font-weight: 800; letter-spacing: 0.14em;
  padding: 3px 7px; border-radius: 3px;
  background: #eee; color: #555;
  text-transform: uppercase;
}
/* Module lifecycle pills — four states, low-to-high progression:
   NEW (untouched) > IN PROGRESS (opened/attempted) > COMPLETED
   (quiz passed) > SIGNED OFF (manager signed). The status code names
   are "new", "inprog", "done", "passed" — see moduleStatus() in app.js. */
.pill.new     { background: rgba(200,16,46,0.08); color: var(--bb-red); border: 1px solid rgba(200,16,46,0.4); }
.pill.inprog  { background: var(--bb-warn-bg); color: var(--bb-warn-ink); border: 1px solid var(--bb-warn-line); }
.pill.done    { background: var(--bb-good-soft); color: var(--bb-good); border: 1px solid #9fd9b2; }
.pill.passed  { background: var(--bb-good); color: #fff; }
.pill.signed  { background: var(--bb-black); color: #fff; }   /* legacy alias */

/* ============ RECIPE "COMING SOON" TILE ============ */
/* Mirrors the LMS website's .rxtile-coming-soon — red bordered,
   diagonally hatched, non-clickable. Used for menu items where the
   recipe card hasn't been authored yet. */
.recipe-coming-soon {
  border: 2px solid var(--bb-red) !important;
  background: repeating-linear-gradient(
    45deg,
    rgba(200, 16, 46, 0.03),
    rgba(200, 16, 46, 0.03) 8px,
    rgba(200, 16, 46, 0.07) 8px,
    rgba(200, 16, 46, 0.07) 16px
  ) !important;
  cursor: not-allowed;
  opacity: 0.85;
}
.recipe-coming-soon:hover {
  border-color: var(--bb-red) !important;
  box-shadow: none !important;
  transform: none !important;
}
.recipe-coming-soon .course-title { color: var(--bb-red); }
.recipe-coming-soon .course-meta  { color: var(--bb-red); font-style: italic; }
.recipe-coming-soon .pill {
  background: var(--bb-red);
  color: #fff;
}

/* ============ RECIPE/PREP COURSE CARD ============ */
/* Menu Items and Preps tabs reuse the .course tile pattern with a
   small red fleur-de-lis instead of a photo placeholder. */
.recipe-course .course-head {
  gap: 8px;
}
.recipe-fleur {
  font-size: 20px;
  line-height: 1;
  color: var(--bb-red);
  flex-shrink: 0;
  margin-right: 2px;
}
.recipe-course .course-eyebrow { flex: 1; }

/* ============ LIBRARY TILE ============ */
.lib-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}
.lib-tile {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 18px;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 124px;
  transition: border-color .12s, box-shadow .12s;
  box-shadow: var(--bb-shadow-sm);
  width: 100%;
}
.lib-tile:hover { border-color: var(--bb-red); box-shadow: var(--bb-shadow-md); }
.lib-tile-eye {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bb-muted); font-weight: 700;
}
.lib-tile-title {
  font-size: 18px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  margin-top: 4px;
}
.lib-tile-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px;
}
.lib-tile-count {
  font-size: 24px; font-weight: 800; color: var(--bb-red);
  line-height: 1;
}
.lib-tile-arrow { color: var(--bb-muted); font-size: 16px; }

/* ============ FILE ROW LIST ============ */
.file-list { display: grid; gap: 6px; }
.file-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 12px 16px;
  text-align: left;
  width: 100%;
}
.file-row:hover { border-color: var(--bb-red); background: var(--bb-shell); }
.file-ico {
  width: 36px; height: 36px;
  background: var(--bb-cream);
  display: grid; place-items: center;
  border-radius: var(--bb-r-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--bb-ink);
}
.file-body { min-width: 0; }
.file-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta {
  font-size: 12px; color: var(--bb-muted);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-tail { color: var(--bb-muted); font-size: 18px; }
.file-tail.done { color: var(--bb-good); }

/* ============ LIBRARY TAB STRIP ============ */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--bb-line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs-tab {
  padding: 10px 14px;
  font-size: 13px; font-weight: 700;
  color: var(--bb-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.tabs-tab[aria-selected="true"] {
  color: var(--bb-red);
  border-bottom-color: var(--bb-red);
}
.tabs-tab .badge {
  background: var(--bb-cream); color: var(--bb-muted);
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
}
.tabs-tab[aria-selected="true"] .badge { background: var(--bb-red); color: #fff; }

/* ============ RECIPES GRID / LIST ============ */
.rx-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.rx-search {
  width: 100%; padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--bb-line); border-radius: var(--bb-r);
  background: var(--bb-paper);
  outline: none;
}
.rx-search:focus {
  border-color: var(--bb-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}
.rx-filter-pills {
  display: flex; gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}
.rx-filter-pills::-webkit-scrollbar { display: none; }
.rx-filter-pill {
  font-size: 11px; padding: 6px 12px; border-radius: var(--bb-r-sm);
  background: var(--bb-paper); border: 1px solid var(--bb-line);
  color: var(--bb-muted);
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.rx-filter-pill.on {
  background: var(--bb-red); color: #fff; border-color: var(--bb-red);
}
.rx-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 24px;
}
.rx-card {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  overflow: hidden;
  text-align: left;
  display: flex; flex-direction: column;
  box-shadow: var(--bb-shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .06s;
}
.rx-card:hover {
  border-color: var(--bb-red);
  box-shadow: var(--bb-shadow-md);
  transform: translateY(-1px);
}
.rx-photo {
  aspect-ratio: 3 / 2;
  background: #1a1a1a;
  background-size: cover; background-position: center;
  position: relative;
}
.rx-photo-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--bb-mute-dark);
  font-size: 32px;
}
.rx-card-body { padding: 12px 14px; }
.rx-card-name {
  font-weight: 700; font-size: 14px; line-height: 1.25;
}
.rx-card-meta {
  font-size: 11px; color: var(--bb-muted);
  margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.rx-viewed-chip {
  position: absolute; top: 8px; right: 8px;
  background: var(--bb-good); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}

.rx-list { display: grid; gap: 6px; margin-bottom: 24px; }

/* ============ LEADERBOARD ============ */
.lb-hero {
  display: flex; gap: 22px; align-items: center;
  padding: 24px 28px;
  background: linear-gradient(135deg, #1a1a1a 0%, var(--bb-black) 100%);
  color: #fff;
  border-radius: var(--bb-r);
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}
.lb-hero-medal { font-size: 56px; line-height: 1; flex-shrink: 0; }
.lb-hero-text { flex: 1; min-width: 0; }
.lb-hero-eyebrow {
  color: var(--bb-red);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}
.lb-hero-name {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-top: 6px; line-height: 1;
}
.lb-hero-stats { font-size: 13px; color: #cfcfcf; margin-top: 6px; font-style: italic; }
.lb-hero-praise { font-size: 14px; color: #fff; margin-top: 8px; font-style: italic; }
.lb-hero-tag { position: absolute; right: 18px; top: 14px; opacity: 0.4; font-size: 32px; }

.lb-list { display: grid; gap: 10px; margin-bottom: 24px; }
.lb-row {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 14px 18px;
}
.lb-row.rank-1 { background: linear-gradient(135deg, rgba(212,168,104,0.18) 0%, rgba(212,168,104,0.04) 100%); border-left: 4px solid var(--bb-gold); }
.lb-row.rank-2 { background: linear-gradient(135deg, rgba(192,192,192,0.18) 0%, rgba(192,192,192,0.04) 100%); border-left: 4px solid var(--bb-silver); }
.lb-row.rank-3 { background: linear-gradient(135deg, rgba(176,116,72,0.16) 0%, rgba(176,116,72,0.04) 100%); border-left: 4px solid var(--bb-bronze); }
.lb-medal { font-size: 28px; line-height: 1; width: 36px; text-align: center; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 15px; }
.lb-sub { font-size: 12px; color: var(--bb-muted); margin-top: 2px; }
.lb-sub strong { color: var(--bb-red); font-weight: 800; }
.lb-praise { font-size: 12px; color: var(--bb-muted); margin-top: 4px; font-style: italic; }
.lb-empty {
  background: var(--bb-cream);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 22px 24px;
  color: var(--bb-muted);
}
.lb-empty strong { color: var(--bb-ink); display: block; margin-bottom: 4px; }

/* ============ TEAM / POSITIONS ============ */
.pos-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
}
.pos-card {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 16px 18px;
  box-shadow: var(--bb-shadow-sm);
  text-align: left;
}
.pos-eye {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bb-muted);
  font-weight: 700;
}
.pos-n {
  font-size: 32px; font-weight: 800; color: var(--bb-red);
  line-height: 1; letter-spacing: -0.01em;
  margin: 8px 0 4px;
}
.pos-sub { font-size: 12px; color: var(--bb-muted); font-style: italic; }

/* ============ MODULE DETAIL ============ */
.module-wrap { max-width: 760px; margin: 0 auto; }
.why-card {
  background: var(--bb-cream);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 22px 24px;
  margin: 18px 0 24px;
}
.why-card .eyebrow { margin-bottom: 6px; }
.why-body {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
}

.facts {
  width: 100%; border-collapse: collapse;
  border-top: 2px solid var(--bb-black);
  border-bottom: 2px solid var(--bb-black);
  margin: 16px 0 24px;
}
.facts th {
  background: var(--bb-black); color: #fff;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 8px 12px; text-align: left;
  font-weight: 700;
}
.facts td {
  background: var(--bb-cream);
  padding: 10px 12px;
  font-size: 13px; font-weight: 600;
}

/* numbered steps (44px red square) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  overflow: hidden;
  align-items: stretch;
}
.n-square {
  background: var(--bb-red); color: #fff;
  font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
  align-self: stretch;
}
.steps-body { padding: 14px 18px; }
.steps-body strong {
  display: block;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bb-red);
  margin-bottom: 4px;
}
.steps-body p { margin: 0; font-size: 14px; line-height: 1.5; }

.bullets {
  padding-left: 22px; margin: 0;
}
.bullets.cream-block {
  background: var(--bb-cream);
  border: 1px solid var(--bb-line);
  padding: 18px 18px 18px 38px;
  border-radius: var(--bb-r);
}
.bullets li { margin-bottom: 6px; }
.bullets li::marker { color: var(--bb-red); }

.watch-for {
  background: var(--bb-red); color: #fff;
  display: flex; gap: 14px; align-items: center;
  padding: 14px 18px;
  border-radius: var(--bb-r);
  margin: 18px 0;
}
.watch-for-mark {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  border-radius: var(--bb-r-sm);
  flex-shrink: 0;
}
.watch-for-text {
  font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
  line-height: 1.4;
}

.module-cta { display: flex; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.module-foot { font-size: 11px; color: var(--bb-muted); font-style: italic; margin-top: 24px; }

/* ============ QUIZ ============ */
.quiz-wrap { max-width: 760px; margin: 0 auto; }
.quiz-list { display: grid; gap: 14px; margin: 18px 0; }
.q {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 20px 22px;
  box-shadow: var(--bb-shadow-sm);
}
.q.passed { border-left: 4px solid var(--bb-good); }
.q.failed { border-left: 4px solid var(--bb-bad); }
.q-num {
  color: var(--bb-red);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 11px;
  text-transform: uppercase;
}
.q-prompt { font-size: 16px; font-weight: 600; margin: 6px 0 14px; line-height: 1.4; }
.q-choices { display: grid; gap: 4px; }
.q-choice {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--bb-r-sm);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  background: transparent;
  width: 100%;
  color: var(--bb-ink);
  border: 1px solid transparent;
}
.q-choice:hover { background: var(--bb-shell); }
.q-choice .q-bullet {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--bb-line);
  flex-shrink: 0;
  display: grid; place-items: center;
}
.q-choice.selected .q-bullet { border-color: var(--bb-red); }
.q-choice.selected .q-bullet::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bb-red);
}
.q-choice.is-answer {
  background: var(--bb-good-soft);
  border-color: rgba(31,122,63,0.4);
  font-weight: 600;
}
.q-choice.is-answer .q-bullet { border-color: var(--bb-good); }
.q-choice.is-answer .q-bullet::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bb-good);
}
.q-choice.wrong-pick {
  background: var(--bb-bad-soft);
  border-left: 3px solid var(--bb-bad);
}
.score-banner {
  padding: 18px 22px; border-radius: var(--bb-r);
  font-size: 16px; font-weight: 700;
  margin: 18px 0;
  display: flex; align-items: center; gap: 14px;
}
.score-banner.pass { background: var(--bb-good); color: #fff; }
.score-banner.fail { background: var(--bb-bad); color: #fff; }
.score-banner .score-n { font-size: 26px; font-weight: 800; }

/* ============ ALLERGENS ============ */
.allergen-band {
  background: var(--bb-red-deep); color: #fff;
  border-radius: var(--bb-r);
  padding: 14px 18px;
  display: flex; gap: 14px; align-items: center;
  margin: 16px 0;
}
.allergen-band-mark {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  border-radius: var(--bb-r-sm);
  flex-shrink: 0;
}
.allergen-band-text {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  line-height: 1.4;
}
.allergen-band-text small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  font-style: italic;
  color: #f1d0d6;
  margin-top: 3px;
}

.allergen-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin: 16px 0;
}
.allergen-cell {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 14px 16px;
}
.allergen-cell-top { display: flex; gap: 8px; align-items: center; }
.sev-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bb-muted);
  display: inline-block;
}
.sev-dot.high { background: var(--bb-red); }
.sev-dot.med  { background: var(--bb-warn-line); }
.sev-dot.low  { background: var(--bb-muted); }
.allergen-name { font-weight: 700; font-size: 14px; }
.allergen-cell-n {
  font-size: 26px; font-weight: 800; color: var(--bb-red);
  line-height: 1; margin: 6px 0 2px;
  letter-spacing: -0.01em;
}
.caps-tiny {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--bb-muted);
}

/* ============ VIEWER ============ */
.viewer {
  position: fixed; inset: 0;
  background: var(--bb-shell);
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr;
}
.viewer.hidden { display: none; }
.viewer-bar {
  background: var(--bb-black);
  color: #fff;
  border-bottom: 3px solid var(--bb-red);
  padding: calc(12px + var(--sa-top)) 16px 12px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 14px; align-items: center;
}
.viewer-title {
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.viewer-actions { display: flex; gap: 8px; align-items: center; }
.viewer iframe {
  width: 100%; height: 100%; border: 0;
  background: #fff;
}
.viewer-fallback { display: grid; place-items: center; padding: 30px 20px; }
.viewer-fallback-card {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 28px 22px;
  text-align: center;
  max-width: 380px;
  box-shadow: var(--bb-shadow-md);
}
.viewer-fallback-icon { font-size: 42px; margin-bottom: 12px; }
.viewer-fallback p { color: var(--bb-muted); margin: 0 0 16px; }

/* ============ SEARCH OVERLAY ============ */
.search-overlay {
  position: fixed; inset: 0;
  background: var(--bb-shell);
  z-index: 50;
  overflow: auto;
  padding-top: var(--sa-top);
}
.search-overlay.hidden { display: none; }
.search-overlay-top {
  background: var(--bb-black);
  padding: 14px 0;
  border-bottom: 3px solid var(--bb-red);
}
.search-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bb-paper);
  border-radius: var(--bb-r);
  padding: 0 14px;
}
.search-ico { color: var(--bb-muted); font-size: 18px; }
.search-box input {
  flex: 1; border: 0; outline: none;
  background: transparent;
  height: 48px; font-size: 16px;
  color: var(--bb-ink);
}
.search-close {
  font-size: 13px; font-weight: 700; color: #fff;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 16px; border: 0;
  border-radius: var(--bb-r-sm);
  background: var(--bb-red);
  flex-shrink: 0;
}
.search-close:active { background: var(--bb-red-dark); }
.search-results { padding-top: 22px; padding-bottom: 40px; }
.search-row {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--bb-paper); border: 1px solid var(--bb-line);
  border-radius: var(--bb-r); padding: 10px 14px;
  text-align: left; width: 100%;
  margin-bottom: 6px;
}
.search-row:hover { border-color: var(--bb-red); background: var(--bb-shell); }
.search-row-num {
  width: 36px; height: 36px;
  background: var(--bb-cream);
  display: grid; place-items: center;
  border-radius: var(--bb-r-sm);
  font-weight: 800; color: var(--bb-red);
  font-size: 13px;
}
.search-row-title { font-weight: 700; font-size: 14px; }
.search-row-meta { font-size: 12px; color: var(--bb-muted); margin-top: 2px; }
.search-empty {
  background: var(--bb-cream);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 24px;
  text-align: center;
  color: var(--bb-muted);
}

/* ============ SETTINGS ============ */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(17,17,17,0.55);
  z-index: 55;
  display: grid; place-items: center;
  padding: 24px;
}
.settings-overlay.hidden { display: none; }
.settings-card {
  background: var(--bb-paper);
  border-radius: var(--bb-r);
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: var(--bb-shadow-lg);
}
.settings-head {
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--bb-line);
  position: relative;
}
.settings-title {
  font-size: 22px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
}
.settings-head .icon-btn {
  position: absolute; top: 18px; right: 16px;
}
.settings-body { padding: 18px 24px 24px; display: grid; gap: 18px; }
.setting-row {
  display: grid; gap: 8px;
  border-bottom: 1px solid var(--bb-line);
  padding-bottom: 16px;
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bb-muted);
  font-weight: 700;
}
.setting-help { font-size: 12px; color: var(--bb-muted); font-style: italic; }
.seg {
  display: inline-flex; border: 1px solid var(--bb-line); border-radius: var(--bb-r-sm); overflow: hidden;
}
.seg-opt {
  padding: 8px 14px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: #fff; color: var(--bb-muted);
  border-right: 1px solid var(--bb-line);
}
.seg-opt:last-child { border-right: 0; }
.seg-opt.on { background: var(--bb-red); color: #fff; }

/* ============ PICKER ============ */
.picker {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17,17,17,0.65);
  display: grid; place-items: center;
  padding: 16px;
}
.picker.hidden { display: none; }
.picker-card {
  width: 100%; max-width: 420px;
  background: var(--bb-paper);
  border-radius: var(--bb-r);
  padding: 30px 26px;
  box-shadow: var(--bb-shadow-lg);
  text-align: center;
  border-top: 4px solid var(--bb-red);
}
.picker-mark {
  font-size: 56px;
  color: var(--bb-red);
  line-height: 1;
  margin: 0 0 10px;
}
.picker-wordmark { margin-bottom: 14px; }
.picker-name {
  font-family: var(--bb-font-logo);
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.picker-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bb-muted);
  margin-top: 4px;
}
.picker-greet {
  color: var(--bb-muted);
  font-size: 13px;
  margin: 6px 0 16px;
}
.picker input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--bb-shell);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  outline: none;
  text-align: left;
}
.picker input:focus {
  border-color: var(--bb-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}
.picker-recent {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 14px 0 18px;
}
.picker-recent .chip {
  padding: 6px 12px;
  border-radius: var(--bb-r-pill);
  background: var(--bb-cream);
  color: var(--bb-ink);
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--bb-line);
}
.picker-recent .chip:hover {
  background: var(--bb-red); color: #fff; border-color: var(--bb-red);
}

/* ============ ME ============ */
.me-hero {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 28px 22px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--bb-shadow-sm);
}
.me-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bb-red); color: #fff;
  font-size: 28px; font-weight: 800;
  display: grid; place-items: center;
  margin: 0 auto 12px;
}
.me-name {
  font-family: var(--bb-font-logo);   /* Bronzetti */
  font-size: 22px; font-weight: 800;
  text-transform: uppercase; letter-spacing: -0.01em;
}
.me-pos { color: var(--bb-muted); margin-top: 4px; font-size: 13px; font-style: italic; }

/* ============ EMPTY ============ */
.empty {
  text-align: center;
  color: var(--bb-muted);
  padding: 36px 16px;
  font-size: 14px;
  background: var(--bb-cream);
  border: 1px dashed var(--bb-line);
  border-radius: var(--bb-r);
}

/* ============ ALLERGY RUSH HOME CTA ============ */
.aa-home-cta {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--bb-black);
  color: #fff;
  border-radius: var(--bb-r);
  padding: 14px 18px;
  margin: 16px 0;
  text-decoration: none;
  box-shadow: var(--bb-shadow-md);
  border-left: 6px solid var(--bb-red);
}
.aa-home-cta:hover { background: #1a1a1a; text-decoration: none; }
.aa-home-cta-mark {
  width: 44px; height: 44px;
  background: var(--bb-red);
  border-radius: var(--bb-r-sm);
  display: grid; place-items: center;
  font-weight: 800; font-size: 24px;
  color: #fff;
}
.aa-home-cta-body { min-width: 0; }
.aa-home-cta-eye {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bb-red);
  font-weight: 800;
}
.aa-home-cta-title {
  font-size: 16px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  margin-top: 3px;
}
.aa-home-cta-sub {
  font-size: 12px; color: #cfcfcf;
  font-style: italic; margin-top: 4px;
}
.aa-home-cta-arrow { font-size: 22px; color: #fff; }

/* ============ LOGIN ============ */
.login-field {
  text-align: left;
  margin-bottom: 12px;
}
.login-field .setting-label { margin-bottom: 6px; display: block; }
.login-field input {
  width: 100%; height: 44px;
  padding: 0 14px;
  background: var(--bb-shell);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  outline: none;
  color: var(--bb-ink);
  font-size: 15px;
}
.login-field input:focus {
  border-color: var(--bb-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
  background: var(--bb-paper);
}
.login-error {
  background: var(--bb-bad-soft);
  color: var(--bb-bad);
  border: 1px solid rgba(176,39,26,0.4);
  border-left: 4px solid var(--bb-bad);
  border-radius: var(--bb-r);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin: 6px 0 12px;
  text-align: left;
}
.login-foot {
  margin-top: 16px;
  font-size: 12px;
  color: var(--bb-muted);
  font-style: italic;
  text-align: center;
}

/* ============ LOADING / TOAST ============ */
.loading {
  display: grid; place-items: center;
  padding: 40px;
  color: var(--bb-muted);
  font-size: 13px;
  font-style: italic;
}
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + var(--sa-bot));
  transform: translateX(-50%);
  background: var(--bb-black);
  color: #fff;
  border-radius: var(--bb-r);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--bb-shadow-md);
  z-index: 70;
  border-left: 4px solid var(--bb-red);
}
.toast.good { border-left-color: var(--bb-good); }
.toast.bad  { border-left-color: var(--bb-bad); }

/* ============ GREETING (bare — no card) ============ */
.greeting {
  padding: 18px 0 10px;
  margin-bottom: 2px;
}

/* ============ PROGRESS SUMMARY (merged stat + bar) ============ */
.progress-summary {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 16px 18px 18px;
  margin-bottom: 4px;
  box-shadow: var(--bb-shadow-sm);
}
.progress-summary-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.progress-summary-n {
  font-size: 30px;
  font-weight: 800;
  color: var(--bb-red);
  letter-spacing: -0.01em;
  line-height: 1;
}
.progress-summary-lbl {
  flex: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bb-muted);
  font-weight: 700;
}
.progress-summary-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--bb-muted);
}

/* ============ FACTS CHIPS (module detail) ============ */
.facts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 22px;
}
.fact-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bb-cream);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r-pill);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bb-ink);
  white-space: nowrap;
}

/* ============ HIDE COMING-SOON RECIPE TILES ============ */
/* These tiles have no action — they add visual noise.
   Re-enable with .recipe-coming-soon { display: flex; } if needed. */
.recipe-coming-soon { display: flex; }

/* ============ ACCORDION (module detail sections) ============ */
.accordion { margin: 0; }
.accordion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: var(--bb-font-logo);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 800;
  color: var(--bb-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 0;
  border-top: 1px solid var(--bb-line);
  text-align: left;
  /* Sticky — the heading pins to the top as you scroll through
     the section, so you always know where you are in the module. */
  position: sticky;
  top: calc(var(--header-h) + var(--sa-top));
  background: var(--bb-shell);
  z-index: 5;
}
.accordion-head:hover { color: var(--bb-red-dark); }
.accordion-chevron {
  font-size: 10px;
  color: var(--bb-muted);
  flex-shrink: 0;
  margin-left: 12px;
}
.accordion-body { padding-bottom: 4px; }
.accordion-body.collapsed { display: none; }

/* Required / Reference recipe pills */
.pill.required  { background: rgba(200,16,46,0.10); color: var(--bb-red); border: 1px solid rgba(200,16,46,0.35); }
.pill.reference { background: var(--bb-cream); color: var(--bb-muted); border: 1px solid var(--bb-line); }
.pill-sm        { font-size: 8px; padding: 2px 6px; }
/* Required recipe tiles get a left red accent stripe */
.course.required-item { border-left: 3px solid var(--bb-red); }

/* ============ VIEWER LOADING OVERLAY ============ */
.viewer-loading {
  position: absolute;
  top: 56px; /* clear the viewer-bar */
  left: 0; right: 0; bottom: 0;
  display: grid;
  place-items: center;
  background: var(--bb-shell);
  z-index: 2;
}
.viewer-loading-inner {
  text-align: center;
  color: var(--bb-muted);
  font-size: 13px;
  font-style: italic;
}
.viewer-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bb-line);
  border-top-color: var(--bb-red);
  border-radius: 50%;
  animation: bbSpin 0.7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes bbSpin { to { transform: rotate(360deg); } }
#viewer-frame { transition: opacity .15s ease; }

/* ============ SKELETON LOADERS ============ */
@keyframes bbShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton-line,
.skeleton-tile,
.skeleton-photo,
.skeleton-medal,
.skeleton-rx-card { background: var(--bb-line); border-radius: var(--bb-r-sm); }
.skeleton-line,
.skeleton-photo,
.skeleton-medal {
  background-image: linear-gradient(90deg,
    var(--bb-line) 0px, #f0eae0 160px, var(--bb-line) 320px);
  background-size: 800px 100%;
  animation: bbShimmer 1.4s ease-in-out infinite;
}
.skeleton-line  { height: 14px; border-radius: 99px; }
.sk-short { width: 40%; }
.sk-med   { width: 65%; }
.sk-long  { width: 88%; }

.skeleton-tile {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 16px 18px;
  min-height: 96px;
  display: flex; flex-direction: column; gap: 0;
}
.skeleton-rx-card {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  overflow: hidden;
}
.skeleton-photo {
  aspect-ratio: 3 / 2;
  background-image: linear-gradient(90deg,
    var(--bb-line) 0px, #f0eae0 160px, var(--bb-line) 320px);
  background-size: 800px 100%;
  animation: bbShimmer 1.4s ease-in-out infinite;
}
.skeleton-lb-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 14px 18px;
}
.skeleton-medal {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============ HOME SEARCH SHORTCUT ============ */
.home-search-tap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 11px 14px;
  color: var(--bb-muted);
  font-size: 14px;
  box-shadow: var(--bb-shadow-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 18px;
}
.home-search-tap:hover { border-color: var(--bb-red); }
.home-search-ico { font-size: 17px; flex-shrink: 0; }

/* ============ LEARN FILTER PILLS ============ */
.learn-filters {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
}

/* ============ CATEGORY PROGRESS COUNT ============ */
.cat-progress {
  font-size: 12px;
  color: var(--bb-muted);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  margin-left: auto;
}

/* ============ ACCORDION META LABEL ============ */
.accordion-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.accordion-meta {
  font-size: 11px;
  color: var(--bb-muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--bb-font-body);
}

/* ============ ME: RECENTLY COMPLETED ============ */
.me-recent { display: grid; gap: 6px; margin-bottom: 18px; }
.me-recent-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 11px 14px;
  text-align: left;
  width: 100%;
  box-shadow: var(--bb-shadow-sm);
  cursor: pointer;
}
.me-recent-row:hover { border-color: var(--bb-red); }
.me-recent-score { font-size: 11px; font-weight: 700; color: var(--bb-red); margin-top: 3px; }
.me-recent-score.perfect { color: var(--bb-good); }
.me-recent-retry {
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--bb-red); border: 0;
  border-radius: var(--bb-r-sm); padding: 7px 12px; cursor: pointer;
  white-space: nowrap;
}
.me-recent-retry:hover { background: var(--bb-red-dark); }
.me-recent-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bb-good);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
}
.me-recent-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.me-recent-meta  { font-size: 11px; color: var(--bb-muted); margin-top: 2px; }
.me-recent-arrow { color: var(--bb-muted); font-size: 16px; }

/* ============ CHANGE PASSWORD FORM (Me tab) ============ */
.pw-card {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  overflow: hidden;
  box-shadow: var(--bb-shadow-sm);
  margin-top: 16px;
}
.pw-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  color: var(--bb-ink);
}
.pw-toggle:hover { background: var(--bb-cream); }
.pw-form {
  border-top: 1px solid var(--bb-line);
  padding: 16px 18px 20px;
  display: grid;
  gap: 4px;
}
.pw-form.hidden { display: none; }
.pw-form .btn.primary { margin-top: 8px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 880px) {
  .topnav { display: none; }
  .user-name { display: none; }
  /* On phones the topbar is tight — drop the "Desktop" text and just
     keep the ↗ glyph as a discreet cross-site link. */
  .desktop-link .desktop-label { display: none; }
  .desktop-link { padding: 6px 10px; }
  .app-header-inner { grid-template-columns: auto 1fr auto; }
}
@media (min-width: 881px) {
  .tabbar { display: none; }
  /* Desktop shows the search icon in the top nav (beside Dashboard), so
     the standalone top-right search icon is redundant here. */
  .topbar-right #search-btn { display: none; }
  body { padding-bottom: 28px; }
  .stat-strip { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .mt-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .lib-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .pos-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  /* tighter h2 section gaps on phones */
  .h2 { margin-top: 24px; margin-bottom: 10px; }

  /* tighter module tile padding on phones */
  .course { padding: 14px 16px; }

  /* stat cards: slightly smaller on phones */
  .stat { padding: 13px 15px; }
  .stat-n { font-size: 28px; }
  .stat-lbl { margin-top: 6px; }
}

/* ============ NOTIFICATIONS ============ */
#bell-btn { position: relative; }
.bell-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--bb-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.bell-badge.hidden { display: none; }
.notif-row {
  padding: 12px 2px;
  border-bottom: 1px solid var(--bb-line);
}
.notif-row.unread { border-left: 3px solid var(--bb-red); padding-left: 10px; }
.notif-title { font-weight: 700; font-size: 14.5px; }
.notif-body-text {
  font-size: 13.5px; color: var(--bb-muted);
  line-height: 1.5; margin-top: 3px; white-space: pre-line;
}
.notif-when {
  font-size: 11px; color: var(--bb-muted);
  margin-top: 5px; letter-spacing: .04em;
}
.notif-empty {
  padding: 28px 6px; text-align: center;
  color: var(--bb-muted); font-size: 14px;
}

/* Bell relocated: sits to the right of the "Hi <name>." greeting. */
.greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bell-home {
  position: relative;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: 50%;
  width: 48px; height: 48px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--bb-shadow-sm);
  flex-shrink: 0;
}
.bell-home:active { transform: scale(0.94); }
.bell-home .bell-badge {
  top: -3px; right: -3px;
  min-width: 18px; height: 18px;
  line-height: 18px;
  font-size: 11px;
}

/* Me tab — manager admin shortcuts */
.me-admin { margin: 6px 0 18px; }
.me-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.me-admin-btn {
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Header search — promoted from a bare glyph to a visible pill. */
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.search-pill:hover { background: rgba(255,255,255,0.22); }
.search-pill-ico { font-size: 16px; }

/* Station-module training materials checklist */
.materials-block {
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  background: var(--bb-paper);
  padding: 14px 16px;
  margin: 4px 0 18px;
}
.materials-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-weight: 800; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--bb-red);
}
.materials-count { font-size: 12px; color: var(--bb-muted); letter-spacing: 0; }
.materials-count.done { color: var(--bb-good); font-weight: 700; }
.materials-sub { font-size: 13px; color: var(--bb-muted); margin: 6px 0 12px; }
.material-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--bb-line);
}
.material-row.read { opacity: .72; }
.material-info { flex: 1; min-width: 0; }
.material-title { font-weight: 600; font-size: 14px; }
.material-kind {
  font-size: 11px; color: var(--bb-muted); text-transform: uppercase;
  letter-spacing: .1em; margin-top: 2px;
}
.material-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Me tab — Messages history */
.me-msgs { margin: 6px 0 18px; }
.me-msg-row {
  background: var(--bb-paper);
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-r);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.me-msg-row.unread { border-left: 4px solid var(--bb-red); }
.me-msg-title {
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.me-msg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bb-red); flex-shrink: 0;
}
.me-msg-body { font-size: 13px; color: var(--bb-ink); margin-top: 4px; line-height: 1.45; }
.me-msg-when { font-size: 11px; color: var(--bb-muted); margin-top: 6px; }

/* ── Games tab: refined Featured + Shelf ─────────────────────────────
   Quiet white featured card with a red spine (matches the validation
   forms' objective cards), monochrome shelf tiles — red is the only
   accent. Titles use the Bronzetti display face. */
.gx-feat {
  display: flex; align-items: center; gap: 16px;
  background: var(--bb-paper);
  border: 1px solid var(--bb-line); border-left: 4px solid var(--bb-red);
  border-radius: 8px; padding: 18px;
  box-shadow: var(--bb-shadow-sm);
  text-decoration: none; color: var(--bb-ink);
  margin-bottom: 6px;
}
.gx-feat:hover { border-color: var(--bb-red); }
.gx-feat-ico {
  width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  background: var(--bb-black); color: var(--bb-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.gx-feat-mid { flex: 1; min-width: 0; }
.gx-feat-eye {
  color: var(--bb-red); font-size: 9px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}
.gx-feat-title {
  font-family: var(--bb-font-logo); font-size: 22px;
  letter-spacing: .03em; margin-top: 3px; color: var(--bb-black);
}
.gx-feat-sub { color: var(--bb-muted); font-size: 12px; margin-top: 4px; line-height: 1.45; }
.gx-feat-go {
  background: var(--bb-red); color: #fff; font-weight: 800;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.gx-feat:hover .gx-feat-go { background: var(--bb-red-dark); }
.gx-shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 420px) { .gx-shelf { grid-template-columns: 1fr 1fr; } }
.gx-card {
  background: var(--bb-paper); border: 1px solid var(--bb-line);
  border-radius: 8px; padding: 14px 10px 12px; text-align: center;
  text-decoration: none; color: var(--bb-ink);
  box-shadow: var(--bb-shadow-sm); display: block;
}
.gx-card:hover { border-color: var(--bb-red); }
.gx-card-ico {
  width: 38px; height: 38px; border-radius: 8px; margin: 0 auto 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bb-cream); border: 1px solid var(--bb-line);
  font-size: 17px;
}
.gx-card-t { font-weight: 700; font-size: 11.5px; line-height: 1.25; }
.gx-card-b {
  color: var(--bb-red); font-size: 9.5px; font-weight: 700;
  margin-top: 5px; letter-spacing: .04em;
}
.gx-card-b.never { color: #b3aca1; font-style: italic; font-weight: 400; }
.gx-foot {
  color: var(--bb-muted); font-size: 11px; font-style: italic;
  text-align: center; margin-top: 16px;
}
