/* BookForge Production design system v2 (2026-09-27 redesign, BF-WP-181a): tokens (calm, warm production
   cockpit palette, both themes) plus the bf- component inventory from the Claude Design handoff. UI chrome
   uses a system sans (--bf-font-ui); Source Serif 4 (self-hosted below) is reserved for book titles and book
   text (--bf-font-book). No external font request, no CDN. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bf-font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bf-font-book: "Source Serif 4", Georgia, serif;
  --bf-font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --bf-bg: #f6f4ef;
  --bf-surface: #ffffff;
  --bf-surface-sunken: #eeebe4;
  --bf-surface-raised: #ffffff;
  --bf-border: #e2ddd3;
  --bf-border-strong: #c6bfb2;
  --bf-text: #1c2130;
  --bf-text-muted: #5a6072;
  --bf-text-subtle: #7b8091;

  --bf-primary: #2f55c8;
  --bf-primary-hover: #2445a8;
  --bf-primary-tint: #e9eefb;
  --bf-on-primary: #ffffff;
  --bf-on-solid: #ffffff;
  --bf-focus: #2f55c8;

  --bf-tone-positive: #23875a;  --bf-tone-positive-bg: #e2f3ea;  --bf-tone-positive-text: #14583a;
  --bf-tone-warning:  #d98a12;  --bf-tone-warning-bg:  #fcefd8;  --bf-tone-warning-text:  #744400;
  --bf-tone-negative: #c8413a;  --bf-tone-negative-bg: #fbe5e2;  --bf-tone-negative-text: #86261f;
  --bf-tone-info:     #2f55c8;  --bf-tone-info-bg:     #e9eefb;  --bf-tone-info-text:     #1f3a8a;
  --bf-tone-neutral:  #7b8091;  --bf-tone-neutral-bg:  #eeebe4;  --bf-tone-neutral-text:  #454a58;

  --bf-space-1: 4px; --bf-space-2: 8px; --bf-space-3: 12px; --bf-space-4: 16px; --bf-space-5: 20px;
  --bf-space-6: 24px; --bf-space-8: 32px; --bf-space-10: 40px;
  --bf-radius-sm: 6px; --bf-radius-md: 8px; --bf-radius-lg: 12px; --bf-radius-pill: 999px;
  --bf-shadow-sm: 0 1px 2px rgba(28,33,48,.06), 0 1px 1px rgba(28,33,48,.04);
  --bf-shadow-md: 0 4px 14px rgba(28,33,48,.10);
  --bf-shadow-lg: 0 18px 48px rgba(28,33,48,.20);
  --bf-dur-fast: 120ms; --bf-dur-base: 180ms; --bf-dur-slow: 280ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bf-bg: #14161c; --bf-surface: #1c1f27; --bf-surface-sunken: #252933; --bf-surface-raised: #262a35;
  --bf-border: #323745; --bf-border-strong: #4a5062; --bf-text: #eceef3; --bf-text-muted: #a7adbc; --bf-text-subtle: #868c9c;
  --bf-primary: #8aa5ff; --bf-primary-hover: #a9bdff; --bf-primary-tint: #233056; --bf-on-primary: #10172e; --bf-on-solid: #14161c; --bf-focus: #8aa5ff;
  --bf-tone-positive: #5fcf98;  --bf-tone-positive-bg: #16352a;  --bf-tone-positive-text: #b3ecd0;
  --bf-tone-warning:  #f2b24c;  --bf-tone-warning-bg:  #3b2c12;  --bf-tone-warning-text:  #f8dba9;
  --bf-tone-negative: #f08a82;  --bf-tone-negative-bg: #3d1d1b;  --bf-tone-negative-text: #f9c8c3;
  --bf-tone-info:     #8aa5ff;  --bf-tone-info-bg:     #233056;  --bf-tone-info-text:     #cdd9ff;
  --bf-tone-neutral:  #8d93a3;  --bf-tone-neutral-bg:  #2a2e39;  --bf-tone-neutral-text:  #d3d6de;
  --bf-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --bf-shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --bf-shadow-lg: 0 20px 50px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bf-bg: #14161c; --bf-surface: #1c1f27; --bf-surface-sunken: #252933; --bf-surface-raised: #262a35;
    --bf-border: #323745; --bf-border-strong: #4a5062; --bf-text: #eceef3; --bf-text-muted: #a7adbc; --bf-text-subtle: #868c9c;
    --bf-primary: #8aa5ff; --bf-primary-hover: #a9bdff; --bf-primary-tint: #233056; --bf-on-primary: #10172e; --bf-on-solid: #14161c; --bf-focus: #8aa5ff;
    --bf-tone-positive: #5fcf98; --bf-tone-positive-bg: #16352a; --bf-tone-positive-text: #b3ecd0;
    --bf-tone-warning: #f2b24c; --bf-tone-warning-bg: #3b2c12; --bf-tone-warning-text: #f8dba9;
    --bf-tone-negative: #f08a82; --bf-tone-negative-bg: #3d1d1b; --bf-tone-negative-text: #f9c8c3;
    --bf-tone-info: #8aa5ff; --bf-tone-info-bg: #233056; --bf-tone-info-text: #cdd9ff;
    --bf-tone-neutral: #8d93a3; --bf-tone-neutral-bg: #2a2e39; --bf-tone-neutral-text: #d3d6de;
    --bf-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --bf-shadow-md: 0 6px 18px rgba(0,0,0,.45);
    --bf-shadow-lg: 0 20px 50px rgba(0,0,0,.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

*, *::before, *::after { box-sizing: border-box; }

.bf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body { margin: 0; }

body {
  font-family: var(--bf-font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--bf-text);
  background: var(--bf-bg);
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

a { color: var(--bf-primary); text-underline-offset: 3px; }
a:hover { color: var(--bf-primary-hover); }

code, kbd { font-family: var(--bf-font-mono); font-size: .9em; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; }

/* App shell */
.bf-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.bf-topbar {
  display: flex;
  align-items: center;
  gap: var(--bf-space-4);
  padding: var(--bf-space-2) var(--bf-space-4);
  border-bottom: 1px solid var(--bf-border);
  background: var(--bf-surface-raised);
}

.bf-topbar__brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--bf-text);
  white-space: nowrap;
}

.bf-topbar__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-1) var(--bf-space-3);
}

.bf-topbar__nav a {
  color: var(--bf-text-muted);
  text-decoration: none;
  font-weight: 600;
}

.bf-topbar__nav a:hover,
.bf-topbar__nav a[aria-current="page"] { color: var(--bf-text); }

.bf-topbar__live {
  display: flex;
  align-items: center;
}

.bf-topbar__user {
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
  margin-left: auto;
}

.bf-topbar__user-role {
  color: var(--bf-text-muted);
  font-size: 13px;
}

/* Collapsed account menu (Handoff "bf-topbar __user", BF-WP-181a) */
.bf-user-menu {
  position: relative;
}

.bf-user-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
  padding: var(--bf-space-1) var(--bf-space-2) var(--bf-space-1) var(--bf-space-1);
  border: 1px solid var(--bf-border);
  border-radius: 999px;
  background: var(--bf-surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.bf-user-menu__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.bf-user-menu__identity {
  display: grid;
  text-align: left;
  line-height: 1.15;
}

.bf-user-menu__name {
  font-size: 13px;
  font-weight: 600;
}

.bf-user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--bf-space-2));
  width: 260px;
  padding: var(--bf-space-2);
  display: grid;
  gap: var(--bf-space-2);
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  box-shadow: var(--bf-shadow-md);
  z-index: 20;
}

