/* EL-YOX SYSTEMS — Brands · the Creative Bible (bible.js). Uses the system's tokens only (light and dark come from them).
   v2 (2026-10-04): Tunisian Darija, right to left (.bb-ar dir="rtl" lang="ar", IBM Plex Sans Arabic loaded in index.html).
   Redesign the same day for ease of use: a workspace (side menu + content), summary-first items, details on demand.
   Swiss / dense dashboard inside the CRM's own system: warm ground, white cards, black ink, pill controls.
   Colour keeps its job: yellow has two jobs only, the TOF stage and «needs action» (what is still open, what to get);
   lilac = in motion / MOF / from the teardown, ink = settled / BOF / we have it, blue = data and links, red only for «never claim».
   Spacing scale 4 · 8 · 12 · 16 · 24 · 32. Motion 150–250 ms, opacity / transform only.
   English too (2026-10-05): the same page with lang="en" dir="ltr" on its containers (bible.js bbAttrs) takes the CRM's
   own Latin face, and the few left/right rules below follow the direction. */

/* ── the Arabic face and the reading rhythm, inside the bible only ── */
/* in English: the CRM's Latin face (the layout is logical: start / end follow dir="ltr" by themselves) */
.bb-ar[lang='en'], .bb-ar[lang^='fr'] { --bb-font: var(--font); }   /* (a French bible reads in the CRM's own font) */
.bb-ar {
  --bb-font: 'IBM Plex Sans Arabic', 'Geist', 'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  --bb-gap: 16px;
  --bb-r: 16px;
  --bb-ease: cubic-bezier(.2, .7, .2, 1);
  font-family: var(--bb-font); font-size: 15px; line-height: 1.7; text-align: start;
}
/* Arabic letters join: letter-spacing and capitals break them. */
.bb-ar, .bb-ar * { letter-spacing: 0 !important; text-transform: none !important; }
.bb-ar :is(h2, h3, h4, h5, h6, .btn, .qf, .input, button) { font-family: var(--bb-font); }
.bb-ar [lang='en'] { font-family: var(--font); }
.bb-ar .hint { font-size: 13px; line-height: 1.75; }
.bb-ar :is(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.bb-ar .i-lg { width: 20px; height: 20px; }
.bb-dim { color: var(--ink-3); }
.bb-ink { color: var(--ink); }
.bb-small { font-size: 12px; }
.bb-en { font-family: var(--font); font-size: 12px; color: var(--ink-3); }
.bb-text > div { overflow-wrap: anywhere; }
.bb-text > div + div { margin-top: 2px; }
/* clamps: summary first, the rest on demand */
.bb-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.bb-clamp.is-full { -webkit-line-clamp: unset; display: block; }
.bb-clamp3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.bb-card.is-open .bb-clamp3, .bb-card.is-open .bb-clamp { -webkit-line-clamp: unset; display: block; }
/* a bracketed English part of a Darija name stays whole, left to right («(Mechanism Reveal)» never splits) */
.bb-lp { white-space: nowrap; }
.bb-more-btn { font-size: 12px; font-weight: 700; color: var(--link); padding: 2px 0; min-height: 24px; text-decoration: underline; text-underline-offset: 3px; }

/* ── chips, badges, bars ── */
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.bb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; min-height: 26px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--ink-2); max-width: 100%; overflow-wrap: anywhere; line-height: 1.5; position: relative; }
a.bb-chip { text-decoration: none; transition: background .15s ease, color .15s ease; }
.bb-chip-link:hover, .bb-chip-match:hover { background: var(--ink); color: var(--on-ink); }
.bb-chip-code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--ink); direction: ltr; }
.bb-chip-ms { font-family: var(--mono); font-size: 12px; background: transparent; border: 1px solid var(--border); color: var(--ink-2); direction: ltr; }
.bb-chip-aware { background: var(--accent-soft); color: var(--accent-ink); }
.bb-chip-td { background: var(--motion); color: var(--motion-ink); }
.bb-chip-ok { background: var(--settled); color: var(--settled-ink); }
.bb-chip-weak, .bb-chip-none { background: var(--serious-soft); color: var(--serious-ink); }
.bb-chip-match { background: var(--commit); color: var(--commit-ink); }
.bb-mini-l { font-size: 12px; font-weight: 700; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.bb-prio { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 24px; padding: 0 8px; border-radius: 999px;
  font-family: var(--font); font-size: 12px; font-weight: 800; background: var(--ink); color: var(--on-ink); direction: ltr; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bb-funnel { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px; font-family: var(--font); font-size: 12px; font-weight: 800; direction: ltr; flex-shrink: 0; }
.bb-funnel-tof { background: var(--act); color: var(--act-ink); }
.bb-funnel-mof { background: var(--motion); color: var(--motion-ink); }
.bb-funnel-bof { background: var(--settled); color: var(--settled-ink); }
.bb-ver { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-family: var(--font); font-size: 12px; font-weight: 800;
  background: var(--commit); color: var(--commit-ink); direction: ltr; vertical-align: middle; }
.bb-angle-tag { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bb-rank { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); text-decoration: none; direction: ltr; position: relative; flex-shrink: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease; font-variant-numeric: tabular-nums; }
a.bb-rank:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.bb-rank.is-static { background: var(--surface-2); }
.bb-ranks { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.bb-bubble { flex-shrink: 0; width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 12px; font-weight: 800; background: var(--ink); color: var(--on-ink); direction: ltr; }
.bb-bubble-lg { width: 44px; height: 44px; border-radius: 14px; font-size: 14px; }
.bb-mi-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  font-family: var(--font); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--ink-2); line-height: 1; }
.bb-mi-n.is-todo { background: var(--act); color: var(--act-ink); }
.bb-verified { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; color: var(--ink-2); border: 1px solid var(--border-strong); flex-shrink: 0; }
/* skip link: hidden until it has the focus */
.bb-skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bb-skip:focus { width: auto; height: auto; clip: auto; overflow: visible; inset-inline-start: 16px; top: 8px; z-index: 40; padding: 8px 16px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); font-weight: 700; text-decoration: none; }
.bb-main:focus { outline: none; }
.bb-main:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 8px; }
/* filter-chip counts: readable (no opacity), 12 px */
.bb-ar .qf .n { opacity: 1; color: var(--ink-3); font-size: 12px; }
.bb-ar .qf.on-ink .n { color: var(--on-ink); }

