/* =====================================================================
   Book Builder
   =====================================================================

   Built on the same tokens as the rest of the application — there is no
   second palette and no second type scale here. What is different is the
   density: an authoring workspace earns its whitespace, and a page of a
   book has to be shown at its own proportions rather than squeezed into
   a card.

   Prefix: bb-.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* Library                                                             */
/* ------------------------------------------------------------------ */

.bb-grid {
  display: grid;
  gap: var(--bp-5);
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.bb-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--bp-4);
  padding: var(--bp-4);
  background: var(--bp-surface);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bb-card:hover {
  border-color: var(--bp-border-strong);
  box-shadow: var(--bp-shadow);
  transform: translateY(-1px);
}
.bb-card__cover { display: block; line-height: 0; }
.bb-card__body { display: flex; flex-direction: column; gap: var(--bp-3); min-width: 0; }

/* ------------------------------------------------------------------ */
/* The cover                                                           */
/* ------------------------------------------------------------------ */

.bb-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 9%;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: var(--bp-shadow), inset -6px 0 12px -10px rgba(0, 0, 0, 0.5);
  /* The spine edge: a book is an object, and one highlight says so
     without a skeuomorphic frame around it. */
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 5px);
}
.bb-cover--unset { box-shadow: var(--bp-shadow-sm); opacity: 0.92; }
.bb-cover__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
}
.bb-cover__scrim { position: absolute; left: 0; right: 0; pointer-events: none; }
/* The zone takes the space above the author line and places the title in it
   (top, middle or bottom). Without it the author's auto margin used all the
   free space and every title sat at the top whatever the cover asked for. */
.bb-cover__zone { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; }
.bb-cover__type { position: relative; width: 100%; }
.bb-cover__title { line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
.bb-cover__rule { width: 34%; height: 2px; margin: 7% 0; }
.bb-cover__subtitle { margin-top: 5%; line-height: 1.34; opacity: 0.88; }
.bb-cover__author {
  position: relative;
  margin-top: auto;
  padding-top: 8%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.bb-cover-card { display: flex; flex-direction: column; align-items: center; }

.bb-wrap {
  display: flex;
  box-shadow: var(--bp-shadow-lg);
  background: var(--bp-surface);
}
.bb-wrap__panel { position: relative; overflow: hidden; }
.bb-wrap__back { padding: 6% 7%; display: flex; flex-direction: column; }
.bb-wrap__blurb { font-size: 0.72rem; line-height: 1.5; opacity: 0.9; }
.bb-wrap__isbn { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.bb-wrap__barcode {
  height: 26px;
  background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 3px, #fff 3px 4px, transparent 4px 7px);
  background-color: rgba(255, 255, 255, 0.86);
  border-radius: 2px;
}
.bb-wrap__isbn span { font-size: 0.55rem; opacity: 0.8; }
.bb-wrap__spine {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bb-wrap__spine span {
  writing-mode: vertical-rl;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.bb-wrap__front .bb-cover { border-radius: 0; box-shadow: none; }
.bb-wrap-frame { overflow-x: auto; padding-bottom: var(--bp-2); }

/* ------------------------------------------------------------------ */
/* Project header and the stage rail                                   */
/* ------------------------------------------------------------------ */

.bb-project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--bp-6);
  flex-wrap: wrap;
  padding-bottom: var(--bp-5);
}
.bb-project-head__title {
  font-family: var(--bp-font-serif);
  font-size: 1.9rem;
  line-height: 1.16;
  margin: var(--bp-2) 0 0;
  max-width: 34ch;
}
.bb-project-head__sub {
  margin: 6px 0 0;
  color: var(--bp-text-muted);
  max-width: 54ch;
  line-height: 1.5;
}
.bb-project-head__side { display: flex; flex-direction: column; gap: var(--bp-3); align-items: flex-end; }
.bb-progress { min-width: 180px; text-align: right; }
.bb-progress__figure {
  font-family: var(--bp-font-serif);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 6px;
}
.bb-progress__figure span { font-size: 0.8rem; color: var(--bp-text-subtle); }

.bb-rail {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--bp-border);
  margin-bottom: var(--bp-8);
}
.bb-rail::-webkit-scrollbar { display: none; }
.bb-rail__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 0.86rem;
  color: var(--bp-text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.bb-rail__item:hover { color: var(--bp-text); text-decoration: none; }
.bb-rail__item--active { color: var(--bp-primary); border-bottom-color: var(--bp-primary); font-weight: 500; }
.bb-rail__item--done .bb-rail__icon { color: var(--bp-success); }
.bb-rail__icon { font-size: 0.9em; opacity: 0.85; }

/* ------------------------------------------------------------------ */
/* Stage furniture                                                     */
/* ------------------------------------------------------------------ */

.bb-stage { max-width: var(--bp-content-max); }
.bb-section-title { font-size: 1.06rem; font-weight: 600; margin: 0 0 var(--bp-3); }
.bb-side-title {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
  margin: 0 0 var(--bp-3);
}

.bb-layout { display: grid; gap: var(--bp-8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) {
  .bb-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
.bb-layout__main { min-width: 0; }

.bb-next {
  padding: var(--bp-6);
  border-radius: var(--bp-radius-lg);
  border: 1px solid var(--bp-primary-border);
  background: var(--bp-primary-soft);
}
.bb-next__label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bp-primary-text);
  margin-bottom: var(--bp-2);
}
.bb-next__title { font-family: var(--bp-font-serif); font-size: 1.4rem; margin: 0 0 var(--bp-2); }
.bb-next__text { color: var(--bp-text-muted); margin: 0 0 var(--bp-5); max-width: 62ch; }

.bb-idea {
  font-family: var(--bp-font-serif);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--bp-text-muted);
  margin: 0;
}

.bb-readiness {
  font-family: var(--bp-font-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--bp-primary);
}
.bb-readiness span { font-size: 0.9rem; color: var(--bp-text-subtle); }
.bb-readiness--lg { font-size: 3rem; }

.bb-chapter-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-chapter-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 34px;
  padding: 6px 0;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-sm);
  background: var(--bp-surface);
  color: var(--bp-text-subtle);
  font-size: 0.72rem;
}
.bb-chapter-chip:hover { border-color: var(--bp-primary-border); text-decoration: none; }
.bb-chapter-chip--written { color: var(--bp-text); border-color: var(--bp-primary-border); }
.bb-chapter-chip__bar {
  width: 6px;
  height: 26px;
  background: var(--bp-sunken);
  border-radius: 3px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bb-chapter-chip__bar i { width: 100%; background: var(--bp-primary); display: block; }

/* ------------------------------------------------------------------ */
/* The agent panel                                                     */
/* ------------------------------------------------------------------ */

.bb-agent {
  padding: var(--bp-6);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  box-shadow: var(--bp-shadow-sm);
}
.bb-agent__head { display: flex; align-items: flex-start; gap: var(--bp-3); margin-bottom: var(--bp-3); }
.bb-agent__mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, var(--bp-accent) 0 22%, transparent 23%),
    linear-gradient(135deg, var(--bp-primary), var(--bp-primary-hover));
}
.bb-agent__name {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bp-primary-text);
}
.bb-agent__title { font-family: var(--bp-font-serif); font-size: 1.24rem; margin: 2px 0 0; }
.bb-agent__text { color: var(--bp-text-muted); margin: 0 0 var(--bp-4); max-width: 68ch; line-height: 1.6; }
.bb-agent__note {
  margin: 0 0 var(--bp-4);
  padding: var(--bp-3);
  border-left: 2px solid var(--bp-warning-border);
  background: var(--bp-warning-soft);
  font-size: 0.85rem;
  color: var(--bp-text-muted);
}
.bb-agent__actions { margin-top: var(--bp-4); }