.bf-user-menu__account {
  display: grid;
  gap: 2px;
  padding: var(--bf-space-1) var(--bf-space-2);
}

.bf-user-menu__theme {
  padding: 0 var(--bf-space-2);
}

.bf-theme-toggle {
  display: flex;
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface-sunken);
  overflow: hidden;
}

.bf-theme-toggle__option {
  flex: 1 1 0;
  padding: var(--bf-space-2) var(--bf-space-3);
  border: 0;
  border-right: 1px solid var(--bf-border);
  background: transparent;
  color: var(--bf-text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.bf-theme-toggle__option:last-child { border-right: 0; }
.bf-theme-toggle__option:hover { color: var(--bf-text); }
.bf-theme-toggle__option:focus-visible { outline-offset: -2px; }

.bf-theme-toggle__option[aria-pressed="true"] {
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  font-weight: 600;
}

.bf-language-switch {
  display: flex;
  margin: 0 var(--bf-space-2);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface-sunken);
  overflow: hidden;
}

.bf-language-switch__option {
  flex: 1 1 0;
  padding: var(--bf-space-2) var(--bf-space-3);
  border: 0;
  border-right: 1px solid var(--bf-border);
  background: transparent;
  color: var(--bf-text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.bf-language-switch__option:last-child { border-right: 0; }
.bf-language-switch__option:hover { color: var(--bf-text); }
.bf-language-switch__option:focus-visible { outline-offset: -2px; }

.bf-language-switch__option[aria-pressed="true"] {
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  font-weight: 600;
}

.bf-user-menu__link {
  display: block;
  padding: var(--bf-space-2) 0;
  color: var(--bf-text);
  text-decoration: none;
}

.bf-user-menu__link:hover { color: var(--bf-primary); text-decoration: underline; }

.bf-account-password {
  display: grid;
  gap: var(--bf-space-4);
  max-width: 32rem;
}

.bf-user-menu__signout {
  border-top: 1px solid var(--bf-border);
  padding-top: var(--bf-space-2);
}

.bf-shell__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/* Project header (book identity band above every project page, BF-WP-181a) */
.bf-project-head {
  display: flex;
  gap: var(--bf-space-4);
  align-items: flex-start;
  padding: var(--bf-space-4);
  background: var(--bf-surface);
  border-bottom: 1px solid var(--bf-border);
}

.bf-project-head__cover {
  flex: none;
  width: 56px;
  height: 72px;
  border-radius: var(--bf-radius-sm);
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bf-font-book);
  font-size: 24px;
  font-weight: 600;
  border: 1px solid var(--bf-border);
}

.bf-project-head__body {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: var(--bf-space-2);
}

.bf-project-head__title {
  font-family: var(--bf-font-book);
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}

.bf-project-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-2);
  color: var(--bf-text-muted);
  font-size: 13px;
}

.bf-project-head__meta-item { color: var(--bf-text-muted); }

.bf-project-head__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-1) var(--bf-space-4);
  margin-top: var(--bf-space-1);
}

.bf-project-head__tabs a {
  color: var(--bf-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding-bottom: var(--bf-space-1);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--bf-space-1);
}

.bf-project-head__tabs a:hover { color: var(--bf-text); }
.bf-project-head__tabs a[aria-current="page"] {
  color: var(--bf-primary);
  border-bottom-color: var(--bf-primary);
}

.bf-admin-nav {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-1);
  padding: var(--bf-space-4) var(--bf-space-2);
  border-right: 1px solid var(--bf-border);
  background: var(--bf-surface);
}

.bf-admin-nav a {
  display: block;
  padding: var(--bf-space-1) var(--bf-space-2);
  border-radius: var(--bf-radius-md);
  color: var(--bf-text);
  text-decoration: none;
}

.bf-admin-nav a:hover { background: var(--bf-surface-raised); }
.bf-admin-nav a[aria-current="page"] {
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  font-weight: 600;
}

.bf-admin-nav__section {
  margin-top: var(--bf-space-4);
  padding-top: var(--bf-space-3);
  border-top: 1px solid var(--bf-border);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bf-text-muted);
  padding-left: var(--bf-space-2);
}

@media (max-width: 1180px) {
  .bf-shell__body { flex-direction: column; }
  .bf-admin-nav {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--bf-border);
    padding: var(--bf-space-2);
  }
  .bf-admin-nav__section { display: none; }

  .bf-topbar { flex-wrap: wrap; }

  .bf-phases {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  }
}

.bf-shell__content {
  flex: 1 1 auto;
  padding: var(--bf-space-6) var(--bf-space-4);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

/* Segmented links (two views of the same thing, e.g. Page proof | Print check, ADR-031) */
.bf-segmented-links {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: var(--bf-space-4);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface);
  overflow: hidden;
}

.bf-segmented-links + .bf-help-link { vertical-align: top; margin: var(--bf-space-2) 0 0 var(--bf-space-2); }

.bf-segmented-links__item {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: var(--bf-space-1) var(--bf-space-4);
  color: var(--bf-text-muted);
  font-weight: 500;
  text-decoration: none;
}

.bf-segmented-links__item + .bf-segmented-links__item { border-left: 1px solid var(--bf-border); }
.bf-segmented-links__item:hover { background: var(--bf-surface-raised); color: var(--bf-text); }
.bf-segmented-links__item[aria-current="page"] {
  background: var(--bf-primary-tint);
  color: var(--bf-primary);
  font-weight: 600;
}

@media (max-width: 899px), (pointer: coarse) {
  .bf-segmented-links__item { min-height: 44px; }
}

/* Quiet text link to the next or previous step of a book (ADR-031) */
.bf-step-link { margin: var(--bf-space-4) 0; }
.bf-step-link a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--bf-primary);
  font-weight: 500;
  text-decoration: none;
}
.bf-step-link a:hover { text-decoration: underline; }

@media (max-width: 899px), (pointer: coarse) {
  .bf-step-link a { min-height: 44px; }
}

@media (max-width: 599px) {
  .bf-topbar {
    flex-wrap: wrap;
    gap: var(--bf-space-2);
  }
  .bf-topbar__nav { flex: 1 1 100%; }
  .bf-topbar__user {
    flex: 1 1 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }
  .bf-shell__content { padding: var(--bf-space-4) var(--bf-space-3); }
  .bf-project-head { flex-direction: column; align-items: stretch; padding: var(--bf-space-3); }
  .bf-project-head__cover { display: none; }
  .bf-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  .bf-table th, .bf-table td { overflow-wrap: break-word; min-width: 6.5rem; }
}

/* Live indicator */
.bf-live {
  display: inline-flex;
  align-items: center;
  gap: var(--bf-space-1);
  font-size: 13px;
  color: var(--bf-text-muted);
}

.bf-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentcolor;
}

.bf-live--connected { color: var(--bf-tone-positive); }
.bf-live--reconnecting { color: var(--bf-tone-warning); }
.bf-live--offline { color: var(--bf-tone-negative); }

/* Blazor reconnect overlay */
#components-reconnect-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .4);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-paused,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-resume-failed {
  display: flex;
}

.bf-reconnect-dialog {
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  box-shadow: var(--bf-shadow-lg);
  padding: var(--bf-space-4);
  max-width: 360px;
  text-align: center;
  display: grid;
  gap: var(--bf-space-2);
}