.bb-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; font-size: 12px; min-width: 0; }
.bb-bar-l { grid-column: 1 / -1; color: var(--ink-2); font-weight: 600; }
.bb-bar-t { display: block; height: 8px; border-radius: 999px; background: var(--surface-4); overflow: hidden; min-width: 40px; }
.bb-bar-t > i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.bb-bar-s1 .bb-bar-t > i { background: var(--s1); }
.bb-bar-ink .bb-bar-t > i { background: var(--ink); }
.bb-bar.is-low .bb-bar-t > i { background: var(--serious); }
.bb-bar-v { font-family: var(--font); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; min-width: 32px; text-align: end; direction: ltr; }
.bb-bar.is-na .bb-bar-v { font-family: var(--bb-font); font-weight: 500; color: var(--ink-3); }

/* the funnel split: one bar, three parts, numbers written */
.bb-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-4); gap: 2px; width: 100%; }
.bb-split > i { display: block; min-width: 6px; }
.bb-split-tof { background: var(--act); }
.bb-split-mof { background: var(--motion); }
.bb-split-bof { background: var(--settled); }
.bb-split-l { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.bb-split-l > span { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font); font-size: 13px; font-variant-numeric: tabular-nums; }
.bb-split-l .bb-funnel { height: 20px; font-size: 12px; padding: 0 6px; }

/* ── the box on the brand's page ── */
.bb-box { gap: 16px; }
.bb-box .cpb-head { margin-bottom: 0; }
.bb-box .cpb-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.bb-box .cpb-head .bb-ver { color: var(--commit-ink); font-size: 12px; }
.bb-box-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.bb-bstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bb-bstat { display: flex; flex-direction: column; gap: 0; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: inherit; min-width: 0;
  transition: border-color .15s ease, background .15s ease; }
.bb-bstat:hover { border-color: var(--ink-3); }
.bb-bstat b { font-family: var(--font); font-size: 22px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bb-bstat span { font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-box-split { display: flex; flex-direction: column; gap: 6px; }
.bb-box-top { display: flex; flex-direction: column; gap: 6px; }
.bb-toplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bb-toplist a { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; padding: 4px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: inherit; }
.bb-toplist a:hover { background: var(--wash); }
.bb-toplist span[dir] { min-width: 0; overflow-wrap: anywhere; }
.bb-box-act { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── the page: header ── */
.bb-page { gap: 16px; position: relative; }
.bb-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border); position: relative; }
.bb-head-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); flex-shrink: 0; }
.bb-head-more { display: none; }
.bb-head-id { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; flex: 1 1 200px; }
.bb-head h2 { font-size: 22px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.bb-head-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.bb-head-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* تونسي | English: a small segmented control; each button is written in its own language and face */
.bb-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); flex-shrink: 0; }
.bb-lang button { min-height: 30px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1; }
.bb-lang button[lang='ar'] { font-family: 'IBM Plex Sans Arabic', var(--font); }
.bb-lang button[lang='en'] { font-family: var(--font); }
.bb-lang button:hover { color: var(--ink); }
.bb-lang button.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-box .cpb-head { flex-wrap: wrap; gap: 8px 12px; }
.bb-box .cpb-head .bb-lang { margin-inline-start: auto; }
/* the English page's word on its translation (none yet, or the Darija edited after it) */
.bb-en-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft-2, var(--surface-2)); color: var(--ink); font-size: 13px; line-height: 1.5; }
.bb-en-note .i { flex-shrink: 0; margin-top: 2px; }
.bb-about { flex: 1 1 100%; padding: 12px 16px; border-radius: var(--bb-r); background: var(--surface-2); font-size: 13px; animation: bb-in .2s var(--bb-ease); }
.bb-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* ── the workspace: side menu + content ── */
.bb-ws { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }
.bb-navwrap { position: sticky; top: calc(var(--topbar-h) + 16px); z-index: 15; min-width: 0; }
.bb-mbar { display: none; }
.bb-side { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border);
  max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; overscroll-behavior: contain; }
.bb-mg { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); }
.bb-mg-l { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 0 8px 2px; }
.bb-mi { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px; border-radius: 12px; text-decoration: none; color: var(--ink-2);
  font-size: 14px; font-weight: 600; transition: background .15s ease, color .15s ease; }
.bb-mi > .i { color: var(--ink-3); flex-shrink: 0; }
.bb-mi:hover { background: var(--wash-strong); color: var(--ink); }
.bb-mi.on { background: var(--ink); color: var(--on-ink); }
.bb-mi.on > .i { color: var(--on-ink); }
.bb-mi-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-mi-end { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bb-mi.on .bb-mi-n:not(.is-todo) { background: color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); }
.bb-st { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bb-st.is-empty { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); margin-inline: 5px; }
.bb-st.is-done { color: var(--ink-3); width: 22px; }
.bb-mi.on .bb-st.is-empty { border-color: var(--on-ink); }
.bb-mi.on .bb-st.is-done { color: var(--on-ink); }
.bb-main { min-width: 0; display: flex; flex-direction: column; gap: var(--bb-gap); }