.bb-cost {
  margin-left: auto;
  flex: none;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--bp-radius-pill);
  background: var(--bp-sunken);
  color: var(--bp-text-subtle);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Wizard                                                              */
/* ------------------------------------------------------------------ */

.bb-wizard { max-width: 760px; margin: 0 auto; }
.bb-wizard__head { margin-bottom: var(--bp-8); }
.bb-wizard__title { font-family: var(--bp-font-serif); font-size: 2.1rem; margin: var(--bp-2) 0 var(--bp-3); }
.bb-wizard__lead { color: var(--bp-text-muted); line-height: 1.65; max-width: 62ch; }
.bb-wizard__card { margin-bottom: var(--bp-6); padding: var(--bp-6); }
.bb-wizard__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--bp-3);
  align-items: center;
}
.bb-wizard__foot { text-align: right; margin-top: var(--bp-3); }

/* Create a book, with the cover template gallery on the left. */
.bb-wizard--wide { max-width: 1180px; }
.bb-wizard__layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: var(--bp-8);
  align-items: start;
}
.bb-wizard--wide .bb-wizard__form { max-width: 760px; }

.bb-tpl-panel {
  position: sticky;
  top: calc(var(--bp-topbar-height) + var(--bp-4));
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--bp-topbar-height) - var(--bp-8));
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  overflow: hidden;
}
.bb-tpl-panel__head { padding: var(--bp-4) var(--bp-4) var(--bp-3); border-bottom: 1px solid var(--bp-border); }
.bb-tpl-panel__title { font-family: var(--bp-font-serif); font-size: 1.12rem; font-weight: 400; margin: 0 0 4px; }
.bb-tpl-panel__lead { margin: 0 0 var(--bp-3); font-size: 0.8rem; line-height: 1.5; color: var(--bp-text-muted); }
.bb-tpl-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: -6px;
  scrollbar-width: thin;
}
.bb-tpl-chip {
  font: inherit;
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--bp-border);
  border-radius: 999px;
  background: var(--bp-surface);
  color: var(--bp-text-muted);
  cursor: pointer;
  flex: none;
  white-space: nowrap;
}
.bb-tpl-chip:hover { border-color: var(--bp-primary); color: var(--bp-primary); }
.bb-tpl-chip--active { background: var(--bp-primary); border-color: var(--bp-primary); color: var(--bp-text-inverse); }
.bb-tpl-chip--active:hover { color: var(--bp-text-inverse); }
.bb-tpl-chip__n { margin-left: 2px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.bb-tpl-chip--active .bb-tpl-chip__n { opacity: 0.85; }

.bb-tpl-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--bp-4);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bp-3);
}
.bb-tpl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}
.bb-tpl[hidden] { display: none; }
.bb-tpl:hover { background: var(--bp-sunken); }
.bb-tpl--selected, .bb-tpl--selected:hover { border-color: var(--bp-primary); background: var(--bp-primary-soft); }
/* The radio is the whole tile, invisible but focusable, so the keyboard works as it should. */
.bb-tpl__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bb-tpl:has(.bb-tpl__input:focus-visible) { outline: 2px solid var(--bp-primary); outline-offset: 2px; }
.bb-tpl__cover { pointer-events: none; }
.bb-tpl__cover .bb-cover { box-shadow: var(--bp-shadow-sm); }
.bb-tpl__name { font-size: 0.78rem; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.bb-tpl__mood { font-size: 0.68rem; color: var(--bp-text-subtle); line-height: 1.2; }
.bb-tpl--selected::after {
  content: "\2713";
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bp-primary);
  color: var(--bp-text-inverse);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}