.bf-reconnect-dialog__failed { display: none; }
#components-reconnect-modal.components-reconnect-failed .bf-reconnect-dialog__reconnecting,
#components-reconnect-modal.components-reconnect-rejected .bf-reconnect-dialog__reconnecting,
#components-reconnect-modal.components-reconnect-resume-failed .bf-reconnect-dialog__reconnecting { display: none; }
#components-reconnect-modal.components-reconnect-failed .bf-reconnect-dialog__failed,
#components-reconnect-modal.components-reconnect-rejected .bf-reconnect-dialog__failed,
#components-reconnect-modal.components-reconnect-resume-failed .bf-reconnect-dialog__failed { display: block; }

/* Breadcrumb */
.bf-breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-1);
  padding: 0;
  margin: 0 0 var(--bf-space-3);
  font-size: 13px;
  color: var(--bf-text-muted);
}

.bf-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: var(--bf-space-1);
  color: var(--bf-border-strong);
}

/* Page header */
.bf-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--bf-space-3);
  margin-bottom: var(--bf-space-4);
}

.bf-page-header__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-2);
}

.bf-page-header__title { font-size: 26px; }
.bf-page-header__subtitle { margin: var(--bf-space-1) 0 0; color: var(--bf-text-muted); }
.bf-page-header__actions { display: flex; gap: var(--bf-space-2); flex-wrap: wrap; }

/* Card */
.bf-card {
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  margin-bottom: var(--bf-space-4);
}

.bf-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bf-space-2);
  padding: var(--bf-space-3) var(--bf-space-4);
  border-bottom: 1px solid var(--bf-border);
}

.bf-card__title { font-size: 17px; }
.bf-card__body { padding: var(--bf-space-4); }
.bf-card__footer {
  padding: var(--bf-space-3) var(--bf-space-4);
  border-top: 1px solid var(--bf-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--bf-space-2);
}

/* Buttons */
.bf-button {
  display: inline-flex;
  align-items: center;
  gap: var(--bf-space-1);
  padding: var(--bf-space-2) var(--bf-space-3);
  border-radius: var(--bf-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--bf-dur-fast) ease, border-color var(--bf-dur-fast) ease;
}

.bf-button--primary { background: var(--bf-primary); color: var(--bf-on-primary); }
.bf-button--primary:hover { background: var(--bf-primary-hover); color: var(--bf-on-primary); }

.bf-button--secondary { background: transparent; color: var(--bf-text); border-color: var(--bf-border-strong); }
.bf-button--secondary:hover { background: var(--bf-surface); }

.bf-button--ghost { background: transparent; color: var(--bf-primary); border-color: transparent; }
.bf-button--ghost:hover { background: var(--bf-primary-tint); }

.bf-button--destructive { background: var(--bf-tone-negative); color: var(--bf-on-solid); }
.bf-button--destructive:hover { filter: brightness(1.08); }

.bf-button--danger { background: transparent; color: var(--bf-tone-negative); border-color: var(--bf-tone-negative); }
.bf-button--danger:hover { background: var(--bf-tone-negative-bg); }

.bf-button--icon { padding: var(--bf-space-2); border-radius: var(--bf-radius-md); }

.bf-button:disabled { opacity: .55; cursor: not-allowed; }

.bf-button.is-loading { position: relative; color: transparent; }
.bf-button.is-loading .bf-button__spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.bf-button-group { display: inline-flex; gap: var(--bf-space-2); flex-wrap: wrap; }

/* Form fields */
.bf-field { margin-bottom: var(--bf-space-3); display: grid; gap: var(--bf-space-1); }
.bf-field__label { font-weight: 600; }
.bf-field__label .bf-field__optional { font-weight: 400; color: var(--bf-text-muted); }
.bf-field--invalid .bf-input,
.bf-field--invalid .bf-textarea,
.bf-field--invalid .bf-select { border-color: var(--bf-tone-negative); }
.bf-field__helper { color: var(--bf-text-muted); font-size: 13px; }
.bf-field__error { color: var(--bf-tone-negative); font-size: 13px; }
.bf-field__counter { color: var(--bf-text-muted); font-size: 12px; text-align: right; }
.bf-field__counter--over { color: var(--bf-tone-negative); font-weight: 600; }
.bf-textarea--concept { box-sizing: border-box; width: 100%; min-height: 16rem; line-height: 1.5; resize: vertical; }

.bf-input, .bf-textarea, .bf-select {
  padding: var(--bf-space-2);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  font: inherit;
  background: var(--bf-surface-raised);
  color: var(--bf-text);
}

.bf-input:focus-visible, .bf-textarea:focus-visible, .bf-select:focus-visible { border-color: var(--bf-focus); }

.bf-combobox { position: relative; }
.bf-combobox__list { display: none; }

.bf-radio-group { border: none; padding: 0; margin: 0; display: grid; gap: var(--bf-space-1); }
.bf-radio-group__option { display: flex; align-items: center; gap: var(--bf-space-2); }
.bf-radio { display: flex; align-items: center; gap: var(--bf-space-2); }
.bf-checkbox { display: flex; align-items: center; gap: var(--bf-space-2); }

.bf-stepper { display: inline-flex; align-items: center; gap: var(--bf-space-1); }
.bf-stepper__input { width: 4.5em; text-align: center; }

.bf-range-pair { display: flex; align-items: center; gap: var(--bf-space-2); }
.bf-range-pair__track { color: var(--bf-text-muted); }

.bf-tag-input { display: flex; flex-wrap: wrap; gap: var(--bf-space-1); align-items: center; padding: var(--bf-space-1); border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); background: var(--bf-surface-raised); }
.bf-tag-input__tag { display: inline-flex; align-items: center; gap: var(--bf-space-1); background: var(--bf-surface); border-radius: var(--bf-radius-sm); padding: 2px var(--bf-space-1); font-size: 13px; }
.bf-tag-input__tag button { border: none; background: none; cursor: pointer; color: var(--bf-text-muted); font: inherit; }
.bf-tag-input__field { border: none; outline: none; flex: 1 1 8ch; min-width: 8ch; background: transparent; font: inherit; color: var(--bf-text); }

.bf-validation-summary { color: var(--bf-tone-negative); }
.bf-validation-summary ul { margin: 0; padding-left: var(--bf-space-4); }

/* Icons: fixed pixel size regardless of the container; descendant rules such as .bf-badge svg may still override it */
.bf-icon { display: inline-block; flex: none; width: 16px; height: 16px; }
.bf-icon--sm { width: 12px; height: 12px; }
.bf-icon--md { width: 16px; height: 16px; }
.bf-icon--lg { width: 20px; height: 20px; }

/* Badges */
.bf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--bf-space-2);
  border-radius: var(--bf-radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bf-tone-neutral-bg);
  color: var(--bf-tone-neutral-text);
}

.bf-badge svg { width: 12px; height: 12px; flex: none; }

.bf-badge--positive { background: var(--bf-tone-positive-bg); color: var(--bf-tone-positive-text); }
.bf-badge--warning { background: var(--bf-tone-warning-bg); color: var(--bf-tone-warning-text); }
.bf-badge--negative { background: var(--bf-tone-negative-bg); color: var(--bf-tone-negative-text); }
.bf-badge--info { background: var(--bf-tone-info-bg); color: var(--bf-tone-info-text); }
.bf-badge--neutral { background: var(--bf-tone-neutral-bg); color: var(--bf-tone-neutral-text); }