/* ── a section ── */
.bb-sec { display: flex; flex-direction: column; gap: var(--bb-gap); min-width: 0; }
.bb-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bb-sec-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink); flex-shrink: 0; }
.bb-sec-tt { flex: 1 1 260px; min-width: 0; }
.bb-sec-tt h3 { font-size: 20px; font-weight: 700; line-height: 1.4; }
.bb-sec-tt h3:focus { outline: none; }
.bb-sec-tt h3:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.bb-sec-sub { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.bb-sec-act { display: flex; gap: 8px; }
.bb-sec-act .btn { white-space: nowrap; }
.bb-sub-h { font-size: 16px; font-weight: 700; margin-top: 8px; }
.bb-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; border: 2px dashed var(--border-strong); border-radius: var(--bb-r); color: var(--ink-3); text-align: center; }
.bb-empty b { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.bb-done { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }

/* toolbar: search, chips, select, count */
.bb-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.bb-search { position: relative; flex: 1 1 220px; min-width: 0; display: flex; align-items: center; }
.bb-search > .i { position: absolute; inset-inline-start: 12px; color: var(--ink-3); pointer-events: none; }
.bb-search .input { padding-inline-start: 36px; padding-inline-end: 12px; border-radius: 999px; font-size: 14px; }
.bb-sel { flex: 0 1 240px; min-width: 0; display: flex; }
.bb-sel select.input { border-radius: 999px; background-position: left 12px center; padding-left: 30px; padding-right: 14px; font-size: 13px; width: 100%; }
[dir='ltr'] .bb-sel select.input { background-position: right 12px center; padding-left: 14px; padding-right: 30px; }
.bb-fchips { display: flex; gap: 4px; flex-wrap: wrap; }
.bb-fchips .qf { min-height: 32px; padding: 2px 12px; font-size: 13px; gap: 6px; }
.bb-count { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bb-nomatch { padding: 24px 16px; border: 2px dashed var(--border-strong); border-radius: var(--bb-r); text-align: center; font-size: 13px; color: var(--ink-3); }

/* ── the overview ── */
.bb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bb-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit; min-width: 0; min-height: 132px; transition: border-color .15s ease, transform .15s ease; }
.bb-stat:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.bb-stat-top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.bb-stat-l { font-size: 14px; font-weight: 600; }
.bb-stat-v { font-family: var(--font); font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bb-stat-s { font-size: 13px; color: var(--ink-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }
.bb-stat-s:has(.bb-split) { white-space: normal; overflow: visible; }
.bb-ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.bb-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.bb-panel-wide { grid-column: 1 / -1; }
.bb-panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bb-panel-h :is(h3, h4, h5) { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.bb-panel-h :is(h3, h4) > .i { color: var(--ink-3); }
.bb-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--link); text-decoration: none; min-height: 32px; }
.bb-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bb-rows > li + li { border-top: 1px solid var(--border); }
.bb-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: inherit; font-size: 14px; }
.bb-row:hover { background: var(--wash); }
.bb-row-t { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; font-weight: 600; line-height: 1.5; }
.bb-row-e { flex-shrink: 0; font-family: var(--font); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bb-row-e b { color: var(--ink); font-size: 14px; }
.bb-ov-td { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bb-ov-td > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bb-todo-empty { display: flex; flex-direction: column; gap: 8px; }
.bb-todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bb-todo { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.bb-todo + .bb-todo { border-top: 1px solid var(--border); }
.bb-todo-mark { flex-shrink: 0; color: var(--ink-3); margin-top: 5px; }
.bb-todo-where { gap: 6px; }
.bb-todo-where .bb-chip { gap: 6px; }
.bb-todo-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--act); color: var(--act-ink);
  font-family: var(--font); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bb-todo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bb-todo-ask { font-weight: 600; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.bb-todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ink-2); }
.bb-todo-item { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.bb-todo-snip { font-size: 13px; color: var(--ink-3); }
.bb-todo-go { flex-shrink: 0; }
.bb-todo-groups { display: flex; flex-direction: column; gap: 12px; }

/* ── cards ── */
.bb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: stretch; }
.bb-grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.bb-card { border: 1px solid var(--border); border-radius: var(--bb-r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--surface);
  transition: border-color .15s ease; }
.bb-card:hover { border-color: var(--border-strong); }
.bb-grid > .bb-card.is-open { grid-column: 1 / -1; }
.bb-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bb-card-head > b { flex: 1 1 160px; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.bb-card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.bb-tools { display: inline-flex; gap: 2px; margin-inline-start: auto; flex-shrink: 0; position: relative; }
.bb-tmore { color: var(--ink-3); }
.bb-tools.is-open .bb-tmore { background: var(--surface-3); color: var(--ink); }
/* an item's tools: a small menu, placed fixed under its «…» button by bbToolsSet */
.bb-tmenu { position: fixed; z-index: 60; min-width: 156px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: bb-in .15s var(--bb-ease); }
.bb-tmenu[hidden] { display: none; }
.bb-tm-i { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); text-align: start; white-space: nowrap; }
.bb-tm-i:hover { background: var(--wash-strong); }
.bb-tm-i > .i { color: var(--ink-3); }
.bb-tm-del { color: var(--crit-ink); }
.bb-tm-del > .i { color: currentColor; }
.bb-tm-i.is-confirm { background: var(--crit-soft); color: var(--crit-ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--crit); }
.bb-xbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong); transition: background .15s ease; }
.bb-xbtn:hover { background: var(--surface-3); }
.bb-chev { transition: transform .2s var(--bb-ease); }
[aria-expanded='true'] > .bb-chev, details[open] > summary > .bb-chev { transform: rotate(180deg); }
.bb-xbody { display: flex; flex-direction: column; gap: 12px; animation: bb-in .2s var(--bb-ease); }
@keyframes bb-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes bb-fade { from { opacity: 0; } to { opacity: 1; } }
.bb-field { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.7; min-width: 0; }
.bb-field > span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.bb-mini { display: flex; flex-direction: column; gap: 6px; }
.bb-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 16px; }
.bb-lead { margin: 0; font-size: 14px; color: var(--ink-2); }
.bb-small-text { font-size: 13px; color: var(--ink-2); }
.bb-note { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; font-size: 14px; background: var(--surface-2); border-inline-start: 3px solid var(--border-strong); }
.bb-note > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bb-note-commit { border-inline-start-color: var(--commit); }
.bb-note-motion { border-inline-start-color: var(--motion); background: color-mix(in srgb, var(--motion) 16%, var(--surface)); }
.bb-note-act { border-inline-start-color: var(--ink); }
.bb-says { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bb-says q { quotes: none; display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 16px; border-end-start-radius: 4px; font-size: 14px;
  background: var(--surface-3); color: var(--ink); overflow-wrap: anywhere; }

/* avatars */
.bb-av-head { display: flex; align-items: flex-start; gap: 12px; }
.bb-av-id { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.bb-av-id > b { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }

/* awareness: a ladder */
.bb-ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bb-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px;
  font-family: var(--font); font-weight: 800; font-size: 13px; background: var(--accent-soft-2); color: var(--accent-ink); flex-shrink: 0; }
.bb-rung .bb-card-head > b { flex: 0 1 auto; }

/* lanes: angles TOF / MOF / BOF, funnel, proof, the teardown's pain / desire, gaps */
.bb-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.bb-lanes-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bb-lane { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 20px; background: var(--surface-2); min-width: 0; border-top: 4px solid var(--border-strong); }
.bb-lane-h { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.bb-lane-h :is(h4, h5) { font-size: 15px; font-weight: 700; line-height: 1.5; margin: 0; }
.bb-proof-list { display: flex; flex-direction: column; gap: 12px; }
.bb-proof-t { font-weight: 700; }
.bb-lane-h .bb-mi-n { margin-inline-start: auto; background: var(--surface); }
.bb-lane-job { margin: -4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.bb-lane-empty { padding: 16px; border: 2px dashed var(--border-strong); border-radius: 14px; text-align: center; font-size: 13px; color: var(--ink-3); }
.bb-lane-tof { border-top-color: var(--act); }
.bb-lane-mof { border-top-color: var(--motion); }
.bb-lane-bof { border-top-color: var(--settled); }
.bb-lane.is-pain { border-top-color: var(--serious); }
.bb-lane.is-desire { border-top-color: var(--commit); }
.bb-lane.is-weak { border-top-color: var(--serious); }
.bb-lane.is-take { border-top-color: var(--ink); }
.bb-lane .bb-card { padding: 12px; }
.bb-lane .bb-card-head { flex-wrap: nowrap; align-items: flex-start; }
.bb-lane .bb-card-head > b { flex: 1 1 0; }
.bb-xbody:empty { display: none; }
.bb-proof.is-have { border-top-color: var(--settled); }
.bb-proof.is-get { border-top-color: var(--act); }
.bb-proof.is-never { border-top-color: var(--crit); background: var(--crit-soft); }
.bb-proof.is-never .bb-lane-h b { color: var(--crit-ink); }
.bb-proof-ic { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bb-proof.is-have .bb-proof-ic { background: var(--settled); color: var(--settled-ink); }
.bb-proof.is-get .bb-proof-ic { background: var(--act); color: var(--act-ink); }
.bb-proof.is-never .bb-proof-ic { background: var(--crit); color: #ffffff; }

/* angles */
.bb-angle-title { font-size: 15px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.bb-angle.is-td { border-color: color-mix(in srgb, var(--motion) 80%, var(--border)); }
/* the hook line: a neutral quote box (yellow is kept for TOF and for «needs action») */
.bb-hookline { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 600; line-height: 1.7; padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 3px solid var(--border-strong); color: var(--ink); }
.bb-hookline > .i { margin-top: 5px; color: var(--ink-3); }
.bb-hookline > div { min-width: 0; overflow-wrap: anywhere; }
.bb-lane .bb-angle .bb-chips .bb-chip { min-height: 24px; }

/* tables */
.bb-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--bb-r); background: var(--surface); max-width: 100%; }
.bb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bb-table th { text-align: start; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap; }
.bb-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: normal; text-align: start; }
.bb-table tbody:last-child tr:last-child td, .bb-table tbody tr:last-child td { border-bottom: 0; }
.bb-num, .bb-table td.bb-num { font-family: var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-table td.bb-cell-act { white-space: nowrap; width: 1%; text-align: end; }
.bb-table .bb-chip, .bb-table .bb-rank { white-space: nowrap; overflow-wrap: normal; }
.bb-h-meta .bb-chips { flex-direction: column; align-items: flex-start; gap: 4px; }
.bb-cell-act > * { vertical-align: middle; }
.bb-cell-act .bb-tools { display: inline-flex; margin: 0; }
.bb-cell-act .btn.is-done { color: var(--ink); background: var(--surface-3); }
.bb-hook-cell { min-width: 260px; }
.bb-hook-said { font-size: 15px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.bb-hook-sub { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.6; }
.bb-hook-sub > .i { margin-top: 3px; color: var(--ink-3); }
.bb-hook-sub > span[dir] { min-width: 0; overflow-wrap: anywhere; }
.bb-onscreen { font-weight: 600; color: var(--ink-2); padding: 0 6px; border-radius: 6px; border: 1px solid var(--border-strong); }
.bb-onscreen-l { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.bb-cellh { display: none; }
.bb-show-sm, .bb-show-sm-i { display: none; }
/* strategies: one tbody per item, its details in a second row */
.bb-strat tbody + tbody { border-top: 1px solid var(--border); }
.bb-strat td { border-bottom: 0; }
.bb-strat .bb-xrow > td { padding: 0 12px; }
.bb-strat .bb-xrow > td > .bb-xbody:not([hidden]) { padding-bottom: 12px; }
.bb-strat-name { min-width: 180px; }
.bb-strat-name > b { display: block; }
.bb-strat-lat { display: block; font-family: var(--font); font-size: 13px; color: var(--ink-2); line-height: 1.4; text-align: end; }
@media (min-width: 1024px) and (pointer: fine) { .bb-strat td .bb-xbtn { min-height: 30px; padding: 2px 10px; } }

/* list-detail: scripts and the top 10 (rows on the start side, a reading panel beside them; an accordion on a phone) */
.bb-ld { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); grid-template-rows: repeat(var(--rows, 1), auto) 1fr; column-gap: 16px; row-gap: 8px; align-items: start; }
.bb-ld-row { grid-column: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'pos t chev' 'pos m chev'; column-gap: 8px; row-gap: 4px;
  padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: inherit; min-width: 0;
  transition: border-color .15s ease, background .15s ease; }
.bb-ld-row:hover { border-color: var(--ink-3); }
.bb-ld-row.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.bb-ld-row.on .bb-dim, .bb-ld-row.on .bb-ink { color: inherit; }
.bb-ld-row.on .bb-chip { background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); border-color: transparent; }
.bb-ld-row.on .bb-rank { background: transparent; color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
.bb-ld-pos { grid-area: pos; align-self: center; width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 800; font-size: 14px; background: var(--surface-3); color: var(--ink); }
.bb-ld-row.on .bb-ld-pos { background: var(--on-ink); color: var(--ink); }
.bb-ld-t { grid-area: t; font-size: 14px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.bb-ld-m { grid-area: m; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; }
.bb-ld-m .bb-chip { min-height: 22px; padding: 0 8px; }
.bb-ld-m .bb-funnel { height: 22px; }
.bb-ld-row > .bb-chev { grid-area: chev; align-self: center; display: none; }
.bb-ld-panel { grid-column: 2; grid-row: 1 / -1; position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 12px;
  padding: 16px 24px 24px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); min-width: 0; animation: bb-in .2s var(--bb-ease); }
.bb-ld-ph { display: flex; align-items: flex-start; gap: 8px; }
.bb-ld-ph h4 { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.bb-ld-ph h4:focus, .bb-deep-id > h5:focus { outline: none; }
.bb-ld-ph h4:focus-visible, .bb-deep-id > h5:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.bb-ld-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-lines { list-style: none; margin: 0; padding: 0; counter-reset: bbl; display: flex; flex-direction: column; gap: 2px; }
.bb-lines li { counter-increment: bbl; position: relative; padding: 8px; padding-inline-start: 44px; font-size: 17px; line-height: 1.8; border-radius: 10px;
  overflow-wrap: anywhere; }
.bb-lines li:nth-child(odd) { background: var(--surface-2); }
.bb-lines li::before { content: counter(bbl); position: absolute; inset-inline-start: 8px; top: 12px; width: 26px; height: 24px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font); font-size: 12px; font-weight: 700;
  background: var(--surface-4); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bb-fold { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.bb-fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink); border-radius: 14px; }
.bb-fold > summary::-webkit-details-marker { display: none; }
.bb-fold > summary:hover { background: var(--wash); }
.bb-fold > summary > .i:not(.bb-chev) { color: var(--ink-3); }
.bb-fold > :not(summary) { padding: 0 16px 16px; }
.bb-fold[open] > :not(summary) { animation: bb-in .2s var(--bb-ease); }
.bb-fold > .bb-text { font-size: 14px; }
.bb-fold-b { display: flex; flex-direction: column; gap: 12px; }
.bb-fold-b.bb-two { display: grid; }
.bb-fold-tools { display: flex; justify-content: flex-start; }
.bb-folds { display: flex; flex-direction: column; gap: 8px; }

/* objections: an accordion */
.bb-acc { display: flex; flex-direction: column; gap: 8px; }
.bb-acc-item { border: 1px solid var(--border); border-radius: var(--bb-r); background: var(--surface); }
.bb-acc-item.is-open { border-color: var(--border-strong); }
.bb-acc-h { display: flex; align-items: center; gap: 4px; padding-inline-end: 8px; }
.bb-acc-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; text-align: start; font-size: 15px; font-weight: 700; line-height: 1.6; border-radius: var(--bb-r); }
.bb-acc-btn:hover { background: var(--wash); }
.bb-acc-q { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bb-acc-n { flex-shrink: 0; font-family: var(--font); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--settled); color: var(--settled-ink); direction: ltr; }
.bb-acc-n.is-part { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-acc-item .bb-xbody { padding: 0 16px 16px; }
.bb-obj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bb-obj-w { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-size: 14px; min-width: 0; }
.bb-obj-w > span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bb-obj-w.is-empty { background: transparent; border: 1px dashed var(--border-strong); }

/* language: grouped by kind, each line copyable */
.bb-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; }
.bb-quotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bb-quote { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 0; align-items: start; }
.bb-quote + .bb-quote { border-top: 1px solid var(--border); }
.bb-quote q { quotes: none; font-size: 15px; overflow-wrap: anywhere; }
.bb-quote .bb-src { grid-column: 1; font-size: 12px; color: var(--ink-3); }
.bb-quote-act { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; gap: 2px; }
.bb-quote-act .bb-tools { margin: 0; }

/* object sections */
.bb-dl { display: grid; gap: 0; margin: 0; font-size: 14px; border: 1px solid var(--border); border-radius: var(--bb-r); overflow: hidden; background: var(--surface); }
.bb-dl-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 16px; padding: 12px 16px; }
.bb-dl-row + .bb-dl-row { border-top: 1px solid var(--border); }
.bb-dl dt { font-weight: 700; color: var(--ink-2); font-size: 13px; }
.bb-dl dd { margin: 0; min-width: 0; }
.bb-dl-tight { border: 0; border-radius: 0; background: transparent; }
.bb-dl-tight .bb-dl-row { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); padding: 8px 0; gap: 12px; }
.bb-dl-stack .bb-dl-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
.bb-dl-stack dt { font-size: 12px; color: var(--ink-3); }

/* ── the teardown dashboard ── */
.bb-td { display: flex; flex-direction: column; gap: var(--bb-gap); min-width: 0; }
.bb-td-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bb-td-head .bb-bubble { background: var(--surface-3); color: var(--ink); width: 40px; height: 40px; font-size: 18px; }
.bb-td-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bb-td-id h4 { font-size: 17px; font-weight: 700; line-height: 1.4; }
.bb-td-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); }
.bb-segnav { position: relative; min-width: 0; }
.bb-segs { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-3); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.bb-segs::-webkit-scrollbar { display: none; }
/* it scrolls: a fade on the side that still has tabs (bbWireTeardown sets fade-l / fade-r) */
.bb-segs.fade-l { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
.bb-segs.fade-r { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
.bb-segs.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
/* a mouse without a trackpad can still scroll it */
@media (pointer: fine) { .bb-segs.fade-l, .bb-segs.fade-r { scrollbar-width: thin; border-radius: 16px; } }
.bb-seg-a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 4px 14px; border-radius: 999px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; transition: background .15s ease, color .15s ease; }
.bb-seg-a:hover { color: var(--ink); background: var(--wash-strong); }
.bb-seg-a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 15, 15, .08), inset 0 0 0 1px var(--border-strong); }
.bb-seg-a .n { font-family: var(--font); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bb-seg-sep { flex-shrink: 0; width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.bb-td-body { display: flex; flex-direction: column; gap: var(--bb-gap); min-width: 0; }
.bb-h6 { font-size: 14px; font-weight: 700; margin: 4px 0 0; color: var(--ink-2); }

.bb-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bb-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.bb-kpi-v { font-family: var(--font); font-size: 26px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.bb-kpi-l { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.bb-kpi-n { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.bb-kpi .bb-more-btn { align-self: flex-start; }
.bb-bullets { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.75; }
.bb-bullets li { overflow-wrap: anywhere; }
.bb-bullets li::marker { color: var(--ink-3); font-family: var(--font); font-weight: 700; }
.bb-bullets-num { padding-inline-start: 24px; }

/* ranking */
.bb-segctl { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); flex-shrink: 0; }
.bb-segctl button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bb-segctl button:hover { color: var(--ink); }
.bb-segctl button.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-segctl .n { font-family: var(--font); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bb-sort { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; padding: 4px; margin: -4px; border-radius: 6px; min-height: 28px; }
.bb-sort.on { color: var(--ink); }
.bb-sort:hover { color: var(--ink); background: var(--wash); }
.bb-rk { min-width: 640px; }
.bb-rk td { padding: 8px 12px; vertical-align: middle; }
.bb-rk th { white-space: normal; line-height: 1.4; }
.bb-rk-row { cursor: pointer; transition: background .12s ease; }
.bb-rk-row:hover, .bb-rk-row.is-open { background: var(--wash); }
.bb-rk-concept { min-width: 200px; }
.bb-rk-concept > b { display: block; font-size: 14px; line-height: 1.5; margin-bottom: 4px; overflow-wrap: anywhere; }
.bb-rk-concept .bb-chip { font-size: 12px; min-height: 22px; padding: 0 8px; }
.bb-rk-bar { min-width: 96px; }
.bb-rk-row.is-open .bb-rk-toggle .i { transform: rotate(180deg); }
.bb-rk-toggle .i { transition: transform .2s var(--bb-ease); }
.bb-rk-more > td { background: var(--surface-2); padding: 16px; }
.bb-rk-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 16px; width: 100%; contain: inline-size; animation: bb-in .2s var(--bb-ease); }
.bb-rk-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bb-rk-bars { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.bb-rk-bars .btn { align-self: flex-start; margin-top: 4px; }
.bb-flash { animation: bb-flash 1.6s ease; }
@keyframes bb-flash { 0%, 40% { box-shadow: inset 0 0 0 2px var(--commit); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
/* desktop: the table fits, so its header sticks under the top bar */
@media (min-width: 1100px) {
  .bb-rk-wrap { overflow: visible; }
  .bb-rk-wrap .bb-rk { min-width: 0; }
  .bb-rk-wrap thead th { position: sticky; top: var(--topbar-h); z-index: 2; }
  .bb-rk-wrap thead th:first-child { border-start-start-radius: var(--bb-r); }
  .bb-rk-wrap thead th:last-child { border-start-end-radius: var(--bb-r); }
}

/* top 10 */
.bb-deep { gap: 16px; }
.bb-deep-head { display: flex; align-items: flex-start; gap: 12px; }
.bb-deep-pos { flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 20px; font-weight: 800; background: var(--ink); color: var(--on-ink); }
.bb-deep-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bb-deep-id > h5 { font-size: 18px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.bb-deep-score { flex-shrink: 0; display: flex; align-items: baseline; gap: 2px; direction: ltr; padding: 6px 12px; border-radius: 14px; background: var(--surface-2); }
.bb-deep-score b { font-family: var(--font); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-deep-score span { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.bb-hookbox { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-inline-start: 3px solid var(--border-strong); }
.bb-hookbox-t { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.bb-hookbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 16px; }
.bb-hook-why { display: flex; flex-direction: column; gap: 2px; font-size: 14px; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.bb-hook-why > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bb-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.bb-scores .bb-bar-l { font-weight: 500; font-size: 12px; }
.bb-flags { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.bb-flags li { font-size: 13px; line-height: 1.6; padding: 6px 12px; border-radius: 10px; background: var(--serious-soft); color: var(--serious-ink); overflow-wrap: anywhere; }
.bb-beats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.bb-beats li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 0 0 12px; position: relative; font-size: 14px; }
.bb-beats li::before { content: ''; position: absolute; inset-inline-start: 88px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.bb-beats li::after { content: ''; position: absolute; inset-inline-start: 92px; top: 17px; bottom: 0; width: 1px; background: var(--border-strong); }
.bb-beats li:last-child::after { display: none; }
.bb-beats li > div { padding-inline-start: 20px; min-width: 0; }
.bb-beats li > div > b { display: block; font-size: 14px; }
.bb-beats li > div > div { color: var(--ink-2); overflow-wrap: anywhere; }
.bb-beat-t { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 2px; text-align: end; }

/* gaps */
.bb-gblock { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.bb-gblock h6 { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.bb-gblock h6 .bb-mi-n { background: var(--surface-3); }
.bb-hk { min-width: 600px; }

/* ── the edit form ── */
.bb-modal .bb-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
.bb-modal .bb-form .field-wrap:has(textarea) { grid-column: 1 / -1; }
.bb-modal textarea.input { line-height: 1.8; font-size: 15px; }
.bb-modal select.input { background-position: left 12px center; padding-left: 28px; padding-right: 14px; }
[dir='ltr'] .bb-modal select.input { background-position: right 12px center; padding-left: 14px; padding-right: 28px; }
.bb-check { grid-column: 1 / -1; }
.bb-check label { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.bb-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.bb-req { font-weight: 500; color: var(--ink-3); }
.bb-modal .modal-actions { justify-content: flex-start; }
.bb-imp-sum { margin: 8px 0 12px; padding-inline-start: 1.2rem; display: grid; gap: 4px; }
.bb-imp-table td, .bb-imp-table th { padding: 6px 12px; }
.bb-imp-table tr.is-diff td { font-weight: 700; }
.bb-imp-table tr.is-diff td:last-child { color: var(--link); }

/* ── widths ── */
@media (max-width: 1279px) { .bb-hide-md { display: none; } }
/* the ranking's awareness column (Darija chips are wide) shows only on very wide screens; it is in each row's details */
@media (max-width: 1599px) { .bb-hide-lg { display: none; } }
@media (max-width: 1180px) {
  .bb-lanes:not(.bb-lanes-2) { grid-template-columns: minmax(0, 1fr); }
  .bb-stats, .bb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-kpis > .bb-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* under 1024: the side menu becomes a «الأقسام» sheet under a sticky bar; list-detail becomes an accordion */
@media (max-width: 1023px) {
  .bb-ws { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bb-navwrap { top: var(--topbar-h); z-index: 25; margin: 0 -4px; }
  .bb-mbar { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 999px; min-width: 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .bb-mbtn { flex-shrink: 0; }
  .bb-mbar-cur { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--ink-2); }
  .bb-mbar-cur b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
  .bb-side { display: none; position: absolute; top: calc(100% + 8px); inset-inline: 0; max-height: min(calc(100vh - var(--topbar-h) - 80px), 560px);
    max-height: min(calc(100dvh - var(--topbar-h) - 80px), 560px); background: var(--surface); box-shadow: var(--shadow-lg); }
  .bb-page.is-menu .bb-side { display: flex; animation: bb-in .2s var(--bb-ease); }
  /* a light scrim behind the sheet: a tap on it closes the sheet (bbDocWire) */
  .bb-page.is-menu .bb-navwrap::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(15, 15, 15, .24); animation: bb-fade .2s ease; }
  /* the scripts' panel title repeats the row right above it: kept for screen readers only */
  .bb-ld:not(.bb-ld-top) .bb-ld-ph h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bb-ld:not(.bb-ld-top) .bb-ld-panel { position: relative; }
  .bb-ld:not(.bb-ld-top) .bb-ld-ph { position: absolute; top: 8px; inset-inline-end: 8px; }
  .bb-ld:not(.bb-ld-top) .bb-ld-ph + .bb-chips { padding-inline-end: 48px; min-height: 44px; }
  .bb-ld { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 8px; }
  .bb-ld-panel { grid-column: 1; grid-row: auto; position: static; padding: 16px; }
  .bb-ld-row > .bb-chev { display: block; }
  .bb-ld-row.on { border-end-start-radius: 4px; border-end-end-radius: 4px; }
  .bb-ld-row.on.is-shut { border-radius: 14px; }
  .bb-ld-row.on.is-shut > .bb-chev { transform: none; }
  .bb-ld-row.on > .bb-chev { transform: rotate(180deg); }
  .bb-ld-panel { margin-top: -6px; border-start-start-radius: 4px; border-start-end-radius: 4px; }
  .bb-scores { grid-template-columns: minmax(0, 1fr); }
  .bb-rk-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .bb-ov-grid, .bb-ov-td, .bb-box-grid { grid-template-columns: minmax(0, 1fr); }
  .bb-lanes-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .bb-page.cp-box { padding: 16px 12px; }
  .bb-head h2 { font-size: 19px; }
  /* the header: one row; «تفاصيل النسخة», «استورد» and «صدّر» fold into one «…» menu */
  .bb-head { flex-wrap: nowrap; padding-bottom: 12px; }
  .bb-head-ic { width: 36px; height: 36px; }
  .bb-head-id { flex: 1 1 auto; }
  .bb-head-more { display: inline-flex; flex-shrink: 0; }
  .bb-head-act { display: none; position: absolute; top: calc(100% - 8px); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 200px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
  .bb-head.is-more .bb-head-act { display: flex; animation: bb-in .15s var(--bb-ease); }
  .bb-head-act .btn { justify-content: flex-start; border-color: transparent; background: transparent; }
  .bb-head-act .btn:hover { background: var(--wash-strong); }
  .bb-head .bb-about { position: relative; z-index: 1; }
  /* a section's header: title and a compact «زيد …» pill on one row */
  .bb-sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; }
  .bb-sec-ic { width: 36px; height: 36px; }
  .bb-sec-tt { min-width: 0; }
  .bb-sec-tt h3 { font-size: 18px; }
  .bb-sec-act .btn { padding-inline: 12px; }
  .bb-stats { gap: 8px; }
  .bb-stat { padding: 12px; min-height: 116px; }
  .bb-stat-v { font-size: 28px; }
  .bb-kpis { gap: 8px; }
  .bb-kpi { padding: 12px; }
  .bb-kpi-v { font-size: 21px; }
  .bb-kpi-l { font-size: 13px; }
  .bb-bstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-grid, .bb-grid-wide, .bb-groups { grid-template-columns: minmax(0, 1fr); }
  .bb-obj-grid { grid-template-columns: minmax(0, 1fr); }
  .bb-dl-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bb-hide-sm, .bb-hide-md { display: none; }
  .bb-show-sm { display: block; }
  .bb-show-sm.bb-clamp { display: -webkit-box; }
  .bb-show-sm-i { display: inline-flex; }
  .bb-rk { min-width: 0; }
  .bb-rk td { padding: 8px 6px; }
  .bb-rk th { padding: 8px 6px; }
  .bb-rk-concept { min-width: 0; }
  .bb-rk-bar { min-width: 0; }
  .bb-rk-row .bb-rk-bar .bb-bar-t { display: none; }
  .bb-rk-row .bb-rk-bar .bb-bar { grid-template-columns: auto; }
  /* the teardown's hook library: one card per hook (the hook on its own line, then rank · tactic · score) */
  .bb-hk { min-width: 0; }
  .bb-hk thead { display: none; }
  .bb-hk, .bb-hk tbody { display: block; }
  .bb-hk tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
  .bb-hk tr:last-child { border-bottom: 0; }
  .bb-hk td { display: block; padding: 0; border: 0; min-width: 0; }
  .bb-hk td.bb-hook-said { grid-row: 1; grid-column: 1 / -1; }
  .bb-hk .bb-hk-tac { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .bb-hk .bb-hk-score { min-width: 72px; }
  .bb-hk .bb-hk-score .bb-bar-t { min-width: 32px; }
  .bb-hk td[colspan] { grid-column: 1 / -1; }
  /* stacked tables lose their headers: each cell says what it is (screen readers only) */
  .bb-cellh { display: inline; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* strategies: one card each (code + name · when · «المثال» and the tools); no sideways scroll */
  .bb-strat-wrap { overflow: visible; }
  .bb-strat thead { display: none; }
  .bb-strat, .bb-strat tbody { display: block; }
  .bb-strat tbody[hidden] { display: none; }
  .bb-strat tr.bb-strat-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 12px 12px 8px; }
  .bb-strat tr.bb-xrow { display: block; }
  .bb-strat td { display: block; padding: 0; min-width: 0; }
  .bb-strat td.bb-hide-sm { display: none; }
  .bb-strat-name { min-width: 0; }
  .bb-strat td.bb-cell-act { grid-column: 1 / -1; width: auto; display: flex; align-items: center; gap: 4px; }
  .bb-strat td.bb-cell-act .bb-tools { margin-inline-start: auto; }
  .bb-strat .bb-xrow > td { padding: 0 12px; }
  .bb-lines li { font-size: 16px; }
  .bb-count { margin-inline-start: 0; }
  .bb-sel { flex: 1 1 100%; }
  .bb-toolbar { border-radius: 16px; }
  .bb-beats li { grid-template-columns: 64px minmax(0, 1fr); }
  .bb-beats li::before { inset-inline-start: 72px; }
  .bb-beats li::after { inset-inline-start: 76px; }
  .bb-card { padding: 12px; }
  .bb-ld-panel { padding: 12px; }
  .bb-todo { flex-wrap: wrap; }
  .bb-todo-go { margin-inline-start: 30px; }
  /* hooks: each row reads as a card */
  .bb-hooks thead { display: none; }
  .bb-hooks, .bb-hooks tbody { display: block; }
  .bb-hooks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
  .bb-hooks tr[hidden] { display: none; }
  .bb-hooks td { display: block; padding: 0; border: 0; }
  .bb-hooks .bb-hook-cell { grid-column: 1 / -1; min-width: 0; }
  .bb-hooks .bb-h-cat { grid-column: 1; }
  .bb-hooks .bb-h-meta .bb-chips { flex-direction: row; flex-wrap: wrap; }
  .bb-hooks .bb-h-ang { grid-column: 2; }
  .bb-hooks td.bb-cell-act { grid-column: 3; width: auto; display: flex; justify-content: flex-end; gap: 2px; }
  .bb-fchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -4px -8px; padding: 4px 8px; flex: 1 1 100%; }
  .bb-fchips::-webkit-scrollbar { display: none; }
  .bb-fchips .qf { flex-shrink: 0; }
  .bb-hooks td.bb-hide-sm, .bb-hooks td.bb-hide-md { display: none; }
}
/* touch widths: every control is at least 44 px */
@media (max-width: 1023px), (pointer: coarse) {
  .bb-ar .btn, .bb-ar .btn-sm, .bb-ar .qf, .bb-fchips .qf, .bb-xbtn, .bb-segctl button, .bb-seg-a, .bb-mi, .bb-link, .bb-more-btn, .bb-sort { min-height: 44px; }
  .bb-ar .btn-icon.btn-sm { width: 44px; }
  .bb-ar .bb-search .input, .bb-ar .bb-sel select.input { min-height: 44px; }
  /* chips that are links: 36 px tall, at least 44 wide, and a hit area that stays inside half the gap (no overlap between rows) */
  .bb-ranks, .bb-chips { gap: 8px; }
  a.bb-rank, a.bb-chip, .bb-lane .bb-angle .bb-chips a.bb-chip { min-height: 36px; min-width: 44px; justify-content: center; }
  a.bb-chip::after, a.bb-rank::after { content: ''; position: absolute; inset: -4px 0; }
  .bb-tm-i { min-height: 44px; }
  .bb-segs { border-radius: 16px; }
  .bb-fold > summary { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .bb-flash { animation: none; }
  .bb-ar *, .bb-ar *::before, .bb-ar *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* phones: the تونسي · English switch takes its own line under the title, so the title keeps its width
   (the title and the «…» menu stay on the first row) */
@media (max-width: 640px) {
  .bb-head { flex-wrap: wrap; }
  .bb-head-id { flex: 1 1 0; min-width: 0; }
  .bb-head > .bb-lang { order: 1; margin-inline-start: 48px; }
  .bb-head > .bb-about { order: 2; }
}