.bb-tpl--none { grid-column: 1 / -1; }
.bb-tpl__blank {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--bp-3);
  border: 1px dashed var(--bp-border-strong, var(--bp-border));
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--bp-text-muted);
  pointer-events: none;
}
.bb-tpl__blank strong { color: var(--bp-text); font-weight: 600; }
.bb-tpl-panel__status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Narrow screens: the gallery becomes a swipeable strip above the form. */
@media (max-width: 980px) {
  .bb-wizard__layout { grid-template-columns: minmax(0, 1fr); gap: var(--bp-6); }
  .bb-tpl-panel { position: static; max-height: none; }
  .bb-tpl-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    padding-bottom: var(--bp-3);
  }
  .bb-tpl { flex: none; width: 148px; scroll-snap-align: start; }
  .bb-tpl--none { grid-column: auto; }
  .bb-tpl__blank { height: 100%; justify-content: center; }
}

.bb-step { display: flex; gap: var(--bp-3); margin-bottom: var(--bp-5); }
.bb-step__number {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bp-primary-soft);
  color: var(--bp-primary-text);
  font-size: 0.82rem;
  font-weight: 600;
}
.bb-step__title { font-size: 1.05rem; margin: 0; }
.bb-step__text { margin: 3px 0 0; font-size: 0.86rem; color: var(--bp-text-muted); }

.bb-options { display: grid; gap: var(--bp-2); }
@media (min-width: 640px) { .bb-options { grid-template-columns: 1fr 1fr; } }

.bb-how { margin-top: var(--bp-16); }
.bb-how__title { font-family: var(--bp-font-serif); font-size: 1.5rem; text-align: center; margin-bottom: var(--bp-8); }
.bb-how__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--bp-5);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.bb-how__step { display: flex; gap: var(--bp-3); }
.bb-how__number {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--bp-primary-border);
  color: var(--bp-primary-text);
  font-size: 0.76rem;
}
.bb-how__step p { margin: 4px 0 0; font-size: 0.86rem; color: var(--bp-text-muted); line-height: 1.5; }

/* ------------------------------------------------------------------ */
/* Positioning                                                         */
/* ------------------------------------------------------------------ */

.bb-pick { display: grid; gap: 6px; }
@media (min-width: 720px) { .bb-pick { grid-template-columns: 1fr 1fr; } }
.bb-pick__option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.bb-pick__option:hover { border-color: var(--bp-border-strong); background: var(--bp-sunken); }
.bb-pick__option--selected { border-color: var(--bp-primary); background: var(--bp-primary-soft); }
.bb-pick__option input { margin-top: 3px; accent-color: var(--bp-primary); }

.bb-reasoning {
  margin: var(--bp-5) 0 0;
  padding-top: var(--bp-4);
  border-top: 1px solid var(--bp-border);
  font-size: 0.88rem;
  color: var(--bp-text-muted);
  line-height: 1.6;
}

.bb-sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: var(--bp-3);
  padding: var(--bp-4) 0;
  background: linear-gradient(to top, var(--bp-page) 62%, transparent);
  z-index: 5;
}

.bb-explainer {
  padding: var(--bp-5) var(--bp-6);
  border-left: 3px solid var(--bp-primary);
  background: var(--bp-sunken);
  border-radius: 0 var(--bp-radius) var(--bp-radius) 0;
  margin-bottom: var(--bp-6);
}
.bb-explainer h2 { font-size: 0.98rem; margin: 0 0 var(--bp-2); }
.bb-explainer p { margin: 0; color: var(--bp-text-muted); line-height: 1.65; max-width: 74ch; }

/* ------------------------------------------------------------------ */
/* Blueprint                                                           */
/* ------------------------------------------------------------------ */