.bf-severity--info { background: var(--bf-tone-info-bg); color: var(--bf-tone-info-text); }
.bf-severity--warning { background: var(--bf-tone-warning-bg); color: var(--bf-tone-warning-text); }
.bf-severity--error { background: var(--bf-tone-negative-bg); color: var(--bf-tone-negative-text); }
.bf-severity--critical { background: var(--bf-tone-negative-text); color: var(--bf-on-solid); }

/* Findings */
.bf-findings { display: grid; gap: var(--bf-space-2); list-style: none; margin: 0; padding: 0; }
.bf-finding { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--bf-space-2); padding: var(--bf-space-2); border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); }
.bf-finding__rule { font-weight: 600; }
.bf-finding__id { font-family: var(--bf-font-mono); font-size: 12px; color: var(--bf-text-muted); }
.bf-finding__location { color: var(--bf-text-muted); font-size: 13px; }

/* Alert / banner */
.bf-alert {
  display: flex;
  gap: var(--bf-space-2);
  align-items: flex-start;
  padding: var(--bf-space-3);
  border-radius: var(--bf-radius-md);
  border: 1px solid var(--bf-border);
  margin-bottom: var(--bf-space-3);
  background: var(--bf-surface);
}

.bf-alert--info { border-color: var(--bf-tone-info); background: var(--bf-tone-info-bg); color: var(--bf-tone-info-text); }
.bf-alert--success { border-color: var(--bf-tone-positive); background: var(--bf-tone-positive-bg); color: var(--bf-tone-positive-text); }
.bf-alert--warning { border-color: var(--bf-tone-warning); background: var(--bf-tone-warning-bg); color: var(--bf-tone-warning-text); }
.bf-alert--error { border-color: var(--bf-tone-negative); background: var(--bf-tone-negative-bg); color: var(--bf-tone-negative-text); }
.bf-alert--pause { border-color: var(--bf-tone-warning); background: var(--bf-tone-warning-bg); color: var(--bf-tone-warning-text); }

/* Toast */
.bf-toasts {
  position: fixed;
  right: var(--bf-space-4);
  bottom: var(--bf-space-4);
  display: grid;
  gap: var(--bf-space-2);
  z-index: 900;
  max-width: 360px;
}

.bf-toast {
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  box-shadow: var(--bf-shadow-md);
  padding: var(--bf-space-2) var(--bf-space-3);
}

.bf-toast--positive { border-color: var(--bf-tone-positive); }
.bf-toast--negative { border-color: var(--bf-tone-negative); }

/* Data table */
.bf-table { width: 100%; border-collapse: collapse; margin-bottom: var(--bf-space-4); }
.bf-table th, .bf-table td { text-align: left; padding: var(--bf-space-2); border-bottom: 1px solid var(--bf-border); }
.bf-table th, .bf-table td { overflow-wrap: anywhere; }
.bf-table .bf-badge { white-space: nowrap; }
.bf-table th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--bf-text-muted); }
.bf-table--compact th, .bf-table--compact td { padding: 4px var(--bf-space-1); }

.bf-table__row--skeleton td {
  background: linear-gradient(90deg, var(--bf-border) 25%, var(--bf-surface) 37%, var(--bf-border) 63%);
  background-size: 400% 100%;
  animation: bf-skeleton var(--bf-dur-slow) ease-in-out infinite;
  animation-duration: 1.4s;
  color: transparent;
  border-radius: var(--bf-radius-sm);
}

@keyframes bf-skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.bf-pagination { display: flex; align-items: center; gap: var(--bf-space-2); justify-content: flex-end; }
.bf-pagination__status { color: var(--bf-text-muted); font-size: 13px; }

.bf-filterbar { display: flex; flex-wrap: wrap; gap: var(--bf-space-2); align-items: flex-end; margin-bottom: var(--bf-space-3); }

/* Definition list */
.bf-dl, .bf-key-values { display: grid; grid-template-columns: fit-content(55%) minmax(0, 1fr); gap: var(--bf-space-1) var(--bf-space-4); margin: 0; }
.bf-dl dd, .bf-key-values dd { min-width: 0; overflow-wrap: anywhere; }
.bf-dl dt, .bf-key-values dt { font-weight: 600; color: var(--bf-text-muted); }

/* Empty state */
.bf-empty, .bf-empty-state { padding: var(--bf-space-6) var(--bf-space-3); text-align: center; color: var(--bf-text-muted); }
.bf-empty__title { color: var(--bf-text); font-weight: 600; margin-bottom: var(--bf-space-1); }
.bf-empty__text { margin: 0; }

/* Glossary term */
.bf-term { position: relative; border-bottom: 1px dotted var(--bf-text-subtle); cursor: help; }
.bf-term:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; border-radius: var(--bf-radius-sm); }
.bf-term__tip {
  position: absolute;
  z-index: 30;
  left: 0;
  top: 100%;
  display: grid;
  gap: var(--bf-space-1);
  width: max-content;
  max-width: min(22rem, 80vw);
  margin-top: 6px;
  padding: var(--bf-space-3);
  border: 1px solid var(--bf-border-strong);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface-raised);
  color: var(--bf-text);
  box-shadow: var(--bf-shadow-lg);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  visibility: hidden;
  opacity: 0;
}
.bf-term__tip::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 6px; }
.bf-term:hover .bf-term__tip,
.bf-term:focus-within .bf-term__tip { visibility: visible; opacity: 1; }
.bf-term__plain { font-weight: 600; }
.bf-term__definition { color: var(--bf-text-muted); }
.bf-term__more { color: var(--bf-primary); text-decoration: underline; }
.bf-term--unknown { border-bottom: 1px solid var(--bf-tone-negative); }
.bf-term__error { color: var(--bf-tone-negative); font-weight: 600; }

.bf-glossary { display: grid; gap: var(--bf-space-3); margin: 0; padding: 0; list-style: none; }
.bf-glossary__entry { display: grid; gap: var(--bf-space-1); padding-bottom: var(--bf-space-3); border-bottom: 1px solid var(--bf-border); scroll-margin-top: var(--bf-space-6); }
.bf-glossary__entry:target { background: var(--bf-primary-tint); border-radius: var(--bf-radius-md); padding: var(--bf-space-3); }
.bf-glossary__term { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--bf-space-2); font-weight: 600; }
.bf-glossary__plain { color: var(--bf-text-muted); font-weight: 400; }
.bf-glossary__anchor { color: var(--bf-text-subtle); text-decoration: none; }
.bf-glossary__anchor:hover { color: var(--bf-primary); text-decoration: underline; }
.bf-glossary__definition { margin: 0; max-width: 70ch; overflow-wrap: anywhere; }

@media (max-width: 599px) {
  .bf-term__tip { position: fixed; left: var(--bf-space-4); right: var(--bf-space-4); top: auto; bottom: var(--bf-space-4); width: auto; max-width: none; margin-top: 0; }
  .bf-term__tip::before { display: none; }
}

/* Pipeline */
.bf-pipeline { display: grid; gap: var(--bf-space-3); list-style: none; margin: 0; padding: 0; }
.bf-pipeline--horizontal { grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); overflow-x: auto; }
.bf-pipeline--vertical { grid-auto-flow: row; }

.bf-pipeline__step {
  display: grid;
  gap: 2px;
  padding: var(--bf-space-2) var(--bf-space-3);
  border-left: 3px solid var(--bf-border);
  border-radius: 0 var(--bf-radius-md) var(--bf-radius-md) 0;
}