.bb-tree { display: flex; flex-direction: column; gap: var(--bp-5); }
.bb-tree__group {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  overflow: hidden;
}
.bb-tree__group--plain { border-style: dashed; background: transparent; }
.bb-tree__part { padding: var(--bp-4) var(--bp-5); border-bottom: 1px solid var(--bp-border); }
.bb-tree__part h3 { font-family: var(--bp-font-serif); font-size: 1.08rem; margin: 0; }
.bb-tree__part p { margin: 4px 0 0; font-size: 0.85rem; color: var(--bp-text-muted); }
.bb-tree__list { list-style: none; margin: 0; padding: 0; }

.bb-tree__item {
  display: grid;
  grid-template-columns: 18px 30px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: var(--bp-3);
  padding: var(--bp-3) var(--bp-5);
  border-bottom: 1px solid var(--bp-border);
  background: var(--bp-surface);
  cursor: grab;
}
.bb-tree__item:last-child { border-bottom: 0; }
.bb-tree__item:hover { background: var(--bp-sunken); }
.bb-tree__item--dragging { opacity: 0.45; cursor: grabbing; }
.bb-tree__grip { color: var(--bp-text-subtle); font-size: 0.9rem; }
.bb-tree__number {
  font-family: var(--bp-font-serif);
  font-size: 1.05rem;
  color: var(--bp-primary);
  text-align: center;
}
.bb-tree__body { min-width: 0; }
.bb-tree__title { font-weight: 500; }
.bb-tree__purpose {
  margin: 3px 0 0;
  font-size: 0.83rem;
  color: var(--bp-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bb-tree__extras { margin: 3px 0 0; font-size: 0.75rem; color: var(--bp-text-subtle); }
.bb-tree__meta { text-align: right; min-width: 116px; }
.bb-tree__bar { margin-top: 5px; }
.bb-tree__delete { opacity: 0; transition: opacity 0.12s ease; }
.bb-tree__item:hover .bb-tree__delete,
.bb-tree__delete:focus-visible { opacity: 1; }

@media (max-width: 720px) {
  .bb-tree__item { grid-template-columns: 16px 26px minmax(0, 1fr) 24px; }
  .bb-tree__meta { grid-column: 1 / -1; text-align: left; }
}

/* ------------------------------------------------------------------ */
/* Book Bible                                                          */
/* ------------------------------------------------------------------ */

.bb-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--bp-3); }
.bb-facts__item { display: flex; gap: var(--bp-3); align-items: flex-start; }
.bb-facts__item p { margin: 0; font-size: 0.9rem; }
.bb-summaries { margin: 0; padding-left: 1.2rem; display: grid; gap: var(--bp-3); }
.bb-summaries p { margin: 2px 0 0; font-size: 0.86rem; color: var(--bp-text-muted); }

/* ------------------------------------------------------------------ */
/* Editor                                                              */
/* ------------------------------------------------------------------ */

.bb-editor {
  display: grid;
  gap: var(--bp-5);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1000px) {
  .bb-editor { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (min-width: 1360px) {
  .bb-editor { grid-template-columns: 220px minmax(0, 1fr) 310px; }
}

.bb-editor__structure {
  position: sticky;
  top: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  padding: var(--bp-3);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.bb-editor__structure-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
  padding: 0 var(--bp-2) var(--bp-2);
}
.bb-editor__jump { display: none; }
.bb-editor__list { display: flex; flex-direction: column; gap: 1px; }
.bb-editor__item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: var(--bp-radius-sm);
  font-size: 0.85rem;
  color: var(--bp-text-muted);
}
.bb-editor__item:hover { background: var(--bp-sunken); color: var(--bp-text); text-decoration: none; }
.bb-editor__item--active { background: var(--bp-primary-soft); color: var(--bp-primary-text); font-weight: 500; }
.bb-editor__item-number { font-family: var(--bp-font-serif); text-align: center; opacity: 0.75; }
.bb-editor__item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-editor__item-bar {
  grid-column: 2;
  height: 2px;
  background: var(--bp-sunken);
  border-radius: 1px;
  overflow: hidden;
}
.bb-editor__item-bar i { display: block; height: 100%; background: var(--bp-primary); }

@media (max-width: 999px) {
  .bb-editor__structure { position: static; max-height: none; }
  .bb-editor__jump { display: block; }
  .bb-editor__list { display: none; }
  .bb-editor__structure-head { display: none; }
}

.bb-editor__canvas {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  padding: var(--bp-5);
  min-width: 0;
}
.bb-editor__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--bp-3);
  flex-wrap: wrap;
  padding-bottom: var(--bp-4);
  border-bottom: 1px solid var(--bp-border);
  margin-bottom: var(--bp-4);
}
.bb-editor__divider { width: 1px; height: 18px; background: var(--bp-border); }
.bb-editor__count { font-size: 0.8rem; color: var(--bp-text-subtle); font-variant-numeric: tabular-nums; }
.bb-editor__count--dirty { color: var(--bp-warning); }

.bb-editor__title-row { display: flex; align-items: baseline; gap: var(--bp-3); }
.bb-editor__title {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--bp-font-serif);
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--bp-text);
  padding: 0;
}
.bb-editor__title:focus { outline: none; box-shadow: 0 2px 0 var(--bp-primary); }
.bb-editor__target { font-size: 0.76rem; color: var(--bp-text-subtle); white-space: nowrap; }
.bb-editor__purpose {
  margin: var(--bp-3) 0 0;
  font-size: 0.85rem;
  color: var(--bp-text-muted);
  padding: var(--bp-3);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius);
}

.bb-editor__text {
  width: 100%;
  margin-top: var(--bp-4);
  min-height: 58vh;
  border: 0;
  padding: 0;
  resize: vertical;
  background: transparent;
  color: var(--bp-text);
  /* The measure a writer wants, not the width of the window. */
  max-width: 68ch;
  font-family: var(--bp-font-serif);
  font-size: 1.02rem;
  line-height: 1.72;
}
.bb-editor__text:focus { outline: none; }
.bb-editor__text::placeholder { color: var(--bp-text-subtle); }

.bb-editor__preview { margin-top: var(--bp-4); max-width: 68ch; }
.bb-editor__preview h3 { font-family: var(--bp-font-serif); font-size: 1.2rem; margin: var(--bp-6) 0 var(--bp-2); }
.bb-editor__preview h4 { font-size: 1rem; margin: var(--bp-5) 0 var(--bp-2); }
.bb-editor__preview p { line-height: 1.72; margin: 0 0 var(--bp-4); font-family: var(--bp-font-serif); }
.bb-editor__preview blockquote {
  margin: var(--bp-4) 0;
  padding-left: var(--bp-4);
  border-left: 2px solid var(--bp-primary);
  font-style: italic;
  color: var(--bp-text-muted);
}
.bb-editor__preview ul, .bb-editor__preview ol { margin: 0 0 var(--bp-4) 1.2rem; line-height: 1.7; }
.bb-scene-break { text-align: center; letter-spacing: 0.5em; color: var(--bp-text-subtle); }

.bb-panel {
  margin: var(--bp-5) 0;
  padding: var(--bp-4);
  border-left: 3px solid var(--bp-primary);
  background: var(--bp-sunken);
  border-radius: 0 var(--bp-radius) var(--bp-radius) 0;
}
.bb-panel h4 {
  margin: 0 0 var(--bp-2);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-primary-text);
  font-family: var(--bp-font-sans);
}
.bb-panel p:last-child { margin-bottom: 0; }
.bb-panel--exercise { border-left-color: var(--bp-accent); }
.bb-panel--case { border-left-color: var(--bp-info); }
.bb-panel--takeaways { border-left-color: var(--bp-success); }

.bb-figure-anchor {
  display: flex;
  align-items: center;
  gap: var(--bp-2);
  margin: var(--bp-5) 0;
  padding: var(--bp-3) var(--bp-4);
  border: 1px dashed var(--bp-border-strong);
  border-radius: var(--bp-radius);
  font-size: 0.85rem;
  color: var(--bp-text-muted);
}
.bb-figure-anchor__label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-primary-text);
}
.bb-figure-anchor__pending { margin-left: auto; font-size: 0.72rem; color: var(--bp-warning); }

.bb-placeholder {
  background: var(--bp-warning-soft);
  border-bottom: 1px dashed var(--bp-warning);
  color: var(--bp-warning);
  padding: 0 3px;
  border-radius: 2px;
  font-family: var(--bp-font-sans);
  font-size: 0.86em;
}

/* Assistant */

.bb-editor__assistant {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  padding: var(--bp-4);
  align-self: start;
}
/* Between the two-column and three-column layouts the assistant would
   otherwise drop into the narrow structure column, because a grid puts
   the third child in the first cell of the next row. */
@media (min-width: 1000px) and (max-width: 1359px) {
  .bb-editor__assistant { grid-column: 1 / -1; }
}
@media (min-width: 1360px) {
  .bb-editor__assistant { position: sticky; top: var(--bp-4); max-height: calc(100vh - 140px); overflow-y: auto; }
}
.bb-assistant__head { display: flex; gap: var(--bp-3); margin-bottom: var(--bp-4); }
.bb-assistant__head p { margin: 4px 0 0; }
.bb-assistant__commands { display: flex; flex-wrap: wrap; gap: 5px; }
.bb-assistant__command {
  font-size: 0.8rem;
  padding: 5px 10px;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-pill);
  background: var(--bp-surface);
  color: var(--bp-text-muted);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.bb-assistant__command:hover { border-color: var(--bp-primary); color: var(--bp-primary-text); }
.bb-assistant__section {
  margin-top: var(--bp-5);
  padding-top: var(--bp-5);
  border-top: 1px solid var(--bp-border);
}
.bb-assistant__visuals { list-style: none; margin: 0 0 var(--bp-2); padding: 0; font-size: 0.85rem; }
.bb-assistant__visuals li { display: flex; justify-content: space-between; gap: var(--bp-2); padding: 3px 0; }

.bb-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--bp-2); }
.bb-versions__item { display: flex; justify-content: space-between; align-items: center; gap: var(--bp-2); }

.bb-review dl { margin: 0; }
.bb-score { margin-bottom: var(--bp-2); }
.bb-score__row { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 3px; }
.bb-score__track { height: 4px; }
.bb-score__bar--success { background: var(--bp-success); }
.bb-score__bar--primary { background: var(--bp-primary); }
.bb-score__bar--warning { background: var(--bp-warning); }
.bb-score__bar--danger { background: var(--bp-danger); }