.bf-pipeline--horizontal .bf-pipeline__step { border-left: none; border-top: 3px solid var(--bf-border); border-radius: 0; }

.bf-pipeline__step--positive { border-color: var(--bf-tone-positive); }
.bf-pipeline__step--warning { border-color: var(--bf-tone-warning); }
.bf-pipeline__step--negative { border-color: var(--bf-tone-negative); }
.bf-pipeline__step--info { border-color: var(--bf-tone-info); }
.bf-pipeline__step--neutral { border-color: var(--bf-border-strong); }

.bf-pipeline__step-name { font-weight: 600; }
.bf-pipeline__step-meta { color: var(--bf-text-muted); font-size: 13px; }

.bf-gate-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--bf-tone-warning);
  font-size: 12px;
  font-weight: 600;
}

/* Phase strip (BF-WP-181b, Screen Overview) */
.bf-phases {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: var(--bf-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

.bf-phases__button {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: var(--bf-space-2) var(--bf-space-3);
  border: 0;
  border-top: 4px solid var(--bf-border-strong);
  border-radius: 0 0 var(--bf-radius-sm) var(--bf-radius-sm);
  background: var(--bf-surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.bf-phases__button:disabled {
  cursor: default;
}

.bf-phases__phase--waiting .bf-phases__button { border-top-color: var(--bf-surface-sunken); color: var(--bf-text-muted); }
.bf-phases__phase--active .bf-phases__button { border-top-color: var(--bf-tone-info); }
.bf-phases__phase--needs .bf-phases__button { border-top-color: var(--bf-tone-warning); }
.bf-phases__phase--problem .bf-phases__button { border-top-color: var(--bf-tone-negative); }
.bf-phases__phase--done .bf-phases__button { border-top-color: var(--bf-tone-positive); }

.bf-phases__phase--current .bf-phases__button {
  background: var(--bf-surface-raised);
  box-shadow: var(--bf-shadow-sm);
}

.bf-phases__name { font-weight: 600; font-size: 14px; }
.bf-phases__state { font-size: 12px; color: var(--bf-text-muted); }
.bf-phases__gate { font-size: 11px; font-weight: 600; color: var(--bf-text-subtle); text-transform: uppercase; letter-spacing: .04em; }

/* Page grid (BF-WP-181b, Pictures phase — one tile per illustrated page, never one per attempt) */
.bf-page-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: var(--bf-space-2);
}

.bf-page-grid__tile {
  border-radius: var(--bf-radius-sm);
  border: 1px solid var(--bf-border);
  background: var(--bf-surface);
  overflow: hidden;
}

.bf-page-grid__tile-link {
  display: grid;
  gap: 6px;
  padding: var(--bf-space-2);
  text-decoration: none;
  color: inherit;
}

.bf-page-grid__label {
  font-size: 13px;
  font-weight: 600;
}

/* Progress */
.bf-progress { height: 8px; border-radius: 999px; background: var(--bf-border); overflow: hidden; }
.bf-progress__fill { height: 100%; background: var(--bf-primary); transition: width var(--bf-dur-base) ease; }
.bf-progress--indeterminate .bf-progress__fill {
  width: 40% !important;
  animation: bf-indeterminate 1.2s ease-in-out infinite;
}

@keyframes bf-indeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.bf-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--bf-border);
  border-top-color: var(--bf-primary);
  border-radius: 50%;
  animation: bf-spin .8s linear infinite;
}

@keyframes bf-spin { to { transform: rotate(360deg); } }

/* Dialog */
.bf-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 30, 29, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bf-space-4);
  z-index: 800;
}

.bf-dialog {
  background: var(--bf-surface-raised);
  border-radius: var(--bf-radius-lg);
  box-shadow: var(--bf-shadow-lg);
  max-width: 520px;
  width: 100%;
  padding: var(--bf-space-4);
  display: grid;
  gap: var(--bf-space-3);
}

.bf-dialog--confirm { max-width: 420px; }
.bf-dialog__title { font-size: 20px; }
.bf-dialog__body { color: var(--bf-text-muted); }
.bf-dialog__actions { display: flex; justify-content: flex-end; gap: var(--bf-space-2); }

/* BfModal: the panel inside the .bf-dialog-backdrop overlay. bf-modal.js traps focus and handles Escape. */
.bf-modal {
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  padding: var(--bf-space-4);
  background: var(--bf-surface-raised);
  box-shadow: var(--bf-shadow-lg);
}

.bf-modal > h2 { margin: 0 0 var(--bf-space-3); font-size: 20px; }
.bf-modal .bf-dialog { max-width: none; padding: 0; box-shadow: none; background: none; }

.bf-confirm-dialog__actions { display: flex; gap: var(--bf-space-2); margin-top: var(--bf-space-3); }

/* Tabs */
.bf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--bf-space-1);
  min-width: 0;
  max-width: 100%;
  border-bottom: 1px solid var(--bf-border);
  margin-bottom: var(--bf-space-3);
}
.bf-tabs__tab {
  min-width: 0;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
  padding: var(--bf-space-2) var(--bf-space-3);
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--bf-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.bf-tabs__tab[aria-selected="true"] { color: var(--bf-primary); border-color: var(--bf-primary); }
.bf-tabs__tab:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: -2px; }

/* Branch switcher (language tabs plus earlier attempts) */
.bf-branch-switcher { min-width: 0; max-width: 100%; }
.bf-branch-switcher__panel { display: grid; gap: var(--bf-space-2); min-width: 0; margin-bottom: var(--bf-space-3); }
.bf-branch-switcher__current { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bf-space-1) var(--bf-space-2); min-width: 0; }
.bf-branch-switcher__attempt { color: var(--bf-text-muted); font-size: 13px; overflow-wrap: anywhere; }
.bf-branch-switcher__note { margin: 0; }
.bf-branch-switcher__attempts { list-style: none; margin: var(--bf-space-2) 0 0; padding: 0; display: grid; gap: var(--bf-space-1); }
.bf-branch-switcher__attempts .bf-button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--bf-space-1) var(--bf-space-2);
  width: 100%;
  min-width: 0;
  text-align: left;
  font-weight: 400;
}
.bf-branch-switcher__attempts .bf-button[aria-current="true"] { border-color: var(--bf-primary); }

/* Disclosure */
.bf-disclosure { border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); padding: var(--bf-space-2) var(--bf-space-3); }
.bf-disclosure summary { cursor: pointer; font-weight: 600; }

/* Copyable ID chip */
.bf-id-chip {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: var(--bf-space-1);
  font-family: var(--bf-font-mono);
  font-size: 12px;
  color: var(--bf-text-muted);
}

.bf-id-chip code { min-width: 0; overflow-wrap: anywhere; }

.bf-id-chip__copy {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--bf-primary);
  padding: 0;
  font: inherit;
}

.bf-id-chip__copy:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; }
.bf-id-chip__copy[data-bf-copy-state] svg { display: none; }
.bf-id-chip__copy[data-bf-copy-state="copied"]::after { content: "\2713"; }
.bf-id-chip__copy[data-bf-copy-state="failed"]::after { content: "!"; }
.bf-id-chip__status { color: var(--bf-text-muted); }

/* Book description card */
.bf-book-description { display: grid; gap: var(--bf-space-3); min-width: 0; }
.bf-book-description__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bf-space-2); }
.bf-book-description__count { display: inline-flex; align-items: center; gap: var(--bf-space-2); font-variant-numeric: tabular-nums; }
.bf-book-description__text {
  max-height: 24rem;
  overflow: auto;
  padding: var(--bf-space-3) var(--bf-space-4);
  background: var(--bf-surface-sunken);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  overflow-wrap: anywhere;
}
.bf-book-description__text { margin-bottom: var(--bf-space-2); }
.bf-book-description__text p { margin: 0 0 var(--bf-space-3); line-height: 1.55; }
.bf-book-description__text p:last-child { margin-bottom: 0; }
.bf-book-description__source-switch { display: flex; flex-wrap: wrap; gap: var(--bf-space-2); }
.bf-book-description__generate { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bf-space-2) var(--bf-space-3); min-width: 0; }
.bf-book-description__generate .bf-alert { flex: 1 1 100%; }
.bf-book-description__generate .bf-alert p { margin: 0 0 var(--bf-space-2); }
.bf-book-description__confirm { display: flex; flex-wrap: wrap; gap: var(--bf-space-2); }
.bf-book-description__busy { display: inline-flex; align-items: center; gap: var(--bf-space-2); }

/* Image frame, zoom/pan, compare */
.bf-image, .bf-image-frame { display: inline-block; margin: 0; max-width: 100%; }
.bf-image__viewport, .bf-image-frame__viewport { position: relative; display: inline-block; max-width: 100%; }
.bf-image__image, .bf-image-frame__image { max-width: min(32rem, 100%); max-height: 16rem; display: block; object-fit: contain; border-radius: var(--bf-radius-md); }
.bf-image__caption, .bf-image-frame__caption { font-size: 13px; color: var(--bf-text-muted); }
.bf-image--loading .bf-image__image { opacity: .5; }
.bf-image--error { border: 1px dashed var(--bf-tone-negative); }
.bf-image--draft::after { content: "Draft"; }
.bf-image__watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-weight: 600; pointer-events: none; }
.bf-image-card { border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); padding: var(--bf-space-2); }

.bf-zoom, .bf-zoom-pan { display: inline-block; max-width: 100%; }
.bf-zoom__toolbar { display: flex; gap: var(--bf-space-1); margin-bottom: var(--bf-space-1); }
.bf-zoom__toolbar .bf-button--icon { min-width: 36px; min-height: 36px; justify-content: center; }
.bf-zoom__reset { padding-inline: var(--bf-space-3); }
.bf-image-frame__broken { margin: var(--bf-space-2) 0 0; padding: var(--bf-space-3); border: 1px dashed var(--bf-tone-negative); border-radius: var(--bf-radius-sm); font-size: 13px; }
.bf-image-frame__image[data-bf-image-broken] { display: none; }
.bf-zoom__viewport { display: inline-block; max-width: 100%; overflow: hidden; touch-action: none; border-radius: var(--bf-radius-md); }
.bf-zoom__viewport:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; }
.bf-zoom__stage, .bf-zoom-pan__surface { display: inline-block; max-width: 100%; cursor: grab; transform-origin: center center; }
.bf-zoom-pan__toggle { position: absolute; opacity: 0; pointer-events: none; }
.bf-zoom-pan__toggle:checked ~ .bf-zoom-pan__surface { cursor: zoom-out; }
.bf-zoom-pan__toggle:checked ~ .bf-zoom-pan__surface .bf-image-frame__image { max-width: none; max-height: none; width: 48rem; }

.bf-compare, .bf-image-compare { display: grid; gap: var(--bf-space-2); max-width: min(32rem, 100%); }
.bf-compare__stage, .bf-image-compare__stage { position: relative; display: inline-block; }
.bf-image-compare__image { display: block; max-width: min(32rem, 100%); max-height: 20rem; object-fit: contain; border-radius: var(--bf-radius-md); }
.bf-image-compare__before { position: absolute; inset: 0; overflow: hidden; }
.bf-image-compare__before .bf-image-compare__image { position: absolute; inset: 0; }
.bf-image-compare__labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--bf-text-muted); }
.bf-image-compare__slider { width: 100%; accent-color: var(--bf-primary); }
.bf-image-compare__slider:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; }

/* Page spread viewer */
.bf-spread { display: flex; flex-direction: column; gap: var(--bf-space-4); }
.bf-spread__stage, .bf-page-proof__spread { display: flex; gap: var(--bf-space-2); align-items: flex-start; flex-wrap: wrap; }
.bf-spread__page { border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); }
.bf-spread__thumbs { display: flex; position: relative; gap: var(--bf-space-1); overflow-x: auto; }

/* Budget */
.bf-budget { display: grid; gap: var(--bf-space-1); }
.bf-budget-line { display: flex; justify-content: space-between; gap: var(--bf-space-2); }

/* Candidates */
.bf-candidate {
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  padding: var(--bf-space-2);
  cursor: pointer;
}

.bf-candidate[aria-checked="true"] { border-color: var(--bf-primary); box-shadow: 0 0 0 1px var(--bf-primary); }

/* Decision bar (gate decisions and picture choices) */
:root { --bf-decision-bar-height: 10rem; }

html:has(.bf-decision-bar) { scroll-padding-bottom: calc(var(--bf-decision-bar-height) + var(--bf-space-4)); }

.bf-decision-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 44rem) max-content;
  justify-content: start;
  align-items: center;
  gap: var(--bf-space-1) var(--bf-space-6);
  box-sizing: border-box;
  max-height: var(--bf-decision-bar-height);
  overflow-y: auto;
  padding: var(--bf-space-3) var(--bf-space-4);
  text-align: left;
  background: var(--bf-surface-raised);
  border-top: 1px solid var(--bf-border);
  box-shadow: var(--bf-shadow-md);
}

.bf-decision-bar > * { min-width: 0; margin: 0; }
.bf-decision-bar > .bf-field { grid-column: 1; grid-row: 1; gap: 2px; }
.bf-decision-bar > :not(.bf-field):not(.bf-decision-bar__actions) { grid-column: 1 / -1; }
.bf-decision-bar .bf-textarea { box-sizing: border-box; width: 100%; resize: none; }
.bf-decision-bar .bf-field__helper { margin: 0; }
.bf-decision-bar > .bf-alert { padding: var(--bf-space-1) var(--bf-space-3); }
.bf-decision-bar > .bf-alert p { margin: 0; }
.bf-decision-bar:has(> .bf-alert) { max-height: calc(var(--bf-decision-bar-height) + 3rem); }

.bf-decision-bar__note {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--bf-text-muted);
}