.bb-recommendations { list-style: none; margin: var(--bp-4) 0 0; padding: 0; display: grid; gap: var(--bp-3); }
.bb-recommendations__item {
  padding: var(--bp-3);
  border-left: 2px solid var(--bp-border-strong);
  background: var(--bp-sunken);
  border-radius: 0 var(--bp-radius-sm) var(--bp-radius-sm) 0;
  font-size: 0.84rem;
}
.bb-recommendations__item--blocking { border-left-color: var(--bp-danger); }
.bb-recommendations__item--important { border-left-color: var(--bp-warning); }
.bb-recommendations__where { font-style: italic; color: var(--bp-text-subtle); margin-bottom: 3px; }
.bb-recommendations__issue { font-weight: 500; }
.bb-recommendations__action { color: var(--bp-text-muted); margin: 3px 0 var(--bp-2); }

.bb-claims { margin-top: var(--bp-4); }
.bb-claims h5 {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
  margin: 0 0 var(--bp-2);
}
.bb-claims ul { margin: 0; padding-left: 1.05rem; font-size: 0.83rem; color: var(--bp-text-muted); }
.bb-claims li { margin-bottom: 5px; }
.bb-claims strong { display: block; color: var(--bp-text); }

.bb-proposal {
  margin: var(--bp-5) 0;
  padding: var(--bp-5);
  border: 1px solid var(--bp-primary-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-primary-soft);
}
.bb-proposal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--bp-3); }
.bb-proposal__title { font-family: var(--bp-font-serif); font-size: 1.2rem; margin: 2px 0 0; }
.bb-proposal__note { font-size: 0.86rem; color: var(--bp-text-muted); margin: var(--bp-3) 0; }
.bb-proposal__body {
  max-height: 46vh;
  overflow-y: auto;
  padding: var(--bp-4);
  background: var(--bp-surface);
  border-radius: var(--bp-radius);
  margin-bottom: var(--bp-4);
  font-family: var(--bp-font-serif);
  line-height: 1.7;
}
.bb-proposal__author-note { font-size: 0.85rem; margin: 0 0 var(--bp-3); }

/* ------------------------------------------------------------------ */
/* Figures and research                                                */
/* ------------------------------------------------------------------ */

.bb-figures { display: grid; gap: var(--bp-5); }
@media (min-width: 900px) { .bb-figures { grid-template-columns: 1fr 1fr; } }

.bb-figure {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bb-figure--skipped { opacity: 0.55; }
.bb-figure__preview {
  padding: var(--bp-5);
  background: var(--bp-sunken);
  border-bottom: 1px solid var(--bp-border);
  display: grid;
  place-items: center;
  min-height: 150px;
}
.bb-figure__preview svg { max-width: 100%; height: auto; }
.bb-figure__unrendered { text-align: center; color: var(--bp-text-muted); }
.bb-figure__unrendered-mark { font-size: 1.6rem; opacity: 0.5; margin-bottom: var(--bp-2); }
.bb-figure__unrendered p { margin: 0; }
.bb-figure__body { padding: var(--bp-4); display: flex; flex-direction: column; gap: var(--bp-3); }
.bb-figure__title { font-size: 1rem; margin: 0; }
.bb-figure__details summary { cursor: pointer; font-size: 0.84rem; color: var(--bp-primary); }
.bb-figure__details p { font-size: 0.84rem; color: var(--bp-text-muted); margin: var(--bp-2) 0 0; }
.bb-figure__prompt {
  font-family: var(--bp-font-mono);
  font-size: 0.76rem;
  padding: var(--bp-2);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius-sm);
  white-space: pre-wrap;
}

.bb-sources { display: grid; gap: var(--bp-3); }
.bb-source {
  padding: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-left: 3px solid var(--bp-warning);
  border-radius: 0 var(--bp-radius) var(--bp-radius) 0;
  background: var(--bp-surface);
}
.bb-source--verified { border-left-color: var(--bp-success); }
.bb-source--disputed { border-left-color: var(--bp-danger); }
.bb-source__head { display: flex; justify-content: space-between; gap: var(--bp-3); flex-wrap: wrap; }
.bb-source__head h4 { margin: 0; font-size: 0.96rem; }
.bb-source__claim { font-style: italic; margin: var(--bp-2) 0; }

.bb-claims-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--bp-3); }
.bb-claims-list li { display: flex; gap: var(--bp-3); align-items: flex-start; }
.bb-claims-list p { margin: 0; font-size: 0.88rem; }

/* ------------------------------------------------------------------ */
/* Design themes                                                       */
/* ------------------------------------------------------------------ */

.bb-themes { display: grid; gap: var(--bp-4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.bb-theme {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--bp-3);
  padding: var(--bp-3);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bb-theme:hover { border-color: var(--bp-border-strong); box-shadow: var(--bp-shadow); transform: translateY(-1px); }
.bb-theme--active { border-color: var(--bp-primary); box-shadow: var(--bp-ring); }
.bb-theme__page {
  display: grid;
  place-items: center;
  background: var(--bp-sunken);
  border-radius: var(--bp-radius-sm);
  overflow: hidden;
  min-height: 190px;
}
.bb-theme__page-inner { display: block; box-shadow: var(--bp-shadow-sm); background: #fff; }
.bb-theme__empty { font-size: 0.78rem; color: var(--bp-text-subtle); padding: var(--bp-4); text-align: center; }
.bb-theme__meta { display: flex; flex-direction: column; gap: 2px; }
.bb-theme__name { font-weight: 600; }
.bb-theme__tagline { font-size: 0.8rem; color: var(--bp-text-muted); }
.bb-theme__spec { font-size: 0.72rem; color: var(--bp-text-subtle); }
.bb-theme__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bp-primary);
  color: #fff;
  font-size: 0.72rem;
}

/* ------------------------------------------------------------------ */
/* Cover studio                                                        */
/* ------------------------------------------------------------------ */

.bb-covers { display: grid; gap: var(--bp-5); }
@media (min-width: 880px) { .bb-covers { grid-template-columns: 1fr 1fr; } }

.bb-cover-concept {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--bp-4);
  padding: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
}
.bb-cover-concept--selected { border-color: var(--bp-primary); box-shadow: var(--bp-ring); }
.bb-cover-concept__body { display: flex; flex-direction: column; gap: var(--bp-3); min-width: 0; }
.bb-cover-concept__name { font-family: var(--bp-font-serif); font-size: 1.16rem; margin: 0; }
@media (max-width: 620px) {
  .bb-cover-concept { grid-template-columns: 1fr; }
  .bb-cover-concept__art { display: grid; place-items: center; }
}

.bb-cover-check { border-top: 1px solid var(--bp-border); padding-top: var(--bp-3); }
.bb-cover-check h4 {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
  margin: 0 0 var(--bp-2);
}
.bb-cover-check dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px var(--bp-3);
  margin: 0 0 var(--bp-2);
  font-size: 0.82rem;
  align-items: center;
}
.bb-cover-check dt { color: var(--bp-text-muted); }
.bb-cover-check dd { margin: 0; }

.bb-blurb {
  font-family: var(--bp-font-serif);
  line-height: 1.65;
  max-width: 62ch;
  color: var(--bp-text-muted);
}

/* ------------------------------------------------------------------ */
/* Previewer                                                           */
/* ------------------------------------------------------------------ */

.bb-preview { display: grid; gap: var(--bp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .bb-preview { grid-template-columns: 240px minmax(0, 1fr); } }

.bb-preview__contents {
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  padding: var(--bp-4);
  align-self: start;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}
.bb-preview__toc { display: flex; flex-direction: column; gap: 1px; margin-top: var(--bp-3); }
.bb-preview__toc-item {
  display: flex;
  justify-content: space-between;
  gap: var(--bp-2);
  padding: 6px 8px;
  border: 0;
  background: transparent;
  border-radius: var(--bp-radius-sm);
  font-size: 0.85rem;
  color: var(--bp-text-muted);
  cursor: pointer;
  text-align: left;
}
.bb-preview__toc-item:hover { background: var(--bp-sunken); color: var(--bp-text); }

.bb-preview__stage { min-width: 0; }
.bb-preview__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--bp-3);
  flex-wrap: wrap;
  margin-bottom: var(--bp-4);
}
.bb-preview__folio { font-size: 0.82rem; color: var(--bp-text-subtle); font-variant-numeric: tabular-nums; }
.bb-preview__viewport {
  display: flex;
  justify-content: center;
  gap: var(--bp-1);
  flex-wrap: wrap;
  padding: var(--bp-6);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius-lg);
  min-height: 420px;
}
.bb-preview__page {
  position: relative;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--bp-shadow), 0 18px 34px -20px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------ */
/* Publishing                                                          */
/* ------------------------------------------------------------------ */

.bb-check {
  padding: var(--bp-6);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
}
.bb-check__head { display: flex; justify-content: space-between; gap: var(--bp-6); flex-wrap: wrap; }
.bb-check__figure { text-align: right; }
.bb-check__summary {
  padding: var(--bp-4);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius);
  line-height: 1.65;
  margin: 0 0 var(--bp-6);
}

.bb-issues { margin-bottom: var(--bp-6); }
.bb-issues__title { display: flex; align-items: center; gap: var(--bp-2); font-size: 0.95rem; margin: 0 0 var(--bp-3); }
.bb-issues__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--bp-2); }
.bb-issues__item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: var(--bp-3);
  align-items: start;
  padding: var(--bp-3);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
}
.bb-issues__area {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
  padding-top: 2px;
}
.bb-issues__where { font-weight: 500; font-size: 0.9rem; }
.bb-issues__issue { margin: 3px 0; font-size: 0.86rem; color: var(--bp-text-muted); }
.bb-issues__fix { margin: 0; font-size: 0.86rem; }
@media (max-width: 720px) {
  .bb-issues__item { grid-template-columns: minmax(0, 1fr); }
}