.bf-decision-bar__actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-2);
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 599px) {
  :root { --bf-decision-bar-height: 45dvh; }

  .bf-decision-bar { grid-template-columns: minmax(0, 1fr); padding: var(--bf-space-2) var(--bf-space-3); }
  .bf-decision-bar > .bf-field,
  .bf-decision-bar__actions { grid-column: 1; }
  .bf-decision-bar__actions { grid-row: auto; flex-wrap: nowrap; }
  .bf-decision-bar__actions > * { flex: 1 1 0; min-width: 0; display: flex; }
  .bf-decision-bar__actions .bf-button { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 899px), (pointer: coarse) {
  .bf-zoom__toolbar .bf-button--icon { min-width: 44px; min-height: 44px; justify-content: center; }
  .bf-button, .bf-tabs__tab { min-height: 44px; }
  .bf-input, .bf-select { min-height: 44px; box-sizing: border-box; }
  .bf-decision-bar .bf-textarea { min-height: 44px; }
  .bf-id-chip__copy { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .bf-checkbox, .bf-radio { min-height: 44px; }
  .bf-gate__input a, .bf-image-card__viewer { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Wizard */
.bf-wizard-steps { display: flex; gap: var(--bf-space-2); margin-bottom: var(--bf-space-4); list-style: none; padding: 0; }
.bf-wizard-actions { display: flex; justify-content: space-between; gap: var(--bf-space-2); margin-top: var(--bf-space-4); }
.bf-wizard-summary { display: grid; gap: var(--bf-space-1); }

/* System pages */
.bf-system-page {
  display: grid;
  place-items: center;
  text-align: center;
  gap: var(--bf-space-2);
  min-height: 60vh;
  padding: var(--bf-space-6);
}

.bf-system-page__mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--bf-tone-info-bg); color: var(--bf-tone-info-text); }

.bf-system-page__code { color: var(--bf-text-muted); font-family: var(--bf-font-mono); }

/* Download link */
.bf-download-link { display: inline-flex; align-items: center; gap: var(--bf-space-1); }
.bf-download-status { margin-inline-start: var(--bf-space-2); color: var(--bf-text-muted, inherit); font-size: var(--bf-text-sm, 0.875rem); }
.bf-download-status button { font: inherit; color: var(--bf-primary); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bf-download-status { overflow-wrap: anywhere; }

/* Module layout (BF-WP-71, docs/distribution/ui-ablaeufe.md §3) */
.bf-context-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-2) var(--bf-space-6);
  padding: var(--bf-space-2) var(--bf-space-3);
  margin-bottom: var(--bf-space-3);
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
}

.bf-process {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: var(--bf-space-4);
  align-items: start;
}

.bf-process__section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-3);
}

.bf-checkpoints ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-1);
}

.bf-checkpoints li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bf-space-2);
  padding: var(--bf-space-1) var(--bf-space-2);
  border-left: 3px solid transparent;
}

.bf-checkpoints li[aria-current="step"] {
  border-left-color: var(--bf-primary);
  background: var(--bf-primary-tint);
}

.bf-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-1);
  margin-bottom: var(--bf-space-3);
  border-bottom: 1px solid var(--bf-border);
}

.bf-subnav a {
  padding: var(--bf-space-1) var(--bf-space-3);
  color: var(--bf-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.bf-subnav a:hover { background: var(--bf-surface-raised); }
.bf-subnav a[aria-current="page"] {
  color: var(--bf-primary);
  border-bottom-color: var(--bf-primary);
  font-weight: 600;
}

.bf-fieldset {
  margin: 0 0 var(--bf-space-3);
  padding: var(--bf-space-3);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  min-width: 0;
}

.bf-fieldset:disabled { opacity: .6; }

.bf-active-state {
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-2);
  padding: var(--bf-space-3);
  background: var(--bf-surface-raised);
  border: 1px solid var(--bf-border);
  border-left: 3px solid var(--bf-primary);
  border-radius: var(--bf-radius-md);
}

@media (max-width: 899px) {
  .bf-process { grid-template-columns: minmax(0, 1fr); }
}

.bf-autopilot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-2) var(--bf-space-3);
  padding: var(--bf-space-2) var(--bf-space-4);
  border-bottom: 1px solid var(--bf-border);
  background: var(--bf-surface-raised);
  color: var(--bf-text);
  font-size: 14px;
}

.bf-autopilot-bar--stopped {
  border-left: 4px solid var(--bf-warning, var(--bf-border-strong));
}

.bf-autopilot-bar__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bf-autopilot-bar__link,
.bf-topbar__autopilot {
  color: var(--bf-primary);
  font-weight: 600;
  text-decoration: underline;
}

.bf-topbar__autopilot {
  font-size: 13px;
  white-space: nowrap;
}

.bf-autopilot-card {
  display: grid;
  gap: var(--bf-space-3);
}

.bf-autopilot-card__lead {
  margin: 0;
  color: var(--bf-text-muted);
}

.bf-autopilot-card__list {
  margin: 0;
  padding-left: var(--bf-space-5);
}

.bf-members-card {
  display: grid;
  gap: var(--bf-space-3);
  min-width: 0;
}

.bf-members-card__lead {
  margin: 0;
  color: var(--bf-text-muted);
}

.bf-members-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--bf-space-2);
}

.bf-members-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-2) var(--bf-space-3);
  min-width: 0;
}

.bf-members-card__who {
  display: grid;
  min-width: 0;
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
}

.bf-members-card__meta {
  color: var(--bf-text-muted);
  font-size: 13px;
}

.bf-members-card__origin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-2);
  min-width: 0;
}

.bf-members-card__role {
  color: var(--bf-text-muted);
  overflow-wrap: anywhere;
}

/* Book journey: stepper and next-step banner on every book page (ADR-031) */
.bf-journey {
  padding: var(--bf-space-2) var(--bf-space-4) 0;
  background: var(--bf-surface);
  border-bottom: 1px solid var(--bf-border);
}

.bf-journey__route {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bf-journey__station {
  position: relative;
  min-width: 0;
}

.bf-journey__station::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--bf-border-strong);
}

.bf-journey__station:first-child::before { display: none; }
.bf-journey__station--done + .bf-journey__station::before { background: var(--bf-tone-positive); }

.bf-journey__link {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: var(--bf-space-2) var(--bf-space-1) var(--bf-space-3);
  color: var(--bf-text);
  text-decoration: none;
  border-radius: var(--bf-radius-md);
}

.bf-journey__help { position: absolute; z-index: 2; top: 0; left: calc(50% + 20px); }
.bf-journey__station:nth-child(-n+3) .bf-help-link__tip { left: 0; right: auto; }
.bf-journey__link:hover { background: var(--bf-surface-sunken); }
.bf-journey__link:focus-visible { outline: 2px solid var(--bf-focus); outline-offset: 2px; }

.bf-journey__dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--bf-border-strong);
  background: var(--bf-surface);
  color: var(--bf-text-subtle);
  font-size: 14px;
  font-weight: 600;
}

.bf-journey__name { font-size: 14px; font-weight: 500; }
.bf-journey__state { font-size: 12.5px; color: var(--bf-text-muted); }
.bf-journey__station--current .bf-journey__name { font-weight: 700; }
.bf-journey__station--waiting .bf-journey__name { color: var(--bf-text-subtle); }

.bf-journey__station--done .bf-journey__dot { background: var(--bf-tone-positive); border-color: var(--bf-tone-positive); color: var(--bf-on-solid); }
.bf-journey__station--done .bf-journey__state { color: var(--bf-tone-positive-text); }
.bf-journey__station--working .bf-journey__dot { border-color: var(--bf-primary); color: var(--bf-primary); box-shadow: 0 0 0 5px var(--bf-primary-tint); }
.bf-journey__station--working .bf-journey__state { color: var(--bf-tone-info-text); }
.bf-journey__station--needsyou .bf-journey__dot { background: var(--bf-tone-warning); border-color: var(--bf-tone-warning); color: var(--bf-on-solid); box-shadow: 0 0 0 5px var(--bf-tone-warning-bg); }
.bf-journey__station--needsyou .bf-journey__state { color: var(--bf-tone-warning-text); font-weight: 600; }
.bf-journey__station--failed .bf-journey__dot { background: var(--bf-tone-negative); border-color: var(--bf-tone-negative); color: var(--bf-on-solid); box-shadow: 0 0 0 5px var(--bf-tone-negative-bg); }
.bf-journey__station--failed .bf-journey__state { color: var(--bf-tone-negative-text); font-weight: 600; }