.bb-formats { display: grid; gap: var(--bp-3); }
.bb-format {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--bp-4);
  padding: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  background: var(--bp-surface);
}
.bb-format__name { font-size: 1rem; margin: 0 0 3px; }
.bb-format p { margin: 0; max-width: 62ch; }

/* ------------------------------------------------------------------ */
/* Marketing                                                           */
/* ------------------------------------------------------------------ */

.bb-scopes { display: grid; gap: var(--bp-3); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bb-scope {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--bp-3);
  padding: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  background: var(--bp-surface);
}
.bb-scope__name { font-size: 1rem; margin: 0 0 4px; }

.bb-assets { display: grid; gap: var(--bp-4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bb-asset {
  display: flex;
  flex-direction: column;
  gap: var(--bp-3);
  padding: var(--bp-4);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
}
.bb-asset__head { display: flex; justify-content: space-between; align-items: center; gap: var(--bp-2); flex-wrap: wrap; }
.bb-asset__head > div { display: flex; gap: 5px; flex-wrap: wrap; }
.bb-asset__title { font-size: 1rem; margin: 0; }
.bb-asset__hook { margin: 0; font-weight: 500; }
.bb-asset__content {
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--bp-text-muted);
  max-height: 260px;
  overflow-y: auto;
  padding: var(--bp-3);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius-sm);
}

/* ------------------------------------------------------------------ */
/* Templates and brand kits                                            */
/* ------------------------------------------------------------------ */

.bb-template { display: flex; flex-direction: column; gap: var(--bp-3); }
.bb-template__name { font-family: var(--bp-font-serif); font-size: 1.14rem; margin: 0 0 4px; }
.bb-template__structure {
  list-style: none;
  margin: 0;
  padding: var(--bp-3);
  background: var(--bp-sunken);
  border-radius: var(--bp-radius);
  display: grid;
  gap: 5px;
}
.bb-template__structure li { display: flex; justify-content: space-between; gap: var(--bp-3); font-size: 0.86rem; }

.bb-kit { display: flex; flex-direction: column; gap: var(--bp-3); }
.bb-kit__name { font-size: 1.08rem; margin: 0; }
.bb-kit__swatches { display: flex; gap: 6px; }
.bb-kit__swatch {
  width: 30px;
  height: 30px;
  border-radius: var(--bp-radius-sm);
  border: 1px solid var(--bp-border);
}

/* ------------------------------------------------------------------ */
/* Small menus                                                         */
/* ------------------------------------------------------------------ */

.bb-menu { position: relative; }
.bb-menu > summary { list-style: none; cursor: pointer; }
.bb-menu > summary::-webkit-details-marker { display: none; }
.bb-menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 170px;
  padding: 5px;
  background: var(--bp-raised);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius);
  box-shadow: var(--bp-shadow-lg);
  display: flex;
  flex-direction: column;
}
.bb-menu__item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 0.86rem;
  color: var(--bp-text);
  border-radius: var(--bp-radius-sm);
  cursor: pointer;
}
.bb-menu__item:hover { background: var(--bp-sunken); text-decoration: none; }
.bb-menu__item--danger { color: var(--bp-danger); }

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .bb-card, .bb-theme { transition: none; }
  .bb-card:hover, .bb-theme:hover { transform: none; }
}

/* ------------------------------------------------------------------ */
/* Sidebar groups                                                      */
/*                                                                     */
/* The shell's nav gained two halves — writing and marketing — so the  */
/* items need labelled sections rather than one undifferentiated list. */
/* ------------------------------------------------------------------ */

.bp-nav-section + .bp-nav-section { margin-top: var(--bp-5); }
.bp-nav-section__label {
  padding: 0 12px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
}

/* ------------------------------------------------------------------ */
/* Mockups                                                             */
/* ------------------------------------------------------------------ */

.bb-mock-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--bp-5);
  margin: var(--bp-5) 0;
}
.bb-mock-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bb-mock-label {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bp-text-subtle);
}
.bb-mock-selects { display: flex; flex-wrap: wrap; gap: var(--bp-4); }
.bb-mock-palettes { display: flex; flex-wrap: wrap; gap: var(--bp-2); }
.bb-mock-palette {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-pill);
  background: var(--bp-surface);
  color: var(--bp-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.bb-mock-palette:hover { border-color: var(--bp-border-strong); }
.bb-mock-palette[aria-checked="true"] { border-color: var(--bp-primary); box-shadow: var(--bp-ring); }
.bb-mock-swatch { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }

.bb-mock-grid { display: grid; gap: var(--bp-5); }
@media (min-width: 760px) { .bb-mock-grid { grid-template-columns: 1fr 1fr; } }
.bb-mock-card {
  margin: 0;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-lg);
  background: var(--bp-surface);
  overflow: hidden;
  box-shadow: var(--bp-shadow);
}
.bb-mock-frame { background: var(--bp-sunken); aspect-ratio: 3 / 2; }
.bb-mock-frame canvas { display: block; width: 100%; height: 100%; }
.bb-mock-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bp-3);
  padding: var(--bp-3) var(--bp-4);
}
.bb-mock-name { font-family: var(--bp-font-serif); font-size: 1.05rem; }