.bf-next-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bf-space-4) var(--bf-space-6);
  padding: var(--bf-space-4) var(--bf-space-6);
  border-bottom: 1px solid var(--bf-border);
  background: var(--bf-surface-sunken);
  color: var(--bf-text);
}

.bf-next-banner--warning { background: var(--bf-tone-warning-bg); }
.bf-next-banner--negative { background: var(--bf-tone-negative-bg); }
.bf-next-banner--info { background: var(--bf-tone-info-bg); }
.bf-next-banner--positive { background: var(--bf-tone-positive-bg); }

.bf-next-banner__body { flex: 1 1 28rem; min-width: 0; display: grid; gap: var(--bf-space-1); }
.bf-next-banner__kicker { margin: 0; font-size: 13px; color: var(--bf-text-muted); }
.bf-next-banner__headline { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.bf-next-banner__reason { margin: 0; max-width: 70ch; overflow-wrap: anywhere; }
.bf-next-banner__autopilot { margin: var(--bf-space-2) 0 0; font-size: 13px; color: var(--bf-text-muted); display: flex; flex-wrap: wrap; gap: var(--bf-space-1) var(--bf-space-3); }
.bf-next-banner__link,
.bf-next-banner__secondary { color: var(--bf-primary); text-decoration: underline; font-weight: 500; }
.bf-next-banner__help { margin: 0; }
.bf-next-banner__help .bf-help-link__tip { left: 0; right: auto; }
.bf-next-banner__help .bf-help-link { padding-left: 0; color: var(--bf-text-muted); text-decoration: underline; }
.bf-next-banner__help .bf-help-link:hover,
.bf-next-banner__help .bf-help-link:focus-visible { color: var(--bf-primary); }
.bf-next-banner__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bf-space-4); flex: 0 0 auto; }

/* Languages card: one row per target language on the project overview (ADR-031) */
.bf-languages-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--bf-space-2);
}

.bf-languages-card__row {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) 7.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--bf-space-2) var(--bf-space-4);
  padding: var(--bf-space-2) var(--bf-space-3);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface);
}

.bf-languages-card__row--needsyou { background: var(--bf-tone-warning-bg); border-color: var(--bf-tone-warning); }
.bf-languages-card__row--failed { background: var(--bf-tone-negative-bg); border-color: var(--bf-tone-negative); }
.bf-languages-card__name { font-weight: 600; overflow-wrap: anywhere; }
.bf-languages-card__reason { min-width: 0; color: var(--bf-text); overflow-wrap: anywhere; }
.bf-languages-card__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--bf-space-2); }

.bf-project-head__util { margin-left: auto; }

/* Context help link (BfHelpLink, ADR-033) */
.bf-help-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--bf-radius-pill);
  color: var(--bf-text-subtle);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.bf-help-link:hover,
.bf-help-link:focus-visible { color: var(--bf-primary); background: var(--bf-primary-tint); }
.bf-help-link--compact { padding: 2px; }
.bf-help-link__tip {
  position: absolute;
  z-index: 30;
  right: 0;
  top: 100%;
  margin-top: 6px;
  width: max-content;
  max-width: min(20rem, 80vw);
  padding: 6px 10px;
  border: 1px solid var(--bf-border-strong);
  border-radius: var(--bf-radius-md);
  background: var(--bf-surface-raised);
  color: var(--bf-text);
  box-shadow: var(--bf-shadow-lg);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.bf-help-link:hover .bf-help-link__tip,
.bf-help-link:focus-visible .bf-help-link__tip { visibility: visible; opacity: 1; }
.bf-help-link--unknown { color: var(--bf-tone-negative); }
.bf-help-link__error { font-weight: 600; }
.bf-project-head__help { flex: none; margin-left: var(--bf-space-2); }
@media (max-width: 599px) {
  .bf-project-head__help { margin-left: 0; }
  .bf-project-head__help .bf-help-link__tip { left: 0; right: auto; }
}
@media (max-width: 899px), (pointer: coarse) {
  .bf-help-link { min-height: 44px; box-sizing: border-box; }
  .bf-help-link--compact { min-width: 44px; justify-content: center; }
}
.bf-help-heading { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bf-space-2); }
.bf-help-heading > :is(h2, h3, h4) { margin: 0; }
.bf-help-line { display: flex; justify-content: flex-end; margin: 0 0 var(--bf-space-2); }

/* Search form (BfSearchForm) */
.bf-search-form { display: flex; flex: 1 1 20rem; gap: var(--bf-space-2); max-width: 36rem; }
.bf-search-form__input { flex: 1 1 auto; min-width: 0; }

@media (max-width: 720px) {
  .bf-journey { position: relative; }
  .bf-journey__route { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .bf-journey__station { position: static; display: grid; }
  .bf-journey__station::before { display: none; }
  .bf-journey__station > .bf-journey__link,
  .bf-journey__station > .bf-journey__help { grid-area: 1 / 1; }
  .bf-journey__help { position: static; justify-self: start; align-self: start; margin-left: calc(50% + 20px); }
  .bf-journey__help .bf-help-link { position: static; }
  .bf-journey__station > .bf-journey__help .bf-help-link__tip {
    top: auto;
    left: var(--bf-space-4);
    right: var(--bf-space-4);
    align-self: flex-start;
    width: auto;
    max-width: none;
    margin-top: 24px;
  }
  .bf-next-banner { padding: var(--bf-space-3) var(--bf-space-4); }
  .bf-next-banner__actions { width: 100%; }
  .bf-next-banner__actions .bf-button { flex: 1 1 auto; justify-content: center; }
  .bf-languages-card__row { grid-template-columns: minmax(0, 1fr) auto; }
  .bf-languages-card__reason { grid-column: 1 / -1; }
  .bf-languages-card__actions { grid-column: 1 / -1; justify-content: stretch; }
  .bf-languages-card__actions .bf-button { flex: 1 1 auto; justify-content: center; }
}

.bf-next-banner__message { margin: 0; font-size: 14px; font-weight: 600; }

.bf-checkbox-group { border: none; padding: 0; margin: 0; display: grid; gap: var(--bf-space-1); }
.bf-checkbox-group__option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--bf-space-2); cursor: pointer; }
.bf-checkbox-group__text { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bf-space-1); }
.bf-checkbox-group__hint { flex-basis: 100%; font-size: 13px; color: var(--bf-text-muted); }
@media (pointer: coarse) {
  .bf-checkbox-group__option { min-height: 44px; }
}

.bf-project-languages { display: grid; gap: var(--bf-space-3); }
.bf-project-languages__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--bf-space-2); }
.bf-project-languages__row { display: grid; grid-template-columns: minmax(10rem, 13rem) 7.5rem minmax(0, 1fr) auto; align-items: center; gap: var(--bf-space-2) var(--bf-space-4); padding: var(--bf-space-2) var(--bf-space-3); border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); background: var(--bf-surface); }
.bf-project-languages__name { font-weight: 600; overflow-wrap: anywhere; }
.bf-project-languages__source { min-width: 0; color: var(--bf-text-muted); overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .bf-project-languages__row { grid-template-columns: minmax(0, 1fr) auto; }
  .bf-project-languages__source { grid-column: 1 / -1; }
}
